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. SCIM provisioning is allowed
9128 for IdP testing (users created in DB only, not in Cognito).
9129 Authorization: Requires PERMISSION_ORG_WRITE.
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        /** List all organizations the authenticated user belongs to.
9161 Org-exempt: callable without org context (only requires valid JWT).
9162 Used by the admin org switcher to discover available orgs.
9163 Excludes expired sandbox organizations.
9164 Authorization: Authenticated user (no specific permission required).
9165*/
9166        pub async fn list_user_organizations(
9167            &mut self,
9168            request: impl tonic::IntoRequest<super::ListUserOrganizationsRequest>,
9169        ) -> std::result::Result<
9170            tonic::Response<super::ListUserOrganizationsResponse>,
9171            tonic::Status,
9172        > {
9173            self.inner
9174                .ready()
9175                .await
9176                .map_err(|e| {
9177                    tonic::Status::unknown(
9178                        format!("Service was not ready: {}", e.into()),
9179                    )
9180                })?;
9181            let codec = tonic_prost::ProstCodec::default();
9182            let path = http::uri::PathAndQuery::from_static(
9183                "/pidgr.v1.OrganizationService/ListUserOrganizations",
9184            );
9185            let mut req = request.into_request();
9186            req.extensions_mut()
9187                .insert(
9188                    GrpcMethod::new(
9189                        "pidgr.v1.OrganizationService",
9190                        "ListUserOrganizations",
9191                    ),
9192                );
9193            self.inner.unary(req, path, codec).await
9194        }
9195    }
9196}
9197/// Generated server implementations.
9198pub mod organization_service_server {
9199    #![allow(
9200        unused_variables,
9201        dead_code,
9202        missing_docs,
9203        clippy::wildcard_imports,
9204        clippy::let_unit_value,
9205    )]
9206    use tonic::codegen::*;
9207    /// Generated trait containing gRPC methods that should be implemented for use with OrganizationServiceServer.
9208    #[async_trait]
9209    pub trait OrganizationService: std::marker::Send + std::marker::Sync + 'static {
9210        /** Create a new organization with an initial admin user.
9211 Supports API key auth (service-to-service) and JWT auth (self-service onboarding).
9212*/
9213        async fn create_organization(
9214            &self,
9215            request: tonic::Request<super::CreateOrganizationRequest>,
9216        ) -> std::result::Result<
9217            tonic::Response<super::CreateOrganizationResponse>,
9218            tonic::Status,
9219        >;
9220        /** Retrieve the organization for the authenticated user.
9221 Authorization: Requires PERMISSION_ORG_READ.
9222*/
9223        async fn get_organization(
9224            &self,
9225            request: tonic::Request<super::GetOrganizationRequest>,
9226        ) -> std::result::Result<
9227            tonic::Response<super::GetOrganizationResponse>,
9228            tonic::Status,
9229        >;
9230        /** Update organization settings (name, default workflow, industry, company size).
9231 Authorization: Requires PERMISSION_ORG_WRITE.
9232*/
9233        async fn update_organization(
9234            &self,
9235            request: tonic::Request<super::UpdateOrganizationRequest>,
9236        ) -> std::result::Result<
9237            tonic::Response<super::UpdateOrganizationResponse>,
9238            tonic::Status,
9239        >;
9240        /** Replace all SSO attribute mappings for the organization.
9241 Authorization: Requires PERMISSION_ORG_WRITE.
9242*/
9243        async fn update_sso_attribute_mappings(
9244            &self,
9245            request: tonic::Request<super::UpdateSsoAttributeMappingsRequest>,
9246        ) -> std::result::Result<
9247            tonic::Response<super::UpdateSsoAttributeMappingsResponse>,
9248            tonic::Status,
9249        >;
9250        /** Rotate the analytics salt and optionally increase the bucket count for k-anonymization.
9251 Authorization: Requires PERMISSION_PRIVACY_WRITE.
9252*/
9253        async fn rotate_analytics_salt(
9254            &self,
9255            request: tonic::Request<super::RotateAnalyticsSaltRequest>,
9256        ) -> std::result::Result<
9257            tonic::Response<super::RotateAnalyticsSaltResponse>,
9258            tonic::Status,
9259        >;
9260        /** Update the differential privacy epsilon parameter.
9261 Authorization: Requires PERMISSION_PRIVACY_WRITE.
9262*/
9263        async fn update_analytics_epsilon(
9264            &self,
9265            request: tonic::Request<super::UpdateAnalyticsEpsilonRequest>,
9266        ) -> std::result::Result<
9267            tonic::Response<super::UpdateAnalyticsEpsilonResponse>,
9268            tonic::Status,
9269        >;
9270        /** Create a sandbox organization for testing configurations.
9271 Sandbox orgs auto-delete after expires_at. SCIM provisioning is allowed
9272 for IdP testing (users created in DB only, not in Cognito).
9273 Authorization: Requires PERMISSION_ORG_WRITE.
9274*/
9275        async fn create_sandbox_organization(
9276            &self,
9277            request: tonic::Request<super::CreateSandboxOrganizationRequest>,
9278        ) -> std::result::Result<
9279            tonic::Response<super::CreateSandboxOrganizationResponse>,
9280            tonic::Status,
9281        >;
9282        /** List all organizations the authenticated user belongs to.
9283 Org-exempt: callable without org context (only requires valid JWT).
9284 Used by the admin org switcher to discover available orgs.
9285 Excludes expired sandbox organizations.
9286 Authorization: Authenticated user (no specific permission required).
9287*/
9288        async fn list_user_organizations(
9289            &self,
9290            request: tonic::Request<super::ListUserOrganizationsRequest>,
9291        ) -> std::result::Result<
9292            tonic::Response<super::ListUserOrganizationsResponse>,
9293            tonic::Status,
9294        >;
9295    }
9296    /** Manages organizations (tenants) in the Pidgr platform.
9297 Most RPCs operate within the caller's org (extracted from JWT).
9298 CreateOrganization supports API key auth or JWT auth (self-service onboarding).
9299*/
9300    #[derive(Debug)]
9301    pub struct OrganizationServiceServer<T> {
9302        inner: Arc<T>,
9303        accept_compression_encodings: EnabledCompressionEncodings,
9304        send_compression_encodings: EnabledCompressionEncodings,
9305        max_decoding_message_size: Option<usize>,
9306        max_encoding_message_size: Option<usize>,
9307    }
9308    impl<T> OrganizationServiceServer<T> {
9309        pub fn new(inner: T) -> Self {
9310            Self::from_arc(Arc::new(inner))
9311        }
9312        pub fn from_arc(inner: Arc<T>) -> Self {
9313            Self {
9314                inner,
9315                accept_compression_encodings: Default::default(),
9316                send_compression_encodings: Default::default(),
9317                max_decoding_message_size: None,
9318                max_encoding_message_size: None,
9319            }
9320        }
9321        pub fn with_interceptor<F>(
9322            inner: T,
9323            interceptor: F,
9324        ) -> InterceptedService<Self, F>
9325        where
9326            F: tonic::service::Interceptor,
9327        {
9328            InterceptedService::new(Self::new(inner), interceptor)
9329        }
9330        /// Enable decompressing requests with the given encoding.
9331        #[must_use]
9332        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9333            self.accept_compression_encodings.enable(encoding);
9334            self
9335        }
9336        /// Compress responses with the given encoding, if the client supports it.
9337        #[must_use]
9338        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9339            self.send_compression_encodings.enable(encoding);
9340            self
9341        }
9342        /// Limits the maximum size of a decoded message.
9343        ///
9344        /// Default: `4MB`
9345        #[must_use]
9346        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9347            self.max_decoding_message_size = Some(limit);
9348            self
9349        }
9350        /// Limits the maximum size of an encoded message.
9351        ///
9352        /// Default: `usize::MAX`
9353        #[must_use]
9354        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9355            self.max_encoding_message_size = Some(limit);
9356            self
9357        }
9358    }
9359    impl<T, B> tonic::codegen::Service<http::Request<B>> for OrganizationServiceServer<T>
9360    where
9361        T: OrganizationService,
9362        B: Body + std::marker::Send + 'static,
9363        B::Error: Into<StdError> + std::marker::Send + 'static,
9364    {
9365        type Response = http::Response<tonic::body::Body>;
9366        type Error = std::convert::Infallible;
9367        type Future = BoxFuture<Self::Response, Self::Error>;
9368        fn poll_ready(
9369            &mut self,
9370            _cx: &mut Context<'_>,
9371        ) -> Poll<std::result::Result<(), Self::Error>> {
9372            Poll::Ready(Ok(()))
9373        }
9374        fn call(&mut self, req: http::Request<B>) -> Self::Future {
9375            match req.uri().path() {
9376                "/pidgr.v1.OrganizationService/CreateOrganization" => {
9377                    #[allow(non_camel_case_types)]
9378                    struct CreateOrganizationSvc<T: OrganizationService>(pub Arc<T>);
9379                    impl<
9380                        T: OrganizationService,
9381                    > tonic::server::UnaryService<super::CreateOrganizationRequest>
9382                    for CreateOrganizationSvc<T> {
9383                        type Response = super::CreateOrganizationResponse;
9384                        type Future = BoxFuture<
9385                            tonic::Response<Self::Response>,
9386                            tonic::Status,
9387                        >;
9388                        fn call(
9389                            &mut self,
9390                            request: tonic::Request<super::CreateOrganizationRequest>,
9391                        ) -> Self::Future {
9392                            let inner = Arc::clone(&self.0);
9393                            let fut = async move {
9394                                <T as OrganizationService>::create_organization(
9395                                        &inner,
9396                                        request,
9397                                    )
9398                                    .await
9399                            };
9400                            Box::pin(fut)
9401                        }
9402                    }
9403                    let accept_compression_encodings = self.accept_compression_encodings;
9404                    let send_compression_encodings = self.send_compression_encodings;
9405                    let max_decoding_message_size = self.max_decoding_message_size;
9406                    let max_encoding_message_size = self.max_encoding_message_size;
9407                    let inner = self.inner.clone();
9408                    let fut = async move {
9409                        let method = CreateOrganizationSvc(inner);
9410                        let codec = tonic_prost::ProstCodec::default();
9411                        let mut grpc = tonic::server::Grpc::new(codec)
9412                            .apply_compression_config(
9413                                accept_compression_encodings,
9414                                send_compression_encodings,
9415                            )
9416                            .apply_max_message_size_config(
9417                                max_decoding_message_size,
9418                                max_encoding_message_size,
9419                            );
9420                        let res = grpc.unary(method, req).await;
9421                        Ok(res)
9422                    };
9423                    Box::pin(fut)
9424                }
9425                "/pidgr.v1.OrganizationService/GetOrganization" => {
9426                    #[allow(non_camel_case_types)]
9427                    struct GetOrganizationSvc<T: OrganizationService>(pub Arc<T>);
9428                    impl<
9429                        T: OrganizationService,
9430                    > tonic::server::UnaryService<super::GetOrganizationRequest>
9431                    for GetOrganizationSvc<T> {
9432                        type Response = super::GetOrganizationResponse;
9433                        type Future = BoxFuture<
9434                            tonic::Response<Self::Response>,
9435                            tonic::Status,
9436                        >;
9437                        fn call(
9438                            &mut self,
9439                            request: tonic::Request<super::GetOrganizationRequest>,
9440                        ) -> Self::Future {
9441                            let inner = Arc::clone(&self.0);
9442                            let fut = async move {
9443                                <T as OrganizationService>::get_organization(
9444                                        &inner,
9445                                        request,
9446                                    )
9447                                    .await
9448                            };
9449                            Box::pin(fut)
9450                        }
9451                    }
9452                    let accept_compression_encodings = self.accept_compression_encodings;
9453                    let send_compression_encodings = self.send_compression_encodings;
9454                    let max_decoding_message_size = self.max_decoding_message_size;
9455                    let max_encoding_message_size = self.max_encoding_message_size;
9456                    let inner = self.inner.clone();
9457                    let fut = async move {
9458                        let method = GetOrganizationSvc(inner);
9459                        let codec = tonic_prost::ProstCodec::default();
9460                        let mut grpc = tonic::server::Grpc::new(codec)
9461                            .apply_compression_config(
9462                                accept_compression_encodings,
9463                                send_compression_encodings,
9464                            )
9465                            .apply_max_message_size_config(
9466                                max_decoding_message_size,
9467                                max_encoding_message_size,
9468                            );
9469                        let res = grpc.unary(method, req).await;
9470                        Ok(res)
9471                    };
9472                    Box::pin(fut)
9473                }
9474                "/pidgr.v1.OrganizationService/UpdateOrganization" => {
9475                    #[allow(non_camel_case_types)]
9476                    struct UpdateOrganizationSvc<T: OrganizationService>(pub Arc<T>);
9477                    impl<
9478                        T: OrganizationService,
9479                    > tonic::server::UnaryService<super::UpdateOrganizationRequest>
9480                    for UpdateOrganizationSvc<T> {
9481                        type Response = super::UpdateOrganizationResponse;
9482                        type Future = BoxFuture<
9483                            tonic::Response<Self::Response>,
9484                            tonic::Status,
9485                        >;
9486                        fn call(
9487                            &mut self,
9488                            request: tonic::Request<super::UpdateOrganizationRequest>,
9489                        ) -> Self::Future {
9490                            let inner = Arc::clone(&self.0);
9491                            let fut = async move {
9492                                <T as OrganizationService>::update_organization(
9493                                        &inner,
9494                                        request,
9495                                    )
9496                                    .await
9497                            };
9498                            Box::pin(fut)
9499                        }
9500                    }
9501                    let accept_compression_encodings = self.accept_compression_encodings;
9502                    let send_compression_encodings = self.send_compression_encodings;
9503                    let max_decoding_message_size = self.max_decoding_message_size;
9504                    let max_encoding_message_size = self.max_encoding_message_size;
9505                    let inner = self.inner.clone();
9506                    let fut = async move {
9507                        let method = UpdateOrganizationSvc(inner);
9508                        let codec = tonic_prost::ProstCodec::default();
9509                        let mut grpc = tonic::server::Grpc::new(codec)
9510                            .apply_compression_config(
9511                                accept_compression_encodings,
9512                                send_compression_encodings,
9513                            )
9514                            .apply_max_message_size_config(
9515                                max_decoding_message_size,
9516                                max_encoding_message_size,
9517                            );
9518                        let res = grpc.unary(method, req).await;
9519                        Ok(res)
9520                    };
9521                    Box::pin(fut)
9522                }
9523                "/pidgr.v1.OrganizationService/UpdateSsoAttributeMappings" => {
9524                    #[allow(non_camel_case_types)]
9525                    struct UpdateSsoAttributeMappingsSvc<T: OrganizationService>(
9526                        pub Arc<T>,
9527                    );
9528                    impl<
9529                        T: OrganizationService,
9530                    > tonic::server::UnaryService<
9531                        super::UpdateSsoAttributeMappingsRequest,
9532                    > for UpdateSsoAttributeMappingsSvc<T> {
9533                        type Response = super::UpdateSsoAttributeMappingsResponse;
9534                        type Future = BoxFuture<
9535                            tonic::Response<Self::Response>,
9536                            tonic::Status,
9537                        >;
9538                        fn call(
9539                            &mut self,
9540                            request: tonic::Request<
9541                                super::UpdateSsoAttributeMappingsRequest,
9542                            >,
9543                        ) -> Self::Future {
9544                            let inner = Arc::clone(&self.0);
9545                            let fut = async move {
9546                                <T as OrganizationService>::update_sso_attribute_mappings(
9547                                        &inner,
9548                                        request,
9549                                    )
9550                                    .await
9551                            };
9552                            Box::pin(fut)
9553                        }
9554                    }
9555                    let accept_compression_encodings = self.accept_compression_encodings;
9556                    let send_compression_encodings = self.send_compression_encodings;
9557                    let max_decoding_message_size = self.max_decoding_message_size;
9558                    let max_encoding_message_size = self.max_encoding_message_size;
9559                    let inner = self.inner.clone();
9560                    let fut = async move {
9561                        let method = UpdateSsoAttributeMappingsSvc(inner);
9562                        let codec = tonic_prost::ProstCodec::default();
9563                        let mut grpc = tonic::server::Grpc::new(codec)
9564                            .apply_compression_config(
9565                                accept_compression_encodings,
9566                                send_compression_encodings,
9567                            )
9568                            .apply_max_message_size_config(
9569                                max_decoding_message_size,
9570                                max_encoding_message_size,
9571                            );
9572                        let res = grpc.unary(method, req).await;
9573                        Ok(res)
9574                    };
9575                    Box::pin(fut)
9576                }
9577                "/pidgr.v1.OrganizationService/RotateAnalyticsSalt" => {
9578                    #[allow(non_camel_case_types)]
9579                    struct RotateAnalyticsSaltSvc<T: OrganizationService>(pub Arc<T>);
9580                    impl<
9581                        T: OrganizationService,
9582                    > tonic::server::UnaryService<super::RotateAnalyticsSaltRequest>
9583                    for RotateAnalyticsSaltSvc<T> {
9584                        type Response = super::RotateAnalyticsSaltResponse;
9585                        type Future = BoxFuture<
9586                            tonic::Response<Self::Response>,
9587                            tonic::Status,
9588                        >;
9589                        fn call(
9590                            &mut self,
9591                            request: tonic::Request<super::RotateAnalyticsSaltRequest>,
9592                        ) -> Self::Future {
9593                            let inner = Arc::clone(&self.0);
9594                            let fut = async move {
9595                                <T as OrganizationService>::rotate_analytics_salt(
9596                                        &inner,
9597                                        request,
9598                                    )
9599                                    .await
9600                            };
9601                            Box::pin(fut)
9602                        }
9603                    }
9604                    let accept_compression_encodings = self.accept_compression_encodings;
9605                    let send_compression_encodings = self.send_compression_encodings;
9606                    let max_decoding_message_size = self.max_decoding_message_size;
9607                    let max_encoding_message_size = self.max_encoding_message_size;
9608                    let inner = self.inner.clone();
9609                    let fut = async move {
9610                        let method = RotateAnalyticsSaltSvc(inner);
9611                        let codec = tonic_prost::ProstCodec::default();
9612                        let mut grpc = tonic::server::Grpc::new(codec)
9613                            .apply_compression_config(
9614                                accept_compression_encodings,
9615                                send_compression_encodings,
9616                            )
9617                            .apply_max_message_size_config(
9618                                max_decoding_message_size,
9619                                max_encoding_message_size,
9620                            );
9621                        let res = grpc.unary(method, req).await;
9622                        Ok(res)
9623                    };
9624                    Box::pin(fut)
9625                }
9626                "/pidgr.v1.OrganizationService/UpdateAnalyticsEpsilon" => {
9627                    #[allow(non_camel_case_types)]
9628                    struct UpdateAnalyticsEpsilonSvc<T: OrganizationService>(pub Arc<T>);
9629                    impl<
9630                        T: OrganizationService,
9631                    > tonic::server::UnaryService<super::UpdateAnalyticsEpsilonRequest>
9632                    for UpdateAnalyticsEpsilonSvc<T> {
9633                        type Response = super::UpdateAnalyticsEpsilonResponse;
9634                        type Future = BoxFuture<
9635                            tonic::Response<Self::Response>,
9636                            tonic::Status,
9637                        >;
9638                        fn call(
9639                            &mut self,
9640                            request: tonic::Request<super::UpdateAnalyticsEpsilonRequest>,
9641                        ) -> Self::Future {
9642                            let inner = Arc::clone(&self.0);
9643                            let fut = async move {
9644                                <T as OrganizationService>::update_analytics_epsilon(
9645                                        &inner,
9646                                        request,
9647                                    )
9648                                    .await
9649                            };
9650                            Box::pin(fut)
9651                        }
9652                    }
9653                    let accept_compression_encodings = self.accept_compression_encodings;
9654                    let send_compression_encodings = self.send_compression_encodings;
9655                    let max_decoding_message_size = self.max_decoding_message_size;
9656                    let max_encoding_message_size = self.max_encoding_message_size;
9657                    let inner = self.inner.clone();
9658                    let fut = async move {
9659                        let method = UpdateAnalyticsEpsilonSvc(inner);
9660                        let codec = tonic_prost::ProstCodec::default();
9661                        let mut grpc = tonic::server::Grpc::new(codec)
9662                            .apply_compression_config(
9663                                accept_compression_encodings,
9664                                send_compression_encodings,
9665                            )
9666                            .apply_max_message_size_config(
9667                                max_decoding_message_size,
9668                                max_encoding_message_size,
9669                            );
9670                        let res = grpc.unary(method, req).await;
9671                        Ok(res)
9672                    };
9673                    Box::pin(fut)
9674                }
9675                "/pidgr.v1.OrganizationService/CreateSandboxOrganization" => {
9676                    #[allow(non_camel_case_types)]
9677                    struct CreateSandboxOrganizationSvc<T: OrganizationService>(
9678                        pub Arc<T>,
9679                    );
9680                    impl<
9681                        T: OrganizationService,
9682                    > tonic::server::UnaryService<
9683                        super::CreateSandboxOrganizationRequest,
9684                    > for CreateSandboxOrganizationSvc<T> {
9685                        type Response = super::CreateSandboxOrganizationResponse;
9686                        type Future = BoxFuture<
9687                            tonic::Response<Self::Response>,
9688                            tonic::Status,
9689                        >;
9690                        fn call(
9691                            &mut self,
9692                            request: tonic::Request<
9693                                super::CreateSandboxOrganizationRequest,
9694                            >,
9695                        ) -> Self::Future {
9696                            let inner = Arc::clone(&self.0);
9697                            let fut = async move {
9698                                <T as OrganizationService>::create_sandbox_organization(
9699                                        &inner,
9700                                        request,
9701                                    )
9702                                    .await
9703                            };
9704                            Box::pin(fut)
9705                        }
9706                    }
9707                    let accept_compression_encodings = self.accept_compression_encodings;
9708                    let send_compression_encodings = self.send_compression_encodings;
9709                    let max_decoding_message_size = self.max_decoding_message_size;
9710                    let max_encoding_message_size = self.max_encoding_message_size;
9711                    let inner = self.inner.clone();
9712                    let fut = async move {
9713                        let method = CreateSandboxOrganizationSvc(inner);
9714                        let codec = tonic_prost::ProstCodec::default();
9715                        let mut grpc = tonic::server::Grpc::new(codec)
9716                            .apply_compression_config(
9717                                accept_compression_encodings,
9718                                send_compression_encodings,
9719                            )
9720                            .apply_max_message_size_config(
9721                                max_decoding_message_size,
9722                                max_encoding_message_size,
9723                            );
9724                        let res = grpc.unary(method, req).await;
9725                        Ok(res)
9726                    };
9727                    Box::pin(fut)
9728                }
9729                "/pidgr.v1.OrganizationService/ListUserOrganizations" => {
9730                    #[allow(non_camel_case_types)]
9731                    struct ListUserOrganizationsSvc<T: OrganizationService>(pub Arc<T>);
9732                    impl<
9733                        T: OrganizationService,
9734                    > tonic::server::UnaryService<super::ListUserOrganizationsRequest>
9735                    for ListUserOrganizationsSvc<T> {
9736                        type Response = super::ListUserOrganizationsResponse;
9737                        type Future = BoxFuture<
9738                            tonic::Response<Self::Response>,
9739                            tonic::Status,
9740                        >;
9741                        fn call(
9742                            &mut self,
9743                            request: tonic::Request<super::ListUserOrganizationsRequest>,
9744                        ) -> Self::Future {
9745                            let inner = Arc::clone(&self.0);
9746                            let fut = async move {
9747                                <T as OrganizationService>::list_user_organizations(
9748                                        &inner,
9749                                        request,
9750                                    )
9751                                    .await
9752                            };
9753                            Box::pin(fut)
9754                        }
9755                    }
9756                    let accept_compression_encodings = self.accept_compression_encodings;
9757                    let send_compression_encodings = self.send_compression_encodings;
9758                    let max_decoding_message_size = self.max_decoding_message_size;
9759                    let max_encoding_message_size = self.max_encoding_message_size;
9760                    let inner = self.inner.clone();
9761                    let fut = async move {
9762                        let method = ListUserOrganizationsSvc(inner);
9763                        let codec = tonic_prost::ProstCodec::default();
9764                        let mut grpc = tonic::server::Grpc::new(codec)
9765                            .apply_compression_config(
9766                                accept_compression_encodings,
9767                                send_compression_encodings,
9768                            )
9769                            .apply_max_message_size_config(
9770                                max_decoding_message_size,
9771                                max_encoding_message_size,
9772                            );
9773                        let res = grpc.unary(method, req).await;
9774                        Ok(res)
9775                    };
9776                    Box::pin(fut)
9777                }
9778                _ => {
9779                    Box::pin(async move {
9780                        let mut response = http::Response::new(
9781                            tonic::body::Body::default(),
9782                        );
9783                        let headers = response.headers_mut();
9784                        headers
9785                            .insert(
9786                                tonic::Status::GRPC_STATUS,
9787                                (tonic::Code::Unimplemented as i32).into(),
9788                            );
9789                        headers
9790                            .insert(
9791                                http::header::CONTENT_TYPE,
9792                                tonic::metadata::GRPC_CONTENT_TYPE,
9793                            );
9794                        Ok(response)
9795                    })
9796                }
9797            }
9798        }
9799    }
9800    impl<T> Clone for OrganizationServiceServer<T> {
9801        fn clone(&self) -> Self {
9802            let inner = self.inner.clone();
9803            Self {
9804                inner,
9805                accept_compression_encodings: self.accept_compression_encodings,
9806                send_compression_encodings: self.send_compression_encodings,
9807                max_decoding_message_size: self.max_decoding_message_size,
9808                max_encoding_message_size: self.max_encoding_message_size,
9809            }
9810        }
9811    }
9812    /// Generated gRPC service name
9813    pub const SERVICE_NAME: &str = "pidgr.v1.OrganizationService";
9814    impl<T> tonic::server::NamedService for OrganizationServiceServer<T> {
9815        const NAME: &'static str = SERVICE_NAME;
9816    }
9817}
9818/// Generated client implementations.
9819pub mod render_service_client {
9820    #![allow(
9821        unused_variables,
9822        dead_code,
9823        missing_docs,
9824        clippy::wildcard_imports,
9825        clippy::let_unit_value,
9826    )]
9827    use tonic::codegen::*;
9828    use tonic::codegen::http::Uri;
9829    /** Internal service for batch template rendering.
9830*/
9831    #[derive(Debug, Clone)]
9832    pub struct RenderServiceClient<T> {
9833        inner: tonic::client::Grpc<T>,
9834    }
9835    impl RenderServiceClient<tonic::transport::Channel> {
9836        /// Attempt to create a new client by connecting to a given endpoint.
9837        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
9838        where
9839            D: TryInto<tonic::transport::Endpoint>,
9840            D::Error: Into<StdError>,
9841        {
9842            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
9843            Ok(Self::new(conn))
9844        }
9845    }
9846    impl<T> RenderServiceClient<T>
9847    where
9848        T: tonic::client::GrpcService<tonic::body::Body>,
9849        T::Error: Into<StdError>,
9850        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
9851        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
9852    {
9853        pub fn new(inner: T) -> Self {
9854            let inner = tonic::client::Grpc::new(inner);
9855            Self { inner }
9856        }
9857        pub fn with_origin(inner: T, origin: Uri) -> Self {
9858            let inner = tonic::client::Grpc::with_origin(inner, origin);
9859            Self { inner }
9860        }
9861        pub fn with_interceptor<F>(
9862            inner: T,
9863            interceptor: F,
9864        ) -> RenderServiceClient<InterceptedService<T, F>>
9865        where
9866            F: tonic::service::Interceptor,
9867            T::ResponseBody: Default,
9868            T: tonic::codegen::Service<
9869                http::Request<tonic::body::Body>,
9870                Response = http::Response<
9871                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
9872                >,
9873            >,
9874            <T as tonic::codegen::Service<
9875                http::Request<tonic::body::Body>,
9876            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
9877        {
9878            RenderServiceClient::new(InterceptedService::new(inner, interceptor))
9879        }
9880        /// Compress requests with the given encoding.
9881        ///
9882        /// This requires the server to support it otherwise it might respond with an
9883        /// error.
9884        #[must_use]
9885        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9886            self.inner = self.inner.send_compressed(encoding);
9887            self
9888        }
9889        /// Enable decompressing responses.
9890        #[must_use]
9891        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9892            self.inner = self.inner.accept_compressed(encoding);
9893            self
9894        }
9895        /// Limits the maximum size of a decoded message.
9896        ///
9897        /// Default: `4MB`
9898        #[must_use]
9899        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9900            self.inner = self.inner.max_decoding_message_size(limit);
9901            self
9902        }
9903        /// Limits the maximum size of an encoded message.
9904        ///
9905        /// Default: `usize::MAX`
9906        #[must_use]
9907        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9908            self.inner = self.inner.max_encoding_message_size(limit);
9909            self
9910        }
9911        /** Render a template for multiple users, streaming results as each completes.
9912 Authorization: Internal server-to-server only. Not exposed to external clients.
9913*/
9914        pub async fn render_batch(
9915            &mut self,
9916            request: impl tonic::IntoRequest<super::RenderBatchRequest>,
9917        ) -> std::result::Result<
9918            tonic::Response<tonic::codec::Streaming<super::RenderBatchResponse>>,
9919            tonic::Status,
9920        > {
9921            self.inner
9922                .ready()
9923                .await
9924                .map_err(|e| {
9925                    tonic::Status::unknown(
9926                        format!("Service was not ready: {}", e.into()),
9927                    )
9928                })?;
9929            let codec = tonic_prost::ProstCodec::default();
9930            let path = http::uri::PathAndQuery::from_static(
9931                "/pidgr.v1.RenderService/RenderBatch",
9932            );
9933            let mut req = request.into_request();
9934            req.extensions_mut()
9935                .insert(GrpcMethod::new("pidgr.v1.RenderService", "RenderBatch"));
9936            self.inner.server_streaming(req, path, codec).await
9937        }
9938    }
9939}
9940/// Generated server implementations.
9941pub mod render_service_server {
9942    #![allow(
9943        unused_variables,
9944        dead_code,
9945        missing_docs,
9946        clippy::wildcard_imports,
9947        clippy::let_unit_value,
9948    )]
9949    use tonic::codegen::*;
9950    /// Generated trait containing gRPC methods that should be implemented for use with RenderServiceServer.
9951    #[async_trait]
9952    pub trait RenderService: std::marker::Send + std::marker::Sync + 'static {
9953        /// Server streaming response type for the RenderBatch method.
9954        type RenderBatchStream: tonic::codegen::tokio_stream::Stream<
9955                Item = std::result::Result<super::RenderBatchResponse, tonic::Status>,
9956            >
9957            + std::marker::Send
9958            + 'static;
9959        /** Render a template for multiple users, streaming results as each completes.
9960 Authorization: Internal server-to-server only. Not exposed to external clients.
9961*/
9962        async fn render_batch(
9963            &self,
9964            request: tonic::Request<super::RenderBatchRequest>,
9965        ) -> std::result::Result<
9966            tonic::Response<Self::RenderBatchStream>,
9967            tonic::Status,
9968        >;
9969    }
9970    /** Internal service for batch template rendering.
9971*/
9972    #[derive(Debug)]
9973    pub struct RenderServiceServer<T> {
9974        inner: Arc<T>,
9975        accept_compression_encodings: EnabledCompressionEncodings,
9976        send_compression_encodings: EnabledCompressionEncodings,
9977        max_decoding_message_size: Option<usize>,
9978        max_encoding_message_size: Option<usize>,
9979    }
9980    impl<T> RenderServiceServer<T> {
9981        pub fn new(inner: T) -> Self {
9982            Self::from_arc(Arc::new(inner))
9983        }
9984        pub fn from_arc(inner: Arc<T>) -> Self {
9985            Self {
9986                inner,
9987                accept_compression_encodings: Default::default(),
9988                send_compression_encodings: Default::default(),
9989                max_decoding_message_size: None,
9990                max_encoding_message_size: None,
9991            }
9992        }
9993        pub fn with_interceptor<F>(
9994            inner: T,
9995            interceptor: F,
9996        ) -> InterceptedService<Self, F>
9997        where
9998            F: tonic::service::Interceptor,
9999        {
10000            InterceptedService::new(Self::new(inner), interceptor)
10001        }
10002        /// Enable decompressing requests with the given encoding.
10003        #[must_use]
10004        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10005            self.accept_compression_encodings.enable(encoding);
10006            self
10007        }
10008        /// Compress responses with the given encoding, if the client supports it.
10009        #[must_use]
10010        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10011            self.send_compression_encodings.enable(encoding);
10012            self
10013        }
10014        /// Limits the maximum size of a decoded message.
10015        ///
10016        /// Default: `4MB`
10017        #[must_use]
10018        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10019            self.max_decoding_message_size = Some(limit);
10020            self
10021        }
10022        /// Limits the maximum size of an encoded message.
10023        ///
10024        /// Default: `usize::MAX`
10025        #[must_use]
10026        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10027            self.max_encoding_message_size = Some(limit);
10028            self
10029        }
10030    }
10031    impl<T, B> tonic::codegen::Service<http::Request<B>> for RenderServiceServer<T>
10032    where
10033        T: RenderService,
10034        B: Body + std::marker::Send + 'static,
10035        B::Error: Into<StdError> + std::marker::Send + 'static,
10036    {
10037        type Response = http::Response<tonic::body::Body>;
10038        type Error = std::convert::Infallible;
10039        type Future = BoxFuture<Self::Response, Self::Error>;
10040        fn poll_ready(
10041            &mut self,
10042            _cx: &mut Context<'_>,
10043        ) -> Poll<std::result::Result<(), Self::Error>> {
10044            Poll::Ready(Ok(()))
10045        }
10046        fn call(&mut self, req: http::Request<B>) -> Self::Future {
10047            match req.uri().path() {
10048                "/pidgr.v1.RenderService/RenderBatch" => {
10049                    #[allow(non_camel_case_types)]
10050                    struct RenderBatchSvc<T: RenderService>(pub Arc<T>);
10051                    impl<
10052                        T: RenderService,
10053                    > tonic::server::ServerStreamingService<super::RenderBatchRequest>
10054                    for RenderBatchSvc<T> {
10055                        type Response = super::RenderBatchResponse;
10056                        type ResponseStream = T::RenderBatchStream;
10057                        type Future = BoxFuture<
10058                            tonic::Response<Self::ResponseStream>,
10059                            tonic::Status,
10060                        >;
10061                        fn call(
10062                            &mut self,
10063                            request: tonic::Request<super::RenderBatchRequest>,
10064                        ) -> Self::Future {
10065                            let inner = Arc::clone(&self.0);
10066                            let fut = async move {
10067                                <T as RenderService>::render_batch(&inner, request).await
10068                            };
10069                            Box::pin(fut)
10070                        }
10071                    }
10072                    let accept_compression_encodings = self.accept_compression_encodings;
10073                    let send_compression_encodings = self.send_compression_encodings;
10074                    let max_decoding_message_size = self.max_decoding_message_size;
10075                    let max_encoding_message_size = self.max_encoding_message_size;
10076                    let inner = self.inner.clone();
10077                    let fut = async move {
10078                        let method = RenderBatchSvc(inner);
10079                        let codec = tonic_prost::ProstCodec::default();
10080                        let mut grpc = tonic::server::Grpc::new(codec)
10081                            .apply_compression_config(
10082                                accept_compression_encodings,
10083                                send_compression_encodings,
10084                            )
10085                            .apply_max_message_size_config(
10086                                max_decoding_message_size,
10087                                max_encoding_message_size,
10088                            );
10089                        let res = grpc.server_streaming(method, req).await;
10090                        Ok(res)
10091                    };
10092                    Box::pin(fut)
10093                }
10094                _ => {
10095                    Box::pin(async move {
10096                        let mut response = http::Response::new(
10097                            tonic::body::Body::default(),
10098                        );
10099                        let headers = response.headers_mut();
10100                        headers
10101                            .insert(
10102                                tonic::Status::GRPC_STATUS,
10103                                (tonic::Code::Unimplemented as i32).into(),
10104                            );
10105                        headers
10106                            .insert(
10107                                http::header::CONTENT_TYPE,
10108                                tonic::metadata::GRPC_CONTENT_TYPE,
10109                            );
10110                        Ok(response)
10111                    })
10112                }
10113            }
10114        }
10115    }
10116    impl<T> Clone for RenderServiceServer<T> {
10117        fn clone(&self) -> Self {
10118            let inner = self.inner.clone();
10119            Self {
10120                inner,
10121                accept_compression_encodings: self.accept_compression_encodings,
10122                send_compression_encodings: self.send_compression_encodings,
10123                max_decoding_message_size: self.max_decoding_message_size,
10124                max_encoding_message_size: self.max_encoding_message_size,
10125            }
10126        }
10127    }
10128    /// Generated gRPC service name
10129    pub const SERVICE_NAME: &str = "pidgr.v1.RenderService";
10130    impl<T> tonic::server::NamedService for RenderServiceServer<T> {
10131        const NAME: &'static str = SERVICE_NAME;
10132    }
10133}
10134/// Generated client implementations.
10135pub mod replay_service_client {
10136    #![allow(
10137        unused_variables,
10138        dead_code,
10139        missing_docs,
10140        clippy::wildcard_imports,
10141        clippy::let_unit_value,
10142    )]
10143    use tonic::codegen::*;
10144    use tonic::codegen::http::Uri;
10145    /** Proxies the analytics provider's session recording API, keeping credentials server-side.
10146 All data is fetched from the analytics provider on demand; no recording data is stored in pidgr.
10147*/
10148    #[derive(Debug, Clone)]
10149    pub struct ReplayServiceClient<T> {
10150        inner: tonic::client::Grpc<T>,
10151    }
10152    impl ReplayServiceClient<tonic::transport::Channel> {
10153        /// Attempt to create a new client by connecting to a given endpoint.
10154        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
10155        where
10156            D: TryInto<tonic::transport::Endpoint>,
10157            D::Error: Into<StdError>,
10158        {
10159            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
10160            Ok(Self::new(conn))
10161        }
10162    }
10163    impl<T> ReplayServiceClient<T>
10164    where
10165        T: tonic::client::GrpcService<tonic::body::Body>,
10166        T::Error: Into<StdError>,
10167        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
10168        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
10169    {
10170        pub fn new(inner: T) -> Self {
10171            let inner = tonic::client::Grpc::new(inner);
10172            Self { inner }
10173        }
10174        pub fn with_origin(inner: T, origin: Uri) -> Self {
10175            let inner = tonic::client::Grpc::with_origin(inner, origin);
10176            Self { inner }
10177        }
10178        pub fn with_interceptor<F>(
10179            inner: T,
10180            interceptor: F,
10181        ) -> ReplayServiceClient<InterceptedService<T, F>>
10182        where
10183            F: tonic::service::Interceptor,
10184            T::ResponseBody: Default,
10185            T: tonic::codegen::Service<
10186                http::Request<tonic::body::Body>,
10187                Response = http::Response<
10188                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
10189                >,
10190            >,
10191            <T as tonic::codegen::Service<
10192                http::Request<tonic::body::Body>,
10193            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
10194        {
10195            ReplayServiceClient::new(InterceptedService::new(inner, interceptor))
10196        }
10197        /// Compress requests with the given encoding.
10198        ///
10199        /// This requires the server to support it otherwise it might respond with an
10200        /// error.
10201        #[must_use]
10202        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10203            self.inner = self.inner.send_compressed(encoding);
10204            self
10205        }
10206        /// Enable decompressing responses.
10207        #[must_use]
10208        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10209            self.inner = self.inner.accept_compressed(encoding);
10210            self
10211        }
10212        /// Limits the maximum size of a decoded message.
10213        ///
10214        /// Default: `4MB`
10215        #[must_use]
10216        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10217            self.inner = self.inner.max_decoding_message_size(limit);
10218            self
10219        }
10220        /// Limits the maximum size of an encoded message.
10221        ///
10222        /// Default: `usize::MAX`
10223        #[must_use]
10224        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10225            self.inner = self.inner.max_encoding_message_size(limit);
10226            self
10227        }
10228        /** List recent session recordings with optional campaign and time range filters.
10229 Authorization: Requires CAMPAIGNS_READ permission.
10230*/
10231        pub async fn list_session_recordings(
10232            &mut self,
10233            request: impl tonic::IntoRequest<super::ListSessionRecordingsRequest>,
10234        ) -> std::result::Result<
10235            tonic::Response<super::ListSessionRecordingsResponse>,
10236            tonic::Status,
10237        > {
10238            self.inner
10239                .ready()
10240                .await
10241                .map_err(|e| {
10242                    tonic::Status::unknown(
10243                        format!("Service was not ready: {}", e.into()),
10244                    )
10245                })?;
10246            let codec = tonic_prost::ProstCodec::default();
10247            let path = http::uri::PathAndQuery::from_static(
10248                "/pidgr.v1.ReplayService/ListSessionRecordings",
10249            );
10250            let mut req = request.into_request();
10251            req.extensions_mut()
10252                .insert(
10253                    GrpcMethod::new("pidgr.v1.ReplayService", "ListSessionRecordings"),
10254                );
10255            self.inner.unary(req, path, codec).await
10256        }
10257        /** Fetch the full rrweb snapshot data for a single recording.
10258 Authorization: Requires CAMPAIGNS_READ permission.
10259*/
10260        pub async fn get_session_snapshots(
10261            &mut self,
10262            request: impl tonic::IntoRequest<super::GetSessionSnapshotsRequest>,
10263        ) -> std::result::Result<
10264            tonic::Response<super::GetSessionSnapshotsResponse>,
10265            tonic::Status,
10266        > {
10267            self.inner
10268                .ready()
10269                .await
10270                .map_err(|e| {
10271                    tonic::Status::unknown(
10272                        format!("Service was not ready: {}", e.into()),
10273                    )
10274                })?;
10275            let codec = tonic_prost::ProstCodec::default();
10276            let path = http::uri::PathAndQuery::from_static(
10277                "/pidgr.v1.ReplayService/GetSessionSnapshots",
10278            );
10279            let mut req = request.into_request();
10280            req.extensions_mut()
10281                .insert(
10282                    GrpcMethod::new("pidgr.v1.ReplayService", "GetSessionSnapshots"),
10283                );
10284            self.inner.unary(req, path, codec).await
10285        }
10286    }
10287}
10288/// Generated server implementations.
10289pub mod replay_service_server {
10290    #![allow(
10291        unused_variables,
10292        dead_code,
10293        missing_docs,
10294        clippy::wildcard_imports,
10295        clippy::let_unit_value,
10296    )]
10297    use tonic::codegen::*;
10298    /// Generated trait containing gRPC methods that should be implemented for use with ReplayServiceServer.
10299    #[async_trait]
10300    pub trait ReplayService: std::marker::Send + std::marker::Sync + 'static {
10301        /** List recent session recordings with optional campaign and time range filters.
10302 Authorization: Requires CAMPAIGNS_READ permission.
10303*/
10304        async fn list_session_recordings(
10305            &self,
10306            request: tonic::Request<super::ListSessionRecordingsRequest>,
10307        ) -> std::result::Result<
10308            tonic::Response<super::ListSessionRecordingsResponse>,
10309            tonic::Status,
10310        >;
10311        /** Fetch the full rrweb snapshot data for a single recording.
10312 Authorization: Requires CAMPAIGNS_READ permission.
10313*/
10314        async fn get_session_snapshots(
10315            &self,
10316            request: tonic::Request<super::GetSessionSnapshotsRequest>,
10317        ) -> std::result::Result<
10318            tonic::Response<super::GetSessionSnapshotsResponse>,
10319            tonic::Status,
10320        >;
10321    }
10322    /** Proxies the analytics provider's session recording API, keeping credentials server-side.
10323 All data is fetched from the analytics provider on demand; no recording data is stored in pidgr.
10324*/
10325    #[derive(Debug)]
10326    pub struct ReplayServiceServer<T> {
10327        inner: Arc<T>,
10328        accept_compression_encodings: EnabledCompressionEncodings,
10329        send_compression_encodings: EnabledCompressionEncodings,
10330        max_decoding_message_size: Option<usize>,
10331        max_encoding_message_size: Option<usize>,
10332    }
10333    impl<T> ReplayServiceServer<T> {
10334        pub fn new(inner: T) -> Self {
10335            Self::from_arc(Arc::new(inner))
10336        }
10337        pub fn from_arc(inner: Arc<T>) -> Self {
10338            Self {
10339                inner,
10340                accept_compression_encodings: Default::default(),
10341                send_compression_encodings: Default::default(),
10342                max_decoding_message_size: None,
10343                max_encoding_message_size: None,
10344            }
10345        }
10346        pub fn with_interceptor<F>(
10347            inner: T,
10348            interceptor: F,
10349        ) -> InterceptedService<Self, F>
10350        where
10351            F: tonic::service::Interceptor,
10352        {
10353            InterceptedService::new(Self::new(inner), interceptor)
10354        }
10355        /// Enable decompressing requests with the given encoding.
10356        #[must_use]
10357        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10358            self.accept_compression_encodings.enable(encoding);
10359            self
10360        }
10361        /// Compress responses with the given encoding, if the client supports it.
10362        #[must_use]
10363        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10364            self.send_compression_encodings.enable(encoding);
10365            self
10366        }
10367        /// Limits the maximum size of a decoded message.
10368        ///
10369        /// Default: `4MB`
10370        #[must_use]
10371        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10372            self.max_decoding_message_size = Some(limit);
10373            self
10374        }
10375        /// Limits the maximum size of an encoded message.
10376        ///
10377        /// Default: `usize::MAX`
10378        #[must_use]
10379        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10380            self.max_encoding_message_size = Some(limit);
10381            self
10382        }
10383    }
10384    impl<T, B> tonic::codegen::Service<http::Request<B>> for ReplayServiceServer<T>
10385    where
10386        T: ReplayService,
10387        B: Body + std::marker::Send + 'static,
10388        B::Error: Into<StdError> + std::marker::Send + 'static,
10389    {
10390        type Response = http::Response<tonic::body::Body>;
10391        type Error = std::convert::Infallible;
10392        type Future = BoxFuture<Self::Response, Self::Error>;
10393        fn poll_ready(
10394            &mut self,
10395            _cx: &mut Context<'_>,
10396        ) -> Poll<std::result::Result<(), Self::Error>> {
10397            Poll::Ready(Ok(()))
10398        }
10399        fn call(&mut self, req: http::Request<B>) -> Self::Future {
10400            match req.uri().path() {
10401                "/pidgr.v1.ReplayService/ListSessionRecordings" => {
10402                    #[allow(non_camel_case_types)]
10403                    struct ListSessionRecordingsSvc<T: ReplayService>(pub Arc<T>);
10404                    impl<
10405                        T: ReplayService,
10406                    > tonic::server::UnaryService<super::ListSessionRecordingsRequest>
10407                    for ListSessionRecordingsSvc<T> {
10408                        type Response = super::ListSessionRecordingsResponse;
10409                        type Future = BoxFuture<
10410                            tonic::Response<Self::Response>,
10411                            tonic::Status,
10412                        >;
10413                        fn call(
10414                            &mut self,
10415                            request: tonic::Request<super::ListSessionRecordingsRequest>,
10416                        ) -> Self::Future {
10417                            let inner = Arc::clone(&self.0);
10418                            let fut = async move {
10419                                <T as ReplayService>::list_session_recordings(
10420                                        &inner,
10421                                        request,
10422                                    )
10423                                    .await
10424                            };
10425                            Box::pin(fut)
10426                        }
10427                    }
10428                    let accept_compression_encodings = self.accept_compression_encodings;
10429                    let send_compression_encodings = self.send_compression_encodings;
10430                    let max_decoding_message_size = self.max_decoding_message_size;
10431                    let max_encoding_message_size = self.max_encoding_message_size;
10432                    let inner = self.inner.clone();
10433                    let fut = async move {
10434                        let method = ListSessionRecordingsSvc(inner);
10435                        let codec = tonic_prost::ProstCodec::default();
10436                        let mut grpc = tonic::server::Grpc::new(codec)
10437                            .apply_compression_config(
10438                                accept_compression_encodings,
10439                                send_compression_encodings,
10440                            )
10441                            .apply_max_message_size_config(
10442                                max_decoding_message_size,
10443                                max_encoding_message_size,
10444                            );
10445                        let res = grpc.unary(method, req).await;
10446                        Ok(res)
10447                    };
10448                    Box::pin(fut)
10449                }
10450                "/pidgr.v1.ReplayService/GetSessionSnapshots" => {
10451                    #[allow(non_camel_case_types)]
10452                    struct GetSessionSnapshotsSvc<T: ReplayService>(pub Arc<T>);
10453                    impl<
10454                        T: ReplayService,
10455                    > tonic::server::UnaryService<super::GetSessionSnapshotsRequest>
10456                    for GetSessionSnapshotsSvc<T> {
10457                        type Response = super::GetSessionSnapshotsResponse;
10458                        type Future = BoxFuture<
10459                            tonic::Response<Self::Response>,
10460                            tonic::Status,
10461                        >;
10462                        fn call(
10463                            &mut self,
10464                            request: tonic::Request<super::GetSessionSnapshotsRequest>,
10465                        ) -> Self::Future {
10466                            let inner = Arc::clone(&self.0);
10467                            let fut = async move {
10468                                <T as ReplayService>::get_session_snapshots(&inner, request)
10469                                    .await
10470                            };
10471                            Box::pin(fut)
10472                        }
10473                    }
10474                    let accept_compression_encodings = self.accept_compression_encodings;
10475                    let send_compression_encodings = self.send_compression_encodings;
10476                    let max_decoding_message_size = self.max_decoding_message_size;
10477                    let max_encoding_message_size = self.max_encoding_message_size;
10478                    let inner = self.inner.clone();
10479                    let fut = async move {
10480                        let method = GetSessionSnapshotsSvc(inner);
10481                        let codec = tonic_prost::ProstCodec::default();
10482                        let mut grpc = tonic::server::Grpc::new(codec)
10483                            .apply_compression_config(
10484                                accept_compression_encodings,
10485                                send_compression_encodings,
10486                            )
10487                            .apply_max_message_size_config(
10488                                max_decoding_message_size,
10489                                max_encoding_message_size,
10490                            );
10491                        let res = grpc.unary(method, req).await;
10492                        Ok(res)
10493                    };
10494                    Box::pin(fut)
10495                }
10496                _ => {
10497                    Box::pin(async move {
10498                        let mut response = http::Response::new(
10499                            tonic::body::Body::default(),
10500                        );
10501                        let headers = response.headers_mut();
10502                        headers
10503                            .insert(
10504                                tonic::Status::GRPC_STATUS,
10505                                (tonic::Code::Unimplemented as i32).into(),
10506                            );
10507                        headers
10508                            .insert(
10509                                http::header::CONTENT_TYPE,
10510                                tonic::metadata::GRPC_CONTENT_TYPE,
10511                            );
10512                        Ok(response)
10513                    })
10514                }
10515            }
10516        }
10517    }
10518    impl<T> Clone for ReplayServiceServer<T> {
10519        fn clone(&self) -> Self {
10520            let inner = self.inner.clone();
10521            Self {
10522                inner,
10523                accept_compression_encodings: self.accept_compression_encodings,
10524                send_compression_encodings: self.send_compression_encodings,
10525                max_decoding_message_size: self.max_decoding_message_size,
10526                max_encoding_message_size: self.max_encoding_message_size,
10527            }
10528        }
10529    }
10530    /// Generated gRPC service name
10531    pub const SERVICE_NAME: &str = "pidgr.v1.ReplayService";
10532    impl<T> tonic::server::NamedService for ReplayServiceServer<T> {
10533        const NAME: &'static str = SERVICE_NAME;
10534    }
10535}
10536/// Generated client implementations.
10537pub mod role_service_client {
10538    #![allow(
10539        unused_variables,
10540        dead_code,
10541        missing_docs,
10542        clippy::wildcard_imports,
10543        clippy::let_unit_value,
10544    )]
10545    use tonic::codegen::*;
10546    use tonic::codegen::http::Uri;
10547    /** Manages roles and their permissions within an organization.
10548 All RPCs operate within the caller's org (extracted from JWT).
10549*/
10550    #[derive(Debug, Clone)]
10551    pub struct RoleServiceClient<T> {
10552        inner: tonic::client::Grpc<T>,
10553    }
10554    impl RoleServiceClient<tonic::transport::Channel> {
10555        /// Attempt to create a new client by connecting to a given endpoint.
10556        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
10557        where
10558            D: TryInto<tonic::transport::Endpoint>,
10559            D::Error: Into<StdError>,
10560        {
10561            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
10562            Ok(Self::new(conn))
10563        }
10564    }
10565    impl<T> RoleServiceClient<T>
10566    where
10567        T: tonic::client::GrpcService<tonic::body::Body>,
10568        T::Error: Into<StdError>,
10569        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
10570        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
10571    {
10572        pub fn new(inner: T) -> Self {
10573            let inner = tonic::client::Grpc::new(inner);
10574            Self { inner }
10575        }
10576        pub fn with_origin(inner: T, origin: Uri) -> Self {
10577            let inner = tonic::client::Grpc::with_origin(inner, origin);
10578            Self { inner }
10579        }
10580        pub fn with_interceptor<F>(
10581            inner: T,
10582            interceptor: F,
10583        ) -> RoleServiceClient<InterceptedService<T, F>>
10584        where
10585            F: tonic::service::Interceptor,
10586            T::ResponseBody: Default,
10587            T: tonic::codegen::Service<
10588                http::Request<tonic::body::Body>,
10589                Response = http::Response<
10590                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
10591                >,
10592            >,
10593            <T as tonic::codegen::Service<
10594                http::Request<tonic::body::Body>,
10595            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
10596        {
10597            RoleServiceClient::new(InterceptedService::new(inner, interceptor))
10598        }
10599        /// Compress requests with the given encoding.
10600        ///
10601        /// This requires the server to support it otherwise it might respond with an
10602        /// error.
10603        #[must_use]
10604        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10605            self.inner = self.inner.send_compressed(encoding);
10606            self
10607        }
10608        /// Enable decompressing responses.
10609        #[must_use]
10610        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10611            self.inner = self.inner.accept_compressed(encoding);
10612            self
10613        }
10614        /// Limits the maximum size of a decoded message.
10615        ///
10616        /// Default: `4MB`
10617        #[must_use]
10618        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10619            self.inner = self.inner.max_decoding_message_size(limit);
10620            self
10621        }
10622        /// Limits the maximum size of an encoded message.
10623        ///
10624        /// Default: `usize::MAX`
10625        #[must_use]
10626        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10627            self.inner = self.inner.max_encoding_message_size(limit);
10628            self
10629        }
10630        /** List all roles in the organization with their permission sets.
10631 Authorization: Requires PERMISSION_ORG_READ.
10632*/
10633        pub async fn list_roles(
10634            &mut self,
10635            request: impl tonic::IntoRequest<super::ListRolesRequest>,
10636        ) -> std::result::Result<
10637            tonic::Response<super::ListRolesResponse>,
10638            tonic::Status,
10639        > {
10640            self.inner
10641                .ready()
10642                .await
10643                .map_err(|e| {
10644                    tonic::Status::unknown(
10645                        format!("Service was not ready: {}", e.into()),
10646                    )
10647                })?;
10648            let codec = tonic_prost::ProstCodec::default();
10649            let path = http::uri::PathAndQuery::from_static(
10650                "/pidgr.v1.RoleService/ListRoles",
10651            );
10652            let mut req = request.into_request();
10653            req.extensions_mut()
10654                .insert(GrpcMethod::new("pidgr.v1.RoleService", "ListRoles"));
10655            self.inner.unary(req, path, codec).await
10656        }
10657        /** Create a new custom role with a name and initial permissions.
10658 Slug is auto-generated from the name and immutable after creation.
10659 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10660*/
10661        pub async fn create_role(
10662            &mut self,
10663            request: impl tonic::IntoRequest<super::CreateRoleRequest>,
10664        ) -> std::result::Result<
10665            tonic::Response<super::CreateRoleResponse>,
10666            tonic::Status,
10667        > {
10668            self.inner
10669                .ready()
10670                .await
10671                .map_err(|e| {
10672                    tonic::Status::unknown(
10673                        format!("Service was not ready: {}", e.into()),
10674                    )
10675                })?;
10676            let codec = tonic_prost::ProstCodec::default();
10677            let path = http::uri::PathAndQuery::from_static(
10678                "/pidgr.v1.RoleService/CreateRole",
10679            );
10680            let mut req = request.into_request();
10681            req.extensions_mut()
10682                .insert(GrpcMethod::new("pidgr.v1.RoleService", "CreateRole"));
10683            self.inner.unary(req, path, codec).await
10684        }
10685        /** Update a role's name and/or permissions.
10686 System roles (is_system=true) cannot be updated.
10687 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10688*/
10689        pub async fn update_role(
10690            &mut self,
10691            request: impl tonic::IntoRequest<super::UpdateRoleRequest>,
10692        ) -> std::result::Result<
10693            tonic::Response<super::UpdateRoleResponse>,
10694            tonic::Status,
10695        > {
10696            self.inner
10697                .ready()
10698                .await
10699                .map_err(|e| {
10700                    tonic::Status::unknown(
10701                        format!("Service was not ready: {}", e.into()),
10702                    )
10703                })?;
10704            let codec = tonic_prost::ProstCodec::default();
10705            let path = http::uri::PathAndQuery::from_static(
10706                "/pidgr.v1.RoleService/UpdateRole",
10707            );
10708            let mut req = request.into_request();
10709            req.extensions_mut()
10710                .insert(GrpcMethod::new("pidgr.v1.RoleService", "UpdateRole"));
10711            self.inner.unary(req, path, codec).await
10712        }
10713        /** Delete a role. Fails if any users are assigned to it.
10714 System roles (is_system=true) cannot be deleted.
10715 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10716*/
10717        pub async fn delete_role(
10718            &mut self,
10719            request: impl tonic::IntoRequest<super::DeleteRoleRequest>,
10720        ) -> std::result::Result<
10721            tonic::Response<super::DeleteRoleResponse>,
10722            tonic::Status,
10723        > {
10724            self.inner
10725                .ready()
10726                .await
10727                .map_err(|e| {
10728                    tonic::Status::unknown(
10729                        format!("Service was not ready: {}", e.into()),
10730                    )
10731                })?;
10732            let codec = tonic_prost::ProstCodec::default();
10733            let path = http::uri::PathAndQuery::from_static(
10734                "/pidgr.v1.RoleService/DeleteRole",
10735            );
10736            let mut req = request.into_request();
10737            req.extensions_mut()
10738                .insert(GrpcMethod::new("pidgr.v1.RoleService", "DeleteRole"));
10739            self.inner.unary(req, path, codec).await
10740        }
10741    }
10742}
10743/// Generated server implementations.
10744pub mod role_service_server {
10745    #![allow(
10746        unused_variables,
10747        dead_code,
10748        missing_docs,
10749        clippy::wildcard_imports,
10750        clippy::let_unit_value,
10751    )]
10752    use tonic::codegen::*;
10753    /// Generated trait containing gRPC methods that should be implemented for use with RoleServiceServer.
10754    #[async_trait]
10755    pub trait RoleService: std::marker::Send + std::marker::Sync + 'static {
10756        /** List all roles in the organization with their permission sets.
10757 Authorization: Requires PERMISSION_ORG_READ.
10758*/
10759        async fn list_roles(
10760            &self,
10761            request: tonic::Request<super::ListRolesRequest>,
10762        ) -> std::result::Result<
10763            tonic::Response<super::ListRolesResponse>,
10764            tonic::Status,
10765        >;
10766        /** Create a new custom role with a name and initial permissions.
10767 Slug is auto-generated from the name and immutable after creation.
10768 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10769*/
10770        async fn create_role(
10771            &self,
10772            request: tonic::Request<super::CreateRoleRequest>,
10773        ) -> std::result::Result<
10774            tonic::Response<super::CreateRoleResponse>,
10775            tonic::Status,
10776        >;
10777        /** Update a role's name and/or permissions.
10778 System roles (is_system=true) cannot be updated.
10779 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10780*/
10781        async fn update_role(
10782            &self,
10783            request: tonic::Request<super::UpdateRoleRequest>,
10784        ) -> std::result::Result<
10785            tonic::Response<super::UpdateRoleResponse>,
10786            tonic::Status,
10787        >;
10788        /** Delete a role. Fails if any users are assigned to it.
10789 System roles (is_system=true) cannot be deleted.
10790 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10791*/
10792        async fn delete_role(
10793            &self,
10794            request: tonic::Request<super::DeleteRoleRequest>,
10795        ) -> std::result::Result<
10796            tonic::Response<super::DeleteRoleResponse>,
10797            tonic::Status,
10798        >;
10799    }
10800    /** Manages roles and their permissions within an organization.
10801 All RPCs operate within the caller's org (extracted from JWT).
10802*/
10803    #[derive(Debug)]
10804    pub struct RoleServiceServer<T> {
10805        inner: Arc<T>,
10806        accept_compression_encodings: EnabledCompressionEncodings,
10807        send_compression_encodings: EnabledCompressionEncodings,
10808        max_decoding_message_size: Option<usize>,
10809        max_encoding_message_size: Option<usize>,
10810    }
10811    impl<T> RoleServiceServer<T> {
10812        pub fn new(inner: T) -> Self {
10813            Self::from_arc(Arc::new(inner))
10814        }
10815        pub fn from_arc(inner: Arc<T>) -> Self {
10816            Self {
10817                inner,
10818                accept_compression_encodings: Default::default(),
10819                send_compression_encodings: Default::default(),
10820                max_decoding_message_size: None,
10821                max_encoding_message_size: None,
10822            }
10823        }
10824        pub fn with_interceptor<F>(
10825            inner: T,
10826            interceptor: F,
10827        ) -> InterceptedService<Self, F>
10828        where
10829            F: tonic::service::Interceptor,
10830        {
10831            InterceptedService::new(Self::new(inner), interceptor)
10832        }
10833        /// Enable decompressing requests with the given encoding.
10834        #[must_use]
10835        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10836            self.accept_compression_encodings.enable(encoding);
10837            self
10838        }
10839        /// Compress responses with the given encoding, if the client supports it.
10840        #[must_use]
10841        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10842            self.send_compression_encodings.enable(encoding);
10843            self
10844        }
10845        /// Limits the maximum size of a decoded message.
10846        ///
10847        /// Default: `4MB`
10848        #[must_use]
10849        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10850            self.max_decoding_message_size = Some(limit);
10851            self
10852        }
10853        /// Limits the maximum size of an encoded message.
10854        ///
10855        /// Default: `usize::MAX`
10856        #[must_use]
10857        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10858            self.max_encoding_message_size = Some(limit);
10859            self
10860        }
10861    }
10862    impl<T, B> tonic::codegen::Service<http::Request<B>> for RoleServiceServer<T>
10863    where
10864        T: RoleService,
10865        B: Body + std::marker::Send + 'static,
10866        B::Error: Into<StdError> + std::marker::Send + 'static,
10867    {
10868        type Response = http::Response<tonic::body::Body>;
10869        type Error = std::convert::Infallible;
10870        type Future = BoxFuture<Self::Response, Self::Error>;
10871        fn poll_ready(
10872            &mut self,
10873            _cx: &mut Context<'_>,
10874        ) -> Poll<std::result::Result<(), Self::Error>> {
10875            Poll::Ready(Ok(()))
10876        }
10877        fn call(&mut self, req: http::Request<B>) -> Self::Future {
10878            match req.uri().path() {
10879                "/pidgr.v1.RoleService/ListRoles" => {
10880                    #[allow(non_camel_case_types)]
10881                    struct ListRolesSvc<T: RoleService>(pub Arc<T>);
10882                    impl<
10883                        T: RoleService,
10884                    > tonic::server::UnaryService<super::ListRolesRequest>
10885                    for ListRolesSvc<T> {
10886                        type Response = super::ListRolesResponse;
10887                        type Future = BoxFuture<
10888                            tonic::Response<Self::Response>,
10889                            tonic::Status,
10890                        >;
10891                        fn call(
10892                            &mut self,
10893                            request: tonic::Request<super::ListRolesRequest>,
10894                        ) -> Self::Future {
10895                            let inner = Arc::clone(&self.0);
10896                            let fut = async move {
10897                                <T as RoleService>::list_roles(&inner, request).await
10898                            };
10899                            Box::pin(fut)
10900                        }
10901                    }
10902                    let accept_compression_encodings = self.accept_compression_encodings;
10903                    let send_compression_encodings = self.send_compression_encodings;
10904                    let max_decoding_message_size = self.max_decoding_message_size;
10905                    let max_encoding_message_size = self.max_encoding_message_size;
10906                    let inner = self.inner.clone();
10907                    let fut = async move {
10908                        let method = ListRolesSvc(inner);
10909                        let codec = tonic_prost::ProstCodec::default();
10910                        let mut grpc = tonic::server::Grpc::new(codec)
10911                            .apply_compression_config(
10912                                accept_compression_encodings,
10913                                send_compression_encodings,
10914                            )
10915                            .apply_max_message_size_config(
10916                                max_decoding_message_size,
10917                                max_encoding_message_size,
10918                            );
10919                        let res = grpc.unary(method, req).await;
10920                        Ok(res)
10921                    };
10922                    Box::pin(fut)
10923                }
10924                "/pidgr.v1.RoleService/CreateRole" => {
10925                    #[allow(non_camel_case_types)]
10926                    struct CreateRoleSvc<T: RoleService>(pub Arc<T>);
10927                    impl<
10928                        T: RoleService,
10929                    > tonic::server::UnaryService<super::CreateRoleRequest>
10930                    for CreateRoleSvc<T> {
10931                        type Response = super::CreateRoleResponse;
10932                        type Future = BoxFuture<
10933                            tonic::Response<Self::Response>,
10934                            tonic::Status,
10935                        >;
10936                        fn call(
10937                            &mut self,
10938                            request: tonic::Request<super::CreateRoleRequest>,
10939                        ) -> Self::Future {
10940                            let inner = Arc::clone(&self.0);
10941                            let fut = async move {
10942                                <T as RoleService>::create_role(&inner, request).await
10943                            };
10944                            Box::pin(fut)
10945                        }
10946                    }
10947                    let accept_compression_encodings = self.accept_compression_encodings;
10948                    let send_compression_encodings = self.send_compression_encodings;
10949                    let max_decoding_message_size = self.max_decoding_message_size;
10950                    let max_encoding_message_size = self.max_encoding_message_size;
10951                    let inner = self.inner.clone();
10952                    let fut = async move {
10953                        let method = CreateRoleSvc(inner);
10954                        let codec = tonic_prost::ProstCodec::default();
10955                        let mut grpc = tonic::server::Grpc::new(codec)
10956                            .apply_compression_config(
10957                                accept_compression_encodings,
10958                                send_compression_encodings,
10959                            )
10960                            .apply_max_message_size_config(
10961                                max_decoding_message_size,
10962                                max_encoding_message_size,
10963                            );
10964                        let res = grpc.unary(method, req).await;
10965                        Ok(res)
10966                    };
10967                    Box::pin(fut)
10968                }
10969                "/pidgr.v1.RoleService/UpdateRole" => {
10970                    #[allow(non_camel_case_types)]
10971                    struct UpdateRoleSvc<T: RoleService>(pub Arc<T>);
10972                    impl<
10973                        T: RoleService,
10974                    > tonic::server::UnaryService<super::UpdateRoleRequest>
10975                    for UpdateRoleSvc<T> {
10976                        type Response = super::UpdateRoleResponse;
10977                        type Future = BoxFuture<
10978                            tonic::Response<Self::Response>,
10979                            tonic::Status,
10980                        >;
10981                        fn call(
10982                            &mut self,
10983                            request: tonic::Request<super::UpdateRoleRequest>,
10984                        ) -> Self::Future {
10985                            let inner = Arc::clone(&self.0);
10986                            let fut = async move {
10987                                <T as RoleService>::update_role(&inner, request).await
10988                            };
10989                            Box::pin(fut)
10990                        }
10991                    }
10992                    let accept_compression_encodings = self.accept_compression_encodings;
10993                    let send_compression_encodings = self.send_compression_encodings;
10994                    let max_decoding_message_size = self.max_decoding_message_size;
10995                    let max_encoding_message_size = self.max_encoding_message_size;
10996                    let inner = self.inner.clone();
10997                    let fut = async move {
10998                        let method = UpdateRoleSvc(inner);
10999                        let codec = tonic_prost::ProstCodec::default();
11000                        let mut grpc = tonic::server::Grpc::new(codec)
11001                            .apply_compression_config(
11002                                accept_compression_encodings,
11003                                send_compression_encodings,
11004                            )
11005                            .apply_max_message_size_config(
11006                                max_decoding_message_size,
11007                                max_encoding_message_size,
11008                            );
11009                        let res = grpc.unary(method, req).await;
11010                        Ok(res)
11011                    };
11012                    Box::pin(fut)
11013                }
11014                "/pidgr.v1.RoleService/DeleteRole" => {
11015                    #[allow(non_camel_case_types)]
11016                    struct DeleteRoleSvc<T: RoleService>(pub Arc<T>);
11017                    impl<
11018                        T: RoleService,
11019                    > tonic::server::UnaryService<super::DeleteRoleRequest>
11020                    for DeleteRoleSvc<T> {
11021                        type Response = super::DeleteRoleResponse;
11022                        type Future = BoxFuture<
11023                            tonic::Response<Self::Response>,
11024                            tonic::Status,
11025                        >;
11026                        fn call(
11027                            &mut self,
11028                            request: tonic::Request<super::DeleteRoleRequest>,
11029                        ) -> Self::Future {
11030                            let inner = Arc::clone(&self.0);
11031                            let fut = async move {
11032                                <T as RoleService>::delete_role(&inner, request).await
11033                            };
11034                            Box::pin(fut)
11035                        }
11036                    }
11037                    let accept_compression_encodings = self.accept_compression_encodings;
11038                    let send_compression_encodings = self.send_compression_encodings;
11039                    let max_decoding_message_size = self.max_decoding_message_size;
11040                    let max_encoding_message_size = self.max_encoding_message_size;
11041                    let inner = self.inner.clone();
11042                    let fut = async move {
11043                        let method = DeleteRoleSvc(inner);
11044                        let codec = tonic_prost::ProstCodec::default();
11045                        let mut grpc = tonic::server::Grpc::new(codec)
11046                            .apply_compression_config(
11047                                accept_compression_encodings,
11048                                send_compression_encodings,
11049                            )
11050                            .apply_max_message_size_config(
11051                                max_decoding_message_size,
11052                                max_encoding_message_size,
11053                            );
11054                        let res = grpc.unary(method, req).await;
11055                        Ok(res)
11056                    };
11057                    Box::pin(fut)
11058                }
11059                _ => {
11060                    Box::pin(async move {
11061                        let mut response = http::Response::new(
11062                            tonic::body::Body::default(),
11063                        );
11064                        let headers = response.headers_mut();
11065                        headers
11066                            .insert(
11067                                tonic::Status::GRPC_STATUS,
11068                                (tonic::Code::Unimplemented as i32).into(),
11069                            );
11070                        headers
11071                            .insert(
11072                                http::header::CONTENT_TYPE,
11073                                tonic::metadata::GRPC_CONTENT_TYPE,
11074                            );
11075                        Ok(response)
11076                    })
11077                }
11078            }
11079        }
11080    }
11081    impl<T> Clone for RoleServiceServer<T> {
11082        fn clone(&self) -> Self {
11083            let inner = self.inner.clone();
11084            Self {
11085                inner,
11086                accept_compression_encodings: self.accept_compression_encodings,
11087                send_compression_encodings: self.send_compression_encodings,
11088                max_decoding_message_size: self.max_decoding_message_size,
11089                max_encoding_message_size: self.max_encoding_message_size,
11090            }
11091        }
11092    }
11093    /// Generated gRPC service name
11094    pub const SERVICE_NAME: &str = "pidgr.v1.RoleService";
11095    impl<T> tonic::server::NamedService for RoleServiceServer<T> {
11096        const NAME: &'static str = SERVICE_NAME;
11097    }
11098}
11099/// Generated client implementations.
11100pub mod sso_service_client {
11101    #![allow(
11102        unused_variables,
11103        dead_code,
11104        missing_docs,
11105        clippy::wildcard_imports,
11106        clippy::let_unit_value,
11107    )]
11108    use tonic::codegen::*;
11109    use tonic::codegen::http::Uri;
11110    /** Manages SSO identity provider configuration for organizations.
11111*/
11112    #[derive(Debug, Clone)]
11113    pub struct SsoServiceClient<T> {
11114        inner: tonic::client::Grpc<T>,
11115    }
11116    impl SsoServiceClient<tonic::transport::Channel> {
11117        /// Attempt to create a new client by connecting to a given endpoint.
11118        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
11119        where
11120            D: TryInto<tonic::transport::Endpoint>,
11121            D::Error: Into<StdError>,
11122        {
11123            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
11124            Ok(Self::new(conn))
11125        }
11126    }
11127    impl<T> SsoServiceClient<T>
11128    where
11129        T: tonic::client::GrpcService<tonic::body::Body>,
11130        T::Error: Into<StdError>,
11131        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
11132        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
11133    {
11134        pub fn new(inner: T) -> Self {
11135            let inner = tonic::client::Grpc::new(inner);
11136            Self { inner }
11137        }
11138        pub fn with_origin(inner: T, origin: Uri) -> Self {
11139            let inner = tonic::client::Grpc::with_origin(inner, origin);
11140            Self { inner }
11141        }
11142        pub fn with_interceptor<F>(
11143            inner: T,
11144            interceptor: F,
11145        ) -> SsoServiceClient<InterceptedService<T, F>>
11146        where
11147            F: tonic::service::Interceptor,
11148            T::ResponseBody: Default,
11149            T: tonic::codegen::Service<
11150                http::Request<tonic::body::Body>,
11151                Response = http::Response<
11152                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
11153                >,
11154            >,
11155            <T as tonic::codegen::Service<
11156                http::Request<tonic::body::Body>,
11157            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
11158        {
11159            SsoServiceClient::new(InterceptedService::new(inner, interceptor))
11160        }
11161        /// Compress requests with the given encoding.
11162        ///
11163        /// This requires the server to support it otherwise it might respond with an
11164        /// error.
11165        #[must_use]
11166        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11167            self.inner = self.inner.send_compressed(encoding);
11168            self
11169        }
11170        /// Enable decompressing responses.
11171        #[must_use]
11172        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11173            self.inner = self.inner.accept_compressed(encoding);
11174            self
11175        }
11176        /// Limits the maximum size of a decoded message.
11177        ///
11178        /// Default: `4MB`
11179        #[must_use]
11180        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11181            self.inner = self.inner.max_decoding_message_size(limit);
11182            self
11183        }
11184        /// Limits the maximum size of an encoded message.
11185        ///
11186        /// Default: `usize::MAX`
11187        #[must_use]
11188        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11189            self.inner = self.inner.max_encoding_message_size(limit);
11190            self
11191        }
11192        /** Check if an email domain has SSO configured.
11193 This is a pre-authentication endpoint — no JWT required.
11194 Authorization: None (public).
11195*/
11196        pub async fn check_sso_by_domain(
11197            &mut self,
11198            request: impl tonic::IntoRequest<super::CheckSsoByDomainRequest>,
11199        ) -> std::result::Result<
11200            tonic::Response<super::CheckSsoByDomainResponse>,
11201            tonic::Status,
11202        > {
11203            self.inner
11204                .ready()
11205                .await
11206                .map_err(|e| {
11207                    tonic::Status::unknown(
11208                        format!("Service was not ready: {}", e.into()),
11209                    )
11210                })?;
11211            let codec = tonic_prost::ProstCodec::default();
11212            let path = http::uri::PathAndQuery::from_static(
11213                "/pidgr.v1.SSOService/CheckSSOByDomain",
11214            );
11215            let mut req = request.into_request();
11216            req.extensions_mut()
11217                .insert(GrpcMethod::new("pidgr.v1.SSOService", "CheckSSOByDomain"));
11218            self.inner.unary(req, path, codec).await
11219        }
11220        /** Create an SSO provider for the organization.
11221 Validates the metadata URL before saving.
11222 Creates the corresponding identity provider in the auth service.
11223 Authorization: Requires PERMISSION_ORG_WRITE.
11224*/
11225        pub async fn create_sso_provider(
11226            &mut self,
11227            request: impl tonic::IntoRequest<super::CreateSsoProviderRequest>,
11228        ) -> std::result::Result<
11229            tonic::Response<super::CreateSsoProviderResponse>,
11230            tonic::Status,
11231        > {
11232            self.inner
11233                .ready()
11234                .await
11235                .map_err(|e| {
11236                    tonic::Status::unknown(
11237                        format!("Service was not ready: {}", e.into()),
11238                    )
11239                })?;
11240            let codec = tonic_prost::ProstCodec::default();
11241            let path = http::uri::PathAndQuery::from_static(
11242                "/pidgr.v1.SSOService/CreateSSOProvider",
11243            );
11244            let mut req = request.into_request();
11245            req.extensions_mut()
11246                .insert(GrpcMethod::new("pidgr.v1.SSOService", "CreateSSOProvider"));
11247            self.inner.unary(req, path, codec).await
11248        }
11249        /** Get the organization's SSO provider configuration.
11250 Authorization: Requires PERMISSION_ORG_READ.
11251*/
11252        pub async fn get_sso_provider(
11253            &mut self,
11254            request: impl tonic::IntoRequest<super::GetSsoProviderRequest>,
11255        ) -> std::result::Result<
11256            tonic::Response<super::GetSsoProviderResponse>,
11257            tonic::Status,
11258        > {
11259            self.inner
11260                .ready()
11261                .await
11262                .map_err(|e| {
11263                    tonic::Status::unknown(
11264                        format!("Service was not ready: {}", e.into()),
11265                    )
11266                })?;
11267            let codec = tonic_prost::ProstCodec::default();
11268            let path = http::uri::PathAndQuery::from_static(
11269                "/pidgr.v1.SSOService/GetSSOProvider",
11270            );
11271            let mut req = request.into_request();
11272            req.extensions_mut()
11273                .insert(GrpcMethod::new("pidgr.v1.SSOService", "GetSSOProvider"));
11274            self.inner.unary(req, path, codec).await
11275        }
11276        /** Delete the organization's SSO provider.
11277 Deletes the corresponding identity provider from the auth service.
11278 Users with that domain fall back to passkey/OTP.
11279 Authorization: Requires PERMISSION_ORG_WRITE.
11280*/
11281        pub async fn delete_sso_provider(
11282            &mut self,
11283            request: impl tonic::IntoRequest<super::DeleteSsoProviderRequest>,
11284        ) -> std::result::Result<
11285            tonic::Response<super::DeleteSsoProviderResponse>,
11286            tonic::Status,
11287        > {
11288            self.inner
11289                .ready()
11290                .await
11291                .map_err(|e| {
11292                    tonic::Status::unknown(
11293                        format!("Service was not ready: {}", e.into()),
11294                    )
11295                })?;
11296            let codec = tonic_prost::ProstCodec::default();
11297            let path = http::uri::PathAndQuery::from_static(
11298                "/pidgr.v1.SSOService/DeleteSSOProvider",
11299            );
11300            let mut req = request.into_request();
11301            req.extensions_mut()
11302                .insert(GrpcMethod::new("pidgr.v1.SSOService", "DeleteSSOProvider"));
11303            self.inner.unary(req, path, codec).await
11304        }
11305    }
11306}
11307/// Generated server implementations.
11308pub mod sso_service_server {
11309    #![allow(
11310        unused_variables,
11311        dead_code,
11312        missing_docs,
11313        clippy::wildcard_imports,
11314        clippy::let_unit_value,
11315    )]
11316    use tonic::codegen::*;
11317    /// Generated trait containing gRPC methods that should be implemented for use with SsoServiceServer.
11318    #[async_trait]
11319    pub trait SsoService: std::marker::Send + std::marker::Sync + 'static {
11320        /** Check if an email domain has SSO configured.
11321 This is a pre-authentication endpoint — no JWT required.
11322 Authorization: None (public).
11323*/
11324        async fn check_sso_by_domain(
11325            &self,
11326            request: tonic::Request<super::CheckSsoByDomainRequest>,
11327        ) -> std::result::Result<
11328            tonic::Response<super::CheckSsoByDomainResponse>,
11329            tonic::Status,
11330        >;
11331        /** Create an SSO provider for the organization.
11332 Validates the metadata URL before saving.
11333 Creates the corresponding identity provider in the auth service.
11334 Authorization: Requires PERMISSION_ORG_WRITE.
11335*/
11336        async fn create_sso_provider(
11337            &self,
11338            request: tonic::Request<super::CreateSsoProviderRequest>,
11339        ) -> std::result::Result<
11340            tonic::Response<super::CreateSsoProviderResponse>,
11341            tonic::Status,
11342        >;
11343        /** Get the organization's SSO provider configuration.
11344 Authorization: Requires PERMISSION_ORG_READ.
11345*/
11346        async fn get_sso_provider(
11347            &self,
11348            request: tonic::Request<super::GetSsoProviderRequest>,
11349        ) -> std::result::Result<
11350            tonic::Response<super::GetSsoProviderResponse>,
11351            tonic::Status,
11352        >;
11353        /** Delete the organization's SSO provider.
11354 Deletes the corresponding identity provider from the auth service.
11355 Users with that domain fall back to passkey/OTP.
11356 Authorization: Requires PERMISSION_ORG_WRITE.
11357*/
11358        async fn delete_sso_provider(
11359            &self,
11360            request: tonic::Request<super::DeleteSsoProviderRequest>,
11361        ) -> std::result::Result<
11362            tonic::Response<super::DeleteSsoProviderResponse>,
11363            tonic::Status,
11364        >;
11365    }
11366    /** Manages SSO identity provider configuration for organizations.
11367*/
11368    #[derive(Debug)]
11369    pub struct SsoServiceServer<T> {
11370        inner: Arc<T>,
11371        accept_compression_encodings: EnabledCompressionEncodings,
11372        send_compression_encodings: EnabledCompressionEncodings,
11373        max_decoding_message_size: Option<usize>,
11374        max_encoding_message_size: Option<usize>,
11375    }
11376    impl<T> SsoServiceServer<T> {
11377        pub fn new(inner: T) -> Self {
11378            Self::from_arc(Arc::new(inner))
11379        }
11380        pub fn from_arc(inner: Arc<T>) -> Self {
11381            Self {
11382                inner,
11383                accept_compression_encodings: Default::default(),
11384                send_compression_encodings: Default::default(),
11385                max_decoding_message_size: None,
11386                max_encoding_message_size: None,
11387            }
11388        }
11389        pub fn with_interceptor<F>(
11390            inner: T,
11391            interceptor: F,
11392        ) -> InterceptedService<Self, F>
11393        where
11394            F: tonic::service::Interceptor,
11395        {
11396            InterceptedService::new(Self::new(inner), interceptor)
11397        }
11398        /// Enable decompressing requests with the given encoding.
11399        #[must_use]
11400        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11401            self.accept_compression_encodings.enable(encoding);
11402            self
11403        }
11404        /// Compress responses with the given encoding, if the client supports it.
11405        #[must_use]
11406        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11407            self.send_compression_encodings.enable(encoding);
11408            self
11409        }
11410        /// Limits the maximum size of a decoded message.
11411        ///
11412        /// Default: `4MB`
11413        #[must_use]
11414        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11415            self.max_decoding_message_size = Some(limit);
11416            self
11417        }
11418        /// Limits the maximum size of an encoded message.
11419        ///
11420        /// Default: `usize::MAX`
11421        #[must_use]
11422        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11423            self.max_encoding_message_size = Some(limit);
11424            self
11425        }
11426    }
11427    impl<T, B> tonic::codegen::Service<http::Request<B>> for SsoServiceServer<T>
11428    where
11429        T: SsoService,
11430        B: Body + std::marker::Send + 'static,
11431        B::Error: Into<StdError> + std::marker::Send + 'static,
11432    {
11433        type Response = http::Response<tonic::body::Body>;
11434        type Error = std::convert::Infallible;
11435        type Future = BoxFuture<Self::Response, Self::Error>;
11436        fn poll_ready(
11437            &mut self,
11438            _cx: &mut Context<'_>,
11439        ) -> Poll<std::result::Result<(), Self::Error>> {
11440            Poll::Ready(Ok(()))
11441        }
11442        fn call(&mut self, req: http::Request<B>) -> Self::Future {
11443            match req.uri().path() {
11444                "/pidgr.v1.SSOService/CheckSSOByDomain" => {
11445                    #[allow(non_camel_case_types)]
11446                    struct CheckSSOByDomainSvc<T: SsoService>(pub Arc<T>);
11447                    impl<
11448                        T: SsoService,
11449                    > tonic::server::UnaryService<super::CheckSsoByDomainRequest>
11450                    for CheckSSOByDomainSvc<T> {
11451                        type Response = super::CheckSsoByDomainResponse;
11452                        type Future = BoxFuture<
11453                            tonic::Response<Self::Response>,
11454                            tonic::Status,
11455                        >;
11456                        fn call(
11457                            &mut self,
11458                            request: tonic::Request<super::CheckSsoByDomainRequest>,
11459                        ) -> Self::Future {
11460                            let inner = Arc::clone(&self.0);
11461                            let fut = async move {
11462                                <T as SsoService>::check_sso_by_domain(&inner, request)
11463                                    .await
11464                            };
11465                            Box::pin(fut)
11466                        }
11467                    }
11468                    let accept_compression_encodings = self.accept_compression_encodings;
11469                    let send_compression_encodings = self.send_compression_encodings;
11470                    let max_decoding_message_size = self.max_decoding_message_size;
11471                    let max_encoding_message_size = self.max_encoding_message_size;
11472                    let inner = self.inner.clone();
11473                    let fut = async move {
11474                        let method = CheckSSOByDomainSvc(inner);
11475                        let codec = tonic_prost::ProstCodec::default();
11476                        let mut grpc = tonic::server::Grpc::new(codec)
11477                            .apply_compression_config(
11478                                accept_compression_encodings,
11479                                send_compression_encodings,
11480                            )
11481                            .apply_max_message_size_config(
11482                                max_decoding_message_size,
11483                                max_encoding_message_size,
11484                            );
11485                        let res = grpc.unary(method, req).await;
11486                        Ok(res)
11487                    };
11488                    Box::pin(fut)
11489                }
11490                "/pidgr.v1.SSOService/CreateSSOProvider" => {
11491                    #[allow(non_camel_case_types)]
11492                    struct CreateSSOProviderSvc<T: SsoService>(pub Arc<T>);
11493                    impl<
11494                        T: SsoService,
11495                    > tonic::server::UnaryService<super::CreateSsoProviderRequest>
11496                    for CreateSSOProviderSvc<T> {
11497                        type Response = super::CreateSsoProviderResponse;
11498                        type Future = BoxFuture<
11499                            tonic::Response<Self::Response>,
11500                            tonic::Status,
11501                        >;
11502                        fn call(
11503                            &mut self,
11504                            request: tonic::Request<super::CreateSsoProviderRequest>,
11505                        ) -> Self::Future {
11506                            let inner = Arc::clone(&self.0);
11507                            let fut = async move {
11508                                <T as SsoService>::create_sso_provider(&inner, request)
11509                                    .await
11510                            };
11511                            Box::pin(fut)
11512                        }
11513                    }
11514                    let accept_compression_encodings = self.accept_compression_encodings;
11515                    let send_compression_encodings = self.send_compression_encodings;
11516                    let max_decoding_message_size = self.max_decoding_message_size;
11517                    let max_encoding_message_size = self.max_encoding_message_size;
11518                    let inner = self.inner.clone();
11519                    let fut = async move {
11520                        let method = CreateSSOProviderSvc(inner);
11521                        let codec = tonic_prost::ProstCodec::default();
11522                        let mut grpc = tonic::server::Grpc::new(codec)
11523                            .apply_compression_config(
11524                                accept_compression_encodings,
11525                                send_compression_encodings,
11526                            )
11527                            .apply_max_message_size_config(
11528                                max_decoding_message_size,
11529                                max_encoding_message_size,
11530                            );
11531                        let res = grpc.unary(method, req).await;
11532                        Ok(res)
11533                    };
11534                    Box::pin(fut)
11535                }
11536                "/pidgr.v1.SSOService/GetSSOProvider" => {
11537                    #[allow(non_camel_case_types)]
11538                    struct GetSSOProviderSvc<T: SsoService>(pub Arc<T>);
11539                    impl<
11540                        T: SsoService,
11541                    > tonic::server::UnaryService<super::GetSsoProviderRequest>
11542                    for GetSSOProviderSvc<T> {
11543                        type Response = super::GetSsoProviderResponse;
11544                        type Future = BoxFuture<
11545                            tonic::Response<Self::Response>,
11546                            tonic::Status,
11547                        >;
11548                        fn call(
11549                            &mut self,
11550                            request: tonic::Request<super::GetSsoProviderRequest>,
11551                        ) -> Self::Future {
11552                            let inner = Arc::clone(&self.0);
11553                            let fut = async move {
11554                                <T as SsoService>::get_sso_provider(&inner, request).await
11555                            };
11556                            Box::pin(fut)
11557                        }
11558                    }
11559                    let accept_compression_encodings = self.accept_compression_encodings;
11560                    let send_compression_encodings = self.send_compression_encodings;
11561                    let max_decoding_message_size = self.max_decoding_message_size;
11562                    let max_encoding_message_size = self.max_encoding_message_size;
11563                    let inner = self.inner.clone();
11564                    let fut = async move {
11565                        let method = GetSSOProviderSvc(inner);
11566                        let codec = tonic_prost::ProstCodec::default();
11567                        let mut grpc = tonic::server::Grpc::new(codec)
11568                            .apply_compression_config(
11569                                accept_compression_encodings,
11570                                send_compression_encodings,
11571                            )
11572                            .apply_max_message_size_config(
11573                                max_decoding_message_size,
11574                                max_encoding_message_size,
11575                            );
11576                        let res = grpc.unary(method, req).await;
11577                        Ok(res)
11578                    };
11579                    Box::pin(fut)
11580                }
11581                "/pidgr.v1.SSOService/DeleteSSOProvider" => {
11582                    #[allow(non_camel_case_types)]
11583                    struct DeleteSSOProviderSvc<T: SsoService>(pub Arc<T>);
11584                    impl<
11585                        T: SsoService,
11586                    > tonic::server::UnaryService<super::DeleteSsoProviderRequest>
11587                    for DeleteSSOProviderSvc<T> {
11588                        type Response = super::DeleteSsoProviderResponse;
11589                        type Future = BoxFuture<
11590                            tonic::Response<Self::Response>,
11591                            tonic::Status,
11592                        >;
11593                        fn call(
11594                            &mut self,
11595                            request: tonic::Request<super::DeleteSsoProviderRequest>,
11596                        ) -> Self::Future {
11597                            let inner = Arc::clone(&self.0);
11598                            let fut = async move {
11599                                <T as SsoService>::delete_sso_provider(&inner, request)
11600                                    .await
11601                            };
11602                            Box::pin(fut)
11603                        }
11604                    }
11605                    let accept_compression_encodings = self.accept_compression_encodings;
11606                    let send_compression_encodings = self.send_compression_encodings;
11607                    let max_decoding_message_size = self.max_decoding_message_size;
11608                    let max_encoding_message_size = self.max_encoding_message_size;
11609                    let inner = self.inner.clone();
11610                    let fut = async move {
11611                        let method = DeleteSSOProviderSvc(inner);
11612                        let codec = tonic_prost::ProstCodec::default();
11613                        let mut grpc = tonic::server::Grpc::new(codec)
11614                            .apply_compression_config(
11615                                accept_compression_encodings,
11616                                send_compression_encodings,
11617                            )
11618                            .apply_max_message_size_config(
11619                                max_decoding_message_size,
11620                                max_encoding_message_size,
11621                            );
11622                        let res = grpc.unary(method, req).await;
11623                        Ok(res)
11624                    };
11625                    Box::pin(fut)
11626                }
11627                _ => {
11628                    Box::pin(async move {
11629                        let mut response = http::Response::new(
11630                            tonic::body::Body::default(),
11631                        );
11632                        let headers = response.headers_mut();
11633                        headers
11634                            .insert(
11635                                tonic::Status::GRPC_STATUS,
11636                                (tonic::Code::Unimplemented as i32).into(),
11637                            );
11638                        headers
11639                            .insert(
11640                                http::header::CONTENT_TYPE,
11641                                tonic::metadata::GRPC_CONTENT_TYPE,
11642                            );
11643                        Ok(response)
11644                    })
11645                }
11646            }
11647        }
11648    }
11649    impl<T> Clone for SsoServiceServer<T> {
11650        fn clone(&self) -> Self {
11651            let inner = self.inner.clone();
11652            Self {
11653                inner,
11654                accept_compression_encodings: self.accept_compression_encodings,
11655                send_compression_encodings: self.send_compression_encodings,
11656                max_decoding_message_size: self.max_decoding_message_size,
11657                max_encoding_message_size: self.max_encoding_message_size,
11658            }
11659        }
11660    }
11661    /// Generated gRPC service name
11662    pub const SERVICE_NAME: &str = "pidgr.v1.SSOService";
11663    impl<T> tonic::server::NamedService for SsoServiceServer<T> {
11664        const NAME: &'static str = SERVICE_NAME;
11665    }
11666}
11667/// Generated client implementations.
11668pub mod team_service_client {
11669    #![allow(
11670        unused_variables,
11671        dead_code,
11672        missing_docs,
11673        clippy::wildcard_imports,
11674        clippy::let_unit_value,
11675    )]
11676    use tonic::codegen::*;
11677    use tonic::codegen::http::Uri;
11678    /** Manages organizational teams (departments, divisions) within an organization.
11679 Teams represent the organizational structure and can serve as sender identity.
11680 All RPCs operate within the caller's org (extracted from JWT).
11681*/
11682    #[derive(Debug, Clone)]
11683    pub struct TeamServiceClient<T> {
11684        inner: tonic::client::Grpc<T>,
11685    }
11686    impl TeamServiceClient<tonic::transport::Channel> {
11687        /// Attempt to create a new client by connecting to a given endpoint.
11688        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
11689        where
11690            D: TryInto<tonic::transport::Endpoint>,
11691            D::Error: Into<StdError>,
11692        {
11693            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
11694            Ok(Self::new(conn))
11695        }
11696    }
11697    impl<T> TeamServiceClient<T>
11698    where
11699        T: tonic::client::GrpcService<tonic::body::Body>,
11700        T::Error: Into<StdError>,
11701        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
11702        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
11703    {
11704        pub fn new(inner: T) -> Self {
11705            let inner = tonic::client::Grpc::new(inner);
11706            Self { inner }
11707        }
11708        pub fn with_origin(inner: T, origin: Uri) -> Self {
11709            let inner = tonic::client::Grpc::with_origin(inner, origin);
11710            Self { inner }
11711        }
11712        pub fn with_interceptor<F>(
11713            inner: T,
11714            interceptor: F,
11715        ) -> TeamServiceClient<InterceptedService<T, F>>
11716        where
11717            F: tonic::service::Interceptor,
11718            T::ResponseBody: Default,
11719            T: tonic::codegen::Service<
11720                http::Request<tonic::body::Body>,
11721                Response = http::Response<
11722                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
11723                >,
11724            >,
11725            <T as tonic::codegen::Service<
11726                http::Request<tonic::body::Body>,
11727            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
11728        {
11729            TeamServiceClient::new(InterceptedService::new(inner, interceptor))
11730        }
11731        /// Compress requests with the given encoding.
11732        ///
11733        /// This requires the server to support it otherwise it might respond with an
11734        /// error.
11735        #[must_use]
11736        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11737            self.inner = self.inner.send_compressed(encoding);
11738            self
11739        }
11740        /// Enable decompressing responses.
11741        #[must_use]
11742        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11743            self.inner = self.inner.accept_compressed(encoding);
11744            self
11745        }
11746        /// Limits the maximum size of a decoded message.
11747        ///
11748        /// Default: `4MB`
11749        #[must_use]
11750        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11751            self.inner = self.inner.max_decoding_message_size(limit);
11752            self
11753        }
11754        /// Limits the maximum size of an encoded message.
11755        ///
11756        /// Default: `usize::MAX`
11757        #[must_use]
11758        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11759            self.inner = self.inner.max_encoding_message_size(limit);
11760            self
11761        }
11762        /** Create a new team in the organization.
11763 Authorization: Requires PERMISSION_TEAMS_WRITE or PERMISSION_TEAMS_ALL_WRITE.
11764*/
11765        pub async fn create_team(
11766            &mut self,
11767            request: impl tonic::IntoRequest<super::CreateTeamRequest>,
11768        ) -> std::result::Result<
11769            tonic::Response<super::CreateTeamResponse>,
11770            tonic::Status,
11771        > {
11772            self.inner
11773                .ready()
11774                .await
11775                .map_err(|e| {
11776                    tonic::Status::unknown(
11777                        format!("Service was not ready: {}", e.into()),
11778                    )
11779                })?;
11780            let codec = tonic_prost::ProstCodec::default();
11781            let path = http::uri::PathAndQuery::from_static(
11782                "/pidgr.v1.TeamService/CreateTeam",
11783            );
11784            let mut req = request.into_request();
11785            req.extensions_mut()
11786                .insert(GrpcMethod::new("pidgr.v1.TeamService", "CreateTeam"));
11787            self.inner.unary(req, path, codec).await
11788        }
11789        /** Retrieve a team by ID.
11790 Authorization: Caller must be a member of the team, or have
11791 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
11792*/
11793        pub async fn get_team(
11794            &mut self,
11795            request: impl tonic::IntoRequest<super::GetTeamRequest>,
11796        ) -> std::result::Result<
11797            tonic::Response<super::GetTeamResponse>,
11798            tonic::Status,
11799        > {
11800            self.inner
11801                .ready()
11802                .await
11803                .map_err(|e| {
11804                    tonic::Status::unknown(
11805                        format!("Service was not ready: {}", e.into()),
11806                    )
11807                })?;
11808            let codec = tonic_prost::ProstCodec::default();
11809            let path = http::uri::PathAndQuery::from_static(
11810                "/pidgr.v1.TeamService/GetTeam",
11811            );
11812            let mut req = request.into_request();
11813            req.extensions_mut()
11814                .insert(GrpcMethod::new("pidgr.v1.TeamService", "GetTeam"));
11815            self.inner.unary(req, path, codec).await
11816        }
11817        /** List teams in the organization with pagination.
11818 Without PERMISSION_TEAMS_ALL_READ/ALL_WRITE, returns only teams the caller belongs to.
11819*/
11820        pub async fn list_teams(
11821            &mut self,
11822            request: impl tonic::IntoRequest<super::ListTeamsRequest>,
11823        ) -> std::result::Result<
11824            tonic::Response<super::ListTeamsResponse>,
11825            tonic::Status,
11826        > {
11827            self.inner
11828                .ready()
11829                .await
11830                .map_err(|e| {
11831                    tonic::Status::unknown(
11832                        format!("Service was not ready: {}", e.into()),
11833                    )
11834                })?;
11835            let codec = tonic_prost::ProstCodec::default();
11836            let path = http::uri::PathAndQuery::from_static(
11837                "/pidgr.v1.TeamService/ListTeams",
11838            );
11839            let mut req = request.into_request();
11840            req.extensions_mut()
11841                .insert(GrpcMethod::new("pidgr.v1.TeamService", "ListTeams"));
11842            self.inner.unary(req, path, codec).await
11843        }
11844        /** Update a team's name and/or description.
11845 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
11846*/
11847        pub async fn update_team(
11848            &mut self,
11849            request: impl tonic::IntoRequest<super::UpdateTeamRequest>,
11850        ) -> std::result::Result<
11851            tonic::Response<super::UpdateTeamResponse>,
11852            tonic::Status,
11853        > {
11854            self.inner
11855                .ready()
11856                .await
11857                .map_err(|e| {
11858                    tonic::Status::unknown(
11859                        format!("Service was not ready: {}", e.into()),
11860                    )
11861                })?;
11862            let codec = tonic_prost::ProstCodec::default();
11863            let path = http::uri::PathAndQuery::from_static(
11864                "/pidgr.v1.TeamService/UpdateTeam",
11865            );
11866            let mut req = request.into_request();
11867            req.extensions_mut()
11868                .insert(GrpcMethod::new("pidgr.v1.TeamService", "UpdateTeam"));
11869            self.inner.unary(req, path, codec).await
11870        }
11871        /** Delete a team and all its membership records. Default teams cannot be deleted.
11872 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
11873*/
11874        pub async fn delete_team(
11875            &mut self,
11876            request: impl tonic::IntoRequest<super::DeleteTeamRequest>,
11877        ) -> std::result::Result<
11878            tonic::Response<super::DeleteTeamResponse>,
11879            tonic::Status,
11880        > {
11881            self.inner
11882                .ready()
11883                .await
11884                .map_err(|e| {
11885                    tonic::Status::unknown(
11886                        format!("Service was not ready: {}", e.into()),
11887                    )
11888                })?;
11889            let codec = tonic_prost::ProstCodec::default();
11890            let path = http::uri::PathAndQuery::from_static(
11891                "/pidgr.v1.TeamService/DeleteTeam",
11892            );
11893            let mut req = request.into_request();
11894            req.extensions_mut()
11895                .insert(GrpcMethod::new("pidgr.v1.TeamService", "DeleteTeam"));
11896            self.inner.unary(req, path, codec).await
11897        }
11898        /** Add one or more users to a team (idempotent).
11899 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
11900*/
11901        pub async fn add_team_members(
11902            &mut self,
11903            request: impl tonic::IntoRequest<super::AddTeamMembersRequest>,
11904        ) -> std::result::Result<
11905            tonic::Response<super::AddTeamMembersResponse>,
11906            tonic::Status,
11907        > {
11908            self.inner
11909                .ready()
11910                .await
11911                .map_err(|e| {
11912                    tonic::Status::unknown(
11913                        format!("Service was not ready: {}", e.into()),
11914                    )
11915                })?;
11916            let codec = tonic_prost::ProstCodec::default();
11917            let path = http::uri::PathAndQuery::from_static(
11918                "/pidgr.v1.TeamService/AddTeamMembers",
11919            );
11920            let mut req = request.into_request();
11921            req.extensions_mut()
11922                .insert(GrpcMethod::new("pidgr.v1.TeamService", "AddTeamMembers"));
11923            self.inner.unary(req, path, codec).await
11924        }
11925        /** Remove one or more users from a team (idempotent).
11926 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
11927*/
11928        pub async fn remove_team_members(
11929            &mut self,
11930            request: impl tonic::IntoRequest<super::RemoveTeamMembersRequest>,
11931        ) -> std::result::Result<
11932            tonic::Response<super::RemoveTeamMembersResponse>,
11933            tonic::Status,
11934        > {
11935            self.inner
11936                .ready()
11937                .await
11938                .map_err(|e| {
11939                    tonic::Status::unknown(
11940                        format!("Service was not ready: {}", e.into()),
11941                    )
11942                })?;
11943            let codec = tonic_prost::ProstCodec::default();
11944            let path = http::uri::PathAndQuery::from_static(
11945                "/pidgr.v1.TeamService/RemoveTeamMembers",
11946            );
11947            let mut req = request.into_request();
11948            req.extensions_mut()
11949                .insert(GrpcMethod::new("pidgr.v1.TeamService", "RemoveTeamMembers"));
11950            self.inner.unary(req, path, codec).await
11951        }
11952        /** List members of a team with pagination.
11953 Authorization: Caller must be a member of the team, or have
11954 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
11955*/
11956        pub async fn list_team_members(
11957            &mut self,
11958            request: impl tonic::IntoRequest<super::ListTeamMembersRequest>,
11959        ) -> std::result::Result<
11960            tonic::Response<super::ListTeamMembersResponse>,
11961            tonic::Status,
11962        > {
11963            self.inner
11964                .ready()
11965                .await
11966                .map_err(|e| {
11967                    tonic::Status::unknown(
11968                        format!("Service was not ready: {}", e.into()),
11969                    )
11970                })?;
11971            let codec = tonic_prost::ProstCodec::default();
11972            let path = http::uri::PathAndQuery::from_static(
11973                "/pidgr.v1.TeamService/ListTeamMembers",
11974            );
11975            let mut req = request.into_request();
11976            req.extensions_mut()
11977                .insert(GrpcMethod::new("pidgr.v1.TeamService", "ListTeamMembers"));
11978            self.inner.unary(req, path, codec).await
11979        }
11980    }
11981}
11982/// Generated server implementations.
11983pub mod team_service_server {
11984    #![allow(
11985        unused_variables,
11986        dead_code,
11987        missing_docs,
11988        clippy::wildcard_imports,
11989        clippy::let_unit_value,
11990    )]
11991    use tonic::codegen::*;
11992    /// Generated trait containing gRPC methods that should be implemented for use with TeamServiceServer.
11993    #[async_trait]
11994    pub trait TeamService: std::marker::Send + std::marker::Sync + 'static {
11995        /** Create a new team in the organization.
11996 Authorization: Requires PERMISSION_TEAMS_WRITE or PERMISSION_TEAMS_ALL_WRITE.
11997*/
11998        async fn create_team(
11999            &self,
12000            request: tonic::Request<super::CreateTeamRequest>,
12001        ) -> std::result::Result<
12002            tonic::Response<super::CreateTeamResponse>,
12003            tonic::Status,
12004        >;
12005        /** Retrieve a team by ID.
12006 Authorization: Caller must be a member of the team, or have
12007 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
12008*/
12009        async fn get_team(
12010            &self,
12011            request: tonic::Request<super::GetTeamRequest>,
12012        ) -> std::result::Result<tonic::Response<super::GetTeamResponse>, tonic::Status>;
12013        /** List teams in the organization with pagination.
12014 Without PERMISSION_TEAMS_ALL_READ/ALL_WRITE, returns only teams the caller belongs to.
12015*/
12016        async fn list_teams(
12017            &self,
12018            request: tonic::Request<super::ListTeamsRequest>,
12019        ) -> std::result::Result<
12020            tonic::Response<super::ListTeamsResponse>,
12021            tonic::Status,
12022        >;
12023        /** Update a team's name and/or description.
12024 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
12025*/
12026        async fn update_team(
12027            &self,
12028            request: tonic::Request<super::UpdateTeamRequest>,
12029        ) -> std::result::Result<
12030            tonic::Response<super::UpdateTeamResponse>,
12031            tonic::Status,
12032        >;
12033        /** Delete a team and all its membership records. Default teams cannot be deleted.
12034 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
12035*/
12036        async fn delete_team(
12037            &self,
12038            request: tonic::Request<super::DeleteTeamRequest>,
12039        ) -> std::result::Result<
12040            tonic::Response<super::DeleteTeamResponse>,
12041            tonic::Status,
12042        >;
12043        /** Add one or more users to a team (idempotent).
12044 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
12045*/
12046        async fn add_team_members(
12047            &self,
12048            request: tonic::Request<super::AddTeamMembersRequest>,
12049        ) -> std::result::Result<
12050            tonic::Response<super::AddTeamMembersResponse>,
12051            tonic::Status,
12052        >;
12053        /** Remove one or more users from a team (idempotent).
12054 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
12055*/
12056        async fn remove_team_members(
12057            &self,
12058            request: tonic::Request<super::RemoveTeamMembersRequest>,
12059        ) -> std::result::Result<
12060            tonic::Response<super::RemoveTeamMembersResponse>,
12061            tonic::Status,
12062        >;
12063        /** List members of a team with pagination.
12064 Authorization: Caller must be a member of the team, or have
12065 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
12066*/
12067        async fn list_team_members(
12068            &self,
12069            request: tonic::Request<super::ListTeamMembersRequest>,
12070        ) -> std::result::Result<
12071            tonic::Response<super::ListTeamMembersResponse>,
12072            tonic::Status,
12073        >;
12074    }
12075    /** Manages organizational teams (departments, divisions) within an organization.
12076 Teams represent the organizational structure and can serve as sender identity.
12077 All RPCs operate within the caller's org (extracted from JWT).
12078*/
12079    #[derive(Debug)]
12080    pub struct TeamServiceServer<T> {
12081        inner: Arc<T>,
12082        accept_compression_encodings: EnabledCompressionEncodings,
12083        send_compression_encodings: EnabledCompressionEncodings,
12084        max_decoding_message_size: Option<usize>,
12085        max_encoding_message_size: Option<usize>,
12086    }
12087    impl<T> TeamServiceServer<T> {
12088        pub fn new(inner: T) -> Self {
12089            Self::from_arc(Arc::new(inner))
12090        }
12091        pub fn from_arc(inner: Arc<T>) -> Self {
12092            Self {
12093                inner,
12094                accept_compression_encodings: Default::default(),
12095                send_compression_encodings: Default::default(),
12096                max_decoding_message_size: None,
12097                max_encoding_message_size: None,
12098            }
12099        }
12100        pub fn with_interceptor<F>(
12101            inner: T,
12102            interceptor: F,
12103        ) -> InterceptedService<Self, F>
12104        where
12105            F: tonic::service::Interceptor,
12106        {
12107            InterceptedService::new(Self::new(inner), interceptor)
12108        }
12109        /// Enable decompressing requests with the given encoding.
12110        #[must_use]
12111        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
12112            self.accept_compression_encodings.enable(encoding);
12113            self
12114        }
12115        /// Compress responses with the given encoding, if the client supports it.
12116        #[must_use]
12117        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
12118            self.send_compression_encodings.enable(encoding);
12119            self
12120        }
12121        /// Limits the maximum size of a decoded message.
12122        ///
12123        /// Default: `4MB`
12124        #[must_use]
12125        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
12126            self.max_decoding_message_size = Some(limit);
12127            self
12128        }
12129        /// Limits the maximum size of an encoded message.
12130        ///
12131        /// Default: `usize::MAX`
12132        #[must_use]
12133        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
12134            self.max_encoding_message_size = Some(limit);
12135            self
12136        }
12137    }
12138    impl<T, B> tonic::codegen::Service<http::Request<B>> for TeamServiceServer<T>
12139    where
12140        T: TeamService,
12141        B: Body + std::marker::Send + 'static,
12142        B::Error: Into<StdError> + std::marker::Send + 'static,
12143    {
12144        type Response = http::Response<tonic::body::Body>;
12145        type Error = std::convert::Infallible;
12146        type Future = BoxFuture<Self::Response, Self::Error>;
12147        fn poll_ready(
12148            &mut self,
12149            _cx: &mut Context<'_>,
12150        ) -> Poll<std::result::Result<(), Self::Error>> {
12151            Poll::Ready(Ok(()))
12152        }
12153        fn call(&mut self, req: http::Request<B>) -> Self::Future {
12154            match req.uri().path() {
12155                "/pidgr.v1.TeamService/CreateTeam" => {
12156                    #[allow(non_camel_case_types)]
12157                    struct CreateTeamSvc<T: TeamService>(pub Arc<T>);
12158                    impl<
12159                        T: TeamService,
12160                    > tonic::server::UnaryService<super::CreateTeamRequest>
12161                    for CreateTeamSvc<T> {
12162                        type Response = super::CreateTeamResponse;
12163                        type Future = BoxFuture<
12164                            tonic::Response<Self::Response>,
12165                            tonic::Status,
12166                        >;
12167                        fn call(
12168                            &mut self,
12169                            request: tonic::Request<super::CreateTeamRequest>,
12170                        ) -> Self::Future {
12171                            let inner = Arc::clone(&self.0);
12172                            let fut = async move {
12173                                <T as TeamService>::create_team(&inner, request).await
12174                            };
12175                            Box::pin(fut)
12176                        }
12177                    }
12178                    let accept_compression_encodings = self.accept_compression_encodings;
12179                    let send_compression_encodings = self.send_compression_encodings;
12180                    let max_decoding_message_size = self.max_decoding_message_size;
12181                    let max_encoding_message_size = self.max_encoding_message_size;
12182                    let inner = self.inner.clone();
12183                    let fut = async move {
12184                        let method = CreateTeamSvc(inner);
12185                        let codec = tonic_prost::ProstCodec::default();
12186                        let mut grpc = tonic::server::Grpc::new(codec)
12187                            .apply_compression_config(
12188                                accept_compression_encodings,
12189                                send_compression_encodings,
12190                            )
12191                            .apply_max_message_size_config(
12192                                max_decoding_message_size,
12193                                max_encoding_message_size,
12194                            );
12195                        let res = grpc.unary(method, req).await;
12196                        Ok(res)
12197                    };
12198                    Box::pin(fut)
12199                }
12200                "/pidgr.v1.TeamService/GetTeam" => {
12201                    #[allow(non_camel_case_types)]
12202                    struct GetTeamSvc<T: TeamService>(pub Arc<T>);
12203                    impl<
12204                        T: TeamService,
12205                    > tonic::server::UnaryService<super::GetTeamRequest>
12206                    for GetTeamSvc<T> {
12207                        type Response = super::GetTeamResponse;
12208                        type Future = BoxFuture<
12209                            tonic::Response<Self::Response>,
12210                            tonic::Status,
12211                        >;
12212                        fn call(
12213                            &mut self,
12214                            request: tonic::Request<super::GetTeamRequest>,
12215                        ) -> Self::Future {
12216                            let inner = Arc::clone(&self.0);
12217                            let fut = async move {
12218                                <T as TeamService>::get_team(&inner, request).await
12219                            };
12220                            Box::pin(fut)
12221                        }
12222                    }
12223                    let accept_compression_encodings = self.accept_compression_encodings;
12224                    let send_compression_encodings = self.send_compression_encodings;
12225                    let max_decoding_message_size = self.max_decoding_message_size;
12226                    let max_encoding_message_size = self.max_encoding_message_size;
12227                    let inner = self.inner.clone();
12228                    let fut = async move {
12229                        let method = GetTeamSvc(inner);
12230                        let codec = tonic_prost::ProstCodec::default();
12231                        let mut grpc = tonic::server::Grpc::new(codec)
12232                            .apply_compression_config(
12233                                accept_compression_encodings,
12234                                send_compression_encodings,
12235                            )
12236                            .apply_max_message_size_config(
12237                                max_decoding_message_size,
12238                                max_encoding_message_size,
12239                            );
12240                        let res = grpc.unary(method, req).await;
12241                        Ok(res)
12242                    };
12243                    Box::pin(fut)
12244                }
12245                "/pidgr.v1.TeamService/ListTeams" => {
12246                    #[allow(non_camel_case_types)]
12247                    struct ListTeamsSvc<T: TeamService>(pub Arc<T>);
12248                    impl<
12249                        T: TeamService,
12250                    > tonic::server::UnaryService<super::ListTeamsRequest>
12251                    for ListTeamsSvc<T> {
12252                        type Response = super::ListTeamsResponse;
12253                        type Future = BoxFuture<
12254                            tonic::Response<Self::Response>,
12255                            tonic::Status,
12256                        >;
12257                        fn call(
12258                            &mut self,
12259                            request: tonic::Request<super::ListTeamsRequest>,
12260                        ) -> Self::Future {
12261                            let inner = Arc::clone(&self.0);
12262                            let fut = async move {
12263                                <T as TeamService>::list_teams(&inner, request).await
12264                            };
12265                            Box::pin(fut)
12266                        }
12267                    }
12268                    let accept_compression_encodings = self.accept_compression_encodings;
12269                    let send_compression_encodings = self.send_compression_encodings;
12270                    let max_decoding_message_size = self.max_decoding_message_size;
12271                    let max_encoding_message_size = self.max_encoding_message_size;
12272                    let inner = self.inner.clone();
12273                    let fut = async move {
12274                        let method = ListTeamsSvc(inner);
12275                        let codec = tonic_prost::ProstCodec::default();
12276                        let mut grpc = tonic::server::Grpc::new(codec)
12277                            .apply_compression_config(
12278                                accept_compression_encodings,
12279                                send_compression_encodings,
12280                            )
12281                            .apply_max_message_size_config(
12282                                max_decoding_message_size,
12283                                max_encoding_message_size,
12284                            );
12285                        let res = grpc.unary(method, req).await;
12286                        Ok(res)
12287                    };
12288                    Box::pin(fut)
12289                }
12290                "/pidgr.v1.TeamService/UpdateTeam" => {
12291                    #[allow(non_camel_case_types)]
12292                    struct UpdateTeamSvc<T: TeamService>(pub Arc<T>);
12293                    impl<
12294                        T: TeamService,
12295                    > tonic::server::UnaryService<super::UpdateTeamRequest>
12296                    for UpdateTeamSvc<T> {
12297                        type Response = super::UpdateTeamResponse;
12298                        type Future = BoxFuture<
12299                            tonic::Response<Self::Response>,
12300                            tonic::Status,
12301                        >;
12302                        fn call(
12303                            &mut self,
12304                            request: tonic::Request<super::UpdateTeamRequest>,
12305                        ) -> Self::Future {
12306                            let inner = Arc::clone(&self.0);
12307                            let fut = async move {
12308                                <T as TeamService>::update_team(&inner, request).await
12309                            };
12310                            Box::pin(fut)
12311                        }
12312                    }
12313                    let accept_compression_encodings = self.accept_compression_encodings;
12314                    let send_compression_encodings = self.send_compression_encodings;
12315                    let max_decoding_message_size = self.max_decoding_message_size;
12316                    let max_encoding_message_size = self.max_encoding_message_size;
12317                    let inner = self.inner.clone();
12318                    let fut = async move {
12319                        let method = UpdateTeamSvc(inner);
12320                        let codec = tonic_prost::ProstCodec::default();
12321                        let mut grpc = tonic::server::Grpc::new(codec)
12322                            .apply_compression_config(
12323                                accept_compression_encodings,
12324                                send_compression_encodings,
12325                            )
12326                            .apply_max_message_size_config(
12327                                max_decoding_message_size,
12328                                max_encoding_message_size,
12329                            );
12330                        let res = grpc.unary(method, req).await;
12331                        Ok(res)
12332                    };
12333                    Box::pin(fut)
12334                }
12335                "/pidgr.v1.TeamService/DeleteTeam" => {
12336                    #[allow(non_camel_case_types)]
12337                    struct DeleteTeamSvc<T: TeamService>(pub Arc<T>);
12338                    impl<
12339                        T: TeamService,
12340                    > tonic::server::UnaryService<super::DeleteTeamRequest>
12341                    for DeleteTeamSvc<T> {
12342                        type Response = super::DeleteTeamResponse;
12343                        type Future = BoxFuture<
12344                            tonic::Response<Self::Response>,
12345                            tonic::Status,
12346                        >;
12347                        fn call(
12348                            &mut self,
12349                            request: tonic::Request<super::DeleteTeamRequest>,
12350                        ) -> Self::Future {
12351                            let inner = Arc::clone(&self.0);
12352                            let fut = async move {
12353                                <T as TeamService>::delete_team(&inner, request).await
12354                            };
12355                            Box::pin(fut)
12356                        }
12357                    }
12358                    let accept_compression_encodings = self.accept_compression_encodings;
12359                    let send_compression_encodings = self.send_compression_encodings;
12360                    let max_decoding_message_size = self.max_decoding_message_size;
12361                    let max_encoding_message_size = self.max_encoding_message_size;
12362                    let inner = self.inner.clone();
12363                    let fut = async move {
12364                        let method = DeleteTeamSvc(inner);
12365                        let codec = tonic_prost::ProstCodec::default();
12366                        let mut grpc = tonic::server::Grpc::new(codec)
12367                            .apply_compression_config(
12368                                accept_compression_encodings,
12369                                send_compression_encodings,
12370                            )
12371                            .apply_max_message_size_config(
12372                                max_decoding_message_size,
12373                                max_encoding_message_size,
12374                            );
12375                        let res = grpc.unary(method, req).await;
12376                        Ok(res)
12377                    };
12378                    Box::pin(fut)
12379                }
12380                "/pidgr.v1.TeamService/AddTeamMembers" => {
12381                    #[allow(non_camel_case_types)]
12382                    struct AddTeamMembersSvc<T: TeamService>(pub Arc<T>);
12383                    impl<
12384                        T: TeamService,
12385                    > tonic::server::UnaryService<super::AddTeamMembersRequest>
12386                    for AddTeamMembersSvc<T> {
12387                        type Response = super::AddTeamMembersResponse;
12388                        type Future = BoxFuture<
12389                            tonic::Response<Self::Response>,
12390                            tonic::Status,
12391                        >;
12392                        fn call(
12393                            &mut self,
12394                            request: tonic::Request<super::AddTeamMembersRequest>,
12395                        ) -> Self::Future {
12396                            let inner = Arc::clone(&self.0);
12397                            let fut = async move {
12398                                <T as TeamService>::add_team_members(&inner, request).await
12399                            };
12400                            Box::pin(fut)
12401                        }
12402                    }
12403                    let accept_compression_encodings = self.accept_compression_encodings;
12404                    let send_compression_encodings = self.send_compression_encodings;
12405                    let max_decoding_message_size = self.max_decoding_message_size;
12406                    let max_encoding_message_size = self.max_encoding_message_size;
12407                    let inner = self.inner.clone();
12408                    let fut = async move {
12409                        let method = AddTeamMembersSvc(inner);
12410                        let codec = tonic_prost::ProstCodec::default();
12411                        let mut grpc = tonic::server::Grpc::new(codec)
12412                            .apply_compression_config(
12413                                accept_compression_encodings,
12414                                send_compression_encodings,
12415                            )
12416                            .apply_max_message_size_config(
12417                                max_decoding_message_size,
12418                                max_encoding_message_size,
12419                            );
12420                        let res = grpc.unary(method, req).await;
12421                        Ok(res)
12422                    };
12423                    Box::pin(fut)
12424                }
12425                "/pidgr.v1.TeamService/RemoveTeamMembers" => {
12426                    #[allow(non_camel_case_types)]
12427                    struct RemoveTeamMembersSvc<T: TeamService>(pub Arc<T>);
12428                    impl<
12429                        T: TeamService,
12430                    > tonic::server::UnaryService<super::RemoveTeamMembersRequest>
12431                    for RemoveTeamMembersSvc<T> {
12432                        type Response = super::RemoveTeamMembersResponse;
12433                        type Future = BoxFuture<
12434                            tonic::Response<Self::Response>,
12435                            tonic::Status,
12436                        >;
12437                        fn call(
12438                            &mut self,
12439                            request: tonic::Request<super::RemoveTeamMembersRequest>,
12440                        ) -> Self::Future {
12441                            let inner = Arc::clone(&self.0);
12442                            let fut = async move {
12443                                <T as TeamService>::remove_team_members(&inner, request)
12444                                    .await
12445                            };
12446                            Box::pin(fut)
12447                        }
12448                    }
12449                    let accept_compression_encodings = self.accept_compression_encodings;
12450                    let send_compression_encodings = self.send_compression_encodings;
12451                    let max_decoding_message_size = self.max_decoding_message_size;
12452                    let max_encoding_message_size = self.max_encoding_message_size;
12453                    let inner = self.inner.clone();
12454                    let fut = async move {
12455                        let method = RemoveTeamMembersSvc(inner);
12456                        let codec = tonic_prost::ProstCodec::default();
12457                        let mut grpc = tonic::server::Grpc::new(codec)
12458                            .apply_compression_config(
12459                                accept_compression_encodings,
12460                                send_compression_encodings,
12461                            )
12462                            .apply_max_message_size_config(
12463                                max_decoding_message_size,
12464                                max_encoding_message_size,
12465                            );
12466                        let res = grpc.unary(method, req).await;
12467                        Ok(res)
12468                    };
12469                    Box::pin(fut)
12470                }
12471                "/pidgr.v1.TeamService/ListTeamMembers" => {
12472                    #[allow(non_camel_case_types)]
12473                    struct ListTeamMembersSvc<T: TeamService>(pub Arc<T>);
12474                    impl<
12475                        T: TeamService,
12476                    > tonic::server::UnaryService<super::ListTeamMembersRequest>
12477                    for ListTeamMembersSvc<T> {
12478                        type Response = super::ListTeamMembersResponse;
12479                        type Future = BoxFuture<
12480                            tonic::Response<Self::Response>,
12481                            tonic::Status,
12482                        >;
12483                        fn call(
12484                            &mut self,
12485                            request: tonic::Request<super::ListTeamMembersRequest>,
12486                        ) -> Self::Future {
12487                            let inner = Arc::clone(&self.0);
12488                            let fut = async move {
12489                                <T as TeamService>::list_team_members(&inner, request).await
12490                            };
12491                            Box::pin(fut)
12492                        }
12493                    }
12494                    let accept_compression_encodings = self.accept_compression_encodings;
12495                    let send_compression_encodings = self.send_compression_encodings;
12496                    let max_decoding_message_size = self.max_decoding_message_size;
12497                    let max_encoding_message_size = self.max_encoding_message_size;
12498                    let inner = self.inner.clone();
12499                    let fut = async move {
12500                        let method = ListTeamMembersSvc(inner);
12501                        let codec = tonic_prost::ProstCodec::default();
12502                        let mut grpc = tonic::server::Grpc::new(codec)
12503                            .apply_compression_config(
12504                                accept_compression_encodings,
12505                                send_compression_encodings,
12506                            )
12507                            .apply_max_message_size_config(
12508                                max_decoding_message_size,
12509                                max_encoding_message_size,
12510                            );
12511                        let res = grpc.unary(method, req).await;
12512                        Ok(res)
12513                    };
12514                    Box::pin(fut)
12515                }
12516                _ => {
12517                    Box::pin(async move {
12518                        let mut response = http::Response::new(
12519                            tonic::body::Body::default(),
12520                        );
12521                        let headers = response.headers_mut();
12522                        headers
12523                            .insert(
12524                                tonic::Status::GRPC_STATUS,
12525                                (tonic::Code::Unimplemented as i32).into(),
12526                            );
12527                        headers
12528                            .insert(
12529                                http::header::CONTENT_TYPE,
12530                                tonic::metadata::GRPC_CONTENT_TYPE,
12531                            );
12532                        Ok(response)
12533                    })
12534                }
12535            }
12536        }
12537    }
12538    impl<T> Clone for TeamServiceServer<T> {
12539        fn clone(&self) -> Self {
12540            let inner = self.inner.clone();
12541            Self {
12542                inner,
12543                accept_compression_encodings: self.accept_compression_encodings,
12544                send_compression_encodings: self.send_compression_encodings,
12545                max_decoding_message_size: self.max_decoding_message_size,
12546                max_encoding_message_size: self.max_encoding_message_size,
12547            }
12548        }
12549    }
12550    /// Generated gRPC service name
12551    pub const SERVICE_NAME: &str = "pidgr.v1.TeamService";
12552    impl<T> tonic::server::NamedService for TeamServiceServer<T> {
12553        const NAME: &'static str = SERVICE_NAME;
12554    }
12555}
12556/// Generated client implementations.
12557pub mod template_service_client {
12558    #![allow(
12559        unused_variables,
12560        dead_code,
12561        missing_docs,
12562        clippy::wildcard_imports,
12563        clippy::let_unit_value,
12564    )]
12565    use tonic::codegen::*;
12566    use tonic::codegen::http::Uri;
12567    /** Manages versioned message templates used by campaigns.
12568 Templates are append-only — updates create new versions while preserving history.
12569*/
12570    #[derive(Debug, Clone)]
12571    pub struct TemplateServiceClient<T> {
12572        inner: tonic::client::Grpc<T>,
12573    }
12574    impl TemplateServiceClient<tonic::transport::Channel> {
12575        /// Attempt to create a new client by connecting to a given endpoint.
12576        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
12577        where
12578            D: TryInto<tonic::transport::Endpoint>,
12579            D::Error: Into<StdError>,
12580        {
12581            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
12582            Ok(Self::new(conn))
12583        }
12584    }
12585    impl<T> TemplateServiceClient<T>
12586    where
12587        T: tonic::client::GrpcService<tonic::body::Body>,
12588        T::Error: Into<StdError>,
12589        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
12590        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
12591    {
12592        pub fn new(inner: T) -> Self {
12593            let inner = tonic::client::Grpc::new(inner);
12594            Self { inner }
12595        }
12596        pub fn with_origin(inner: T, origin: Uri) -> Self {
12597            let inner = tonic::client::Grpc::with_origin(inner, origin);
12598            Self { inner }
12599        }
12600        pub fn with_interceptor<F>(
12601            inner: T,
12602            interceptor: F,
12603        ) -> TemplateServiceClient<InterceptedService<T, F>>
12604        where
12605            F: tonic::service::Interceptor,
12606            T::ResponseBody: Default,
12607            T: tonic::codegen::Service<
12608                http::Request<tonic::body::Body>,
12609                Response = http::Response<
12610                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
12611                >,
12612            >,
12613            <T as tonic::codegen::Service<
12614                http::Request<tonic::body::Body>,
12615            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
12616        {
12617            TemplateServiceClient::new(InterceptedService::new(inner, interceptor))
12618        }
12619        /// Compress requests with the given encoding.
12620        ///
12621        /// This requires the server to support it otherwise it might respond with an
12622        /// error.
12623        #[must_use]
12624        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
12625            self.inner = self.inner.send_compressed(encoding);
12626            self
12627        }
12628        /// Enable decompressing responses.
12629        #[must_use]
12630        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
12631            self.inner = self.inner.accept_compressed(encoding);
12632            self
12633        }
12634        /// Limits the maximum size of a decoded message.
12635        ///
12636        /// Default: `4MB`
12637        #[must_use]
12638        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
12639            self.inner = self.inner.max_decoding_message_size(limit);
12640            self
12641        }
12642        /// Limits the maximum size of an encoded message.
12643        ///
12644        /// Default: `usize::MAX`
12645        #[must_use]
12646        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
12647            self.inner = self.inner.max_encoding_message_size(limit);
12648            self
12649        }
12650        /** Create a new template with a body and variable definitions.
12651 Authorization: Requires MANAGER+ role.
12652*/
12653        pub async fn create_template(
12654            &mut self,
12655            request: impl tonic::IntoRequest<super::CreateTemplateRequest>,
12656        ) -> std::result::Result<
12657            tonic::Response<super::CreateTemplateResponse>,
12658            tonic::Status,
12659        > {
12660            self.inner
12661                .ready()
12662                .await
12663                .map_err(|e| {
12664                    tonic::Status::unknown(
12665                        format!("Service was not ready: {}", e.into()),
12666                    )
12667                })?;
12668            let codec = tonic_prost::ProstCodec::default();
12669            let path = http::uri::PathAndQuery::from_static(
12670                "/pidgr.v1.TemplateService/CreateTemplate",
12671            );
12672            let mut req = request.into_request();
12673            req.extensions_mut()
12674                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "CreateTemplate"));
12675            self.inner.unary(req, path, codec).await
12676        }
12677        /** Update an existing template, creating a new version.
12678 Authorization: Requires MANAGER+ role.
12679*/
12680        pub async fn update_template(
12681            &mut self,
12682            request: impl tonic::IntoRequest<super::UpdateTemplateRequest>,
12683        ) -> std::result::Result<
12684            tonic::Response<super::UpdateTemplateResponse>,
12685            tonic::Status,
12686        > {
12687            self.inner
12688                .ready()
12689                .await
12690                .map_err(|e| {
12691                    tonic::Status::unknown(
12692                        format!("Service was not ready: {}", e.into()),
12693                    )
12694                })?;
12695            let codec = tonic_prost::ProstCodec::default();
12696            let path = http::uri::PathAndQuery::from_static(
12697                "/pidgr.v1.TemplateService/UpdateTemplate",
12698            );
12699            let mut req = request.into_request();
12700            req.extensions_mut()
12701                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "UpdateTemplate"));
12702            self.inner.unary(req, path, codec).await
12703        }
12704        /** Retrieve a specific template by ID and optional version.
12705 Authorization: Authenticated user within the organization.
12706*/
12707        pub async fn get_template(
12708            &mut self,
12709            request: impl tonic::IntoRequest<super::GetTemplateRequest>,
12710        ) -> std::result::Result<
12711            tonic::Response<super::GetTemplateResponse>,
12712            tonic::Status,
12713        > {
12714            self.inner
12715                .ready()
12716                .await
12717                .map_err(|e| {
12718                    tonic::Status::unknown(
12719                        format!("Service was not ready: {}", e.into()),
12720                    )
12721                })?;
12722            let codec = tonic_prost::ProstCodec::default();
12723            let path = http::uri::PathAndQuery::from_static(
12724                "/pidgr.v1.TemplateService/GetTemplate",
12725            );
12726            let mut req = request.into_request();
12727            req.extensions_mut()
12728                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "GetTemplate"));
12729            self.inner.unary(req, path, codec).await
12730        }
12731        /** List all templates for the organization with pagination.
12732 Authorization: Authenticated user within the organization.
12733*/
12734        pub async fn list_templates(
12735            &mut self,
12736            request: impl tonic::IntoRequest<super::ListTemplatesRequest>,
12737        ) -> std::result::Result<
12738            tonic::Response<super::ListTemplatesResponse>,
12739            tonic::Status,
12740        > {
12741            self.inner
12742                .ready()
12743                .await
12744                .map_err(|e| {
12745                    tonic::Status::unknown(
12746                        format!("Service was not ready: {}", e.into()),
12747                    )
12748                })?;
12749            let codec = tonic_prost::ProstCodec::default();
12750            let path = http::uri::PathAndQuery::from_static(
12751                "/pidgr.v1.TemplateService/ListTemplates",
12752            );
12753            let mut req = request.into_request();
12754            req.extensions_mut()
12755                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "ListTemplates"));
12756            self.inner.unary(req, path, codec).await
12757        }
12758        /** Create a locale-specific translation of a template.
12759 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
12760*/
12761        pub async fn create_template_translation(
12762            &mut self,
12763            request: impl tonic::IntoRequest<super::CreateTemplateTranslationRequest>,
12764        ) -> std::result::Result<
12765            tonic::Response<super::CreateTemplateTranslationResponse>,
12766            tonic::Status,
12767        > {
12768            self.inner
12769                .ready()
12770                .await
12771                .map_err(|e| {
12772                    tonic::Status::unknown(
12773                        format!("Service was not ready: {}", e.into()),
12774                    )
12775                })?;
12776            let codec = tonic_prost::ProstCodec::default();
12777            let path = http::uri::PathAndQuery::from_static(
12778                "/pidgr.v1.TemplateService/CreateTemplateTranslation",
12779            );
12780            let mut req = request.into_request();
12781            req.extensions_mut()
12782                .insert(
12783                    GrpcMethod::new(
12784                        "pidgr.v1.TemplateService",
12785                        "CreateTemplateTranslation",
12786                    ),
12787                );
12788            self.inner.unary(req, path, codec).await
12789        }
12790        /** Update an existing template translation.
12791 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
12792*/
12793        pub async fn update_template_translation(
12794            &mut self,
12795            request: impl tonic::IntoRequest<super::UpdateTemplateTranslationRequest>,
12796        ) -> std::result::Result<
12797            tonic::Response<super::UpdateTemplateTranslationResponse>,
12798            tonic::Status,
12799        > {
12800            self.inner
12801                .ready()
12802                .await
12803                .map_err(|e| {
12804                    tonic::Status::unknown(
12805                        format!("Service was not ready: {}", e.into()),
12806                    )
12807                })?;
12808            let codec = tonic_prost::ProstCodec::default();
12809            let path = http::uri::PathAndQuery::from_static(
12810                "/pidgr.v1.TemplateService/UpdateTemplateTranslation",
12811            );
12812            let mut req = request.into_request();
12813            req.extensions_mut()
12814                .insert(
12815                    GrpcMethod::new(
12816                        "pidgr.v1.TemplateService",
12817                        "UpdateTemplateTranslation",
12818                    ),
12819                );
12820            self.inner.unary(req, path, codec).await
12821        }
12822        /** List all translations for a template version.
12823 Authorization: Requires PERMISSION_TEMPLATES_READ.
12824*/
12825        pub async fn list_template_translations(
12826            &mut self,
12827            request: impl tonic::IntoRequest<super::ListTemplateTranslationsRequest>,
12828        ) -> std::result::Result<
12829            tonic::Response<super::ListTemplateTranslationsResponse>,
12830            tonic::Status,
12831        > {
12832            self.inner
12833                .ready()
12834                .await
12835                .map_err(|e| {
12836                    tonic::Status::unknown(
12837                        format!("Service was not ready: {}", e.into()),
12838                    )
12839                })?;
12840            let codec = tonic_prost::ProstCodec::default();
12841            let path = http::uri::PathAndQuery::from_static(
12842                "/pidgr.v1.TemplateService/ListTemplateTranslations",
12843            );
12844            let mut req = request.into_request();
12845            req.extensions_mut()
12846                .insert(
12847                    GrpcMethod::new(
12848                        "pidgr.v1.TemplateService",
12849                        "ListTemplateTranslations",
12850                    ),
12851                );
12852            self.inner.unary(req, path, codec).await
12853        }
12854        /** Approve a template translation for use in campaigns.
12855 Authorization: Requires PERMISSION_TEMPLATES_REVIEW.
12856*/
12857        pub async fn approve_template_translation(
12858            &mut self,
12859            request: impl tonic::IntoRequest<super::ApproveTemplateTranslationRequest>,
12860        ) -> std::result::Result<
12861            tonic::Response<super::ApproveTemplateTranslationResponse>,
12862            tonic::Status,
12863        > {
12864            self.inner
12865                .ready()
12866                .await
12867                .map_err(|e| {
12868                    tonic::Status::unknown(
12869                        format!("Service was not ready: {}", e.into()),
12870                    )
12871                })?;
12872            let codec = tonic_prost::ProstCodec::default();
12873            let path = http::uri::PathAndQuery::from_static(
12874                "/pidgr.v1.TemplateService/ApproveTemplateTranslation",
12875            );
12876            let mut req = request.into_request();
12877            req.extensions_mut()
12878                .insert(
12879                    GrpcMethod::new(
12880                        "pidgr.v1.TemplateService",
12881                        "ApproveTemplateTranslation",
12882                    ),
12883                );
12884            self.inner.unary(req, path, codec).await
12885        }
12886    }
12887}
12888/// Generated server implementations.
12889pub mod template_service_server {
12890    #![allow(
12891        unused_variables,
12892        dead_code,
12893        missing_docs,
12894        clippy::wildcard_imports,
12895        clippy::let_unit_value,
12896    )]
12897    use tonic::codegen::*;
12898    /// Generated trait containing gRPC methods that should be implemented for use with TemplateServiceServer.
12899    #[async_trait]
12900    pub trait TemplateService: std::marker::Send + std::marker::Sync + 'static {
12901        /** Create a new template with a body and variable definitions.
12902 Authorization: Requires MANAGER+ role.
12903*/
12904        async fn create_template(
12905            &self,
12906            request: tonic::Request<super::CreateTemplateRequest>,
12907        ) -> std::result::Result<
12908            tonic::Response<super::CreateTemplateResponse>,
12909            tonic::Status,
12910        >;
12911        /** Update an existing template, creating a new version.
12912 Authorization: Requires MANAGER+ role.
12913*/
12914        async fn update_template(
12915            &self,
12916            request: tonic::Request<super::UpdateTemplateRequest>,
12917        ) -> std::result::Result<
12918            tonic::Response<super::UpdateTemplateResponse>,
12919            tonic::Status,
12920        >;
12921        /** Retrieve a specific template by ID and optional version.
12922 Authorization: Authenticated user within the organization.
12923*/
12924        async fn get_template(
12925            &self,
12926            request: tonic::Request<super::GetTemplateRequest>,
12927        ) -> std::result::Result<
12928            tonic::Response<super::GetTemplateResponse>,
12929            tonic::Status,
12930        >;
12931        /** List all templates for the organization with pagination.
12932 Authorization: Authenticated user within the organization.
12933*/
12934        async fn list_templates(
12935            &self,
12936            request: tonic::Request<super::ListTemplatesRequest>,
12937        ) -> std::result::Result<
12938            tonic::Response<super::ListTemplatesResponse>,
12939            tonic::Status,
12940        >;
12941        /** Create a locale-specific translation of a template.
12942 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
12943*/
12944        async fn create_template_translation(
12945            &self,
12946            request: tonic::Request<super::CreateTemplateTranslationRequest>,
12947        ) -> std::result::Result<
12948            tonic::Response<super::CreateTemplateTranslationResponse>,
12949            tonic::Status,
12950        >;
12951        /** Update an existing template translation.
12952 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
12953*/
12954        async fn update_template_translation(
12955            &self,
12956            request: tonic::Request<super::UpdateTemplateTranslationRequest>,
12957        ) -> std::result::Result<
12958            tonic::Response<super::UpdateTemplateTranslationResponse>,
12959            tonic::Status,
12960        >;
12961        /** List all translations for a template version.
12962 Authorization: Requires PERMISSION_TEMPLATES_READ.
12963*/
12964        async fn list_template_translations(
12965            &self,
12966            request: tonic::Request<super::ListTemplateTranslationsRequest>,
12967        ) -> std::result::Result<
12968            tonic::Response<super::ListTemplateTranslationsResponse>,
12969            tonic::Status,
12970        >;
12971        /** Approve a template translation for use in campaigns.
12972 Authorization: Requires PERMISSION_TEMPLATES_REVIEW.
12973*/
12974        async fn approve_template_translation(
12975            &self,
12976            request: tonic::Request<super::ApproveTemplateTranslationRequest>,
12977        ) -> std::result::Result<
12978            tonic::Response<super::ApproveTemplateTranslationResponse>,
12979            tonic::Status,
12980        >;
12981    }
12982    /** Manages versioned message templates used by campaigns.
12983 Templates are append-only — updates create new versions while preserving history.
12984*/
12985    #[derive(Debug)]
12986    pub struct TemplateServiceServer<T> {
12987        inner: Arc<T>,
12988        accept_compression_encodings: EnabledCompressionEncodings,
12989        send_compression_encodings: EnabledCompressionEncodings,
12990        max_decoding_message_size: Option<usize>,
12991        max_encoding_message_size: Option<usize>,
12992    }
12993    impl<T> TemplateServiceServer<T> {
12994        pub fn new(inner: T) -> Self {
12995            Self::from_arc(Arc::new(inner))
12996        }
12997        pub fn from_arc(inner: Arc<T>) -> Self {
12998            Self {
12999                inner,
13000                accept_compression_encodings: Default::default(),
13001                send_compression_encodings: Default::default(),
13002                max_decoding_message_size: None,
13003                max_encoding_message_size: None,
13004            }
13005        }
13006        pub fn with_interceptor<F>(
13007            inner: T,
13008            interceptor: F,
13009        ) -> InterceptedService<Self, F>
13010        where
13011            F: tonic::service::Interceptor,
13012        {
13013            InterceptedService::new(Self::new(inner), interceptor)
13014        }
13015        /// Enable decompressing requests with the given encoding.
13016        #[must_use]
13017        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13018            self.accept_compression_encodings.enable(encoding);
13019            self
13020        }
13021        /// Compress responses with the given encoding, if the client supports it.
13022        #[must_use]
13023        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13024            self.send_compression_encodings.enable(encoding);
13025            self
13026        }
13027        /// Limits the maximum size of a decoded message.
13028        ///
13029        /// Default: `4MB`
13030        #[must_use]
13031        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13032            self.max_decoding_message_size = Some(limit);
13033            self
13034        }
13035        /// Limits the maximum size of an encoded message.
13036        ///
13037        /// Default: `usize::MAX`
13038        #[must_use]
13039        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13040            self.max_encoding_message_size = Some(limit);
13041            self
13042        }
13043    }
13044    impl<T, B> tonic::codegen::Service<http::Request<B>> for TemplateServiceServer<T>
13045    where
13046        T: TemplateService,
13047        B: Body + std::marker::Send + 'static,
13048        B::Error: Into<StdError> + std::marker::Send + 'static,
13049    {
13050        type Response = http::Response<tonic::body::Body>;
13051        type Error = std::convert::Infallible;
13052        type Future = BoxFuture<Self::Response, Self::Error>;
13053        fn poll_ready(
13054            &mut self,
13055            _cx: &mut Context<'_>,
13056        ) -> Poll<std::result::Result<(), Self::Error>> {
13057            Poll::Ready(Ok(()))
13058        }
13059        fn call(&mut self, req: http::Request<B>) -> Self::Future {
13060            match req.uri().path() {
13061                "/pidgr.v1.TemplateService/CreateTemplate" => {
13062                    #[allow(non_camel_case_types)]
13063                    struct CreateTemplateSvc<T: TemplateService>(pub Arc<T>);
13064                    impl<
13065                        T: TemplateService,
13066                    > tonic::server::UnaryService<super::CreateTemplateRequest>
13067                    for CreateTemplateSvc<T> {
13068                        type Response = super::CreateTemplateResponse;
13069                        type Future = BoxFuture<
13070                            tonic::Response<Self::Response>,
13071                            tonic::Status,
13072                        >;
13073                        fn call(
13074                            &mut self,
13075                            request: tonic::Request<super::CreateTemplateRequest>,
13076                        ) -> Self::Future {
13077                            let inner = Arc::clone(&self.0);
13078                            let fut = async move {
13079                                <T as TemplateService>::create_template(&inner, request)
13080                                    .await
13081                            };
13082                            Box::pin(fut)
13083                        }
13084                    }
13085                    let accept_compression_encodings = self.accept_compression_encodings;
13086                    let send_compression_encodings = self.send_compression_encodings;
13087                    let max_decoding_message_size = self.max_decoding_message_size;
13088                    let max_encoding_message_size = self.max_encoding_message_size;
13089                    let inner = self.inner.clone();
13090                    let fut = async move {
13091                        let method = CreateTemplateSvc(inner);
13092                        let codec = tonic_prost::ProstCodec::default();
13093                        let mut grpc = tonic::server::Grpc::new(codec)
13094                            .apply_compression_config(
13095                                accept_compression_encodings,
13096                                send_compression_encodings,
13097                            )
13098                            .apply_max_message_size_config(
13099                                max_decoding_message_size,
13100                                max_encoding_message_size,
13101                            );
13102                        let res = grpc.unary(method, req).await;
13103                        Ok(res)
13104                    };
13105                    Box::pin(fut)
13106                }
13107                "/pidgr.v1.TemplateService/UpdateTemplate" => {
13108                    #[allow(non_camel_case_types)]
13109                    struct UpdateTemplateSvc<T: TemplateService>(pub Arc<T>);
13110                    impl<
13111                        T: TemplateService,
13112                    > tonic::server::UnaryService<super::UpdateTemplateRequest>
13113                    for UpdateTemplateSvc<T> {
13114                        type Response = super::UpdateTemplateResponse;
13115                        type Future = BoxFuture<
13116                            tonic::Response<Self::Response>,
13117                            tonic::Status,
13118                        >;
13119                        fn call(
13120                            &mut self,
13121                            request: tonic::Request<super::UpdateTemplateRequest>,
13122                        ) -> Self::Future {
13123                            let inner = Arc::clone(&self.0);
13124                            let fut = async move {
13125                                <T as TemplateService>::update_template(&inner, request)
13126                                    .await
13127                            };
13128                            Box::pin(fut)
13129                        }
13130                    }
13131                    let accept_compression_encodings = self.accept_compression_encodings;
13132                    let send_compression_encodings = self.send_compression_encodings;
13133                    let max_decoding_message_size = self.max_decoding_message_size;
13134                    let max_encoding_message_size = self.max_encoding_message_size;
13135                    let inner = self.inner.clone();
13136                    let fut = async move {
13137                        let method = UpdateTemplateSvc(inner);
13138                        let codec = tonic_prost::ProstCodec::default();
13139                        let mut grpc = tonic::server::Grpc::new(codec)
13140                            .apply_compression_config(
13141                                accept_compression_encodings,
13142                                send_compression_encodings,
13143                            )
13144                            .apply_max_message_size_config(
13145                                max_decoding_message_size,
13146                                max_encoding_message_size,
13147                            );
13148                        let res = grpc.unary(method, req).await;
13149                        Ok(res)
13150                    };
13151                    Box::pin(fut)
13152                }
13153                "/pidgr.v1.TemplateService/GetTemplate" => {
13154                    #[allow(non_camel_case_types)]
13155                    struct GetTemplateSvc<T: TemplateService>(pub Arc<T>);
13156                    impl<
13157                        T: TemplateService,
13158                    > tonic::server::UnaryService<super::GetTemplateRequest>
13159                    for GetTemplateSvc<T> {
13160                        type Response = super::GetTemplateResponse;
13161                        type Future = BoxFuture<
13162                            tonic::Response<Self::Response>,
13163                            tonic::Status,
13164                        >;
13165                        fn call(
13166                            &mut self,
13167                            request: tonic::Request<super::GetTemplateRequest>,
13168                        ) -> Self::Future {
13169                            let inner = Arc::clone(&self.0);
13170                            let fut = async move {
13171                                <T as TemplateService>::get_template(&inner, request).await
13172                            };
13173                            Box::pin(fut)
13174                        }
13175                    }
13176                    let accept_compression_encodings = self.accept_compression_encodings;
13177                    let send_compression_encodings = self.send_compression_encodings;
13178                    let max_decoding_message_size = self.max_decoding_message_size;
13179                    let max_encoding_message_size = self.max_encoding_message_size;
13180                    let inner = self.inner.clone();
13181                    let fut = async move {
13182                        let method = GetTemplateSvc(inner);
13183                        let codec = tonic_prost::ProstCodec::default();
13184                        let mut grpc = tonic::server::Grpc::new(codec)
13185                            .apply_compression_config(
13186                                accept_compression_encodings,
13187                                send_compression_encodings,
13188                            )
13189                            .apply_max_message_size_config(
13190                                max_decoding_message_size,
13191                                max_encoding_message_size,
13192                            );
13193                        let res = grpc.unary(method, req).await;
13194                        Ok(res)
13195                    };
13196                    Box::pin(fut)
13197                }
13198                "/pidgr.v1.TemplateService/ListTemplates" => {
13199                    #[allow(non_camel_case_types)]
13200                    struct ListTemplatesSvc<T: TemplateService>(pub Arc<T>);
13201                    impl<
13202                        T: TemplateService,
13203                    > tonic::server::UnaryService<super::ListTemplatesRequest>
13204                    for ListTemplatesSvc<T> {
13205                        type Response = super::ListTemplatesResponse;
13206                        type Future = BoxFuture<
13207                            tonic::Response<Self::Response>,
13208                            tonic::Status,
13209                        >;
13210                        fn call(
13211                            &mut self,
13212                            request: tonic::Request<super::ListTemplatesRequest>,
13213                        ) -> Self::Future {
13214                            let inner = Arc::clone(&self.0);
13215                            let fut = async move {
13216                                <T as TemplateService>::list_templates(&inner, request)
13217                                    .await
13218                            };
13219                            Box::pin(fut)
13220                        }
13221                    }
13222                    let accept_compression_encodings = self.accept_compression_encodings;
13223                    let send_compression_encodings = self.send_compression_encodings;
13224                    let max_decoding_message_size = self.max_decoding_message_size;
13225                    let max_encoding_message_size = self.max_encoding_message_size;
13226                    let inner = self.inner.clone();
13227                    let fut = async move {
13228                        let method = ListTemplatesSvc(inner);
13229                        let codec = tonic_prost::ProstCodec::default();
13230                        let mut grpc = tonic::server::Grpc::new(codec)
13231                            .apply_compression_config(
13232                                accept_compression_encodings,
13233                                send_compression_encodings,
13234                            )
13235                            .apply_max_message_size_config(
13236                                max_decoding_message_size,
13237                                max_encoding_message_size,
13238                            );
13239                        let res = grpc.unary(method, req).await;
13240                        Ok(res)
13241                    };
13242                    Box::pin(fut)
13243                }
13244                "/pidgr.v1.TemplateService/CreateTemplateTranslation" => {
13245                    #[allow(non_camel_case_types)]
13246                    struct CreateTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
13247                    impl<
13248                        T: TemplateService,
13249                    > tonic::server::UnaryService<
13250                        super::CreateTemplateTranslationRequest,
13251                    > for CreateTemplateTranslationSvc<T> {
13252                        type Response = super::CreateTemplateTranslationResponse;
13253                        type Future = BoxFuture<
13254                            tonic::Response<Self::Response>,
13255                            tonic::Status,
13256                        >;
13257                        fn call(
13258                            &mut self,
13259                            request: tonic::Request<
13260                                super::CreateTemplateTranslationRequest,
13261                            >,
13262                        ) -> Self::Future {
13263                            let inner = Arc::clone(&self.0);
13264                            let fut = async move {
13265                                <T as TemplateService>::create_template_translation(
13266                                        &inner,
13267                                        request,
13268                                    )
13269                                    .await
13270                            };
13271                            Box::pin(fut)
13272                        }
13273                    }
13274                    let accept_compression_encodings = self.accept_compression_encodings;
13275                    let send_compression_encodings = self.send_compression_encodings;
13276                    let max_decoding_message_size = self.max_decoding_message_size;
13277                    let max_encoding_message_size = self.max_encoding_message_size;
13278                    let inner = self.inner.clone();
13279                    let fut = async move {
13280                        let method = CreateTemplateTranslationSvc(inner);
13281                        let codec = tonic_prost::ProstCodec::default();
13282                        let mut grpc = tonic::server::Grpc::new(codec)
13283                            .apply_compression_config(
13284                                accept_compression_encodings,
13285                                send_compression_encodings,
13286                            )
13287                            .apply_max_message_size_config(
13288                                max_decoding_message_size,
13289                                max_encoding_message_size,
13290                            );
13291                        let res = grpc.unary(method, req).await;
13292                        Ok(res)
13293                    };
13294                    Box::pin(fut)
13295                }
13296                "/pidgr.v1.TemplateService/UpdateTemplateTranslation" => {
13297                    #[allow(non_camel_case_types)]
13298                    struct UpdateTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
13299                    impl<
13300                        T: TemplateService,
13301                    > tonic::server::UnaryService<
13302                        super::UpdateTemplateTranslationRequest,
13303                    > for UpdateTemplateTranslationSvc<T> {
13304                        type Response = super::UpdateTemplateTranslationResponse;
13305                        type Future = BoxFuture<
13306                            tonic::Response<Self::Response>,
13307                            tonic::Status,
13308                        >;
13309                        fn call(
13310                            &mut self,
13311                            request: tonic::Request<
13312                                super::UpdateTemplateTranslationRequest,
13313                            >,
13314                        ) -> Self::Future {
13315                            let inner = Arc::clone(&self.0);
13316                            let fut = async move {
13317                                <T as TemplateService>::update_template_translation(
13318                                        &inner,
13319                                        request,
13320                                    )
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 = UpdateTemplateTranslationSvc(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/ListTemplateTranslations" => {
13349                    #[allow(non_camel_case_types)]
13350                    struct ListTemplateTranslationsSvc<T: TemplateService>(pub Arc<T>);
13351                    impl<
13352                        T: TemplateService,
13353                    > tonic::server::UnaryService<super::ListTemplateTranslationsRequest>
13354                    for ListTemplateTranslationsSvc<T> {
13355                        type Response = super::ListTemplateTranslationsResponse;
13356                        type Future = BoxFuture<
13357                            tonic::Response<Self::Response>,
13358                            tonic::Status,
13359                        >;
13360                        fn call(
13361                            &mut self,
13362                            request: tonic::Request<
13363                                super::ListTemplateTranslationsRequest,
13364                            >,
13365                        ) -> Self::Future {
13366                            let inner = Arc::clone(&self.0);
13367                            let fut = async move {
13368                                <T as TemplateService>::list_template_translations(
13369                                        &inner,
13370                                        request,
13371                                    )
13372                                    .await
13373                            };
13374                            Box::pin(fut)
13375                        }
13376                    }
13377                    let accept_compression_encodings = self.accept_compression_encodings;
13378                    let send_compression_encodings = self.send_compression_encodings;
13379                    let max_decoding_message_size = self.max_decoding_message_size;
13380                    let max_encoding_message_size = self.max_encoding_message_size;
13381                    let inner = self.inner.clone();
13382                    let fut = async move {
13383                        let method = ListTemplateTranslationsSvc(inner);
13384                        let codec = tonic_prost::ProstCodec::default();
13385                        let mut grpc = tonic::server::Grpc::new(codec)
13386                            .apply_compression_config(
13387                                accept_compression_encodings,
13388                                send_compression_encodings,
13389                            )
13390                            .apply_max_message_size_config(
13391                                max_decoding_message_size,
13392                                max_encoding_message_size,
13393                            );
13394                        let res = grpc.unary(method, req).await;
13395                        Ok(res)
13396                    };
13397                    Box::pin(fut)
13398                }
13399                "/pidgr.v1.TemplateService/ApproveTemplateTranslation" => {
13400                    #[allow(non_camel_case_types)]
13401                    struct ApproveTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
13402                    impl<
13403                        T: TemplateService,
13404                    > tonic::server::UnaryService<
13405                        super::ApproveTemplateTranslationRequest,
13406                    > for ApproveTemplateTranslationSvc<T> {
13407                        type Response = super::ApproveTemplateTranslationResponse;
13408                        type Future = BoxFuture<
13409                            tonic::Response<Self::Response>,
13410                            tonic::Status,
13411                        >;
13412                        fn call(
13413                            &mut self,
13414                            request: tonic::Request<
13415                                super::ApproveTemplateTranslationRequest,
13416                            >,
13417                        ) -> Self::Future {
13418                            let inner = Arc::clone(&self.0);
13419                            let fut = async move {
13420                                <T as TemplateService>::approve_template_translation(
13421                                        &inner,
13422                                        request,
13423                                    )
13424                                    .await
13425                            };
13426                            Box::pin(fut)
13427                        }
13428                    }
13429                    let accept_compression_encodings = self.accept_compression_encodings;
13430                    let send_compression_encodings = self.send_compression_encodings;
13431                    let max_decoding_message_size = self.max_decoding_message_size;
13432                    let max_encoding_message_size = self.max_encoding_message_size;
13433                    let inner = self.inner.clone();
13434                    let fut = async move {
13435                        let method = ApproveTemplateTranslationSvc(inner);
13436                        let codec = tonic_prost::ProstCodec::default();
13437                        let mut grpc = tonic::server::Grpc::new(codec)
13438                            .apply_compression_config(
13439                                accept_compression_encodings,
13440                                send_compression_encodings,
13441                            )
13442                            .apply_max_message_size_config(
13443                                max_decoding_message_size,
13444                                max_encoding_message_size,
13445                            );
13446                        let res = grpc.unary(method, req).await;
13447                        Ok(res)
13448                    };
13449                    Box::pin(fut)
13450                }
13451                _ => {
13452                    Box::pin(async move {
13453                        let mut response = http::Response::new(
13454                            tonic::body::Body::default(),
13455                        );
13456                        let headers = response.headers_mut();
13457                        headers
13458                            .insert(
13459                                tonic::Status::GRPC_STATUS,
13460                                (tonic::Code::Unimplemented as i32).into(),
13461                            );
13462                        headers
13463                            .insert(
13464                                http::header::CONTENT_TYPE,
13465                                tonic::metadata::GRPC_CONTENT_TYPE,
13466                            );
13467                        Ok(response)
13468                    })
13469                }
13470            }
13471        }
13472    }
13473    impl<T> Clone for TemplateServiceServer<T> {
13474        fn clone(&self) -> Self {
13475            let inner = self.inner.clone();
13476            Self {
13477                inner,
13478                accept_compression_encodings: self.accept_compression_encodings,
13479                send_compression_encodings: self.send_compression_encodings,
13480                max_decoding_message_size: self.max_decoding_message_size,
13481                max_encoding_message_size: self.max_encoding_message_size,
13482            }
13483        }
13484    }
13485    /// Generated gRPC service name
13486    pub const SERVICE_NAME: &str = "pidgr.v1.TemplateService";
13487    impl<T> tonic::server::NamedService for TemplateServiceServer<T> {
13488        const NAME: &'static str = SERVICE_NAME;
13489    }
13490}