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 invite_link_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    /** Manages shareable invite links for organization self-join.
6178 Create, List, and Revoke require JWT + PERMISSION_MEMBERS_INVITE.
6179 ValidateInviteLink is unauthenticated — the token IS the authorization.
6180 RedeemInviteLink requires a valid JWT.
6181*/
6182    #[derive(Debug, Clone)]
6183    pub struct InviteLinkServiceClient<T> {
6184        inner: tonic::client::Grpc<T>,
6185    }
6186    impl InviteLinkServiceClient<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> InviteLinkServiceClient<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        ) -> InviteLinkServiceClient<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            InviteLinkServiceClient::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        /** Create a new shareable invite link for the organization.
6263 Authorization: Requires PERMISSION_MEMBERS_INVITE.
6264*/
6265        pub async fn create_invite_link(
6266            &mut self,
6267            request: impl tonic::IntoRequest<super::CreateInviteLinkRequest>,
6268        ) -> std::result::Result<
6269            tonic::Response<super::CreateInviteLinkResponse>,
6270            tonic::Status,
6271        > {
6272            self.inner
6273                .ready()
6274                .await
6275                .map_err(|e| {
6276                    tonic::Status::unknown(
6277                        format!("Service was not ready: {}", e.into()),
6278                    )
6279                })?;
6280            let codec = tonic_prost::ProstCodec::default();
6281            let path = http::uri::PathAndQuery::from_static(
6282                "/pidgr.v1.InviteLinkService/CreateInviteLink",
6283            );
6284            let mut req = request.into_request();
6285            req.extensions_mut()
6286                .insert(
6287                    GrpcMethod::new("pidgr.v1.InviteLinkService", "CreateInviteLink"),
6288                );
6289            self.inner.unary(req, path, codec).await
6290        }
6291        /** List all invite links for the organization.
6292 Authorization: Requires PERMISSION_MEMBERS_INVITE.
6293*/
6294        pub async fn list_invite_links(
6295            &mut self,
6296            request: impl tonic::IntoRequest<super::ListInviteLinksRequest>,
6297        ) -> std::result::Result<
6298            tonic::Response<super::ListInviteLinksResponse>,
6299            tonic::Status,
6300        > {
6301            self.inner
6302                .ready()
6303                .await
6304                .map_err(|e| {
6305                    tonic::Status::unknown(
6306                        format!("Service was not ready: {}", e.into()),
6307                    )
6308                })?;
6309            let codec = tonic_prost::ProstCodec::default();
6310            let path = http::uri::PathAndQuery::from_static(
6311                "/pidgr.v1.InviteLinkService/ListInviteLinks",
6312            );
6313            let mut req = request.into_request();
6314            req.extensions_mut()
6315                .insert(
6316                    GrpcMethod::new("pidgr.v1.InviteLinkService", "ListInviteLinks"),
6317                );
6318            self.inner.unary(req, path, codec).await
6319        }
6320        /** Revoke an invite link, making it immediately unusable. Idempotent.
6321 Authorization: Requires PERMISSION_MEMBERS_INVITE.
6322*/
6323        pub async fn revoke_invite_link(
6324            &mut self,
6325            request: impl tonic::IntoRequest<super::RevokeInviteLinkRequest>,
6326        ) -> std::result::Result<
6327            tonic::Response<super::RevokeInviteLinkResponse>,
6328            tonic::Status,
6329        > {
6330            self.inner
6331                .ready()
6332                .await
6333                .map_err(|e| {
6334                    tonic::Status::unknown(
6335                        format!("Service was not ready: {}", e.into()),
6336                    )
6337                })?;
6338            let codec = tonic_prost::ProstCodec::default();
6339            let path = http::uri::PathAndQuery::from_static(
6340                "/pidgr.v1.InviteLinkService/RevokeInviteLink",
6341            );
6342            let mut req = request.into_request();
6343            req.extensions_mut()
6344                .insert(
6345                    GrpcMethod::new("pidgr.v1.InviteLinkService", "RevokeInviteLink"),
6346                );
6347            self.inner.unary(req, path, codec).await
6348        }
6349        /** Validate an invite link and provision a user account if needed.
6350 This is a pre-authentication endpoint — no JWT required.
6351 Rate limited to 10 requests per minute per IP.
6352 Authorization: None (token-based).
6353*/
6354        pub async fn validate_invite_link(
6355            &mut self,
6356            request: impl tonic::IntoRequest<super::ValidateInviteLinkRequest>,
6357        ) -> std::result::Result<
6358            tonic::Response<super::ValidateInviteLinkResponse>,
6359            tonic::Status,
6360        > {
6361            self.inner
6362                .ready()
6363                .await
6364                .map_err(|e| {
6365                    tonic::Status::unknown(
6366                        format!("Service was not ready: {}", e.into()),
6367                    )
6368                })?;
6369            let codec = tonic_prost::ProstCodec::default();
6370            let path = http::uri::PathAndQuery::from_static(
6371                "/pidgr.v1.InviteLinkService/ValidateInviteLink",
6372            );
6373            let mut req = request.into_request();
6374            req.extensions_mut()
6375                .insert(
6376                    GrpcMethod::new("pidgr.v1.InviteLinkService", "ValidateInviteLink"),
6377                );
6378            self.inner.unary(req, path, codec).await
6379        }
6380        /** Redeem an invite link to join an organization.
6381 Requires a valid JWT — the email is extracted from the token.
6382 Authorization: JWT required.
6383*/
6384        pub async fn redeem_invite_link(
6385            &mut self,
6386            request: impl tonic::IntoRequest<super::RedeemInviteLinkRequest>,
6387        ) -> std::result::Result<
6388            tonic::Response<super::RedeemInviteLinkResponse>,
6389            tonic::Status,
6390        > {
6391            self.inner
6392                .ready()
6393                .await
6394                .map_err(|e| {
6395                    tonic::Status::unknown(
6396                        format!("Service was not ready: {}", e.into()),
6397                    )
6398                })?;
6399            let codec = tonic_prost::ProstCodec::default();
6400            let path = http::uri::PathAndQuery::from_static(
6401                "/pidgr.v1.InviteLinkService/RedeemInviteLink",
6402            );
6403            let mut req = request.into_request();
6404            req.extensions_mut()
6405                .insert(
6406                    GrpcMethod::new("pidgr.v1.InviteLinkService", "RedeemInviteLink"),
6407                );
6408            self.inner.unary(req, path, codec).await
6409        }
6410    }
6411}
6412/// Generated server implementations.
6413pub mod invite_link_service_server {
6414    #![allow(
6415        unused_variables,
6416        dead_code,
6417        missing_docs,
6418        clippy::wildcard_imports,
6419        clippy::let_unit_value,
6420    )]
6421    use tonic::codegen::*;
6422    /// Generated trait containing gRPC methods that should be implemented for use with InviteLinkServiceServer.
6423    #[async_trait]
6424    pub trait InviteLinkService: std::marker::Send + std::marker::Sync + 'static {
6425        /** Create a new shareable invite link for the organization.
6426 Authorization: Requires PERMISSION_MEMBERS_INVITE.
6427*/
6428        async fn create_invite_link(
6429            &self,
6430            request: tonic::Request<super::CreateInviteLinkRequest>,
6431        ) -> std::result::Result<
6432            tonic::Response<super::CreateInviteLinkResponse>,
6433            tonic::Status,
6434        >;
6435        /** List all invite links for the organization.
6436 Authorization: Requires PERMISSION_MEMBERS_INVITE.
6437*/
6438        async fn list_invite_links(
6439            &self,
6440            request: tonic::Request<super::ListInviteLinksRequest>,
6441        ) -> std::result::Result<
6442            tonic::Response<super::ListInviteLinksResponse>,
6443            tonic::Status,
6444        >;
6445        /** Revoke an invite link, making it immediately unusable. Idempotent.
6446 Authorization: Requires PERMISSION_MEMBERS_INVITE.
6447*/
6448        async fn revoke_invite_link(
6449            &self,
6450            request: tonic::Request<super::RevokeInviteLinkRequest>,
6451        ) -> std::result::Result<
6452            tonic::Response<super::RevokeInviteLinkResponse>,
6453            tonic::Status,
6454        >;
6455        /** Validate an invite link and provision a user account if needed.
6456 This is a pre-authentication endpoint — no JWT required.
6457 Rate limited to 10 requests per minute per IP.
6458 Authorization: None (token-based).
6459*/
6460        async fn validate_invite_link(
6461            &self,
6462            request: tonic::Request<super::ValidateInviteLinkRequest>,
6463        ) -> std::result::Result<
6464            tonic::Response<super::ValidateInviteLinkResponse>,
6465            tonic::Status,
6466        >;
6467        /** Redeem an invite link to join an organization.
6468 Requires a valid JWT — the email is extracted from the token.
6469 Authorization: JWT required.
6470*/
6471        async fn redeem_invite_link(
6472            &self,
6473            request: tonic::Request<super::RedeemInviteLinkRequest>,
6474        ) -> std::result::Result<
6475            tonic::Response<super::RedeemInviteLinkResponse>,
6476            tonic::Status,
6477        >;
6478    }
6479    /** Manages shareable invite links for organization self-join.
6480 Create, List, and Revoke require JWT + PERMISSION_MEMBERS_INVITE.
6481 ValidateInviteLink is unauthenticated — the token IS the authorization.
6482 RedeemInviteLink requires a valid JWT.
6483*/
6484    #[derive(Debug)]
6485    pub struct InviteLinkServiceServer<T> {
6486        inner: Arc<T>,
6487        accept_compression_encodings: EnabledCompressionEncodings,
6488        send_compression_encodings: EnabledCompressionEncodings,
6489        max_decoding_message_size: Option<usize>,
6490        max_encoding_message_size: Option<usize>,
6491    }
6492    impl<T> InviteLinkServiceServer<T> {
6493        pub fn new(inner: T) -> Self {
6494            Self::from_arc(Arc::new(inner))
6495        }
6496        pub fn from_arc(inner: Arc<T>) -> Self {
6497            Self {
6498                inner,
6499                accept_compression_encodings: Default::default(),
6500                send_compression_encodings: Default::default(),
6501                max_decoding_message_size: None,
6502                max_encoding_message_size: None,
6503            }
6504        }
6505        pub fn with_interceptor<F>(
6506            inner: T,
6507            interceptor: F,
6508        ) -> InterceptedService<Self, F>
6509        where
6510            F: tonic::service::Interceptor,
6511        {
6512            InterceptedService::new(Self::new(inner), interceptor)
6513        }
6514        /// Enable decompressing requests with the given encoding.
6515        #[must_use]
6516        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6517            self.accept_compression_encodings.enable(encoding);
6518            self
6519        }
6520        /// Compress responses with the given encoding, if the client supports it.
6521        #[must_use]
6522        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6523            self.send_compression_encodings.enable(encoding);
6524            self
6525        }
6526        /// Limits the maximum size of a decoded message.
6527        ///
6528        /// Default: `4MB`
6529        #[must_use]
6530        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6531            self.max_decoding_message_size = Some(limit);
6532            self
6533        }
6534        /// Limits the maximum size of an encoded message.
6535        ///
6536        /// Default: `usize::MAX`
6537        #[must_use]
6538        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6539            self.max_encoding_message_size = Some(limit);
6540            self
6541        }
6542    }
6543    impl<T, B> tonic::codegen::Service<http::Request<B>> for InviteLinkServiceServer<T>
6544    where
6545        T: InviteLinkService,
6546        B: Body + std::marker::Send + 'static,
6547        B::Error: Into<StdError> + std::marker::Send + 'static,
6548    {
6549        type Response = http::Response<tonic::body::Body>;
6550        type Error = std::convert::Infallible;
6551        type Future = BoxFuture<Self::Response, Self::Error>;
6552        fn poll_ready(
6553            &mut self,
6554            _cx: &mut Context<'_>,
6555        ) -> Poll<std::result::Result<(), Self::Error>> {
6556            Poll::Ready(Ok(()))
6557        }
6558        fn call(&mut self, req: http::Request<B>) -> Self::Future {
6559            match req.uri().path() {
6560                "/pidgr.v1.InviteLinkService/CreateInviteLink" => {
6561                    #[allow(non_camel_case_types)]
6562                    struct CreateInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
6563                    impl<
6564                        T: InviteLinkService,
6565                    > tonic::server::UnaryService<super::CreateInviteLinkRequest>
6566                    for CreateInviteLinkSvc<T> {
6567                        type Response = super::CreateInviteLinkResponse;
6568                        type Future = BoxFuture<
6569                            tonic::Response<Self::Response>,
6570                            tonic::Status,
6571                        >;
6572                        fn call(
6573                            &mut self,
6574                            request: tonic::Request<super::CreateInviteLinkRequest>,
6575                        ) -> Self::Future {
6576                            let inner = Arc::clone(&self.0);
6577                            let fut = async move {
6578                                <T as InviteLinkService>::create_invite_link(
6579                                        &inner,
6580                                        request,
6581                                    )
6582                                    .await
6583                            };
6584                            Box::pin(fut)
6585                        }
6586                    }
6587                    let accept_compression_encodings = self.accept_compression_encodings;
6588                    let send_compression_encodings = self.send_compression_encodings;
6589                    let max_decoding_message_size = self.max_decoding_message_size;
6590                    let max_encoding_message_size = self.max_encoding_message_size;
6591                    let inner = self.inner.clone();
6592                    let fut = async move {
6593                        let method = CreateInviteLinkSvc(inner);
6594                        let codec = tonic_prost::ProstCodec::default();
6595                        let mut grpc = tonic::server::Grpc::new(codec)
6596                            .apply_compression_config(
6597                                accept_compression_encodings,
6598                                send_compression_encodings,
6599                            )
6600                            .apply_max_message_size_config(
6601                                max_decoding_message_size,
6602                                max_encoding_message_size,
6603                            );
6604                        let res = grpc.unary(method, req).await;
6605                        Ok(res)
6606                    };
6607                    Box::pin(fut)
6608                }
6609                "/pidgr.v1.InviteLinkService/ListInviteLinks" => {
6610                    #[allow(non_camel_case_types)]
6611                    struct ListInviteLinksSvc<T: InviteLinkService>(pub Arc<T>);
6612                    impl<
6613                        T: InviteLinkService,
6614                    > tonic::server::UnaryService<super::ListInviteLinksRequest>
6615                    for ListInviteLinksSvc<T> {
6616                        type Response = super::ListInviteLinksResponse;
6617                        type Future = BoxFuture<
6618                            tonic::Response<Self::Response>,
6619                            tonic::Status,
6620                        >;
6621                        fn call(
6622                            &mut self,
6623                            request: tonic::Request<super::ListInviteLinksRequest>,
6624                        ) -> Self::Future {
6625                            let inner = Arc::clone(&self.0);
6626                            let fut = async move {
6627                                <T as InviteLinkService>::list_invite_links(&inner, request)
6628                                    .await
6629                            };
6630                            Box::pin(fut)
6631                        }
6632                    }
6633                    let accept_compression_encodings = self.accept_compression_encodings;
6634                    let send_compression_encodings = self.send_compression_encodings;
6635                    let max_decoding_message_size = self.max_decoding_message_size;
6636                    let max_encoding_message_size = self.max_encoding_message_size;
6637                    let inner = self.inner.clone();
6638                    let fut = async move {
6639                        let method = ListInviteLinksSvc(inner);
6640                        let codec = tonic_prost::ProstCodec::default();
6641                        let mut grpc = tonic::server::Grpc::new(codec)
6642                            .apply_compression_config(
6643                                accept_compression_encodings,
6644                                send_compression_encodings,
6645                            )
6646                            .apply_max_message_size_config(
6647                                max_decoding_message_size,
6648                                max_encoding_message_size,
6649                            );
6650                        let res = grpc.unary(method, req).await;
6651                        Ok(res)
6652                    };
6653                    Box::pin(fut)
6654                }
6655                "/pidgr.v1.InviteLinkService/RevokeInviteLink" => {
6656                    #[allow(non_camel_case_types)]
6657                    struct RevokeInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
6658                    impl<
6659                        T: InviteLinkService,
6660                    > tonic::server::UnaryService<super::RevokeInviteLinkRequest>
6661                    for RevokeInviteLinkSvc<T> {
6662                        type Response = super::RevokeInviteLinkResponse;
6663                        type Future = BoxFuture<
6664                            tonic::Response<Self::Response>,
6665                            tonic::Status,
6666                        >;
6667                        fn call(
6668                            &mut self,
6669                            request: tonic::Request<super::RevokeInviteLinkRequest>,
6670                        ) -> Self::Future {
6671                            let inner = Arc::clone(&self.0);
6672                            let fut = async move {
6673                                <T as InviteLinkService>::revoke_invite_link(
6674                                        &inner,
6675                                        request,
6676                                    )
6677                                    .await
6678                            };
6679                            Box::pin(fut)
6680                        }
6681                    }
6682                    let accept_compression_encodings = self.accept_compression_encodings;
6683                    let send_compression_encodings = self.send_compression_encodings;
6684                    let max_decoding_message_size = self.max_decoding_message_size;
6685                    let max_encoding_message_size = self.max_encoding_message_size;
6686                    let inner = self.inner.clone();
6687                    let fut = async move {
6688                        let method = RevokeInviteLinkSvc(inner);
6689                        let codec = tonic_prost::ProstCodec::default();
6690                        let mut grpc = tonic::server::Grpc::new(codec)
6691                            .apply_compression_config(
6692                                accept_compression_encodings,
6693                                send_compression_encodings,
6694                            )
6695                            .apply_max_message_size_config(
6696                                max_decoding_message_size,
6697                                max_encoding_message_size,
6698                            );
6699                        let res = grpc.unary(method, req).await;
6700                        Ok(res)
6701                    };
6702                    Box::pin(fut)
6703                }
6704                "/pidgr.v1.InviteLinkService/ValidateInviteLink" => {
6705                    #[allow(non_camel_case_types)]
6706                    struct ValidateInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
6707                    impl<
6708                        T: InviteLinkService,
6709                    > tonic::server::UnaryService<super::ValidateInviteLinkRequest>
6710                    for ValidateInviteLinkSvc<T> {
6711                        type Response = super::ValidateInviteLinkResponse;
6712                        type Future = BoxFuture<
6713                            tonic::Response<Self::Response>,
6714                            tonic::Status,
6715                        >;
6716                        fn call(
6717                            &mut self,
6718                            request: tonic::Request<super::ValidateInviteLinkRequest>,
6719                        ) -> Self::Future {
6720                            let inner = Arc::clone(&self.0);
6721                            let fut = async move {
6722                                <T as InviteLinkService>::validate_invite_link(
6723                                        &inner,
6724                                        request,
6725                                    )
6726                                    .await
6727                            };
6728                            Box::pin(fut)
6729                        }
6730                    }
6731                    let accept_compression_encodings = self.accept_compression_encodings;
6732                    let send_compression_encodings = self.send_compression_encodings;
6733                    let max_decoding_message_size = self.max_decoding_message_size;
6734                    let max_encoding_message_size = self.max_encoding_message_size;
6735                    let inner = self.inner.clone();
6736                    let fut = async move {
6737                        let method = ValidateInviteLinkSvc(inner);
6738                        let codec = tonic_prost::ProstCodec::default();
6739                        let mut grpc = tonic::server::Grpc::new(codec)
6740                            .apply_compression_config(
6741                                accept_compression_encodings,
6742                                send_compression_encodings,
6743                            )
6744                            .apply_max_message_size_config(
6745                                max_decoding_message_size,
6746                                max_encoding_message_size,
6747                            );
6748                        let res = grpc.unary(method, req).await;
6749                        Ok(res)
6750                    };
6751                    Box::pin(fut)
6752                }
6753                "/pidgr.v1.InviteLinkService/RedeemInviteLink" => {
6754                    #[allow(non_camel_case_types)]
6755                    struct RedeemInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
6756                    impl<
6757                        T: InviteLinkService,
6758                    > tonic::server::UnaryService<super::RedeemInviteLinkRequest>
6759                    for RedeemInviteLinkSvc<T> {
6760                        type Response = super::RedeemInviteLinkResponse;
6761                        type Future = BoxFuture<
6762                            tonic::Response<Self::Response>,
6763                            tonic::Status,
6764                        >;
6765                        fn call(
6766                            &mut self,
6767                            request: tonic::Request<super::RedeemInviteLinkRequest>,
6768                        ) -> Self::Future {
6769                            let inner = Arc::clone(&self.0);
6770                            let fut = async move {
6771                                <T as InviteLinkService>::redeem_invite_link(
6772                                        &inner,
6773                                        request,
6774                                    )
6775                                    .await
6776                            };
6777                            Box::pin(fut)
6778                        }
6779                    }
6780                    let accept_compression_encodings = self.accept_compression_encodings;
6781                    let send_compression_encodings = self.send_compression_encodings;
6782                    let max_decoding_message_size = self.max_decoding_message_size;
6783                    let max_encoding_message_size = self.max_encoding_message_size;
6784                    let inner = self.inner.clone();
6785                    let fut = async move {
6786                        let method = RedeemInviteLinkSvc(inner);
6787                        let codec = tonic_prost::ProstCodec::default();
6788                        let mut grpc = tonic::server::Grpc::new(codec)
6789                            .apply_compression_config(
6790                                accept_compression_encodings,
6791                                send_compression_encodings,
6792                            )
6793                            .apply_max_message_size_config(
6794                                max_decoding_message_size,
6795                                max_encoding_message_size,
6796                            );
6797                        let res = grpc.unary(method, req).await;
6798                        Ok(res)
6799                    };
6800                    Box::pin(fut)
6801                }
6802                _ => {
6803                    Box::pin(async move {
6804                        let mut response = http::Response::new(
6805                            tonic::body::Body::default(),
6806                        );
6807                        let headers = response.headers_mut();
6808                        headers
6809                            .insert(
6810                                tonic::Status::GRPC_STATUS,
6811                                (tonic::Code::Unimplemented as i32).into(),
6812                            );
6813                        headers
6814                            .insert(
6815                                http::header::CONTENT_TYPE,
6816                                tonic::metadata::GRPC_CONTENT_TYPE,
6817                            );
6818                        Ok(response)
6819                    })
6820                }
6821            }
6822        }
6823    }
6824    impl<T> Clone for InviteLinkServiceServer<T> {
6825        fn clone(&self) -> Self {
6826            let inner = self.inner.clone();
6827            Self {
6828                inner,
6829                accept_compression_encodings: self.accept_compression_encodings,
6830                send_compression_encodings: self.send_compression_encodings,
6831                max_decoding_message_size: self.max_decoding_message_size,
6832                max_encoding_message_size: self.max_encoding_message_size,
6833            }
6834        }
6835    }
6836    /// Generated gRPC service name
6837    pub const SERVICE_NAME: &str = "pidgr.v1.InviteLinkService";
6838    impl<T> tonic::server::NamedService for InviteLinkServiceServer<T> {
6839        const NAME: &'static str = SERVICE_NAME;
6840    }
6841}
6842/// Generated client implementations.
6843pub mod member_service_client {
6844    #![allow(
6845        unused_variables,
6846        dead_code,
6847        missing_docs,
6848        clippy::wildcard_imports,
6849        clippy::let_unit_value,
6850    )]
6851    use tonic::codegen::*;
6852    use tonic::codegen::http::Uri;
6853    /** Manages members (users) within an organization.
6854 All RPCs operate within the caller's org (extracted from JWT).
6855*/
6856    #[derive(Debug, Clone)]
6857    pub struct MemberServiceClient<T> {
6858        inner: tonic::client::Grpc<T>,
6859    }
6860    impl MemberServiceClient<tonic::transport::Channel> {
6861        /// Attempt to create a new client by connecting to a given endpoint.
6862        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6863        where
6864            D: TryInto<tonic::transport::Endpoint>,
6865            D::Error: Into<StdError>,
6866        {
6867            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6868            Ok(Self::new(conn))
6869        }
6870    }
6871    impl<T> MemberServiceClient<T>
6872    where
6873        T: tonic::client::GrpcService<tonic::body::Body>,
6874        T::Error: Into<StdError>,
6875        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6876        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6877    {
6878        pub fn new(inner: T) -> Self {
6879            let inner = tonic::client::Grpc::new(inner);
6880            Self { inner }
6881        }
6882        pub fn with_origin(inner: T, origin: Uri) -> Self {
6883            let inner = tonic::client::Grpc::with_origin(inner, origin);
6884            Self { inner }
6885        }
6886        pub fn with_interceptor<F>(
6887            inner: T,
6888            interceptor: F,
6889        ) -> MemberServiceClient<InterceptedService<T, F>>
6890        where
6891            F: tonic::service::Interceptor,
6892            T::ResponseBody: Default,
6893            T: tonic::codegen::Service<
6894                http::Request<tonic::body::Body>,
6895                Response = http::Response<
6896                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6897                >,
6898            >,
6899            <T as tonic::codegen::Service<
6900                http::Request<tonic::body::Body>,
6901            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6902        {
6903            MemberServiceClient::new(InterceptedService::new(inner, interceptor))
6904        }
6905        /// Compress requests with the given encoding.
6906        ///
6907        /// This requires the server to support it otherwise it might respond with an
6908        /// error.
6909        #[must_use]
6910        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6911            self.inner = self.inner.send_compressed(encoding);
6912            self
6913        }
6914        /// Enable decompressing responses.
6915        #[must_use]
6916        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6917            self.inner = self.inner.accept_compressed(encoding);
6918            self
6919        }
6920        /// Limits the maximum size of a decoded message.
6921        ///
6922        /// Default: `4MB`
6923        #[must_use]
6924        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6925            self.inner = self.inner.max_decoding_message_size(limit);
6926            self
6927        }
6928        /// Limits the maximum size of an encoded message.
6929        ///
6930        /// Default: `usize::MAX`
6931        #[must_use]
6932        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6933            self.inner = self.inner.max_encoding_message_size(limit);
6934            self
6935        }
6936        /** Invite a new user to the organization via email.
6937 Authorization: Requires PERMISSION_MEMBERS_INVITE.
6938*/
6939        pub async fn invite_user(
6940            &mut self,
6941            request: impl tonic::IntoRequest<super::InviteUserRequest>,
6942        ) -> std::result::Result<
6943            tonic::Response<super::InviteUserResponse>,
6944            tonic::Status,
6945        > {
6946            self.inner
6947                .ready()
6948                .await
6949                .map_err(|e| {
6950                    tonic::Status::unknown(
6951                        format!("Service was not ready: {}", e.into()),
6952                    )
6953                })?;
6954            let codec = tonic_prost::ProstCodec::default();
6955            let path = http::uri::PathAndQuery::from_static(
6956                "/pidgr.v1.MemberService/InviteUser",
6957            );
6958            let mut req = request.into_request();
6959            req.extensions_mut()
6960                .insert(GrpcMethod::new("pidgr.v1.MemberService", "InviteUser"));
6961            self.inner.unary(req, path, codec).await
6962        }
6963        /** Retrieve a user by ID within the organization.
6964 Self-lookup (empty user_id) is allowed for any authenticated user.
6965 Authorization: Requires PERMISSION_MEMBERS_READ for other users.
6966*/
6967        pub async fn get_user(
6968            &mut self,
6969            request: impl tonic::IntoRequest<super::GetUserRequest>,
6970        ) -> std::result::Result<
6971            tonic::Response<super::GetUserResponse>,
6972            tonic::Status,
6973        > {
6974            self.inner
6975                .ready()
6976                .await
6977                .map_err(|e| {
6978                    tonic::Status::unknown(
6979                        format!("Service was not ready: {}", e.into()),
6980                    )
6981                })?;
6982            let codec = tonic_prost::ProstCodec::default();
6983            let path = http::uri::PathAndQuery::from_static(
6984                "/pidgr.v1.MemberService/GetUser",
6985            );
6986            let mut req = request.into_request();
6987            req.extensions_mut()
6988                .insert(GrpcMethod::new("pidgr.v1.MemberService", "GetUser"));
6989            self.inner.unary(req, path, codec).await
6990        }
6991        /** List all users in the organization with pagination.
6992 Authorization: Requires PERMISSION_MEMBERS_READ.
6993*/
6994        pub async fn list_users(
6995            &mut self,
6996            request: impl tonic::IntoRequest<super::ListUsersRequest>,
6997        ) -> std::result::Result<
6998            tonic::Response<super::ListUsersResponse>,
6999            tonic::Status,
7000        > {
7001            self.inner
7002                .ready()
7003                .await
7004                .map_err(|e| {
7005                    tonic::Status::unknown(
7006                        format!("Service was not ready: {}", e.into()),
7007                    )
7008                })?;
7009            let codec = tonic_prost::ProstCodec::default();
7010            let path = http::uri::PathAndQuery::from_static(
7011                "/pidgr.v1.MemberService/ListUsers",
7012            );
7013            let mut req = request.into_request();
7014            req.extensions_mut()
7015                .insert(GrpcMethod::new("pidgr.v1.MemberService", "ListUsers"));
7016            self.inner.unary(req, path, codec).await
7017        }
7018        /** Change a user's role within the organization.
7019 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
7020*/
7021        pub async fn update_user_role(
7022            &mut self,
7023            request: impl tonic::IntoRequest<super::UpdateUserRoleRequest>,
7024        ) -> std::result::Result<
7025            tonic::Response<super::UpdateUserRoleResponse>,
7026            tonic::Status,
7027        > {
7028            self.inner
7029                .ready()
7030                .await
7031                .map_err(|e| {
7032                    tonic::Status::unknown(
7033                        format!("Service was not ready: {}", e.into()),
7034                    )
7035                })?;
7036            let codec = tonic_prost::ProstCodec::default();
7037            let path = http::uri::PathAndQuery::from_static(
7038                "/pidgr.v1.MemberService/UpdateUserRole",
7039            );
7040            let mut req = request.into_request();
7041            req.extensions_mut()
7042                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserRole"));
7043            self.inner.unary(req, path, codec).await
7044        }
7045        /** Deactivate a user within the organization.
7046 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
7047*/
7048        pub async fn deactivate_user(
7049            &mut self,
7050            request: impl tonic::IntoRequest<super::DeactivateUserRequest>,
7051        ) -> std::result::Result<
7052            tonic::Response<super::DeactivateUserResponse>,
7053            tonic::Status,
7054        > {
7055            self.inner
7056                .ready()
7057                .await
7058                .map_err(|e| {
7059                    tonic::Status::unknown(
7060                        format!("Service was not ready: {}", e.into()),
7061                    )
7062                })?;
7063            let codec = tonic_prost::ProstCodec::default();
7064            let path = http::uri::PathAndQuery::from_static(
7065                "/pidgr.v1.MemberService/DeactivateUser",
7066            );
7067            let mut req = request.into_request();
7068            req.extensions_mut()
7069                .insert(GrpcMethod::new("pidgr.v1.MemberService", "DeactivateUser"));
7070            self.inner.unary(req, path, codec).await
7071        }
7072        /** Reactivate a deactivated user, restoring their status to INVITED.
7073 The user must complete the invite link flow again to become ACTIVE.
7074 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
7075*/
7076        pub async fn reactivate_user(
7077            &mut self,
7078            request: impl tonic::IntoRequest<super::ReactivateUserRequest>,
7079        ) -> std::result::Result<
7080            tonic::Response<super::ReactivateUserResponse>,
7081            tonic::Status,
7082        > {
7083            self.inner
7084                .ready()
7085                .await
7086                .map_err(|e| {
7087                    tonic::Status::unknown(
7088                        format!("Service was not ready: {}", e.into()),
7089                    )
7090                })?;
7091            let codec = tonic_prost::ProstCodec::default();
7092            let path = http::uri::PathAndQuery::from_static(
7093                "/pidgr.v1.MemberService/ReactivateUser",
7094            );
7095            let mut req = request.into_request();
7096            req.extensions_mut()
7097                .insert(GrpcMethod::new("pidgr.v1.MemberService", "ReactivateUser"));
7098            self.inner.unary(req, path, codec).await
7099        }
7100        /** Revoke an invitation for a user who has not yet completed registration.
7101 Hard-deletes the user record (INVITED users have no data to preserve).
7102 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
7103*/
7104        pub async fn revoke_invite(
7105            &mut self,
7106            request: impl tonic::IntoRequest<super::RevokeInviteRequest>,
7107        ) -> std::result::Result<
7108            tonic::Response<super::RevokeInviteResponse>,
7109            tonic::Status,
7110        > {
7111            self.inner
7112                .ready()
7113                .await
7114                .map_err(|e| {
7115                    tonic::Status::unknown(
7116                        format!("Service was not ready: {}", e.into()),
7117                    )
7118                })?;
7119            let codec = tonic_prost::ProstCodec::default();
7120            let path = http::uri::PathAndQuery::from_static(
7121                "/pidgr.v1.MemberService/RevokeInvite",
7122            );
7123            let mut req = request.into_request();
7124            req.extensions_mut()
7125                .insert(GrpcMethod::new("pidgr.v1.MemberService", "RevokeInvite"));
7126            self.inner.unary(req, path, codec).await
7127        }
7128        /** Update a user's profile attributes (department, title, etc.).
7129 Self-update (empty user_id or matching JWT sub) requires no special permission.
7130 Updating another user requires PERMISSION_MEMBERS_MANAGE.
7131*/
7132        pub async fn update_user_profile(
7133            &mut self,
7134            request: impl tonic::IntoRequest<super::UpdateUserProfileRequest>,
7135        ) -> std::result::Result<
7136            tonic::Response<super::UpdateUserProfileResponse>,
7137            tonic::Status,
7138        > {
7139            self.inner
7140                .ready()
7141                .await
7142                .map_err(|e| {
7143                    tonic::Status::unknown(
7144                        format!("Service was not ready: {}", e.into()),
7145                    )
7146                })?;
7147            let codec = tonic_prost::ProstCodec::default();
7148            let path = http::uri::PathAndQuery::from_static(
7149                "/pidgr.v1.MemberService/UpdateUserProfile",
7150            );
7151            let mut req = request.into_request();
7152            req.extensions_mut()
7153                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserProfile"));
7154            self.inner.unary(req, path, codec).await
7155        }
7156        /** Retrieve the caller's platform settings (theme, etc.).
7157 Authorization: Any authenticated user (self-only).
7158*/
7159        pub async fn get_user_settings(
7160            &mut self,
7161            request: impl tonic::IntoRequest<super::GetUserSettingsRequest>,
7162        ) -> std::result::Result<
7163            tonic::Response<super::GetUserSettingsResponse>,
7164            tonic::Status,
7165        > {
7166            self.inner
7167                .ready()
7168                .await
7169                .map_err(|e| {
7170                    tonic::Status::unknown(
7171                        format!("Service was not ready: {}", e.into()),
7172                    )
7173                })?;
7174            let codec = tonic_prost::ProstCodec::default();
7175            let path = http::uri::PathAndQuery::from_static(
7176                "/pidgr.v1.MemberService/GetUserSettings",
7177            );
7178            let mut req = request.into_request();
7179            req.extensions_mut()
7180                .insert(GrpcMethod::new("pidgr.v1.MemberService", "GetUserSettings"));
7181            self.inner.unary(req, path, codec).await
7182        }
7183        /** Update the caller's platform settings.
7184 Only fields with non-default values are applied; others are left unchanged.
7185 Authorization: Any authenticated user (self-only).
7186*/
7187        pub async fn update_user_settings(
7188            &mut self,
7189            request: impl tonic::IntoRequest<super::UpdateUserSettingsRequest>,
7190        ) -> std::result::Result<
7191            tonic::Response<super::UpdateUserSettingsResponse>,
7192            tonic::Status,
7193        > {
7194            self.inner
7195                .ready()
7196                .await
7197                .map_err(|e| {
7198                    tonic::Status::unknown(
7199                        format!("Service was not ready: {}", e.into()),
7200                    )
7201                })?;
7202            let codec = tonic_prost::ProstCodec::default();
7203            let path = http::uri::PathAndQuery::from_static(
7204                "/pidgr.v1.MemberService/UpdateUserSettings",
7205            );
7206            let mut req = request.into_request();
7207            req.extensions_mut()
7208                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserSettings"));
7209            self.inner.unary(req, path, codec).await
7210        }
7211        /** Invite multiple users to the organization in a single call.
7212 Emails are deduplicated. Each email is processed independently — individual
7213 failures do not abort the batch. Identity provider calls are parallelized (bounded concurrency).
7214 Authorization: Requires PERMISSION_MEMBERS_INVITE.
7215*/
7216        pub async fn bulk_invite_users(
7217            &mut self,
7218            request: impl tonic::IntoRequest<super::BulkInviteUsersRequest>,
7219        ) -> std::result::Result<
7220            tonic::Response<super::BulkInviteUsersResponse>,
7221            tonic::Status,
7222        > {
7223            self.inner
7224                .ready()
7225                .await
7226                .map_err(|e| {
7227                    tonic::Status::unknown(
7228                        format!("Service was not ready: {}", e.into()),
7229                    )
7230                })?;
7231            let codec = tonic_prost::ProstCodec::default();
7232            let path = http::uri::PathAndQuery::from_static(
7233                "/pidgr.v1.MemberService/BulkInviteUsers",
7234            );
7235            let mut req = request.into_request();
7236            req.extensions_mut()
7237                .insert(GrpcMethod::new("pidgr.v1.MemberService", "BulkInviteUsers"));
7238            self.inner.unary(req, path, codec).await
7239        }
7240        /** Confirm passkey enrollment after client-side WebAuthn registration.
7241 Verifies the caller has at least one registered credential server-side,
7242 then marks the user as passkey-enrolled in the identity provider.
7243 Authorization: Any authenticated user (self-only, no permission required).
7244*/
7245        pub async fn confirm_passkey_enrollment(
7246            &mut self,
7247            request: impl tonic::IntoRequest<super::ConfirmPasskeyEnrollmentRequest>,
7248        ) -> std::result::Result<
7249            tonic::Response<super::ConfirmPasskeyEnrollmentResponse>,
7250            tonic::Status,
7251        > {
7252            self.inner
7253                .ready()
7254                .await
7255                .map_err(|e| {
7256                    tonic::Status::unknown(
7257                        format!("Service was not ready: {}", e.into()),
7258                    )
7259                })?;
7260            let codec = tonic_prost::ProstCodec::default();
7261            let path = http::uri::PathAndQuery::from_static(
7262                "/pidgr.v1.MemberService/ConfirmPasskeyEnrollment",
7263            );
7264            let mut req = request.into_request();
7265            req.extensions_mut()
7266                .insert(
7267                    GrpcMethod::new("pidgr.v1.MemberService", "ConfirmPasskeyEnrollment"),
7268                );
7269            self.inner.unary(req, path, codec).await
7270        }
7271    }
7272}
7273/// Generated server implementations.
7274pub mod member_service_server {
7275    #![allow(
7276        unused_variables,
7277        dead_code,
7278        missing_docs,
7279        clippy::wildcard_imports,
7280        clippy::let_unit_value,
7281    )]
7282    use tonic::codegen::*;
7283    /// Generated trait containing gRPC methods that should be implemented for use with MemberServiceServer.
7284    #[async_trait]
7285    pub trait MemberService: std::marker::Send + std::marker::Sync + 'static {
7286        /** Invite a new user to the organization via email.
7287 Authorization: Requires PERMISSION_MEMBERS_INVITE.
7288*/
7289        async fn invite_user(
7290            &self,
7291            request: tonic::Request<super::InviteUserRequest>,
7292        ) -> std::result::Result<
7293            tonic::Response<super::InviteUserResponse>,
7294            tonic::Status,
7295        >;
7296        /** Retrieve a user by ID within the organization.
7297 Self-lookup (empty user_id) is allowed for any authenticated user.
7298 Authorization: Requires PERMISSION_MEMBERS_READ for other users.
7299*/
7300        async fn get_user(
7301            &self,
7302            request: tonic::Request<super::GetUserRequest>,
7303        ) -> std::result::Result<tonic::Response<super::GetUserResponse>, tonic::Status>;
7304        /** List all users in the organization with pagination.
7305 Authorization: Requires PERMISSION_MEMBERS_READ.
7306*/
7307        async fn list_users(
7308            &self,
7309            request: tonic::Request<super::ListUsersRequest>,
7310        ) -> std::result::Result<
7311            tonic::Response<super::ListUsersResponse>,
7312            tonic::Status,
7313        >;
7314        /** Change a user's role within the organization.
7315 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
7316*/
7317        async fn update_user_role(
7318            &self,
7319            request: tonic::Request<super::UpdateUserRoleRequest>,
7320        ) -> std::result::Result<
7321            tonic::Response<super::UpdateUserRoleResponse>,
7322            tonic::Status,
7323        >;
7324        /** Deactivate a user within the organization.
7325 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
7326*/
7327        async fn deactivate_user(
7328            &self,
7329            request: tonic::Request<super::DeactivateUserRequest>,
7330        ) -> std::result::Result<
7331            tonic::Response<super::DeactivateUserResponse>,
7332            tonic::Status,
7333        >;
7334        /** Reactivate a deactivated user, restoring their status to INVITED.
7335 The user must complete the invite link flow again to become ACTIVE.
7336 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
7337*/
7338        async fn reactivate_user(
7339            &self,
7340            request: tonic::Request<super::ReactivateUserRequest>,
7341        ) -> std::result::Result<
7342            tonic::Response<super::ReactivateUserResponse>,
7343            tonic::Status,
7344        >;
7345        /** Revoke an invitation for a user who has not yet completed registration.
7346 Hard-deletes the user record (INVITED users have no data to preserve).
7347 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
7348*/
7349        async fn revoke_invite(
7350            &self,
7351            request: tonic::Request<super::RevokeInviteRequest>,
7352        ) -> std::result::Result<
7353            tonic::Response<super::RevokeInviteResponse>,
7354            tonic::Status,
7355        >;
7356        /** Update a user's profile attributes (department, title, etc.).
7357 Self-update (empty user_id or matching JWT sub) requires no special permission.
7358 Updating another user requires PERMISSION_MEMBERS_MANAGE.
7359*/
7360        async fn update_user_profile(
7361            &self,
7362            request: tonic::Request<super::UpdateUserProfileRequest>,
7363        ) -> std::result::Result<
7364            tonic::Response<super::UpdateUserProfileResponse>,
7365            tonic::Status,
7366        >;
7367        /** Retrieve the caller's platform settings (theme, etc.).
7368 Authorization: Any authenticated user (self-only).
7369*/
7370        async fn get_user_settings(
7371            &self,
7372            request: tonic::Request<super::GetUserSettingsRequest>,
7373        ) -> std::result::Result<
7374            tonic::Response<super::GetUserSettingsResponse>,
7375            tonic::Status,
7376        >;
7377        /** Update the caller's platform settings.
7378 Only fields with non-default values are applied; others are left unchanged.
7379 Authorization: Any authenticated user (self-only).
7380*/
7381        async fn update_user_settings(
7382            &self,
7383            request: tonic::Request<super::UpdateUserSettingsRequest>,
7384        ) -> std::result::Result<
7385            tonic::Response<super::UpdateUserSettingsResponse>,
7386            tonic::Status,
7387        >;
7388        /** Invite multiple users to the organization in a single call.
7389 Emails are deduplicated. Each email is processed independently — individual
7390 failures do not abort the batch. Identity provider calls are parallelized (bounded concurrency).
7391 Authorization: Requires PERMISSION_MEMBERS_INVITE.
7392*/
7393        async fn bulk_invite_users(
7394            &self,
7395            request: tonic::Request<super::BulkInviteUsersRequest>,
7396        ) -> std::result::Result<
7397            tonic::Response<super::BulkInviteUsersResponse>,
7398            tonic::Status,
7399        >;
7400        /** Confirm passkey enrollment after client-side WebAuthn registration.
7401 Verifies the caller has at least one registered credential server-side,
7402 then marks the user as passkey-enrolled in the identity provider.
7403 Authorization: Any authenticated user (self-only, no permission required).
7404*/
7405        async fn confirm_passkey_enrollment(
7406            &self,
7407            request: tonic::Request<super::ConfirmPasskeyEnrollmentRequest>,
7408        ) -> std::result::Result<
7409            tonic::Response<super::ConfirmPasskeyEnrollmentResponse>,
7410            tonic::Status,
7411        >;
7412    }
7413    /** Manages members (users) within an organization.
7414 All RPCs operate within the caller's org (extracted from JWT).
7415*/
7416    #[derive(Debug)]
7417    pub struct MemberServiceServer<T> {
7418        inner: Arc<T>,
7419        accept_compression_encodings: EnabledCompressionEncodings,
7420        send_compression_encodings: EnabledCompressionEncodings,
7421        max_decoding_message_size: Option<usize>,
7422        max_encoding_message_size: Option<usize>,
7423    }
7424    impl<T> MemberServiceServer<T> {
7425        pub fn new(inner: T) -> Self {
7426            Self::from_arc(Arc::new(inner))
7427        }
7428        pub fn from_arc(inner: Arc<T>) -> Self {
7429            Self {
7430                inner,
7431                accept_compression_encodings: Default::default(),
7432                send_compression_encodings: Default::default(),
7433                max_decoding_message_size: None,
7434                max_encoding_message_size: None,
7435            }
7436        }
7437        pub fn with_interceptor<F>(
7438            inner: T,
7439            interceptor: F,
7440        ) -> InterceptedService<Self, F>
7441        where
7442            F: tonic::service::Interceptor,
7443        {
7444            InterceptedService::new(Self::new(inner), interceptor)
7445        }
7446        /// Enable decompressing requests with the given encoding.
7447        #[must_use]
7448        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7449            self.accept_compression_encodings.enable(encoding);
7450            self
7451        }
7452        /// Compress responses with the given encoding, if the client supports it.
7453        #[must_use]
7454        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7455            self.send_compression_encodings.enable(encoding);
7456            self
7457        }
7458        /// Limits the maximum size of a decoded message.
7459        ///
7460        /// Default: `4MB`
7461        #[must_use]
7462        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7463            self.max_decoding_message_size = Some(limit);
7464            self
7465        }
7466        /// Limits the maximum size of an encoded message.
7467        ///
7468        /// Default: `usize::MAX`
7469        #[must_use]
7470        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7471            self.max_encoding_message_size = Some(limit);
7472            self
7473        }
7474    }
7475    impl<T, B> tonic::codegen::Service<http::Request<B>> for MemberServiceServer<T>
7476    where
7477        T: MemberService,
7478        B: Body + std::marker::Send + 'static,
7479        B::Error: Into<StdError> + std::marker::Send + 'static,
7480    {
7481        type Response = http::Response<tonic::body::Body>;
7482        type Error = std::convert::Infallible;
7483        type Future = BoxFuture<Self::Response, Self::Error>;
7484        fn poll_ready(
7485            &mut self,
7486            _cx: &mut Context<'_>,
7487        ) -> Poll<std::result::Result<(), Self::Error>> {
7488            Poll::Ready(Ok(()))
7489        }
7490        fn call(&mut self, req: http::Request<B>) -> Self::Future {
7491            match req.uri().path() {
7492                "/pidgr.v1.MemberService/InviteUser" => {
7493                    #[allow(non_camel_case_types)]
7494                    struct InviteUserSvc<T: MemberService>(pub Arc<T>);
7495                    impl<
7496                        T: MemberService,
7497                    > tonic::server::UnaryService<super::InviteUserRequest>
7498                    for InviteUserSvc<T> {
7499                        type Response = super::InviteUserResponse;
7500                        type Future = BoxFuture<
7501                            tonic::Response<Self::Response>,
7502                            tonic::Status,
7503                        >;
7504                        fn call(
7505                            &mut self,
7506                            request: tonic::Request<super::InviteUserRequest>,
7507                        ) -> Self::Future {
7508                            let inner = Arc::clone(&self.0);
7509                            let fut = async move {
7510                                <T as MemberService>::invite_user(&inner, request).await
7511                            };
7512                            Box::pin(fut)
7513                        }
7514                    }
7515                    let accept_compression_encodings = self.accept_compression_encodings;
7516                    let send_compression_encodings = self.send_compression_encodings;
7517                    let max_decoding_message_size = self.max_decoding_message_size;
7518                    let max_encoding_message_size = self.max_encoding_message_size;
7519                    let inner = self.inner.clone();
7520                    let fut = async move {
7521                        let method = InviteUserSvc(inner);
7522                        let codec = tonic_prost::ProstCodec::default();
7523                        let mut grpc = tonic::server::Grpc::new(codec)
7524                            .apply_compression_config(
7525                                accept_compression_encodings,
7526                                send_compression_encodings,
7527                            )
7528                            .apply_max_message_size_config(
7529                                max_decoding_message_size,
7530                                max_encoding_message_size,
7531                            );
7532                        let res = grpc.unary(method, req).await;
7533                        Ok(res)
7534                    };
7535                    Box::pin(fut)
7536                }
7537                "/pidgr.v1.MemberService/GetUser" => {
7538                    #[allow(non_camel_case_types)]
7539                    struct GetUserSvc<T: MemberService>(pub Arc<T>);
7540                    impl<
7541                        T: MemberService,
7542                    > tonic::server::UnaryService<super::GetUserRequest>
7543                    for GetUserSvc<T> {
7544                        type Response = super::GetUserResponse;
7545                        type Future = BoxFuture<
7546                            tonic::Response<Self::Response>,
7547                            tonic::Status,
7548                        >;
7549                        fn call(
7550                            &mut self,
7551                            request: tonic::Request<super::GetUserRequest>,
7552                        ) -> Self::Future {
7553                            let inner = Arc::clone(&self.0);
7554                            let fut = async move {
7555                                <T as MemberService>::get_user(&inner, request).await
7556                            };
7557                            Box::pin(fut)
7558                        }
7559                    }
7560                    let accept_compression_encodings = self.accept_compression_encodings;
7561                    let send_compression_encodings = self.send_compression_encodings;
7562                    let max_decoding_message_size = self.max_decoding_message_size;
7563                    let max_encoding_message_size = self.max_encoding_message_size;
7564                    let inner = self.inner.clone();
7565                    let fut = async move {
7566                        let method = GetUserSvc(inner);
7567                        let codec = tonic_prost::ProstCodec::default();
7568                        let mut grpc = tonic::server::Grpc::new(codec)
7569                            .apply_compression_config(
7570                                accept_compression_encodings,
7571                                send_compression_encodings,
7572                            )
7573                            .apply_max_message_size_config(
7574                                max_decoding_message_size,
7575                                max_encoding_message_size,
7576                            );
7577                        let res = grpc.unary(method, req).await;
7578                        Ok(res)
7579                    };
7580                    Box::pin(fut)
7581                }
7582                "/pidgr.v1.MemberService/ListUsers" => {
7583                    #[allow(non_camel_case_types)]
7584                    struct ListUsersSvc<T: MemberService>(pub Arc<T>);
7585                    impl<
7586                        T: MemberService,
7587                    > tonic::server::UnaryService<super::ListUsersRequest>
7588                    for ListUsersSvc<T> {
7589                        type Response = super::ListUsersResponse;
7590                        type Future = BoxFuture<
7591                            tonic::Response<Self::Response>,
7592                            tonic::Status,
7593                        >;
7594                        fn call(
7595                            &mut self,
7596                            request: tonic::Request<super::ListUsersRequest>,
7597                        ) -> Self::Future {
7598                            let inner = Arc::clone(&self.0);
7599                            let fut = async move {
7600                                <T as MemberService>::list_users(&inner, request).await
7601                            };
7602                            Box::pin(fut)
7603                        }
7604                    }
7605                    let accept_compression_encodings = self.accept_compression_encodings;
7606                    let send_compression_encodings = self.send_compression_encodings;
7607                    let max_decoding_message_size = self.max_decoding_message_size;
7608                    let max_encoding_message_size = self.max_encoding_message_size;
7609                    let inner = self.inner.clone();
7610                    let fut = async move {
7611                        let method = ListUsersSvc(inner);
7612                        let codec = tonic_prost::ProstCodec::default();
7613                        let mut grpc = tonic::server::Grpc::new(codec)
7614                            .apply_compression_config(
7615                                accept_compression_encodings,
7616                                send_compression_encodings,
7617                            )
7618                            .apply_max_message_size_config(
7619                                max_decoding_message_size,
7620                                max_encoding_message_size,
7621                            );
7622                        let res = grpc.unary(method, req).await;
7623                        Ok(res)
7624                    };
7625                    Box::pin(fut)
7626                }
7627                "/pidgr.v1.MemberService/UpdateUserRole" => {
7628                    #[allow(non_camel_case_types)]
7629                    struct UpdateUserRoleSvc<T: MemberService>(pub Arc<T>);
7630                    impl<
7631                        T: MemberService,
7632                    > tonic::server::UnaryService<super::UpdateUserRoleRequest>
7633                    for UpdateUserRoleSvc<T> {
7634                        type Response = super::UpdateUserRoleResponse;
7635                        type Future = BoxFuture<
7636                            tonic::Response<Self::Response>,
7637                            tonic::Status,
7638                        >;
7639                        fn call(
7640                            &mut self,
7641                            request: tonic::Request<super::UpdateUserRoleRequest>,
7642                        ) -> Self::Future {
7643                            let inner = Arc::clone(&self.0);
7644                            let fut = async move {
7645                                <T as MemberService>::update_user_role(&inner, request)
7646                                    .await
7647                            };
7648                            Box::pin(fut)
7649                        }
7650                    }
7651                    let accept_compression_encodings = self.accept_compression_encodings;
7652                    let send_compression_encodings = self.send_compression_encodings;
7653                    let max_decoding_message_size = self.max_decoding_message_size;
7654                    let max_encoding_message_size = self.max_encoding_message_size;
7655                    let inner = self.inner.clone();
7656                    let fut = async move {
7657                        let method = UpdateUserRoleSvc(inner);
7658                        let codec = tonic_prost::ProstCodec::default();
7659                        let mut grpc = tonic::server::Grpc::new(codec)
7660                            .apply_compression_config(
7661                                accept_compression_encodings,
7662                                send_compression_encodings,
7663                            )
7664                            .apply_max_message_size_config(
7665                                max_decoding_message_size,
7666                                max_encoding_message_size,
7667                            );
7668                        let res = grpc.unary(method, req).await;
7669                        Ok(res)
7670                    };
7671                    Box::pin(fut)
7672                }
7673                "/pidgr.v1.MemberService/DeactivateUser" => {
7674                    #[allow(non_camel_case_types)]
7675                    struct DeactivateUserSvc<T: MemberService>(pub Arc<T>);
7676                    impl<
7677                        T: MemberService,
7678                    > tonic::server::UnaryService<super::DeactivateUserRequest>
7679                    for DeactivateUserSvc<T> {
7680                        type Response = super::DeactivateUserResponse;
7681                        type Future = BoxFuture<
7682                            tonic::Response<Self::Response>,
7683                            tonic::Status,
7684                        >;
7685                        fn call(
7686                            &mut self,
7687                            request: tonic::Request<super::DeactivateUserRequest>,
7688                        ) -> Self::Future {
7689                            let inner = Arc::clone(&self.0);
7690                            let fut = async move {
7691                                <T as MemberService>::deactivate_user(&inner, request).await
7692                            };
7693                            Box::pin(fut)
7694                        }
7695                    }
7696                    let accept_compression_encodings = self.accept_compression_encodings;
7697                    let send_compression_encodings = self.send_compression_encodings;
7698                    let max_decoding_message_size = self.max_decoding_message_size;
7699                    let max_encoding_message_size = self.max_encoding_message_size;
7700                    let inner = self.inner.clone();
7701                    let fut = async move {
7702                        let method = DeactivateUserSvc(inner);
7703                        let codec = tonic_prost::ProstCodec::default();
7704                        let mut grpc = tonic::server::Grpc::new(codec)
7705                            .apply_compression_config(
7706                                accept_compression_encodings,
7707                                send_compression_encodings,
7708                            )
7709                            .apply_max_message_size_config(
7710                                max_decoding_message_size,
7711                                max_encoding_message_size,
7712                            );
7713                        let res = grpc.unary(method, req).await;
7714                        Ok(res)
7715                    };
7716                    Box::pin(fut)
7717                }
7718                "/pidgr.v1.MemberService/ReactivateUser" => {
7719                    #[allow(non_camel_case_types)]
7720                    struct ReactivateUserSvc<T: MemberService>(pub Arc<T>);
7721                    impl<
7722                        T: MemberService,
7723                    > tonic::server::UnaryService<super::ReactivateUserRequest>
7724                    for ReactivateUserSvc<T> {
7725                        type Response = super::ReactivateUserResponse;
7726                        type Future = BoxFuture<
7727                            tonic::Response<Self::Response>,
7728                            tonic::Status,
7729                        >;
7730                        fn call(
7731                            &mut self,
7732                            request: tonic::Request<super::ReactivateUserRequest>,
7733                        ) -> Self::Future {
7734                            let inner = Arc::clone(&self.0);
7735                            let fut = async move {
7736                                <T as MemberService>::reactivate_user(&inner, request).await
7737                            };
7738                            Box::pin(fut)
7739                        }
7740                    }
7741                    let accept_compression_encodings = self.accept_compression_encodings;
7742                    let send_compression_encodings = self.send_compression_encodings;
7743                    let max_decoding_message_size = self.max_decoding_message_size;
7744                    let max_encoding_message_size = self.max_encoding_message_size;
7745                    let inner = self.inner.clone();
7746                    let fut = async move {
7747                        let method = ReactivateUserSvc(inner);
7748                        let codec = tonic_prost::ProstCodec::default();
7749                        let mut grpc = tonic::server::Grpc::new(codec)
7750                            .apply_compression_config(
7751                                accept_compression_encodings,
7752                                send_compression_encodings,
7753                            )
7754                            .apply_max_message_size_config(
7755                                max_decoding_message_size,
7756                                max_encoding_message_size,
7757                            );
7758                        let res = grpc.unary(method, req).await;
7759                        Ok(res)
7760                    };
7761                    Box::pin(fut)
7762                }
7763                "/pidgr.v1.MemberService/RevokeInvite" => {
7764                    #[allow(non_camel_case_types)]
7765                    struct RevokeInviteSvc<T: MemberService>(pub Arc<T>);
7766                    impl<
7767                        T: MemberService,
7768                    > tonic::server::UnaryService<super::RevokeInviteRequest>
7769                    for RevokeInviteSvc<T> {
7770                        type Response = super::RevokeInviteResponse;
7771                        type Future = BoxFuture<
7772                            tonic::Response<Self::Response>,
7773                            tonic::Status,
7774                        >;
7775                        fn call(
7776                            &mut self,
7777                            request: tonic::Request<super::RevokeInviteRequest>,
7778                        ) -> Self::Future {
7779                            let inner = Arc::clone(&self.0);
7780                            let fut = async move {
7781                                <T as MemberService>::revoke_invite(&inner, request).await
7782                            };
7783                            Box::pin(fut)
7784                        }
7785                    }
7786                    let accept_compression_encodings = self.accept_compression_encodings;
7787                    let send_compression_encodings = self.send_compression_encodings;
7788                    let max_decoding_message_size = self.max_decoding_message_size;
7789                    let max_encoding_message_size = self.max_encoding_message_size;
7790                    let inner = self.inner.clone();
7791                    let fut = async move {
7792                        let method = RevokeInviteSvc(inner);
7793                        let codec = tonic_prost::ProstCodec::default();
7794                        let mut grpc = tonic::server::Grpc::new(codec)
7795                            .apply_compression_config(
7796                                accept_compression_encodings,
7797                                send_compression_encodings,
7798                            )
7799                            .apply_max_message_size_config(
7800                                max_decoding_message_size,
7801                                max_encoding_message_size,
7802                            );
7803                        let res = grpc.unary(method, req).await;
7804                        Ok(res)
7805                    };
7806                    Box::pin(fut)
7807                }
7808                "/pidgr.v1.MemberService/UpdateUserProfile" => {
7809                    #[allow(non_camel_case_types)]
7810                    struct UpdateUserProfileSvc<T: MemberService>(pub Arc<T>);
7811                    impl<
7812                        T: MemberService,
7813                    > tonic::server::UnaryService<super::UpdateUserProfileRequest>
7814                    for UpdateUserProfileSvc<T> {
7815                        type Response = super::UpdateUserProfileResponse;
7816                        type Future = BoxFuture<
7817                            tonic::Response<Self::Response>,
7818                            tonic::Status,
7819                        >;
7820                        fn call(
7821                            &mut self,
7822                            request: tonic::Request<super::UpdateUserProfileRequest>,
7823                        ) -> Self::Future {
7824                            let inner = Arc::clone(&self.0);
7825                            let fut = async move {
7826                                <T as MemberService>::update_user_profile(&inner, request)
7827                                    .await
7828                            };
7829                            Box::pin(fut)
7830                        }
7831                    }
7832                    let accept_compression_encodings = self.accept_compression_encodings;
7833                    let send_compression_encodings = self.send_compression_encodings;
7834                    let max_decoding_message_size = self.max_decoding_message_size;
7835                    let max_encoding_message_size = self.max_encoding_message_size;
7836                    let inner = self.inner.clone();
7837                    let fut = async move {
7838                        let method = UpdateUserProfileSvc(inner);
7839                        let codec = tonic_prost::ProstCodec::default();
7840                        let mut grpc = tonic::server::Grpc::new(codec)
7841                            .apply_compression_config(
7842                                accept_compression_encodings,
7843                                send_compression_encodings,
7844                            )
7845                            .apply_max_message_size_config(
7846                                max_decoding_message_size,
7847                                max_encoding_message_size,
7848                            );
7849                        let res = grpc.unary(method, req).await;
7850                        Ok(res)
7851                    };
7852                    Box::pin(fut)
7853                }
7854                "/pidgr.v1.MemberService/GetUserSettings" => {
7855                    #[allow(non_camel_case_types)]
7856                    struct GetUserSettingsSvc<T: MemberService>(pub Arc<T>);
7857                    impl<
7858                        T: MemberService,
7859                    > tonic::server::UnaryService<super::GetUserSettingsRequest>
7860                    for GetUserSettingsSvc<T> {
7861                        type Response = super::GetUserSettingsResponse;
7862                        type Future = BoxFuture<
7863                            tonic::Response<Self::Response>,
7864                            tonic::Status,
7865                        >;
7866                        fn call(
7867                            &mut self,
7868                            request: tonic::Request<super::GetUserSettingsRequest>,
7869                        ) -> Self::Future {
7870                            let inner = Arc::clone(&self.0);
7871                            let fut = async move {
7872                                <T as MemberService>::get_user_settings(&inner, request)
7873                                    .await
7874                            };
7875                            Box::pin(fut)
7876                        }
7877                    }
7878                    let accept_compression_encodings = self.accept_compression_encodings;
7879                    let send_compression_encodings = self.send_compression_encodings;
7880                    let max_decoding_message_size = self.max_decoding_message_size;
7881                    let max_encoding_message_size = self.max_encoding_message_size;
7882                    let inner = self.inner.clone();
7883                    let fut = async move {
7884                        let method = GetUserSettingsSvc(inner);
7885                        let codec = tonic_prost::ProstCodec::default();
7886                        let mut grpc = tonic::server::Grpc::new(codec)
7887                            .apply_compression_config(
7888                                accept_compression_encodings,
7889                                send_compression_encodings,
7890                            )
7891                            .apply_max_message_size_config(
7892                                max_decoding_message_size,
7893                                max_encoding_message_size,
7894                            );
7895                        let res = grpc.unary(method, req).await;
7896                        Ok(res)
7897                    };
7898                    Box::pin(fut)
7899                }
7900                "/pidgr.v1.MemberService/UpdateUserSettings" => {
7901                    #[allow(non_camel_case_types)]
7902                    struct UpdateUserSettingsSvc<T: MemberService>(pub Arc<T>);
7903                    impl<
7904                        T: MemberService,
7905                    > tonic::server::UnaryService<super::UpdateUserSettingsRequest>
7906                    for UpdateUserSettingsSvc<T> {
7907                        type Response = super::UpdateUserSettingsResponse;
7908                        type Future = BoxFuture<
7909                            tonic::Response<Self::Response>,
7910                            tonic::Status,
7911                        >;
7912                        fn call(
7913                            &mut self,
7914                            request: tonic::Request<super::UpdateUserSettingsRequest>,
7915                        ) -> Self::Future {
7916                            let inner = Arc::clone(&self.0);
7917                            let fut = async move {
7918                                <T as MemberService>::update_user_settings(&inner, request)
7919                                    .await
7920                            };
7921                            Box::pin(fut)
7922                        }
7923                    }
7924                    let accept_compression_encodings = self.accept_compression_encodings;
7925                    let send_compression_encodings = self.send_compression_encodings;
7926                    let max_decoding_message_size = self.max_decoding_message_size;
7927                    let max_encoding_message_size = self.max_encoding_message_size;
7928                    let inner = self.inner.clone();
7929                    let fut = async move {
7930                        let method = UpdateUserSettingsSvc(inner);
7931                        let codec = tonic_prost::ProstCodec::default();
7932                        let mut grpc = tonic::server::Grpc::new(codec)
7933                            .apply_compression_config(
7934                                accept_compression_encodings,
7935                                send_compression_encodings,
7936                            )
7937                            .apply_max_message_size_config(
7938                                max_decoding_message_size,
7939                                max_encoding_message_size,
7940                            );
7941                        let res = grpc.unary(method, req).await;
7942                        Ok(res)
7943                    };
7944                    Box::pin(fut)
7945                }
7946                "/pidgr.v1.MemberService/BulkInviteUsers" => {
7947                    #[allow(non_camel_case_types)]
7948                    struct BulkInviteUsersSvc<T: MemberService>(pub Arc<T>);
7949                    impl<
7950                        T: MemberService,
7951                    > tonic::server::UnaryService<super::BulkInviteUsersRequest>
7952                    for BulkInviteUsersSvc<T> {
7953                        type Response = super::BulkInviteUsersResponse;
7954                        type Future = BoxFuture<
7955                            tonic::Response<Self::Response>,
7956                            tonic::Status,
7957                        >;
7958                        fn call(
7959                            &mut self,
7960                            request: tonic::Request<super::BulkInviteUsersRequest>,
7961                        ) -> Self::Future {
7962                            let inner = Arc::clone(&self.0);
7963                            let fut = async move {
7964                                <T as MemberService>::bulk_invite_users(&inner, request)
7965                                    .await
7966                            };
7967                            Box::pin(fut)
7968                        }
7969                    }
7970                    let accept_compression_encodings = self.accept_compression_encodings;
7971                    let send_compression_encodings = self.send_compression_encodings;
7972                    let max_decoding_message_size = self.max_decoding_message_size;
7973                    let max_encoding_message_size = self.max_encoding_message_size;
7974                    let inner = self.inner.clone();
7975                    let fut = async move {
7976                        let method = BulkInviteUsersSvc(inner);
7977                        let codec = tonic_prost::ProstCodec::default();
7978                        let mut grpc = tonic::server::Grpc::new(codec)
7979                            .apply_compression_config(
7980                                accept_compression_encodings,
7981                                send_compression_encodings,
7982                            )
7983                            .apply_max_message_size_config(
7984                                max_decoding_message_size,
7985                                max_encoding_message_size,
7986                            );
7987                        let res = grpc.unary(method, req).await;
7988                        Ok(res)
7989                    };
7990                    Box::pin(fut)
7991                }
7992                "/pidgr.v1.MemberService/ConfirmPasskeyEnrollment" => {
7993                    #[allow(non_camel_case_types)]
7994                    struct ConfirmPasskeyEnrollmentSvc<T: MemberService>(pub Arc<T>);
7995                    impl<
7996                        T: MemberService,
7997                    > tonic::server::UnaryService<super::ConfirmPasskeyEnrollmentRequest>
7998                    for ConfirmPasskeyEnrollmentSvc<T> {
7999                        type Response = super::ConfirmPasskeyEnrollmentResponse;
8000                        type Future = BoxFuture<
8001                            tonic::Response<Self::Response>,
8002                            tonic::Status,
8003                        >;
8004                        fn call(
8005                            &mut self,
8006                            request: tonic::Request<
8007                                super::ConfirmPasskeyEnrollmentRequest,
8008                            >,
8009                        ) -> Self::Future {
8010                            let inner = Arc::clone(&self.0);
8011                            let fut = async move {
8012                                <T as MemberService>::confirm_passkey_enrollment(
8013                                        &inner,
8014                                        request,
8015                                    )
8016                                    .await
8017                            };
8018                            Box::pin(fut)
8019                        }
8020                    }
8021                    let accept_compression_encodings = self.accept_compression_encodings;
8022                    let send_compression_encodings = self.send_compression_encodings;
8023                    let max_decoding_message_size = self.max_decoding_message_size;
8024                    let max_encoding_message_size = self.max_encoding_message_size;
8025                    let inner = self.inner.clone();
8026                    let fut = async move {
8027                        let method = ConfirmPasskeyEnrollmentSvc(inner);
8028                        let codec = tonic_prost::ProstCodec::default();
8029                        let mut grpc = tonic::server::Grpc::new(codec)
8030                            .apply_compression_config(
8031                                accept_compression_encodings,
8032                                send_compression_encodings,
8033                            )
8034                            .apply_max_message_size_config(
8035                                max_decoding_message_size,
8036                                max_encoding_message_size,
8037                            );
8038                        let res = grpc.unary(method, req).await;
8039                        Ok(res)
8040                    };
8041                    Box::pin(fut)
8042                }
8043                _ => {
8044                    Box::pin(async move {
8045                        let mut response = http::Response::new(
8046                            tonic::body::Body::default(),
8047                        );
8048                        let headers = response.headers_mut();
8049                        headers
8050                            .insert(
8051                                tonic::Status::GRPC_STATUS,
8052                                (tonic::Code::Unimplemented as i32).into(),
8053                            );
8054                        headers
8055                            .insert(
8056                                http::header::CONTENT_TYPE,
8057                                tonic::metadata::GRPC_CONTENT_TYPE,
8058                            );
8059                        Ok(response)
8060                    })
8061                }
8062            }
8063        }
8064    }
8065    impl<T> Clone for MemberServiceServer<T> {
8066        fn clone(&self) -> Self {
8067            let inner = self.inner.clone();
8068            Self {
8069                inner,
8070                accept_compression_encodings: self.accept_compression_encodings,
8071                send_compression_encodings: self.send_compression_encodings,
8072                max_decoding_message_size: self.max_decoding_message_size,
8073                max_encoding_message_size: self.max_encoding_message_size,
8074            }
8075        }
8076    }
8077    /// Generated gRPC service name
8078    pub const SERVICE_NAME: &str = "pidgr.v1.MemberService";
8079    impl<T> tonic::server::NamedService for MemberServiceServer<T> {
8080        const NAME: &'static str = SERVICE_NAME;
8081    }
8082}
8083/// Generated client implementations.
8084pub mod organization_service_client {
8085    #![allow(
8086        unused_variables,
8087        dead_code,
8088        missing_docs,
8089        clippy::wildcard_imports,
8090        clippy::let_unit_value,
8091    )]
8092    use tonic::codegen::*;
8093    use tonic::codegen::http::Uri;
8094    /** Manages organizations (tenants) in the Pidgr platform.
8095 Most RPCs operate within the caller's org (extracted from JWT).
8096 CreateOrganization supports API key auth or JWT auth (self-service onboarding).
8097*/
8098    #[derive(Debug, Clone)]
8099    pub struct OrganizationServiceClient<T> {
8100        inner: tonic::client::Grpc<T>,
8101    }
8102    impl OrganizationServiceClient<tonic::transport::Channel> {
8103        /// Attempt to create a new client by connecting to a given endpoint.
8104        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
8105        where
8106            D: TryInto<tonic::transport::Endpoint>,
8107            D::Error: Into<StdError>,
8108        {
8109            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
8110            Ok(Self::new(conn))
8111        }
8112    }
8113    impl<T> OrganizationServiceClient<T>
8114    where
8115        T: tonic::client::GrpcService<tonic::body::Body>,
8116        T::Error: Into<StdError>,
8117        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
8118        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
8119    {
8120        pub fn new(inner: T) -> Self {
8121            let inner = tonic::client::Grpc::new(inner);
8122            Self { inner }
8123        }
8124        pub fn with_origin(inner: T, origin: Uri) -> Self {
8125            let inner = tonic::client::Grpc::with_origin(inner, origin);
8126            Self { inner }
8127        }
8128        pub fn with_interceptor<F>(
8129            inner: T,
8130            interceptor: F,
8131        ) -> OrganizationServiceClient<InterceptedService<T, F>>
8132        where
8133            F: tonic::service::Interceptor,
8134            T::ResponseBody: Default,
8135            T: tonic::codegen::Service<
8136                http::Request<tonic::body::Body>,
8137                Response = http::Response<
8138                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
8139                >,
8140            >,
8141            <T as tonic::codegen::Service<
8142                http::Request<tonic::body::Body>,
8143            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
8144        {
8145            OrganizationServiceClient::new(InterceptedService::new(inner, interceptor))
8146        }
8147        /// Compress requests with the given encoding.
8148        ///
8149        /// This requires the server to support it otherwise it might respond with an
8150        /// error.
8151        #[must_use]
8152        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8153            self.inner = self.inner.send_compressed(encoding);
8154            self
8155        }
8156        /// Enable decompressing responses.
8157        #[must_use]
8158        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8159            self.inner = self.inner.accept_compressed(encoding);
8160            self
8161        }
8162        /// Limits the maximum size of a decoded message.
8163        ///
8164        /// Default: `4MB`
8165        #[must_use]
8166        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8167            self.inner = self.inner.max_decoding_message_size(limit);
8168            self
8169        }
8170        /// Limits the maximum size of an encoded message.
8171        ///
8172        /// Default: `usize::MAX`
8173        #[must_use]
8174        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8175            self.inner = self.inner.max_encoding_message_size(limit);
8176            self
8177        }
8178        /** Create a new organization with an initial admin user.
8179 Supports API key auth (service-to-service) and JWT auth (self-service onboarding).
8180*/
8181        pub async fn create_organization(
8182            &mut self,
8183            request: impl tonic::IntoRequest<super::CreateOrganizationRequest>,
8184        ) -> std::result::Result<
8185            tonic::Response<super::CreateOrganizationResponse>,
8186            tonic::Status,
8187        > {
8188            self.inner
8189                .ready()
8190                .await
8191                .map_err(|e| {
8192                    tonic::Status::unknown(
8193                        format!("Service was not ready: {}", e.into()),
8194                    )
8195                })?;
8196            let codec = tonic_prost::ProstCodec::default();
8197            let path = http::uri::PathAndQuery::from_static(
8198                "/pidgr.v1.OrganizationService/CreateOrganization",
8199            );
8200            let mut req = request.into_request();
8201            req.extensions_mut()
8202                .insert(
8203                    GrpcMethod::new("pidgr.v1.OrganizationService", "CreateOrganization"),
8204                );
8205            self.inner.unary(req, path, codec).await
8206        }
8207        /** Retrieve the organization for the authenticated user.
8208 Authorization: Requires PERMISSION_ORG_READ.
8209*/
8210        pub async fn get_organization(
8211            &mut self,
8212            request: impl tonic::IntoRequest<super::GetOrganizationRequest>,
8213        ) -> std::result::Result<
8214            tonic::Response<super::GetOrganizationResponse>,
8215            tonic::Status,
8216        > {
8217            self.inner
8218                .ready()
8219                .await
8220                .map_err(|e| {
8221                    tonic::Status::unknown(
8222                        format!("Service was not ready: {}", e.into()),
8223                    )
8224                })?;
8225            let codec = tonic_prost::ProstCodec::default();
8226            let path = http::uri::PathAndQuery::from_static(
8227                "/pidgr.v1.OrganizationService/GetOrganization",
8228            );
8229            let mut req = request.into_request();
8230            req.extensions_mut()
8231                .insert(
8232                    GrpcMethod::new("pidgr.v1.OrganizationService", "GetOrganization"),
8233                );
8234            self.inner.unary(req, path, codec).await
8235        }
8236        /** Update organization settings (name, default workflow, industry, company size).
8237 Authorization: Requires PERMISSION_ORG_WRITE.
8238*/
8239        pub async fn update_organization(
8240            &mut self,
8241            request: impl tonic::IntoRequest<super::UpdateOrganizationRequest>,
8242        ) -> std::result::Result<
8243            tonic::Response<super::UpdateOrganizationResponse>,
8244            tonic::Status,
8245        > {
8246            self.inner
8247                .ready()
8248                .await
8249                .map_err(|e| {
8250                    tonic::Status::unknown(
8251                        format!("Service was not ready: {}", e.into()),
8252                    )
8253                })?;
8254            let codec = tonic_prost::ProstCodec::default();
8255            let path = http::uri::PathAndQuery::from_static(
8256                "/pidgr.v1.OrganizationService/UpdateOrganization",
8257            );
8258            let mut req = request.into_request();
8259            req.extensions_mut()
8260                .insert(
8261                    GrpcMethod::new("pidgr.v1.OrganizationService", "UpdateOrganization"),
8262                );
8263            self.inner.unary(req, path, codec).await
8264        }
8265        /** Replace all SSO attribute mappings for the organization.
8266 Authorization: Requires PERMISSION_ORG_WRITE.
8267*/
8268        pub async fn update_sso_attribute_mappings(
8269            &mut self,
8270            request: impl tonic::IntoRequest<super::UpdateSsoAttributeMappingsRequest>,
8271        ) -> std::result::Result<
8272            tonic::Response<super::UpdateSsoAttributeMappingsResponse>,
8273            tonic::Status,
8274        > {
8275            self.inner
8276                .ready()
8277                .await
8278                .map_err(|e| {
8279                    tonic::Status::unknown(
8280                        format!("Service was not ready: {}", e.into()),
8281                    )
8282                })?;
8283            let codec = tonic_prost::ProstCodec::default();
8284            let path = http::uri::PathAndQuery::from_static(
8285                "/pidgr.v1.OrganizationService/UpdateSsoAttributeMappings",
8286            );
8287            let mut req = request.into_request();
8288            req.extensions_mut()
8289                .insert(
8290                    GrpcMethod::new(
8291                        "pidgr.v1.OrganizationService",
8292                        "UpdateSsoAttributeMappings",
8293                    ),
8294                );
8295            self.inner.unary(req, path, codec).await
8296        }
8297        /** Rotate the analytics salt and optionally increase the bucket count for k-anonymization.
8298 Authorization: Requires PERMISSION_PRIVACY_WRITE.
8299*/
8300        pub async fn rotate_analytics_salt(
8301            &mut self,
8302            request: impl tonic::IntoRequest<super::RotateAnalyticsSaltRequest>,
8303        ) -> std::result::Result<
8304            tonic::Response<super::RotateAnalyticsSaltResponse>,
8305            tonic::Status,
8306        > {
8307            self.inner
8308                .ready()
8309                .await
8310                .map_err(|e| {
8311                    tonic::Status::unknown(
8312                        format!("Service was not ready: {}", e.into()),
8313                    )
8314                })?;
8315            let codec = tonic_prost::ProstCodec::default();
8316            let path = http::uri::PathAndQuery::from_static(
8317                "/pidgr.v1.OrganizationService/RotateAnalyticsSalt",
8318            );
8319            let mut req = request.into_request();
8320            req.extensions_mut()
8321                .insert(
8322                    GrpcMethod::new(
8323                        "pidgr.v1.OrganizationService",
8324                        "RotateAnalyticsSalt",
8325                    ),
8326                );
8327            self.inner.unary(req, path, codec).await
8328        }
8329        /** Update the differential privacy epsilon parameter.
8330 Authorization: Requires PERMISSION_PRIVACY_WRITE.
8331*/
8332        pub async fn update_analytics_epsilon(
8333            &mut self,
8334            request: impl tonic::IntoRequest<super::UpdateAnalyticsEpsilonRequest>,
8335        ) -> std::result::Result<
8336            tonic::Response<super::UpdateAnalyticsEpsilonResponse>,
8337            tonic::Status,
8338        > {
8339            self.inner
8340                .ready()
8341                .await
8342                .map_err(|e| {
8343                    tonic::Status::unknown(
8344                        format!("Service was not ready: {}", e.into()),
8345                    )
8346                })?;
8347            let codec = tonic_prost::ProstCodec::default();
8348            let path = http::uri::PathAndQuery::from_static(
8349                "/pidgr.v1.OrganizationService/UpdateAnalyticsEpsilon",
8350            );
8351            let mut req = request.into_request();
8352            req.extensions_mut()
8353                .insert(
8354                    GrpcMethod::new(
8355                        "pidgr.v1.OrganizationService",
8356                        "UpdateAnalyticsEpsilon",
8357                    ),
8358                );
8359            self.inner.unary(req, path, codec).await
8360        }
8361    }
8362}
8363/// Generated server implementations.
8364pub mod organization_service_server {
8365    #![allow(
8366        unused_variables,
8367        dead_code,
8368        missing_docs,
8369        clippy::wildcard_imports,
8370        clippy::let_unit_value,
8371    )]
8372    use tonic::codegen::*;
8373    /// Generated trait containing gRPC methods that should be implemented for use with OrganizationServiceServer.
8374    #[async_trait]
8375    pub trait OrganizationService: std::marker::Send + std::marker::Sync + 'static {
8376        /** Create a new organization with an initial admin user.
8377 Supports API key auth (service-to-service) and JWT auth (self-service onboarding).
8378*/
8379        async fn create_organization(
8380            &self,
8381            request: tonic::Request<super::CreateOrganizationRequest>,
8382        ) -> std::result::Result<
8383            tonic::Response<super::CreateOrganizationResponse>,
8384            tonic::Status,
8385        >;
8386        /** Retrieve the organization for the authenticated user.
8387 Authorization: Requires PERMISSION_ORG_READ.
8388*/
8389        async fn get_organization(
8390            &self,
8391            request: tonic::Request<super::GetOrganizationRequest>,
8392        ) -> std::result::Result<
8393            tonic::Response<super::GetOrganizationResponse>,
8394            tonic::Status,
8395        >;
8396        /** Update organization settings (name, default workflow, industry, company size).
8397 Authorization: Requires PERMISSION_ORG_WRITE.
8398*/
8399        async fn update_organization(
8400            &self,
8401            request: tonic::Request<super::UpdateOrganizationRequest>,
8402        ) -> std::result::Result<
8403            tonic::Response<super::UpdateOrganizationResponse>,
8404            tonic::Status,
8405        >;
8406        /** Replace all SSO attribute mappings for the organization.
8407 Authorization: Requires PERMISSION_ORG_WRITE.
8408*/
8409        async fn update_sso_attribute_mappings(
8410            &self,
8411            request: tonic::Request<super::UpdateSsoAttributeMappingsRequest>,
8412        ) -> std::result::Result<
8413            tonic::Response<super::UpdateSsoAttributeMappingsResponse>,
8414            tonic::Status,
8415        >;
8416        /** Rotate the analytics salt and optionally increase the bucket count for k-anonymization.
8417 Authorization: Requires PERMISSION_PRIVACY_WRITE.
8418*/
8419        async fn rotate_analytics_salt(
8420            &self,
8421            request: tonic::Request<super::RotateAnalyticsSaltRequest>,
8422        ) -> std::result::Result<
8423            tonic::Response<super::RotateAnalyticsSaltResponse>,
8424            tonic::Status,
8425        >;
8426        /** Update the differential privacy epsilon parameter.
8427 Authorization: Requires PERMISSION_PRIVACY_WRITE.
8428*/
8429        async fn update_analytics_epsilon(
8430            &self,
8431            request: tonic::Request<super::UpdateAnalyticsEpsilonRequest>,
8432        ) -> std::result::Result<
8433            tonic::Response<super::UpdateAnalyticsEpsilonResponse>,
8434            tonic::Status,
8435        >;
8436    }
8437    /** Manages organizations (tenants) in the Pidgr platform.
8438 Most RPCs operate within the caller's org (extracted from JWT).
8439 CreateOrganization supports API key auth or JWT auth (self-service onboarding).
8440*/
8441    #[derive(Debug)]
8442    pub struct OrganizationServiceServer<T> {
8443        inner: Arc<T>,
8444        accept_compression_encodings: EnabledCompressionEncodings,
8445        send_compression_encodings: EnabledCompressionEncodings,
8446        max_decoding_message_size: Option<usize>,
8447        max_encoding_message_size: Option<usize>,
8448    }
8449    impl<T> OrganizationServiceServer<T> {
8450        pub fn new(inner: T) -> Self {
8451            Self::from_arc(Arc::new(inner))
8452        }
8453        pub fn from_arc(inner: Arc<T>) -> Self {
8454            Self {
8455                inner,
8456                accept_compression_encodings: Default::default(),
8457                send_compression_encodings: Default::default(),
8458                max_decoding_message_size: None,
8459                max_encoding_message_size: None,
8460            }
8461        }
8462        pub fn with_interceptor<F>(
8463            inner: T,
8464            interceptor: F,
8465        ) -> InterceptedService<Self, F>
8466        where
8467            F: tonic::service::Interceptor,
8468        {
8469            InterceptedService::new(Self::new(inner), interceptor)
8470        }
8471        /// Enable decompressing requests with the given encoding.
8472        #[must_use]
8473        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8474            self.accept_compression_encodings.enable(encoding);
8475            self
8476        }
8477        /// Compress responses with the given encoding, if the client supports it.
8478        #[must_use]
8479        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8480            self.send_compression_encodings.enable(encoding);
8481            self
8482        }
8483        /// Limits the maximum size of a decoded message.
8484        ///
8485        /// Default: `4MB`
8486        #[must_use]
8487        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8488            self.max_decoding_message_size = Some(limit);
8489            self
8490        }
8491        /// Limits the maximum size of an encoded message.
8492        ///
8493        /// Default: `usize::MAX`
8494        #[must_use]
8495        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8496            self.max_encoding_message_size = Some(limit);
8497            self
8498        }
8499    }
8500    impl<T, B> tonic::codegen::Service<http::Request<B>> for OrganizationServiceServer<T>
8501    where
8502        T: OrganizationService,
8503        B: Body + std::marker::Send + 'static,
8504        B::Error: Into<StdError> + std::marker::Send + 'static,
8505    {
8506        type Response = http::Response<tonic::body::Body>;
8507        type Error = std::convert::Infallible;
8508        type Future = BoxFuture<Self::Response, Self::Error>;
8509        fn poll_ready(
8510            &mut self,
8511            _cx: &mut Context<'_>,
8512        ) -> Poll<std::result::Result<(), Self::Error>> {
8513            Poll::Ready(Ok(()))
8514        }
8515        fn call(&mut self, req: http::Request<B>) -> Self::Future {
8516            match req.uri().path() {
8517                "/pidgr.v1.OrganizationService/CreateOrganization" => {
8518                    #[allow(non_camel_case_types)]
8519                    struct CreateOrganizationSvc<T: OrganizationService>(pub Arc<T>);
8520                    impl<
8521                        T: OrganizationService,
8522                    > tonic::server::UnaryService<super::CreateOrganizationRequest>
8523                    for CreateOrganizationSvc<T> {
8524                        type Response = super::CreateOrganizationResponse;
8525                        type Future = BoxFuture<
8526                            tonic::Response<Self::Response>,
8527                            tonic::Status,
8528                        >;
8529                        fn call(
8530                            &mut self,
8531                            request: tonic::Request<super::CreateOrganizationRequest>,
8532                        ) -> Self::Future {
8533                            let inner = Arc::clone(&self.0);
8534                            let fut = async move {
8535                                <T as OrganizationService>::create_organization(
8536                                        &inner,
8537                                        request,
8538                                    )
8539                                    .await
8540                            };
8541                            Box::pin(fut)
8542                        }
8543                    }
8544                    let accept_compression_encodings = self.accept_compression_encodings;
8545                    let send_compression_encodings = self.send_compression_encodings;
8546                    let max_decoding_message_size = self.max_decoding_message_size;
8547                    let max_encoding_message_size = self.max_encoding_message_size;
8548                    let inner = self.inner.clone();
8549                    let fut = async move {
8550                        let method = CreateOrganizationSvc(inner);
8551                        let codec = tonic_prost::ProstCodec::default();
8552                        let mut grpc = tonic::server::Grpc::new(codec)
8553                            .apply_compression_config(
8554                                accept_compression_encodings,
8555                                send_compression_encodings,
8556                            )
8557                            .apply_max_message_size_config(
8558                                max_decoding_message_size,
8559                                max_encoding_message_size,
8560                            );
8561                        let res = grpc.unary(method, req).await;
8562                        Ok(res)
8563                    };
8564                    Box::pin(fut)
8565                }
8566                "/pidgr.v1.OrganizationService/GetOrganization" => {
8567                    #[allow(non_camel_case_types)]
8568                    struct GetOrganizationSvc<T: OrganizationService>(pub Arc<T>);
8569                    impl<
8570                        T: OrganizationService,
8571                    > tonic::server::UnaryService<super::GetOrganizationRequest>
8572                    for GetOrganizationSvc<T> {
8573                        type Response = super::GetOrganizationResponse;
8574                        type Future = BoxFuture<
8575                            tonic::Response<Self::Response>,
8576                            tonic::Status,
8577                        >;
8578                        fn call(
8579                            &mut self,
8580                            request: tonic::Request<super::GetOrganizationRequest>,
8581                        ) -> Self::Future {
8582                            let inner = Arc::clone(&self.0);
8583                            let fut = async move {
8584                                <T as OrganizationService>::get_organization(
8585                                        &inner,
8586                                        request,
8587                                    )
8588                                    .await
8589                            };
8590                            Box::pin(fut)
8591                        }
8592                    }
8593                    let accept_compression_encodings = self.accept_compression_encodings;
8594                    let send_compression_encodings = self.send_compression_encodings;
8595                    let max_decoding_message_size = self.max_decoding_message_size;
8596                    let max_encoding_message_size = self.max_encoding_message_size;
8597                    let inner = self.inner.clone();
8598                    let fut = async move {
8599                        let method = GetOrganizationSvc(inner);
8600                        let codec = tonic_prost::ProstCodec::default();
8601                        let mut grpc = tonic::server::Grpc::new(codec)
8602                            .apply_compression_config(
8603                                accept_compression_encodings,
8604                                send_compression_encodings,
8605                            )
8606                            .apply_max_message_size_config(
8607                                max_decoding_message_size,
8608                                max_encoding_message_size,
8609                            );
8610                        let res = grpc.unary(method, req).await;
8611                        Ok(res)
8612                    };
8613                    Box::pin(fut)
8614                }
8615                "/pidgr.v1.OrganizationService/UpdateOrganization" => {
8616                    #[allow(non_camel_case_types)]
8617                    struct UpdateOrganizationSvc<T: OrganizationService>(pub Arc<T>);
8618                    impl<
8619                        T: OrganizationService,
8620                    > tonic::server::UnaryService<super::UpdateOrganizationRequest>
8621                    for UpdateOrganizationSvc<T> {
8622                        type Response = super::UpdateOrganizationResponse;
8623                        type Future = BoxFuture<
8624                            tonic::Response<Self::Response>,
8625                            tonic::Status,
8626                        >;
8627                        fn call(
8628                            &mut self,
8629                            request: tonic::Request<super::UpdateOrganizationRequest>,
8630                        ) -> Self::Future {
8631                            let inner = Arc::clone(&self.0);
8632                            let fut = async move {
8633                                <T as OrganizationService>::update_organization(
8634                                        &inner,
8635                                        request,
8636                                    )
8637                                    .await
8638                            };
8639                            Box::pin(fut)
8640                        }
8641                    }
8642                    let accept_compression_encodings = self.accept_compression_encodings;
8643                    let send_compression_encodings = self.send_compression_encodings;
8644                    let max_decoding_message_size = self.max_decoding_message_size;
8645                    let max_encoding_message_size = self.max_encoding_message_size;
8646                    let inner = self.inner.clone();
8647                    let fut = async move {
8648                        let method = UpdateOrganizationSvc(inner);
8649                        let codec = tonic_prost::ProstCodec::default();
8650                        let mut grpc = tonic::server::Grpc::new(codec)
8651                            .apply_compression_config(
8652                                accept_compression_encodings,
8653                                send_compression_encodings,
8654                            )
8655                            .apply_max_message_size_config(
8656                                max_decoding_message_size,
8657                                max_encoding_message_size,
8658                            );
8659                        let res = grpc.unary(method, req).await;
8660                        Ok(res)
8661                    };
8662                    Box::pin(fut)
8663                }
8664                "/pidgr.v1.OrganizationService/UpdateSsoAttributeMappings" => {
8665                    #[allow(non_camel_case_types)]
8666                    struct UpdateSsoAttributeMappingsSvc<T: OrganizationService>(
8667                        pub Arc<T>,
8668                    );
8669                    impl<
8670                        T: OrganizationService,
8671                    > tonic::server::UnaryService<
8672                        super::UpdateSsoAttributeMappingsRequest,
8673                    > for UpdateSsoAttributeMappingsSvc<T> {
8674                        type Response = super::UpdateSsoAttributeMappingsResponse;
8675                        type Future = BoxFuture<
8676                            tonic::Response<Self::Response>,
8677                            tonic::Status,
8678                        >;
8679                        fn call(
8680                            &mut self,
8681                            request: tonic::Request<
8682                                super::UpdateSsoAttributeMappingsRequest,
8683                            >,
8684                        ) -> Self::Future {
8685                            let inner = Arc::clone(&self.0);
8686                            let fut = async move {
8687                                <T as OrganizationService>::update_sso_attribute_mappings(
8688                                        &inner,
8689                                        request,
8690                                    )
8691                                    .await
8692                            };
8693                            Box::pin(fut)
8694                        }
8695                    }
8696                    let accept_compression_encodings = self.accept_compression_encodings;
8697                    let send_compression_encodings = self.send_compression_encodings;
8698                    let max_decoding_message_size = self.max_decoding_message_size;
8699                    let max_encoding_message_size = self.max_encoding_message_size;
8700                    let inner = self.inner.clone();
8701                    let fut = async move {
8702                        let method = UpdateSsoAttributeMappingsSvc(inner);
8703                        let codec = tonic_prost::ProstCodec::default();
8704                        let mut grpc = tonic::server::Grpc::new(codec)
8705                            .apply_compression_config(
8706                                accept_compression_encodings,
8707                                send_compression_encodings,
8708                            )
8709                            .apply_max_message_size_config(
8710                                max_decoding_message_size,
8711                                max_encoding_message_size,
8712                            );
8713                        let res = grpc.unary(method, req).await;
8714                        Ok(res)
8715                    };
8716                    Box::pin(fut)
8717                }
8718                "/pidgr.v1.OrganizationService/RotateAnalyticsSalt" => {
8719                    #[allow(non_camel_case_types)]
8720                    struct RotateAnalyticsSaltSvc<T: OrganizationService>(pub Arc<T>);
8721                    impl<
8722                        T: OrganizationService,
8723                    > tonic::server::UnaryService<super::RotateAnalyticsSaltRequest>
8724                    for RotateAnalyticsSaltSvc<T> {
8725                        type Response = super::RotateAnalyticsSaltResponse;
8726                        type Future = BoxFuture<
8727                            tonic::Response<Self::Response>,
8728                            tonic::Status,
8729                        >;
8730                        fn call(
8731                            &mut self,
8732                            request: tonic::Request<super::RotateAnalyticsSaltRequest>,
8733                        ) -> Self::Future {
8734                            let inner = Arc::clone(&self.0);
8735                            let fut = async move {
8736                                <T as OrganizationService>::rotate_analytics_salt(
8737                                        &inner,
8738                                        request,
8739                                    )
8740                                    .await
8741                            };
8742                            Box::pin(fut)
8743                        }
8744                    }
8745                    let accept_compression_encodings = self.accept_compression_encodings;
8746                    let send_compression_encodings = self.send_compression_encodings;
8747                    let max_decoding_message_size = self.max_decoding_message_size;
8748                    let max_encoding_message_size = self.max_encoding_message_size;
8749                    let inner = self.inner.clone();
8750                    let fut = async move {
8751                        let method = RotateAnalyticsSaltSvc(inner);
8752                        let codec = tonic_prost::ProstCodec::default();
8753                        let mut grpc = tonic::server::Grpc::new(codec)
8754                            .apply_compression_config(
8755                                accept_compression_encodings,
8756                                send_compression_encodings,
8757                            )
8758                            .apply_max_message_size_config(
8759                                max_decoding_message_size,
8760                                max_encoding_message_size,
8761                            );
8762                        let res = grpc.unary(method, req).await;
8763                        Ok(res)
8764                    };
8765                    Box::pin(fut)
8766                }
8767                "/pidgr.v1.OrganizationService/UpdateAnalyticsEpsilon" => {
8768                    #[allow(non_camel_case_types)]
8769                    struct UpdateAnalyticsEpsilonSvc<T: OrganizationService>(pub Arc<T>);
8770                    impl<
8771                        T: OrganizationService,
8772                    > tonic::server::UnaryService<super::UpdateAnalyticsEpsilonRequest>
8773                    for UpdateAnalyticsEpsilonSvc<T> {
8774                        type Response = super::UpdateAnalyticsEpsilonResponse;
8775                        type Future = BoxFuture<
8776                            tonic::Response<Self::Response>,
8777                            tonic::Status,
8778                        >;
8779                        fn call(
8780                            &mut self,
8781                            request: tonic::Request<super::UpdateAnalyticsEpsilonRequest>,
8782                        ) -> Self::Future {
8783                            let inner = Arc::clone(&self.0);
8784                            let fut = async move {
8785                                <T as OrganizationService>::update_analytics_epsilon(
8786                                        &inner,
8787                                        request,
8788                                    )
8789                                    .await
8790                            };
8791                            Box::pin(fut)
8792                        }
8793                    }
8794                    let accept_compression_encodings = self.accept_compression_encodings;
8795                    let send_compression_encodings = self.send_compression_encodings;
8796                    let max_decoding_message_size = self.max_decoding_message_size;
8797                    let max_encoding_message_size = self.max_encoding_message_size;
8798                    let inner = self.inner.clone();
8799                    let fut = async move {
8800                        let method = UpdateAnalyticsEpsilonSvc(inner);
8801                        let codec = tonic_prost::ProstCodec::default();
8802                        let mut grpc = tonic::server::Grpc::new(codec)
8803                            .apply_compression_config(
8804                                accept_compression_encodings,
8805                                send_compression_encodings,
8806                            )
8807                            .apply_max_message_size_config(
8808                                max_decoding_message_size,
8809                                max_encoding_message_size,
8810                            );
8811                        let res = grpc.unary(method, req).await;
8812                        Ok(res)
8813                    };
8814                    Box::pin(fut)
8815                }
8816                _ => {
8817                    Box::pin(async move {
8818                        let mut response = http::Response::new(
8819                            tonic::body::Body::default(),
8820                        );
8821                        let headers = response.headers_mut();
8822                        headers
8823                            .insert(
8824                                tonic::Status::GRPC_STATUS,
8825                                (tonic::Code::Unimplemented as i32).into(),
8826                            );
8827                        headers
8828                            .insert(
8829                                http::header::CONTENT_TYPE,
8830                                tonic::metadata::GRPC_CONTENT_TYPE,
8831                            );
8832                        Ok(response)
8833                    })
8834                }
8835            }
8836        }
8837    }
8838    impl<T> Clone for OrganizationServiceServer<T> {
8839        fn clone(&self) -> Self {
8840            let inner = self.inner.clone();
8841            Self {
8842                inner,
8843                accept_compression_encodings: self.accept_compression_encodings,
8844                send_compression_encodings: self.send_compression_encodings,
8845                max_decoding_message_size: self.max_decoding_message_size,
8846                max_encoding_message_size: self.max_encoding_message_size,
8847            }
8848        }
8849    }
8850    /// Generated gRPC service name
8851    pub const SERVICE_NAME: &str = "pidgr.v1.OrganizationService";
8852    impl<T> tonic::server::NamedService for OrganizationServiceServer<T> {
8853        const NAME: &'static str = SERVICE_NAME;
8854    }
8855}
8856/// Generated client implementations.
8857pub mod render_service_client {
8858    #![allow(
8859        unused_variables,
8860        dead_code,
8861        missing_docs,
8862        clippy::wildcard_imports,
8863        clippy::let_unit_value,
8864    )]
8865    use tonic::codegen::*;
8866    use tonic::codegen::http::Uri;
8867    /** Internal service for batch template rendering.
8868*/
8869    #[derive(Debug, Clone)]
8870    pub struct RenderServiceClient<T> {
8871        inner: tonic::client::Grpc<T>,
8872    }
8873    impl RenderServiceClient<tonic::transport::Channel> {
8874        /// Attempt to create a new client by connecting to a given endpoint.
8875        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
8876        where
8877            D: TryInto<tonic::transport::Endpoint>,
8878            D::Error: Into<StdError>,
8879        {
8880            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
8881            Ok(Self::new(conn))
8882        }
8883    }
8884    impl<T> RenderServiceClient<T>
8885    where
8886        T: tonic::client::GrpcService<tonic::body::Body>,
8887        T::Error: Into<StdError>,
8888        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
8889        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
8890    {
8891        pub fn new(inner: T) -> Self {
8892            let inner = tonic::client::Grpc::new(inner);
8893            Self { inner }
8894        }
8895        pub fn with_origin(inner: T, origin: Uri) -> Self {
8896            let inner = tonic::client::Grpc::with_origin(inner, origin);
8897            Self { inner }
8898        }
8899        pub fn with_interceptor<F>(
8900            inner: T,
8901            interceptor: F,
8902        ) -> RenderServiceClient<InterceptedService<T, F>>
8903        where
8904            F: tonic::service::Interceptor,
8905            T::ResponseBody: Default,
8906            T: tonic::codegen::Service<
8907                http::Request<tonic::body::Body>,
8908                Response = http::Response<
8909                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
8910                >,
8911            >,
8912            <T as tonic::codegen::Service<
8913                http::Request<tonic::body::Body>,
8914            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
8915        {
8916            RenderServiceClient::new(InterceptedService::new(inner, interceptor))
8917        }
8918        /// Compress requests with the given encoding.
8919        ///
8920        /// This requires the server to support it otherwise it might respond with an
8921        /// error.
8922        #[must_use]
8923        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8924            self.inner = self.inner.send_compressed(encoding);
8925            self
8926        }
8927        /// Enable decompressing responses.
8928        #[must_use]
8929        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8930            self.inner = self.inner.accept_compressed(encoding);
8931            self
8932        }
8933        /// Limits the maximum size of a decoded message.
8934        ///
8935        /// Default: `4MB`
8936        #[must_use]
8937        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8938            self.inner = self.inner.max_decoding_message_size(limit);
8939            self
8940        }
8941        /// Limits the maximum size of an encoded message.
8942        ///
8943        /// Default: `usize::MAX`
8944        #[must_use]
8945        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8946            self.inner = self.inner.max_encoding_message_size(limit);
8947            self
8948        }
8949        /** Render a template for multiple users, streaming results as each completes.
8950 Authorization: Internal server-to-server only. Not exposed to external clients.
8951*/
8952        pub async fn render_batch(
8953            &mut self,
8954            request: impl tonic::IntoRequest<super::RenderBatchRequest>,
8955        ) -> std::result::Result<
8956            tonic::Response<tonic::codec::Streaming<super::RenderBatchResponse>>,
8957            tonic::Status,
8958        > {
8959            self.inner
8960                .ready()
8961                .await
8962                .map_err(|e| {
8963                    tonic::Status::unknown(
8964                        format!("Service was not ready: {}", e.into()),
8965                    )
8966                })?;
8967            let codec = tonic_prost::ProstCodec::default();
8968            let path = http::uri::PathAndQuery::from_static(
8969                "/pidgr.v1.RenderService/RenderBatch",
8970            );
8971            let mut req = request.into_request();
8972            req.extensions_mut()
8973                .insert(GrpcMethod::new("pidgr.v1.RenderService", "RenderBatch"));
8974            self.inner.server_streaming(req, path, codec).await
8975        }
8976    }
8977}
8978/// Generated server implementations.
8979pub mod render_service_server {
8980    #![allow(
8981        unused_variables,
8982        dead_code,
8983        missing_docs,
8984        clippy::wildcard_imports,
8985        clippy::let_unit_value,
8986    )]
8987    use tonic::codegen::*;
8988    /// Generated trait containing gRPC methods that should be implemented for use with RenderServiceServer.
8989    #[async_trait]
8990    pub trait RenderService: std::marker::Send + std::marker::Sync + 'static {
8991        /// Server streaming response type for the RenderBatch method.
8992        type RenderBatchStream: tonic::codegen::tokio_stream::Stream<
8993                Item = std::result::Result<super::RenderBatchResponse, tonic::Status>,
8994            >
8995            + std::marker::Send
8996            + 'static;
8997        /** Render a template for multiple users, streaming results as each completes.
8998 Authorization: Internal server-to-server only. Not exposed to external clients.
8999*/
9000        async fn render_batch(
9001            &self,
9002            request: tonic::Request<super::RenderBatchRequest>,
9003        ) -> std::result::Result<
9004            tonic::Response<Self::RenderBatchStream>,
9005            tonic::Status,
9006        >;
9007    }
9008    /** Internal service for batch template rendering.
9009*/
9010    #[derive(Debug)]
9011    pub struct RenderServiceServer<T> {
9012        inner: Arc<T>,
9013        accept_compression_encodings: EnabledCompressionEncodings,
9014        send_compression_encodings: EnabledCompressionEncodings,
9015        max_decoding_message_size: Option<usize>,
9016        max_encoding_message_size: Option<usize>,
9017    }
9018    impl<T> RenderServiceServer<T> {
9019        pub fn new(inner: T) -> Self {
9020            Self::from_arc(Arc::new(inner))
9021        }
9022        pub fn from_arc(inner: Arc<T>) -> Self {
9023            Self {
9024                inner,
9025                accept_compression_encodings: Default::default(),
9026                send_compression_encodings: Default::default(),
9027                max_decoding_message_size: None,
9028                max_encoding_message_size: None,
9029            }
9030        }
9031        pub fn with_interceptor<F>(
9032            inner: T,
9033            interceptor: F,
9034        ) -> InterceptedService<Self, F>
9035        where
9036            F: tonic::service::Interceptor,
9037        {
9038            InterceptedService::new(Self::new(inner), interceptor)
9039        }
9040        /// Enable decompressing requests with the given encoding.
9041        #[must_use]
9042        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9043            self.accept_compression_encodings.enable(encoding);
9044            self
9045        }
9046        /// Compress responses with the given encoding, if the client supports it.
9047        #[must_use]
9048        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9049            self.send_compression_encodings.enable(encoding);
9050            self
9051        }
9052        /// Limits the maximum size of a decoded message.
9053        ///
9054        /// Default: `4MB`
9055        #[must_use]
9056        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9057            self.max_decoding_message_size = Some(limit);
9058            self
9059        }
9060        /// Limits the maximum size of an encoded message.
9061        ///
9062        /// Default: `usize::MAX`
9063        #[must_use]
9064        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9065            self.max_encoding_message_size = Some(limit);
9066            self
9067        }
9068    }
9069    impl<T, B> tonic::codegen::Service<http::Request<B>> for RenderServiceServer<T>
9070    where
9071        T: RenderService,
9072        B: Body + std::marker::Send + 'static,
9073        B::Error: Into<StdError> + std::marker::Send + 'static,
9074    {
9075        type Response = http::Response<tonic::body::Body>;
9076        type Error = std::convert::Infallible;
9077        type Future = BoxFuture<Self::Response, Self::Error>;
9078        fn poll_ready(
9079            &mut self,
9080            _cx: &mut Context<'_>,
9081        ) -> Poll<std::result::Result<(), Self::Error>> {
9082            Poll::Ready(Ok(()))
9083        }
9084        fn call(&mut self, req: http::Request<B>) -> Self::Future {
9085            match req.uri().path() {
9086                "/pidgr.v1.RenderService/RenderBatch" => {
9087                    #[allow(non_camel_case_types)]
9088                    struct RenderBatchSvc<T: RenderService>(pub Arc<T>);
9089                    impl<
9090                        T: RenderService,
9091                    > tonic::server::ServerStreamingService<super::RenderBatchRequest>
9092                    for RenderBatchSvc<T> {
9093                        type Response = super::RenderBatchResponse;
9094                        type ResponseStream = T::RenderBatchStream;
9095                        type Future = BoxFuture<
9096                            tonic::Response<Self::ResponseStream>,
9097                            tonic::Status,
9098                        >;
9099                        fn call(
9100                            &mut self,
9101                            request: tonic::Request<super::RenderBatchRequest>,
9102                        ) -> Self::Future {
9103                            let inner = Arc::clone(&self.0);
9104                            let fut = async move {
9105                                <T as RenderService>::render_batch(&inner, request).await
9106                            };
9107                            Box::pin(fut)
9108                        }
9109                    }
9110                    let accept_compression_encodings = self.accept_compression_encodings;
9111                    let send_compression_encodings = self.send_compression_encodings;
9112                    let max_decoding_message_size = self.max_decoding_message_size;
9113                    let max_encoding_message_size = self.max_encoding_message_size;
9114                    let inner = self.inner.clone();
9115                    let fut = async move {
9116                        let method = RenderBatchSvc(inner);
9117                        let codec = tonic_prost::ProstCodec::default();
9118                        let mut grpc = tonic::server::Grpc::new(codec)
9119                            .apply_compression_config(
9120                                accept_compression_encodings,
9121                                send_compression_encodings,
9122                            )
9123                            .apply_max_message_size_config(
9124                                max_decoding_message_size,
9125                                max_encoding_message_size,
9126                            );
9127                        let res = grpc.server_streaming(method, req).await;
9128                        Ok(res)
9129                    };
9130                    Box::pin(fut)
9131                }
9132                _ => {
9133                    Box::pin(async move {
9134                        let mut response = http::Response::new(
9135                            tonic::body::Body::default(),
9136                        );
9137                        let headers = response.headers_mut();
9138                        headers
9139                            .insert(
9140                                tonic::Status::GRPC_STATUS,
9141                                (tonic::Code::Unimplemented as i32).into(),
9142                            );
9143                        headers
9144                            .insert(
9145                                http::header::CONTENT_TYPE,
9146                                tonic::metadata::GRPC_CONTENT_TYPE,
9147                            );
9148                        Ok(response)
9149                    })
9150                }
9151            }
9152        }
9153    }
9154    impl<T> Clone for RenderServiceServer<T> {
9155        fn clone(&self) -> Self {
9156            let inner = self.inner.clone();
9157            Self {
9158                inner,
9159                accept_compression_encodings: self.accept_compression_encodings,
9160                send_compression_encodings: self.send_compression_encodings,
9161                max_decoding_message_size: self.max_decoding_message_size,
9162                max_encoding_message_size: self.max_encoding_message_size,
9163            }
9164        }
9165    }
9166    /// Generated gRPC service name
9167    pub const SERVICE_NAME: &str = "pidgr.v1.RenderService";
9168    impl<T> tonic::server::NamedService for RenderServiceServer<T> {
9169        const NAME: &'static str = SERVICE_NAME;
9170    }
9171}
9172/// Generated client implementations.
9173pub mod replay_service_client {
9174    #![allow(
9175        unused_variables,
9176        dead_code,
9177        missing_docs,
9178        clippy::wildcard_imports,
9179        clippy::let_unit_value,
9180    )]
9181    use tonic::codegen::*;
9182    use tonic::codegen::http::Uri;
9183    /** Proxies the analytics provider's session recording API, keeping credentials server-side.
9184 All data is fetched from the analytics provider on demand; no recording data is stored in pidgr.
9185*/
9186    #[derive(Debug, Clone)]
9187    pub struct ReplayServiceClient<T> {
9188        inner: tonic::client::Grpc<T>,
9189    }
9190    impl ReplayServiceClient<tonic::transport::Channel> {
9191        /// Attempt to create a new client by connecting to a given endpoint.
9192        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
9193        where
9194            D: TryInto<tonic::transport::Endpoint>,
9195            D::Error: Into<StdError>,
9196        {
9197            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
9198            Ok(Self::new(conn))
9199        }
9200    }
9201    impl<T> ReplayServiceClient<T>
9202    where
9203        T: tonic::client::GrpcService<tonic::body::Body>,
9204        T::Error: Into<StdError>,
9205        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
9206        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
9207    {
9208        pub fn new(inner: T) -> Self {
9209            let inner = tonic::client::Grpc::new(inner);
9210            Self { inner }
9211        }
9212        pub fn with_origin(inner: T, origin: Uri) -> Self {
9213            let inner = tonic::client::Grpc::with_origin(inner, origin);
9214            Self { inner }
9215        }
9216        pub fn with_interceptor<F>(
9217            inner: T,
9218            interceptor: F,
9219        ) -> ReplayServiceClient<InterceptedService<T, F>>
9220        where
9221            F: tonic::service::Interceptor,
9222            T::ResponseBody: Default,
9223            T: tonic::codegen::Service<
9224                http::Request<tonic::body::Body>,
9225                Response = http::Response<
9226                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
9227                >,
9228            >,
9229            <T as tonic::codegen::Service<
9230                http::Request<tonic::body::Body>,
9231            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
9232        {
9233            ReplayServiceClient::new(InterceptedService::new(inner, interceptor))
9234        }
9235        /// Compress requests with the given encoding.
9236        ///
9237        /// This requires the server to support it otherwise it might respond with an
9238        /// error.
9239        #[must_use]
9240        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9241            self.inner = self.inner.send_compressed(encoding);
9242            self
9243        }
9244        /// Enable decompressing responses.
9245        #[must_use]
9246        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9247            self.inner = self.inner.accept_compressed(encoding);
9248            self
9249        }
9250        /// Limits the maximum size of a decoded message.
9251        ///
9252        /// Default: `4MB`
9253        #[must_use]
9254        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9255            self.inner = self.inner.max_decoding_message_size(limit);
9256            self
9257        }
9258        /// Limits the maximum size of an encoded message.
9259        ///
9260        /// Default: `usize::MAX`
9261        #[must_use]
9262        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9263            self.inner = self.inner.max_encoding_message_size(limit);
9264            self
9265        }
9266        /** List recent session recordings with optional campaign and time range filters.
9267 Authorization: Requires CAMPAIGNS_READ permission.
9268*/
9269        pub async fn list_session_recordings(
9270            &mut self,
9271            request: impl tonic::IntoRequest<super::ListSessionRecordingsRequest>,
9272        ) -> std::result::Result<
9273            tonic::Response<super::ListSessionRecordingsResponse>,
9274            tonic::Status,
9275        > {
9276            self.inner
9277                .ready()
9278                .await
9279                .map_err(|e| {
9280                    tonic::Status::unknown(
9281                        format!("Service was not ready: {}", e.into()),
9282                    )
9283                })?;
9284            let codec = tonic_prost::ProstCodec::default();
9285            let path = http::uri::PathAndQuery::from_static(
9286                "/pidgr.v1.ReplayService/ListSessionRecordings",
9287            );
9288            let mut req = request.into_request();
9289            req.extensions_mut()
9290                .insert(
9291                    GrpcMethod::new("pidgr.v1.ReplayService", "ListSessionRecordings"),
9292                );
9293            self.inner.unary(req, path, codec).await
9294        }
9295        /** Fetch the full rrweb snapshot data for a single recording.
9296 Authorization: Requires CAMPAIGNS_READ permission.
9297*/
9298        pub async fn get_session_snapshots(
9299            &mut self,
9300            request: impl tonic::IntoRequest<super::GetSessionSnapshotsRequest>,
9301        ) -> std::result::Result<
9302            tonic::Response<super::GetSessionSnapshotsResponse>,
9303            tonic::Status,
9304        > {
9305            self.inner
9306                .ready()
9307                .await
9308                .map_err(|e| {
9309                    tonic::Status::unknown(
9310                        format!("Service was not ready: {}", e.into()),
9311                    )
9312                })?;
9313            let codec = tonic_prost::ProstCodec::default();
9314            let path = http::uri::PathAndQuery::from_static(
9315                "/pidgr.v1.ReplayService/GetSessionSnapshots",
9316            );
9317            let mut req = request.into_request();
9318            req.extensions_mut()
9319                .insert(
9320                    GrpcMethod::new("pidgr.v1.ReplayService", "GetSessionSnapshots"),
9321                );
9322            self.inner.unary(req, path, codec).await
9323        }
9324    }
9325}
9326/// Generated server implementations.
9327pub mod replay_service_server {
9328    #![allow(
9329        unused_variables,
9330        dead_code,
9331        missing_docs,
9332        clippy::wildcard_imports,
9333        clippy::let_unit_value,
9334    )]
9335    use tonic::codegen::*;
9336    /// Generated trait containing gRPC methods that should be implemented for use with ReplayServiceServer.
9337    #[async_trait]
9338    pub trait ReplayService: std::marker::Send + std::marker::Sync + 'static {
9339        /** List recent session recordings with optional campaign and time range filters.
9340 Authorization: Requires CAMPAIGNS_READ permission.
9341*/
9342        async fn list_session_recordings(
9343            &self,
9344            request: tonic::Request<super::ListSessionRecordingsRequest>,
9345        ) -> std::result::Result<
9346            tonic::Response<super::ListSessionRecordingsResponse>,
9347            tonic::Status,
9348        >;
9349        /** Fetch the full rrweb snapshot data for a single recording.
9350 Authorization: Requires CAMPAIGNS_READ permission.
9351*/
9352        async fn get_session_snapshots(
9353            &self,
9354            request: tonic::Request<super::GetSessionSnapshotsRequest>,
9355        ) -> std::result::Result<
9356            tonic::Response<super::GetSessionSnapshotsResponse>,
9357            tonic::Status,
9358        >;
9359    }
9360    /** Proxies the analytics provider's session recording API, keeping credentials server-side.
9361 All data is fetched from the analytics provider on demand; no recording data is stored in pidgr.
9362*/
9363    #[derive(Debug)]
9364    pub struct ReplayServiceServer<T> {
9365        inner: Arc<T>,
9366        accept_compression_encodings: EnabledCompressionEncodings,
9367        send_compression_encodings: EnabledCompressionEncodings,
9368        max_decoding_message_size: Option<usize>,
9369        max_encoding_message_size: Option<usize>,
9370    }
9371    impl<T> ReplayServiceServer<T> {
9372        pub fn new(inner: T) -> Self {
9373            Self::from_arc(Arc::new(inner))
9374        }
9375        pub fn from_arc(inner: Arc<T>) -> Self {
9376            Self {
9377                inner,
9378                accept_compression_encodings: Default::default(),
9379                send_compression_encodings: Default::default(),
9380                max_decoding_message_size: None,
9381                max_encoding_message_size: None,
9382            }
9383        }
9384        pub fn with_interceptor<F>(
9385            inner: T,
9386            interceptor: F,
9387        ) -> InterceptedService<Self, F>
9388        where
9389            F: tonic::service::Interceptor,
9390        {
9391            InterceptedService::new(Self::new(inner), interceptor)
9392        }
9393        /// Enable decompressing requests with the given encoding.
9394        #[must_use]
9395        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9396            self.accept_compression_encodings.enable(encoding);
9397            self
9398        }
9399        /// Compress responses with the given encoding, if the client supports it.
9400        #[must_use]
9401        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9402            self.send_compression_encodings.enable(encoding);
9403            self
9404        }
9405        /// Limits the maximum size of a decoded message.
9406        ///
9407        /// Default: `4MB`
9408        #[must_use]
9409        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9410            self.max_decoding_message_size = Some(limit);
9411            self
9412        }
9413        /// Limits the maximum size of an encoded message.
9414        ///
9415        /// Default: `usize::MAX`
9416        #[must_use]
9417        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9418            self.max_encoding_message_size = Some(limit);
9419            self
9420        }
9421    }
9422    impl<T, B> tonic::codegen::Service<http::Request<B>> for ReplayServiceServer<T>
9423    where
9424        T: ReplayService,
9425        B: Body + std::marker::Send + 'static,
9426        B::Error: Into<StdError> + std::marker::Send + 'static,
9427    {
9428        type Response = http::Response<tonic::body::Body>;
9429        type Error = std::convert::Infallible;
9430        type Future = BoxFuture<Self::Response, Self::Error>;
9431        fn poll_ready(
9432            &mut self,
9433            _cx: &mut Context<'_>,
9434        ) -> Poll<std::result::Result<(), Self::Error>> {
9435            Poll::Ready(Ok(()))
9436        }
9437        fn call(&mut self, req: http::Request<B>) -> Self::Future {
9438            match req.uri().path() {
9439                "/pidgr.v1.ReplayService/ListSessionRecordings" => {
9440                    #[allow(non_camel_case_types)]
9441                    struct ListSessionRecordingsSvc<T: ReplayService>(pub Arc<T>);
9442                    impl<
9443                        T: ReplayService,
9444                    > tonic::server::UnaryService<super::ListSessionRecordingsRequest>
9445                    for ListSessionRecordingsSvc<T> {
9446                        type Response = super::ListSessionRecordingsResponse;
9447                        type Future = BoxFuture<
9448                            tonic::Response<Self::Response>,
9449                            tonic::Status,
9450                        >;
9451                        fn call(
9452                            &mut self,
9453                            request: tonic::Request<super::ListSessionRecordingsRequest>,
9454                        ) -> Self::Future {
9455                            let inner = Arc::clone(&self.0);
9456                            let fut = async move {
9457                                <T as ReplayService>::list_session_recordings(
9458                                        &inner,
9459                                        request,
9460                                    )
9461                                    .await
9462                            };
9463                            Box::pin(fut)
9464                        }
9465                    }
9466                    let accept_compression_encodings = self.accept_compression_encodings;
9467                    let send_compression_encodings = self.send_compression_encodings;
9468                    let max_decoding_message_size = self.max_decoding_message_size;
9469                    let max_encoding_message_size = self.max_encoding_message_size;
9470                    let inner = self.inner.clone();
9471                    let fut = async move {
9472                        let method = ListSessionRecordingsSvc(inner);
9473                        let codec = tonic_prost::ProstCodec::default();
9474                        let mut grpc = tonic::server::Grpc::new(codec)
9475                            .apply_compression_config(
9476                                accept_compression_encodings,
9477                                send_compression_encodings,
9478                            )
9479                            .apply_max_message_size_config(
9480                                max_decoding_message_size,
9481                                max_encoding_message_size,
9482                            );
9483                        let res = grpc.unary(method, req).await;
9484                        Ok(res)
9485                    };
9486                    Box::pin(fut)
9487                }
9488                "/pidgr.v1.ReplayService/GetSessionSnapshots" => {
9489                    #[allow(non_camel_case_types)]
9490                    struct GetSessionSnapshotsSvc<T: ReplayService>(pub Arc<T>);
9491                    impl<
9492                        T: ReplayService,
9493                    > tonic::server::UnaryService<super::GetSessionSnapshotsRequest>
9494                    for GetSessionSnapshotsSvc<T> {
9495                        type Response = super::GetSessionSnapshotsResponse;
9496                        type Future = BoxFuture<
9497                            tonic::Response<Self::Response>,
9498                            tonic::Status,
9499                        >;
9500                        fn call(
9501                            &mut self,
9502                            request: tonic::Request<super::GetSessionSnapshotsRequest>,
9503                        ) -> Self::Future {
9504                            let inner = Arc::clone(&self.0);
9505                            let fut = async move {
9506                                <T as ReplayService>::get_session_snapshots(&inner, request)
9507                                    .await
9508                            };
9509                            Box::pin(fut)
9510                        }
9511                    }
9512                    let accept_compression_encodings = self.accept_compression_encodings;
9513                    let send_compression_encodings = self.send_compression_encodings;
9514                    let max_decoding_message_size = self.max_decoding_message_size;
9515                    let max_encoding_message_size = self.max_encoding_message_size;
9516                    let inner = self.inner.clone();
9517                    let fut = async move {
9518                        let method = GetSessionSnapshotsSvc(inner);
9519                        let codec = tonic_prost::ProstCodec::default();
9520                        let mut grpc = tonic::server::Grpc::new(codec)
9521                            .apply_compression_config(
9522                                accept_compression_encodings,
9523                                send_compression_encodings,
9524                            )
9525                            .apply_max_message_size_config(
9526                                max_decoding_message_size,
9527                                max_encoding_message_size,
9528                            );
9529                        let res = grpc.unary(method, req).await;
9530                        Ok(res)
9531                    };
9532                    Box::pin(fut)
9533                }
9534                _ => {
9535                    Box::pin(async move {
9536                        let mut response = http::Response::new(
9537                            tonic::body::Body::default(),
9538                        );
9539                        let headers = response.headers_mut();
9540                        headers
9541                            .insert(
9542                                tonic::Status::GRPC_STATUS,
9543                                (tonic::Code::Unimplemented as i32).into(),
9544                            );
9545                        headers
9546                            .insert(
9547                                http::header::CONTENT_TYPE,
9548                                tonic::metadata::GRPC_CONTENT_TYPE,
9549                            );
9550                        Ok(response)
9551                    })
9552                }
9553            }
9554        }
9555    }
9556    impl<T> Clone for ReplayServiceServer<T> {
9557        fn clone(&self) -> Self {
9558            let inner = self.inner.clone();
9559            Self {
9560                inner,
9561                accept_compression_encodings: self.accept_compression_encodings,
9562                send_compression_encodings: self.send_compression_encodings,
9563                max_decoding_message_size: self.max_decoding_message_size,
9564                max_encoding_message_size: self.max_encoding_message_size,
9565            }
9566        }
9567    }
9568    /// Generated gRPC service name
9569    pub const SERVICE_NAME: &str = "pidgr.v1.ReplayService";
9570    impl<T> tonic::server::NamedService for ReplayServiceServer<T> {
9571        const NAME: &'static str = SERVICE_NAME;
9572    }
9573}
9574/// Generated client implementations.
9575pub mod role_service_client {
9576    #![allow(
9577        unused_variables,
9578        dead_code,
9579        missing_docs,
9580        clippy::wildcard_imports,
9581        clippy::let_unit_value,
9582    )]
9583    use tonic::codegen::*;
9584    use tonic::codegen::http::Uri;
9585    /** Manages roles and their permissions within an organization.
9586 All RPCs operate within the caller's org (extracted from JWT).
9587*/
9588    #[derive(Debug, Clone)]
9589    pub struct RoleServiceClient<T> {
9590        inner: tonic::client::Grpc<T>,
9591    }
9592    impl RoleServiceClient<tonic::transport::Channel> {
9593        /// Attempt to create a new client by connecting to a given endpoint.
9594        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
9595        where
9596            D: TryInto<tonic::transport::Endpoint>,
9597            D::Error: Into<StdError>,
9598        {
9599            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
9600            Ok(Self::new(conn))
9601        }
9602    }
9603    impl<T> RoleServiceClient<T>
9604    where
9605        T: tonic::client::GrpcService<tonic::body::Body>,
9606        T::Error: Into<StdError>,
9607        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
9608        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
9609    {
9610        pub fn new(inner: T) -> Self {
9611            let inner = tonic::client::Grpc::new(inner);
9612            Self { inner }
9613        }
9614        pub fn with_origin(inner: T, origin: Uri) -> Self {
9615            let inner = tonic::client::Grpc::with_origin(inner, origin);
9616            Self { inner }
9617        }
9618        pub fn with_interceptor<F>(
9619            inner: T,
9620            interceptor: F,
9621        ) -> RoleServiceClient<InterceptedService<T, F>>
9622        where
9623            F: tonic::service::Interceptor,
9624            T::ResponseBody: Default,
9625            T: tonic::codegen::Service<
9626                http::Request<tonic::body::Body>,
9627                Response = http::Response<
9628                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
9629                >,
9630            >,
9631            <T as tonic::codegen::Service<
9632                http::Request<tonic::body::Body>,
9633            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
9634        {
9635            RoleServiceClient::new(InterceptedService::new(inner, interceptor))
9636        }
9637        /// Compress requests with the given encoding.
9638        ///
9639        /// This requires the server to support it otherwise it might respond with an
9640        /// error.
9641        #[must_use]
9642        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9643            self.inner = self.inner.send_compressed(encoding);
9644            self
9645        }
9646        /// Enable decompressing responses.
9647        #[must_use]
9648        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9649            self.inner = self.inner.accept_compressed(encoding);
9650            self
9651        }
9652        /// Limits the maximum size of a decoded message.
9653        ///
9654        /// Default: `4MB`
9655        #[must_use]
9656        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9657            self.inner = self.inner.max_decoding_message_size(limit);
9658            self
9659        }
9660        /// Limits the maximum size of an encoded message.
9661        ///
9662        /// Default: `usize::MAX`
9663        #[must_use]
9664        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9665            self.inner = self.inner.max_encoding_message_size(limit);
9666            self
9667        }
9668        /** List all roles in the organization with their permission sets.
9669 Authorization: Requires PERMISSION_ORG_READ.
9670*/
9671        pub async fn list_roles(
9672            &mut self,
9673            request: impl tonic::IntoRequest<super::ListRolesRequest>,
9674        ) -> std::result::Result<
9675            tonic::Response<super::ListRolesResponse>,
9676            tonic::Status,
9677        > {
9678            self.inner
9679                .ready()
9680                .await
9681                .map_err(|e| {
9682                    tonic::Status::unknown(
9683                        format!("Service was not ready: {}", e.into()),
9684                    )
9685                })?;
9686            let codec = tonic_prost::ProstCodec::default();
9687            let path = http::uri::PathAndQuery::from_static(
9688                "/pidgr.v1.RoleService/ListRoles",
9689            );
9690            let mut req = request.into_request();
9691            req.extensions_mut()
9692                .insert(GrpcMethod::new("pidgr.v1.RoleService", "ListRoles"));
9693            self.inner.unary(req, path, codec).await
9694        }
9695        /** Create a new custom role with a name and initial permissions.
9696 Slug is auto-generated from the name and immutable after creation.
9697 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
9698*/
9699        pub async fn create_role(
9700            &mut self,
9701            request: impl tonic::IntoRequest<super::CreateRoleRequest>,
9702        ) -> std::result::Result<
9703            tonic::Response<super::CreateRoleResponse>,
9704            tonic::Status,
9705        > {
9706            self.inner
9707                .ready()
9708                .await
9709                .map_err(|e| {
9710                    tonic::Status::unknown(
9711                        format!("Service was not ready: {}", e.into()),
9712                    )
9713                })?;
9714            let codec = tonic_prost::ProstCodec::default();
9715            let path = http::uri::PathAndQuery::from_static(
9716                "/pidgr.v1.RoleService/CreateRole",
9717            );
9718            let mut req = request.into_request();
9719            req.extensions_mut()
9720                .insert(GrpcMethod::new("pidgr.v1.RoleService", "CreateRole"));
9721            self.inner.unary(req, path, codec).await
9722        }
9723        /** Update a role's name and/or permissions.
9724 System roles (is_system=true) cannot be updated.
9725 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
9726*/
9727        pub async fn update_role(
9728            &mut self,
9729            request: impl tonic::IntoRequest<super::UpdateRoleRequest>,
9730        ) -> std::result::Result<
9731            tonic::Response<super::UpdateRoleResponse>,
9732            tonic::Status,
9733        > {
9734            self.inner
9735                .ready()
9736                .await
9737                .map_err(|e| {
9738                    tonic::Status::unknown(
9739                        format!("Service was not ready: {}", e.into()),
9740                    )
9741                })?;
9742            let codec = tonic_prost::ProstCodec::default();
9743            let path = http::uri::PathAndQuery::from_static(
9744                "/pidgr.v1.RoleService/UpdateRole",
9745            );
9746            let mut req = request.into_request();
9747            req.extensions_mut()
9748                .insert(GrpcMethod::new("pidgr.v1.RoleService", "UpdateRole"));
9749            self.inner.unary(req, path, codec).await
9750        }
9751        /** Delete a role. Fails if any users are assigned to it.
9752 System roles (is_system=true) cannot be deleted.
9753 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
9754*/
9755        pub async fn delete_role(
9756            &mut self,
9757            request: impl tonic::IntoRequest<super::DeleteRoleRequest>,
9758        ) -> std::result::Result<
9759            tonic::Response<super::DeleteRoleResponse>,
9760            tonic::Status,
9761        > {
9762            self.inner
9763                .ready()
9764                .await
9765                .map_err(|e| {
9766                    tonic::Status::unknown(
9767                        format!("Service was not ready: {}", e.into()),
9768                    )
9769                })?;
9770            let codec = tonic_prost::ProstCodec::default();
9771            let path = http::uri::PathAndQuery::from_static(
9772                "/pidgr.v1.RoleService/DeleteRole",
9773            );
9774            let mut req = request.into_request();
9775            req.extensions_mut()
9776                .insert(GrpcMethod::new("pidgr.v1.RoleService", "DeleteRole"));
9777            self.inner.unary(req, path, codec).await
9778        }
9779    }
9780}
9781/// Generated server implementations.
9782pub mod role_service_server {
9783    #![allow(
9784        unused_variables,
9785        dead_code,
9786        missing_docs,
9787        clippy::wildcard_imports,
9788        clippy::let_unit_value,
9789    )]
9790    use tonic::codegen::*;
9791    /// Generated trait containing gRPC methods that should be implemented for use with RoleServiceServer.
9792    #[async_trait]
9793    pub trait RoleService: std::marker::Send + std::marker::Sync + 'static {
9794        /** List all roles in the organization with their permission sets.
9795 Authorization: Requires PERMISSION_ORG_READ.
9796*/
9797        async fn list_roles(
9798            &self,
9799            request: tonic::Request<super::ListRolesRequest>,
9800        ) -> std::result::Result<
9801            tonic::Response<super::ListRolesResponse>,
9802            tonic::Status,
9803        >;
9804        /** Create a new custom role with a name and initial permissions.
9805 Slug is auto-generated from the name and immutable after creation.
9806 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
9807*/
9808        async fn create_role(
9809            &self,
9810            request: tonic::Request<super::CreateRoleRequest>,
9811        ) -> std::result::Result<
9812            tonic::Response<super::CreateRoleResponse>,
9813            tonic::Status,
9814        >;
9815        /** Update a role's name and/or permissions.
9816 System roles (is_system=true) cannot be updated.
9817 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
9818*/
9819        async fn update_role(
9820            &self,
9821            request: tonic::Request<super::UpdateRoleRequest>,
9822        ) -> std::result::Result<
9823            tonic::Response<super::UpdateRoleResponse>,
9824            tonic::Status,
9825        >;
9826        /** Delete a role. Fails if any users are assigned to it.
9827 System roles (is_system=true) cannot be deleted.
9828 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
9829*/
9830        async fn delete_role(
9831            &self,
9832            request: tonic::Request<super::DeleteRoleRequest>,
9833        ) -> std::result::Result<
9834            tonic::Response<super::DeleteRoleResponse>,
9835            tonic::Status,
9836        >;
9837    }
9838    /** Manages roles and their permissions within an organization.
9839 All RPCs operate within the caller's org (extracted from JWT).
9840*/
9841    #[derive(Debug)]
9842    pub struct RoleServiceServer<T> {
9843        inner: Arc<T>,
9844        accept_compression_encodings: EnabledCompressionEncodings,
9845        send_compression_encodings: EnabledCompressionEncodings,
9846        max_decoding_message_size: Option<usize>,
9847        max_encoding_message_size: Option<usize>,
9848    }
9849    impl<T> RoleServiceServer<T> {
9850        pub fn new(inner: T) -> Self {
9851            Self::from_arc(Arc::new(inner))
9852        }
9853        pub fn from_arc(inner: Arc<T>) -> Self {
9854            Self {
9855                inner,
9856                accept_compression_encodings: Default::default(),
9857                send_compression_encodings: Default::default(),
9858                max_decoding_message_size: None,
9859                max_encoding_message_size: None,
9860            }
9861        }
9862        pub fn with_interceptor<F>(
9863            inner: T,
9864            interceptor: F,
9865        ) -> InterceptedService<Self, F>
9866        where
9867            F: tonic::service::Interceptor,
9868        {
9869            InterceptedService::new(Self::new(inner), interceptor)
9870        }
9871        /// Enable decompressing requests with the given encoding.
9872        #[must_use]
9873        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9874            self.accept_compression_encodings.enable(encoding);
9875            self
9876        }
9877        /// Compress responses with the given encoding, if the client supports it.
9878        #[must_use]
9879        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9880            self.send_compression_encodings.enable(encoding);
9881            self
9882        }
9883        /// Limits the maximum size of a decoded message.
9884        ///
9885        /// Default: `4MB`
9886        #[must_use]
9887        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9888            self.max_decoding_message_size = Some(limit);
9889            self
9890        }
9891        /// Limits the maximum size of an encoded message.
9892        ///
9893        /// Default: `usize::MAX`
9894        #[must_use]
9895        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9896            self.max_encoding_message_size = Some(limit);
9897            self
9898        }
9899    }
9900    impl<T, B> tonic::codegen::Service<http::Request<B>> for RoleServiceServer<T>
9901    where
9902        T: RoleService,
9903        B: Body + std::marker::Send + 'static,
9904        B::Error: Into<StdError> + std::marker::Send + 'static,
9905    {
9906        type Response = http::Response<tonic::body::Body>;
9907        type Error = std::convert::Infallible;
9908        type Future = BoxFuture<Self::Response, Self::Error>;
9909        fn poll_ready(
9910            &mut self,
9911            _cx: &mut Context<'_>,
9912        ) -> Poll<std::result::Result<(), Self::Error>> {
9913            Poll::Ready(Ok(()))
9914        }
9915        fn call(&mut self, req: http::Request<B>) -> Self::Future {
9916            match req.uri().path() {
9917                "/pidgr.v1.RoleService/ListRoles" => {
9918                    #[allow(non_camel_case_types)]
9919                    struct ListRolesSvc<T: RoleService>(pub Arc<T>);
9920                    impl<
9921                        T: RoleService,
9922                    > tonic::server::UnaryService<super::ListRolesRequest>
9923                    for ListRolesSvc<T> {
9924                        type Response = super::ListRolesResponse;
9925                        type Future = BoxFuture<
9926                            tonic::Response<Self::Response>,
9927                            tonic::Status,
9928                        >;
9929                        fn call(
9930                            &mut self,
9931                            request: tonic::Request<super::ListRolesRequest>,
9932                        ) -> Self::Future {
9933                            let inner = Arc::clone(&self.0);
9934                            let fut = async move {
9935                                <T as RoleService>::list_roles(&inner, request).await
9936                            };
9937                            Box::pin(fut)
9938                        }
9939                    }
9940                    let accept_compression_encodings = self.accept_compression_encodings;
9941                    let send_compression_encodings = self.send_compression_encodings;
9942                    let max_decoding_message_size = self.max_decoding_message_size;
9943                    let max_encoding_message_size = self.max_encoding_message_size;
9944                    let inner = self.inner.clone();
9945                    let fut = async move {
9946                        let method = ListRolesSvc(inner);
9947                        let codec = tonic_prost::ProstCodec::default();
9948                        let mut grpc = tonic::server::Grpc::new(codec)
9949                            .apply_compression_config(
9950                                accept_compression_encodings,
9951                                send_compression_encodings,
9952                            )
9953                            .apply_max_message_size_config(
9954                                max_decoding_message_size,
9955                                max_encoding_message_size,
9956                            );
9957                        let res = grpc.unary(method, req).await;
9958                        Ok(res)
9959                    };
9960                    Box::pin(fut)
9961                }
9962                "/pidgr.v1.RoleService/CreateRole" => {
9963                    #[allow(non_camel_case_types)]
9964                    struct CreateRoleSvc<T: RoleService>(pub Arc<T>);
9965                    impl<
9966                        T: RoleService,
9967                    > tonic::server::UnaryService<super::CreateRoleRequest>
9968                    for CreateRoleSvc<T> {
9969                        type Response = super::CreateRoleResponse;
9970                        type Future = BoxFuture<
9971                            tonic::Response<Self::Response>,
9972                            tonic::Status,
9973                        >;
9974                        fn call(
9975                            &mut self,
9976                            request: tonic::Request<super::CreateRoleRequest>,
9977                        ) -> Self::Future {
9978                            let inner = Arc::clone(&self.0);
9979                            let fut = async move {
9980                                <T as RoleService>::create_role(&inner, request).await
9981                            };
9982                            Box::pin(fut)
9983                        }
9984                    }
9985                    let accept_compression_encodings = self.accept_compression_encodings;
9986                    let send_compression_encodings = self.send_compression_encodings;
9987                    let max_decoding_message_size = self.max_decoding_message_size;
9988                    let max_encoding_message_size = self.max_encoding_message_size;
9989                    let inner = self.inner.clone();
9990                    let fut = async move {
9991                        let method = CreateRoleSvc(inner);
9992                        let codec = tonic_prost::ProstCodec::default();
9993                        let mut grpc = tonic::server::Grpc::new(codec)
9994                            .apply_compression_config(
9995                                accept_compression_encodings,
9996                                send_compression_encodings,
9997                            )
9998                            .apply_max_message_size_config(
9999                                max_decoding_message_size,
10000                                max_encoding_message_size,
10001                            );
10002                        let res = grpc.unary(method, req).await;
10003                        Ok(res)
10004                    };
10005                    Box::pin(fut)
10006                }
10007                "/pidgr.v1.RoleService/UpdateRole" => {
10008                    #[allow(non_camel_case_types)]
10009                    struct UpdateRoleSvc<T: RoleService>(pub Arc<T>);
10010                    impl<
10011                        T: RoleService,
10012                    > tonic::server::UnaryService<super::UpdateRoleRequest>
10013                    for UpdateRoleSvc<T> {
10014                        type Response = super::UpdateRoleResponse;
10015                        type Future = BoxFuture<
10016                            tonic::Response<Self::Response>,
10017                            tonic::Status,
10018                        >;
10019                        fn call(
10020                            &mut self,
10021                            request: tonic::Request<super::UpdateRoleRequest>,
10022                        ) -> Self::Future {
10023                            let inner = Arc::clone(&self.0);
10024                            let fut = async move {
10025                                <T as RoleService>::update_role(&inner, request).await
10026                            };
10027                            Box::pin(fut)
10028                        }
10029                    }
10030                    let accept_compression_encodings = self.accept_compression_encodings;
10031                    let send_compression_encodings = self.send_compression_encodings;
10032                    let max_decoding_message_size = self.max_decoding_message_size;
10033                    let max_encoding_message_size = self.max_encoding_message_size;
10034                    let inner = self.inner.clone();
10035                    let fut = async move {
10036                        let method = UpdateRoleSvc(inner);
10037                        let codec = tonic_prost::ProstCodec::default();
10038                        let mut grpc = tonic::server::Grpc::new(codec)
10039                            .apply_compression_config(
10040                                accept_compression_encodings,
10041                                send_compression_encodings,
10042                            )
10043                            .apply_max_message_size_config(
10044                                max_decoding_message_size,
10045                                max_encoding_message_size,
10046                            );
10047                        let res = grpc.unary(method, req).await;
10048                        Ok(res)
10049                    };
10050                    Box::pin(fut)
10051                }
10052                "/pidgr.v1.RoleService/DeleteRole" => {
10053                    #[allow(non_camel_case_types)]
10054                    struct DeleteRoleSvc<T: RoleService>(pub Arc<T>);
10055                    impl<
10056                        T: RoleService,
10057                    > tonic::server::UnaryService<super::DeleteRoleRequest>
10058                    for DeleteRoleSvc<T> {
10059                        type Response = super::DeleteRoleResponse;
10060                        type Future = BoxFuture<
10061                            tonic::Response<Self::Response>,
10062                            tonic::Status,
10063                        >;
10064                        fn call(
10065                            &mut self,
10066                            request: tonic::Request<super::DeleteRoleRequest>,
10067                        ) -> Self::Future {
10068                            let inner = Arc::clone(&self.0);
10069                            let fut = async move {
10070                                <T as RoleService>::delete_role(&inner, request).await
10071                            };
10072                            Box::pin(fut)
10073                        }
10074                    }
10075                    let accept_compression_encodings = self.accept_compression_encodings;
10076                    let send_compression_encodings = self.send_compression_encodings;
10077                    let max_decoding_message_size = self.max_decoding_message_size;
10078                    let max_encoding_message_size = self.max_encoding_message_size;
10079                    let inner = self.inner.clone();
10080                    let fut = async move {
10081                        let method = DeleteRoleSvc(inner);
10082                        let codec = tonic_prost::ProstCodec::default();
10083                        let mut grpc = tonic::server::Grpc::new(codec)
10084                            .apply_compression_config(
10085                                accept_compression_encodings,
10086                                send_compression_encodings,
10087                            )
10088                            .apply_max_message_size_config(
10089                                max_decoding_message_size,
10090                                max_encoding_message_size,
10091                            );
10092                        let res = grpc.unary(method, req).await;
10093                        Ok(res)
10094                    };
10095                    Box::pin(fut)
10096                }
10097                _ => {
10098                    Box::pin(async move {
10099                        let mut response = http::Response::new(
10100                            tonic::body::Body::default(),
10101                        );
10102                        let headers = response.headers_mut();
10103                        headers
10104                            .insert(
10105                                tonic::Status::GRPC_STATUS,
10106                                (tonic::Code::Unimplemented as i32).into(),
10107                            );
10108                        headers
10109                            .insert(
10110                                http::header::CONTENT_TYPE,
10111                                tonic::metadata::GRPC_CONTENT_TYPE,
10112                            );
10113                        Ok(response)
10114                    })
10115                }
10116            }
10117        }
10118    }
10119    impl<T> Clone for RoleServiceServer<T> {
10120        fn clone(&self) -> Self {
10121            let inner = self.inner.clone();
10122            Self {
10123                inner,
10124                accept_compression_encodings: self.accept_compression_encodings,
10125                send_compression_encodings: self.send_compression_encodings,
10126                max_decoding_message_size: self.max_decoding_message_size,
10127                max_encoding_message_size: self.max_encoding_message_size,
10128            }
10129        }
10130    }
10131    /// Generated gRPC service name
10132    pub const SERVICE_NAME: &str = "pidgr.v1.RoleService";
10133    impl<T> tonic::server::NamedService for RoleServiceServer<T> {
10134        const NAME: &'static str = SERVICE_NAME;
10135    }
10136}
10137/// Generated client implementations.
10138pub mod sso_service_client {
10139    #![allow(
10140        unused_variables,
10141        dead_code,
10142        missing_docs,
10143        clippy::wildcard_imports,
10144        clippy::let_unit_value,
10145    )]
10146    use tonic::codegen::*;
10147    use tonic::codegen::http::Uri;
10148    /** Manages SSO identity provider configuration for organizations.
10149*/
10150    #[derive(Debug, Clone)]
10151    pub struct SsoServiceClient<T> {
10152        inner: tonic::client::Grpc<T>,
10153    }
10154    impl SsoServiceClient<tonic::transport::Channel> {
10155        /// Attempt to create a new client by connecting to a given endpoint.
10156        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
10157        where
10158            D: TryInto<tonic::transport::Endpoint>,
10159            D::Error: Into<StdError>,
10160        {
10161            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
10162            Ok(Self::new(conn))
10163        }
10164    }
10165    impl<T> SsoServiceClient<T>
10166    where
10167        T: tonic::client::GrpcService<tonic::body::Body>,
10168        T::Error: Into<StdError>,
10169        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
10170        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
10171    {
10172        pub fn new(inner: T) -> Self {
10173            let inner = tonic::client::Grpc::new(inner);
10174            Self { inner }
10175        }
10176        pub fn with_origin(inner: T, origin: Uri) -> Self {
10177            let inner = tonic::client::Grpc::with_origin(inner, origin);
10178            Self { inner }
10179        }
10180        pub fn with_interceptor<F>(
10181            inner: T,
10182            interceptor: F,
10183        ) -> SsoServiceClient<InterceptedService<T, F>>
10184        where
10185            F: tonic::service::Interceptor,
10186            T::ResponseBody: Default,
10187            T: tonic::codegen::Service<
10188                http::Request<tonic::body::Body>,
10189                Response = http::Response<
10190                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
10191                >,
10192            >,
10193            <T as tonic::codegen::Service<
10194                http::Request<tonic::body::Body>,
10195            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
10196        {
10197            SsoServiceClient::new(InterceptedService::new(inner, interceptor))
10198        }
10199        /// Compress requests with the given encoding.
10200        ///
10201        /// This requires the server to support it otherwise it might respond with an
10202        /// error.
10203        #[must_use]
10204        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10205            self.inner = self.inner.send_compressed(encoding);
10206            self
10207        }
10208        /// Enable decompressing responses.
10209        #[must_use]
10210        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10211            self.inner = self.inner.accept_compressed(encoding);
10212            self
10213        }
10214        /// Limits the maximum size of a decoded message.
10215        ///
10216        /// Default: `4MB`
10217        #[must_use]
10218        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10219            self.inner = self.inner.max_decoding_message_size(limit);
10220            self
10221        }
10222        /// Limits the maximum size of an encoded message.
10223        ///
10224        /// Default: `usize::MAX`
10225        #[must_use]
10226        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10227            self.inner = self.inner.max_encoding_message_size(limit);
10228            self
10229        }
10230        /** Check if an email domain has SSO configured.
10231 This is a pre-authentication endpoint — no JWT required.
10232 Authorization: None (public).
10233*/
10234        pub async fn check_sso_by_domain(
10235            &mut self,
10236            request: impl tonic::IntoRequest<super::CheckSsoByDomainRequest>,
10237        ) -> std::result::Result<
10238            tonic::Response<super::CheckSsoByDomainResponse>,
10239            tonic::Status,
10240        > {
10241            self.inner
10242                .ready()
10243                .await
10244                .map_err(|e| {
10245                    tonic::Status::unknown(
10246                        format!("Service was not ready: {}", e.into()),
10247                    )
10248                })?;
10249            let codec = tonic_prost::ProstCodec::default();
10250            let path = http::uri::PathAndQuery::from_static(
10251                "/pidgr.v1.SSOService/CheckSSOByDomain",
10252            );
10253            let mut req = request.into_request();
10254            req.extensions_mut()
10255                .insert(GrpcMethod::new("pidgr.v1.SSOService", "CheckSSOByDomain"));
10256            self.inner.unary(req, path, codec).await
10257        }
10258        /** Create an SSO provider for the organization.
10259 Validates the metadata URL before saving.
10260 Creates the corresponding identity provider in the auth service.
10261 Authorization: Requires PERMISSION_ORG_WRITE.
10262*/
10263        pub async fn create_sso_provider(
10264            &mut self,
10265            request: impl tonic::IntoRequest<super::CreateSsoProviderRequest>,
10266        ) -> std::result::Result<
10267            tonic::Response<super::CreateSsoProviderResponse>,
10268            tonic::Status,
10269        > {
10270            self.inner
10271                .ready()
10272                .await
10273                .map_err(|e| {
10274                    tonic::Status::unknown(
10275                        format!("Service was not ready: {}", e.into()),
10276                    )
10277                })?;
10278            let codec = tonic_prost::ProstCodec::default();
10279            let path = http::uri::PathAndQuery::from_static(
10280                "/pidgr.v1.SSOService/CreateSSOProvider",
10281            );
10282            let mut req = request.into_request();
10283            req.extensions_mut()
10284                .insert(GrpcMethod::new("pidgr.v1.SSOService", "CreateSSOProvider"));
10285            self.inner.unary(req, path, codec).await
10286        }
10287        /** Get the organization's SSO provider configuration.
10288 Authorization: Requires PERMISSION_ORG_READ.
10289*/
10290        pub async fn get_sso_provider(
10291            &mut self,
10292            request: impl tonic::IntoRequest<super::GetSsoProviderRequest>,
10293        ) -> std::result::Result<
10294            tonic::Response<super::GetSsoProviderResponse>,
10295            tonic::Status,
10296        > {
10297            self.inner
10298                .ready()
10299                .await
10300                .map_err(|e| {
10301                    tonic::Status::unknown(
10302                        format!("Service was not ready: {}", e.into()),
10303                    )
10304                })?;
10305            let codec = tonic_prost::ProstCodec::default();
10306            let path = http::uri::PathAndQuery::from_static(
10307                "/pidgr.v1.SSOService/GetSSOProvider",
10308            );
10309            let mut req = request.into_request();
10310            req.extensions_mut()
10311                .insert(GrpcMethod::new("pidgr.v1.SSOService", "GetSSOProvider"));
10312            self.inner.unary(req, path, codec).await
10313        }
10314        /** Delete the organization's SSO provider.
10315 Deletes the corresponding identity provider from the auth service.
10316 Users with that domain fall back to passkey/OTP.
10317 Authorization: Requires PERMISSION_ORG_WRITE.
10318*/
10319        pub async fn delete_sso_provider(
10320            &mut self,
10321            request: impl tonic::IntoRequest<super::DeleteSsoProviderRequest>,
10322        ) -> std::result::Result<
10323            tonic::Response<super::DeleteSsoProviderResponse>,
10324            tonic::Status,
10325        > {
10326            self.inner
10327                .ready()
10328                .await
10329                .map_err(|e| {
10330                    tonic::Status::unknown(
10331                        format!("Service was not ready: {}", e.into()),
10332                    )
10333                })?;
10334            let codec = tonic_prost::ProstCodec::default();
10335            let path = http::uri::PathAndQuery::from_static(
10336                "/pidgr.v1.SSOService/DeleteSSOProvider",
10337            );
10338            let mut req = request.into_request();
10339            req.extensions_mut()
10340                .insert(GrpcMethod::new("pidgr.v1.SSOService", "DeleteSSOProvider"));
10341            self.inner.unary(req, path, codec).await
10342        }
10343    }
10344}
10345/// Generated server implementations.
10346pub mod sso_service_server {
10347    #![allow(
10348        unused_variables,
10349        dead_code,
10350        missing_docs,
10351        clippy::wildcard_imports,
10352        clippy::let_unit_value,
10353    )]
10354    use tonic::codegen::*;
10355    /// Generated trait containing gRPC methods that should be implemented for use with SsoServiceServer.
10356    #[async_trait]
10357    pub trait SsoService: std::marker::Send + std::marker::Sync + 'static {
10358        /** Check if an email domain has SSO configured.
10359 This is a pre-authentication endpoint — no JWT required.
10360 Authorization: None (public).
10361*/
10362        async fn check_sso_by_domain(
10363            &self,
10364            request: tonic::Request<super::CheckSsoByDomainRequest>,
10365        ) -> std::result::Result<
10366            tonic::Response<super::CheckSsoByDomainResponse>,
10367            tonic::Status,
10368        >;
10369        /** Create an SSO provider for the organization.
10370 Validates the metadata URL before saving.
10371 Creates the corresponding identity provider in the auth service.
10372 Authorization: Requires PERMISSION_ORG_WRITE.
10373*/
10374        async fn create_sso_provider(
10375            &self,
10376            request: tonic::Request<super::CreateSsoProviderRequest>,
10377        ) -> std::result::Result<
10378            tonic::Response<super::CreateSsoProviderResponse>,
10379            tonic::Status,
10380        >;
10381        /** Get the organization's SSO provider configuration.
10382 Authorization: Requires PERMISSION_ORG_READ.
10383*/
10384        async fn get_sso_provider(
10385            &self,
10386            request: tonic::Request<super::GetSsoProviderRequest>,
10387        ) -> std::result::Result<
10388            tonic::Response<super::GetSsoProviderResponse>,
10389            tonic::Status,
10390        >;
10391        /** Delete the organization's SSO provider.
10392 Deletes the corresponding identity provider from the auth service.
10393 Users with that domain fall back to passkey/OTP.
10394 Authorization: Requires PERMISSION_ORG_WRITE.
10395*/
10396        async fn delete_sso_provider(
10397            &self,
10398            request: tonic::Request<super::DeleteSsoProviderRequest>,
10399        ) -> std::result::Result<
10400            tonic::Response<super::DeleteSsoProviderResponse>,
10401            tonic::Status,
10402        >;
10403    }
10404    /** Manages SSO identity provider configuration for organizations.
10405*/
10406    #[derive(Debug)]
10407    pub struct SsoServiceServer<T> {
10408        inner: Arc<T>,
10409        accept_compression_encodings: EnabledCompressionEncodings,
10410        send_compression_encodings: EnabledCompressionEncodings,
10411        max_decoding_message_size: Option<usize>,
10412        max_encoding_message_size: Option<usize>,
10413    }
10414    impl<T> SsoServiceServer<T> {
10415        pub fn new(inner: T) -> Self {
10416            Self::from_arc(Arc::new(inner))
10417        }
10418        pub fn from_arc(inner: Arc<T>) -> Self {
10419            Self {
10420                inner,
10421                accept_compression_encodings: Default::default(),
10422                send_compression_encodings: Default::default(),
10423                max_decoding_message_size: None,
10424                max_encoding_message_size: None,
10425            }
10426        }
10427        pub fn with_interceptor<F>(
10428            inner: T,
10429            interceptor: F,
10430        ) -> InterceptedService<Self, F>
10431        where
10432            F: tonic::service::Interceptor,
10433        {
10434            InterceptedService::new(Self::new(inner), interceptor)
10435        }
10436        /// Enable decompressing requests with the given encoding.
10437        #[must_use]
10438        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10439            self.accept_compression_encodings.enable(encoding);
10440            self
10441        }
10442        /// Compress responses with the given encoding, if the client supports it.
10443        #[must_use]
10444        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10445            self.send_compression_encodings.enable(encoding);
10446            self
10447        }
10448        /// Limits the maximum size of a decoded message.
10449        ///
10450        /// Default: `4MB`
10451        #[must_use]
10452        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10453            self.max_decoding_message_size = Some(limit);
10454            self
10455        }
10456        /// Limits the maximum size of an encoded message.
10457        ///
10458        /// Default: `usize::MAX`
10459        #[must_use]
10460        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10461            self.max_encoding_message_size = Some(limit);
10462            self
10463        }
10464    }
10465    impl<T, B> tonic::codegen::Service<http::Request<B>> for SsoServiceServer<T>
10466    where
10467        T: SsoService,
10468        B: Body + std::marker::Send + 'static,
10469        B::Error: Into<StdError> + std::marker::Send + 'static,
10470    {
10471        type Response = http::Response<tonic::body::Body>;
10472        type Error = std::convert::Infallible;
10473        type Future = BoxFuture<Self::Response, Self::Error>;
10474        fn poll_ready(
10475            &mut self,
10476            _cx: &mut Context<'_>,
10477        ) -> Poll<std::result::Result<(), Self::Error>> {
10478            Poll::Ready(Ok(()))
10479        }
10480        fn call(&mut self, req: http::Request<B>) -> Self::Future {
10481            match req.uri().path() {
10482                "/pidgr.v1.SSOService/CheckSSOByDomain" => {
10483                    #[allow(non_camel_case_types)]
10484                    struct CheckSSOByDomainSvc<T: SsoService>(pub Arc<T>);
10485                    impl<
10486                        T: SsoService,
10487                    > tonic::server::UnaryService<super::CheckSsoByDomainRequest>
10488                    for CheckSSOByDomainSvc<T> {
10489                        type Response = super::CheckSsoByDomainResponse;
10490                        type Future = BoxFuture<
10491                            tonic::Response<Self::Response>,
10492                            tonic::Status,
10493                        >;
10494                        fn call(
10495                            &mut self,
10496                            request: tonic::Request<super::CheckSsoByDomainRequest>,
10497                        ) -> Self::Future {
10498                            let inner = Arc::clone(&self.0);
10499                            let fut = async move {
10500                                <T as SsoService>::check_sso_by_domain(&inner, request)
10501                                    .await
10502                            };
10503                            Box::pin(fut)
10504                        }
10505                    }
10506                    let accept_compression_encodings = self.accept_compression_encodings;
10507                    let send_compression_encodings = self.send_compression_encodings;
10508                    let max_decoding_message_size = self.max_decoding_message_size;
10509                    let max_encoding_message_size = self.max_encoding_message_size;
10510                    let inner = self.inner.clone();
10511                    let fut = async move {
10512                        let method = CheckSSOByDomainSvc(inner);
10513                        let codec = tonic_prost::ProstCodec::default();
10514                        let mut grpc = tonic::server::Grpc::new(codec)
10515                            .apply_compression_config(
10516                                accept_compression_encodings,
10517                                send_compression_encodings,
10518                            )
10519                            .apply_max_message_size_config(
10520                                max_decoding_message_size,
10521                                max_encoding_message_size,
10522                            );
10523                        let res = grpc.unary(method, req).await;
10524                        Ok(res)
10525                    };
10526                    Box::pin(fut)
10527                }
10528                "/pidgr.v1.SSOService/CreateSSOProvider" => {
10529                    #[allow(non_camel_case_types)]
10530                    struct CreateSSOProviderSvc<T: SsoService>(pub Arc<T>);
10531                    impl<
10532                        T: SsoService,
10533                    > tonic::server::UnaryService<super::CreateSsoProviderRequest>
10534                    for CreateSSOProviderSvc<T> {
10535                        type Response = super::CreateSsoProviderResponse;
10536                        type Future = BoxFuture<
10537                            tonic::Response<Self::Response>,
10538                            tonic::Status,
10539                        >;
10540                        fn call(
10541                            &mut self,
10542                            request: tonic::Request<super::CreateSsoProviderRequest>,
10543                        ) -> Self::Future {
10544                            let inner = Arc::clone(&self.0);
10545                            let fut = async move {
10546                                <T as SsoService>::create_sso_provider(&inner, request)
10547                                    .await
10548                            };
10549                            Box::pin(fut)
10550                        }
10551                    }
10552                    let accept_compression_encodings = self.accept_compression_encodings;
10553                    let send_compression_encodings = self.send_compression_encodings;
10554                    let max_decoding_message_size = self.max_decoding_message_size;
10555                    let max_encoding_message_size = self.max_encoding_message_size;
10556                    let inner = self.inner.clone();
10557                    let fut = async move {
10558                        let method = CreateSSOProviderSvc(inner);
10559                        let codec = tonic_prost::ProstCodec::default();
10560                        let mut grpc = tonic::server::Grpc::new(codec)
10561                            .apply_compression_config(
10562                                accept_compression_encodings,
10563                                send_compression_encodings,
10564                            )
10565                            .apply_max_message_size_config(
10566                                max_decoding_message_size,
10567                                max_encoding_message_size,
10568                            );
10569                        let res = grpc.unary(method, req).await;
10570                        Ok(res)
10571                    };
10572                    Box::pin(fut)
10573                }
10574                "/pidgr.v1.SSOService/GetSSOProvider" => {
10575                    #[allow(non_camel_case_types)]
10576                    struct GetSSOProviderSvc<T: SsoService>(pub Arc<T>);
10577                    impl<
10578                        T: SsoService,
10579                    > tonic::server::UnaryService<super::GetSsoProviderRequest>
10580                    for GetSSOProviderSvc<T> {
10581                        type Response = super::GetSsoProviderResponse;
10582                        type Future = BoxFuture<
10583                            tonic::Response<Self::Response>,
10584                            tonic::Status,
10585                        >;
10586                        fn call(
10587                            &mut self,
10588                            request: tonic::Request<super::GetSsoProviderRequest>,
10589                        ) -> Self::Future {
10590                            let inner = Arc::clone(&self.0);
10591                            let fut = async move {
10592                                <T as SsoService>::get_sso_provider(&inner, request).await
10593                            };
10594                            Box::pin(fut)
10595                        }
10596                    }
10597                    let accept_compression_encodings = self.accept_compression_encodings;
10598                    let send_compression_encodings = self.send_compression_encodings;
10599                    let max_decoding_message_size = self.max_decoding_message_size;
10600                    let max_encoding_message_size = self.max_encoding_message_size;
10601                    let inner = self.inner.clone();
10602                    let fut = async move {
10603                        let method = GetSSOProviderSvc(inner);
10604                        let codec = tonic_prost::ProstCodec::default();
10605                        let mut grpc = tonic::server::Grpc::new(codec)
10606                            .apply_compression_config(
10607                                accept_compression_encodings,
10608                                send_compression_encodings,
10609                            )
10610                            .apply_max_message_size_config(
10611                                max_decoding_message_size,
10612                                max_encoding_message_size,
10613                            );
10614                        let res = grpc.unary(method, req).await;
10615                        Ok(res)
10616                    };
10617                    Box::pin(fut)
10618                }
10619                "/pidgr.v1.SSOService/DeleteSSOProvider" => {
10620                    #[allow(non_camel_case_types)]
10621                    struct DeleteSSOProviderSvc<T: SsoService>(pub Arc<T>);
10622                    impl<
10623                        T: SsoService,
10624                    > tonic::server::UnaryService<super::DeleteSsoProviderRequest>
10625                    for DeleteSSOProviderSvc<T> {
10626                        type Response = super::DeleteSsoProviderResponse;
10627                        type Future = BoxFuture<
10628                            tonic::Response<Self::Response>,
10629                            tonic::Status,
10630                        >;
10631                        fn call(
10632                            &mut self,
10633                            request: tonic::Request<super::DeleteSsoProviderRequest>,
10634                        ) -> Self::Future {
10635                            let inner = Arc::clone(&self.0);
10636                            let fut = async move {
10637                                <T as SsoService>::delete_sso_provider(&inner, request)
10638                                    .await
10639                            };
10640                            Box::pin(fut)
10641                        }
10642                    }
10643                    let accept_compression_encodings = self.accept_compression_encodings;
10644                    let send_compression_encodings = self.send_compression_encodings;
10645                    let max_decoding_message_size = self.max_decoding_message_size;
10646                    let max_encoding_message_size = self.max_encoding_message_size;
10647                    let inner = self.inner.clone();
10648                    let fut = async move {
10649                        let method = DeleteSSOProviderSvc(inner);
10650                        let codec = tonic_prost::ProstCodec::default();
10651                        let mut grpc = tonic::server::Grpc::new(codec)
10652                            .apply_compression_config(
10653                                accept_compression_encodings,
10654                                send_compression_encodings,
10655                            )
10656                            .apply_max_message_size_config(
10657                                max_decoding_message_size,
10658                                max_encoding_message_size,
10659                            );
10660                        let res = grpc.unary(method, req).await;
10661                        Ok(res)
10662                    };
10663                    Box::pin(fut)
10664                }
10665                _ => {
10666                    Box::pin(async move {
10667                        let mut response = http::Response::new(
10668                            tonic::body::Body::default(),
10669                        );
10670                        let headers = response.headers_mut();
10671                        headers
10672                            .insert(
10673                                tonic::Status::GRPC_STATUS,
10674                                (tonic::Code::Unimplemented as i32).into(),
10675                            );
10676                        headers
10677                            .insert(
10678                                http::header::CONTENT_TYPE,
10679                                tonic::metadata::GRPC_CONTENT_TYPE,
10680                            );
10681                        Ok(response)
10682                    })
10683                }
10684            }
10685        }
10686    }
10687    impl<T> Clone for SsoServiceServer<T> {
10688        fn clone(&self) -> Self {
10689            let inner = self.inner.clone();
10690            Self {
10691                inner,
10692                accept_compression_encodings: self.accept_compression_encodings,
10693                send_compression_encodings: self.send_compression_encodings,
10694                max_decoding_message_size: self.max_decoding_message_size,
10695                max_encoding_message_size: self.max_encoding_message_size,
10696            }
10697        }
10698    }
10699    /// Generated gRPC service name
10700    pub const SERVICE_NAME: &str = "pidgr.v1.SSOService";
10701    impl<T> tonic::server::NamedService for SsoServiceServer<T> {
10702        const NAME: &'static str = SERVICE_NAME;
10703    }
10704}
10705/// Generated client implementations.
10706pub mod team_service_client {
10707    #![allow(
10708        unused_variables,
10709        dead_code,
10710        missing_docs,
10711        clippy::wildcard_imports,
10712        clippy::let_unit_value,
10713    )]
10714    use tonic::codegen::*;
10715    use tonic::codegen::http::Uri;
10716    /** Manages organizational teams (departments, divisions) within an organization.
10717 Teams represent the organizational structure and can serve as sender identity.
10718 All RPCs operate within the caller's org (extracted from JWT).
10719*/
10720    #[derive(Debug, Clone)]
10721    pub struct TeamServiceClient<T> {
10722        inner: tonic::client::Grpc<T>,
10723    }
10724    impl TeamServiceClient<tonic::transport::Channel> {
10725        /// Attempt to create a new client by connecting to a given endpoint.
10726        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
10727        where
10728            D: TryInto<tonic::transport::Endpoint>,
10729            D::Error: Into<StdError>,
10730        {
10731            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
10732            Ok(Self::new(conn))
10733        }
10734    }
10735    impl<T> TeamServiceClient<T>
10736    where
10737        T: tonic::client::GrpcService<tonic::body::Body>,
10738        T::Error: Into<StdError>,
10739        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
10740        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
10741    {
10742        pub fn new(inner: T) -> Self {
10743            let inner = tonic::client::Grpc::new(inner);
10744            Self { inner }
10745        }
10746        pub fn with_origin(inner: T, origin: Uri) -> Self {
10747            let inner = tonic::client::Grpc::with_origin(inner, origin);
10748            Self { inner }
10749        }
10750        pub fn with_interceptor<F>(
10751            inner: T,
10752            interceptor: F,
10753        ) -> TeamServiceClient<InterceptedService<T, F>>
10754        where
10755            F: tonic::service::Interceptor,
10756            T::ResponseBody: Default,
10757            T: tonic::codegen::Service<
10758                http::Request<tonic::body::Body>,
10759                Response = http::Response<
10760                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
10761                >,
10762            >,
10763            <T as tonic::codegen::Service<
10764                http::Request<tonic::body::Body>,
10765            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
10766        {
10767            TeamServiceClient::new(InterceptedService::new(inner, interceptor))
10768        }
10769        /// Compress requests with the given encoding.
10770        ///
10771        /// This requires the server to support it otherwise it might respond with an
10772        /// error.
10773        #[must_use]
10774        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10775            self.inner = self.inner.send_compressed(encoding);
10776            self
10777        }
10778        /// Enable decompressing responses.
10779        #[must_use]
10780        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10781            self.inner = self.inner.accept_compressed(encoding);
10782            self
10783        }
10784        /// Limits the maximum size of a decoded message.
10785        ///
10786        /// Default: `4MB`
10787        #[must_use]
10788        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10789            self.inner = self.inner.max_decoding_message_size(limit);
10790            self
10791        }
10792        /// Limits the maximum size of an encoded message.
10793        ///
10794        /// Default: `usize::MAX`
10795        #[must_use]
10796        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10797            self.inner = self.inner.max_encoding_message_size(limit);
10798            self
10799        }
10800        /** Create a new team in the organization.
10801 Authorization: Requires PERMISSION_TEAMS_WRITE or PERMISSION_TEAMS_ALL_WRITE.
10802*/
10803        pub async fn create_team(
10804            &mut self,
10805            request: impl tonic::IntoRequest<super::CreateTeamRequest>,
10806        ) -> std::result::Result<
10807            tonic::Response<super::CreateTeamResponse>,
10808            tonic::Status,
10809        > {
10810            self.inner
10811                .ready()
10812                .await
10813                .map_err(|e| {
10814                    tonic::Status::unknown(
10815                        format!("Service was not ready: {}", e.into()),
10816                    )
10817                })?;
10818            let codec = tonic_prost::ProstCodec::default();
10819            let path = http::uri::PathAndQuery::from_static(
10820                "/pidgr.v1.TeamService/CreateTeam",
10821            );
10822            let mut req = request.into_request();
10823            req.extensions_mut()
10824                .insert(GrpcMethod::new("pidgr.v1.TeamService", "CreateTeam"));
10825            self.inner.unary(req, path, codec).await
10826        }
10827        /** Retrieve a team by ID.
10828 Authorization: Caller must be a member of the team, or have
10829 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
10830*/
10831        pub async fn get_team(
10832            &mut self,
10833            request: impl tonic::IntoRequest<super::GetTeamRequest>,
10834        ) -> std::result::Result<
10835            tonic::Response<super::GetTeamResponse>,
10836            tonic::Status,
10837        > {
10838            self.inner
10839                .ready()
10840                .await
10841                .map_err(|e| {
10842                    tonic::Status::unknown(
10843                        format!("Service was not ready: {}", e.into()),
10844                    )
10845                })?;
10846            let codec = tonic_prost::ProstCodec::default();
10847            let path = http::uri::PathAndQuery::from_static(
10848                "/pidgr.v1.TeamService/GetTeam",
10849            );
10850            let mut req = request.into_request();
10851            req.extensions_mut()
10852                .insert(GrpcMethod::new("pidgr.v1.TeamService", "GetTeam"));
10853            self.inner.unary(req, path, codec).await
10854        }
10855        /** List teams in the organization with pagination.
10856 Without PERMISSION_TEAMS_ALL_READ/ALL_WRITE, returns only teams the caller belongs to.
10857*/
10858        pub async fn list_teams(
10859            &mut self,
10860            request: impl tonic::IntoRequest<super::ListTeamsRequest>,
10861        ) -> std::result::Result<
10862            tonic::Response<super::ListTeamsResponse>,
10863            tonic::Status,
10864        > {
10865            self.inner
10866                .ready()
10867                .await
10868                .map_err(|e| {
10869                    tonic::Status::unknown(
10870                        format!("Service was not ready: {}", e.into()),
10871                    )
10872                })?;
10873            let codec = tonic_prost::ProstCodec::default();
10874            let path = http::uri::PathAndQuery::from_static(
10875                "/pidgr.v1.TeamService/ListTeams",
10876            );
10877            let mut req = request.into_request();
10878            req.extensions_mut()
10879                .insert(GrpcMethod::new("pidgr.v1.TeamService", "ListTeams"));
10880            self.inner.unary(req, path, codec).await
10881        }
10882        /** Update a team's name and/or description.
10883 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
10884*/
10885        pub async fn update_team(
10886            &mut self,
10887            request: impl tonic::IntoRequest<super::UpdateTeamRequest>,
10888        ) -> std::result::Result<
10889            tonic::Response<super::UpdateTeamResponse>,
10890            tonic::Status,
10891        > {
10892            self.inner
10893                .ready()
10894                .await
10895                .map_err(|e| {
10896                    tonic::Status::unknown(
10897                        format!("Service was not ready: {}", e.into()),
10898                    )
10899                })?;
10900            let codec = tonic_prost::ProstCodec::default();
10901            let path = http::uri::PathAndQuery::from_static(
10902                "/pidgr.v1.TeamService/UpdateTeam",
10903            );
10904            let mut req = request.into_request();
10905            req.extensions_mut()
10906                .insert(GrpcMethod::new("pidgr.v1.TeamService", "UpdateTeam"));
10907            self.inner.unary(req, path, codec).await
10908        }
10909        /** Delete a team and all its membership records. Default teams cannot be deleted.
10910 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
10911*/
10912        pub async fn delete_team(
10913            &mut self,
10914            request: impl tonic::IntoRequest<super::DeleteTeamRequest>,
10915        ) -> std::result::Result<
10916            tonic::Response<super::DeleteTeamResponse>,
10917            tonic::Status,
10918        > {
10919            self.inner
10920                .ready()
10921                .await
10922                .map_err(|e| {
10923                    tonic::Status::unknown(
10924                        format!("Service was not ready: {}", e.into()),
10925                    )
10926                })?;
10927            let codec = tonic_prost::ProstCodec::default();
10928            let path = http::uri::PathAndQuery::from_static(
10929                "/pidgr.v1.TeamService/DeleteTeam",
10930            );
10931            let mut req = request.into_request();
10932            req.extensions_mut()
10933                .insert(GrpcMethod::new("pidgr.v1.TeamService", "DeleteTeam"));
10934            self.inner.unary(req, path, codec).await
10935        }
10936        /** Add one or more users to a team (idempotent).
10937 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
10938*/
10939        pub async fn add_team_members(
10940            &mut self,
10941            request: impl tonic::IntoRequest<super::AddTeamMembersRequest>,
10942        ) -> std::result::Result<
10943            tonic::Response<super::AddTeamMembersResponse>,
10944            tonic::Status,
10945        > {
10946            self.inner
10947                .ready()
10948                .await
10949                .map_err(|e| {
10950                    tonic::Status::unknown(
10951                        format!("Service was not ready: {}", e.into()),
10952                    )
10953                })?;
10954            let codec = tonic_prost::ProstCodec::default();
10955            let path = http::uri::PathAndQuery::from_static(
10956                "/pidgr.v1.TeamService/AddTeamMembers",
10957            );
10958            let mut req = request.into_request();
10959            req.extensions_mut()
10960                .insert(GrpcMethod::new("pidgr.v1.TeamService", "AddTeamMembers"));
10961            self.inner.unary(req, path, codec).await
10962        }
10963        /** Remove one or more users from a team (idempotent).
10964 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
10965*/
10966        pub async fn remove_team_members(
10967            &mut self,
10968            request: impl tonic::IntoRequest<super::RemoveTeamMembersRequest>,
10969        ) -> std::result::Result<
10970            tonic::Response<super::RemoveTeamMembersResponse>,
10971            tonic::Status,
10972        > {
10973            self.inner
10974                .ready()
10975                .await
10976                .map_err(|e| {
10977                    tonic::Status::unknown(
10978                        format!("Service was not ready: {}", e.into()),
10979                    )
10980                })?;
10981            let codec = tonic_prost::ProstCodec::default();
10982            let path = http::uri::PathAndQuery::from_static(
10983                "/pidgr.v1.TeamService/RemoveTeamMembers",
10984            );
10985            let mut req = request.into_request();
10986            req.extensions_mut()
10987                .insert(GrpcMethod::new("pidgr.v1.TeamService", "RemoveTeamMembers"));
10988            self.inner.unary(req, path, codec).await
10989        }
10990        /** List members of a team with pagination.
10991 Authorization: Caller must be a member of the team, or have
10992 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
10993*/
10994        pub async fn list_team_members(
10995            &mut self,
10996            request: impl tonic::IntoRequest<super::ListTeamMembersRequest>,
10997        ) -> std::result::Result<
10998            tonic::Response<super::ListTeamMembersResponse>,
10999            tonic::Status,
11000        > {
11001            self.inner
11002                .ready()
11003                .await
11004                .map_err(|e| {
11005                    tonic::Status::unknown(
11006                        format!("Service was not ready: {}", e.into()),
11007                    )
11008                })?;
11009            let codec = tonic_prost::ProstCodec::default();
11010            let path = http::uri::PathAndQuery::from_static(
11011                "/pidgr.v1.TeamService/ListTeamMembers",
11012            );
11013            let mut req = request.into_request();
11014            req.extensions_mut()
11015                .insert(GrpcMethod::new("pidgr.v1.TeamService", "ListTeamMembers"));
11016            self.inner.unary(req, path, codec).await
11017        }
11018    }
11019}
11020/// Generated server implementations.
11021pub mod team_service_server {
11022    #![allow(
11023        unused_variables,
11024        dead_code,
11025        missing_docs,
11026        clippy::wildcard_imports,
11027        clippy::let_unit_value,
11028    )]
11029    use tonic::codegen::*;
11030    /// Generated trait containing gRPC methods that should be implemented for use with TeamServiceServer.
11031    #[async_trait]
11032    pub trait TeamService: std::marker::Send + std::marker::Sync + 'static {
11033        /** Create a new team in the organization.
11034 Authorization: Requires PERMISSION_TEAMS_WRITE or PERMISSION_TEAMS_ALL_WRITE.
11035*/
11036        async fn create_team(
11037            &self,
11038            request: tonic::Request<super::CreateTeamRequest>,
11039        ) -> std::result::Result<
11040            tonic::Response<super::CreateTeamResponse>,
11041            tonic::Status,
11042        >;
11043        /** Retrieve a team by ID.
11044 Authorization: Caller must be a member of the team, or have
11045 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
11046*/
11047        async fn get_team(
11048            &self,
11049            request: tonic::Request<super::GetTeamRequest>,
11050        ) -> std::result::Result<tonic::Response<super::GetTeamResponse>, tonic::Status>;
11051        /** List teams in the organization with pagination.
11052 Without PERMISSION_TEAMS_ALL_READ/ALL_WRITE, returns only teams the caller belongs to.
11053*/
11054        async fn list_teams(
11055            &self,
11056            request: tonic::Request<super::ListTeamsRequest>,
11057        ) -> std::result::Result<
11058            tonic::Response<super::ListTeamsResponse>,
11059            tonic::Status,
11060        >;
11061        /** Update a team's name and/or description.
11062 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
11063*/
11064        async fn update_team(
11065            &self,
11066            request: tonic::Request<super::UpdateTeamRequest>,
11067        ) -> std::result::Result<
11068            tonic::Response<super::UpdateTeamResponse>,
11069            tonic::Status,
11070        >;
11071        /** Delete a team and all its membership records. Default teams cannot be deleted.
11072 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
11073*/
11074        async fn delete_team(
11075            &self,
11076            request: tonic::Request<super::DeleteTeamRequest>,
11077        ) -> std::result::Result<
11078            tonic::Response<super::DeleteTeamResponse>,
11079            tonic::Status,
11080        >;
11081        /** Add one or more users to a team (idempotent).
11082 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
11083*/
11084        async fn add_team_members(
11085            &self,
11086            request: tonic::Request<super::AddTeamMembersRequest>,
11087        ) -> std::result::Result<
11088            tonic::Response<super::AddTeamMembersResponse>,
11089            tonic::Status,
11090        >;
11091        /** Remove one or more users from a team (idempotent).
11092 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
11093*/
11094        async fn remove_team_members(
11095            &self,
11096            request: tonic::Request<super::RemoveTeamMembersRequest>,
11097        ) -> std::result::Result<
11098            tonic::Response<super::RemoveTeamMembersResponse>,
11099            tonic::Status,
11100        >;
11101        /** List members of a team with pagination.
11102 Authorization: Caller must be a member of the team, or have
11103 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
11104*/
11105        async fn list_team_members(
11106            &self,
11107            request: tonic::Request<super::ListTeamMembersRequest>,
11108        ) -> std::result::Result<
11109            tonic::Response<super::ListTeamMembersResponse>,
11110            tonic::Status,
11111        >;
11112    }
11113    /** Manages organizational teams (departments, divisions) within an organization.
11114 Teams represent the organizational structure and can serve as sender identity.
11115 All RPCs operate within the caller's org (extracted from JWT).
11116*/
11117    #[derive(Debug)]
11118    pub struct TeamServiceServer<T> {
11119        inner: Arc<T>,
11120        accept_compression_encodings: EnabledCompressionEncodings,
11121        send_compression_encodings: EnabledCompressionEncodings,
11122        max_decoding_message_size: Option<usize>,
11123        max_encoding_message_size: Option<usize>,
11124    }
11125    impl<T> TeamServiceServer<T> {
11126        pub fn new(inner: T) -> Self {
11127            Self::from_arc(Arc::new(inner))
11128        }
11129        pub fn from_arc(inner: Arc<T>) -> Self {
11130            Self {
11131                inner,
11132                accept_compression_encodings: Default::default(),
11133                send_compression_encodings: Default::default(),
11134                max_decoding_message_size: None,
11135                max_encoding_message_size: None,
11136            }
11137        }
11138        pub fn with_interceptor<F>(
11139            inner: T,
11140            interceptor: F,
11141        ) -> InterceptedService<Self, F>
11142        where
11143            F: tonic::service::Interceptor,
11144        {
11145            InterceptedService::new(Self::new(inner), interceptor)
11146        }
11147        /// Enable decompressing requests with the given encoding.
11148        #[must_use]
11149        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11150            self.accept_compression_encodings.enable(encoding);
11151            self
11152        }
11153        /// Compress responses with the given encoding, if the client supports it.
11154        #[must_use]
11155        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11156            self.send_compression_encodings.enable(encoding);
11157            self
11158        }
11159        /// Limits the maximum size of a decoded message.
11160        ///
11161        /// Default: `4MB`
11162        #[must_use]
11163        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11164            self.max_decoding_message_size = Some(limit);
11165            self
11166        }
11167        /// Limits the maximum size of an encoded message.
11168        ///
11169        /// Default: `usize::MAX`
11170        #[must_use]
11171        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11172            self.max_encoding_message_size = Some(limit);
11173            self
11174        }
11175    }
11176    impl<T, B> tonic::codegen::Service<http::Request<B>> for TeamServiceServer<T>
11177    where
11178        T: TeamService,
11179        B: Body + std::marker::Send + 'static,
11180        B::Error: Into<StdError> + std::marker::Send + 'static,
11181    {
11182        type Response = http::Response<tonic::body::Body>;
11183        type Error = std::convert::Infallible;
11184        type Future = BoxFuture<Self::Response, Self::Error>;
11185        fn poll_ready(
11186            &mut self,
11187            _cx: &mut Context<'_>,
11188        ) -> Poll<std::result::Result<(), Self::Error>> {
11189            Poll::Ready(Ok(()))
11190        }
11191        fn call(&mut self, req: http::Request<B>) -> Self::Future {
11192            match req.uri().path() {
11193                "/pidgr.v1.TeamService/CreateTeam" => {
11194                    #[allow(non_camel_case_types)]
11195                    struct CreateTeamSvc<T: TeamService>(pub Arc<T>);
11196                    impl<
11197                        T: TeamService,
11198                    > tonic::server::UnaryService<super::CreateTeamRequest>
11199                    for CreateTeamSvc<T> {
11200                        type Response = super::CreateTeamResponse;
11201                        type Future = BoxFuture<
11202                            tonic::Response<Self::Response>,
11203                            tonic::Status,
11204                        >;
11205                        fn call(
11206                            &mut self,
11207                            request: tonic::Request<super::CreateTeamRequest>,
11208                        ) -> Self::Future {
11209                            let inner = Arc::clone(&self.0);
11210                            let fut = async move {
11211                                <T as TeamService>::create_team(&inner, request).await
11212                            };
11213                            Box::pin(fut)
11214                        }
11215                    }
11216                    let accept_compression_encodings = self.accept_compression_encodings;
11217                    let send_compression_encodings = self.send_compression_encodings;
11218                    let max_decoding_message_size = self.max_decoding_message_size;
11219                    let max_encoding_message_size = self.max_encoding_message_size;
11220                    let inner = self.inner.clone();
11221                    let fut = async move {
11222                        let method = CreateTeamSvc(inner);
11223                        let codec = tonic_prost::ProstCodec::default();
11224                        let mut grpc = tonic::server::Grpc::new(codec)
11225                            .apply_compression_config(
11226                                accept_compression_encodings,
11227                                send_compression_encodings,
11228                            )
11229                            .apply_max_message_size_config(
11230                                max_decoding_message_size,
11231                                max_encoding_message_size,
11232                            );
11233                        let res = grpc.unary(method, req).await;
11234                        Ok(res)
11235                    };
11236                    Box::pin(fut)
11237                }
11238                "/pidgr.v1.TeamService/GetTeam" => {
11239                    #[allow(non_camel_case_types)]
11240                    struct GetTeamSvc<T: TeamService>(pub Arc<T>);
11241                    impl<
11242                        T: TeamService,
11243                    > tonic::server::UnaryService<super::GetTeamRequest>
11244                    for GetTeamSvc<T> {
11245                        type Response = super::GetTeamResponse;
11246                        type Future = BoxFuture<
11247                            tonic::Response<Self::Response>,
11248                            tonic::Status,
11249                        >;
11250                        fn call(
11251                            &mut self,
11252                            request: tonic::Request<super::GetTeamRequest>,
11253                        ) -> Self::Future {
11254                            let inner = Arc::clone(&self.0);
11255                            let fut = async move {
11256                                <T as TeamService>::get_team(&inner, request).await
11257                            };
11258                            Box::pin(fut)
11259                        }
11260                    }
11261                    let accept_compression_encodings = self.accept_compression_encodings;
11262                    let send_compression_encodings = self.send_compression_encodings;
11263                    let max_decoding_message_size = self.max_decoding_message_size;
11264                    let max_encoding_message_size = self.max_encoding_message_size;
11265                    let inner = self.inner.clone();
11266                    let fut = async move {
11267                        let method = GetTeamSvc(inner);
11268                        let codec = tonic_prost::ProstCodec::default();
11269                        let mut grpc = tonic::server::Grpc::new(codec)
11270                            .apply_compression_config(
11271                                accept_compression_encodings,
11272                                send_compression_encodings,
11273                            )
11274                            .apply_max_message_size_config(
11275                                max_decoding_message_size,
11276                                max_encoding_message_size,
11277                            );
11278                        let res = grpc.unary(method, req).await;
11279                        Ok(res)
11280                    };
11281                    Box::pin(fut)
11282                }
11283                "/pidgr.v1.TeamService/ListTeams" => {
11284                    #[allow(non_camel_case_types)]
11285                    struct ListTeamsSvc<T: TeamService>(pub Arc<T>);
11286                    impl<
11287                        T: TeamService,
11288                    > tonic::server::UnaryService<super::ListTeamsRequest>
11289                    for ListTeamsSvc<T> {
11290                        type Response = super::ListTeamsResponse;
11291                        type Future = BoxFuture<
11292                            tonic::Response<Self::Response>,
11293                            tonic::Status,
11294                        >;
11295                        fn call(
11296                            &mut self,
11297                            request: tonic::Request<super::ListTeamsRequest>,
11298                        ) -> Self::Future {
11299                            let inner = Arc::clone(&self.0);
11300                            let fut = async move {
11301                                <T as TeamService>::list_teams(&inner, request).await
11302                            };
11303                            Box::pin(fut)
11304                        }
11305                    }
11306                    let accept_compression_encodings = self.accept_compression_encodings;
11307                    let send_compression_encodings = self.send_compression_encodings;
11308                    let max_decoding_message_size = self.max_decoding_message_size;
11309                    let max_encoding_message_size = self.max_encoding_message_size;
11310                    let inner = self.inner.clone();
11311                    let fut = async move {
11312                        let method = ListTeamsSvc(inner);
11313                        let codec = tonic_prost::ProstCodec::default();
11314                        let mut grpc = tonic::server::Grpc::new(codec)
11315                            .apply_compression_config(
11316                                accept_compression_encodings,
11317                                send_compression_encodings,
11318                            )
11319                            .apply_max_message_size_config(
11320                                max_decoding_message_size,
11321                                max_encoding_message_size,
11322                            );
11323                        let res = grpc.unary(method, req).await;
11324                        Ok(res)
11325                    };
11326                    Box::pin(fut)
11327                }
11328                "/pidgr.v1.TeamService/UpdateTeam" => {
11329                    #[allow(non_camel_case_types)]
11330                    struct UpdateTeamSvc<T: TeamService>(pub Arc<T>);
11331                    impl<
11332                        T: TeamService,
11333                    > tonic::server::UnaryService<super::UpdateTeamRequest>
11334                    for UpdateTeamSvc<T> {
11335                        type Response = super::UpdateTeamResponse;
11336                        type Future = BoxFuture<
11337                            tonic::Response<Self::Response>,
11338                            tonic::Status,
11339                        >;
11340                        fn call(
11341                            &mut self,
11342                            request: tonic::Request<super::UpdateTeamRequest>,
11343                        ) -> Self::Future {
11344                            let inner = Arc::clone(&self.0);
11345                            let fut = async move {
11346                                <T as TeamService>::update_team(&inner, request).await
11347                            };
11348                            Box::pin(fut)
11349                        }
11350                    }
11351                    let accept_compression_encodings = self.accept_compression_encodings;
11352                    let send_compression_encodings = self.send_compression_encodings;
11353                    let max_decoding_message_size = self.max_decoding_message_size;
11354                    let max_encoding_message_size = self.max_encoding_message_size;
11355                    let inner = self.inner.clone();
11356                    let fut = async move {
11357                        let method = UpdateTeamSvc(inner);
11358                        let codec = tonic_prost::ProstCodec::default();
11359                        let mut grpc = tonic::server::Grpc::new(codec)
11360                            .apply_compression_config(
11361                                accept_compression_encodings,
11362                                send_compression_encodings,
11363                            )
11364                            .apply_max_message_size_config(
11365                                max_decoding_message_size,
11366                                max_encoding_message_size,
11367                            );
11368                        let res = grpc.unary(method, req).await;
11369                        Ok(res)
11370                    };
11371                    Box::pin(fut)
11372                }
11373                "/pidgr.v1.TeamService/DeleteTeam" => {
11374                    #[allow(non_camel_case_types)]
11375                    struct DeleteTeamSvc<T: TeamService>(pub Arc<T>);
11376                    impl<
11377                        T: TeamService,
11378                    > tonic::server::UnaryService<super::DeleteTeamRequest>
11379                    for DeleteTeamSvc<T> {
11380                        type Response = super::DeleteTeamResponse;
11381                        type Future = BoxFuture<
11382                            tonic::Response<Self::Response>,
11383                            tonic::Status,
11384                        >;
11385                        fn call(
11386                            &mut self,
11387                            request: tonic::Request<super::DeleteTeamRequest>,
11388                        ) -> Self::Future {
11389                            let inner = Arc::clone(&self.0);
11390                            let fut = async move {
11391                                <T as TeamService>::delete_team(&inner, request).await
11392                            };
11393                            Box::pin(fut)
11394                        }
11395                    }
11396                    let accept_compression_encodings = self.accept_compression_encodings;
11397                    let send_compression_encodings = self.send_compression_encodings;
11398                    let max_decoding_message_size = self.max_decoding_message_size;
11399                    let max_encoding_message_size = self.max_encoding_message_size;
11400                    let inner = self.inner.clone();
11401                    let fut = async move {
11402                        let method = DeleteTeamSvc(inner);
11403                        let codec = tonic_prost::ProstCodec::default();
11404                        let mut grpc = tonic::server::Grpc::new(codec)
11405                            .apply_compression_config(
11406                                accept_compression_encodings,
11407                                send_compression_encodings,
11408                            )
11409                            .apply_max_message_size_config(
11410                                max_decoding_message_size,
11411                                max_encoding_message_size,
11412                            );
11413                        let res = grpc.unary(method, req).await;
11414                        Ok(res)
11415                    };
11416                    Box::pin(fut)
11417                }
11418                "/pidgr.v1.TeamService/AddTeamMembers" => {
11419                    #[allow(non_camel_case_types)]
11420                    struct AddTeamMembersSvc<T: TeamService>(pub Arc<T>);
11421                    impl<
11422                        T: TeamService,
11423                    > tonic::server::UnaryService<super::AddTeamMembersRequest>
11424                    for AddTeamMembersSvc<T> {
11425                        type Response = super::AddTeamMembersResponse;
11426                        type Future = BoxFuture<
11427                            tonic::Response<Self::Response>,
11428                            tonic::Status,
11429                        >;
11430                        fn call(
11431                            &mut self,
11432                            request: tonic::Request<super::AddTeamMembersRequest>,
11433                        ) -> Self::Future {
11434                            let inner = Arc::clone(&self.0);
11435                            let fut = async move {
11436                                <T as TeamService>::add_team_members(&inner, request).await
11437                            };
11438                            Box::pin(fut)
11439                        }
11440                    }
11441                    let accept_compression_encodings = self.accept_compression_encodings;
11442                    let send_compression_encodings = self.send_compression_encodings;
11443                    let max_decoding_message_size = self.max_decoding_message_size;
11444                    let max_encoding_message_size = self.max_encoding_message_size;
11445                    let inner = self.inner.clone();
11446                    let fut = async move {
11447                        let method = AddTeamMembersSvc(inner);
11448                        let codec = tonic_prost::ProstCodec::default();
11449                        let mut grpc = tonic::server::Grpc::new(codec)
11450                            .apply_compression_config(
11451                                accept_compression_encodings,
11452                                send_compression_encodings,
11453                            )
11454                            .apply_max_message_size_config(
11455                                max_decoding_message_size,
11456                                max_encoding_message_size,
11457                            );
11458                        let res = grpc.unary(method, req).await;
11459                        Ok(res)
11460                    };
11461                    Box::pin(fut)
11462                }
11463                "/pidgr.v1.TeamService/RemoveTeamMembers" => {
11464                    #[allow(non_camel_case_types)]
11465                    struct RemoveTeamMembersSvc<T: TeamService>(pub Arc<T>);
11466                    impl<
11467                        T: TeamService,
11468                    > tonic::server::UnaryService<super::RemoveTeamMembersRequest>
11469                    for RemoveTeamMembersSvc<T> {
11470                        type Response = super::RemoveTeamMembersResponse;
11471                        type Future = BoxFuture<
11472                            tonic::Response<Self::Response>,
11473                            tonic::Status,
11474                        >;
11475                        fn call(
11476                            &mut self,
11477                            request: tonic::Request<super::RemoveTeamMembersRequest>,
11478                        ) -> Self::Future {
11479                            let inner = Arc::clone(&self.0);
11480                            let fut = async move {
11481                                <T as TeamService>::remove_team_members(&inner, request)
11482                                    .await
11483                            };
11484                            Box::pin(fut)
11485                        }
11486                    }
11487                    let accept_compression_encodings = self.accept_compression_encodings;
11488                    let send_compression_encodings = self.send_compression_encodings;
11489                    let max_decoding_message_size = self.max_decoding_message_size;
11490                    let max_encoding_message_size = self.max_encoding_message_size;
11491                    let inner = self.inner.clone();
11492                    let fut = async move {
11493                        let method = RemoveTeamMembersSvc(inner);
11494                        let codec = tonic_prost::ProstCodec::default();
11495                        let mut grpc = tonic::server::Grpc::new(codec)
11496                            .apply_compression_config(
11497                                accept_compression_encodings,
11498                                send_compression_encodings,
11499                            )
11500                            .apply_max_message_size_config(
11501                                max_decoding_message_size,
11502                                max_encoding_message_size,
11503                            );
11504                        let res = grpc.unary(method, req).await;
11505                        Ok(res)
11506                    };
11507                    Box::pin(fut)
11508                }
11509                "/pidgr.v1.TeamService/ListTeamMembers" => {
11510                    #[allow(non_camel_case_types)]
11511                    struct ListTeamMembersSvc<T: TeamService>(pub Arc<T>);
11512                    impl<
11513                        T: TeamService,
11514                    > tonic::server::UnaryService<super::ListTeamMembersRequest>
11515                    for ListTeamMembersSvc<T> {
11516                        type Response = super::ListTeamMembersResponse;
11517                        type Future = BoxFuture<
11518                            tonic::Response<Self::Response>,
11519                            tonic::Status,
11520                        >;
11521                        fn call(
11522                            &mut self,
11523                            request: tonic::Request<super::ListTeamMembersRequest>,
11524                        ) -> Self::Future {
11525                            let inner = Arc::clone(&self.0);
11526                            let fut = async move {
11527                                <T as TeamService>::list_team_members(&inner, request).await
11528                            };
11529                            Box::pin(fut)
11530                        }
11531                    }
11532                    let accept_compression_encodings = self.accept_compression_encodings;
11533                    let send_compression_encodings = self.send_compression_encodings;
11534                    let max_decoding_message_size = self.max_decoding_message_size;
11535                    let max_encoding_message_size = self.max_encoding_message_size;
11536                    let inner = self.inner.clone();
11537                    let fut = async move {
11538                        let method = ListTeamMembersSvc(inner);
11539                        let codec = tonic_prost::ProstCodec::default();
11540                        let mut grpc = tonic::server::Grpc::new(codec)
11541                            .apply_compression_config(
11542                                accept_compression_encodings,
11543                                send_compression_encodings,
11544                            )
11545                            .apply_max_message_size_config(
11546                                max_decoding_message_size,
11547                                max_encoding_message_size,
11548                            );
11549                        let res = grpc.unary(method, req).await;
11550                        Ok(res)
11551                    };
11552                    Box::pin(fut)
11553                }
11554                _ => {
11555                    Box::pin(async move {
11556                        let mut response = http::Response::new(
11557                            tonic::body::Body::default(),
11558                        );
11559                        let headers = response.headers_mut();
11560                        headers
11561                            .insert(
11562                                tonic::Status::GRPC_STATUS,
11563                                (tonic::Code::Unimplemented as i32).into(),
11564                            );
11565                        headers
11566                            .insert(
11567                                http::header::CONTENT_TYPE,
11568                                tonic::metadata::GRPC_CONTENT_TYPE,
11569                            );
11570                        Ok(response)
11571                    })
11572                }
11573            }
11574        }
11575    }
11576    impl<T> Clone for TeamServiceServer<T> {
11577        fn clone(&self) -> Self {
11578            let inner = self.inner.clone();
11579            Self {
11580                inner,
11581                accept_compression_encodings: self.accept_compression_encodings,
11582                send_compression_encodings: self.send_compression_encodings,
11583                max_decoding_message_size: self.max_decoding_message_size,
11584                max_encoding_message_size: self.max_encoding_message_size,
11585            }
11586        }
11587    }
11588    /// Generated gRPC service name
11589    pub const SERVICE_NAME: &str = "pidgr.v1.TeamService";
11590    impl<T> tonic::server::NamedService for TeamServiceServer<T> {
11591        const NAME: &'static str = SERVICE_NAME;
11592    }
11593}
11594/// Generated client implementations.
11595pub mod template_service_client {
11596    #![allow(
11597        unused_variables,
11598        dead_code,
11599        missing_docs,
11600        clippy::wildcard_imports,
11601        clippy::let_unit_value,
11602    )]
11603    use tonic::codegen::*;
11604    use tonic::codegen::http::Uri;
11605    /** Manages versioned message templates used by campaigns.
11606 Templates are append-only — updates create new versions while preserving history.
11607*/
11608    #[derive(Debug, Clone)]
11609    pub struct TemplateServiceClient<T> {
11610        inner: tonic::client::Grpc<T>,
11611    }
11612    impl TemplateServiceClient<tonic::transport::Channel> {
11613        /// Attempt to create a new client by connecting to a given endpoint.
11614        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
11615        where
11616            D: TryInto<tonic::transport::Endpoint>,
11617            D::Error: Into<StdError>,
11618        {
11619            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
11620            Ok(Self::new(conn))
11621        }
11622    }
11623    impl<T> TemplateServiceClient<T>
11624    where
11625        T: tonic::client::GrpcService<tonic::body::Body>,
11626        T::Error: Into<StdError>,
11627        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
11628        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
11629    {
11630        pub fn new(inner: T) -> Self {
11631            let inner = tonic::client::Grpc::new(inner);
11632            Self { inner }
11633        }
11634        pub fn with_origin(inner: T, origin: Uri) -> Self {
11635            let inner = tonic::client::Grpc::with_origin(inner, origin);
11636            Self { inner }
11637        }
11638        pub fn with_interceptor<F>(
11639            inner: T,
11640            interceptor: F,
11641        ) -> TemplateServiceClient<InterceptedService<T, F>>
11642        where
11643            F: tonic::service::Interceptor,
11644            T::ResponseBody: Default,
11645            T: tonic::codegen::Service<
11646                http::Request<tonic::body::Body>,
11647                Response = http::Response<
11648                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
11649                >,
11650            >,
11651            <T as tonic::codegen::Service<
11652                http::Request<tonic::body::Body>,
11653            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
11654        {
11655            TemplateServiceClient::new(InterceptedService::new(inner, interceptor))
11656        }
11657        /// Compress requests with the given encoding.
11658        ///
11659        /// This requires the server to support it otherwise it might respond with an
11660        /// error.
11661        #[must_use]
11662        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11663            self.inner = self.inner.send_compressed(encoding);
11664            self
11665        }
11666        /// Enable decompressing responses.
11667        #[must_use]
11668        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11669            self.inner = self.inner.accept_compressed(encoding);
11670            self
11671        }
11672        /// Limits the maximum size of a decoded message.
11673        ///
11674        /// Default: `4MB`
11675        #[must_use]
11676        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11677            self.inner = self.inner.max_decoding_message_size(limit);
11678            self
11679        }
11680        /// Limits the maximum size of an encoded message.
11681        ///
11682        /// Default: `usize::MAX`
11683        #[must_use]
11684        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11685            self.inner = self.inner.max_encoding_message_size(limit);
11686            self
11687        }
11688        /** Create a new template with a body and variable definitions.
11689 Authorization: Requires MANAGER+ role.
11690*/
11691        pub async fn create_template(
11692            &mut self,
11693            request: impl tonic::IntoRequest<super::CreateTemplateRequest>,
11694        ) -> std::result::Result<
11695            tonic::Response<super::CreateTemplateResponse>,
11696            tonic::Status,
11697        > {
11698            self.inner
11699                .ready()
11700                .await
11701                .map_err(|e| {
11702                    tonic::Status::unknown(
11703                        format!("Service was not ready: {}", e.into()),
11704                    )
11705                })?;
11706            let codec = tonic_prost::ProstCodec::default();
11707            let path = http::uri::PathAndQuery::from_static(
11708                "/pidgr.v1.TemplateService/CreateTemplate",
11709            );
11710            let mut req = request.into_request();
11711            req.extensions_mut()
11712                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "CreateTemplate"));
11713            self.inner.unary(req, path, codec).await
11714        }
11715        /** Update an existing template, creating a new version.
11716 Authorization: Requires MANAGER+ role.
11717*/
11718        pub async fn update_template(
11719            &mut self,
11720            request: impl tonic::IntoRequest<super::UpdateTemplateRequest>,
11721        ) -> std::result::Result<
11722            tonic::Response<super::UpdateTemplateResponse>,
11723            tonic::Status,
11724        > {
11725            self.inner
11726                .ready()
11727                .await
11728                .map_err(|e| {
11729                    tonic::Status::unknown(
11730                        format!("Service was not ready: {}", e.into()),
11731                    )
11732                })?;
11733            let codec = tonic_prost::ProstCodec::default();
11734            let path = http::uri::PathAndQuery::from_static(
11735                "/pidgr.v1.TemplateService/UpdateTemplate",
11736            );
11737            let mut req = request.into_request();
11738            req.extensions_mut()
11739                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "UpdateTemplate"));
11740            self.inner.unary(req, path, codec).await
11741        }
11742        /** Retrieve a specific template by ID and optional version.
11743 Authorization: Authenticated user within the organization.
11744*/
11745        pub async fn get_template(
11746            &mut self,
11747            request: impl tonic::IntoRequest<super::GetTemplateRequest>,
11748        ) -> std::result::Result<
11749            tonic::Response<super::GetTemplateResponse>,
11750            tonic::Status,
11751        > {
11752            self.inner
11753                .ready()
11754                .await
11755                .map_err(|e| {
11756                    tonic::Status::unknown(
11757                        format!("Service was not ready: {}", e.into()),
11758                    )
11759                })?;
11760            let codec = tonic_prost::ProstCodec::default();
11761            let path = http::uri::PathAndQuery::from_static(
11762                "/pidgr.v1.TemplateService/GetTemplate",
11763            );
11764            let mut req = request.into_request();
11765            req.extensions_mut()
11766                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "GetTemplate"));
11767            self.inner.unary(req, path, codec).await
11768        }
11769        /** List all templates for the organization with pagination.
11770 Authorization: Authenticated user within the organization.
11771*/
11772        pub async fn list_templates(
11773            &mut self,
11774            request: impl tonic::IntoRequest<super::ListTemplatesRequest>,
11775        ) -> std::result::Result<
11776            tonic::Response<super::ListTemplatesResponse>,
11777            tonic::Status,
11778        > {
11779            self.inner
11780                .ready()
11781                .await
11782                .map_err(|e| {
11783                    tonic::Status::unknown(
11784                        format!("Service was not ready: {}", e.into()),
11785                    )
11786                })?;
11787            let codec = tonic_prost::ProstCodec::default();
11788            let path = http::uri::PathAndQuery::from_static(
11789                "/pidgr.v1.TemplateService/ListTemplates",
11790            );
11791            let mut req = request.into_request();
11792            req.extensions_mut()
11793                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "ListTemplates"));
11794            self.inner.unary(req, path, codec).await
11795        }
11796    }
11797}
11798/// Generated server implementations.
11799pub mod template_service_server {
11800    #![allow(
11801        unused_variables,
11802        dead_code,
11803        missing_docs,
11804        clippy::wildcard_imports,
11805        clippy::let_unit_value,
11806    )]
11807    use tonic::codegen::*;
11808    /// Generated trait containing gRPC methods that should be implemented for use with TemplateServiceServer.
11809    #[async_trait]
11810    pub trait TemplateService: std::marker::Send + std::marker::Sync + 'static {
11811        /** Create a new template with a body and variable definitions.
11812 Authorization: Requires MANAGER+ role.
11813*/
11814        async fn create_template(
11815            &self,
11816            request: tonic::Request<super::CreateTemplateRequest>,
11817        ) -> std::result::Result<
11818            tonic::Response<super::CreateTemplateResponse>,
11819            tonic::Status,
11820        >;
11821        /** Update an existing template, creating a new version.
11822 Authorization: Requires MANAGER+ role.
11823*/
11824        async fn update_template(
11825            &self,
11826            request: tonic::Request<super::UpdateTemplateRequest>,
11827        ) -> std::result::Result<
11828            tonic::Response<super::UpdateTemplateResponse>,
11829            tonic::Status,
11830        >;
11831        /** Retrieve a specific template by ID and optional version.
11832 Authorization: Authenticated user within the organization.
11833*/
11834        async fn get_template(
11835            &self,
11836            request: tonic::Request<super::GetTemplateRequest>,
11837        ) -> std::result::Result<
11838            tonic::Response<super::GetTemplateResponse>,
11839            tonic::Status,
11840        >;
11841        /** List all templates for the organization with pagination.
11842 Authorization: Authenticated user within the organization.
11843*/
11844        async fn list_templates(
11845            &self,
11846            request: tonic::Request<super::ListTemplatesRequest>,
11847        ) -> std::result::Result<
11848            tonic::Response<super::ListTemplatesResponse>,
11849            tonic::Status,
11850        >;
11851    }
11852    /** Manages versioned message templates used by campaigns.
11853 Templates are append-only — updates create new versions while preserving history.
11854*/
11855    #[derive(Debug)]
11856    pub struct TemplateServiceServer<T> {
11857        inner: Arc<T>,
11858        accept_compression_encodings: EnabledCompressionEncodings,
11859        send_compression_encodings: EnabledCompressionEncodings,
11860        max_decoding_message_size: Option<usize>,
11861        max_encoding_message_size: Option<usize>,
11862    }
11863    impl<T> TemplateServiceServer<T> {
11864        pub fn new(inner: T) -> Self {
11865            Self::from_arc(Arc::new(inner))
11866        }
11867        pub fn from_arc(inner: Arc<T>) -> Self {
11868            Self {
11869                inner,
11870                accept_compression_encodings: Default::default(),
11871                send_compression_encodings: Default::default(),
11872                max_decoding_message_size: None,
11873                max_encoding_message_size: None,
11874            }
11875        }
11876        pub fn with_interceptor<F>(
11877            inner: T,
11878            interceptor: F,
11879        ) -> InterceptedService<Self, F>
11880        where
11881            F: tonic::service::Interceptor,
11882        {
11883            InterceptedService::new(Self::new(inner), interceptor)
11884        }
11885        /// Enable decompressing requests with the given encoding.
11886        #[must_use]
11887        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11888            self.accept_compression_encodings.enable(encoding);
11889            self
11890        }
11891        /// Compress responses with the given encoding, if the client supports it.
11892        #[must_use]
11893        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11894            self.send_compression_encodings.enable(encoding);
11895            self
11896        }
11897        /// Limits the maximum size of a decoded message.
11898        ///
11899        /// Default: `4MB`
11900        #[must_use]
11901        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11902            self.max_decoding_message_size = Some(limit);
11903            self
11904        }
11905        /// Limits the maximum size of an encoded message.
11906        ///
11907        /// Default: `usize::MAX`
11908        #[must_use]
11909        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11910            self.max_encoding_message_size = Some(limit);
11911            self
11912        }
11913    }
11914    impl<T, B> tonic::codegen::Service<http::Request<B>> for TemplateServiceServer<T>
11915    where
11916        T: TemplateService,
11917        B: Body + std::marker::Send + 'static,
11918        B::Error: Into<StdError> + std::marker::Send + 'static,
11919    {
11920        type Response = http::Response<tonic::body::Body>;
11921        type Error = std::convert::Infallible;
11922        type Future = BoxFuture<Self::Response, Self::Error>;
11923        fn poll_ready(
11924            &mut self,
11925            _cx: &mut Context<'_>,
11926        ) -> Poll<std::result::Result<(), Self::Error>> {
11927            Poll::Ready(Ok(()))
11928        }
11929        fn call(&mut self, req: http::Request<B>) -> Self::Future {
11930            match req.uri().path() {
11931                "/pidgr.v1.TemplateService/CreateTemplate" => {
11932                    #[allow(non_camel_case_types)]
11933                    struct CreateTemplateSvc<T: TemplateService>(pub Arc<T>);
11934                    impl<
11935                        T: TemplateService,
11936                    > tonic::server::UnaryService<super::CreateTemplateRequest>
11937                    for CreateTemplateSvc<T> {
11938                        type Response = super::CreateTemplateResponse;
11939                        type Future = BoxFuture<
11940                            tonic::Response<Self::Response>,
11941                            tonic::Status,
11942                        >;
11943                        fn call(
11944                            &mut self,
11945                            request: tonic::Request<super::CreateTemplateRequest>,
11946                        ) -> Self::Future {
11947                            let inner = Arc::clone(&self.0);
11948                            let fut = async move {
11949                                <T as TemplateService>::create_template(&inner, request)
11950                                    .await
11951                            };
11952                            Box::pin(fut)
11953                        }
11954                    }
11955                    let accept_compression_encodings = self.accept_compression_encodings;
11956                    let send_compression_encodings = self.send_compression_encodings;
11957                    let max_decoding_message_size = self.max_decoding_message_size;
11958                    let max_encoding_message_size = self.max_encoding_message_size;
11959                    let inner = self.inner.clone();
11960                    let fut = async move {
11961                        let method = CreateTemplateSvc(inner);
11962                        let codec = tonic_prost::ProstCodec::default();
11963                        let mut grpc = tonic::server::Grpc::new(codec)
11964                            .apply_compression_config(
11965                                accept_compression_encodings,
11966                                send_compression_encodings,
11967                            )
11968                            .apply_max_message_size_config(
11969                                max_decoding_message_size,
11970                                max_encoding_message_size,
11971                            );
11972                        let res = grpc.unary(method, req).await;
11973                        Ok(res)
11974                    };
11975                    Box::pin(fut)
11976                }
11977                "/pidgr.v1.TemplateService/UpdateTemplate" => {
11978                    #[allow(non_camel_case_types)]
11979                    struct UpdateTemplateSvc<T: TemplateService>(pub Arc<T>);
11980                    impl<
11981                        T: TemplateService,
11982                    > tonic::server::UnaryService<super::UpdateTemplateRequest>
11983                    for UpdateTemplateSvc<T> {
11984                        type Response = super::UpdateTemplateResponse;
11985                        type Future = BoxFuture<
11986                            tonic::Response<Self::Response>,
11987                            tonic::Status,
11988                        >;
11989                        fn call(
11990                            &mut self,
11991                            request: tonic::Request<super::UpdateTemplateRequest>,
11992                        ) -> Self::Future {
11993                            let inner = Arc::clone(&self.0);
11994                            let fut = async move {
11995                                <T as TemplateService>::update_template(&inner, request)
11996                                    .await
11997                            };
11998                            Box::pin(fut)
11999                        }
12000                    }
12001                    let accept_compression_encodings = self.accept_compression_encodings;
12002                    let send_compression_encodings = self.send_compression_encodings;
12003                    let max_decoding_message_size = self.max_decoding_message_size;
12004                    let max_encoding_message_size = self.max_encoding_message_size;
12005                    let inner = self.inner.clone();
12006                    let fut = async move {
12007                        let method = UpdateTemplateSvc(inner);
12008                        let codec = tonic_prost::ProstCodec::default();
12009                        let mut grpc = tonic::server::Grpc::new(codec)
12010                            .apply_compression_config(
12011                                accept_compression_encodings,
12012                                send_compression_encodings,
12013                            )
12014                            .apply_max_message_size_config(
12015                                max_decoding_message_size,
12016                                max_encoding_message_size,
12017                            );
12018                        let res = grpc.unary(method, req).await;
12019                        Ok(res)
12020                    };
12021                    Box::pin(fut)
12022                }
12023                "/pidgr.v1.TemplateService/GetTemplate" => {
12024                    #[allow(non_camel_case_types)]
12025                    struct GetTemplateSvc<T: TemplateService>(pub Arc<T>);
12026                    impl<
12027                        T: TemplateService,
12028                    > tonic::server::UnaryService<super::GetTemplateRequest>
12029                    for GetTemplateSvc<T> {
12030                        type Response = super::GetTemplateResponse;
12031                        type Future = BoxFuture<
12032                            tonic::Response<Self::Response>,
12033                            tonic::Status,
12034                        >;
12035                        fn call(
12036                            &mut self,
12037                            request: tonic::Request<super::GetTemplateRequest>,
12038                        ) -> Self::Future {
12039                            let inner = Arc::clone(&self.0);
12040                            let fut = async move {
12041                                <T as TemplateService>::get_template(&inner, request).await
12042                            };
12043                            Box::pin(fut)
12044                        }
12045                    }
12046                    let accept_compression_encodings = self.accept_compression_encodings;
12047                    let send_compression_encodings = self.send_compression_encodings;
12048                    let max_decoding_message_size = self.max_decoding_message_size;
12049                    let max_encoding_message_size = self.max_encoding_message_size;
12050                    let inner = self.inner.clone();
12051                    let fut = async move {
12052                        let method = GetTemplateSvc(inner);
12053                        let codec = tonic_prost::ProstCodec::default();
12054                        let mut grpc = tonic::server::Grpc::new(codec)
12055                            .apply_compression_config(
12056                                accept_compression_encodings,
12057                                send_compression_encodings,
12058                            )
12059                            .apply_max_message_size_config(
12060                                max_decoding_message_size,
12061                                max_encoding_message_size,
12062                            );
12063                        let res = grpc.unary(method, req).await;
12064                        Ok(res)
12065                    };
12066                    Box::pin(fut)
12067                }
12068                "/pidgr.v1.TemplateService/ListTemplates" => {
12069                    #[allow(non_camel_case_types)]
12070                    struct ListTemplatesSvc<T: TemplateService>(pub Arc<T>);
12071                    impl<
12072                        T: TemplateService,
12073                    > tonic::server::UnaryService<super::ListTemplatesRequest>
12074                    for ListTemplatesSvc<T> {
12075                        type Response = super::ListTemplatesResponse;
12076                        type Future = BoxFuture<
12077                            tonic::Response<Self::Response>,
12078                            tonic::Status,
12079                        >;
12080                        fn call(
12081                            &mut self,
12082                            request: tonic::Request<super::ListTemplatesRequest>,
12083                        ) -> Self::Future {
12084                            let inner = Arc::clone(&self.0);
12085                            let fut = async move {
12086                                <T as TemplateService>::list_templates(&inner, request)
12087                                    .await
12088                            };
12089                            Box::pin(fut)
12090                        }
12091                    }
12092                    let accept_compression_encodings = self.accept_compression_encodings;
12093                    let send_compression_encodings = self.send_compression_encodings;
12094                    let max_decoding_message_size = self.max_decoding_message_size;
12095                    let max_encoding_message_size = self.max_encoding_message_size;
12096                    let inner = self.inner.clone();
12097                    let fut = async move {
12098                        let method = ListTemplatesSvc(inner);
12099                        let codec = tonic_prost::ProstCodec::default();
12100                        let mut grpc = tonic::server::Grpc::new(codec)
12101                            .apply_compression_config(
12102                                accept_compression_encodings,
12103                                send_compression_encodings,
12104                            )
12105                            .apply_max_message_size_config(
12106                                max_decoding_message_size,
12107                                max_encoding_message_size,
12108                            );
12109                        let res = grpc.unary(method, req).await;
12110                        Ok(res)
12111                    };
12112                    Box::pin(fut)
12113                }
12114                _ => {
12115                    Box::pin(async move {
12116                        let mut response = http::Response::new(
12117                            tonic::body::Body::default(),
12118                        );
12119                        let headers = response.headers_mut();
12120                        headers
12121                            .insert(
12122                                tonic::Status::GRPC_STATUS,
12123                                (tonic::Code::Unimplemented as i32).into(),
12124                            );
12125                        headers
12126                            .insert(
12127                                http::header::CONTENT_TYPE,
12128                                tonic::metadata::GRPC_CONTENT_TYPE,
12129                            );
12130                        Ok(response)
12131                    })
12132                }
12133            }
12134        }
12135    }
12136    impl<T> Clone for TemplateServiceServer<T> {
12137        fn clone(&self) -> Self {
12138            let inner = self.inner.clone();
12139            Self {
12140                inner,
12141                accept_compression_encodings: self.accept_compression_encodings,
12142                send_compression_encodings: self.send_compression_encodings,
12143                max_decoding_message_size: self.max_decoding_message_size,
12144                max_encoding_message_size: self.max_encoding_message_size,
12145            }
12146        }
12147    }
12148    /// Generated gRPC service name
12149    pub const SERVICE_NAME: &str = "pidgr.v1.TemplateService";
12150    impl<T> tonic::server::NamedService for TemplateServiceServer<T> {
12151        const NAME: &'static str = SERVICE_NAME;
12152    }
12153}