Skip to main content

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

1// @generated
2/// Generated client implementations.
3pub mod access_code_service_client {
4    #![allow(
5        unused_variables,
6        dead_code,
7        missing_docs,
8        clippy::wildcard_imports,
9        clippy::let_unit_value,
10    )]
11    use tonic::codegen::*;
12    use tonic::codegen::http::Uri;
13    /** Manages early access codes for organization creation gating.
14 All RPCs require API key authentication (platform-level, not org-scoped).
15*/
16    #[derive(Debug, Clone)]
17    pub struct AccessCodeServiceClient<T> {
18        inner: tonic::client::Grpc<T>,
19    }
20    impl AccessCodeServiceClient<tonic::transport::Channel> {
21        /// Attempt to create a new client by connecting to a given endpoint.
22        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
23        where
24            D: TryInto<tonic::transport::Endpoint>,
25            D::Error: Into<StdError>,
26        {
27            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
28            Ok(Self::new(conn))
29        }
30    }
31    impl<T> AccessCodeServiceClient<T>
32    where
33        T: tonic::client::GrpcService<tonic::body::Body>,
34        T::Error: Into<StdError>,
35        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
36        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
37    {
38        pub fn new(inner: T) -> Self {
39            let inner = tonic::client::Grpc::new(inner);
40            Self { inner }
41        }
42        pub fn with_origin(inner: T, origin: Uri) -> Self {
43            let inner = tonic::client::Grpc::with_origin(inner, origin);
44            Self { inner }
45        }
46        pub fn with_interceptor<F>(
47            inner: T,
48            interceptor: F,
49        ) -> AccessCodeServiceClient<InterceptedService<T, F>>
50        where
51            F: tonic::service::Interceptor,
52            T::ResponseBody: Default,
53            T: tonic::codegen::Service<
54                http::Request<tonic::body::Body>,
55                Response = http::Response<
56                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
57                >,
58            >,
59            <T as tonic::codegen::Service<
60                http::Request<tonic::body::Body>,
61            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
62        {
63            AccessCodeServiceClient::new(InterceptedService::new(inner, interceptor))
64        }
65        /// Compress requests with the given encoding.
66        ///
67        /// This requires the server to support it otherwise it might respond with an
68        /// error.
69        #[must_use]
70        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
71            self.inner = self.inner.send_compressed(encoding);
72            self
73        }
74        /// Enable decompressing responses.
75        #[must_use]
76        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
77            self.inner = self.inner.accept_compressed(encoding);
78            self
79        }
80        /// Limits the maximum size of a decoded message.
81        ///
82        /// Default: `4MB`
83        #[must_use]
84        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
85            self.inner = self.inner.max_decoding_message_size(limit);
86            self
87        }
88        /// Limits the maximum size of an encoded message.
89        ///
90        /// Default: `usize::MAX`
91        #[must_use]
92        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
93            self.inner = self.inner.max_encoding_message_size(limit);
94            self
95        }
96        /** Generate one or more access codes with an optional label.
97 Authorization: Requires API key auth (service-level).
98*/
99        pub async fn generate_access_codes(
100            &mut self,
101            request: impl tonic::IntoRequest<super::GenerateAccessCodesRequest>,
102        ) -> std::result::Result<
103            tonic::Response<super::GenerateAccessCodesResponse>,
104            tonic::Status,
105        > {
106            self.inner
107                .ready()
108                .await
109                .map_err(|e| {
110                    tonic::Status::unknown(
111                        format!("Service was not ready: {}", e.into()),
112                    )
113                })?;
114            let codec = tonic_prost::ProstCodec::default();
115            let path = http::uri::PathAndQuery::from_static(
116                "/pidgr.v1.AccessCodeService/GenerateAccessCodes",
117            );
118            let mut req = request.into_request();
119            req.extensions_mut()
120                .insert(
121                    GrpcMethod::new("pidgr.v1.AccessCodeService", "GenerateAccessCodes"),
122                );
123            self.inner.unary(req, path, codec).await
124        }
125        /** List all access codes (active, redeemed, and revoked).
126 Authorization: Requires API key auth (service-level).
127*/
128        pub async fn list_access_codes(
129            &mut self,
130            request: impl tonic::IntoRequest<super::ListAccessCodesRequest>,
131        ) -> std::result::Result<
132            tonic::Response<super::ListAccessCodesResponse>,
133            tonic::Status,
134        > {
135            self.inner
136                .ready()
137                .await
138                .map_err(|e| {
139                    tonic::Status::unknown(
140                        format!("Service was not ready: {}", e.into()),
141                    )
142                })?;
143            let codec = tonic_prost::ProstCodec::default();
144            let path = http::uri::PathAndQuery::from_static(
145                "/pidgr.v1.AccessCodeService/ListAccessCodes",
146            );
147            let mut req = request.into_request();
148            req.extensions_mut()
149                .insert(
150                    GrpcMethod::new("pidgr.v1.AccessCodeService", "ListAccessCodes"),
151                );
152            self.inner.unary(req, path, codec).await
153        }
154        /** Revoke an access code. Revoked codes cannot be used for organization creation.
155 Authorization: Requires API key auth (service-level).
156*/
157        pub async fn revoke_access_code(
158            &mut self,
159            request: impl tonic::IntoRequest<super::RevokeAccessCodeRequest>,
160        ) -> std::result::Result<
161            tonic::Response<super::RevokeAccessCodeResponse>,
162            tonic::Status,
163        > {
164            self.inner
165                .ready()
166                .await
167                .map_err(|e| {
168                    tonic::Status::unknown(
169                        format!("Service was not ready: {}", e.into()),
170                    )
171                })?;
172            let codec = tonic_prost::ProstCodec::default();
173            let path = http::uri::PathAndQuery::from_static(
174                "/pidgr.v1.AccessCodeService/RevokeAccessCode",
175            );
176            let mut req = request.into_request();
177            req.extensions_mut()
178                .insert(
179                    GrpcMethod::new("pidgr.v1.AccessCodeService", "RevokeAccessCode"),
180                );
181            self.inner.unary(req, path, codec).await
182        }
183    }
184}
185/// Generated server implementations.
186pub mod access_code_service_server {
187    #![allow(
188        unused_variables,
189        dead_code,
190        missing_docs,
191        clippy::wildcard_imports,
192        clippy::let_unit_value,
193    )]
194    use tonic::codegen::*;
195    /// Generated trait containing gRPC methods that should be implemented for use with AccessCodeServiceServer.
196    #[async_trait]
197    pub trait AccessCodeService: std::marker::Send + std::marker::Sync + 'static {
198        /** Generate one or more access codes with an optional label.
199 Authorization: Requires API key auth (service-level).
200*/
201        async fn generate_access_codes(
202            &self,
203            request: tonic::Request<super::GenerateAccessCodesRequest>,
204        ) -> std::result::Result<
205            tonic::Response<super::GenerateAccessCodesResponse>,
206            tonic::Status,
207        >;
208        /** List all access codes (active, redeemed, and revoked).
209 Authorization: Requires API key auth (service-level).
210*/
211        async fn list_access_codes(
212            &self,
213            request: tonic::Request<super::ListAccessCodesRequest>,
214        ) -> std::result::Result<
215            tonic::Response<super::ListAccessCodesResponse>,
216            tonic::Status,
217        >;
218        /** Revoke an access code. Revoked codes cannot be used for organization creation.
219 Authorization: Requires API key auth (service-level).
220*/
221        async fn revoke_access_code(
222            &self,
223            request: tonic::Request<super::RevokeAccessCodeRequest>,
224        ) -> std::result::Result<
225            tonic::Response<super::RevokeAccessCodeResponse>,
226            tonic::Status,
227        >;
228    }
229    /** Manages early access codes for organization creation gating.
230 All RPCs require API key authentication (platform-level, not org-scoped).
231*/
232    #[derive(Debug)]
233    pub struct AccessCodeServiceServer<T> {
234        inner: Arc<T>,
235        accept_compression_encodings: EnabledCompressionEncodings,
236        send_compression_encodings: EnabledCompressionEncodings,
237        max_decoding_message_size: Option<usize>,
238        max_encoding_message_size: Option<usize>,
239    }
240    impl<T> AccessCodeServiceServer<T> {
241        pub fn new(inner: T) -> Self {
242            Self::from_arc(Arc::new(inner))
243        }
244        pub fn from_arc(inner: Arc<T>) -> Self {
245            Self {
246                inner,
247                accept_compression_encodings: Default::default(),
248                send_compression_encodings: Default::default(),
249                max_decoding_message_size: None,
250                max_encoding_message_size: None,
251            }
252        }
253        pub fn with_interceptor<F>(
254            inner: T,
255            interceptor: F,
256        ) -> InterceptedService<Self, F>
257        where
258            F: tonic::service::Interceptor,
259        {
260            InterceptedService::new(Self::new(inner), interceptor)
261        }
262        /// Enable decompressing requests with the given encoding.
263        #[must_use]
264        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
265            self.accept_compression_encodings.enable(encoding);
266            self
267        }
268        /// Compress responses with the given encoding, if the client supports it.
269        #[must_use]
270        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
271            self.send_compression_encodings.enable(encoding);
272            self
273        }
274        /// Limits the maximum size of a decoded message.
275        ///
276        /// Default: `4MB`
277        #[must_use]
278        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
279            self.max_decoding_message_size = Some(limit);
280            self
281        }
282        /// Limits the maximum size of an encoded message.
283        ///
284        /// Default: `usize::MAX`
285        #[must_use]
286        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
287            self.max_encoding_message_size = Some(limit);
288            self
289        }
290    }
291    impl<T, B> tonic::codegen::Service<http::Request<B>> for AccessCodeServiceServer<T>
292    where
293        T: AccessCodeService,
294        B: Body + std::marker::Send + 'static,
295        B::Error: Into<StdError> + std::marker::Send + 'static,
296    {
297        type Response = http::Response<tonic::body::Body>;
298        type Error = std::convert::Infallible;
299        type Future = BoxFuture<Self::Response, Self::Error>;
300        fn poll_ready(
301            &mut self,
302            _cx: &mut Context<'_>,
303        ) -> Poll<std::result::Result<(), Self::Error>> {
304            Poll::Ready(Ok(()))
305        }
306        fn call(&mut self, req: http::Request<B>) -> Self::Future {
307            match req.uri().path() {
308                "/pidgr.v1.AccessCodeService/GenerateAccessCodes" => {
309                    #[allow(non_camel_case_types)]
310                    struct GenerateAccessCodesSvc<T: AccessCodeService>(pub Arc<T>);
311                    impl<
312                        T: AccessCodeService,
313                    > tonic::server::UnaryService<super::GenerateAccessCodesRequest>
314                    for GenerateAccessCodesSvc<T> {
315                        type Response = super::GenerateAccessCodesResponse;
316                        type Future = BoxFuture<
317                            tonic::Response<Self::Response>,
318                            tonic::Status,
319                        >;
320                        fn call(
321                            &mut self,
322                            request: tonic::Request<super::GenerateAccessCodesRequest>,
323                        ) -> Self::Future {
324                            let inner = Arc::clone(&self.0);
325                            let fut = async move {
326                                <T as AccessCodeService>::generate_access_codes(
327                                        &inner,
328                                        request,
329                                    )
330                                    .await
331                            };
332                            Box::pin(fut)
333                        }
334                    }
335                    let accept_compression_encodings = self.accept_compression_encodings;
336                    let send_compression_encodings = self.send_compression_encodings;
337                    let max_decoding_message_size = self.max_decoding_message_size;
338                    let max_encoding_message_size = self.max_encoding_message_size;
339                    let inner = self.inner.clone();
340                    let fut = async move {
341                        let method = GenerateAccessCodesSvc(inner);
342                        let codec = tonic_prost::ProstCodec::default();
343                        let mut grpc = tonic::server::Grpc::new(codec)
344                            .apply_compression_config(
345                                accept_compression_encodings,
346                                send_compression_encodings,
347                            )
348                            .apply_max_message_size_config(
349                                max_decoding_message_size,
350                                max_encoding_message_size,
351                            );
352                        let res = grpc.unary(method, req).await;
353                        Ok(res)
354                    };
355                    Box::pin(fut)
356                }
357                "/pidgr.v1.AccessCodeService/ListAccessCodes" => {
358                    #[allow(non_camel_case_types)]
359                    struct ListAccessCodesSvc<T: AccessCodeService>(pub Arc<T>);
360                    impl<
361                        T: AccessCodeService,
362                    > tonic::server::UnaryService<super::ListAccessCodesRequest>
363                    for ListAccessCodesSvc<T> {
364                        type Response = super::ListAccessCodesResponse;
365                        type Future = BoxFuture<
366                            tonic::Response<Self::Response>,
367                            tonic::Status,
368                        >;
369                        fn call(
370                            &mut self,
371                            request: tonic::Request<super::ListAccessCodesRequest>,
372                        ) -> Self::Future {
373                            let inner = Arc::clone(&self.0);
374                            let fut = async move {
375                                <T as AccessCodeService>::list_access_codes(&inner, request)
376                                    .await
377                            };
378                            Box::pin(fut)
379                        }
380                    }
381                    let accept_compression_encodings = self.accept_compression_encodings;
382                    let send_compression_encodings = self.send_compression_encodings;
383                    let max_decoding_message_size = self.max_decoding_message_size;
384                    let max_encoding_message_size = self.max_encoding_message_size;
385                    let inner = self.inner.clone();
386                    let fut = async move {
387                        let method = ListAccessCodesSvc(inner);
388                        let codec = tonic_prost::ProstCodec::default();
389                        let mut grpc = tonic::server::Grpc::new(codec)
390                            .apply_compression_config(
391                                accept_compression_encodings,
392                                send_compression_encodings,
393                            )
394                            .apply_max_message_size_config(
395                                max_decoding_message_size,
396                                max_encoding_message_size,
397                            );
398                        let res = grpc.unary(method, req).await;
399                        Ok(res)
400                    };
401                    Box::pin(fut)
402                }
403                "/pidgr.v1.AccessCodeService/RevokeAccessCode" => {
404                    #[allow(non_camel_case_types)]
405                    struct RevokeAccessCodeSvc<T: AccessCodeService>(pub Arc<T>);
406                    impl<
407                        T: AccessCodeService,
408                    > tonic::server::UnaryService<super::RevokeAccessCodeRequest>
409                    for RevokeAccessCodeSvc<T> {
410                        type Response = super::RevokeAccessCodeResponse;
411                        type Future = BoxFuture<
412                            tonic::Response<Self::Response>,
413                            tonic::Status,
414                        >;
415                        fn call(
416                            &mut self,
417                            request: tonic::Request<super::RevokeAccessCodeRequest>,
418                        ) -> Self::Future {
419                            let inner = Arc::clone(&self.0);
420                            let fut = async move {
421                                <T as AccessCodeService>::revoke_access_code(
422                                        &inner,
423                                        request,
424                                    )
425                                    .await
426                            };
427                            Box::pin(fut)
428                        }
429                    }
430                    let accept_compression_encodings = self.accept_compression_encodings;
431                    let send_compression_encodings = self.send_compression_encodings;
432                    let max_decoding_message_size = self.max_decoding_message_size;
433                    let max_encoding_message_size = self.max_encoding_message_size;
434                    let inner = self.inner.clone();
435                    let fut = async move {
436                        let method = RevokeAccessCodeSvc(inner);
437                        let codec = tonic_prost::ProstCodec::default();
438                        let mut grpc = tonic::server::Grpc::new(codec)
439                            .apply_compression_config(
440                                accept_compression_encodings,
441                                send_compression_encodings,
442                            )
443                            .apply_max_message_size_config(
444                                max_decoding_message_size,
445                                max_encoding_message_size,
446                            );
447                        let res = grpc.unary(method, req).await;
448                        Ok(res)
449                    };
450                    Box::pin(fut)
451                }
452                _ => {
453                    Box::pin(async move {
454                        let mut response = http::Response::new(
455                            tonic::body::Body::default(),
456                        );
457                        let headers = response.headers_mut();
458                        headers
459                            .insert(
460                                tonic::Status::GRPC_STATUS,
461                                (tonic::Code::Unimplemented as i32).into(),
462                            );
463                        headers
464                            .insert(
465                                http::header::CONTENT_TYPE,
466                                tonic::metadata::GRPC_CONTENT_TYPE,
467                            );
468                        Ok(response)
469                    })
470                }
471            }
472        }
473    }
474    impl<T> Clone for AccessCodeServiceServer<T> {
475        fn clone(&self) -> Self {
476            let inner = self.inner.clone();
477            Self {
478                inner,
479                accept_compression_encodings: self.accept_compression_encodings,
480                send_compression_encodings: self.send_compression_encodings,
481                max_decoding_message_size: self.max_decoding_message_size,
482                max_encoding_message_size: self.max_encoding_message_size,
483            }
484        }
485    }
486    /// Generated gRPC service name
487    pub const SERVICE_NAME: &str = "pidgr.v1.AccessCodeService";
488    impl<T> tonic::server::NamedService for AccessCodeServiceServer<T> {
489        const NAME: &'static str = SERVICE_NAME;
490    }
491}
492/// Generated client implementations.
493pub mod action_service_client {
494    #![allow(
495        unused_variables,
496        dead_code,
497        missing_docs,
498        clippy::wildcard_imports,
499        clippy::let_unit_value,
500    )]
501    use tonic::codegen::*;
502    use tonic::codegen::http::Uri;
503    /** Handles user actions on delivered messages.
504 Actions drive workflow progression (e.g. ACK completes a wait step).
505*/
506    #[derive(Debug, Clone)]
507    pub struct ActionServiceClient<T> {
508        inner: tonic::client::Grpc<T>,
509    }
510    impl ActionServiceClient<tonic::transport::Channel> {
511        /// Attempt to create a new client by connecting to a given endpoint.
512        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
513        where
514            D: TryInto<tonic::transport::Endpoint>,
515            D::Error: Into<StdError>,
516        {
517            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
518            Ok(Self::new(conn))
519        }
520    }
521    impl<T> ActionServiceClient<T>
522    where
523        T: tonic::client::GrpcService<tonic::body::Body>,
524        T::Error: Into<StdError>,
525        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
526        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
527    {
528        pub fn new(inner: T) -> Self {
529            let inner = tonic::client::Grpc::new(inner);
530            Self { inner }
531        }
532        pub fn with_origin(inner: T, origin: Uri) -> Self {
533            let inner = tonic::client::Grpc::with_origin(inner, origin);
534            Self { inner }
535        }
536        pub fn with_interceptor<F>(
537            inner: T,
538            interceptor: F,
539        ) -> ActionServiceClient<InterceptedService<T, F>>
540        where
541            F: tonic::service::Interceptor,
542            T::ResponseBody: Default,
543            T: tonic::codegen::Service<
544                http::Request<tonic::body::Body>,
545                Response = http::Response<
546                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
547                >,
548            >,
549            <T as tonic::codegen::Service<
550                http::Request<tonic::body::Body>,
551            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
552        {
553            ActionServiceClient::new(InterceptedService::new(inner, interceptor))
554        }
555        /// Compress requests with the given encoding.
556        ///
557        /// This requires the server to support it otherwise it might respond with an
558        /// error.
559        #[must_use]
560        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
561            self.inner = self.inner.send_compressed(encoding);
562            self
563        }
564        /// Enable decompressing responses.
565        #[must_use]
566        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
567            self.inner = self.inner.accept_compressed(encoding);
568            self
569        }
570        /// Limits the maximum size of a decoded message.
571        ///
572        /// Default: `4MB`
573        #[must_use]
574        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
575            self.inner = self.inner.max_decoding_message_size(limit);
576            self
577        }
578        /// Limits the maximum size of an encoded message.
579        ///
580        /// Default: `usize::MAX`
581        #[must_use]
582        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
583            self.inner = self.inner.max_encoding_message_size(limit);
584            self
585        }
586        /** Submit an action for a specific delivery, advancing the campaign workflow.
587 Backend MUST verify the authenticated user is the delivery recipient.
588*/
589        pub async fn submit_action(
590            &mut self,
591            request: impl tonic::IntoRequest<super::SubmitActionRequest>,
592        ) -> std::result::Result<
593            tonic::Response<super::SubmitActionResponse>,
594            tonic::Status,
595        > {
596            self.inner
597                .ready()
598                .await
599                .map_err(|e| {
600                    tonic::Status::unknown(
601                        format!("Service was not ready: {}", e.into()),
602                    )
603                })?;
604            let codec = tonic_prost::ProstCodec::default();
605            let path = http::uri::PathAndQuery::from_static(
606                "/pidgr.v1.ActionService/SubmitAction",
607            );
608            let mut req = request.into_request();
609            req.extensions_mut()
610                .insert(GrpcMethod::new("pidgr.v1.ActionService", "SubmitAction"));
611            self.inner.unary(req, path, codec).await
612        }
613    }
614}
615/// Generated server implementations.
616pub mod action_service_server {
617    #![allow(
618        unused_variables,
619        dead_code,
620        missing_docs,
621        clippy::wildcard_imports,
622        clippy::let_unit_value,
623    )]
624    use tonic::codegen::*;
625    /// Generated trait containing gRPC methods that should be implemented for use with ActionServiceServer.
626    #[async_trait]
627    pub trait ActionService: std::marker::Send + std::marker::Sync + 'static {
628        /** Submit an action for a specific delivery, advancing the campaign workflow.
629 Backend MUST verify the authenticated user is the delivery recipient.
630*/
631        async fn submit_action(
632            &self,
633            request: tonic::Request<super::SubmitActionRequest>,
634        ) -> std::result::Result<
635            tonic::Response<super::SubmitActionResponse>,
636            tonic::Status,
637        >;
638    }
639    /** Handles user actions on delivered messages.
640 Actions drive workflow progression (e.g. ACK completes a wait step).
641*/
642    #[derive(Debug)]
643    pub struct ActionServiceServer<T> {
644        inner: Arc<T>,
645        accept_compression_encodings: EnabledCompressionEncodings,
646        send_compression_encodings: EnabledCompressionEncodings,
647        max_decoding_message_size: Option<usize>,
648        max_encoding_message_size: Option<usize>,
649    }
650    impl<T> ActionServiceServer<T> {
651        pub fn new(inner: T) -> Self {
652            Self::from_arc(Arc::new(inner))
653        }
654        pub fn from_arc(inner: Arc<T>) -> Self {
655            Self {
656                inner,
657                accept_compression_encodings: Default::default(),
658                send_compression_encodings: Default::default(),
659                max_decoding_message_size: None,
660                max_encoding_message_size: None,
661            }
662        }
663        pub fn with_interceptor<F>(
664            inner: T,
665            interceptor: F,
666        ) -> InterceptedService<Self, F>
667        where
668            F: tonic::service::Interceptor,
669        {
670            InterceptedService::new(Self::new(inner), interceptor)
671        }
672        /// Enable decompressing requests with the given encoding.
673        #[must_use]
674        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
675            self.accept_compression_encodings.enable(encoding);
676            self
677        }
678        /// Compress responses with the given encoding, if the client supports it.
679        #[must_use]
680        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
681            self.send_compression_encodings.enable(encoding);
682            self
683        }
684        /// Limits the maximum size of a decoded message.
685        ///
686        /// Default: `4MB`
687        #[must_use]
688        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
689            self.max_decoding_message_size = Some(limit);
690            self
691        }
692        /// Limits the maximum size of an encoded message.
693        ///
694        /// Default: `usize::MAX`
695        #[must_use]
696        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
697            self.max_encoding_message_size = Some(limit);
698            self
699        }
700    }
701    impl<T, B> tonic::codegen::Service<http::Request<B>> for ActionServiceServer<T>
702    where
703        T: ActionService,
704        B: Body + std::marker::Send + 'static,
705        B::Error: Into<StdError> + std::marker::Send + 'static,
706    {
707        type Response = http::Response<tonic::body::Body>;
708        type Error = std::convert::Infallible;
709        type Future = BoxFuture<Self::Response, Self::Error>;
710        fn poll_ready(
711            &mut self,
712            _cx: &mut Context<'_>,
713        ) -> Poll<std::result::Result<(), Self::Error>> {
714            Poll::Ready(Ok(()))
715        }
716        fn call(&mut self, req: http::Request<B>) -> Self::Future {
717            match req.uri().path() {
718                "/pidgr.v1.ActionService/SubmitAction" => {
719                    #[allow(non_camel_case_types)]
720                    struct SubmitActionSvc<T: ActionService>(pub Arc<T>);
721                    impl<
722                        T: ActionService,
723                    > tonic::server::UnaryService<super::SubmitActionRequest>
724                    for SubmitActionSvc<T> {
725                        type Response = super::SubmitActionResponse;
726                        type Future = BoxFuture<
727                            tonic::Response<Self::Response>,
728                            tonic::Status,
729                        >;
730                        fn call(
731                            &mut self,
732                            request: tonic::Request<super::SubmitActionRequest>,
733                        ) -> Self::Future {
734                            let inner = Arc::clone(&self.0);
735                            let fut = async move {
736                                <T as ActionService>::submit_action(&inner, request).await
737                            };
738                            Box::pin(fut)
739                        }
740                    }
741                    let accept_compression_encodings = self.accept_compression_encodings;
742                    let send_compression_encodings = self.send_compression_encodings;
743                    let max_decoding_message_size = self.max_decoding_message_size;
744                    let max_encoding_message_size = self.max_encoding_message_size;
745                    let inner = self.inner.clone();
746                    let fut = async move {
747                        let method = SubmitActionSvc(inner);
748                        let codec = tonic_prost::ProstCodec::default();
749                        let mut grpc = tonic::server::Grpc::new(codec)
750                            .apply_compression_config(
751                                accept_compression_encodings,
752                                send_compression_encodings,
753                            )
754                            .apply_max_message_size_config(
755                                max_decoding_message_size,
756                                max_encoding_message_size,
757                            );
758                        let res = grpc.unary(method, req).await;
759                        Ok(res)
760                    };
761                    Box::pin(fut)
762                }
763                _ => {
764                    Box::pin(async move {
765                        let mut response = http::Response::new(
766                            tonic::body::Body::default(),
767                        );
768                        let headers = response.headers_mut();
769                        headers
770                            .insert(
771                                tonic::Status::GRPC_STATUS,
772                                (tonic::Code::Unimplemented as i32).into(),
773                            );
774                        headers
775                            .insert(
776                                http::header::CONTENT_TYPE,
777                                tonic::metadata::GRPC_CONTENT_TYPE,
778                            );
779                        Ok(response)
780                    })
781                }
782            }
783        }
784    }
785    impl<T> Clone for ActionServiceServer<T> {
786        fn clone(&self) -> Self {
787            let inner = self.inner.clone();
788            Self {
789                inner,
790                accept_compression_encodings: self.accept_compression_encodings,
791                send_compression_encodings: self.send_compression_encodings,
792                max_decoding_message_size: self.max_decoding_message_size,
793                max_encoding_message_size: self.max_encoding_message_size,
794            }
795        }
796    }
797    /// Generated gRPC service name
798    pub const SERVICE_NAME: &str = "pidgr.v1.ActionService";
799    impl<T> tonic::server::NamedService for ActionServiceServer<T> {
800        const NAME: &'static str = SERVICE_NAME;
801    }
802}
803/// Generated client implementations.
804pub mod api_key_service_client {
805    #![allow(
806        unused_variables,
807        dead_code,
808        missing_docs,
809        clippy::wildcard_imports,
810        clippy::let_unit_value,
811    )]
812    use tonic::codegen::*;
813    use tonic::codegen::http::Uri;
814    /** Manages scoped API keys for programmatic access.
815 All RPCs operate within the caller's org (extracted from JWT).
816*/
817    #[derive(Debug, Clone)]
818    pub struct ApiKeyServiceClient<T> {
819        inner: tonic::client::Grpc<T>,
820    }
821    impl ApiKeyServiceClient<tonic::transport::Channel> {
822        /// Attempt to create a new client by connecting to a given endpoint.
823        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
824        where
825            D: TryInto<tonic::transport::Endpoint>,
826            D::Error: Into<StdError>,
827        {
828            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
829            Ok(Self::new(conn))
830        }
831    }
832    impl<T> ApiKeyServiceClient<T>
833    where
834        T: tonic::client::GrpcService<tonic::body::Body>,
835        T::Error: Into<StdError>,
836        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
837        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
838    {
839        pub fn new(inner: T) -> Self {
840            let inner = tonic::client::Grpc::new(inner);
841            Self { inner }
842        }
843        pub fn with_origin(inner: T, origin: Uri) -> Self {
844            let inner = tonic::client::Grpc::with_origin(inner, origin);
845            Self { inner }
846        }
847        pub fn with_interceptor<F>(
848            inner: T,
849            interceptor: F,
850        ) -> ApiKeyServiceClient<InterceptedService<T, F>>
851        where
852            F: tonic::service::Interceptor,
853            T::ResponseBody: Default,
854            T: tonic::codegen::Service<
855                http::Request<tonic::body::Body>,
856                Response = http::Response<
857                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
858                >,
859            >,
860            <T as tonic::codegen::Service<
861                http::Request<tonic::body::Body>,
862            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
863        {
864            ApiKeyServiceClient::new(InterceptedService::new(inner, interceptor))
865        }
866        /// Compress requests with the given encoding.
867        ///
868        /// This requires the server to support it otherwise it might respond with an
869        /// error.
870        #[must_use]
871        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
872            self.inner = self.inner.send_compressed(encoding);
873            self
874        }
875        /// Enable decompressing responses.
876        #[must_use]
877        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
878            self.inner = self.inner.accept_compressed(encoding);
879            self
880        }
881        /// Limits the maximum size of a decoded message.
882        ///
883        /// Default: `4MB`
884        #[must_use]
885        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
886            self.inner = self.inner.max_decoding_message_size(limit);
887            self
888        }
889        /// Limits the maximum size of an encoded message.
890        ///
891        /// Default: `usize::MAX`
892        #[must_use]
893        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
894            self.inner = self.inner.max_encoding_message_size(limit);
895            self
896        }
897        /** Create a new scoped API key with specific permissions.
898 The full secret key is only returned in the response — store it securely.
899 Authorization: Requires PERMISSION_ORG_WRITE.
900*/
901        pub async fn create_api_key(
902            &mut self,
903            request: impl tonic::IntoRequest<super::CreateApiKeyRequest>,
904        ) -> std::result::Result<
905            tonic::Response<super::CreateApiKeyResponse>,
906            tonic::Status,
907        > {
908            self.inner
909                .ready()
910                .await
911                .map_err(|e| {
912                    tonic::Status::unknown(
913                        format!("Service was not ready: {}", e.into()),
914                    )
915                })?;
916            let codec = tonic_prost::ProstCodec::default();
917            let path = http::uri::PathAndQuery::from_static(
918                "/pidgr.v1.ApiKeyService/CreateApiKey",
919            );
920            let mut req = request.into_request();
921            req.extensions_mut()
922                .insert(GrpcMethod::new("pidgr.v1.ApiKeyService", "CreateApiKey"));
923            self.inner.unary(req, path, codec).await
924        }
925        /** List all active API keys in the organization (metadata only, no secrets).
926 Authorization: Requires PERMISSION_ORG_READ.
927*/
928        pub async fn list_api_keys(
929            &mut self,
930            request: impl tonic::IntoRequest<super::ListApiKeysRequest>,
931        ) -> std::result::Result<
932            tonic::Response<super::ListApiKeysResponse>,
933            tonic::Status,
934        > {
935            self.inner
936                .ready()
937                .await
938                .map_err(|e| {
939                    tonic::Status::unknown(
940                        format!("Service was not ready: {}", e.into()),
941                    )
942                })?;
943            let codec = tonic_prost::ProstCodec::default();
944            let path = http::uri::PathAndQuery::from_static(
945                "/pidgr.v1.ApiKeyService/ListApiKeys",
946            );
947            let mut req = request.into_request();
948            req.extensions_mut()
949                .insert(GrpcMethod::new("pidgr.v1.ApiKeyService", "ListApiKeys"));
950            self.inner.unary(req, path, codec).await
951        }
952        /** Revoke an API key. The key becomes immediately unusable.
953 Authorization: Requires PERMISSION_ORG_WRITE.
954*/
955        pub async fn revoke_api_key(
956            &mut self,
957            request: impl tonic::IntoRequest<super::RevokeApiKeyRequest>,
958        ) -> std::result::Result<
959            tonic::Response<super::RevokeApiKeyResponse>,
960            tonic::Status,
961        > {
962            self.inner
963                .ready()
964                .await
965                .map_err(|e| {
966                    tonic::Status::unknown(
967                        format!("Service was not ready: {}", e.into()),
968                    )
969                })?;
970            let codec = tonic_prost::ProstCodec::default();
971            let path = http::uri::PathAndQuery::from_static(
972                "/pidgr.v1.ApiKeyService/RevokeApiKey",
973            );
974            let mut req = request.into_request();
975            req.extensions_mut()
976                .insert(GrpcMethod::new("pidgr.v1.ApiKeyService", "RevokeApiKey"));
977            self.inner.unary(req, path, codec).await
978        }
979    }
980}
981/// Generated server implementations.
982pub mod api_key_service_server {
983    #![allow(
984        unused_variables,
985        dead_code,
986        missing_docs,
987        clippy::wildcard_imports,
988        clippy::let_unit_value,
989    )]
990    use tonic::codegen::*;
991    /// Generated trait containing gRPC methods that should be implemented for use with ApiKeyServiceServer.
992    #[async_trait]
993    pub trait ApiKeyService: std::marker::Send + std::marker::Sync + 'static {
994        /** Create a new scoped API key with specific permissions.
995 The full secret key is only returned in the response — store it securely.
996 Authorization: Requires PERMISSION_ORG_WRITE.
997*/
998        async fn create_api_key(
999            &self,
1000            request: tonic::Request<super::CreateApiKeyRequest>,
1001        ) -> std::result::Result<
1002            tonic::Response<super::CreateApiKeyResponse>,
1003            tonic::Status,
1004        >;
1005        /** List all active API keys in the organization (metadata only, no secrets).
1006 Authorization: Requires PERMISSION_ORG_READ.
1007*/
1008        async fn list_api_keys(
1009            &self,
1010            request: tonic::Request<super::ListApiKeysRequest>,
1011        ) -> std::result::Result<
1012            tonic::Response<super::ListApiKeysResponse>,
1013            tonic::Status,
1014        >;
1015        /** Revoke an API key. The key becomes immediately unusable.
1016 Authorization: Requires PERMISSION_ORG_WRITE.
1017*/
1018        async fn revoke_api_key(
1019            &self,
1020            request: tonic::Request<super::RevokeApiKeyRequest>,
1021        ) -> std::result::Result<
1022            tonic::Response<super::RevokeApiKeyResponse>,
1023            tonic::Status,
1024        >;
1025    }
1026    /** Manages scoped API keys for programmatic access.
1027 All RPCs operate within the caller's org (extracted from JWT).
1028*/
1029    #[derive(Debug)]
1030    pub struct ApiKeyServiceServer<T> {
1031        inner: Arc<T>,
1032        accept_compression_encodings: EnabledCompressionEncodings,
1033        send_compression_encodings: EnabledCompressionEncodings,
1034        max_decoding_message_size: Option<usize>,
1035        max_encoding_message_size: Option<usize>,
1036    }
1037    impl<T> ApiKeyServiceServer<T> {
1038        pub fn new(inner: T) -> Self {
1039            Self::from_arc(Arc::new(inner))
1040        }
1041        pub fn from_arc(inner: Arc<T>) -> Self {
1042            Self {
1043                inner,
1044                accept_compression_encodings: Default::default(),
1045                send_compression_encodings: Default::default(),
1046                max_decoding_message_size: None,
1047                max_encoding_message_size: None,
1048            }
1049        }
1050        pub fn with_interceptor<F>(
1051            inner: T,
1052            interceptor: F,
1053        ) -> InterceptedService<Self, F>
1054        where
1055            F: tonic::service::Interceptor,
1056        {
1057            InterceptedService::new(Self::new(inner), interceptor)
1058        }
1059        /// Enable decompressing requests with the given encoding.
1060        #[must_use]
1061        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1062            self.accept_compression_encodings.enable(encoding);
1063            self
1064        }
1065        /// Compress responses with the given encoding, if the client supports it.
1066        #[must_use]
1067        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1068            self.send_compression_encodings.enable(encoding);
1069            self
1070        }
1071        /// Limits the maximum size of a decoded message.
1072        ///
1073        /// Default: `4MB`
1074        #[must_use]
1075        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1076            self.max_decoding_message_size = Some(limit);
1077            self
1078        }
1079        /// Limits the maximum size of an encoded message.
1080        ///
1081        /// Default: `usize::MAX`
1082        #[must_use]
1083        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1084            self.max_encoding_message_size = Some(limit);
1085            self
1086        }
1087    }
1088    impl<T, B> tonic::codegen::Service<http::Request<B>> for ApiKeyServiceServer<T>
1089    where
1090        T: ApiKeyService,
1091        B: Body + std::marker::Send + 'static,
1092        B::Error: Into<StdError> + std::marker::Send + 'static,
1093    {
1094        type Response = http::Response<tonic::body::Body>;
1095        type Error = std::convert::Infallible;
1096        type Future = BoxFuture<Self::Response, Self::Error>;
1097        fn poll_ready(
1098            &mut self,
1099            _cx: &mut Context<'_>,
1100        ) -> Poll<std::result::Result<(), Self::Error>> {
1101            Poll::Ready(Ok(()))
1102        }
1103        fn call(&mut self, req: http::Request<B>) -> Self::Future {
1104            match req.uri().path() {
1105                "/pidgr.v1.ApiKeyService/CreateApiKey" => {
1106                    #[allow(non_camel_case_types)]
1107                    struct CreateApiKeySvc<T: ApiKeyService>(pub Arc<T>);
1108                    impl<
1109                        T: ApiKeyService,
1110                    > tonic::server::UnaryService<super::CreateApiKeyRequest>
1111                    for CreateApiKeySvc<T> {
1112                        type Response = super::CreateApiKeyResponse;
1113                        type Future = BoxFuture<
1114                            tonic::Response<Self::Response>,
1115                            tonic::Status,
1116                        >;
1117                        fn call(
1118                            &mut self,
1119                            request: tonic::Request<super::CreateApiKeyRequest>,
1120                        ) -> Self::Future {
1121                            let inner = Arc::clone(&self.0);
1122                            let fut = async move {
1123                                <T as ApiKeyService>::create_api_key(&inner, request).await
1124                            };
1125                            Box::pin(fut)
1126                        }
1127                    }
1128                    let accept_compression_encodings = self.accept_compression_encodings;
1129                    let send_compression_encodings = self.send_compression_encodings;
1130                    let max_decoding_message_size = self.max_decoding_message_size;
1131                    let max_encoding_message_size = self.max_encoding_message_size;
1132                    let inner = self.inner.clone();
1133                    let fut = async move {
1134                        let method = CreateApiKeySvc(inner);
1135                        let codec = tonic_prost::ProstCodec::default();
1136                        let mut grpc = tonic::server::Grpc::new(codec)
1137                            .apply_compression_config(
1138                                accept_compression_encodings,
1139                                send_compression_encodings,
1140                            )
1141                            .apply_max_message_size_config(
1142                                max_decoding_message_size,
1143                                max_encoding_message_size,
1144                            );
1145                        let res = grpc.unary(method, req).await;
1146                        Ok(res)
1147                    };
1148                    Box::pin(fut)
1149                }
1150                "/pidgr.v1.ApiKeyService/ListApiKeys" => {
1151                    #[allow(non_camel_case_types)]
1152                    struct ListApiKeysSvc<T: ApiKeyService>(pub Arc<T>);
1153                    impl<
1154                        T: ApiKeyService,
1155                    > tonic::server::UnaryService<super::ListApiKeysRequest>
1156                    for ListApiKeysSvc<T> {
1157                        type Response = super::ListApiKeysResponse;
1158                        type Future = BoxFuture<
1159                            tonic::Response<Self::Response>,
1160                            tonic::Status,
1161                        >;
1162                        fn call(
1163                            &mut self,
1164                            request: tonic::Request<super::ListApiKeysRequest>,
1165                        ) -> Self::Future {
1166                            let inner = Arc::clone(&self.0);
1167                            let fut = async move {
1168                                <T as ApiKeyService>::list_api_keys(&inner, request).await
1169                            };
1170                            Box::pin(fut)
1171                        }
1172                    }
1173                    let accept_compression_encodings = self.accept_compression_encodings;
1174                    let send_compression_encodings = self.send_compression_encodings;
1175                    let max_decoding_message_size = self.max_decoding_message_size;
1176                    let max_encoding_message_size = self.max_encoding_message_size;
1177                    let inner = self.inner.clone();
1178                    let fut = async move {
1179                        let method = ListApiKeysSvc(inner);
1180                        let codec = tonic_prost::ProstCodec::default();
1181                        let mut grpc = tonic::server::Grpc::new(codec)
1182                            .apply_compression_config(
1183                                accept_compression_encodings,
1184                                send_compression_encodings,
1185                            )
1186                            .apply_max_message_size_config(
1187                                max_decoding_message_size,
1188                                max_encoding_message_size,
1189                            );
1190                        let res = grpc.unary(method, req).await;
1191                        Ok(res)
1192                    };
1193                    Box::pin(fut)
1194                }
1195                "/pidgr.v1.ApiKeyService/RevokeApiKey" => {
1196                    #[allow(non_camel_case_types)]
1197                    struct RevokeApiKeySvc<T: ApiKeyService>(pub Arc<T>);
1198                    impl<
1199                        T: ApiKeyService,
1200                    > tonic::server::UnaryService<super::RevokeApiKeyRequest>
1201                    for RevokeApiKeySvc<T> {
1202                        type Response = super::RevokeApiKeyResponse;
1203                        type Future = BoxFuture<
1204                            tonic::Response<Self::Response>,
1205                            tonic::Status,
1206                        >;
1207                        fn call(
1208                            &mut self,
1209                            request: tonic::Request<super::RevokeApiKeyRequest>,
1210                        ) -> Self::Future {
1211                            let inner = Arc::clone(&self.0);
1212                            let fut = async move {
1213                                <T as ApiKeyService>::revoke_api_key(&inner, request).await
1214                            };
1215                            Box::pin(fut)
1216                        }
1217                    }
1218                    let accept_compression_encodings = self.accept_compression_encodings;
1219                    let send_compression_encodings = self.send_compression_encodings;
1220                    let max_decoding_message_size = self.max_decoding_message_size;
1221                    let max_encoding_message_size = self.max_encoding_message_size;
1222                    let inner = self.inner.clone();
1223                    let fut = async move {
1224                        let method = RevokeApiKeySvc(inner);
1225                        let codec = tonic_prost::ProstCodec::default();
1226                        let mut grpc = tonic::server::Grpc::new(codec)
1227                            .apply_compression_config(
1228                                accept_compression_encodings,
1229                                send_compression_encodings,
1230                            )
1231                            .apply_max_message_size_config(
1232                                max_decoding_message_size,
1233                                max_encoding_message_size,
1234                            );
1235                        let res = grpc.unary(method, req).await;
1236                        Ok(res)
1237                    };
1238                    Box::pin(fut)
1239                }
1240                _ => {
1241                    Box::pin(async move {
1242                        let mut response = http::Response::new(
1243                            tonic::body::Body::default(),
1244                        );
1245                        let headers = response.headers_mut();
1246                        headers
1247                            .insert(
1248                                tonic::Status::GRPC_STATUS,
1249                                (tonic::Code::Unimplemented as i32).into(),
1250                            );
1251                        headers
1252                            .insert(
1253                                http::header::CONTENT_TYPE,
1254                                tonic::metadata::GRPC_CONTENT_TYPE,
1255                            );
1256                        Ok(response)
1257                    })
1258                }
1259            }
1260        }
1261    }
1262    impl<T> Clone for ApiKeyServiceServer<T> {
1263        fn clone(&self) -> Self {
1264            let inner = self.inner.clone();
1265            Self {
1266                inner,
1267                accept_compression_encodings: self.accept_compression_encodings,
1268                send_compression_encodings: self.send_compression_encodings,
1269                max_decoding_message_size: self.max_decoding_message_size,
1270                max_encoding_message_size: self.max_encoding_message_size,
1271            }
1272        }
1273    }
1274    /// Generated gRPC service name
1275    pub const SERVICE_NAME: &str = "pidgr.v1.ApiKeyService";
1276    impl<T> tonic::server::NamedService for ApiKeyServiceServer<T> {
1277        const NAME: &'static str = SERVICE_NAME;
1278    }
1279}
1280/// Generated client implementations.
1281pub mod privacy_service_client {
1282    #![allow(
1283        unused_variables,
1284        dead_code,
1285        missing_docs,
1286        clippy::wildcard_imports,
1287        clippy::let_unit_value,
1288    )]
1289    use tonic::codegen::*;
1290    use tonic::codegen::http::Uri;
1291    /** PrivacyService handles GDPR/LGPD data subject rights.
1292 All RPCs extract org_id from the JWT — it is never in request messages.
1293*/
1294    #[derive(Debug, Clone)]
1295    pub struct PrivacyServiceClient<T> {
1296        inner: tonic::client::Grpc<T>,
1297    }
1298    impl PrivacyServiceClient<tonic::transport::Channel> {
1299        /// Attempt to create a new client by connecting to a given endpoint.
1300        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1301        where
1302            D: TryInto<tonic::transport::Endpoint>,
1303            D::Error: Into<StdError>,
1304        {
1305            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1306            Ok(Self::new(conn))
1307        }
1308    }
1309    impl<T> PrivacyServiceClient<T>
1310    where
1311        T: tonic::client::GrpcService<tonic::body::Body>,
1312        T::Error: Into<StdError>,
1313        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1314        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1315    {
1316        pub fn new(inner: T) -> Self {
1317            let inner = tonic::client::Grpc::new(inner);
1318            Self { inner }
1319        }
1320        pub fn with_origin(inner: T, origin: Uri) -> Self {
1321            let inner = tonic::client::Grpc::with_origin(inner, origin);
1322            Self { inner }
1323        }
1324        pub fn with_interceptor<F>(
1325            inner: T,
1326            interceptor: F,
1327        ) -> PrivacyServiceClient<InterceptedService<T, F>>
1328        where
1329            F: tonic::service::Interceptor,
1330            T::ResponseBody: Default,
1331            T: tonic::codegen::Service<
1332                http::Request<tonic::body::Body>,
1333                Response = http::Response<
1334                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
1335                >,
1336            >,
1337            <T as tonic::codegen::Service<
1338                http::Request<tonic::body::Body>,
1339            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1340        {
1341            PrivacyServiceClient::new(InterceptedService::new(inner, interceptor))
1342        }
1343        /// Compress requests with the given encoding.
1344        ///
1345        /// This requires the server to support it otherwise it might respond with an
1346        /// error.
1347        #[must_use]
1348        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1349            self.inner = self.inner.send_compressed(encoding);
1350            self
1351        }
1352        /// Enable decompressing responses.
1353        #[must_use]
1354        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1355            self.inner = self.inner.accept_compressed(encoding);
1356            self
1357        }
1358        /// Limits the maximum size of a decoded message.
1359        ///
1360        /// Default: `4MB`
1361        #[must_use]
1362        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1363            self.inner = self.inner.max_decoding_message_size(limit);
1364            self
1365        }
1366        /// Limits the maximum size of an encoded message.
1367        ///
1368        /// Default: `usize::MAX`
1369        #[must_use]
1370        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1371            self.inner = self.inner.max_encoding_message_size(limit);
1372            self
1373        }
1374        /** Export all personal data associated with a user as a downloadable ZIP.
1375 Async operation — returns immediately with PENDING status, sends push
1376 notification when the export is ready.
1377 Auth: Requires JWT. Callable by the user themselves or an org admin.
1378*/
1379        pub async fn export_user_data(
1380            &mut self,
1381            request: impl tonic::IntoRequest<super::ExportUserDataRequest>,
1382        ) -> std::result::Result<
1383            tonic::Response<super::ExportUserDataResponse>,
1384            tonic::Status,
1385        > {
1386            self.inner
1387                .ready()
1388                .await
1389                .map_err(|e| {
1390                    tonic::Status::unknown(
1391                        format!("Service was not ready: {}", e.into()),
1392                    )
1393                })?;
1394            let codec = tonic_prost::ProstCodec::default();
1395            let path = http::uri::PathAndQuery::from_static(
1396                "/pidgr.v1.PrivacyService/ExportUserData",
1397            );
1398            let mut req = request.into_request();
1399            req.extensions_mut()
1400                .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "ExportUserData"));
1401            self.inner.unary(req, path, codec).await
1402        }
1403        /** Delete or anonymize all personal data associated with a user.
1404 Deletion has a 30-day grace period during which processing is restricted
1405 and the request can be cancelled. After 30 days, deletion is irreversible.
1406 Auth: Requires JWT. Admin only.
1407*/
1408        pub async fn delete_user_data(
1409            &mut self,
1410            request: impl tonic::IntoRequest<super::DeleteUserDataRequest>,
1411        ) -> std::result::Result<
1412            tonic::Response<super::DeleteUserDataResponse>,
1413            tonic::Status,
1414        > {
1415            self.inner
1416                .ready()
1417                .await
1418                .map_err(|e| {
1419                    tonic::Status::unknown(
1420                        format!("Service was not ready: {}", e.into()),
1421                    )
1422                })?;
1423            let codec = tonic_prost::ProstCodec::default();
1424            let path = http::uri::PathAndQuery::from_static(
1425                "/pidgr.v1.PrivacyService/DeleteUserData",
1426            );
1427            let mut req = request.into_request();
1428            req.extensions_mut()
1429                .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "DeleteUserData"));
1430            self.inner.unary(req, path, codec).await
1431        }
1432        /** Correct personal data for a user. Propagates corrections to all stored
1433 locations (profile, delivery records, analytics metadata).
1434 Auth: Requires JWT. Callable by the user themselves or an org admin.
1435*/
1436        pub async fn rectify_user_data(
1437            &mut self,
1438            request: impl tonic::IntoRequest<super::RectifyUserDataRequest>,
1439        ) -> std::result::Result<
1440            tonic::Response<super::RectifyUserDataResponse>,
1441            tonic::Status,
1442        > {
1443            self.inner
1444                .ready()
1445                .await
1446                .map_err(|e| {
1447                    tonic::Status::unknown(
1448                        format!("Service was not ready: {}", e.into()),
1449                    )
1450                })?;
1451            let codec = tonic_prost::ProstCodec::default();
1452            let path = http::uri::PathAndQuery::from_static(
1453                "/pidgr.v1.PrivacyService/RectifyUserData",
1454            );
1455            let mut req = request.into_request();
1456            req.extensions_mut()
1457                .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "RectifyUserData"));
1458            self.inner.unary(req, path, codec).await
1459        }
1460        /** Restrict or unrestrict processing for a user. When restricted, the API
1461 skips this user in campaigns, analytics, and session replay.
1462 Auth: Requires JWT. Admin only.
1463*/
1464        pub async fn restrict_processing(
1465            &mut self,
1466            request: impl tonic::IntoRequest<super::RestrictProcessingRequest>,
1467        ) -> std::result::Result<
1468            tonic::Response<super::RestrictProcessingResponse>,
1469            tonic::Status,
1470        > {
1471            self.inner
1472                .ready()
1473                .await
1474                .map_err(|e| {
1475                    tonic::Status::unknown(
1476                        format!("Service was not ready: {}", e.into()),
1477                    )
1478                })?;
1479            let codec = tonic_prost::ProstCodec::default();
1480            let path = http::uri::PathAndQuery::from_static(
1481                "/pidgr.v1.PrivacyService/RestrictProcessing",
1482            );
1483            let mut req = request.into_request();
1484            req.extensions_mut()
1485                .insert(
1486                    GrpcMethod::new("pidgr.v1.PrivacyService", "RestrictProcessing"),
1487                );
1488            self.inner.unary(req, path, codec).await
1489        }
1490        /** Confirm whether personal data exists for a user and list data categories.
1491 LGPD-specific: confirmação de existência (Art. 18, I).
1492 Auth: Requires JWT. Admin only.
1493*/
1494        pub async fn get_data_existence_confirmation(
1495            &mut self,
1496            request: impl tonic::IntoRequest<super::GetDataExistenceConfirmationRequest>,
1497        ) -> std::result::Result<
1498            tonic::Response<super::GetDataExistenceConfirmationResponse>,
1499            tonic::Status,
1500        > {
1501            self.inner
1502                .ready()
1503                .await
1504                .map_err(|e| {
1505                    tonic::Status::unknown(
1506                        format!("Service was not ready: {}", e.into()),
1507                    )
1508                })?;
1509            let codec = tonic_prost::ProstCodec::default();
1510            let path = http::uri::PathAndQuery::from_static(
1511                "/pidgr.v1.PrivacyService/GetDataExistenceConfirmation",
1512            );
1513            let mut req = request.into_request();
1514            req.extensions_mut()
1515                .insert(
1516                    GrpcMethod::new(
1517                        "pidgr.v1.PrivacyService",
1518                        "GetDataExistenceConfirmation",
1519                    ),
1520                );
1521            self.inner.unary(req, path, codec).await
1522        }
1523        /** List privacy requests for the organization, with optional filters.
1524 Used by the admin UI to show scheduled deletions table.
1525 Auth: Requires JWT. Admin only.
1526*/
1527        pub async fn list_privacy_requests(
1528            &mut self,
1529            request: impl tonic::IntoRequest<super::ListPrivacyRequestsRequest>,
1530        ) -> std::result::Result<
1531            tonic::Response<super::ListPrivacyRequestsResponse>,
1532            tonic::Status,
1533        > {
1534            self.inner
1535                .ready()
1536                .await
1537                .map_err(|e| {
1538                    tonic::Status::unknown(
1539                        format!("Service was not ready: {}", e.into()),
1540                    )
1541                })?;
1542            let codec = tonic_prost::ProstCodec::default();
1543            let path = http::uri::PathAndQuery::from_static(
1544                "/pidgr.v1.PrivacyService/ListPrivacyRequests",
1545            );
1546            let mut req = request.into_request();
1547            req.extensions_mut()
1548                .insert(
1549                    GrpcMethod::new("pidgr.v1.PrivacyService", "ListPrivacyRequests"),
1550                );
1551            self.inner.unary(req, path, codec).await
1552        }
1553        /** Cancel a pending deletion request. Reactivates the user and aborts
1554 the deletion workflow. Only valid during the 30-day grace period.
1555 Auth: Requires JWT. Admin only.
1556*/
1557        pub async fn cancel_deletion(
1558            &mut self,
1559            request: impl tonic::IntoRequest<super::CancelDeletionRequest>,
1560        ) -> std::result::Result<
1561            tonic::Response<super::CancelDeletionResponse>,
1562            tonic::Status,
1563        > {
1564            self.inner
1565                .ready()
1566                .await
1567                .map_err(|e| {
1568                    tonic::Status::unknown(
1569                        format!("Service was not ready: {}", e.into()),
1570                    )
1571                })?;
1572            let codec = tonic_prost::ProstCodec::default();
1573            let path = http::uri::PathAndQuery::from_static(
1574                "/pidgr.v1.PrivacyService/CancelDeletion",
1575            );
1576            let mut req = request.into_request();
1577            req.extensions_mut()
1578                .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "CancelDeletion"));
1579            self.inner.unary(req, path, codec).await
1580        }
1581        /** Skip the grace period and delete immediately. Signals the deletion
1582 workflow to proceed without waiting for the 30-day timer.
1583 Auth: Requires JWT. Admin only.
1584*/
1585        pub async fn immediate_delete(
1586            &mut self,
1587            request: impl tonic::IntoRequest<super::ImmediateDeleteRequest>,
1588        ) -> std::result::Result<
1589            tonic::Response<super::ImmediateDeleteResponse>,
1590            tonic::Status,
1591        > {
1592            self.inner
1593                .ready()
1594                .await
1595                .map_err(|e| {
1596                    tonic::Status::unknown(
1597                        format!("Service was not ready: {}", e.into()),
1598                    )
1599                })?;
1600            let codec = tonic_prost::ProstCodec::default();
1601            let path = http::uri::PathAndQuery::from_static(
1602                "/pidgr.v1.PrivacyService/ImmediateDelete",
1603            );
1604            let mut req = request.into_request();
1605            req.extensions_mut()
1606                .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "ImmediateDelete"));
1607            self.inner.unary(req, path, codec).await
1608        }
1609        /** List the calling user's own privacy requests (export, rectify).
1610 The server extracts user_id from the JWT — no admin permission required.
1611 Auth: Requires JWT. Any authenticated user.
1612*/
1613        pub async fn list_my_privacy_requests(
1614            &mut self,
1615            request: impl tonic::IntoRequest<super::ListMyPrivacyRequestsRequest>,
1616        ) -> std::result::Result<
1617            tonic::Response<super::ListMyPrivacyRequestsResponse>,
1618            tonic::Status,
1619        > {
1620            self.inner
1621                .ready()
1622                .await
1623                .map_err(|e| {
1624                    tonic::Status::unknown(
1625                        format!("Service was not ready: {}", e.into()),
1626                    )
1627                })?;
1628            let codec = tonic_prost::ProstCodec::default();
1629            let path = http::uri::PathAndQuery::from_static(
1630                "/pidgr.v1.PrivacyService/ListMyPrivacyRequests",
1631            );
1632            let mut req = request.into_request();
1633            req.extensions_mut()
1634                .insert(
1635                    GrpcMethod::new("pidgr.v1.PrivacyService", "ListMyPrivacyRequests"),
1636                );
1637            self.inner.unary(req, path, codec).await
1638        }
1639    }
1640}
1641/// Generated server implementations.
1642pub mod privacy_service_server {
1643    #![allow(
1644        unused_variables,
1645        dead_code,
1646        missing_docs,
1647        clippy::wildcard_imports,
1648        clippy::let_unit_value,
1649    )]
1650    use tonic::codegen::*;
1651    /// Generated trait containing gRPC methods that should be implemented for use with PrivacyServiceServer.
1652    #[async_trait]
1653    pub trait PrivacyService: std::marker::Send + std::marker::Sync + 'static {
1654        /** Export all personal data associated with a user as a downloadable ZIP.
1655 Async operation — returns immediately with PENDING status, sends push
1656 notification when the export is ready.
1657 Auth: Requires JWT. Callable by the user themselves or an org admin.
1658*/
1659        async fn export_user_data(
1660            &self,
1661            request: tonic::Request<super::ExportUserDataRequest>,
1662        ) -> std::result::Result<
1663            tonic::Response<super::ExportUserDataResponse>,
1664            tonic::Status,
1665        >;
1666        /** Delete or anonymize all personal data associated with a user.
1667 Deletion has a 30-day grace period during which processing is restricted
1668 and the request can be cancelled. After 30 days, deletion is irreversible.
1669 Auth: Requires JWT. Admin only.
1670*/
1671        async fn delete_user_data(
1672            &self,
1673            request: tonic::Request<super::DeleteUserDataRequest>,
1674        ) -> std::result::Result<
1675            tonic::Response<super::DeleteUserDataResponse>,
1676            tonic::Status,
1677        >;
1678        /** Correct personal data for a user. Propagates corrections to all stored
1679 locations (profile, delivery records, analytics metadata).
1680 Auth: Requires JWT. Callable by the user themselves or an org admin.
1681*/
1682        async fn rectify_user_data(
1683            &self,
1684            request: tonic::Request<super::RectifyUserDataRequest>,
1685        ) -> std::result::Result<
1686            tonic::Response<super::RectifyUserDataResponse>,
1687            tonic::Status,
1688        >;
1689        /** Restrict or unrestrict processing for a user. When restricted, the API
1690 skips this user in campaigns, analytics, and session replay.
1691 Auth: Requires JWT. Admin only.
1692*/
1693        async fn restrict_processing(
1694            &self,
1695            request: tonic::Request<super::RestrictProcessingRequest>,
1696        ) -> std::result::Result<
1697            tonic::Response<super::RestrictProcessingResponse>,
1698            tonic::Status,
1699        >;
1700        /** Confirm whether personal data exists for a user and list data categories.
1701 LGPD-specific: confirmação de existência (Art. 18, I).
1702 Auth: Requires JWT. Admin only.
1703*/
1704        async fn get_data_existence_confirmation(
1705            &self,
1706            request: tonic::Request<super::GetDataExistenceConfirmationRequest>,
1707        ) -> std::result::Result<
1708            tonic::Response<super::GetDataExistenceConfirmationResponse>,
1709            tonic::Status,
1710        >;
1711        /** List privacy requests for the organization, with optional filters.
1712 Used by the admin UI to show scheduled deletions table.
1713 Auth: Requires JWT. Admin only.
1714*/
1715        async fn list_privacy_requests(
1716            &self,
1717            request: tonic::Request<super::ListPrivacyRequestsRequest>,
1718        ) -> std::result::Result<
1719            tonic::Response<super::ListPrivacyRequestsResponse>,
1720            tonic::Status,
1721        >;
1722        /** Cancel a pending deletion request. Reactivates the user and aborts
1723 the deletion workflow. Only valid during the 30-day grace period.
1724 Auth: Requires JWT. Admin only.
1725*/
1726        async fn cancel_deletion(
1727            &self,
1728            request: tonic::Request<super::CancelDeletionRequest>,
1729        ) -> std::result::Result<
1730            tonic::Response<super::CancelDeletionResponse>,
1731            tonic::Status,
1732        >;
1733        /** Skip the grace period and delete immediately. Signals the deletion
1734 workflow to proceed without waiting for the 30-day timer.
1735 Auth: Requires JWT. Admin only.
1736*/
1737        async fn immediate_delete(
1738            &self,
1739            request: tonic::Request<super::ImmediateDeleteRequest>,
1740        ) -> std::result::Result<
1741            tonic::Response<super::ImmediateDeleteResponse>,
1742            tonic::Status,
1743        >;
1744        /** List the calling user's own privacy requests (export, rectify).
1745 The server extracts user_id from the JWT — no admin permission required.
1746 Auth: Requires JWT. Any authenticated user.
1747*/
1748        async fn list_my_privacy_requests(
1749            &self,
1750            request: tonic::Request<super::ListMyPrivacyRequestsRequest>,
1751        ) -> std::result::Result<
1752            tonic::Response<super::ListMyPrivacyRequestsResponse>,
1753            tonic::Status,
1754        >;
1755    }
1756    /** PrivacyService handles GDPR/LGPD data subject rights.
1757 All RPCs extract org_id from the JWT — it is never in request messages.
1758*/
1759    #[derive(Debug)]
1760    pub struct PrivacyServiceServer<T> {
1761        inner: Arc<T>,
1762        accept_compression_encodings: EnabledCompressionEncodings,
1763        send_compression_encodings: EnabledCompressionEncodings,
1764        max_decoding_message_size: Option<usize>,
1765        max_encoding_message_size: Option<usize>,
1766    }
1767    impl<T> PrivacyServiceServer<T> {
1768        pub fn new(inner: T) -> Self {
1769            Self::from_arc(Arc::new(inner))
1770        }
1771        pub fn from_arc(inner: Arc<T>) -> Self {
1772            Self {
1773                inner,
1774                accept_compression_encodings: Default::default(),
1775                send_compression_encodings: Default::default(),
1776                max_decoding_message_size: None,
1777                max_encoding_message_size: None,
1778            }
1779        }
1780        pub fn with_interceptor<F>(
1781            inner: T,
1782            interceptor: F,
1783        ) -> InterceptedService<Self, F>
1784        where
1785            F: tonic::service::Interceptor,
1786        {
1787            InterceptedService::new(Self::new(inner), interceptor)
1788        }
1789        /// Enable decompressing requests with the given encoding.
1790        #[must_use]
1791        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1792            self.accept_compression_encodings.enable(encoding);
1793            self
1794        }
1795        /// Compress responses with the given encoding, if the client supports it.
1796        #[must_use]
1797        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1798            self.send_compression_encodings.enable(encoding);
1799            self
1800        }
1801        /// Limits the maximum size of a decoded message.
1802        ///
1803        /// Default: `4MB`
1804        #[must_use]
1805        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1806            self.max_decoding_message_size = Some(limit);
1807            self
1808        }
1809        /// Limits the maximum size of an encoded message.
1810        ///
1811        /// Default: `usize::MAX`
1812        #[must_use]
1813        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1814            self.max_encoding_message_size = Some(limit);
1815            self
1816        }
1817    }
1818    impl<T, B> tonic::codegen::Service<http::Request<B>> for PrivacyServiceServer<T>
1819    where
1820        T: PrivacyService,
1821        B: Body + std::marker::Send + 'static,
1822        B::Error: Into<StdError> + std::marker::Send + 'static,
1823    {
1824        type Response = http::Response<tonic::body::Body>;
1825        type Error = std::convert::Infallible;
1826        type Future = BoxFuture<Self::Response, Self::Error>;
1827        fn poll_ready(
1828            &mut self,
1829            _cx: &mut Context<'_>,
1830        ) -> Poll<std::result::Result<(), Self::Error>> {
1831            Poll::Ready(Ok(()))
1832        }
1833        fn call(&mut self, req: http::Request<B>) -> Self::Future {
1834            match req.uri().path() {
1835                "/pidgr.v1.PrivacyService/ExportUserData" => {
1836                    #[allow(non_camel_case_types)]
1837                    struct ExportUserDataSvc<T: PrivacyService>(pub Arc<T>);
1838                    impl<
1839                        T: PrivacyService,
1840                    > tonic::server::UnaryService<super::ExportUserDataRequest>
1841                    for ExportUserDataSvc<T> {
1842                        type Response = super::ExportUserDataResponse;
1843                        type Future = BoxFuture<
1844                            tonic::Response<Self::Response>,
1845                            tonic::Status,
1846                        >;
1847                        fn call(
1848                            &mut self,
1849                            request: tonic::Request<super::ExportUserDataRequest>,
1850                        ) -> Self::Future {
1851                            let inner = Arc::clone(&self.0);
1852                            let fut = async move {
1853                                <T as PrivacyService>::export_user_data(&inner, request)
1854                                    .await
1855                            };
1856                            Box::pin(fut)
1857                        }
1858                    }
1859                    let accept_compression_encodings = self.accept_compression_encodings;
1860                    let send_compression_encodings = self.send_compression_encodings;
1861                    let max_decoding_message_size = self.max_decoding_message_size;
1862                    let max_encoding_message_size = self.max_encoding_message_size;
1863                    let inner = self.inner.clone();
1864                    let fut = async move {
1865                        let method = ExportUserDataSvc(inner);
1866                        let codec = tonic_prost::ProstCodec::default();
1867                        let mut grpc = tonic::server::Grpc::new(codec)
1868                            .apply_compression_config(
1869                                accept_compression_encodings,
1870                                send_compression_encodings,
1871                            )
1872                            .apply_max_message_size_config(
1873                                max_decoding_message_size,
1874                                max_encoding_message_size,
1875                            );
1876                        let res = grpc.unary(method, req).await;
1877                        Ok(res)
1878                    };
1879                    Box::pin(fut)
1880                }
1881                "/pidgr.v1.PrivacyService/DeleteUserData" => {
1882                    #[allow(non_camel_case_types)]
1883                    struct DeleteUserDataSvc<T: PrivacyService>(pub Arc<T>);
1884                    impl<
1885                        T: PrivacyService,
1886                    > tonic::server::UnaryService<super::DeleteUserDataRequest>
1887                    for DeleteUserDataSvc<T> {
1888                        type Response = super::DeleteUserDataResponse;
1889                        type Future = BoxFuture<
1890                            tonic::Response<Self::Response>,
1891                            tonic::Status,
1892                        >;
1893                        fn call(
1894                            &mut self,
1895                            request: tonic::Request<super::DeleteUserDataRequest>,
1896                        ) -> Self::Future {
1897                            let inner = Arc::clone(&self.0);
1898                            let fut = async move {
1899                                <T as PrivacyService>::delete_user_data(&inner, request)
1900                                    .await
1901                            };
1902                            Box::pin(fut)
1903                        }
1904                    }
1905                    let accept_compression_encodings = self.accept_compression_encodings;
1906                    let send_compression_encodings = self.send_compression_encodings;
1907                    let max_decoding_message_size = self.max_decoding_message_size;
1908                    let max_encoding_message_size = self.max_encoding_message_size;
1909                    let inner = self.inner.clone();
1910                    let fut = async move {
1911                        let method = DeleteUserDataSvc(inner);
1912                        let codec = tonic_prost::ProstCodec::default();
1913                        let mut grpc = tonic::server::Grpc::new(codec)
1914                            .apply_compression_config(
1915                                accept_compression_encodings,
1916                                send_compression_encodings,
1917                            )
1918                            .apply_max_message_size_config(
1919                                max_decoding_message_size,
1920                                max_encoding_message_size,
1921                            );
1922                        let res = grpc.unary(method, req).await;
1923                        Ok(res)
1924                    };
1925                    Box::pin(fut)
1926                }
1927                "/pidgr.v1.PrivacyService/RectifyUserData" => {
1928                    #[allow(non_camel_case_types)]
1929                    struct RectifyUserDataSvc<T: PrivacyService>(pub Arc<T>);
1930                    impl<
1931                        T: PrivacyService,
1932                    > tonic::server::UnaryService<super::RectifyUserDataRequest>
1933                    for RectifyUserDataSvc<T> {
1934                        type Response = super::RectifyUserDataResponse;
1935                        type Future = BoxFuture<
1936                            tonic::Response<Self::Response>,
1937                            tonic::Status,
1938                        >;
1939                        fn call(
1940                            &mut self,
1941                            request: tonic::Request<super::RectifyUserDataRequest>,
1942                        ) -> Self::Future {
1943                            let inner = Arc::clone(&self.0);
1944                            let fut = async move {
1945                                <T as PrivacyService>::rectify_user_data(&inner, request)
1946                                    .await
1947                            };
1948                            Box::pin(fut)
1949                        }
1950                    }
1951                    let accept_compression_encodings = self.accept_compression_encodings;
1952                    let send_compression_encodings = self.send_compression_encodings;
1953                    let max_decoding_message_size = self.max_decoding_message_size;
1954                    let max_encoding_message_size = self.max_encoding_message_size;
1955                    let inner = self.inner.clone();
1956                    let fut = async move {
1957                        let method = RectifyUserDataSvc(inner);
1958                        let codec = tonic_prost::ProstCodec::default();
1959                        let mut grpc = tonic::server::Grpc::new(codec)
1960                            .apply_compression_config(
1961                                accept_compression_encodings,
1962                                send_compression_encodings,
1963                            )
1964                            .apply_max_message_size_config(
1965                                max_decoding_message_size,
1966                                max_encoding_message_size,
1967                            );
1968                        let res = grpc.unary(method, req).await;
1969                        Ok(res)
1970                    };
1971                    Box::pin(fut)
1972                }
1973                "/pidgr.v1.PrivacyService/RestrictProcessing" => {
1974                    #[allow(non_camel_case_types)]
1975                    struct RestrictProcessingSvc<T: PrivacyService>(pub Arc<T>);
1976                    impl<
1977                        T: PrivacyService,
1978                    > tonic::server::UnaryService<super::RestrictProcessingRequest>
1979                    for RestrictProcessingSvc<T> {
1980                        type Response = super::RestrictProcessingResponse;
1981                        type Future = BoxFuture<
1982                            tonic::Response<Self::Response>,
1983                            tonic::Status,
1984                        >;
1985                        fn call(
1986                            &mut self,
1987                            request: tonic::Request<super::RestrictProcessingRequest>,
1988                        ) -> Self::Future {
1989                            let inner = Arc::clone(&self.0);
1990                            let fut = async move {
1991                                <T as PrivacyService>::restrict_processing(&inner, request)
1992                                    .await
1993                            };
1994                            Box::pin(fut)
1995                        }
1996                    }
1997                    let accept_compression_encodings = self.accept_compression_encodings;
1998                    let send_compression_encodings = self.send_compression_encodings;
1999                    let max_decoding_message_size = self.max_decoding_message_size;
2000                    let max_encoding_message_size = self.max_encoding_message_size;
2001                    let inner = self.inner.clone();
2002                    let fut = async move {
2003                        let method = RestrictProcessingSvc(inner);
2004                        let codec = tonic_prost::ProstCodec::default();
2005                        let mut grpc = tonic::server::Grpc::new(codec)
2006                            .apply_compression_config(
2007                                accept_compression_encodings,
2008                                send_compression_encodings,
2009                            )
2010                            .apply_max_message_size_config(
2011                                max_decoding_message_size,
2012                                max_encoding_message_size,
2013                            );
2014                        let res = grpc.unary(method, req).await;
2015                        Ok(res)
2016                    };
2017                    Box::pin(fut)
2018                }
2019                "/pidgr.v1.PrivacyService/GetDataExistenceConfirmation" => {
2020                    #[allow(non_camel_case_types)]
2021                    struct GetDataExistenceConfirmationSvc<T: PrivacyService>(
2022                        pub Arc<T>,
2023                    );
2024                    impl<
2025                        T: PrivacyService,
2026                    > tonic::server::UnaryService<
2027                        super::GetDataExistenceConfirmationRequest,
2028                    > for GetDataExistenceConfirmationSvc<T> {
2029                        type Response = super::GetDataExistenceConfirmationResponse;
2030                        type Future = BoxFuture<
2031                            tonic::Response<Self::Response>,
2032                            tonic::Status,
2033                        >;
2034                        fn call(
2035                            &mut self,
2036                            request: tonic::Request<
2037                                super::GetDataExistenceConfirmationRequest,
2038                            >,
2039                        ) -> Self::Future {
2040                            let inner = Arc::clone(&self.0);
2041                            let fut = async move {
2042                                <T as PrivacyService>::get_data_existence_confirmation(
2043                                        &inner,
2044                                        request,
2045                                    )
2046                                    .await
2047                            };
2048                            Box::pin(fut)
2049                        }
2050                    }
2051                    let accept_compression_encodings = self.accept_compression_encodings;
2052                    let send_compression_encodings = self.send_compression_encodings;
2053                    let max_decoding_message_size = self.max_decoding_message_size;
2054                    let max_encoding_message_size = self.max_encoding_message_size;
2055                    let inner = self.inner.clone();
2056                    let fut = async move {
2057                        let method = GetDataExistenceConfirmationSvc(inner);
2058                        let codec = tonic_prost::ProstCodec::default();
2059                        let mut grpc = tonic::server::Grpc::new(codec)
2060                            .apply_compression_config(
2061                                accept_compression_encodings,
2062                                send_compression_encodings,
2063                            )
2064                            .apply_max_message_size_config(
2065                                max_decoding_message_size,
2066                                max_encoding_message_size,
2067                            );
2068                        let res = grpc.unary(method, req).await;
2069                        Ok(res)
2070                    };
2071                    Box::pin(fut)
2072                }
2073                "/pidgr.v1.PrivacyService/ListPrivacyRequests" => {
2074                    #[allow(non_camel_case_types)]
2075                    struct ListPrivacyRequestsSvc<T: PrivacyService>(pub Arc<T>);
2076                    impl<
2077                        T: PrivacyService,
2078                    > tonic::server::UnaryService<super::ListPrivacyRequestsRequest>
2079                    for ListPrivacyRequestsSvc<T> {
2080                        type Response = super::ListPrivacyRequestsResponse;
2081                        type Future = BoxFuture<
2082                            tonic::Response<Self::Response>,
2083                            tonic::Status,
2084                        >;
2085                        fn call(
2086                            &mut self,
2087                            request: tonic::Request<super::ListPrivacyRequestsRequest>,
2088                        ) -> Self::Future {
2089                            let inner = Arc::clone(&self.0);
2090                            let fut = async move {
2091                                <T as PrivacyService>::list_privacy_requests(
2092                                        &inner,
2093                                        request,
2094                                    )
2095                                    .await
2096                            };
2097                            Box::pin(fut)
2098                        }
2099                    }
2100                    let accept_compression_encodings = self.accept_compression_encodings;
2101                    let send_compression_encodings = self.send_compression_encodings;
2102                    let max_decoding_message_size = self.max_decoding_message_size;
2103                    let max_encoding_message_size = self.max_encoding_message_size;
2104                    let inner = self.inner.clone();
2105                    let fut = async move {
2106                        let method = ListPrivacyRequestsSvc(inner);
2107                        let codec = tonic_prost::ProstCodec::default();
2108                        let mut grpc = tonic::server::Grpc::new(codec)
2109                            .apply_compression_config(
2110                                accept_compression_encodings,
2111                                send_compression_encodings,
2112                            )
2113                            .apply_max_message_size_config(
2114                                max_decoding_message_size,
2115                                max_encoding_message_size,
2116                            );
2117                        let res = grpc.unary(method, req).await;
2118                        Ok(res)
2119                    };
2120                    Box::pin(fut)
2121                }
2122                "/pidgr.v1.PrivacyService/CancelDeletion" => {
2123                    #[allow(non_camel_case_types)]
2124                    struct CancelDeletionSvc<T: PrivacyService>(pub Arc<T>);
2125                    impl<
2126                        T: PrivacyService,
2127                    > tonic::server::UnaryService<super::CancelDeletionRequest>
2128                    for CancelDeletionSvc<T> {
2129                        type Response = super::CancelDeletionResponse;
2130                        type Future = BoxFuture<
2131                            tonic::Response<Self::Response>,
2132                            tonic::Status,
2133                        >;
2134                        fn call(
2135                            &mut self,
2136                            request: tonic::Request<super::CancelDeletionRequest>,
2137                        ) -> Self::Future {
2138                            let inner = Arc::clone(&self.0);
2139                            let fut = async move {
2140                                <T as PrivacyService>::cancel_deletion(&inner, request)
2141                                    .await
2142                            };
2143                            Box::pin(fut)
2144                        }
2145                    }
2146                    let accept_compression_encodings = self.accept_compression_encodings;
2147                    let send_compression_encodings = self.send_compression_encodings;
2148                    let max_decoding_message_size = self.max_decoding_message_size;
2149                    let max_encoding_message_size = self.max_encoding_message_size;
2150                    let inner = self.inner.clone();
2151                    let fut = async move {
2152                        let method = CancelDeletionSvc(inner);
2153                        let codec = tonic_prost::ProstCodec::default();
2154                        let mut grpc = tonic::server::Grpc::new(codec)
2155                            .apply_compression_config(
2156                                accept_compression_encodings,
2157                                send_compression_encodings,
2158                            )
2159                            .apply_max_message_size_config(
2160                                max_decoding_message_size,
2161                                max_encoding_message_size,
2162                            );
2163                        let res = grpc.unary(method, req).await;
2164                        Ok(res)
2165                    };
2166                    Box::pin(fut)
2167                }
2168                "/pidgr.v1.PrivacyService/ImmediateDelete" => {
2169                    #[allow(non_camel_case_types)]
2170                    struct ImmediateDeleteSvc<T: PrivacyService>(pub Arc<T>);
2171                    impl<
2172                        T: PrivacyService,
2173                    > tonic::server::UnaryService<super::ImmediateDeleteRequest>
2174                    for ImmediateDeleteSvc<T> {
2175                        type Response = super::ImmediateDeleteResponse;
2176                        type Future = BoxFuture<
2177                            tonic::Response<Self::Response>,
2178                            tonic::Status,
2179                        >;
2180                        fn call(
2181                            &mut self,
2182                            request: tonic::Request<super::ImmediateDeleteRequest>,
2183                        ) -> Self::Future {
2184                            let inner = Arc::clone(&self.0);
2185                            let fut = async move {
2186                                <T as PrivacyService>::immediate_delete(&inner, request)
2187                                    .await
2188                            };
2189                            Box::pin(fut)
2190                        }
2191                    }
2192                    let accept_compression_encodings = self.accept_compression_encodings;
2193                    let send_compression_encodings = self.send_compression_encodings;
2194                    let max_decoding_message_size = self.max_decoding_message_size;
2195                    let max_encoding_message_size = self.max_encoding_message_size;
2196                    let inner = self.inner.clone();
2197                    let fut = async move {
2198                        let method = ImmediateDeleteSvc(inner);
2199                        let codec = tonic_prost::ProstCodec::default();
2200                        let mut grpc = tonic::server::Grpc::new(codec)
2201                            .apply_compression_config(
2202                                accept_compression_encodings,
2203                                send_compression_encodings,
2204                            )
2205                            .apply_max_message_size_config(
2206                                max_decoding_message_size,
2207                                max_encoding_message_size,
2208                            );
2209                        let res = grpc.unary(method, req).await;
2210                        Ok(res)
2211                    };
2212                    Box::pin(fut)
2213                }
2214                "/pidgr.v1.PrivacyService/ListMyPrivacyRequests" => {
2215                    #[allow(non_camel_case_types)]
2216                    struct ListMyPrivacyRequestsSvc<T: PrivacyService>(pub Arc<T>);
2217                    impl<
2218                        T: PrivacyService,
2219                    > tonic::server::UnaryService<super::ListMyPrivacyRequestsRequest>
2220                    for ListMyPrivacyRequestsSvc<T> {
2221                        type Response = super::ListMyPrivacyRequestsResponse;
2222                        type Future = BoxFuture<
2223                            tonic::Response<Self::Response>,
2224                            tonic::Status,
2225                        >;
2226                        fn call(
2227                            &mut self,
2228                            request: tonic::Request<super::ListMyPrivacyRequestsRequest>,
2229                        ) -> Self::Future {
2230                            let inner = Arc::clone(&self.0);
2231                            let fut = async move {
2232                                <T as PrivacyService>::list_my_privacy_requests(
2233                                        &inner,
2234                                        request,
2235                                    )
2236                                    .await
2237                            };
2238                            Box::pin(fut)
2239                        }
2240                    }
2241                    let accept_compression_encodings = self.accept_compression_encodings;
2242                    let send_compression_encodings = self.send_compression_encodings;
2243                    let max_decoding_message_size = self.max_decoding_message_size;
2244                    let max_encoding_message_size = self.max_encoding_message_size;
2245                    let inner = self.inner.clone();
2246                    let fut = async move {
2247                        let method = ListMyPrivacyRequestsSvc(inner);
2248                        let codec = tonic_prost::ProstCodec::default();
2249                        let mut grpc = tonic::server::Grpc::new(codec)
2250                            .apply_compression_config(
2251                                accept_compression_encodings,
2252                                send_compression_encodings,
2253                            )
2254                            .apply_max_message_size_config(
2255                                max_decoding_message_size,
2256                                max_encoding_message_size,
2257                            );
2258                        let res = grpc.unary(method, req).await;
2259                        Ok(res)
2260                    };
2261                    Box::pin(fut)
2262                }
2263                _ => {
2264                    Box::pin(async move {
2265                        let mut response = http::Response::new(
2266                            tonic::body::Body::default(),
2267                        );
2268                        let headers = response.headers_mut();
2269                        headers
2270                            .insert(
2271                                tonic::Status::GRPC_STATUS,
2272                                (tonic::Code::Unimplemented as i32).into(),
2273                            );
2274                        headers
2275                            .insert(
2276                                http::header::CONTENT_TYPE,
2277                                tonic::metadata::GRPC_CONTENT_TYPE,
2278                            );
2279                        Ok(response)
2280                    })
2281                }
2282            }
2283        }
2284    }
2285    impl<T> Clone for PrivacyServiceServer<T> {
2286        fn clone(&self) -> Self {
2287            let inner = self.inner.clone();
2288            Self {
2289                inner,
2290                accept_compression_encodings: self.accept_compression_encodings,
2291                send_compression_encodings: self.send_compression_encodings,
2292                max_decoding_message_size: self.max_decoding_message_size,
2293                max_encoding_message_size: self.max_encoding_message_size,
2294            }
2295        }
2296    }
2297    /// Generated gRPC service name
2298    pub const SERVICE_NAME: &str = "pidgr.v1.PrivacyService";
2299    impl<T> tonic::server::NamedService for PrivacyServiceServer<T> {
2300        const NAME: &'static str = SERVICE_NAME;
2301    }
2302}
2303/// Generated client implementations.
2304pub mod audit_service_client {
2305    #![allow(
2306        unused_variables,
2307        dead_code,
2308        missing_docs,
2309        clippy::wildcard_imports,
2310        clippy::let_unit_value,
2311    )]
2312    use tonic::codegen::*;
2313    use tonic::codegen::http::Uri;
2314    /** AuditService provides read access to the append-only audit trail.
2315 All RPCs extract org_id from the JWT — it is never in request messages.
2316*/
2317    #[derive(Debug, Clone)]
2318    pub struct AuditServiceClient<T> {
2319        inner: tonic::client::Grpc<T>,
2320    }
2321    impl AuditServiceClient<tonic::transport::Channel> {
2322        /// Attempt to create a new client by connecting to a given endpoint.
2323        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
2324        where
2325            D: TryInto<tonic::transport::Endpoint>,
2326            D::Error: Into<StdError>,
2327        {
2328            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
2329            Ok(Self::new(conn))
2330        }
2331    }
2332    impl<T> AuditServiceClient<T>
2333    where
2334        T: tonic::client::GrpcService<tonic::body::Body>,
2335        T::Error: Into<StdError>,
2336        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
2337        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
2338    {
2339        pub fn new(inner: T) -> Self {
2340            let inner = tonic::client::Grpc::new(inner);
2341            Self { inner }
2342        }
2343        pub fn with_origin(inner: T, origin: Uri) -> Self {
2344            let inner = tonic::client::Grpc::with_origin(inner, origin);
2345            Self { inner }
2346        }
2347        pub fn with_interceptor<F>(
2348            inner: T,
2349            interceptor: F,
2350        ) -> AuditServiceClient<InterceptedService<T, F>>
2351        where
2352            F: tonic::service::Interceptor,
2353            T::ResponseBody: Default,
2354            T: tonic::codegen::Service<
2355                http::Request<tonic::body::Body>,
2356                Response = http::Response<
2357                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
2358                >,
2359            >,
2360            <T as tonic::codegen::Service<
2361                http::Request<tonic::body::Body>,
2362            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
2363        {
2364            AuditServiceClient::new(InterceptedService::new(inner, interceptor))
2365        }
2366        /// Compress requests with the given encoding.
2367        ///
2368        /// This requires the server to support it otherwise it might respond with an
2369        /// error.
2370        #[must_use]
2371        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2372            self.inner = self.inner.send_compressed(encoding);
2373            self
2374        }
2375        /// Enable decompressing responses.
2376        #[must_use]
2377        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2378            self.inner = self.inner.accept_compressed(encoding);
2379            self
2380        }
2381        /// Limits the maximum size of a decoded message.
2382        ///
2383        /// Default: `4MB`
2384        #[must_use]
2385        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2386            self.inner = self.inner.max_decoding_message_size(limit);
2387            self
2388        }
2389        /// Limits the maximum size of an encoded message.
2390        ///
2391        /// Default: `usize::MAX`
2392        #[must_use]
2393        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2394            self.inner = self.inner.max_encoding_message_size(limit);
2395            self
2396        }
2397        /** List audit events with optional filtering by event type, actor, and date range.
2398 Results are ordered by created_at descending (newest first).
2399 Auth: Requires JWT. Admin only.
2400*/
2401        pub async fn list_audit_events(
2402            &mut self,
2403            request: impl tonic::IntoRequest<super::ListAuditEventsRequest>,
2404        ) -> std::result::Result<
2405            tonic::Response<super::ListAuditEventsResponse>,
2406            tonic::Status,
2407        > {
2408            self.inner
2409                .ready()
2410                .await
2411                .map_err(|e| {
2412                    tonic::Status::unknown(
2413                        format!("Service was not ready: {}", e.into()),
2414                    )
2415                })?;
2416            let codec = tonic_prost::ProstCodec::default();
2417            let path = http::uri::PathAndQuery::from_static(
2418                "/pidgr.v1.AuditService/ListAuditEvents",
2419            );
2420            let mut req = request.into_request();
2421            req.extensions_mut()
2422                .insert(GrpcMethod::new("pidgr.v1.AuditService", "ListAuditEvents"));
2423            self.inner.unary(req, path, codec).await
2424        }
2425        /** Export the audit trail to S3 in CSV, JSON, or Parquet format.
2426 Creates a persistent record and starts an async Temporal workflow.
2427 Auth: Requires JWT. Admin only.
2428*/
2429        pub async fn export_audit_trail(
2430            &mut self,
2431            request: impl tonic::IntoRequest<super::ExportAuditTrailRequest>,
2432        ) -> std::result::Result<
2433            tonic::Response<super::ExportAuditTrailResponse>,
2434            tonic::Status,
2435        > {
2436            self.inner
2437                .ready()
2438                .await
2439                .map_err(|e| {
2440                    tonic::Status::unknown(
2441                        format!("Service was not ready: {}", e.into()),
2442                    )
2443                })?;
2444            let codec = tonic_prost::ProstCodec::default();
2445            let path = http::uri::PathAndQuery::from_static(
2446                "/pidgr.v1.AuditService/ExportAuditTrail",
2447            );
2448            let mut req = request.into_request();
2449            req.extensions_mut()
2450                .insert(GrpcMethod::new("pidgr.v1.AuditService", "ExportAuditTrail"));
2451            self.inner.unary(req, path, codec).await
2452        }
2453        /** List audit export history for the organization.
2454 Auth: Requires JWT. Admin only.
2455*/
2456        pub async fn list_audit_exports(
2457            &mut self,
2458            request: impl tonic::IntoRequest<super::ListAuditExportsRequest>,
2459        ) -> std::result::Result<
2460            tonic::Response<super::ListAuditExportsResponse>,
2461            tonic::Status,
2462        > {
2463            self.inner
2464                .ready()
2465                .await
2466                .map_err(|e| {
2467                    tonic::Status::unknown(
2468                        format!("Service was not ready: {}", e.into()),
2469                    )
2470                })?;
2471            let codec = tonic_prost::ProstCodec::default();
2472            let path = http::uri::PathAndQuery::from_static(
2473                "/pidgr.v1.AuditService/ListAuditExports",
2474            );
2475            let mut req = request.into_request();
2476            req.extensions_mut()
2477                .insert(GrpcMethod::new("pidgr.v1.AuditService", "ListAuditExports"));
2478            self.inner.unary(req, path, codec).await
2479        }
2480    }
2481}
2482/// Generated server implementations.
2483pub mod audit_service_server {
2484    #![allow(
2485        unused_variables,
2486        dead_code,
2487        missing_docs,
2488        clippy::wildcard_imports,
2489        clippy::let_unit_value,
2490    )]
2491    use tonic::codegen::*;
2492    /// Generated trait containing gRPC methods that should be implemented for use with AuditServiceServer.
2493    #[async_trait]
2494    pub trait AuditService: std::marker::Send + std::marker::Sync + 'static {
2495        /** List audit events with optional filtering by event type, actor, and date range.
2496 Results are ordered by created_at descending (newest first).
2497 Auth: Requires JWT. Admin only.
2498*/
2499        async fn list_audit_events(
2500            &self,
2501            request: tonic::Request<super::ListAuditEventsRequest>,
2502        ) -> std::result::Result<
2503            tonic::Response<super::ListAuditEventsResponse>,
2504            tonic::Status,
2505        >;
2506        /** Export the audit trail to S3 in CSV, JSON, or Parquet format.
2507 Creates a persistent record and starts an async Temporal workflow.
2508 Auth: Requires JWT. Admin only.
2509*/
2510        async fn export_audit_trail(
2511            &self,
2512            request: tonic::Request<super::ExportAuditTrailRequest>,
2513        ) -> std::result::Result<
2514            tonic::Response<super::ExportAuditTrailResponse>,
2515            tonic::Status,
2516        >;
2517        /** List audit export history for the organization.
2518 Auth: Requires JWT. Admin only.
2519*/
2520        async fn list_audit_exports(
2521            &self,
2522            request: tonic::Request<super::ListAuditExportsRequest>,
2523        ) -> std::result::Result<
2524            tonic::Response<super::ListAuditExportsResponse>,
2525            tonic::Status,
2526        >;
2527    }
2528    /** AuditService provides read access to the append-only audit trail.
2529 All RPCs extract org_id from the JWT — it is never in request messages.
2530*/
2531    #[derive(Debug)]
2532    pub struct AuditServiceServer<T> {
2533        inner: Arc<T>,
2534        accept_compression_encodings: EnabledCompressionEncodings,
2535        send_compression_encodings: EnabledCompressionEncodings,
2536        max_decoding_message_size: Option<usize>,
2537        max_encoding_message_size: Option<usize>,
2538    }
2539    impl<T> AuditServiceServer<T> {
2540        pub fn new(inner: T) -> Self {
2541            Self::from_arc(Arc::new(inner))
2542        }
2543        pub fn from_arc(inner: Arc<T>) -> Self {
2544            Self {
2545                inner,
2546                accept_compression_encodings: Default::default(),
2547                send_compression_encodings: Default::default(),
2548                max_decoding_message_size: None,
2549                max_encoding_message_size: None,
2550            }
2551        }
2552        pub fn with_interceptor<F>(
2553            inner: T,
2554            interceptor: F,
2555        ) -> InterceptedService<Self, F>
2556        where
2557            F: tonic::service::Interceptor,
2558        {
2559            InterceptedService::new(Self::new(inner), interceptor)
2560        }
2561        /// Enable decompressing requests with the given encoding.
2562        #[must_use]
2563        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2564            self.accept_compression_encodings.enable(encoding);
2565            self
2566        }
2567        /// Compress responses with the given encoding, if the client supports it.
2568        #[must_use]
2569        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2570            self.send_compression_encodings.enable(encoding);
2571            self
2572        }
2573        /// Limits the maximum size of a decoded message.
2574        ///
2575        /// Default: `4MB`
2576        #[must_use]
2577        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2578            self.max_decoding_message_size = Some(limit);
2579            self
2580        }
2581        /// Limits the maximum size of an encoded message.
2582        ///
2583        /// Default: `usize::MAX`
2584        #[must_use]
2585        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2586            self.max_encoding_message_size = Some(limit);
2587            self
2588        }
2589    }
2590    impl<T, B> tonic::codegen::Service<http::Request<B>> for AuditServiceServer<T>
2591    where
2592        T: AuditService,
2593        B: Body + std::marker::Send + 'static,
2594        B::Error: Into<StdError> + std::marker::Send + 'static,
2595    {
2596        type Response = http::Response<tonic::body::Body>;
2597        type Error = std::convert::Infallible;
2598        type Future = BoxFuture<Self::Response, Self::Error>;
2599        fn poll_ready(
2600            &mut self,
2601            _cx: &mut Context<'_>,
2602        ) -> Poll<std::result::Result<(), Self::Error>> {
2603            Poll::Ready(Ok(()))
2604        }
2605        fn call(&mut self, req: http::Request<B>) -> Self::Future {
2606            match req.uri().path() {
2607                "/pidgr.v1.AuditService/ListAuditEvents" => {
2608                    #[allow(non_camel_case_types)]
2609                    struct ListAuditEventsSvc<T: AuditService>(pub Arc<T>);
2610                    impl<
2611                        T: AuditService,
2612                    > tonic::server::UnaryService<super::ListAuditEventsRequest>
2613                    for ListAuditEventsSvc<T> {
2614                        type Response = super::ListAuditEventsResponse;
2615                        type Future = BoxFuture<
2616                            tonic::Response<Self::Response>,
2617                            tonic::Status,
2618                        >;
2619                        fn call(
2620                            &mut self,
2621                            request: tonic::Request<super::ListAuditEventsRequest>,
2622                        ) -> Self::Future {
2623                            let inner = Arc::clone(&self.0);
2624                            let fut = async move {
2625                                <T as AuditService>::list_audit_events(&inner, request)
2626                                    .await
2627                            };
2628                            Box::pin(fut)
2629                        }
2630                    }
2631                    let accept_compression_encodings = self.accept_compression_encodings;
2632                    let send_compression_encodings = self.send_compression_encodings;
2633                    let max_decoding_message_size = self.max_decoding_message_size;
2634                    let max_encoding_message_size = self.max_encoding_message_size;
2635                    let inner = self.inner.clone();
2636                    let fut = async move {
2637                        let method = ListAuditEventsSvc(inner);
2638                        let codec = tonic_prost::ProstCodec::default();
2639                        let mut grpc = tonic::server::Grpc::new(codec)
2640                            .apply_compression_config(
2641                                accept_compression_encodings,
2642                                send_compression_encodings,
2643                            )
2644                            .apply_max_message_size_config(
2645                                max_decoding_message_size,
2646                                max_encoding_message_size,
2647                            );
2648                        let res = grpc.unary(method, req).await;
2649                        Ok(res)
2650                    };
2651                    Box::pin(fut)
2652                }
2653                "/pidgr.v1.AuditService/ExportAuditTrail" => {
2654                    #[allow(non_camel_case_types)]
2655                    struct ExportAuditTrailSvc<T: AuditService>(pub Arc<T>);
2656                    impl<
2657                        T: AuditService,
2658                    > tonic::server::UnaryService<super::ExportAuditTrailRequest>
2659                    for ExportAuditTrailSvc<T> {
2660                        type Response = super::ExportAuditTrailResponse;
2661                        type Future = BoxFuture<
2662                            tonic::Response<Self::Response>,
2663                            tonic::Status,
2664                        >;
2665                        fn call(
2666                            &mut self,
2667                            request: tonic::Request<super::ExportAuditTrailRequest>,
2668                        ) -> Self::Future {
2669                            let inner = Arc::clone(&self.0);
2670                            let fut = async move {
2671                                <T as AuditService>::export_audit_trail(&inner, request)
2672                                    .await
2673                            };
2674                            Box::pin(fut)
2675                        }
2676                    }
2677                    let accept_compression_encodings = self.accept_compression_encodings;
2678                    let send_compression_encodings = self.send_compression_encodings;
2679                    let max_decoding_message_size = self.max_decoding_message_size;
2680                    let max_encoding_message_size = self.max_encoding_message_size;
2681                    let inner = self.inner.clone();
2682                    let fut = async move {
2683                        let method = ExportAuditTrailSvc(inner);
2684                        let codec = tonic_prost::ProstCodec::default();
2685                        let mut grpc = tonic::server::Grpc::new(codec)
2686                            .apply_compression_config(
2687                                accept_compression_encodings,
2688                                send_compression_encodings,
2689                            )
2690                            .apply_max_message_size_config(
2691                                max_decoding_message_size,
2692                                max_encoding_message_size,
2693                            );
2694                        let res = grpc.unary(method, req).await;
2695                        Ok(res)
2696                    };
2697                    Box::pin(fut)
2698                }
2699                "/pidgr.v1.AuditService/ListAuditExports" => {
2700                    #[allow(non_camel_case_types)]
2701                    struct ListAuditExportsSvc<T: AuditService>(pub Arc<T>);
2702                    impl<
2703                        T: AuditService,
2704                    > tonic::server::UnaryService<super::ListAuditExportsRequest>
2705                    for ListAuditExportsSvc<T> {
2706                        type Response = super::ListAuditExportsResponse;
2707                        type Future = BoxFuture<
2708                            tonic::Response<Self::Response>,
2709                            tonic::Status,
2710                        >;
2711                        fn call(
2712                            &mut self,
2713                            request: tonic::Request<super::ListAuditExportsRequest>,
2714                        ) -> Self::Future {
2715                            let inner = Arc::clone(&self.0);
2716                            let fut = async move {
2717                                <T as AuditService>::list_audit_exports(&inner, request)
2718                                    .await
2719                            };
2720                            Box::pin(fut)
2721                        }
2722                    }
2723                    let accept_compression_encodings = self.accept_compression_encodings;
2724                    let send_compression_encodings = self.send_compression_encodings;
2725                    let max_decoding_message_size = self.max_decoding_message_size;
2726                    let max_encoding_message_size = self.max_encoding_message_size;
2727                    let inner = self.inner.clone();
2728                    let fut = async move {
2729                        let method = ListAuditExportsSvc(inner);
2730                        let codec = tonic_prost::ProstCodec::default();
2731                        let mut grpc = tonic::server::Grpc::new(codec)
2732                            .apply_compression_config(
2733                                accept_compression_encodings,
2734                                send_compression_encodings,
2735                            )
2736                            .apply_max_message_size_config(
2737                                max_decoding_message_size,
2738                                max_encoding_message_size,
2739                            );
2740                        let res = grpc.unary(method, req).await;
2741                        Ok(res)
2742                    };
2743                    Box::pin(fut)
2744                }
2745                _ => {
2746                    Box::pin(async move {
2747                        let mut response = http::Response::new(
2748                            tonic::body::Body::default(),
2749                        );
2750                        let headers = response.headers_mut();
2751                        headers
2752                            .insert(
2753                                tonic::Status::GRPC_STATUS,
2754                                (tonic::Code::Unimplemented as i32).into(),
2755                            );
2756                        headers
2757                            .insert(
2758                                http::header::CONTENT_TYPE,
2759                                tonic::metadata::GRPC_CONTENT_TYPE,
2760                            );
2761                        Ok(response)
2762                    })
2763                }
2764            }
2765        }
2766    }
2767    impl<T> Clone for AuditServiceServer<T> {
2768        fn clone(&self) -> Self {
2769            let inner = self.inner.clone();
2770            Self {
2771                inner,
2772                accept_compression_encodings: self.accept_compression_encodings,
2773                send_compression_encodings: self.send_compression_encodings,
2774                max_decoding_message_size: self.max_decoding_message_size,
2775                max_encoding_message_size: self.max_encoding_message_size,
2776            }
2777        }
2778    }
2779    /// Generated gRPC service name
2780    pub const SERVICE_NAME: &str = "pidgr.v1.AuditService";
2781    impl<T> tonic::server::NamedService for AuditServiceServer<T> {
2782        const NAME: &'static str = SERVICE_NAME;
2783    }
2784}
2785/// Generated client implementations.
2786pub mod campaign_service_client {
2787    #![allow(
2788        unused_variables,
2789        dead_code,
2790        missing_docs,
2791        clippy::wildcard_imports,
2792        clippy::let_unit_value,
2793    )]
2794    use tonic::codegen::*;
2795    use tonic::codegen::http::Uri;
2796    /** Manages the full lifecycle of communication campaigns — creation,
2797 execution, monitoring, and cancellation.
2798*/
2799    #[derive(Debug, Clone)]
2800    pub struct CampaignServiceClient<T> {
2801        inner: tonic::client::Grpc<T>,
2802    }
2803    impl CampaignServiceClient<tonic::transport::Channel> {
2804        /// Attempt to create a new client by connecting to a given endpoint.
2805        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
2806        where
2807            D: TryInto<tonic::transport::Endpoint>,
2808            D::Error: Into<StdError>,
2809        {
2810            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
2811            Ok(Self::new(conn))
2812        }
2813    }
2814    impl<T> CampaignServiceClient<T>
2815    where
2816        T: tonic::client::GrpcService<tonic::body::Body>,
2817        T::Error: Into<StdError>,
2818        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
2819        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
2820    {
2821        pub fn new(inner: T) -> Self {
2822            let inner = tonic::client::Grpc::new(inner);
2823            Self { inner }
2824        }
2825        pub fn with_origin(inner: T, origin: Uri) -> Self {
2826            let inner = tonic::client::Grpc::with_origin(inner, origin);
2827            Self { inner }
2828        }
2829        pub fn with_interceptor<F>(
2830            inner: T,
2831            interceptor: F,
2832        ) -> CampaignServiceClient<InterceptedService<T, F>>
2833        where
2834            F: tonic::service::Interceptor,
2835            T::ResponseBody: Default,
2836            T: tonic::codegen::Service<
2837                http::Request<tonic::body::Body>,
2838                Response = http::Response<
2839                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
2840                >,
2841            >,
2842            <T as tonic::codegen::Service<
2843                http::Request<tonic::body::Body>,
2844            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
2845        {
2846            CampaignServiceClient::new(InterceptedService::new(inner, interceptor))
2847        }
2848        /// Compress requests with the given encoding.
2849        ///
2850        /// This requires the server to support it otherwise it might respond with an
2851        /// error.
2852        #[must_use]
2853        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2854            self.inner = self.inner.send_compressed(encoding);
2855            self
2856        }
2857        /// Enable decompressing responses.
2858        #[must_use]
2859        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2860            self.inner = self.inner.accept_compressed(encoding);
2861            self
2862        }
2863        /// Limits the maximum size of a decoded message.
2864        ///
2865        /// Default: `4MB`
2866        #[must_use]
2867        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2868            self.inner = self.inner.max_decoding_message_size(limit);
2869            self
2870        }
2871        /// Limits the maximum size of an encoded message.
2872        ///
2873        /// Default: `usize::MAX`
2874        #[must_use]
2875        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2876            self.inner = self.inner.max_encoding_message_size(limit);
2877            self
2878        }
2879        /** Create a new campaign with a template, audience, and workflow.
2880 Authorization: Requires MANAGER+ role.
2881*/
2882        pub async fn create_campaign(
2883            &mut self,
2884            request: impl tonic::IntoRequest<super::CreateCampaignRequest>,
2885        ) -> std::result::Result<
2886            tonic::Response<super::CreateCampaignResponse>,
2887            tonic::Status,
2888        > {
2889            self.inner
2890                .ready()
2891                .await
2892                .map_err(|e| {
2893                    tonic::Status::unknown(
2894                        format!("Service was not ready: {}", e.into()),
2895                    )
2896                })?;
2897            let codec = tonic_prost::ProstCodec::default();
2898            let path = http::uri::PathAndQuery::from_static(
2899                "/pidgr.v1.CampaignService/CreateCampaign",
2900            );
2901            let mut req = request.into_request();
2902            req.extensions_mut()
2903                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "CreateCampaign"));
2904            self.inner.unary(req, path, codec).await
2905        }
2906        /** Start a created campaign, triggering its workflow execution via the orchestration engine.
2907 Authorization: Requires MANAGER+ role.
2908*/
2909        pub async fn start_campaign(
2910            &mut self,
2911            request: impl tonic::IntoRequest<super::StartCampaignRequest>,
2912        ) -> std::result::Result<
2913            tonic::Response<super::StartCampaignResponse>,
2914            tonic::Status,
2915        > {
2916            self.inner
2917                .ready()
2918                .await
2919                .map_err(|e| {
2920                    tonic::Status::unknown(
2921                        format!("Service was not ready: {}", e.into()),
2922                    )
2923                })?;
2924            let codec = tonic_prost::ProstCodec::default();
2925            let path = http::uri::PathAndQuery::from_static(
2926                "/pidgr.v1.CampaignService/StartCampaign",
2927            );
2928            let mut req = request.into_request();
2929            req.extensions_mut()
2930                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "StartCampaign"));
2931            self.inner.unary(req, path, codec).await
2932        }
2933        /** Retrieve a single campaign by ID.
2934 Authorization: Authenticated user within the organization.
2935*/
2936        pub async fn get_campaign(
2937            &mut self,
2938            request: impl tonic::IntoRequest<super::GetCampaignRequest>,
2939        ) -> std::result::Result<
2940            tonic::Response<super::GetCampaignResponse>,
2941            tonic::Status,
2942        > {
2943            self.inner
2944                .ready()
2945                .await
2946                .map_err(|e| {
2947                    tonic::Status::unknown(
2948                        format!("Service was not ready: {}", e.into()),
2949                    )
2950                })?;
2951            let codec = tonic_prost::ProstCodec::default();
2952            let path = http::uri::PathAndQuery::from_static(
2953                "/pidgr.v1.CampaignService/GetCampaign",
2954            );
2955            let mut req = request.into_request();
2956            req.extensions_mut()
2957                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "GetCampaign"));
2958            self.inner.unary(req, path, codec).await
2959        }
2960        /** List campaigns for the organization with pagination.
2961 Authorization: Authenticated user within the organization.
2962*/
2963        pub async fn list_campaigns(
2964            &mut self,
2965            request: impl tonic::IntoRequest<super::ListCampaignsRequest>,
2966        ) -> std::result::Result<
2967            tonic::Response<super::ListCampaignsResponse>,
2968            tonic::Status,
2969        > {
2970            self.inner
2971                .ready()
2972                .await
2973                .map_err(|e| {
2974                    tonic::Status::unknown(
2975                        format!("Service was not ready: {}", e.into()),
2976                    )
2977                })?;
2978            let codec = tonic_prost::ProstCodec::default();
2979            let path = http::uri::PathAndQuery::from_static(
2980                "/pidgr.v1.CampaignService/ListCampaigns",
2981            );
2982            let mut req = request.into_request();
2983            req.extensions_mut()
2984                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "ListCampaigns"));
2985            self.inner.unary(req, path, codec).await
2986        }
2987        /** Update a draft campaign (CREATED status only). Non-empty fields overwrite existing values.
2988 Authorization: Requires MANAGER+ role.
2989*/
2990        pub async fn update_campaign(
2991            &mut self,
2992            request: impl tonic::IntoRequest<super::UpdateCampaignRequest>,
2993        ) -> std::result::Result<
2994            tonic::Response<super::UpdateCampaignResponse>,
2995            tonic::Status,
2996        > {
2997            self.inner
2998                .ready()
2999                .await
3000                .map_err(|e| {
3001                    tonic::Status::unknown(
3002                        format!("Service was not ready: {}", e.into()),
3003                    )
3004                })?;
3005            let codec = tonic_prost::ProstCodec::default();
3006            let path = http::uri::PathAndQuery::from_static(
3007                "/pidgr.v1.CampaignService/UpdateCampaign",
3008            );
3009            let mut req = request.into_request();
3010            req.extensions_mut()
3011                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "UpdateCampaign"));
3012            self.inner.unary(req, path, codec).await
3013        }
3014        /** Cancel a running campaign, stopping further deliveries and reminders.
3015 Authorization: Requires MANAGER+ role.
3016*/
3017        pub async fn cancel_campaign(
3018            &mut self,
3019            request: impl tonic::IntoRequest<super::CancelCampaignRequest>,
3020        ) -> std::result::Result<
3021            tonic::Response<super::CancelCampaignResponse>,
3022            tonic::Status,
3023        > {
3024            self.inner
3025                .ready()
3026                .await
3027                .map_err(|e| {
3028                    tonic::Status::unknown(
3029                        format!("Service was not ready: {}", e.into()),
3030                    )
3031                })?;
3032            let codec = tonic_prost::ProstCodec::default();
3033            let path = http::uri::PathAndQuery::from_static(
3034                "/pidgr.v1.CampaignService/CancelCampaign",
3035            );
3036            let mut req = request.into_request();
3037            req.extensions_mut()
3038                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "CancelCampaign"));
3039            self.inner.unary(req, path, codec).await
3040        }
3041        /** List delivery records for a campaign, optionally filtered by status.
3042 Authorization: Authenticated user within the organization.
3043*/
3044        pub async fn list_deliveries(
3045            &mut self,
3046            request: impl tonic::IntoRequest<super::ListDeliveriesRequest>,
3047        ) -> std::result::Result<
3048            tonic::Response<super::ListDeliveriesResponse>,
3049            tonic::Status,
3050        > {
3051            self.inner
3052                .ready()
3053                .await
3054                .map_err(|e| {
3055                    tonic::Status::unknown(
3056                        format!("Service was not ready: {}", e.into()),
3057                    )
3058                })?;
3059            let codec = tonic_prost::ProstCodec::default();
3060            let path = http::uri::PathAndQuery::from_static(
3061                "/pidgr.v1.CampaignService/ListDeliveries",
3062            );
3063            let mut req = request.into_request();
3064            req.extensions_mut()
3065                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "ListDeliveries"));
3066            self.inner.unary(req, path, codec).await
3067        }
3068    }
3069}
3070/// Generated server implementations.
3071pub mod campaign_service_server {
3072    #![allow(
3073        unused_variables,
3074        dead_code,
3075        missing_docs,
3076        clippy::wildcard_imports,
3077        clippy::let_unit_value,
3078    )]
3079    use tonic::codegen::*;
3080    /// Generated trait containing gRPC methods that should be implemented for use with CampaignServiceServer.
3081    #[async_trait]
3082    pub trait CampaignService: std::marker::Send + std::marker::Sync + 'static {
3083        /** Create a new campaign with a template, audience, and workflow.
3084 Authorization: Requires MANAGER+ role.
3085*/
3086        async fn create_campaign(
3087            &self,
3088            request: tonic::Request<super::CreateCampaignRequest>,
3089        ) -> std::result::Result<
3090            tonic::Response<super::CreateCampaignResponse>,
3091            tonic::Status,
3092        >;
3093        /** Start a created campaign, triggering its workflow execution via the orchestration engine.
3094 Authorization: Requires MANAGER+ role.
3095*/
3096        async fn start_campaign(
3097            &self,
3098            request: tonic::Request<super::StartCampaignRequest>,
3099        ) -> std::result::Result<
3100            tonic::Response<super::StartCampaignResponse>,
3101            tonic::Status,
3102        >;
3103        /** Retrieve a single campaign by ID.
3104 Authorization: Authenticated user within the organization.
3105*/
3106        async fn get_campaign(
3107            &self,
3108            request: tonic::Request<super::GetCampaignRequest>,
3109        ) -> std::result::Result<
3110            tonic::Response<super::GetCampaignResponse>,
3111            tonic::Status,
3112        >;
3113        /** List campaigns for the organization with pagination.
3114 Authorization: Authenticated user within the organization.
3115*/
3116        async fn list_campaigns(
3117            &self,
3118            request: tonic::Request<super::ListCampaignsRequest>,
3119        ) -> std::result::Result<
3120            tonic::Response<super::ListCampaignsResponse>,
3121            tonic::Status,
3122        >;
3123        /** Update a draft campaign (CREATED status only). Non-empty fields overwrite existing values.
3124 Authorization: Requires MANAGER+ role.
3125*/
3126        async fn update_campaign(
3127            &self,
3128            request: tonic::Request<super::UpdateCampaignRequest>,
3129        ) -> std::result::Result<
3130            tonic::Response<super::UpdateCampaignResponse>,
3131            tonic::Status,
3132        >;
3133        /** Cancel a running campaign, stopping further deliveries and reminders.
3134 Authorization: Requires MANAGER+ role.
3135*/
3136        async fn cancel_campaign(
3137            &self,
3138            request: tonic::Request<super::CancelCampaignRequest>,
3139        ) -> std::result::Result<
3140            tonic::Response<super::CancelCampaignResponse>,
3141            tonic::Status,
3142        >;
3143        /** List delivery records for a campaign, optionally filtered by status.
3144 Authorization: Authenticated user within the organization.
3145*/
3146        async fn list_deliveries(
3147            &self,
3148            request: tonic::Request<super::ListDeliveriesRequest>,
3149        ) -> std::result::Result<
3150            tonic::Response<super::ListDeliveriesResponse>,
3151            tonic::Status,
3152        >;
3153    }
3154    /** Manages the full lifecycle of communication campaigns — creation,
3155 execution, monitoring, and cancellation.
3156*/
3157    #[derive(Debug)]
3158    pub struct CampaignServiceServer<T> {
3159        inner: Arc<T>,
3160        accept_compression_encodings: EnabledCompressionEncodings,
3161        send_compression_encodings: EnabledCompressionEncodings,
3162        max_decoding_message_size: Option<usize>,
3163        max_encoding_message_size: Option<usize>,
3164    }
3165    impl<T> CampaignServiceServer<T> {
3166        pub fn new(inner: T) -> Self {
3167            Self::from_arc(Arc::new(inner))
3168        }
3169        pub fn from_arc(inner: Arc<T>) -> Self {
3170            Self {
3171                inner,
3172                accept_compression_encodings: Default::default(),
3173                send_compression_encodings: Default::default(),
3174                max_decoding_message_size: None,
3175                max_encoding_message_size: None,
3176            }
3177        }
3178        pub fn with_interceptor<F>(
3179            inner: T,
3180            interceptor: F,
3181        ) -> InterceptedService<Self, F>
3182        where
3183            F: tonic::service::Interceptor,
3184        {
3185            InterceptedService::new(Self::new(inner), interceptor)
3186        }
3187        /// Enable decompressing requests with the given encoding.
3188        #[must_use]
3189        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3190            self.accept_compression_encodings.enable(encoding);
3191            self
3192        }
3193        /// Compress responses with the given encoding, if the client supports it.
3194        #[must_use]
3195        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3196            self.send_compression_encodings.enable(encoding);
3197            self
3198        }
3199        /// Limits the maximum size of a decoded message.
3200        ///
3201        /// Default: `4MB`
3202        #[must_use]
3203        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3204            self.max_decoding_message_size = Some(limit);
3205            self
3206        }
3207        /// Limits the maximum size of an encoded message.
3208        ///
3209        /// Default: `usize::MAX`
3210        #[must_use]
3211        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3212            self.max_encoding_message_size = Some(limit);
3213            self
3214        }
3215    }
3216    impl<T, B> tonic::codegen::Service<http::Request<B>> for CampaignServiceServer<T>
3217    where
3218        T: CampaignService,
3219        B: Body + std::marker::Send + 'static,
3220        B::Error: Into<StdError> + std::marker::Send + 'static,
3221    {
3222        type Response = http::Response<tonic::body::Body>;
3223        type Error = std::convert::Infallible;
3224        type Future = BoxFuture<Self::Response, Self::Error>;
3225        fn poll_ready(
3226            &mut self,
3227            _cx: &mut Context<'_>,
3228        ) -> Poll<std::result::Result<(), Self::Error>> {
3229            Poll::Ready(Ok(()))
3230        }
3231        fn call(&mut self, req: http::Request<B>) -> Self::Future {
3232            match req.uri().path() {
3233                "/pidgr.v1.CampaignService/CreateCampaign" => {
3234                    #[allow(non_camel_case_types)]
3235                    struct CreateCampaignSvc<T: CampaignService>(pub Arc<T>);
3236                    impl<
3237                        T: CampaignService,
3238                    > tonic::server::UnaryService<super::CreateCampaignRequest>
3239                    for CreateCampaignSvc<T> {
3240                        type Response = super::CreateCampaignResponse;
3241                        type Future = BoxFuture<
3242                            tonic::Response<Self::Response>,
3243                            tonic::Status,
3244                        >;
3245                        fn call(
3246                            &mut self,
3247                            request: tonic::Request<super::CreateCampaignRequest>,
3248                        ) -> Self::Future {
3249                            let inner = Arc::clone(&self.0);
3250                            let fut = async move {
3251                                <T as CampaignService>::create_campaign(&inner, request)
3252                                    .await
3253                            };
3254                            Box::pin(fut)
3255                        }
3256                    }
3257                    let accept_compression_encodings = self.accept_compression_encodings;
3258                    let send_compression_encodings = self.send_compression_encodings;
3259                    let max_decoding_message_size = self.max_decoding_message_size;
3260                    let max_encoding_message_size = self.max_encoding_message_size;
3261                    let inner = self.inner.clone();
3262                    let fut = async move {
3263                        let method = CreateCampaignSvc(inner);
3264                        let codec = tonic_prost::ProstCodec::default();
3265                        let mut grpc = tonic::server::Grpc::new(codec)
3266                            .apply_compression_config(
3267                                accept_compression_encodings,
3268                                send_compression_encodings,
3269                            )
3270                            .apply_max_message_size_config(
3271                                max_decoding_message_size,
3272                                max_encoding_message_size,
3273                            );
3274                        let res = grpc.unary(method, req).await;
3275                        Ok(res)
3276                    };
3277                    Box::pin(fut)
3278                }
3279                "/pidgr.v1.CampaignService/StartCampaign" => {
3280                    #[allow(non_camel_case_types)]
3281                    struct StartCampaignSvc<T: CampaignService>(pub Arc<T>);
3282                    impl<
3283                        T: CampaignService,
3284                    > tonic::server::UnaryService<super::StartCampaignRequest>
3285                    for StartCampaignSvc<T> {
3286                        type Response = super::StartCampaignResponse;
3287                        type Future = BoxFuture<
3288                            tonic::Response<Self::Response>,
3289                            tonic::Status,
3290                        >;
3291                        fn call(
3292                            &mut self,
3293                            request: tonic::Request<super::StartCampaignRequest>,
3294                        ) -> Self::Future {
3295                            let inner = Arc::clone(&self.0);
3296                            let fut = async move {
3297                                <T as CampaignService>::start_campaign(&inner, request)
3298                                    .await
3299                            };
3300                            Box::pin(fut)
3301                        }
3302                    }
3303                    let accept_compression_encodings = self.accept_compression_encodings;
3304                    let send_compression_encodings = self.send_compression_encodings;
3305                    let max_decoding_message_size = self.max_decoding_message_size;
3306                    let max_encoding_message_size = self.max_encoding_message_size;
3307                    let inner = self.inner.clone();
3308                    let fut = async move {
3309                        let method = StartCampaignSvc(inner);
3310                        let codec = tonic_prost::ProstCodec::default();
3311                        let mut grpc = tonic::server::Grpc::new(codec)
3312                            .apply_compression_config(
3313                                accept_compression_encodings,
3314                                send_compression_encodings,
3315                            )
3316                            .apply_max_message_size_config(
3317                                max_decoding_message_size,
3318                                max_encoding_message_size,
3319                            );
3320                        let res = grpc.unary(method, req).await;
3321                        Ok(res)
3322                    };
3323                    Box::pin(fut)
3324                }
3325                "/pidgr.v1.CampaignService/GetCampaign" => {
3326                    #[allow(non_camel_case_types)]
3327                    struct GetCampaignSvc<T: CampaignService>(pub Arc<T>);
3328                    impl<
3329                        T: CampaignService,
3330                    > tonic::server::UnaryService<super::GetCampaignRequest>
3331                    for GetCampaignSvc<T> {
3332                        type Response = super::GetCampaignResponse;
3333                        type Future = BoxFuture<
3334                            tonic::Response<Self::Response>,
3335                            tonic::Status,
3336                        >;
3337                        fn call(
3338                            &mut self,
3339                            request: tonic::Request<super::GetCampaignRequest>,
3340                        ) -> Self::Future {
3341                            let inner = Arc::clone(&self.0);
3342                            let fut = async move {
3343                                <T as CampaignService>::get_campaign(&inner, request).await
3344                            };
3345                            Box::pin(fut)
3346                        }
3347                    }
3348                    let accept_compression_encodings = self.accept_compression_encodings;
3349                    let send_compression_encodings = self.send_compression_encodings;
3350                    let max_decoding_message_size = self.max_decoding_message_size;
3351                    let max_encoding_message_size = self.max_encoding_message_size;
3352                    let inner = self.inner.clone();
3353                    let fut = async move {
3354                        let method = GetCampaignSvc(inner);
3355                        let codec = tonic_prost::ProstCodec::default();
3356                        let mut grpc = tonic::server::Grpc::new(codec)
3357                            .apply_compression_config(
3358                                accept_compression_encodings,
3359                                send_compression_encodings,
3360                            )
3361                            .apply_max_message_size_config(
3362                                max_decoding_message_size,
3363                                max_encoding_message_size,
3364                            );
3365                        let res = grpc.unary(method, req).await;
3366                        Ok(res)
3367                    };
3368                    Box::pin(fut)
3369                }
3370                "/pidgr.v1.CampaignService/ListCampaigns" => {
3371                    #[allow(non_camel_case_types)]
3372                    struct ListCampaignsSvc<T: CampaignService>(pub Arc<T>);
3373                    impl<
3374                        T: CampaignService,
3375                    > tonic::server::UnaryService<super::ListCampaignsRequest>
3376                    for ListCampaignsSvc<T> {
3377                        type Response = super::ListCampaignsResponse;
3378                        type Future = BoxFuture<
3379                            tonic::Response<Self::Response>,
3380                            tonic::Status,
3381                        >;
3382                        fn call(
3383                            &mut self,
3384                            request: tonic::Request<super::ListCampaignsRequest>,
3385                        ) -> Self::Future {
3386                            let inner = Arc::clone(&self.0);
3387                            let fut = async move {
3388                                <T as CampaignService>::list_campaigns(&inner, request)
3389                                    .await
3390                            };
3391                            Box::pin(fut)
3392                        }
3393                    }
3394                    let accept_compression_encodings = self.accept_compression_encodings;
3395                    let send_compression_encodings = self.send_compression_encodings;
3396                    let max_decoding_message_size = self.max_decoding_message_size;
3397                    let max_encoding_message_size = self.max_encoding_message_size;
3398                    let inner = self.inner.clone();
3399                    let fut = async move {
3400                        let method = ListCampaignsSvc(inner);
3401                        let codec = tonic_prost::ProstCodec::default();
3402                        let mut grpc = tonic::server::Grpc::new(codec)
3403                            .apply_compression_config(
3404                                accept_compression_encodings,
3405                                send_compression_encodings,
3406                            )
3407                            .apply_max_message_size_config(
3408                                max_decoding_message_size,
3409                                max_encoding_message_size,
3410                            );
3411                        let res = grpc.unary(method, req).await;
3412                        Ok(res)
3413                    };
3414                    Box::pin(fut)
3415                }
3416                "/pidgr.v1.CampaignService/UpdateCampaign" => {
3417                    #[allow(non_camel_case_types)]
3418                    struct UpdateCampaignSvc<T: CampaignService>(pub Arc<T>);
3419                    impl<
3420                        T: CampaignService,
3421                    > tonic::server::UnaryService<super::UpdateCampaignRequest>
3422                    for UpdateCampaignSvc<T> {
3423                        type Response = super::UpdateCampaignResponse;
3424                        type Future = BoxFuture<
3425                            tonic::Response<Self::Response>,
3426                            tonic::Status,
3427                        >;
3428                        fn call(
3429                            &mut self,
3430                            request: tonic::Request<super::UpdateCampaignRequest>,
3431                        ) -> Self::Future {
3432                            let inner = Arc::clone(&self.0);
3433                            let fut = async move {
3434                                <T as CampaignService>::update_campaign(&inner, request)
3435                                    .await
3436                            };
3437                            Box::pin(fut)
3438                        }
3439                    }
3440                    let accept_compression_encodings = self.accept_compression_encodings;
3441                    let send_compression_encodings = self.send_compression_encodings;
3442                    let max_decoding_message_size = self.max_decoding_message_size;
3443                    let max_encoding_message_size = self.max_encoding_message_size;
3444                    let inner = self.inner.clone();
3445                    let fut = async move {
3446                        let method = UpdateCampaignSvc(inner);
3447                        let codec = tonic_prost::ProstCodec::default();
3448                        let mut grpc = tonic::server::Grpc::new(codec)
3449                            .apply_compression_config(
3450                                accept_compression_encodings,
3451                                send_compression_encodings,
3452                            )
3453                            .apply_max_message_size_config(
3454                                max_decoding_message_size,
3455                                max_encoding_message_size,
3456                            );
3457                        let res = grpc.unary(method, req).await;
3458                        Ok(res)
3459                    };
3460                    Box::pin(fut)
3461                }
3462                "/pidgr.v1.CampaignService/CancelCampaign" => {
3463                    #[allow(non_camel_case_types)]
3464                    struct CancelCampaignSvc<T: CampaignService>(pub Arc<T>);
3465                    impl<
3466                        T: CampaignService,
3467                    > tonic::server::UnaryService<super::CancelCampaignRequest>
3468                    for CancelCampaignSvc<T> {
3469                        type Response = super::CancelCampaignResponse;
3470                        type Future = BoxFuture<
3471                            tonic::Response<Self::Response>,
3472                            tonic::Status,
3473                        >;
3474                        fn call(
3475                            &mut self,
3476                            request: tonic::Request<super::CancelCampaignRequest>,
3477                        ) -> Self::Future {
3478                            let inner = Arc::clone(&self.0);
3479                            let fut = async move {
3480                                <T as CampaignService>::cancel_campaign(&inner, request)
3481                                    .await
3482                            };
3483                            Box::pin(fut)
3484                        }
3485                    }
3486                    let accept_compression_encodings = self.accept_compression_encodings;
3487                    let send_compression_encodings = self.send_compression_encodings;
3488                    let max_decoding_message_size = self.max_decoding_message_size;
3489                    let max_encoding_message_size = self.max_encoding_message_size;
3490                    let inner = self.inner.clone();
3491                    let fut = async move {
3492                        let method = CancelCampaignSvc(inner);
3493                        let codec = tonic_prost::ProstCodec::default();
3494                        let mut grpc = tonic::server::Grpc::new(codec)
3495                            .apply_compression_config(
3496                                accept_compression_encodings,
3497                                send_compression_encodings,
3498                            )
3499                            .apply_max_message_size_config(
3500                                max_decoding_message_size,
3501                                max_encoding_message_size,
3502                            );
3503                        let res = grpc.unary(method, req).await;
3504                        Ok(res)
3505                    };
3506                    Box::pin(fut)
3507                }
3508                "/pidgr.v1.CampaignService/ListDeliveries" => {
3509                    #[allow(non_camel_case_types)]
3510                    struct ListDeliveriesSvc<T: CampaignService>(pub Arc<T>);
3511                    impl<
3512                        T: CampaignService,
3513                    > tonic::server::UnaryService<super::ListDeliveriesRequest>
3514                    for ListDeliveriesSvc<T> {
3515                        type Response = super::ListDeliveriesResponse;
3516                        type Future = BoxFuture<
3517                            tonic::Response<Self::Response>,
3518                            tonic::Status,
3519                        >;
3520                        fn call(
3521                            &mut self,
3522                            request: tonic::Request<super::ListDeliveriesRequest>,
3523                        ) -> Self::Future {
3524                            let inner = Arc::clone(&self.0);
3525                            let fut = async move {
3526                                <T as CampaignService>::list_deliveries(&inner, request)
3527                                    .await
3528                            };
3529                            Box::pin(fut)
3530                        }
3531                    }
3532                    let accept_compression_encodings = self.accept_compression_encodings;
3533                    let send_compression_encodings = self.send_compression_encodings;
3534                    let max_decoding_message_size = self.max_decoding_message_size;
3535                    let max_encoding_message_size = self.max_encoding_message_size;
3536                    let inner = self.inner.clone();
3537                    let fut = async move {
3538                        let method = ListDeliveriesSvc(inner);
3539                        let codec = tonic_prost::ProstCodec::default();
3540                        let mut grpc = tonic::server::Grpc::new(codec)
3541                            .apply_compression_config(
3542                                accept_compression_encodings,
3543                                send_compression_encodings,
3544                            )
3545                            .apply_max_message_size_config(
3546                                max_decoding_message_size,
3547                                max_encoding_message_size,
3548                            );
3549                        let res = grpc.unary(method, req).await;
3550                        Ok(res)
3551                    };
3552                    Box::pin(fut)
3553                }
3554                _ => {
3555                    Box::pin(async move {
3556                        let mut response = http::Response::new(
3557                            tonic::body::Body::default(),
3558                        );
3559                        let headers = response.headers_mut();
3560                        headers
3561                            .insert(
3562                                tonic::Status::GRPC_STATUS,
3563                                (tonic::Code::Unimplemented as i32).into(),
3564                            );
3565                        headers
3566                            .insert(
3567                                http::header::CONTENT_TYPE,
3568                                tonic::metadata::GRPC_CONTENT_TYPE,
3569                            );
3570                        Ok(response)
3571                    })
3572                }
3573            }
3574        }
3575    }
3576    impl<T> Clone for CampaignServiceServer<T> {
3577        fn clone(&self) -> Self {
3578            let inner = self.inner.clone();
3579            Self {
3580                inner,
3581                accept_compression_encodings: self.accept_compression_encodings,
3582                send_compression_encodings: self.send_compression_encodings,
3583                max_decoding_message_size: self.max_decoding_message_size,
3584                max_encoding_message_size: self.max_encoding_message_size,
3585            }
3586        }
3587    }
3588    /// Generated gRPC service name
3589    pub const SERVICE_NAME: &str = "pidgr.v1.CampaignService";
3590    impl<T> tonic::server::NamedService for CampaignServiceServer<T> {
3591        const NAME: &'static str = SERVICE_NAME;
3592    }
3593}
3594/// Generated client implementations.
3595pub mod device_service_client {
3596    #![allow(
3597        unused_variables,
3598        dead_code,
3599        missing_docs,
3600        clippy::wildcard_imports,
3601        clippy::let_unit_value,
3602    )]
3603    use tonic::codegen::*;
3604    use tonic::codegen::http::Uri;
3605    /** Manages push notification device registration.
3606 Used by the mobile app to register push tokens and manage device lifecycle.
3607*/
3608    #[derive(Debug, Clone)]
3609    pub struct DeviceServiceClient<T> {
3610        inner: tonic::client::Grpc<T>,
3611    }
3612    impl DeviceServiceClient<tonic::transport::Channel> {
3613        /// Attempt to create a new client by connecting to a given endpoint.
3614        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
3615        where
3616            D: TryInto<tonic::transport::Endpoint>,
3617            D::Error: Into<StdError>,
3618        {
3619            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
3620            Ok(Self::new(conn))
3621        }
3622    }
3623    impl<T> DeviceServiceClient<T>
3624    where
3625        T: tonic::client::GrpcService<tonic::body::Body>,
3626        T::Error: Into<StdError>,
3627        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
3628        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
3629    {
3630        pub fn new(inner: T) -> Self {
3631            let inner = tonic::client::Grpc::new(inner);
3632            Self { inner }
3633        }
3634        pub fn with_origin(inner: T, origin: Uri) -> Self {
3635            let inner = tonic::client::Grpc::with_origin(inner, origin);
3636            Self { inner }
3637        }
3638        pub fn with_interceptor<F>(
3639            inner: T,
3640            interceptor: F,
3641        ) -> DeviceServiceClient<InterceptedService<T, F>>
3642        where
3643            F: tonic::service::Interceptor,
3644            T::ResponseBody: Default,
3645            T: tonic::codegen::Service<
3646                http::Request<tonic::body::Body>,
3647                Response = http::Response<
3648                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
3649                >,
3650            >,
3651            <T as tonic::codegen::Service<
3652                http::Request<tonic::body::Body>,
3653            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
3654        {
3655            DeviceServiceClient::new(InterceptedService::new(inner, interceptor))
3656        }
3657        /// Compress requests with the given encoding.
3658        ///
3659        /// This requires the server to support it otherwise it might respond with an
3660        /// error.
3661        #[must_use]
3662        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3663            self.inner = self.inner.send_compressed(encoding);
3664            self
3665        }
3666        /// Enable decompressing responses.
3667        #[must_use]
3668        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3669            self.inner = self.inner.accept_compressed(encoding);
3670            self
3671        }
3672        /// Limits the maximum size of a decoded message.
3673        ///
3674        /// Default: `4MB`
3675        #[must_use]
3676        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3677            self.inner = self.inner.max_decoding_message_size(limit);
3678            self
3679        }
3680        /// Limits the maximum size of an encoded message.
3681        ///
3682        /// Default: `usize::MAX`
3683        #[must_use]
3684        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3685            self.inner = self.inner.max_encoding_message_size(limit);
3686            self
3687        }
3688        /** Register a device with its push token for receiving notifications.
3689 Authorization: Authenticated user (own devices only).
3690*/
3691        pub async fn register(
3692            &mut self,
3693            request: impl tonic::IntoRequest<super::RegisterRequest>,
3694        ) -> std::result::Result<
3695            tonic::Response<super::RegisterResponse>,
3696            tonic::Status,
3697        > {
3698            self.inner
3699                .ready()
3700                .await
3701                .map_err(|e| {
3702                    tonic::Status::unknown(
3703                        format!("Service was not ready: {}", e.into()),
3704                    )
3705                })?;
3706            let codec = tonic_prost::ProstCodec::default();
3707            let path = http::uri::PathAndQuery::from_static(
3708                "/pidgr.v1.DeviceService/Register",
3709            );
3710            let mut req = request.into_request();
3711            req.extensions_mut()
3712                .insert(GrpcMethod::new("pidgr.v1.DeviceService", "Register"));
3713            self.inner.unary(req, path, codec).await
3714        }
3715        /** Deactivate a device, preventing further push notifications.
3716 Authorization: Authenticated user (own devices only).
3717*/
3718        pub async fn deactivate(
3719            &mut self,
3720            request: impl tonic::IntoRequest<super::DeactivateRequest>,
3721        ) -> std::result::Result<
3722            tonic::Response<super::DeactivateResponse>,
3723            tonic::Status,
3724        > {
3725            self.inner
3726                .ready()
3727                .await
3728                .map_err(|e| {
3729                    tonic::Status::unknown(
3730                        format!("Service was not ready: {}", e.into()),
3731                    )
3732                })?;
3733            let codec = tonic_prost::ProstCodec::default();
3734            let path = http::uri::PathAndQuery::from_static(
3735                "/pidgr.v1.DeviceService/Deactivate",
3736            );
3737            let mut req = request.into_request();
3738            req.extensions_mut()
3739                .insert(GrpcMethod::new("pidgr.v1.DeviceService", "Deactivate"));
3740            self.inner.unary(req, path, codec).await
3741        }
3742        /** List all devices registered to the authenticated user.
3743 Authorization: Authenticated user (own devices only).
3744*/
3745        pub async fn list_devices(
3746            &mut self,
3747            request: impl tonic::IntoRequest<super::ListDevicesRequest>,
3748        ) -> std::result::Result<
3749            tonic::Response<super::ListDevicesResponse>,
3750            tonic::Status,
3751        > {
3752            self.inner
3753                .ready()
3754                .await
3755                .map_err(|e| {
3756                    tonic::Status::unknown(
3757                        format!("Service was not ready: {}", e.into()),
3758                    )
3759                })?;
3760            let codec = tonic_prost::ProstCodec::default();
3761            let path = http::uri::PathAndQuery::from_static(
3762                "/pidgr.v1.DeviceService/ListDevices",
3763            );
3764            let mut req = request.into_request();
3765            req.extensions_mut()
3766                .insert(GrpcMethod::new("pidgr.v1.DeviceService", "ListDevices"));
3767            self.inner.unary(req, path, codec).await
3768        }
3769        /** List all devices for a specific organization member.
3770 Authorization: Requires MEMBERS_READ permission.
3771*/
3772        pub async fn list_member_devices(
3773            &mut self,
3774            request: impl tonic::IntoRequest<super::ListMemberDevicesRequest>,
3775        ) -> std::result::Result<
3776            tonic::Response<super::ListMemberDevicesResponse>,
3777            tonic::Status,
3778        > {
3779            self.inner
3780                .ready()
3781                .await
3782                .map_err(|e| {
3783                    tonic::Status::unknown(
3784                        format!("Service was not ready: {}", e.into()),
3785                    )
3786                })?;
3787            let codec = tonic_prost::ProstCodec::default();
3788            let path = http::uri::PathAndQuery::from_static(
3789                "/pidgr.v1.DeviceService/ListMemberDevices",
3790            );
3791            let mut req = request.into_request();
3792            req.extensions_mut()
3793                .insert(GrpcMethod::new("pidgr.v1.DeviceService", "ListMemberDevices"));
3794            self.inner.unary(req, path, codec).await
3795        }
3796    }
3797}
3798/// Generated server implementations.
3799pub mod device_service_server {
3800    #![allow(
3801        unused_variables,
3802        dead_code,
3803        missing_docs,
3804        clippy::wildcard_imports,
3805        clippy::let_unit_value,
3806    )]
3807    use tonic::codegen::*;
3808    /// Generated trait containing gRPC methods that should be implemented for use with DeviceServiceServer.
3809    #[async_trait]
3810    pub trait DeviceService: std::marker::Send + std::marker::Sync + 'static {
3811        /** Register a device with its push token for receiving notifications.
3812 Authorization: Authenticated user (own devices only).
3813*/
3814        async fn register(
3815            &self,
3816            request: tonic::Request<super::RegisterRequest>,
3817        ) -> std::result::Result<
3818            tonic::Response<super::RegisterResponse>,
3819            tonic::Status,
3820        >;
3821        /** Deactivate a device, preventing further push notifications.
3822 Authorization: Authenticated user (own devices only).
3823*/
3824        async fn deactivate(
3825            &self,
3826            request: tonic::Request<super::DeactivateRequest>,
3827        ) -> std::result::Result<
3828            tonic::Response<super::DeactivateResponse>,
3829            tonic::Status,
3830        >;
3831        /** List all devices registered to the authenticated user.
3832 Authorization: Authenticated user (own devices only).
3833*/
3834        async fn list_devices(
3835            &self,
3836            request: tonic::Request<super::ListDevicesRequest>,
3837        ) -> std::result::Result<
3838            tonic::Response<super::ListDevicesResponse>,
3839            tonic::Status,
3840        >;
3841        /** List all devices for a specific organization member.
3842 Authorization: Requires MEMBERS_READ permission.
3843*/
3844        async fn list_member_devices(
3845            &self,
3846            request: tonic::Request<super::ListMemberDevicesRequest>,
3847        ) -> std::result::Result<
3848            tonic::Response<super::ListMemberDevicesResponse>,
3849            tonic::Status,
3850        >;
3851    }
3852    /** Manages push notification device registration.
3853 Used by the mobile app to register push tokens and manage device lifecycle.
3854*/
3855    #[derive(Debug)]
3856    pub struct DeviceServiceServer<T> {
3857        inner: Arc<T>,
3858        accept_compression_encodings: EnabledCompressionEncodings,
3859        send_compression_encodings: EnabledCompressionEncodings,
3860        max_decoding_message_size: Option<usize>,
3861        max_encoding_message_size: Option<usize>,
3862    }
3863    impl<T> DeviceServiceServer<T> {
3864        pub fn new(inner: T) -> Self {
3865            Self::from_arc(Arc::new(inner))
3866        }
3867        pub fn from_arc(inner: Arc<T>) -> Self {
3868            Self {
3869                inner,
3870                accept_compression_encodings: Default::default(),
3871                send_compression_encodings: Default::default(),
3872                max_decoding_message_size: None,
3873                max_encoding_message_size: None,
3874            }
3875        }
3876        pub fn with_interceptor<F>(
3877            inner: T,
3878            interceptor: F,
3879        ) -> InterceptedService<Self, F>
3880        where
3881            F: tonic::service::Interceptor,
3882        {
3883            InterceptedService::new(Self::new(inner), interceptor)
3884        }
3885        /// Enable decompressing requests with the given encoding.
3886        #[must_use]
3887        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3888            self.accept_compression_encodings.enable(encoding);
3889            self
3890        }
3891        /// Compress responses with the given encoding, if the client supports it.
3892        #[must_use]
3893        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3894            self.send_compression_encodings.enable(encoding);
3895            self
3896        }
3897        /// Limits the maximum size of a decoded message.
3898        ///
3899        /// Default: `4MB`
3900        #[must_use]
3901        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3902            self.max_decoding_message_size = Some(limit);
3903            self
3904        }
3905        /// Limits the maximum size of an encoded message.
3906        ///
3907        /// Default: `usize::MAX`
3908        #[must_use]
3909        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3910            self.max_encoding_message_size = Some(limit);
3911            self
3912        }
3913    }
3914    impl<T, B> tonic::codegen::Service<http::Request<B>> for DeviceServiceServer<T>
3915    where
3916        T: DeviceService,
3917        B: Body + std::marker::Send + 'static,
3918        B::Error: Into<StdError> + std::marker::Send + 'static,
3919    {
3920        type Response = http::Response<tonic::body::Body>;
3921        type Error = std::convert::Infallible;
3922        type Future = BoxFuture<Self::Response, Self::Error>;
3923        fn poll_ready(
3924            &mut self,
3925            _cx: &mut Context<'_>,
3926        ) -> Poll<std::result::Result<(), Self::Error>> {
3927            Poll::Ready(Ok(()))
3928        }
3929        fn call(&mut self, req: http::Request<B>) -> Self::Future {
3930            match req.uri().path() {
3931                "/pidgr.v1.DeviceService/Register" => {
3932                    #[allow(non_camel_case_types)]
3933                    struct RegisterSvc<T: DeviceService>(pub Arc<T>);
3934                    impl<
3935                        T: DeviceService,
3936                    > tonic::server::UnaryService<super::RegisterRequest>
3937                    for RegisterSvc<T> {
3938                        type Response = super::RegisterResponse;
3939                        type Future = BoxFuture<
3940                            tonic::Response<Self::Response>,
3941                            tonic::Status,
3942                        >;
3943                        fn call(
3944                            &mut self,
3945                            request: tonic::Request<super::RegisterRequest>,
3946                        ) -> Self::Future {
3947                            let inner = Arc::clone(&self.0);
3948                            let fut = async move {
3949                                <T as DeviceService>::register(&inner, request).await
3950                            };
3951                            Box::pin(fut)
3952                        }
3953                    }
3954                    let accept_compression_encodings = self.accept_compression_encodings;
3955                    let send_compression_encodings = self.send_compression_encodings;
3956                    let max_decoding_message_size = self.max_decoding_message_size;
3957                    let max_encoding_message_size = self.max_encoding_message_size;
3958                    let inner = self.inner.clone();
3959                    let fut = async move {
3960                        let method = RegisterSvc(inner);
3961                        let codec = tonic_prost::ProstCodec::default();
3962                        let mut grpc = tonic::server::Grpc::new(codec)
3963                            .apply_compression_config(
3964                                accept_compression_encodings,
3965                                send_compression_encodings,
3966                            )
3967                            .apply_max_message_size_config(
3968                                max_decoding_message_size,
3969                                max_encoding_message_size,
3970                            );
3971                        let res = grpc.unary(method, req).await;
3972                        Ok(res)
3973                    };
3974                    Box::pin(fut)
3975                }
3976                "/pidgr.v1.DeviceService/Deactivate" => {
3977                    #[allow(non_camel_case_types)]
3978                    struct DeactivateSvc<T: DeviceService>(pub Arc<T>);
3979                    impl<
3980                        T: DeviceService,
3981                    > tonic::server::UnaryService<super::DeactivateRequest>
3982                    for DeactivateSvc<T> {
3983                        type Response = super::DeactivateResponse;
3984                        type Future = BoxFuture<
3985                            tonic::Response<Self::Response>,
3986                            tonic::Status,
3987                        >;
3988                        fn call(
3989                            &mut self,
3990                            request: tonic::Request<super::DeactivateRequest>,
3991                        ) -> Self::Future {
3992                            let inner = Arc::clone(&self.0);
3993                            let fut = async move {
3994                                <T as DeviceService>::deactivate(&inner, request).await
3995                            };
3996                            Box::pin(fut)
3997                        }
3998                    }
3999                    let accept_compression_encodings = self.accept_compression_encodings;
4000                    let send_compression_encodings = self.send_compression_encodings;
4001                    let max_decoding_message_size = self.max_decoding_message_size;
4002                    let max_encoding_message_size = self.max_encoding_message_size;
4003                    let inner = self.inner.clone();
4004                    let fut = async move {
4005                        let method = DeactivateSvc(inner);
4006                        let codec = tonic_prost::ProstCodec::default();
4007                        let mut grpc = tonic::server::Grpc::new(codec)
4008                            .apply_compression_config(
4009                                accept_compression_encodings,
4010                                send_compression_encodings,
4011                            )
4012                            .apply_max_message_size_config(
4013                                max_decoding_message_size,
4014                                max_encoding_message_size,
4015                            );
4016                        let res = grpc.unary(method, req).await;
4017                        Ok(res)
4018                    };
4019                    Box::pin(fut)
4020                }
4021                "/pidgr.v1.DeviceService/ListDevices" => {
4022                    #[allow(non_camel_case_types)]
4023                    struct ListDevicesSvc<T: DeviceService>(pub Arc<T>);
4024                    impl<
4025                        T: DeviceService,
4026                    > tonic::server::UnaryService<super::ListDevicesRequest>
4027                    for ListDevicesSvc<T> {
4028                        type Response = super::ListDevicesResponse;
4029                        type Future = BoxFuture<
4030                            tonic::Response<Self::Response>,
4031                            tonic::Status,
4032                        >;
4033                        fn call(
4034                            &mut self,
4035                            request: tonic::Request<super::ListDevicesRequest>,
4036                        ) -> Self::Future {
4037                            let inner = Arc::clone(&self.0);
4038                            let fut = async move {
4039                                <T as DeviceService>::list_devices(&inner, request).await
4040                            };
4041                            Box::pin(fut)
4042                        }
4043                    }
4044                    let accept_compression_encodings = self.accept_compression_encodings;
4045                    let send_compression_encodings = self.send_compression_encodings;
4046                    let max_decoding_message_size = self.max_decoding_message_size;
4047                    let max_encoding_message_size = self.max_encoding_message_size;
4048                    let inner = self.inner.clone();
4049                    let fut = async move {
4050                        let method = ListDevicesSvc(inner);
4051                        let codec = tonic_prost::ProstCodec::default();
4052                        let mut grpc = tonic::server::Grpc::new(codec)
4053                            .apply_compression_config(
4054                                accept_compression_encodings,
4055                                send_compression_encodings,
4056                            )
4057                            .apply_max_message_size_config(
4058                                max_decoding_message_size,
4059                                max_encoding_message_size,
4060                            );
4061                        let res = grpc.unary(method, req).await;
4062                        Ok(res)
4063                    };
4064                    Box::pin(fut)
4065                }
4066                "/pidgr.v1.DeviceService/ListMemberDevices" => {
4067                    #[allow(non_camel_case_types)]
4068                    struct ListMemberDevicesSvc<T: DeviceService>(pub Arc<T>);
4069                    impl<
4070                        T: DeviceService,
4071                    > tonic::server::UnaryService<super::ListMemberDevicesRequest>
4072                    for ListMemberDevicesSvc<T> {
4073                        type Response = super::ListMemberDevicesResponse;
4074                        type Future = BoxFuture<
4075                            tonic::Response<Self::Response>,
4076                            tonic::Status,
4077                        >;
4078                        fn call(
4079                            &mut self,
4080                            request: tonic::Request<super::ListMemberDevicesRequest>,
4081                        ) -> Self::Future {
4082                            let inner = Arc::clone(&self.0);
4083                            let fut = async move {
4084                                <T as DeviceService>::list_member_devices(&inner, request)
4085                                    .await
4086                            };
4087                            Box::pin(fut)
4088                        }
4089                    }
4090                    let accept_compression_encodings = self.accept_compression_encodings;
4091                    let send_compression_encodings = self.send_compression_encodings;
4092                    let max_decoding_message_size = self.max_decoding_message_size;
4093                    let max_encoding_message_size = self.max_encoding_message_size;
4094                    let inner = self.inner.clone();
4095                    let fut = async move {
4096                        let method = ListMemberDevicesSvc(inner);
4097                        let codec = tonic_prost::ProstCodec::default();
4098                        let mut grpc = tonic::server::Grpc::new(codec)
4099                            .apply_compression_config(
4100                                accept_compression_encodings,
4101                                send_compression_encodings,
4102                            )
4103                            .apply_max_message_size_config(
4104                                max_decoding_message_size,
4105                                max_encoding_message_size,
4106                            );
4107                        let res = grpc.unary(method, req).await;
4108                        Ok(res)
4109                    };
4110                    Box::pin(fut)
4111                }
4112                _ => {
4113                    Box::pin(async move {
4114                        let mut response = http::Response::new(
4115                            tonic::body::Body::default(),
4116                        );
4117                        let headers = response.headers_mut();
4118                        headers
4119                            .insert(
4120                                tonic::Status::GRPC_STATUS,
4121                                (tonic::Code::Unimplemented as i32).into(),
4122                            );
4123                        headers
4124                            .insert(
4125                                http::header::CONTENT_TYPE,
4126                                tonic::metadata::GRPC_CONTENT_TYPE,
4127                            );
4128                        Ok(response)
4129                    })
4130                }
4131            }
4132        }
4133    }
4134    impl<T> Clone for DeviceServiceServer<T> {
4135        fn clone(&self) -> Self {
4136            let inner = self.inner.clone();
4137            Self {
4138                inner,
4139                accept_compression_encodings: self.accept_compression_encodings,
4140                send_compression_encodings: self.send_compression_encodings,
4141                max_decoding_message_size: self.max_decoding_message_size,
4142                max_encoding_message_size: self.max_encoding_message_size,
4143            }
4144        }
4145    }
4146    /// Generated gRPC service name
4147    pub const SERVICE_NAME: &str = "pidgr.v1.DeviceService";
4148    impl<T> tonic::server::NamedService for DeviceServiceServer<T> {
4149        const NAME: &'static str = SERVICE_NAME;
4150    }
4151}
4152/// Generated client implementations.
4153pub mod group_service_client {
4154    #![allow(
4155        unused_variables,
4156        dead_code,
4157        missing_docs,
4158        clippy::wildcard_imports,
4159        clippy::let_unit_value,
4160    )]
4161    use tonic::codegen::*;
4162    use tonic::codegen::http::Uri;
4163    /** Manages groups and group membership within an organization.
4164 Groups are recipient collections used for campaign audience targeting.
4165 All RPCs operate within the caller's org (extracted from JWT).
4166*/
4167    #[derive(Debug, Clone)]
4168    pub struct GroupServiceClient<T> {
4169        inner: tonic::client::Grpc<T>,
4170    }
4171    impl GroupServiceClient<tonic::transport::Channel> {
4172        /// Attempt to create a new client by connecting to a given endpoint.
4173        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4174        where
4175            D: TryInto<tonic::transport::Endpoint>,
4176            D::Error: Into<StdError>,
4177        {
4178            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4179            Ok(Self::new(conn))
4180        }
4181    }
4182    impl<T> GroupServiceClient<T>
4183    where
4184        T: tonic::client::GrpcService<tonic::body::Body>,
4185        T::Error: Into<StdError>,
4186        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4187        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4188    {
4189        pub fn new(inner: T) -> Self {
4190            let inner = tonic::client::Grpc::new(inner);
4191            Self { inner }
4192        }
4193        pub fn with_origin(inner: T, origin: Uri) -> Self {
4194            let inner = tonic::client::Grpc::with_origin(inner, origin);
4195            Self { inner }
4196        }
4197        pub fn with_interceptor<F>(
4198            inner: T,
4199            interceptor: F,
4200        ) -> GroupServiceClient<InterceptedService<T, F>>
4201        where
4202            F: tonic::service::Interceptor,
4203            T::ResponseBody: Default,
4204            T: tonic::codegen::Service<
4205                http::Request<tonic::body::Body>,
4206                Response = http::Response<
4207                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4208                >,
4209            >,
4210            <T as tonic::codegen::Service<
4211                http::Request<tonic::body::Body>,
4212            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4213        {
4214            GroupServiceClient::new(InterceptedService::new(inner, interceptor))
4215        }
4216        /// Compress requests with the given encoding.
4217        ///
4218        /// This requires the server to support it otherwise it might respond with an
4219        /// error.
4220        #[must_use]
4221        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4222            self.inner = self.inner.send_compressed(encoding);
4223            self
4224        }
4225        /// Enable decompressing responses.
4226        #[must_use]
4227        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4228            self.inner = self.inner.accept_compressed(encoding);
4229            self
4230        }
4231        /// Limits the maximum size of a decoded message.
4232        ///
4233        /// Default: `4MB`
4234        #[must_use]
4235        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4236            self.inner = self.inner.max_decoding_message_size(limit);
4237            self
4238        }
4239        /// Limits the maximum size of an encoded message.
4240        ///
4241        /// Default: `usize::MAX`
4242        #[must_use]
4243        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4244            self.inner = self.inner.max_encoding_message_size(limit);
4245            self
4246        }
4247        /** Create a new group in the organization.
4248 Authorization: Requires PERMISSION_GROUPS_WRITE or PERMISSION_GROUPS_ALL_WRITE.
4249*/
4250        pub async fn create_group(
4251            &mut self,
4252            request: impl tonic::IntoRequest<super::CreateGroupRequest>,
4253        ) -> std::result::Result<
4254            tonic::Response<super::CreateGroupResponse>,
4255            tonic::Status,
4256        > {
4257            self.inner
4258                .ready()
4259                .await
4260                .map_err(|e| {
4261                    tonic::Status::unknown(
4262                        format!("Service was not ready: {}", e.into()),
4263                    )
4264                })?;
4265            let codec = tonic_prost::ProstCodec::default();
4266            let path = http::uri::PathAndQuery::from_static(
4267                "/pidgr.v1.GroupService/CreateGroup",
4268            );
4269            let mut req = request.into_request();
4270            req.extensions_mut()
4271                .insert(GrpcMethod::new("pidgr.v1.GroupService", "CreateGroup"));
4272            self.inner.unary(req, path, codec).await
4273        }
4274        /** Retrieve a group by ID.
4275 Authorization: Caller must be a member of the group, or have
4276 PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
4277*/
4278        pub async fn get_group(
4279            &mut self,
4280            request: impl tonic::IntoRequest<super::GetGroupRequest>,
4281        ) -> std::result::Result<
4282            tonic::Response<super::GetGroupResponse>,
4283            tonic::Status,
4284        > {
4285            self.inner
4286                .ready()
4287                .await
4288                .map_err(|e| {
4289                    tonic::Status::unknown(
4290                        format!("Service was not ready: {}", e.into()),
4291                    )
4292                })?;
4293            let codec = tonic_prost::ProstCodec::default();
4294            let path = http::uri::PathAndQuery::from_static(
4295                "/pidgr.v1.GroupService/GetGroup",
4296            );
4297            let mut req = request.into_request();
4298            req.extensions_mut()
4299                .insert(GrpcMethod::new("pidgr.v1.GroupService", "GetGroup"));
4300            self.inner.unary(req, path, codec).await
4301        }
4302        /** List groups in the organization with pagination.
4303 Without PERMISSION_GROUPS_ALL_READ/ALL_WRITE, returns only groups the caller belongs to.
4304*/
4305        pub async fn list_groups(
4306            &mut self,
4307            request: impl tonic::IntoRequest<super::ListGroupsRequest>,
4308        ) -> std::result::Result<
4309            tonic::Response<super::ListGroupsResponse>,
4310            tonic::Status,
4311        > {
4312            self.inner
4313                .ready()
4314                .await
4315                .map_err(|e| {
4316                    tonic::Status::unknown(
4317                        format!("Service was not ready: {}", e.into()),
4318                    )
4319                })?;
4320            let codec = tonic_prost::ProstCodec::default();
4321            let path = http::uri::PathAndQuery::from_static(
4322                "/pidgr.v1.GroupService/ListGroups",
4323            );
4324            let mut req = request.into_request();
4325            req.extensions_mut()
4326                .insert(GrpcMethod::new("pidgr.v1.GroupService", "ListGroups"));
4327            self.inner.unary(req, path, codec).await
4328        }
4329        /** Update a group's name and/or description.
4330 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
4331*/
4332        pub async fn update_group(
4333            &mut self,
4334            request: impl tonic::IntoRequest<super::UpdateGroupRequest>,
4335        ) -> std::result::Result<
4336            tonic::Response<super::UpdateGroupResponse>,
4337            tonic::Status,
4338        > {
4339            self.inner
4340                .ready()
4341                .await
4342                .map_err(|e| {
4343                    tonic::Status::unknown(
4344                        format!("Service was not ready: {}", e.into()),
4345                    )
4346                })?;
4347            let codec = tonic_prost::ProstCodec::default();
4348            let path = http::uri::PathAndQuery::from_static(
4349                "/pidgr.v1.GroupService/UpdateGroup",
4350            );
4351            let mut req = request.into_request();
4352            req.extensions_mut()
4353                .insert(GrpcMethod::new("pidgr.v1.GroupService", "UpdateGroup"));
4354            self.inner.unary(req, path, codec).await
4355        }
4356        /** Delete a group and all its membership records. Default groups cannot be deleted.
4357 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
4358*/
4359        pub async fn delete_group(
4360            &mut self,
4361            request: impl tonic::IntoRequest<super::DeleteGroupRequest>,
4362        ) -> std::result::Result<
4363            tonic::Response<super::DeleteGroupResponse>,
4364            tonic::Status,
4365        > {
4366            self.inner
4367                .ready()
4368                .await
4369                .map_err(|e| {
4370                    tonic::Status::unknown(
4371                        format!("Service was not ready: {}", e.into()),
4372                    )
4373                })?;
4374            let codec = tonic_prost::ProstCodec::default();
4375            let path = http::uri::PathAndQuery::from_static(
4376                "/pidgr.v1.GroupService/DeleteGroup",
4377            );
4378            let mut req = request.into_request();
4379            req.extensions_mut()
4380                .insert(GrpcMethod::new("pidgr.v1.GroupService", "DeleteGroup"));
4381            self.inner.unary(req, path, codec).await
4382        }
4383        /** Add one or more users to a group (idempotent).
4384 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
4385*/
4386        pub async fn add_group_members(
4387            &mut self,
4388            request: impl tonic::IntoRequest<super::AddGroupMembersRequest>,
4389        ) -> std::result::Result<
4390            tonic::Response<super::AddGroupMembersResponse>,
4391            tonic::Status,
4392        > {
4393            self.inner
4394                .ready()
4395                .await
4396                .map_err(|e| {
4397                    tonic::Status::unknown(
4398                        format!("Service was not ready: {}", e.into()),
4399                    )
4400                })?;
4401            let codec = tonic_prost::ProstCodec::default();
4402            let path = http::uri::PathAndQuery::from_static(
4403                "/pidgr.v1.GroupService/AddGroupMembers",
4404            );
4405            let mut req = request.into_request();
4406            req.extensions_mut()
4407                .insert(GrpcMethod::new("pidgr.v1.GroupService", "AddGroupMembers"));
4408            self.inner.unary(req, path, codec).await
4409        }
4410        /** Remove one or more users from a group (idempotent).
4411 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
4412*/
4413        pub async fn remove_group_members(
4414            &mut self,
4415            request: impl tonic::IntoRequest<super::RemoveGroupMembersRequest>,
4416        ) -> std::result::Result<
4417            tonic::Response<super::RemoveGroupMembersResponse>,
4418            tonic::Status,
4419        > {
4420            self.inner
4421                .ready()
4422                .await
4423                .map_err(|e| {
4424                    tonic::Status::unknown(
4425                        format!("Service was not ready: {}", e.into()),
4426                    )
4427                })?;
4428            let codec = tonic_prost::ProstCodec::default();
4429            let path = http::uri::PathAndQuery::from_static(
4430                "/pidgr.v1.GroupService/RemoveGroupMembers",
4431            );
4432            let mut req = request.into_request();
4433            req.extensions_mut()
4434                .insert(GrpcMethod::new("pidgr.v1.GroupService", "RemoveGroupMembers"));
4435            self.inner.unary(req, path, codec).await
4436        }
4437        /** List members of a group with pagination.
4438 Authorization: Caller must be a member of the group, or have
4439 PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
4440*/
4441        pub async fn list_group_members(
4442            &mut self,
4443            request: impl tonic::IntoRequest<super::ListGroupMembersRequest>,
4444        ) -> std::result::Result<
4445            tonic::Response<super::ListGroupMembersResponse>,
4446            tonic::Status,
4447        > {
4448            self.inner
4449                .ready()
4450                .await
4451                .map_err(|e| {
4452                    tonic::Status::unknown(
4453                        format!("Service was not ready: {}", e.into()),
4454                    )
4455                })?;
4456            let codec = tonic_prost::ProstCodec::default();
4457            let path = http::uri::PathAndQuery::from_static(
4458                "/pidgr.v1.GroupService/ListGroupMembers",
4459            );
4460            let mut req = request.into_request();
4461            req.extensions_mut()
4462                .insert(GrpcMethod::new("pidgr.v1.GroupService", "ListGroupMembers"));
4463            self.inner.unary(req, path, codec).await
4464        }
4465        /** Get group memberships for a batch of users.
4466 Used by campaign audience to show group badges.
4467 Authorization: Requires PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
4468*/
4469        pub async fn get_user_group_memberships(
4470            &mut self,
4471            request: impl tonic::IntoRequest<super::GetUserGroupMembershipsRequest>,
4472        ) -> std::result::Result<
4473            tonic::Response<super::GetUserGroupMembershipsResponse>,
4474            tonic::Status,
4475        > {
4476            self.inner
4477                .ready()
4478                .await
4479                .map_err(|e| {
4480                    tonic::Status::unknown(
4481                        format!("Service was not ready: {}", e.into()),
4482                    )
4483                })?;
4484            let codec = tonic_prost::ProstCodec::default();
4485            let path = http::uri::PathAndQuery::from_static(
4486                "/pidgr.v1.GroupService/GetUserGroupMemberships",
4487            );
4488            let mut req = request.into_request();
4489            req.extensions_mut()
4490                .insert(
4491                    GrpcMethod::new("pidgr.v1.GroupService", "GetUserGroupMemberships"),
4492                );
4493            self.inner.unary(req, path, codec).await
4494        }
4495    }
4496}
4497/// Generated server implementations.
4498pub mod group_service_server {
4499    #![allow(
4500        unused_variables,
4501        dead_code,
4502        missing_docs,
4503        clippy::wildcard_imports,
4504        clippy::let_unit_value,
4505    )]
4506    use tonic::codegen::*;
4507    /// Generated trait containing gRPC methods that should be implemented for use with GroupServiceServer.
4508    #[async_trait]
4509    pub trait GroupService: std::marker::Send + std::marker::Sync + 'static {
4510        /** Create a new group in the organization.
4511 Authorization: Requires PERMISSION_GROUPS_WRITE or PERMISSION_GROUPS_ALL_WRITE.
4512*/
4513        async fn create_group(
4514            &self,
4515            request: tonic::Request<super::CreateGroupRequest>,
4516        ) -> std::result::Result<
4517            tonic::Response<super::CreateGroupResponse>,
4518            tonic::Status,
4519        >;
4520        /** Retrieve a group by ID.
4521 Authorization: Caller must be a member of the group, or have
4522 PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
4523*/
4524        async fn get_group(
4525            &self,
4526            request: tonic::Request<super::GetGroupRequest>,
4527        ) -> std::result::Result<
4528            tonic::Response<super::GetGroupResponse>,
4529            tonic::Status,
4530        >;
4531        /** List groups in the organization with pagination.
4532 Without PERMISSION_GROUPS_ALL_READ/ALL_WRITE, returns only groups the caller belongs to.
4533*/
4534        async fn list_groups(
4535            &self,
4536            request: tonic::Request<super::ListGroupsRequest>,
4537        ) -> std::result::Result<
4538            tonic::Response<super::ListGroupsResponse>,
4539            tonic::Status,
4540        >;
4541        /** Update a group's name and/or description.
4542 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
4543*/
4544        async fn update_group(
4545            &self,
4546            request: tonic::Request<super::UpdateGroupRequest>,
4547        ) -> std::result::Result<
4548            tonic::Response<super::UpdateGroupResponse>,
4549            tonic::Status,
4550        >;
4551        /** Delete a group and all its membership records. Default groups cannot be deleted.
4552 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
4553*/
4554        async fn delete_group(
4555            &self,
4556            request: tonic::Request<super::DeleteGroupRequest>,
4557        ) -> std::result::Result<
4558            tonic::Response<super::DeleteGroupResponse>,
4559            tonic::Status,
4560        >;
4561        /** Add one or more users to a group (idempotent).
4562 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
4563*/
4564        async fn add_group_members(
4565            &self,
4566            request: tonic::Request<super::AddGroupMembersRequest>,
4567        ) -> std::result::Result<
4568            tonic::Response<super::AddGroupMembersResponse>,
4569            tonic::Status,
4570        >;
4571        /** Remove one or more users from a group (idempotent).
4572 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
4573*/
4574        async fn remove_group_members(
4575            &self,
4576            request: tonic::Request<super::RemoveGroupMembersRequest>,
4577        ) -> std::result::Result<
4578            tonic::Response<super::RemoveGroupMembersResponse>,
4579            tonic::Status,
4580        >;
4581        /** List members of a group with pagination.
4582 Authorization: Caller must be a member of the group, or have
4583 PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
4584*/
4585        async fn list_group_members(
4586            &self,
4587            request: tonic::Request<super::ListGroupMembersRequest>,
4588        ) -> std::result::Result<
4589            tonic::Response<super::ListGroupMembersResponse>,
4590            tonic::Status,
4591        >;
4592        /** Get group memberships for a batch of users.
4593 Used by campaign audience to show group badges.
4594 Authorization: Requires PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
4595*/
4596        async fn get_user_group_memberships(
4597            &self,
4598            request: tonic::Request<super::GetUserGroupMembershipsRequest>,
4599        ) -> std::result::Result<
4600            tonic::Response<super::GetUserGroupMembershipsResponse>,
4601            tonic::Status,
4602        >;
4603    }
4604    /** Manages groups and group membership within an organization.
4605 Groups are recipient collections used for campaign audience targeting.
4606 All RPCs operate within the caller's org (extracted from JWT).
4607*/
4608    #[derive(Debug)]
4609    pub struct GroupServiceServer<T> {
4610        inner: Arc<T>,
4611        accept_compression_encodings: EnabledCompressionEncodings,
4612        send_compression_encodings: EnabledCompressionEncodings,
4613        max_decoding_message_size: Option<usize>,
4614        max_encoding_message_size: Option<usize>,
4615    }
4616    impl<T> GroupServiceServer<T> {
4617        pub fn new(inner: T) -> Self {
4618            Self::from_arc(Arc::new(inner))
4619        }
4620        pub fn from_arc(inner: Arc<T>) -> Self {
4621            Self {
4622                inner,
4623                accept_compression_encodings: Default::default(),
4624                send_compression_encodings: Default::default(),
4625                max_decoding_message_size: None,
4626                max_encoding_message_size: None,
4627            }
4628        }
4629        pub fn with_interceptor<F>(
4630            inner: T,
4631            interceptor: F,
4632        ) -> InterceptedService<Self, F>
4633        where
4634            F: tonic::service::Interceptor,
4635        {
4636            InterceptedService::new(Self::new(inner), interceptor)
4637        }
4638        /// Enable decompressing requests with the given encoding.
4639        #[must_use]
4640        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4641            self.accept_compression_encodings.enable(encoding);
4642            self
4643        }
4644        /// Compress responses with the given encoding, if the client supports it.
4645        #[must_use]
4646        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4647            self.send_compression_encodings.enable(encoding);
4648            self
4649        }
4650        /// Limits the maximum size of a decoded message.
4651        ///
4652        /// Default: `4MB`
4653        #[must_use]
4654        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4655            self.max_decoding_message_size = Some(limit);
4656            self
4657        }
4658        /// Limits the maximum size of an encoded message.
4659        ///
4660        /// Default: `usize::MAX`
4661        #[must_use]
4662        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4663            self.max_encoding_message_size = Some(limit);
4664            self
4665        }
4666    }
4667    impl<T, B> tonic::codegen::Service<http::Request<B>> for GroupServiceServer<T>
4668    where
4669        T: GroupService,
4670        B: Body + std::marker::Send + 'static,
4671        B::Error: Into<StdError> + std::marker::Send + 'static,
4672    {
4673        type Response = http::Response<tonic::body::Body>;
4674        type Error = std::convert::Infallible;
4675        type Future = BoxFuture<Self::Response, Self::Error>;
4676        fn poll_ready(
4677            &mut self,
4678            _cx: &mut Context<'_>,
4679        ) -> Poll<std::result::Result<(), Self::Error>> {
4680            Poll::Ready(Ok(()))
4681        }
4682        fn call(&mut self, req: http::Request<B>) -> Self::Future {
4683            match req.uri().path() {
4684                "/pidgr.v1.GroupService/CreateGroup" => {
4685                    #[allow(non_camel_case_types)]
4686                    struct CreateGroupSvc<T: GroupService>(pub Arc<T>);
4687                    impl<
4688                        T: GroupService,
4689                    > tonic::server::UnaryService<super::CreateGroupRequest>
4690                    for CreateGroupSvc<T> {
4691                        type Response = super::CreateGroupResponse;
4692                        type Future = BoxFuture<
4693                            tonic::Response<Self::Response>,
4694                            tonic::Status,
4695                        >;
4696                        fn call(
4697                            &mut self,
4698                            request: tonic::Request<super::CreateGroupRequest>,
4699                        ) -> Self::Future {
4700                            let inner = Arc::clone(&self.0);
4701                            let fut = async move {
4702                                <T as GroupService>::create_group(&inner, request).await
4703                            };
4704                            Box::pin(fut)
4705                        }
4706                    }
4707                    let accept_compression_encodings = self.accept_compression_encodings;
4708                    let send_compression_encodings = self.send_compression_encodings;
4709                    let max_decoding_message_size = self.max_decoding_message_size;
4710                    let max_encoding_message_size = self.max_encoding_message_size;
4711                    let inner = self.inner.clone();
4712                    let fut = async move {
4713                        let method = CreateGroupSvc(inner);
4714                        let codec = tonic_prost::ProstCodec::default();
4715                        let mut grpc = tonic::server::Grpc::new(codec)
4716                            .apply_compression_config(
4717                                accept_compression_encodings,
4718                                send_compression_encodings,
4719                            )
4720                            .apply_max_message_size_config(
4721                                max_decoding_message_size,
4722                                max_encoding_message_size,
4723                            );
4724                        let res = grpc.unary(method, req).await;
4725                        Ok(res)
4726                    };
4727                    Box::pin(fut)
4728                }
4729                "/pidgr.v1.GroupService/GetGroup" => {
4730                    #[allow(non_camel_case_types)]
4731                    struct GetGroupSvc<T: GroupService>(pub Arc<T>);
4732                    impl<
4733                        T: GroupService,
4734                    > tonic::server::UnaryService<super::GetGroupRequest>
4735                    for GetGroupSvc<T> {
4736                        type Response = super::GetGroupResponse;
4737                        type Future = BoxFuture<
4738                            tonic::Response<Self::Response>,
4739                            tonic::Status,
4740                        >;
4741                        fn call(
4742                            &mut self,
4743                            request: tonic::Request<super::GetGroupRequest>,
4744                        ) -> Self::Future {
4745                            let inner = Arc::clone(&self.0);
4746                            let fut = async move {
4747                                <T as GroupService>::get_group(&inner, request).await
4748                            };
4749                            Box::pin(fut)
4750                        }
4751                    }
4752                    let accept_compression_encodings = self.accept_compression_encodings;
4753                    let send_compression_encodings = self.send_compression_encodings;
4754                    let max_decoding_message_size = self.max_decoding_message_size;
4755                    let max_encoding_message_size = self.max_encoding_message_size;
4756                    let inner = self.inner.clone();
4757                    let fut = async move {
4758                        let method = GetGroupSvc(inner);
4759                        let codec = tonic_prost::ProstCodec::default();
4760                        let mut grpc = tonic::server::Grpc::new(codec)
4761                            .apply_compression_config(
4762                                accept_compression_encodings,
4763                                send_compression_encodings,
4764                            )
4765                            .apply_max_message_size_config(
4766                                max_decoding_message_size,
4767                                max_encoding_message_size,
4768                            );
4769                        let res = grpc.unary(method, req).await;
4770                        Ok(res)
4771                    };
4772                    Box::pin(fut)
4773                }
4774                "/pidgr.v1.GroupService/ListGroups" => {
4775                    #[allow(non_camel_case_types)]
4776                    struct ListGroupsSvc<T: GroupService>(pub Arc<T>);
4777                    impl<
4778                        T: GroupService,
4779                    > tonic::server::UnaryService<super::ListGroupsRequest>
4780                    for ListGroupsSvc<T> {
4781                        type Response = super::ListGroupsResponse;
4782                        type Future = BoxFuture<
4783                            tonic::Response<Self::Response>,
4784                            tonic::Status,
4785                        >;
4786                        fn call(
4787                            &mut self,
4788                            request: tonic::Request<super::ListGroupsRequest>,
4789                        ) -> Self::Future {
4790                            let inner = Arc::clone(&self.0);
4791                            let fut = async move {
4792                                <T as GroupService>::list_groups(&inner, request).await
4793                            };
4794                            Box::pin(fut)
4795                        }
4796                    }
4797                    let accept_compression_encodings = self.accept_compression_encodings;
4798                    let send_compression_encodings = self.send_compression_encodings;
4799                    let max_decoding_message_size = self.max_decoding_message_size;
4800                    let max_encoding_message_size = self.max_encoding_message_size;
4801                    let inner = self.inner.clone();
4802                    let fut = async move {
4803                        let method = ListGroupsSvc(inner);
4804                        let codec = tonic_prost::ProstCodec::default();
4805                        let mut grpc = tonic::server::Grpc::new(codec)
4806                            .apply_compression_config(
4807                                accept_compression_encodings,
4808                                send_compression_encodings,
4809                            )
4810                            .apply_max_message_size_config(
4811                                max_decoding_message_size,
4812                                max_encoding_message_size,
4813                            );
4814                        let res = grpc.unary(method, req).await;
4815                        Ok(res)
4816                    };
4817                    Box::pin(fut)
4818                }
4819                "/pidgr.v1.GroupService/UpdateGroup" => {
4820                    #[allow(non_camel_case_types)]
4821                    struct UpdateGroupSvc<T: GroupService>(pub Arc<T>);
4822                    impl<
4823                        T: GroupService,
4824                    > tonic::server::UnaryService<super::UpdateGroupRequest>
4825                    for UpdateGroupSvc<T> {
4826                        type Response = super::UpdateGroupResponse;
4827                        type Future = BoxFuture<
4828                            tonic::Response<Self::Response>,
4829                            tonic::Status,
4830                        >;
4831                        fn call(
4832                            &mut self,
4833                            request: tonic::Request<super::UpdateGroupRequest>,
4834                        ) -> Self::Future {
4835                            let inner = Arc::clone(&self.0);
4836                            let fut = async move {
4837                                <T as GroupService>::update_group(&inner, request).await
4838                            };
4839                            Box::pin(fut)
4840                        }
4841                    }
4842                    let accept_compression_encodings = self.accept_compression_encodings;
4843                    let send_compression_encodings = self.send_compression_encodings;
4844                    let max_decoding_message_size = self.max_decoding_message_size;
4845                    let max_encoding_message_size = self.max_encoding_message_size;
4846                    let inner = self.inner.clone();
4847                    let fut = async move {
4848                        let method = UpdateGroupSvc(inner);
4849                        let codec = tonic_prost::ProstCodec::default();
4850                        let mut grpc = tonic::server::Grpc::new(codec)
4851                            .apply_compression_config(
4852                                accept_compression_encodings,
4853                                send_compression_encodings,
4854                            )
4855                            .apply_max_message_size_config(
4856                                max_decoding_message_size,
4857                                max_encoding_message_size,
4858                            );
4859                        let res = grpc.unary(method, req).await;
4860                        Ok(res)
4861                    };
4862                    Box::pin(fut)
4863                }
4864                "/pidgr.v1.GroupService/DeleteGroup" => {
4865                    #[allow(non_camel_case_types)]
4866                    struct DeleteGroupSvc<T: GroupService>(pub Arc<T>);
4867                    impl<
4868                        T: GroupService,
4869                    > tonic::server::UnaryService<super::DeleteGroupRequest>
4870                    for DeleteGroupSvc<T> {
4871                        type Response = super::DeleteGroupResponse;
4872                        type Future = BoxFuture<
4873                            tonic::Response<Self::Response>,
4874                            tonic::Status,
4875                        >;
4876                        fn call(
4877                            &mut self,
4878                            request: tonic::Request<super::DeleteGroupRequest>,
4879                        ) -> Self::Future {
4880                            let inner = Arc::clone(&self.0);
4881                            let fut = async move {
4882                                <T as GroupService>::delete_group(&inner, request).await
4883                            };
4884                            Box::pin(fut)
4885                        }
4886                    }
4887                    let accept_compression_encodings = self.accept_compression_encodings;
4888                    let send_compression_encodings = self.send_compression_encodings;
4889                    let max_decoding_message_size = self.max_decoding_message_size;
4890                    let max_encoding_message_size = self.max_encoding_message_size;
4891                    let inner = self.inner.clone();
4892                    let fut = async move {
4893                        let method = DeleteGroupSvc(inner);
4894                        let codec = tonic_prost::ProstCodec::default();
4895                        let mut grpc = tonic::server::Grpc::new(codec)
4896                            .apply_compression_config(
4897                                accept_compression_encodings,
4898                                send_compression_encodings,
4899                            )
4900                            .apply_max_message_size_config(
4901                                max_decoding_message_size,
4902                                max_encoding_message_size,
4903                            );
4904                        let res = grpc.unary(method, req).await;
4905                        Ok(res)
4906                    };
4907                    Box::pin(fut)
4908                }
4909                "/pidgr.v1.GroupService/AddGroupMembers" => {
4910                    #[allow(non_camel_case_types)]
4911                    struct AddGroupMembersSvc<T: GroupService>(pub Arc<T>);
4912                    impl<
4913                        T: GroupService,
4914                    > tonic::server::UnaryService<super::AddGroupMembersRequest>
4915                    for AddGroupMembersSvc<T> {
4916                        type Response = super::AddGroupMembersResponse;
4917                        type Future = BoxFuture<
4918                            tonic::Response<Self::Response>,
4919                            tonic::Status,
4920                        >;
4921                        fn call(
4922                            &mut self,
4923                            request: tonic::Request<super::AddGroupMembersRequest>,
4924                        ) -> Self::Future {
4925                            let inner = Arc::clone(&self.0);
4926                            let fut = async move {
4927                                <T as GroupService>::add_group_members(&inner, request)
4928                                    .await
4929                            };
4930                            Box::pin(fut)
4931                        }
4932                    }
4933                    let accept_compression_encodings = self.accept_compression_encodings;
4934                    let send_compression_encodings = self.send_compression_encodings;
4935                    let max_decoding_message_size = self.max_decoding_message_size;
4936                    let max_encoding_message_size = self.max_encoding_message_size;
4937                    let inner = self.inner.clone();
4938                    let fut = async move {
4939                        let method = AddGroupMembersSvc(inner);
4940                        let codec = tonic_prost::ProstCodec::default();
4941                        let mut grpc = tonic::server::Grpc::new(codec)
4942                            .apply_compression_config(
4943                                accept_compression_encodings,
4944                                send_compression_encodings,
4945                            )
4946                            .apply_max_message_size_config(
4947                                max_decoding_message_size,
4948                                max_encoding_message_size,
4949                            );
4950                        let res = grpc.unary(method, req).await;
4951                        Ok(res)
4952                    };
4953                    Box::pin(fut)
4954                }
4955                "/pidgr.v1.GroupService/RemoveGroupMembers" => {
4956                    #[allow(non_camel_case_types)]
4957                    struct RemoveGroupMembersSvc<T: GroupService>(pub Arc<T>);
4958                    impl<
4959                        T: GroupService,
4960                    > tonic::server::UnaryService<super::RemoveGroupMembersRequest>
4961                    for RemoveGroupMembersSvc<T> {
4962                        type Response = super::RemoveGroupMembersResponse;
4963                        type Future = BoxFuture<
4964                            tonic::Response<Self::Response>,
4965                            tonic::Status,
4966                        >;
4967                        fn call(
4968                            &mut self,
4969                            request: tonic::Request<super::RemoveGroupMembersRequest>,
4970                        ) -> Self::Future {
4971                            let inner = Arc::clone(&self.0);
4972                            let fut = async move {
4973                                <T as GroupService>::remove_group_members(&inner, request)
4974                                    .await
4975                            };
4976                            Box::pin(fut)
4977                        }
4978                    }
4979                    let accept_compression_encodings = self.accept_compression_encodings;
4980                    let send_compression_encodings = self.send_compression_encodings;
4981                    let max_decoding_message_size = self.max_decoding_message_size;
4982                    let max_encoding_message_size = self.max_encoding_message_size;
4983                    let inner = self.inner.clone();
4984                    let fut = async move {
4985                        let method = RemoveGroupMembersSvc(inner);
4986                        let codec = tonic_prost::ProstCodec::default();
4987                        let mut grpc = tonic::server::Grpc::new(codec)
4988                            .apply_compression_config(
4989                                accept_compression_encodings,
4990                                send_compression_encodings,
4991                            )
4992                            .apply_max_message_size_config(
4993                                max_decoding_message_size,
4994                                max_encoding_message_size,
4995                            );
4996                        let res = grpc.unary(method, req).await;
4997                        Ok(res)
4998                    };
4999                    Box::pin(fut)
5000                }
5001                "/pidgr.v1.GroupService/ListGroupMembers" => {
5002                    #[allow(non_camel_case_types)]
5003                    struct ListGroupMembersSvc<T: GroupService>(pub Arc<T>);
5004                    impl<
5005                        T: GroupService,
5006                    > tonic::server::UnaryService<super::ListGroupMembersRequest>
5007                    for ListGroupMembersSvc<T> {
5008                        type Response = super::ListGroupMembersResponse;
5009                        type Future = BoxFuture<
5010                            tonic::Response<Self::Response>,
5011                            tonic::Status,
5012                        >;
5013                        fn call(
5014                            &mut self,
5015                            request: tonic::Request<super::ListGroupMembersRequest>,
5016                        ) -> Self::Future {
5017                            let inner = Arc::clone(&self.0);
5018                            let fut = async move {
5019                                <T as GroupService>::list_group_members(&inner, request)
5020                                    .await
5021                            };
5022                            Box::pin(fut)
5023                        }
5024                    }
5025                    let accept_compression_encodings = self.accept_compression_encodings;
5026                    let send_compression_encodings = self.send_compression_encodings;
5027                    let max_decoding_message_size = self.max_decoding_message_size;
5028                    let max_encoding_message_size = self.max_encoding_message_size;
5029                    let inner = self.inner.clone();
5030                    let fut = async move {
5031                        let method = ListGroupMembersSvc(inner);
5032                        let codec = tonic_prost::ProstCodec::default();
5033                        let mut grpc = tonic::server::Grpc::new(codec)
5034                            .apply_compression_config(
5035                                accept_compression_encodings,
5036                                send_compression_encodings,
5037                            )
5038                            .apply_max_message_size_config(
5039                                max_decoding_message_size,
5040                                max_encoding_message_size,
5041                            );
5042                        let res = grpc.unary(method, req).await;
5043                        Ok(res)
5044                    };
5045                    Box::pin(fut)
5046                }
5047                "/pidgr.v1.GroupService/GetUserGroupMemberships" => {
5048                    #[allow(non_camel_case_types)]
5049                    struct GetUserGroupMembershipsSvc<T: GroupService>(pub Arc<T>);
5050                    impl<
5051                        T: GroupService,
5052                    > tonic::server::UnaryService<super::GetUserGroupMembershipsRequest>
5053                    for GetUserGroupMembershipsSvc<T> {
5054                        type Response = super::GetUserGroupMembershipsResponse;
5055                        type Future = BoxFuture<
5056                            tonic::Response<Self::Response>,
5057                            tonic::Status,
5058                        >;
5059                        fn call(
5060                            &mut self,
5061                            request: tonic::Request<
5062                                super::GetUserGroupMembershipsRequest,
5063                            >,
5064                        ) -> Self::Future {
5065                            let inner = Arc::clone(&self.0);
5066                            let fut = async move {
5067                                <T as GroupService>::get_user_group_memberships(
5068                                        &inner,
5069                                        request,
5070                                    )
5071                                    .await
5072                            };
5073                            Box::pin(fut)
5074                        }
5075                    }
5076                    let accept_compression_encodings = self.accept_compression_encodings;
5077                    let send_compression_encodings = self.send_compression_encodings;
5078                    let max_decoding_message_size = self.max_decoding_message_size;
5079                    let max_encoding_message_size = self.max_encoding_message_size;
5080                    let inner = self.inner.clone();
5081                    let fut = async move {
5082                        let method = GetUserGroupMembershipsSvc(inner);
5083                        let codec = tonic_prost::ProstCodec::default();
5084                        let mut grpc = tonic::server::Grpc::new(codec)
5085                            .apply_compression_config(
5086                                accept_compression_encodings,
5087                                send_compression_encodings,
5088                            )
5089                            .apply_max_message_size_config(
5090                                max_decoding_message_size,
5091                                max_encoding_message_size,
5092                            );
5093                        let res = grpc.unary(method, req).await;
5094                        Ok(res)
5095                    };
5096                    Box::pin(fut)
5097                }
5098                _ => {
5099                    Box::pin(async move {
5100                        let mut response = http::Response::new(
5101                            tonic::body::Body::default(),
5102                        );
5103                        let headers = response.headers_mut();
5104                        headers
5105                            .insert(
5106                                tonic::Status::GRPC_STATUS,
5107                                (tonic::Code::Unimplemented as i32).into(),
5108                            );
5109                        headers
5110                            .insert(
5111                                http::header::CONTENT_TYPE,
5112                                tonic::metadata::GRPC_CONTENT_TYPE,
5113                            );
5114                        Ok(response)
5115                    })
5116                }
5117            }
5118        }
5119    }
5120    impl<T> Clone for GroupServiceServer<T> {
5121        fn clone(&self) -> Self {
5122            let inner = self.inner.clone();
5123            Self {
5124                inner,
5125                accept_compression_encodings: self.accept_compression_encodings,
5126                send_compression_encodings: self.send_compression_encodings,
5127                max_decoding_message_size: self.max_decoding_message_size,
5128                max_encoding_message_size: self.max_encoding_message_size,
5129            }
5130        }
5131    }
5132    /// Generated gRPC service name
5133    pub const SERVICE_NAME: &str = "pidgr.v1.GroupService";
5134    impl<T> tonic::server::NamedService for GroupServiceServer<T> {
5135        const NAME: &'static str = SERVICE_NAME;
5136    }
5137}
5138/// Generated client implementations.
5139pub mod heatmap_service_client {
5140    #![allow(
5141        unused_variables,
5142        dead_code,
5143        missing_docs,
5144        clippy::wildcard_imports,
5145        clippy::let_unit_value,
5146    )]
5147    use tonic::codegen::*;
5148    use tonic::codegen::http::Uri;
5149    /** Manages touch event ingestion, heatmap data aggregation, and screen screenshots
5150 for mobile app interaction analytics.
5151*/
5152    #[derive(Debug, Clone)]
5153    pub struct HeatmapServiceClient<T> {
5154        inner: tonic::client::Grpc<T>,
5155    }
5156    impl HeatmapServiceClient<tonic::transport::Channel> {
5157        /// Attempt to create a new client by connecting to a given endpoint.
5158        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5159        where
5160            D: TryInto<tonic::transport::Endpoint>,
5161            D::Error: Into<StdError>,
5162        {
5163            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5164            Ok(Self::new(conn))
5165        }
5166    }
5167    impl<T> HeatmapServiceClient<T>
5168    where
5169        T: tonic::client::GrpcService<tonic::body::Body>,
5170        T::Error: Into<StdError>,
5171        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5172        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5173    {
5174        pub fn new(inner: T) -> Self {
5175            let inner = tonic::client::Grpc::new(inner);
5176            Self { inner }
5177        }
5178        pub fn with_origin(inner: T, origin: Uri) -> Self {
5179            let inner = tonic::client::Grpc::with_origin(inner, origin);
5180            Self { inner }
5181        }
5182        pub fn with_interceptor<F>(
5183            inner: T,
5184            interceptor: F,
5185        ) -> HeatmapServiceClient<InterceptedService<T, F>>
5186        where
5187            F: tonic::service::Interceptor,
5188            T::ResponseBody: Default,
5189            T: tonic::codegen::Service<
5190                http::Request<tonic::body::Body>,
5191                Response = http::Response<
5192                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
5193                >,
5194            >,
5195            <T as tonic::codegen::Service<
5196                http::Request<tonic::body::Body>,
5197            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
5198        {
5199            HeatmapServiceClient::new(InterceptedService::new(inner, interceptor))
5200        }
5201        /// Compress requests with the given encoding.
5202        ///
5203        /// This requires the server to support it otherwise it might respond with an
5204        /// error.
5205        #[must_use]
5206        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5207            self.inner = self.inner.send_compressed(encoding);
5208            self
5209        }
5210        /// Enable decompressing responses.
5211        #[must_use]
5212        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5213            self.inner = self.inner.accept_compressed(encoding);
5214            self
5215        }
5216        /// Limits the maximum size of a decoded message.
5217        ///
5218        /// Default: `4MB`
5219        #[must_use]
5220        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5221            self.inner = self.inner.max_decoding_message_size(limit);
5222            self
5223        }
5224        /// Limits the maximum size of an encoded message.
5225        ///
5226        /// Default: `usize::MAX`
5227        #[must_use]
5228        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5229            self.inner = self.inner.max_encoding_message_size(limit);
5230            self
5231        }
5232        /** Ingest a batch of touch events from the mobile app.
5233 Authorization: Authenticated mobile user.
5234*/
5235        pub async fn ingest_touch_events(
5236            &mut self,
5237            request: impl tonic::IntoRequest<super::IngestTouchEventsRequest>,
5238        ) -> std::result::Result<
5239            tonic::Response<super::IngestTouchEventsResponse>,
5240            tonic::Status,
5241        > {
5242            self.inner
5243                .ready()
5244                .await
5245                .map_err(|e| {
5246                    tonic::Status::unknown(
5247                        format!("Service was not ready: {}", e.into()),
5248                    )
5249                })?;
5250            let codec = tonic_prost::ProstCodec::default();
5251            let path = http::uri::PathAndQuery::from_static(
5252                "/pidgr.v1.HeatmapService/IngestTouchEvents",
5253            );
5254            let mut req = request.into_request();
5255            req.extensions_mut()
5256                .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "IngestTouchEvents"));
5257            self.inner.unary(req, path, codec).await
5258        }
5259        /** Query aggregated touch data for heatmap rendering.
5260 Authorization: Requires CAMPAIGNS_READ permission.
5261*/
5262        pub async fn query_heatmap_data(
5263            &mut self,
5264            request: impl tonic::IntoRequest<super::QueryHeatmapDataRequest>,
5265        ) -> std::result::Result<
5266            tonic::Response<super::QueryHeatmapDataResponse>,
5267            tonic::Status,
5268        > {
5269            self.inner
5270                .ready()
5271                .await
5272                .map_err(|e| {
5273                    tonic::Status::unknown(
5274                        format!("Service was not ready: {}", e.into()),
5275                    )
5276                })?;
5277            let codec = tonic_prost::ProstCodec::default();
5278            let path = http::uri::PathAndQuery::from_static(
5279                "/pidgr.v1.HeatmapService/QueryHeatmapData",
5280            );
5281            let mut req = request.into_request();
5282            req.extensions_mut()
5283                .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "QueryHeatmapData"));
5284            self.inner.unary(req, path, codec).await
5285        }
5286        /** List available screen screenshots for heatmap backgrounds.
5287 Authorization: Requires CAMPAIGNS_READ permission.
5288*/
5289        pub async fn list_screenshots(
5290            &mut self,
5291            request: impl tonic::IntoRequest<super::ListScreenshotsRequest>,
5292        ) -> std::result::Result<
5293            tonic::Response<super::ListScreenshotsResponse>,
5294            tonic::Status,
5295        > {
5296            self.inner
5297                .ready()
5298                .await
5299                .map_err(|e| {
5300                    tonic::Status::unknown(
5301                        format!("Service was not ready: {}", e.into()),
5302                    )
5303                })?;
5304            let codec = tonic_prost::ProstCodec::default();
5305            let path = http::uri::PathAndQuery::from_static(
5306                "/pidgr.v1.HeatmapService/ListScreenshots",
5307            );
5308            let mut req = request.into_request();
5309            req.extensions_mut()
5310                .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "ListScreenshots"));
5311            self.inner.unary(req, path, codec).await
5312        }
5313        /** Upload a screenshot captured from the mobile app for heatmap backdrops.
5314 Authorization: Authenticated mobile user.
5315*/
5316        pub async fn upload_screenshot(
5317            &mut self,
5318            request: impl tonic::IntoRequest<super::UploadScreenshotRequest>,
5319        ) -> std::result::Result<
5320            tonic::Response<super::UploadScreenshotResponse>,
5321            tonic::Status,
5322        > {
5323            self.inner
5324                .ready()
5325                .await
5326                .map_err(|e| {
5327                    tonic::Status::unknown(
5328                        format!("Service was not ready: {}", e.into()),
5329                    )
5330                })?;
5331            let codec = tonic_prost::ProstCodec::default();
5332            let path = http::uri::PathAndQuery::from_static(
5333                "/pidgr.v1.HeatmapService/UploadScreenshot",
5334            );
5335            let mut req = request.into_request();
5336            req.extensions_mut()
5337                .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "UploadScreenshot"));
5338            self.inner.unary(req, path, codec).await
5339        }
5340    }
5341}
5342/// Generated server implementations.
5343pub mod heatmap_service_server {
5344    #![allow(
5345        unused_variables,
5346        dead_code,
5347        missing_docs,
5348        clippy::wildcard_imports,
5349        clippy::let_unit_value,
5350    )]
5351    use tonic::codegen::*;
5352    /// Generated trait containing gRPC methods that should be implemented for use with HeatmapServiceServer.
5353    #[async_trait]
5354    pub trait HeatmapService: std::marker::Send + std::marker::Sync + 'static {
5355        /** Ingest a batch of touch events from the mobile app.
5356 Authorization: Authenticated mobile user.
5357*/
5358        async fn ingest_touch_events(
5359            &self,
5360            request: tonic::Request<super::IngestTouchEventsRequest>,
5361        ) -> std::result::Result<
5362            tonic::Response<super::IngestTouchEventsResponse>,
5363            tonic::Status,
5364        >;
5365        /** Query aggregated touch data for heatmap rendering.
5366 Authorization: Requires CAMPAIGNS_READ permission.
5367*/
5368        async fn query_heatmap_data(
5369            &self,
5370            request: tonic::Request<super::QueryHeatmapDataRequest>,
5371        ) -> std::result::Result<
5372            tonic::Response<super::QueryHeatmapDataResponse>,
5373            tonic::Status,
5374        >;
5375        /** List available screen screenshots for heatmap backgrounds.
5376 Authorization: Requires CAMPAIGNS_READ permission.
5377*/
5378        async fn list_screenshots(
5379            &self,
5380            request: tonic::Request<super::ListScreenshotsRequest>,
5381        ) -> std::result::Result<
5382            tonic::Response<super::ListScreenshotsResponse>,
5383            tonic::Status,
5384        >;
5385        /** Upload a screenshot captured from the mobile app for heatmap backdrops.
5386 Authorization: Authenticated mobile user.
5387*/
5388        async fn upload_screenshot(
5389            &self,
5390            request: tonic::Request<super::UploadScreenshotRequest>,
5391        ) -> std::result::Result<
5392            tonic::Response<super::UploadScreenshotResponse>,
5393            tonic::Status,
5394        >;
5395    }
5396    /** Manages touch event ingestion, heatmap data aggregation, and screen screenshots
5397 for mobile app interaction analytics.
5398*/
5399    #[derive(Debug)]
5400    pub struct HeatmapServiceServer<T> {
5401        inner: Arc<T>,
5402        accept_compression_encodings: EnabledCompressionEncodings,
5403        send_compression_encodings: EnabledCompressionEncodings,
5404        max_decoding_message_size: Option<usize>,
5405        max_encoding_message_size: Option<usize>,
5406    }
5407    impl<T> HeatmapServiceServer<T> {
5408        pub fn new(inner: T) -> Self {
5409            Self::from_arc(Arc::new(inner))
5410        }
5411        pub fn from_arc(inner: Arc<T>) -> Self {
5412            Self {
5413                inner,
5414                accept_compression_encodings: Default::default(),
5415                send_compression_encodings: Default::default(),
5416                max_decoding_message_size: None,
5417                max_encoding_message_size: None,
5418            }
5419        }
5420        pub fn with_interceptor<F>(
5421            inner: T,
5422            interceptor: F,
5423        ) -> InterceptedService<Self, F>
5424        where
5425            F: tonic::service::Interceptor,
5426        {
5427            InterceptedService::new(Self::new(inner), interceptor)
5428        }
5429        /// Enable decompressing requests with the given encoding.
5430        #[must_use]
5431        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5432            self.accept_compression_encodings.enable(encoding);
5433            self
5434        }
5435        /// Compress responses with the given encoding, if the client supports it.
5436        #[must_use]
5437        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5438            self.send_compression_encodings.enable(encoding);
5439            self
5440        }
5441        /// Limits the maximum size of a decoded message.
5442        ///
5443        /// Default: `4MB`
5444        #[must_use]
5445        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5446            self.max_decoding_message_size = Some(limit);
5447            self
5448        }
5449        /// Limits the maximum size of an encoded message.
5450        ///
5451        /// Default: `usize::MAX`
5452        #[must_use]
5453        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5454            self.max_encoding_message_size = Some(limit);
5455            self
5456        }
5457    }
5458    impl<T, B> tonic::codegen::Service<http::Request<B>> for HeatmapServiceServer<T>
5459    where
5460        T: HeatmapService,
5461        B: Body + std::marker::Send + 'static,
5462        B::Error: Into<StdError> + std::marker::Send + 'static,
5463    {
5464        type Response = http::Response<tonic::body::Body>;
5465        type Error = std::convert::Infallible;
5466        type Future = BoxFuture<Self::Response, Self::Error>;
5467        fn poll_ready(
5468            &mut self,
5469            _cx: &mut Context<'_>,
5470        ) -> Poll<std::result::Result<(), Self::Error>> {
5471            Poll::Ready(Ok(()))
5472        }
5473        fn call(&mut self, req: http::Request<B>) -> Self::Future {
5474            match req.uri().path() {
5475                "/pidgr.v1.HeatmapService/IngestTouchEvents" => {
5476                    #[allow(non_camel_case_types)]
5477                    struct IngestTouchEventsSvc<T: HeatmapService>(pub Arc<T>);
5478                    impl<
5479                        T: HeatmapService,
5480                    > tonic::server::UnaryService<super::IngestTouchEventsRequest>
5481                    for IngestTouchEventsSvc<T> {
5482                        type Response = super::IngestTouchEventsResponse;
5483                        type Future = BoxFuture<
5484                            tonic::Response<Self::Response>,
5485                            tonic::Status,
5486                        >;
5487                        fn call(
5488                            &mut self,
5489                            request: tonic::Request<super::IngestTouchEventsRequest>,
5490                        ) -> Self::Future {
5491                            let inner = Arc::clone(&self.0);
5492                            let fut = async move {
5493                                <T as HeatmapService>::ingest_touch_events(&inner, request)
5494                                    .await
5495                            };
5496                            Box::pin(fut)
5497                        }
5498                    }
5499                    let accept_compression_encodings = self.accept_compression_encodings;
5500                    let send_compression_encodings = self.send_compression_encodings;
5501                    let max_decoding_message_size = self.max_decoding_message_size;
5502                    let max_encoding_message_size = self.max_encoding_message_size;
5503                    let inner = self.inner.clone();
5504                    let fut = async move {
5505                        let method = IngestTouchEventsSvc(inner);
5506                        let codec = tonic_prost::ProstCodec::default();
5507                        let mut grpc = tonic::server::Grpc::new(codec)
5508                            .apply_compression_config(
5509                                accept_compression_encodings,
5510                                send_compression_encodings,
5511                            )
5512                            .apply_max_message_size_config(
5513                                max_decoding_message_size,
5514                                max_encoding_message_size,
5515                            );
5516                        let res = grpc.unary(method, req).await;
5517                        Ok(res)
5518                    };
5519                    Box::pin(fut)
5520                }
5521                "/pidgr.v1.HeatmapService/QueryHeatmapData" => {
5522                    #[allow(non_camel_case_types)]
5523                    struct QueryHeatmapDataSvc<T: HeatmapService>(pub Arc<T>);
5524                    impl<
5525                        T: HeatmapService,
5526                    > tonic::server::UnaryService<super::QueryHeatmapDataRequest>
5527                    for QueryHeatmapDataSvc<T> {
5528                        type Response = super::QueryHeatmapDataResponse;
5529                        type Future = BoxFuture<
5530                            tonic::Response<Self::Response>,
5531                            tonic::Status,
5532                        >;
5533                        fn call(
5534                            &mut self,
5535                            request: tonic::Request<super::QueryHeatmapDataRequest>,
5536                        ) -> Self::Future {
5537                            let inner = Arc::clone(&self.0);
5538                            let fut = async move {
5539                                <T as HeatmapService>::query_heatmap_data(&inner, request)
5540                                    .await
5541                            };
5542                            Box::pin(fut)
5543                        }
5544                    }
5545                    let accept_compression_encodings = self.accept_compression_encodings;
5546                    let send_compression_encodings = self.send_compression_encodings;
5547                    let max_decoding_message_size = self.max_decoding_message_size;
5548                    let max_encoding_message_size = self.max_encoding_message_size;
5549                    let inner = self.inner.clone();
5550                    let fut = async move {
5551                        let method = QueryHeatmapDataSvc(inner);
5552                        let codec = tonic_prost::ProstCodec::default();
5553                        let mut grpc = tonic::server::Grpc::new(codec)
5554                            .apply_compression_config(
5555                                accept_compression_encodings,
5556                                send_compression_encodings,
5557                            )
5558                            .apply_max_message_size_config(
5559                                max_decoding_message_size,
5560                                max_encoding_message_size,
5561                            );
5562                        let res = grpc.unary(method, req).await;
5563                        Ok(res)
5564                    };
5565                    Box::pin(fut)
5566                }
5567                "/pidgr.v1.HeatmapService/ListScreenshots" => {
5568                    #[allow(non_camel_case_types)]
5569                    struct ListScreenshotsSvc<T: HeatmapService>(pub Arc<T>);
5570                    impl<
5571                        T: HeatmapService,
5572                    > tonic::server::UnaryService<super::ListScreenshotsRequest>
5573                    for ListScreenshotsSvc<T> {
5574                        type Response = super::ListScreenshotsResponse;
5575                        type Future = BoxFuture<
5576                            tonic::Response<Self::Response>,
5577                            tonic::Status,
5578                        >;
5579                        fn call(
5580                            &mut self,
5581                            request: tonic::Request<super::ListScreenshotsRequest>,
5582                        ) -> Self::Future {
5583                            let inner = Arc::clone(&self.0);
5584                            let fut = async move {
5585                                <T as HeatmapService>::list_screenshots(&inner, request)
5586                                    .await
5587                            };
5588                            Box::pin(fut)
5589                        }
5590                    }
5591                    let accept_compression_encodings = self.accept_compression_encodings;
5592                    let send_compression_encodings = self.send_compression_encodings;
5593                    let max_decoding_message_size = self.max_decoding_message_size;
5594                    let max_encoding_message_size = self.max_encoding_message_size;
5595                    let inner = self.inner.clone();
5596                    let fut = async move {
5597                        let method = ListScreenshotsSvc(inner);
5598                        let codec = tonic_prost::ProstCodec::default();
5599                        let mut grpc = tonic::server::Grpc::new(codec)
5600                            .apply_compression_config(
5601                                accept_compression_encodings,
5602                                send_compression_encodings,
5603                            )
5604                            .apply_max_message_size_config(
5605                                max_decoding_message_size,
5606                                max_encoding_message_size,
5607                            );
5608                        let res = grpc.unary(method, req).await;
5609                        Ok(res)
5610                    };
5611                    Box::pin(fut)
5612                }
5613                "/pidgr.v1.HeatmapService/UploadScreenshot" => {
5614                    #[allow(non_camel_case_types)]
5615                    struct UploadScreenshotSvc<T: HeatmapService>(pub Arc<T>);
5616                    impl<
5617                        T: HeatmapService,
5618                    > tonic::server::UnaryService<super::UploadScreenshotRequest>
5619                    for UploadScreenshotSvc<T> {
5620                        type Response = super::UploadScreenshotResponse;
5621                        type Future = BoxFuture<
5622                            tonic::Response<Self::Response>,
5623                            tonic::Status,
5624                        >;
5625                        fn call(
5626                            &mut self,
5627                            request: tonic::Request<super::UploadScreenshotRequest>,
5628                        ) -> Self::Future {
5629                            let inner = Arc::clone(&self.0);
5630                            let fut = async move {
5631                                <T as HeatmapService>::upload_screenshot(&inner, request)
5632                                    .await
5633                            };
5634                            Box::pin(fut)
5635                        }
5636                    }
5637                    let accept_compression_encodings = self.accept_compression_encodings;
5638                    let send_compression_encodings = self.send_compression_encodings;
5639                    let max_decoding_message_size = self.max_decoding_message_size;
5640                    let max_encoding_message_size = self.max_encoding_message_size;
5641                    let inner = self.inner.clone();
5642                    let fut = async move {
5643                        let method = UploadScreenshotSvc(inner);
5644                        let codec = tonic_prost::ProstCodec::default();
5645                        let mut grpc = tonic::server::Grpc::new(codec)
5646                            .apply_compression_config(
5647                                accept_compression_encodings,
5648                                send_compression_encodings,
5649                            )
5650                            .apply_max_message_size_config(
5651                                max_decoding_message_size,
5652                                max_encoding_message_size,
5653                            );
5654                        let res = grpc.unary(method, req).await;
5655                        Ok(res)
5656                    };
5657                    Box::pin(fut)
5658                }
5659                _ => {
5660                    Box::pin(async move {
5661                        let mut response = http::Response::new(
5662                            tonic::body::Body::default(),
5663                        );
5664                        let headers = response.headers_mut();
5665                        headers
5666                            .insert(
5667                                tonic::Status::GRPC_STATUS,
5668                                (tonic::Code::Unimplemented as i32).into(),
5669                            );
5670                        headers
5671                            .insert(
5672                                http::header::CONTENT_TYPE,
5673                                tonic::metadata::GRPC_CONTENT_TYPE,
5674                            );
5675                        Ok(response)
5676                    })
5677                }
5678            }
5679        }
5680    }
5681    impl<T> Clone for HeatmapServiceServer<T> {
5682        fn clone(&self) -> Self {
5683            let inner = self.inner.clone();
5684            Self {
5685                inner,
5686                accept_compression_encodings: self.accept_compression_encodings,
5687                send_compression_encodings: self.send_compression_encodings,
5688                max_decoding_message_size: self.max_decoding_message_size,
5689                max_encoding_message_size: self.max_encoding_message_size,
5690            }
5691        }
5692    }
5693    /// Generated gRPC service name
5694    pub const SERVICE_NAME: &str = "pidgr.v1.HeatmapService";
5695    impl<T> tonic::server::NamedService for HeatmapServiceServer<T> {
5696        const NAME: &'static str = SERVICE_NAME;
5697    }
5698}
5699/// Generated client implementations.
5700pub mod inbox_service_client {
5701    #![allow(
5702        unused_variables,
5703        dead_code,
5704        missing_docs,
5705        clippy::wildcard_imports,
5706        clippy::let_unit_value,
5707    )]
5708    use tonic::codegen::*;
5709    use tonic::codegen::http::Uri;
5710    /** Provides the mobile app's inbox experience — syncing messages,
5711 tracking read status, and retrieving individual entries.
5712*/
5713    #[derive(Debug, Clone)]
5714    pub struct InboxServiceClient<T> {
5715        inner: tonic::client::Grpc<T>,
5716    }
5717    impl InboxServiceClient<tonic::transport::Channel> {
5718        /// Attempt to create a new client by connecting to a given endpoint.
5719        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5720        where
5721            D: TryInto<tonic::transport::Endpoint>,
5722            D::Error: Into<StdError>,
5723        {
5724            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5725            Ok(Self::new(conn))
5726        }
5727    }
5728    impl<T> InboxServiceClient<T>
5729    where
5730        T: tonic::client::GrpcService<tonic::body::Body>,
5731        T::Error: Into<StdError>,
5732        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5733        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5734    {
5735        pub fn new(inner: T) -> Self {
5736            let inner = tonic::client::Grpc::new(inner);
5737            Self { inner }
5738        }
5739        pub fn with_origin(inner: T, origin: Uri) -> Self {
5740            let inner = tonic::client::Grpc::with_origin(inner, origin);
5741            Self { inner }
5742        }
5743        pub fn with_interceptor<F>(
5744            inner: T,
5745            interceptor: F,
5746        ) -> InboxServiceClient<InterceptedService<T, F>>
5747        where
5748            F: tonic::service::Interceptor,
5749            T::ResponseBody: Default,
5750            T: tonic::codegen::Service<
5751                http::Request<tonic::body::Body>,
5752                Response = http::Response<
5753                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
5754                >,
5755            >,
5756            <T as tonic::codegen::Service<
5757                http::Request<tonic::body::Body>,
5758            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
5759        {
5760            InboxServiceClient::new(InterceptedService::new(inner, interceptor))
5761        }
5762        /// Compress requests with the given encoding.
5763        ///
5764        /// This requires the server to support it otherwise it might respond with an
5765        /// error.
5766        #[must_use]
5767        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5768            self.inner = self.inner.send_compressed(encoding);
5769            self
5770        }
5771        /// Enable decompressing responses.
5772        #[must_use]
5773        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5774            self.inner = self.inner.accept_compressed(encoding);
5775            self
5776        }
5777        /// Limits the maximum size of a decoded message.
5778        ///
5779        /// Default: `4MB`
5780        #[must_use]
5781        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5782            self.inner = self.inner.max_decoding_message_size(limit);
5783            self
5784        }
5785        /// Limits the maximum size of an encoded message.
5786        ///
5787        /// Default: `usize::MAX`
5788        #[must_use]
5789        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5790            self.inner = self.inner.max_encoding_message_size(limit);
5791            self
5792        }
5793        /** Sync inbox entries since a given timestamp for incremental updates.
5794 Authorization: Authenticated user (own inbox only).
5795*/
5796        pub async fn sync(
5797            &mut self,
5798            request: impl tonic::IntoRequest<super::SyncRequest>,
5799        ) -> std::result::Result<tonic::Response<super::SyncResponse>, tonic::Status> {
5800            self.inner
5801                .ready()
5802                .await
5803                .map_err(|e| {
5804                    tonic::Status::unknown(
5805                        format!("Service was not ready: {}", e.into()),
5806                    )
5807                })?;
5808            let codec = tonic_prost::ProstCodec::default();
5809            let path = http::uri::PathAndQuery::from_static(
5810                "/pidgr.v1.InboxService/Sync",
5811            );
5812            let mut req = request.into_request();
5813            req.extensions_mut()
5814                .insert(GrpcMethod::new("pidgr.v1.InboxService", "Sync"));
5815            self.inner.unary(req, path, codec).await
5816        }
5817        /** Mark a delivered message as read (analytics-only, does not affect workflow).
5818 Authorization: Authenticated user (own inbox only).
5819*/
5820        pub async fn mark_read(
5821            &mut self,
5822            request: impl tonic::IntoRequest<super::MarkReadRequest>,
5823        ) -> std::result::Result<
5824            tonic::Response<super::MarkReadResponse>,
5825            tonic::Status,
5826        > {
5827            self.inner
5828                .ready()
5829                .await
5830                .map_err(|e| {
5831                    tonic::Status::unknown(
5832                        format!("Service was not ready: {}", e.into()),
5833                    )
5834                })?;
5835            let codec = tonic_prost::ProstCodec::default();
5836            let path = http::uri::PathAndQuery::from_static(
5837                "/pidgr.v1.InboxService/MarkRead",
5838            );
5839            let mut req = request.into_request();
5840            req.extensions_mut()
5841                .insert(GrpcMethod::new("pidgr.v1.InboxService", "MarkRead"));
5842            self.inner.unary(req, path, codec).await
5843        }
5844        /** Retrieve a single inbox entry by delivery ID.
5845 Authorization: Authenticated user (own inbox only).
5846*/
5847        pub async fn get_message(
5848            &mut self,
5849            request: impl tonic::IntoRequest<super::GetMessageRequest>,
5850        ) -> std::result::Result<
5851            tonic::Response<super::GetMessageResponse>,
5852            tonic::Status,
5853        > {
5854            self.inner
5855                .ready()
5856                .await
5857                .map_err(|e| {
5858                    tonic::Status::unknown(
5859                        format!("Service was not ready: {}", e.into()),
5860                    )
5861                })?;
5862            let codec = tonic_prost::ProstCodec::default();
5863            let path = http::uri::PathAndQuery::from_static(
5864                "/pidgr.v1.InboxService/GetMessage",
5865            );
5866            let mut req = request.into_request();
5867            req.extensions_mut()
5868                .insert(GrpcMethod::new("pidgr.v1.InboxService", "GetMessage"));
5869            self.inner.unary(req, path, codec).await
5870        }
5871    }
5872}
5873/// Generated server implementations.
5874pub mod inbox_service_server {
5875    #![allow(
5876        unused_variables,
5877        dead_code,
5878        missing_docs,
5879        clippy::wildcard_imports,
5880        clippy::let_unit_value,
5881    )]
5882    use tonic::codegen::*;
5883    /// Generated trait containing gRPC methods that should be implemented for use with InboxServiceServer.
5884    #[async_trait]
5885    pub trait InboxService: std::marker::Send + std::marker::Sync + 'static {
5886        /** Sync inbox entries since a given timestamp for incremental updates.
5887 Authorization: Authenticated user (own inbox only).
5888*/
5889        async fn sync(
5890            &self,
5891            request: tonic::Request<super::SyncRequest>,
5892        ) -> std::result::Result<tonic::Response<super::SyncResponse>, tonic::Status>;
5893        /** Mark a delivered message as read (analytics-only, does not affect workflow).
5894 Authorization: Authenticated user (own inbox only).
5895*/
5896        async fn mark_read(
5897            &self,
5898            request: tonic::Request<super::MarkReadRequest>,
5899        ) -> std::result::Result<
5900            tonic::Response<super::MarkReadResponse>,
5901            tonic::Status,
5902        >;
5903        /** Retrieve a single inbox entry by delivery ID.
5904 Authorization: Authenticated user (own inbox only).
5905*/
5906        async fn get_message(
5907            &self,
5908            request: tonic::Request<super::GetMessageRequest>,
5909        ) -> std::result::Result<
5910            tonic::Response<super::GetMessageResponse>,
5911            tonic::Status,
5912        >;
5913    }
5914    /** Provides the mobile app's inbox experience — syncing messages,
5915 tracking read status, and retrieving individual entries.
5916*/
5917    #[derive(Debug)]
5918    pub struct InboxServiceServer<T> {
5919        inner: Arc<T>,
5920        accept_compression_encodings: EnabledCompressionEncodings,
5921        send_compression_encodings: EnabledCompressionEncodings,
5922        max_decoding_message_size: Option<usize>,
5923        max_encoding_message_size: Option<usize>,
5924    }
5925    impl<T> InboxServiceServer<T> {
5926        pub fn new(inner: T) -> Self {
5927            Self::from_arc(Arc::new(inner))
5928        }
5929        pub fn from_arc(inner: Arc<T>) -> Self {
5930            Self {
5931                inner,
5932                accept_compression_encodings: Default::default(),
5933                send_compression_encodings: Default::default(),
5934                max_decoding_message_size: None,
5935                max_encoding_message_size: None,
5936            }
5937        }
5938        pub fn with_interceptor<F>(
5939            inner: T,
5940            interceptor: F,
5941        ) -> InterceptedService<Self, F>
5942        where
5943            F: tonic::service::Interceptor,
5944        {
5945            InterceptedService::new(Self::new(inner), interceptor)
5946        }
5947        /// Enable decompressing requests with the given encoding.
5948        #[must_use]
5949        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5950            self.accept_compression_encodings.enable(encoding);
5951            self
5952        }
5953        /// Compress responses with the given encoding, if the client supports it.
5954        #[must_use]
5955        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5956            self.send_compression_encodings.enable(encoding);
5957            self
5958        }
5959        /// Limits the maximum size of a decoded message.
5960        ///
5961        /// Default: `4MB`
5962        #[must_use]
5963        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5964            self.max_decoding_message_size = Some(limit);
5965            self
5966        }
5967        /// Limits the maximum size of an encoded message.
5968        ///
5969        /// Default: `usize::MAX`
5970        #[must_use]
5971        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5972            self.max_encoding_message_size = Some(limit);
5973            self
5974        }
5975    }
5976    impl<T, B> tonic::codegen::Service<http::Request<B>> for InboxServiceServer<T>
5977    where
5978        T: InboxService,
5979        B: Body + std::marker::Send + 'static,
5980        B::Error: Into<StdError> + std::marker::Send + 'static,
5981    {
5982        type Response = http::Response<tonic::body::Body>;
5983        type Error = std::convert::Infallible;
5984        type Future = BoxFuture<Self::Response, Self::Error>;
5985        fn poll_ready(
5986            &mut self,
5987            _cx: &mut Context<'_>,
5988        ) -> Poll<std::result::Result<(), Self::Error>> {
5989            Poll::Ready(Ok(()))
5990        }
5991        fn call(&mut self, req: http::Request<B>) -> Self::Future {
5992            match req.uri().path() {
5993                "/pidgr.v1.InboxService/Sync" => {
5994                    #[allow(non_camel_case_types)]
5995                    struct SyncSvc<T: InboxService>(pub Arc<T>);
5996                    impl<T: InboxService> tonic::server::UnaryService<super::SyncRequest>
5997                    for SyncSvc<T> {
5998                        type Response = super::SyncResponse;
5999                        type Future = BoxFuture<
6000                            tonic::Response<Self::Response>,
6001                            tonic::Status,
6002                        >;
6003                        fn call(
6004                            &mut self,
6005                            request: tonic::Request<super::SyncRequest>,
6006                        ) -> Self::Future {
6007                            let inner = Arc::clone(&self.0);
6008                            let fut = async move {
6009                                <T as InboxService>::sync(&inner, request).await
6010                            };
6011                            Box::pin(fut)
6012                        }
6013                    }
6014                    let accept_compression_encodings = self.accept_compression_encodings;
6015                    let send_compression_encodings = self.send_compression_encodings;
6016                    let max_decoding_message_size = self.max_decoding_message_size;
6017                    let max_encoding_message_size = self.max_encoding_message_size;
6018                    let inner = self.inner.clone();
6019                    let fut = async move {
6020                        let method = SyncSvc(inner);
6021                        let codec = tonic_prost::ProstCodec::default();
6022                        let mut grpc = tonic::server::Grpc::new(codec)
6023                            .apply_compression_config(
6024                                accept_compression_encodings,
6025                                send_compression_encodings,
6026                            )
6027                            .apply_max_message_size_config(
6028                                max_decoding_message_size,
6029                                max_encoding_message_size,
6030                            );
6031                        let res = grpc.unary(method, req).await;
6032                        Ok(res)
6033                    };
6034                    Box::pin(fut)
6035                }
6036                "/pidgr.v1.InboxService/MarkRead" => {
6037                    #[allow(non_camel_case_types)]
6038                    struct MarkReadSvc<T: InboxService>(pub Arc<T>);
6039                    impl<
6040                        T: InboxService,
6041                    > tonic::server::UnaryService<super::MarkReadRequest>
6042                    for MarkReadSvc<T> {
6043                        type Response = super::MarkReadResponse;
6044                        type Future = BoxFuture<
6045                            tonic::Response<Self::Response>,
6046                            tonic::Status,
6047                        >;
6048                        fn call(
6049                            &mut self,
6050                            request: tonic::Request<super::MarkReadRequest>,
6051                        ) -> Self::Future {
6052                            let inner = Arc::clone(&self.0);
6053                            let fut = async move {
6054                                <T as InboxService>::mark_read(&inner, request).await
6055                            };
6056                            Box::pin(fut)
6057                        }
6058                    }
6059                    let accept_compression_encodings = self.accept_compression_encodings;
6060                    let send_compression_encodings = self.send_compression_encodings;
6061                    let max_decoding_message_size = self.max_decoding_message_size;
6062                    let max_encoding_message_size = self.max_encoding_message_size;
6063                    let inner = self.inner.clone();
6064                    let fut = async move {
6065                        let method = MarkReadSvc(inner);
6066                        let codec = tonic_prost::ProstCodec::default();
6067                        let mut grpc = tonic::server::Grpc::new(codec)
6068                            .apply_compression_config(
6069                                accept_compression_encodings,
6070                                send_compression_encodings,
6071                            )
6072                            .apply_max_message_size_config(
6073                                max_decoding_message_size,
6074                                max_encoding_message_size,
6075                            );
6076                        let res = grpc.unary(method, req).await;
6077                        Ok(res)
6078                    };
6079                    Box::pin(fut)
6080                }
6081                "/pidgr.v1.InboxService/GetMessage" => {
6082                    #[allow(non_camel_case_types)]
6083                    struct GetMessageSvc<T: InboxService>(pub Arc<T>);
6084                    impl<
6085                        T: InboxService,
6086                    > tonic::server::UnaryService<super::GetMessageRequest>
6087                    for GetMessageSvc<T> {
6088                        type Response = super::GetMessageResponse;
6089                        type Future = BoxFuture<
6090                            tonic::Response<Self::Response>,
6091                            tonic::Status,
6092                        >;
6093                        fn call(
6094                            &mut self,
6095                            request: tonic::Request<super::GetMessageRequest>,
6096                        ) -> Self::Future {
6097                            let inner = Arc::clone(&self.0);
6098                            let fut = async move {
6099                                <T as InboxService>::get_message(&inner, request).await
6100                            };
6101                            Box::pin(fut)
6102                        }
6103                    }
6104                    let accept_compression_encodings = self.accept_compression_encodings;
6105                    let send_compression_encodings = self.send_compression_encodings;
6106                    let max_decoding_message_size = self.max_decoding_message_size;
6107                    let max_encoding_message_size = self.max_encoding_message_size;
6108                    let inner = self.inner.clone();
6109                    let fut = async move {
6110                        let method = GetMessageSvc(inner);
6111                        let codec = tonic_prost::ProstCodec::default();
6112                        let mut grpc = tonic::server::Grpc::new(codec)
6113                            .apply_compression_config(
6114                                accept_compression_encodings,
6115                                send_compression_encodings,
6116                            )
6117                            .apply_max_message_size_config(
6118                                max_decoding_message_size,
6119                                max_encoding_message_size,
6120                            );
6121                        let res = grpc.unary(method, req).await;
6122                        Ok(res)
6123                    };
6124                    Box::pin(fut)
6125                }
6126                _ => {
6127                    Box::pin(async move {
6128                        let mut response = http::Response::new(
6129                            tonic::body::Body::default(),
6130                        );
6131                        let headers = response.headers_mut();
6132                        headers
6133                            .insert(
6134                                tonic::Status::GRPC_STATUS,
6135                                (tonic::Code::Unimplemented as i32).into(),
6136                            );
6137                        headers
6138                            .insert(
6139                                http::header::CONTENT_TYPE,
6140                                tonic::metadata::GRPC_CONTENT_TYPE,
6141                            );
6142                        Ok(response)
6143                    })
6144                }
6145            }
6146        }
6147    }
6148    impl<T> Clone for InboxServiceServer<T> {
6149        fn clone(&self) -> Self {
6150            let inner = self.inner.clone();
6151            Self {
6152                inner,
6153                accept_compression_encodings: self.accept_compression_encodings,
6154                send_compression_encodings: self.send_compression_encodings,
6155                max_decoding_message_size: self.max_decoding_message_size,
6156                max_encoding_message_size: self.max_encoding_message_size,
6157            }
6158        }
6159    }
6160    /// Generated gRPC service name
6161    pub const SERVICE_NAME: &str = "pidgr.v1.InboxService";
6162    impl<T> tonic::server::NamedService for InboxServiceServer<T> {
6163        const NAME: &'static str = SERVICE_NAME;
6164    }
6165}
6166/// Generated client implementations.
6167pub mod insights_service_client {
6168    #![allow(
6169        unused_variables,
6170        dead_code,
6171        missing_docs,
6172        clippy::wildcard_imports,
6173        clippy::let_unit_value,
6174    )]
6175    use tonic::codegen::*;
6176    use tonic::codegen::http::Uri;
6177    /** Provides cohort-level AI insights for campaign planning and optimization.
6178 All predictions are aggregate — no individual-level profiling.
6179 Data is derived from k-anonymized, differential-privacy-noised behavioral features.
6180 All RPCs operate within the caller's org (extracted from JWT).
6181*/
6182    #[derive(Debug, Clone)]
6183    pub struct InsightsServiceClient<T> {
6184        inner: tonic::client::Grpc<T>,
6185    }
6186    impl InsightsServiceClient<tonic::transport::Channel> {
6187        /// Attempt to create a new client by connecting to a given endpoint.
6188        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6189        where
6190            D: TryInto<tonic::transport::Endpoint>,
6191            D::Error: Into<StdError>,
6192        {
6193            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6194            Ok(Self::new(conn))
6195        }
6196    }
6197    impl<T> InsightsServiceClient<T>
6198    where
6199        T: tonic::client::GrpcService<tonic::body::Body>,
6200        T::Error: Into<StdError>,
6201        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6202        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6203    {
6204        pub fn new(inner: T) -> Self {
6205            let inner = tonic::client::Grpc::new(inner);
6206            Self { inner }
6207        }
6208        pub fn with_origin(inner: T, origin: Uri) -> Self {
6209            let inner = tonic::client::Grpc::with_origin(inner, origin);
6210            Self { inner }
6211        }
6212        pub fn with_interceptor<F>(
6213            inner: T,
6214            interceptor: F,
6215        ) -> InsightsServiceClient<InterceptedService<T, F>>
6216        where
6217            F: tonic::service::Interceptor,
6218            T::ResponseBody: Default,
6219            T: tonic::codegen::Service<
6220                http::Request<tonic::body::Body>,
6221                Response = http::Response<
6222                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6223                >,
6224            >,
6225            <T as tonic::codegen::Service<
6226                http::Request<tonic::body::Body>,
6227            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6228        {
6229            InsightsServiceClient::new(InterceptedService::new(inner, interceptor))
6230        }
6231        /// Compress requests with the given encoding.
6232        ///
6233        /// This requires the server to support it otherwise it might respond with an
6234        /// error.
6235        #[must_use]
6236        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6237            self.inner = self.inner.send_compressed(encoding);
6238            self
6239        }
6240        /// Enable decompressing responses.
6241        #[must_use]
6242        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6243            self.inner = self.inner.accept_compressed(encoding);
6244            self
6245        }
6246        /// Limits the maximum size of a decoded message.
6247        ///
6248        /// Default: `4MB`
6249        #[must_use]
6250        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6251            self.inner = self.inner.max_decoding_message_size(limit);
6252            self
6253        }
6254        /// Limits the maximum size of an encoded message.
6255        ///
6256        /// Default: `usize::MAX`
6257        #[must_use]
6258        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6259            self.inner = self.inner.max_encoding_message_size(limit);
6260            self
6261        }
6262        /** Retrieve behavioral archetypes for a group based on anonymous feature vectors.
6263 Returns empty archetypes if insufficient data (cold start).
6264 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
6265*/
6266        pub async fn get_group_archetypes(
6267            &mut self,
6268            request: impl tonic::IntoRequest<super::GetGroupArchetypesRequest>,
6269        ) -> std::result::Result<
6270            tonic::Response<super::GetGroupArchetypesResponse>,
6271            tonic::Status,
6272        > {
6273            self.inner
6274                .ready()
6275                .await
6276                .map_err(|e| {
6277                    tonic::Status::unknown(
6278                        format!("Service was not ready: {}", e.into()),
6279                    )
6280                })?;
6281            let codec = tonic_prost::ProstCodec::default();
6282            let path = http::uri::PathAndQuery::from_static(
6283                "/pidgr.v1.InsightsService/GetGroupArchetypes",
6284            );
6285            let mut req = request.into_request();
6286            req.extensions_mut()
6287                .insert(
6288                    GrpcMethod::new("pidgr.v1.InsightsService", "GetGroupArchetypes"),
6289                );
6290            self.inner.unary(req, path, codec).await
6291        }
6292        /** Predict cohort-level ACK rate for a campaign targeting a specific group.
6293 Returns a confidence interval that narrows as more campaign data accumulates.
6294 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
6295*/
6296        pub async fn predict_campaign_ack(
6297            &mut self,
6298            request: impl tonic::IntoRequest<super::PredictCampaignAckRequest>,
6299        ) -> std::result::Result<
6300            tonic::Response<super::PredictCampaignAckResponse>,
6301            tonic::Status,
6302        > {
6303            self.inner
6304                .ready()
6305                .await
6306                .map_err(|e| {
6307                    tonic::Status::unknown(
6308                        format!("Service was not ready: {}", e.into()),
6309                    )
6310                })?;
6311            let codec = tonic_prost::ProstCodec::default();
6312            let path = http::uri::PathAndQuery::from_static(
6313                "/pidgr.v1.InsightsService/PredictCampaignACK",
6314            );
6315            let mut req = request.into_request();
6316            req.extensions_mut()
6317                .insert(
6318                    GrpcMethod::new("pidgr.v1.InsightsService", "PredictCampaignACK"),
6319                );
6320            self.inner.unary(req, path, codec).await
6321        }
6322        /** Get campaign configuration advisory (prediction + suggested escalation + archetypes).
6323 Advisory is informational only — never drives automated decisions.
6324 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
6325*/
6326        pub async fn get_campaign_advisory(
6327            &mut self,
6328            request: impl tonic::IntoRequest<super::GetCampaignAdvisoryRequest>,
6329        ) -> std::result::Result<
6330            tonic::Response<super::GetCampaignAdvisoryResponse>,
6331            tonic::Status,
6332        > {
6333            self.inner
6334                .ready()
6335                .await
6336                .map_err(|e| {
6337                    tonic::Status::unknown(
6338                        format!("Service was not ready: {}", e.into()),
6339                    )
6340                })?;
6341            let codec = tonic_prost::ProstCodec::default();
6342            let path = http::uri::PathAndQuery::from_static(
6343                "/pidgr.v1.InsightsService/GetCampaignAdvisory",
6344            );
6345            let mut req = request.into_request();
6346            req.extensions_mut()
6347                .insert(
6348                    GrpcMethod::new("pidgr.v1.InsightsService", "GetCampaignAdvisory"),
6349                );
6350            self.inner.unary(req, path, codec).await
6351        }
6352        /** Generate an AI-powered narrative summary of a group's insights.
6353 Combines archetype, prediction, and campaign data into human-readable analysis.
6354 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
6355*/
6356        pub async fn get_insight_narrative(
6357            &mut self,
6358            request: impl tonic::IntoRequest<super::GetInsightNarrativeRequest>,
6359        ) -> std::result::Result<
6360            tonic::Response<super::GetInsightNarrativeResponse>,
6361            tonic::Status,
6362        > {
6363            self.inner
6364                .ready()
6365                .await
6366                .map_err(|e| {
6367                    tonic::Status::unknown(
6368                        format!("Service was not ready: {}", e.into()),
6369                    )
6370                })?;
6371            let codec = tonic_prost::ProstCodec::default();
6372            let path = http::uri::PathAndQuery::from_static(
6373                "/pidgr.v1.InsightsService/GetInsightNarrative",
6374            );
6375            let mut req = request.into_request();
6376            req.extensions_mut()
6377                .insert(
6378                    GrpcMethod::new("pidgr.v1.InsightsService", "GetInsightNarrative"),
6379                );
6380            self.inner.unary(req, path, codec).await
6381        }
6382        /** Manually trigger the ML training pipeline for the caller's organization.
6383 Rate-limited by ml_manual_limit_monthly (default 3 per month, auto-resets).
6384 Authorization: Requires PERMISSION_ORGANIZATION_WRITE.
6385*/
6386        pub async fn trigger_ml_pipeline(
6387            &mut self,
6388            request: impl tonic::IntoRequest<super::TriggerMlPipelineRequest>,
6389        ) -> std::result::Result<
6390            tonic::Response<super::TriggerMlPipelineResponse>,
6391            tonic::Status,
6392        > {
6393            self.inner
6394                .ready()
6395                .await
6396                .map_err(|e| {
6397                    tonic::Status::unknown(
6398                        format!("Service was not ready: {}", e.into()),
6399                    )
6400                })?;
6401            let codec = tonic_prost::ProstCodec::default();
6402            let path = http::uri::PathAndQuery::from_static(
6403                "/pidgr.v1.InsightsService/TriggerMLPipeline",
6404            );
6405            let mut req = request.into_request();
6406            req.extensions_mut()
6407                .insert(
6408                    GrpcMethod::new("pidgr.v1.InsightsService", "TriggerMLPipeline"),
6409                );
6410            self.inner.unary(req, path, codec).await
6411        }
6412        /** Manually retrigger archetype clustering for a single group, reusing
6413 the already-deployed SageMaker clustering model. Cheaper than a
6414 full TriggerMLPipeline run because no training happens. Shares the
6415 same ml_manual_limit_monthly quota as TriggerMLPipeline — callers
6416 get N manual retrains per month across both RPCs.
6417 Authorization: Requires PERMISSION_ORGANIZATION_WRITE.
6418*/
6419        pub async fn trigger_archetype_clustering(
6420            &mut self,
6421            request: impl tonic::IntoRequest<super::TriggerArchetypeClusteringRequest>,
6422        ) -> std::result::Result<
6423            tonic::Response<super::TriggerArchetypeClusteringResponse>,
6424            tonic::Status,
6425        > {
6426            self.inner
6427                .ready()
6428                .await
6429                .map_err(|e| {
6430                    tonic::Status::unknown(
6431                        format!("Service was not ready: {}", e.into()),
6432                    )
6433                })?;
6434            let codec = tonic_prost::ProstCodec::default();
6435            let path = http::uri::PathAndQuery::from_static(
6436                "/pidgr.v1.InsightsService/TriggerArchetypeClustering",
6437            );
6438            let mut req = request.into_request();
6439            req.extensions_mut()
6440                .insert(
6441                    GrpcMethod::new(
6442                        "pidgr.v1.InsightsService",
6443                        "TriggerArchetypeClustering",
6444                    ),
6445                );
6446            self.inner.unary(req, path, codec).await
6447        }
6448    }
6449}
6450/// Generated server implementations.
6451pub mod insights_service_server {
6452    #![allow(
6453        unused_variables,
6454        dead_code,
6455        missing_docs,
6456        clippy::wildcard_imports,
6457        clippy::let_unit_value,
6458    )]
6459    use tonic::codegen::*;
6460    /// Generated trait containing gRPC methods that should be implemented for use with InsightsServiceServer.
6461    #[async_trait]
6462    pub trait InsightsService: std::marker::Send + std::marker::Sync + 'static {
6463        /** Retrieve behavioral archetypes for a group based on anonymous feature vectors.
6464 Returns empty archetypes if insufficient data (cold start).
6465 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
6466*/
6467        async fn get_group_archetypes(
6468            &self,
6469            request: tonic::Request<super::GetGroupArchetypesRequest>,
6470        ) -> std::result::Result<
6471            tonic::Response<super::GetGroupArchetypesResponse>,
6472            tonic::Status,
6473        >;
6474        /** Predict cohort-level ACK rate for a campaign targeting a specific group.
6475 Returns a confidence interval that narrows as more campaign data accumulates.
6476 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
6477*/
6478        async fn predict_campaign_ack(
6479            &self,
6480            request: tonic::Request<super::PredictCampaignAckRequest>,
6481        ) -> std::result::Result<
6482            tonic::Response<super::PredictCampaignAckResponse>,
6483            tonic::Status,
6484        >;
6485        /** Get campaign configuration advisory (prediction + suggested escalation + archetypes).
6486 Advisory is informational only — never drives automated decisions.
6487 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
6488*/
6489        async fn get_campaign_advisory(
6490            &self,
6491            request: tonic::Request<super::GetCampaignAdvisoryRequest>,
6492        ) -> std::result::Result<
6493            tonic::Response<super::GetCampaignAdvisoryResponse>,
6494            tonic::Status,
6495        >;
6496        /** Generate an AI-powered narrative summary of a group's insights.
6497 Combines archetype, prediction, and campaign data into human-readable analysis.
6498 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
6499*/
6500        async fn get_insight_narrative(
6501            &self,
6502            request: tonic::Request<super::GetInsightNarrativeRequest>,
6503        ) -> std::result::Result<
6504            tonic::Response<super::GetInsightNarrativeResponse>,
6505            tonic::Status,
6506        >;
6507        /** Manually trigger the ML training pipeline for the caller's organization.
6508 Rate-limited by ml_manual_limit_monthly (default 3 per month, auto-resets).
6509 Authorization: Requires PERMISSION_ORGANIZATION_WRITE.
6510*/
6511        async fn trigger_ml_pipeline(
6512            &self,
6513            request: tonic::Request<super::TriggerMlPipelineRequest>,
6514        ) -> std::result::Result<
6515            tonic::Response<super::TriggerMlPipelineResponse>,
6516            tonic::Status,
6517        >;
6518        /** Manually retrigger archetype clustering for a single group, reusing
6519 the already-deployed SageMaker clustering model. Cheaper than a
6520 full TriggerMLPipeline run because no training happens. Shares the
6521 same ml_manual_limit_monthly quota as TriggerMLPipeline — callers
6522 get N manual retrains per month across both RPCs.
6523 Authorization: Requires PERMISSION_ORGANIZATION_WRITE.
6524*/
6525        async fn trigger_archetype_clustering(
6526            &self,
6527            request: tonic::Request<super::TriggerArchetypeClusteringRequest>,
6528        ) -> std::result::Result<
6529            tonic::Response<super::TriggerArchetypeClusteringResponse>,
6530            tonic::Status,
6531        >;
6532    }
6533    /** Provides cohort-level AI insights for campaign planning and optimization.
6534 All predictions are aggregate — no individual-level profiling.
6535 Data is derived from k-anonymized, differential-privacy-noised behavioral features.
6536 All RPCs operate within the caller's org (extracted from JWT).
6537*/
6538    #[derive(Debug)]
6539    pub struct InsightsServiceServer<T> {
6540        inner: Arc<T>,
6541        accept_compression_encodings: EnabledCompressionEncodings,
6542        send_compression_encodings: EnabledCompressionEncodings,
6543        max_decoding_message_size: Option<usize>,
6544        max_encoding_message_size: Option<usize>,
6545    }
6546    impl<T> InsightsServiceServer<T> {
6547        pub fn new(inner: T) -> Self {
6548            Self::from_arc(Arc::new(inner))
6549        }
6550        pub fn from_arc(inner: Arc<T>) -> Self {
6551            Self {
6552                inner,
6553                accept_compression_encodings: Default::default(),
6554                send_compression_encodings: Default::default(),
6555                max_decoding_message_size: None,
6556                max_encoding_message_size: None,
6557            }
6558        }
6559        pub fn with_interceptor<F>(
6560            inner: T,
6561            interceptor: F,
6562        ) -> InterceptedService<Self, F>
6563        where
6564            F: tonic::service::Interceptor,
6565        {
6566            InterceptedService::new(Self::new(inner), interceptor)
6567        }
6568        /// Enable decompressing requests with the given encoding.
6569        #[must_use]
6570        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6571            self.accept_compression_encodings.enable(encoding);
6572            self
6573        }
6574        /// Compress responses with the given encoding, if the client supports it.
6575        #[must_use]
6576        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6577            self.send_compression_encodings.enable(encoding);
6578            self
6579        }
6580        /// Limits the maximum size of a decoded message.
6581        ///
6582        /// Default: `4MB`
6583        #[must_use]
6584        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6585            self.max_decoding_message_size = Some(limit);
6586            self
6587        }
6588        /// Limits the maximum size of an encoded message.
6589        ///
6590        /// Default: `usize::MAX`
6591        #[must_use]
6592        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6593            self.max_encoding_message_size = Some(limit);
6594            self
6595        }
6596    }
6597    impl<T, B> tonic::codegen::Service<http::Request<B>> for InsightsServiceServer<T>
6598    where
6599        T: InsightsService,
6600        B: Body + std::marker::Send + 'static,
6601        B::Error: Into<StdError> + std::marker::Send + 'static,
6602    {
6603        type Response = http::Response<tonic::body::Body>;
6604        type Error = std::convert::Infallible;
6605        type Future = BoxFuture<Self::Response, Self::Error>;
6606        fn poll_ready(
6607            &mut self,
6608            _cx: &mut Context<'_>,
6609        ) -> Poll<std::result::Result<(), Self::Error>> {
6610            Poll::Ready(Ok(()))
6611        }
6612        fn call(&mut self, req: http::Request<B>) -> Self::Future {
6613            match req.uri().path() {
6614                "/pidgr.v1.InsightsService/GetGroupArchetypes" => {
6615                    #[allow(non_camel_case_types)]
6616                    struct GetGroupArchetypesSvc<T: InsightsService>(pub Arc<T>);
6617                    impl<
6618                        T: InsightsService,
6619                    > tonic::server::UnaryService<super::GetGroupArchetypesRequest>
6620                    for GetGroupArchetypesSvc<T> {
6621                        type Response = super::GetGroupArchetypesResponse;
6622                        type Future = BoxFuture<
6623                            tonic::Response<Self::Response>,
6624                            tonic::Status,
6625                        >;
6626                        fn call(
6627                            &mut self,
6628                            request: tonic::Request<super::GetGroupArchetypesRequest>,
6629                        ) -> Self::Future {
6630                            let inner = Arc::clone(&self.0);
6631                            let fut = async move {
6632                                <T as InsightsService>::get_group_archetypes(
6633                                        &inner,
6634                                        request,
6635                                    )
6636                                    .await
6637                            };
6638                            Box::pin(fut)
6639                        }
6640                    }
6641                    let accept_compression_encodings = self.accept_compression_encodings;
6642                    let send_compression_encodings = self.send_compression_encodings;
6643                    let max_decoding_message_size = self.max_decoding_message_size;
6644                    let max_encoding_message_size = self.max_encoding_message_size;
6645                    let inner = self.inner.clone();
6646                    let fut = async move {
6647                        let method = GetGroupArchetypesSvc(inner);
6648                        let codec = tonic_prost::ProstCodec::default();
6649                        let mut grpc = tonic::server::Grpc::new(codec)
6650                            .apply_compression_config(
6651                                accept_compression_encodings,
6652                                send_compression_encodings,
6653                            )
6654                            .apply_max_message_size_config(
6655                                max_decoding_message_size,
6656                                max_encoding_message_size,
6657                            );
6658                        let res = grpc.unary(method, req).await;
6659                        Ok(res)
6660                    };
6661                    Box::pin(fut)
6662                }
6663                "/pidgr.v1.InsightsService/PredictCampaignACK" => {
6664                    #[allow(non_camel_case_types)]
6665                    struct PredictCampaignACKSvc<T: InsightsService>(pub Arc<T>);
6666                    impl<
6667                        T: InsightsService,
6668                    > tonic::server::UnaryService<super::PredictCampaignAckRequest>
6669                    for PredictCampaignACKSvc<T> {
6670                        type Response = super::PredictCampaignAckResponse;
6671                        type Future = BoxFuture<
6672                            tonic::Response<Self::Response>,
6673                            tonic::Status,
6674                        >;
6675                        fn call(
6676                            &mut self,
6677                            request: tonic::Request<super::PredictCampaignAckRequest>,
6678                        ) -> Self::Future {
6679                            let inner = Arc::clone(&self.0);
6680                            let fut = async move {
6681                                <T as InsightsService>::predict_campaign_ack(
6682                                        &inner,
6683                                        request,
6684                                    )
6685                                    .await
6686                            };
6687                            Box::pin(fut)
6688                        }
6689                    }
6690                    let accept_compression_encodings = self.accept_compression_encodings;
6691                    let send_compression_encodings = self.send_compression_encodings;
6692                    let max_decoding_message_size = self.max_decoding_message_size;
6693                    let max_encoding_message_size = self.max_encoding_message_size;
6694                    let inner = self.inner.clone();
6695                    let fut = async move {
6696                        let method = PredictCampaignACKSvc(inner);
6697                        let codec = tonic_prost::ProstCodec::default();
6698                        let mut grpc = tonic::server::Grpc::new(codec)
6699                            .apply_compression_config(
6700                                accept_compression_encodings,
6701                                send_compression_encodings,
6702                            )
6703                            .apply_max_message_size_config(
6704                                max_decoding_message_size,
6705                                max_encoding_message_size,
6706                            );
6707                        let res = grpc.unary(method, req).await;
6708                        Ok(res)
6709                    };
6710                    Box::pin(fut)
6711                }
6712                "/pidgr.v1.InsightsService/GetCampaignAdvisory" => {
6713                    #[allow(non_camel_case_types)]
6714                    struct GetCampaignAdvisorySvc<T: InsightsService>(pub Arc<T>);
6715                    impl<
6716                        T: InsightsService,
6717                    > tonic::server::UnaryService<super::GetCampaignAdvisoryRequest>
6718                    for GetCampaignAdvisorySvc<T> {
6719                        type Response = super::GetCampaignAdvisoryResponse;
6720                        type Future = BoxFuture<
6721                            tonic::Response<Self::Response>,
6722                            tonic::Status,
6723                        >;
6724                        fn call(
6725                            &mut self,
6726                            request: tonic::Request<super::GetCampaignAdvisoryRequest>,
6727                        ) -> Self::Future {
6728                            let inner = Arc::clone(&self.0);
6729                            let fut = async move {
6730                                <T as InsightsService>::get_campaign_advisory(
6731                                        &inner,
6732                                        request,
6733                                    )
6734                                    .await
6735                            };
6736                            Box::pin(fut)
6737                        }
6738                    }
6739                    let accept_compression_encodings = self.accept_compression_encodings;
6740                    let send_compression_encodings = self.send_compression_encodings;
6741                    let max_decoding_message_size = self.max_decoding_message_size;
6742                    let max_encoding_message_size = self.max_encoding_message_size;
6743                    let inner = self.inner.clone();
6744                    let fut = async move {
6745                        let method = GetCampaignAdvisorySvc(inner);
6746                        let codec = tonic_prost::ProstCodec::default();
6747                        let mut grpc = tonic::server::Grpc::new(codec)
6748                            .apply_compression_config(
6749                                accept_compression_encodings,
6750                                send_compression_encodings,
6751                            )
6752                            .apply_max_message_size_config(
6753                                max_decoding_message_size,
6754                                max_encoding_message_size,
6755                            );
6756                        let res = grpc.unary(method, req).await;
6757                        Ok(res)
6758                    };
6759                    Box::pin(fut)
6760                }
6761                "/pidgr.v1.InsightsService/GetInsightNarrative" => {
6762                    #[allow(non_camel_case_types)]
6763                    struct GetInsightNarrativeSvc<T: InsightsService>(pub Arc<T>);
6764                    impl<
6765                        T: InsightsService,
6766                    > tonic::server::UnaryService<super::GetInsightNarrativeRequest>
6767                    for GetInsightNarrativeSvc<T> {
6768                        type Response = super::GetInsightNarrativeResponse;
6769                        type Future = BoxFuture<
6770                            tonic::Response<Self::Response>,
6771                            tonic::Status,
6772                        >;
6773                        fn call(
6774                            &mut self,
6775                            request: tonic::Request<super::GetInsightNarrativeRequest>,
6776                        ) -> Self::Future {
6777                            let inner = Arc::clone(&self.0);
6778                            let fut = async move {
6779                                <T as InsightsService>::get_insight_narrative(
6780                                        &inner,
6781                                        request,
6782                                    )
6783                                    .await
6784                            };
6785                            Box::pin(fut)
6786                        }
6787                    }
6788                    let accept_compression_encodings = self.accept_compression_encodings;
6789                    let send_compression_encodings = self.send_compression_encodings;
6790                    let max_decoding_message_size = self.max_decoding_message_size;
6791                    let max_encoding_message_size = self.max_encoding_message_size;
6792                    let inner = self.inner.clone();
6793                    let fut = async move {
6794                        let method = GetInsightNarrativeSvc(inner);
6795                        let codec = tonic_prost::ProstCodec::default();
6796                        let mut grpc = tonic::server::Grpc::new(codec)
6797                            .apply_compression_config(
6798                                accept_compression_encodings,
6799                                send_compression_encodings,
6800                            )
6801                            .apply_max_message_size_config(
6802                                max_decoding_message_size,
6803                                max_encoding_message_size,
6804                            );
6805                        let res = grpc.unary(method, req).await;
6806                        Ok(res)
6807                    };
6808                    Box::pin(fut)
6809                }
6810                "/pidgr.v1.InsightsService/TriggerMLPipeline" => {
6811                    #[allow(non_camel_case_types)]
6812                    struct TriggerMLPipelineSvc<T: InsightsService>(pub Arc<T>);
6813                    impl<
6814                        T: InsightsService,
6815                    > tonic::server::UnaryService<super::TriggerMlPipelineRequest>
6816                    for TriggerMLPipelineSvc<T> {
6817                        type Response = super::TriggerMlPipelineResponse;
6818                        type Future = BoxFuture<
6819                            tonic::Response<Self::Response>,
6820                            tonic::Status,
6821                        >;
6822                        fn call(
6823                            &mut self,
6824                            request: tonic::Request<super::TriggerMlPipelineRequest>,
6825                        ) -> Self::Future {
6826                            let inner = Arc::clone(&self.0);
6827                            let fut = async move {
6828                                <T as InsightsService>::trigger_ml_pipeline(&inner, request)
6829                                    .await
6830                            };
6831                            Box::pin(fut)
6832                        }
6833                    }
6834                    let accept_compression_encodings = self.accept_compression_encodings;
6835                    let send_compression_encodings = self.send_compression_encodings;
6836                    let max_decoding_message_size = self.max_decoding_message_size;
6837                    let max_encoding_message_size = self.max_encoding_message_size;
6838                    let inner = self.inner.clone();
6839                    let fut = async move {
6840                        let method = TriggerMLPipelineSvc(inner);
6841                        let codec = tonic_prost::ProstCodec::default();
6842                        let mut grpc = tonic::server::Grpc::new(codec)
6843                            .apply_compression_config(
6844                                accept_compression_encodings,
6845                                send_compression_encodings,
6846                            )
6847                            .apply_max_message_size_config(
6848                                max_decoding_message_size,
6849                                max_encoding_message_size,
6850                            );
6851                        let res = grpc.unary(method, req).await;
6852                        Ok(res)
6853                    };
6854                    Box::pin(fut)
6855                }
6856                "/pidgr.v1.InsightsService/TriggerArchetypeClustering" => {
6857                    #[allow(non_camel_case_types)]
6858                    struct TriggerArchetypeClusteringSvc<T: InsightsService>(pub Arc<T>);
6859                    impl<
6860                        T: InsightsService,
6861                    > tonic::server::UnaryService<
6862                        super::TriggerArchetypeClusteringRequest,
6863                    > for TriggerArchetypeClusteringSvc<T> {
6864                        type Response = super::TriggerArchetypeClusteringResponse;
6865                        type Future = BoxFuture<
6866                            tonic::Response<Self::Response>,
6867                            tonic::Status,
6868                        >;
6869                        fn call(
6870                            &mut self,
6871                            request: tonic::Request<
6872                                super::TriggerArchetypeClusteringRequest,
6873                            >,
6874                        ) -> Self::Future {
6875                            let inner = Arc::clone(&self.0);
6876                            let fut = async move {
6877                                <T as InsightsService>::trigger_archetype_clustering(
6878                                        &inner,
6879                                        request,
6880                                    )
6881                                    .await
6882                            };
6883                            Box::pin(fut)
6884                        }
6885                    }
6886                    let accept_compression_encodings = self.accept_compression_encodings;
6887                    let send_compression_encodings = self.send_compression_encodings;
6888                    let max_decoding_message_size = self.max_decoding_message_size;
6889                    let max_encoding_message_size = self.max_encoding_message_size;
6890                    let inner = self.inner.clone();
6891                    let fut = async move {
6892                        let method = TriggerArchetypeClusteringSvc(inner);
6893                        let codec = tonic_prost::ProstCodec::default();
6894                        let mut grpc = tonic::server::Grpc::new(codec)
6895                            .apply_compression_config(
6896                                accept_compression_encodings,
6897                                send_compression_encodings,
6898                            )
6899                            .apply_max_message_size_config(
6900                                max_decoding_message_size,
6901                                max_encoding_message_size,
6902                            );
6903                        let res = grpc.unary(method, req).await;
6904                        Ok(res)
6905                    };
6906                    Box::pin(fut)
6907                }
6908                _ => {
6909                    Box::pin(async move {
6910                        let mut response = http::Response::new(
6911                            tonic::body::Body::default(),
6912                        );
6913                        let headers = response.headers_mut();
6914                        headers
6915                            .insert(
6916                                tonic::Status::GRPC_STATUS,
6917                                (tonic::Code::Unimplemented as i32).into(),
6918                            );
6919                        headers
6920                            .insert(
6921                                http::header::CONTENT_TYPE,
6922                                tonic::metadata::GRPC_CONTENT_TYPE,
6923                            );
6924                        Ok(response)
6925                    })
6926                }
6927            }
6928        }
6929    }
6930    impl<T> Clone for InsightsServiceServer<T> {
6931        fn clone(&self) -> Self {
6932            let inner = self.inner.clone();
6933            Self {
6934                inner,
6935                accept_compression_encodings: self.accept_compression_encodings,
6936                send_compression_encodings: self.send_compression_encodings,
6937                max_decoding_message_size: self.max_decoding_message_size,
6938                max_encoding_message_size: self.max_encoding_message_size,
6939            }
6940        }
6941    }
6942    /// Generated gRPC service name
6943    pub const SERVICE_NAME: &str = "pidgr.v1.InsightsService";
6944    impl<T> tonic::server::NamedService for InsightsServiceServer<T> {
6945        const NAME: &'static str = SERVICE_NAME;
6946    }
6947}
6948/// Generated client implementations.
6949pub mod invite_link_service_client {
6950    #![allow(
6951        unused_variables,
6952        dead_code,
6953        missing_docs,
6954        clippy::wildcard_imports,
6955        clippy::let_unit_value,
6956    )]
6957    use tonic::codegen::*;
6958    use tonic::codegen::http::Uri;
6959    /** Manages shareable invite links for organization self-join.
6960 Create, List, and Revoke require JWT + PERMISSION_MEMBERS_INVITE.
6961 ValidateInviteLink is unauthenticated — the token IS the authorization.
6962 RedeemInviteLink requires a valid JWT.
6963*/
6964    #[derive(Debug, Clone)]
6965    pub struct InviteLinkServiceClient<T> {
6966        inner: tonic::client::Grpc<T>,
6967    }
6968    impl InviteLinkServiceClient<tonic::transport::Channel> {
6969        /// Attempt to create a new client by connecting to a given endpoint.
6970        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6971        where
6972            D: TryInto<tonic::transport::Endpoint>,
6973            D::Error: Into<StdError>,
6974        {
6975            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6976            Ok(Self::new(conn))
6977        }
6978    }
6979    impl<T> InviteLinkServiceClient<T>
6980    where
6981        T: tonic::client::GrpcService<tonic::body::Body>,
6982        T::Error: Into<StdError>,
6983        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6984        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6985    {
6986        pub fn new(inner: T) -> Self {
6987            let inner = tonic::client::Grpc::new(inner);
6988            Self { inner }
6989        }
6990        pub fn with_origin(inner: T, origin: Uri) -> Self {
6991            let inner = tonic::client::Grpc::with_origin(inner, origin);
6992            Self { inner }
6993        }
6994        pub fn with_interceptor<F>(
6995            inner: T,
6996            interceptor: F,
6997        ) -> InviteLinkServiceClient<InterceptedService<T, F>>
6998        where
6999            F: tonic::service::Interceptor,
7000            T::ResponseBody: Default,
7001            T: tonic::codegen::Service<
7002                http::Request<tonic::body::Body>,
7003                Response = http::Response<
7004                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
7005                >,
7006            >,
7007            <T as tonic::codegen::Service<
7008                http::Request<tonic::body::Body>,
7009            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
7010        {
7011            InviteLinkServiceClient::new(InterceptedService::new(inner, interceptor))
7012        }
7013        /// Compress requests with the given encoding.
7014        ///
7015        /// This requires the server to support it otherwise it might respond with an
7016        /// error.
7017        #[must_use]
7018        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7019            self.inner = self.inner.send_compressed(encoding);
7020            self
7021        }
7022        /// Enable decompressing responses.
7023        #[must_use]
7024        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7025            self.inner = self.inner.accept_compressed(encoding);
7026            self
7027        }
7028        /// Limits the maximum size of a decoded message.
7029        ///
7030        /// Default: `4MB`
7031        #[must_use]
7032        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7033            self.inner = self.inner.max_decoding_message_size(limit);
7034            self
7035        }
7036        /// Limits the maximum size of an encoded message.
7037        ///
7038        /// Default: `usize::MAX`
7039        #[must_use]
7040        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7041            self.inner = self.inner.max_encoding_message_size(limit);
7042            self
7043        }
7044        /** Create a new shareable invite link for the organization.
7045 Authorization: Requires PERMISSION_MEMBERS_INVITE.
7046*/
7047        pub async fn create_invite_link(
7048            &mut self,
7049            request: impl tonic::IntoRequest<super::CreateInviteLinkRequest>,
7050        ) -> std::result::Result<
7051            tonic::Response<super::CreateInviteLinkResponse>,
7052            tonic::Status,
7053        > {
7054            self.inner
7055                .ready()
7056                .await
7057                .map_err(|e| {
7058                    tonic::Status::unknown(
7059                        format!("Service was not ready: {}", e.into()),
7060                    )
7061                })?;
7062            let codec = tonic_prost::ProstCodec::default();
7063            let path = http::uri::PathAndQuery::from_static(
7064                "/pidgr.v1.InviteLinkService/CreateInviteLink",
7065            );
7066            let mut req = request.into_request();
7067            req.extensions_mut()
7068                .insert(
7069                    GrpcMethod::new("pidgr.v1.InviteLinkService", "CreateInviteLink"),
7070                );
7071            self.inner.unary(req, path, codec).await
7072        }
7073        /** List all invite links for the organization.
7074 Authorization: Requires PERMISSION_MEMBERS_INVITE.
7075*/
7076        pub async fn list_invite_links(
7077            &mut self,
7078            request: impl tonic::IntoRequest<super::ListInviteLinksRequest>,
7079        ) -> std::result::Result<
7080            tonic::Response<super::ListInviteLinksResponse>,
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.InviteLinkService/ListInviteLinks",
7094            );
7095            let mut req = request.into_request();
7096            req.extensions_mut()
7097                .insert(
7098                    GrpcMethod::new("pidgr.v1.InviteLinkService", "ListInviteLinks"),
7099                );
7100            self.inner.unary(req, path, codec).await
7101        }
7102        /** Revoke an invite link, making it immediately unusable. Idempotent.
7103 Authorization: Requires PERMISSION_MEMBERS_INVITE.
7104*/
7105        pub async fn revoke_invite_link(
7106            &mut self,
7107            request: impl tonic::IntoRequest<super::RevokeInviteLinkRequest>,
7108        ) -> std::result::Result<
7109            tonic::Response<super::RevokeInviteLinkResponse>,
7110            tonic::Status,
7111        > {
7112            self.inner
7113                .ready()
7114                .await
7115                .map_err(|e| {
7116                    tonic::Status::unknown(
7117                        format!("Service was not ready: {}", e.into()),
7118                    )
7119                })?;
7120            let codec = tonic_prost::ProstCodec::default();
7121            let path = http::uri::PathAndQuery::from_static(
7122                "/pidgr.v1.InviteLinkService/RevokeInviteLink",
7123            );
7124            let mut req = request.into_request();
7125            req.extensions_mut()
7126                .insert(
7127                    GrpcMethod::new("pidgr.v1.InviteLinkService", "RevokeInviteLink"),
7128                );
7129            self.inner.unary(req, path, codec).await
7130        }
7131        /** Validate an invite link and provision a user account if needed.
7132 This is a pre-authentication endpoint — no JWT required.
7133 Rate limited to 10 requests per minute per IP.
7134 Authorization: None (token-based).
7135*/
7136        pub async fn validate_invite_link(
7137            &mut self,
7138            request: impl tonic::IntoRequest<super::ValidateInviteLinkRequest>,
7139        ) -> std::result::Result<
7140            tonic::Response<super::ValidateInviteLinkResponse>,
7141            tonic::Status,
7142        > {
7143            self.inner
7144                .ready()
7145                .await
7146                .map_err(|e| {
7147                    tonic::Status::unknown(
7148                        format!("Service was not ready: {}", e.into()),
7149                    )
7150                })?;
7151            let codec = tonic_prost::ProstCodec::default();
7152            let path = http::uri::PathAndQuery::from_static(
7153                "/pidgr.v1.InviteLinkService/ValidateInviteLink",
7154            );
7155            let mut req = request.into_request();
7156            req.extensions_mut()
7157                .insert(
7158                    GrpcMethod::new("pidgr.v1.InviteLinkService", "ValidateInviteLink"),
7159                );
7160            self.inner.unary(req, path, codec).await
7161        }
7162        /** Redeem an invite link to join an organization.
7163 Requires a valid JWT — the email is extracted from the token.
7164 Authorization: JWT required.
7165*/
7166        pub async fn redeem_invite_link(
7167            &mut self,
7168            request: impl tonic::IntoRequest<super::RedeemInviteLinkRequest>,
7169        ) -> std::result::Result<
7170            tonic::Response<super::RedeemInviteLinkResponse>,
7171            tonic::Status,
7172        > {
7173            self.inner
7174                .ready()
7175                .await
7176                .map_err(|e| {
7177                    tonic::Status::unknown(
7178                        format!("Service was not ready: {}", e.into()),
7179                    )
7180                })?;
7181            let codec = tonic_prost::ProstCodec::default();
7182            let path = http::uri::PathAndQuery::from_static(
7183                "/pidgr.v1.InviteLinkService/RedeemInviteLink",
7184            );
7185            let mut req = request.into_request();
7186            req.extensions_mut()
7187                .insert(
7188                    GrpcMethod::new("pidgr.v1.InviteLinkService", "RedeemInviteLink"),
7189                );
7190            self.inner.unary(req, path, codec).await
7191        }
7192    }
7193}
7194/// Generated server implementations.
7195pub mod invite_link_service_server {
7196    #![allow(
7197        unused_variables,
7198        dead_code,
7199        missing_docs,
7200        clippy::wildcard_imports,
7201        clippy::let_unit_value,
7202    )]
7203    use tonic::codegen::*;
7204    /// Generated trait containing gRPC methods that should be implemented for use with InviteLinkServiceServer.
7205    #[async_trait]
7206    pub trait InviteLinkService: std::marker::Send + std::marker::Sync + 'static {
7207        /** Create a new shareable invite link for the organization.
7208 Authorization: Requires PERMISSION_MEMBERS_INVITE.
7209*/
7210        async fn create_invite_link(
7211            &self,
7212            request: tonic::Request<super::CreateInviteLinkRequest>,
7213        ) -> std::result::Result<
7214            tonic::Response<super::CreateInviteLinkResponse>,
7215            tonic::Status,
7216        >;
7217        /** List all invite links for the organization.
7218 Authorization: Requires PERMISSION_MEMBERS_INVITE.
7219*/
7220        async fn list_invite_links(
7221            &self,
7222            request: tonic::Request<super::ListInviteLinksRequest>,
7223        ) -> std::result::Result<
7224            tonic::Response<super::ListInviteLinksResponse>,
7225            tonic::Status,
7226        >;
7227        /** Revoke an invite link, making it immediately unusable. Idempotent.
7228 Authorization: Requires PERMISSION_MEMBERS_INVITE.
7229*/
7230        async fn revoke_invite_link(
7231            &self,
7232            request: tonic::Request<super::RevokeInviteLinkRequest>,
7233        ) -> std::result::Result<
7234            tonic::Response<super::RevokeInviteLinkResponse>,
7235            tonic::Status,
7236        >;
7237        /** Validate an invite link and provision a user account if needed.
7238 This is a pre-authentication endpoint — no JWT required.
7239 Rate limited to 10 requests per minute per IP.
7240 Authorization: None (token-based).
7241*/
7242        async fn validate_invite_link(
7243            &self,
7244            request: tonic::Request<super::ValidateInviteLinkRequest>,
7245        ) -> std::result::Result<
7246            tonic::Response<super::ValidateInviteLinkResponse>,
7247            tonic::Status,
7248        >;
7249        /** Redeem an invite link to join an organization.
7250 Requires a valid JWT — the email is extracted from the token.
7251 Authorization: JWT required.
7252*/
7253        async fn redeem_invite_link(
7254            &self,
7255            request: tonic::Request<super::RedeemInviteLinkRequest>,
7256        ) -> std::result::Result<
7257            tonic::Response<super::RedeemInviteLinkResponse>,
7258            tonic::Status,
7259        >;
7260    }
7261    /** Manages shareable invite links for organization self-join.
7262 Create, List, and Revoke require JWT + PERMISSION_MEMBERS_INVITE.
7263 ValidateInviteLink is unauthenticated — the token IS the authorization.
7264 RedeemInviteLink requires a valid JWT.
7265*/
7266    #[derive(Debug)]
7267    pub struct InviteLinkServiceServer<T> {
7268        inner: Arc<T>,
7269        accept_compression_encodings: EnabledCompressionEncodings,
7270        send_compression_encodings: EnabledCompressionEncodings,
7271        max_decoding_message_size: Option<usize>,
7272        max_encoding_message_size: Option<usize>,
7273    }
7274    impl<T> InviteLinkServiceServer<T> {
7275        pub fn new(inner: T) -> Self {
7276            Self::from_arc(Arc::new(inner))
7277        }
7278        pub fn from_arc(inner: Arc<T>) -> Self {
7279            Self {
7280                inner,
7281                accept_compression_encodings: Default::default(),
7282                send_compression_encodings: Default::default(),
7283                max_decoding_message_size: None,
7284                max_encoding_message_size: None,
7285            }
7286        }
7287        pub fn with_interceptor<F>(
7288            inner: T,
7289            interceptor: F,
7290        ) -> InterceptedService<Self, F>
7291        where
7292            F: tonic::service::Interceptor,
7293        {
7294            InterceptedService::new(Self::new(inner), interceptor)
7295        }
7296        /// Enable decompressing requests with the given encoding.
7297        #[must_use]
7298        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7299            self.accept_compression_encodings.enable(encoding);
7300            self
7301        }
7302        /// Compress responses with the given encoding, if the client supports it.
7303        #[must_use]
7304        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7305            self.send_compression_encodings.enable(encoding);
7306            self
7307        }
7308        /// Limits the maximum size of a decoded message.
7309        ///
7310        /// Default: `4MB`
7311        #[must_use]
7312        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7313            self.max_decoding_message_size = Some(limit);
7314            self
7315        }
7316        /// Limits the maximum size of an encoded message.
7317        ///
7318        /// Default: `usize::MAX`
7319        #[must_use]
7320        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7321            self.max_encoding_message_size = Some(limit);
7322            self
7323        }
7324    }
7325    impl<T, B> tonic::codegen::Service<http::Request<B>> for InviteLinkServiceServer<T>
7326    where
7327        T: InviteLinkService,
7328        B: Body + std::marker::Send + 'static,
7329        B::Error: Into<StdError> + std::marker::Send + 'static,
7330    {
7331        type Response = http::Response<tonic::body::Body>;
7332        type Error = std::convert::Infallible;
7333        type Future = BoxFuture<Self::Response, Self::Error>;
7334        fn poll_ready(
7335            &mut self,
7336            _cx: &mut Context<'_>,
7337        ) -> Poll<std::result::Result<(), Self::Error>> {
7338            Poll::Ready(Ok(()))
7339        }
7340        fn call(&mut self, req: http::Request<B>) -> Self::Future {
7341            match req.uri().path() {
7342                "/pidgr.v1.InviteLinkService/CreateInviteLink" => {
7343                    #[allow(non_camel_case_types)]
7344                    struct CreateInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
7345                    impl<
7346                        T: InviteLinkService,
7347                    > tonic::server::UnaryService<super::CreateInviteLinkRequest>
7348                    for CreateInviteLinkSvc<T> {
7349                        type Response = super::CreateInviteLinkResponse;
7350                        type Future = BoxFuture<
7351                            tonic::Response<Self::Response>,
7352                            tonic::Status,
7353                        >;
7354                        fn call(
7355                            &mut self,
7356                            request: tonic::Request<super::CreateInviteLinkRequest>,
7357                        ) -> Self::Future {
7358                            let inner = Arc::clone(&self.0);
7359                            let fut = async move {
7360                                <T as InviteLinkService>::create_invite_link(
7361                                        &inner,
7362                                        request,
7363                                    )
7364                                    .await
7365                            };
7366                            Box::pin(fut)
7367                        }
7368                    }
7369                    let accept_compression_encodings = self.accept_compression_encodings;
7370                    let send_compression_encodings = self.send_compression_encodings;
7371                    let max_decoding_message_size = self.max_decoding_message_size;
7372                    let max_encoding_message_size = self.max_encoding_message_size;
7373                    let inner = self.inner.clone();
7374                    let fut = async move {
7375                        let method = CreateInviteLinkSvc(inner);
7376                        let codec = tonic_prost::ProstCodec::default();
7377                        let mut grpc = tonic::server::Grpc::new(codec)
7378                            .apply_compression_config(
7379                                accept_compression_encodings,
7380                                send_compression_encodings,
7381                            )
7382                            .apply_max_message_size_config(
7383                                max_decoding_message_size,
7384                                max_encoding_message_size,
7385                            );
7386                        let res = grpc.unary(method, req).await;
7387                        Ok(res)
7388                    };
7389                    Box::pin(fut)
7390                }
7391                "/pidgr.v1.InviteLinkService/ListInviteLinks" => {
7392                    #[allow(non_camel_case_types)]
7393                    struct ListInviteLinksSvc<T: InviteLinkService>(pub Arc<T>);
7394                    impl<
7395                        T: InviteLinkService,
7396                    > tonic::server::UnaryService<super::ListInviteLinksRequest>
7397                    for ListInviteLinksSvc<T> {
7398                        type Response = super::ListInviteLinksResponse;
7399                        type Future = BoxFuture<
7400                            tonic::Response<Self::Response>,
7401                            tonic::Status,
7402                        >;
7403                        fn call(
7404                            &mut self,
7405                            request: tonic::Request<super::ListInviteLinksRequest>,
7406                        ) -> Self::Future {
7407                            let inner = Arc::clone(&self.0);
7408                            let fut = async move {
7409                                <T as InviteLinkService>::list_invite_links(&inner, request)
7410                                    .await
7411                            };
7412                            Box::pin(fut)
7413                        }
7414                    }
7415                    let accept_compression_encodings = self.accept_compression_encodings;
7416                    let send_compression_encodings = self.send_compression_encodings;
7417                    let max_decoding_message_size = self.max_decoding_message_size;
7418                    let max_encoding_message_size = self.max_encoding_message_size;
7419                    let inner = self.inner.clone();
7420                    let fut = async move {
7421                        let method = ListInviteLinksSvc(inner);
7422                        let codec = tonic_prost::ProstCodec::default();
7423                        let mut grpc = tonic::server::Grpc::new(codec)
7424                            .apply_compression_config(
7425                                accept_compression_encodings,
7426                                send_compression_encodings,
7427                            )
7428                            .apply_max_message_size_config(
7429                                max_decoding_message_size,
7430                                max_encoding_message_size,
7431                            );
7432                        let res = grpc.unary(method, req).await;
7433                        Ok(res)
7434                    };
7435                    Box::pin(fut)
7436                }
7437                "/pidgr.v1.InviteLinkService/RevokeInviteLink" => {
7438                    #[allow(non_camel_case_types)]
7439                    struct RevokeInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
7440                    impl<
7441                        T: InviteLinkService,
7442                    > tonic::server::UnaryService<super::RevokeInviteLinkRequest>
7443                    for RevokeInviteLinkSvc<T> {
7444                        type Response = super::RevokeInviteLinkResponse;
7445                        type Future = BoxFuture<
7446                            tonic::Response<Self::Response>,
7447                            tonic::Status,
7448                        >;
7449                        fn call(
7450                            &mut self,
7451                            request: tonic::Request<super::RevokeInviteLinkRequest>,
7452                        ) -> Self::Future {
7453                            let inner = Arc::clone(&self.0);
7454                            let fut = async move {
7455                                <T as InviteLinkService>::revoke_invite_link(
7456                                        &inner,
7457                                        request,
7458                                    )
7459                                    .await
7460                            };
7461                            Box::pin(fut)
7462                        }
7463                    }
7464                    let accept_compression_encodings = self.accept_compression_encodings;
7465                    let send_compression_encodings = self.send_compression_encodings;
7466                    let max_decoding_message_size = self.max_decoding_message_size;
7467                    let max_encoding_message_size = self.max_encoding_message_size;
7468                    let inner = self.inner.clone();
7469                    let fut = async move {
7470                        let method = RevokeInviteLinkSvc(inner);
7471                        let codec = tonic_prost::ProstCodec::default();
7472                        let mut grpc = tonic::server::Grpc::new(codec)
7473                            .apply_compression_config(
7474                                accept_compression_encodings,
7475                                send_compression_encodings,
7476                            )
7477                            .apply_max_message_size_config(
7478                                max_decoding_message_size,
7479                                max_encoding_message_size,
7480                            );
7481                        let res = grpc.unary(method, req).await;
7482                        Ok(res)
7483                    };
7484                    Box::pin(fut)
7485                }
7486                "/pidgr.v1.InviteLinkService/ValidateInviteLink" => {
7487                    #[allow(non_camel_case_types)]
7488                    struct ValidateInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
7489                    impl<
7490                        T: InviteLinkService,
7491                    > tonic::server::UnaryService<super::ValidateInviteLinkRequest>
7492                    for ValidateInviteLinkSvc<T> {
7493                        type Response = super::ValidateInviteLinkResponse;
7494                        type Future = BoxFuture<
7495                            tonic::Response<Self::Response>,
7496                            tonic::Status,
7497                        >;
7498                        fn call(
7499                            &mut self,
7500                            request: tonic::Request<super::ValidateInviteLinkRequest>,
7501                        ) -> Self::Future {
7502                            let inner = Arc::clone(&self.0);
7503                            let fut = async move {
7504                                <T as InviteLinkService>::validate_invite_link(
7505                                        &inner,
7506                                        request,
7507                                    )
7508                                    .await
7509                            };
7510                            Box::pin(fut)
7511                        }
7512                    }
7513                    let accept_compression_encodings = self.accept_compression_encodings;
7514                    let send_compression_encodings = self.send_compression_encodings;
7515                    let max_decoding_message_size = self.max_decoding_message_size;
7516                    let max_encoding_message_size = self.max_encoding_message_size;
7517                    let inner = self.inner.clone();
7518                    let fut = async move {
7519                        let method = ValidateInviteLinkSvc(inner);
7520                        let codec = tonic_prost::ProstCodec::default();
7521                        let mut grpc = tonic::server::Grpc::new(codec)
7522                            .apply_compression_config(
7523                                accept_compression_encodings,
7524                                send_compression_encodings,
7525                            )
7526                            .apply_max_message_size_config(
7527                                max_decoding_message_size,
7528                                max_encoding_message_size,
7529                            );
7530                        let res = grpc.unary(method, req).await;
7531                        Ok(res)
7532                    };
7533                    Box::pin(fut)
7534                }
7535                "/pidgr.v1.InviteLinkService/RedeemInviteLink" => {
7536                    #[allow(non_camel_case_types)]
7537                    struct RedeemInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
7538                    impl<
7539                        T: InviteLinkService,
7540                    > tonic::server::UnaryService<super::RedeemInviteLinkRequest>
7541                    for RedeemInviteLinkSvc<T> {
7542                        type Response = super::RedeemInviteLinkResponse;
7543                        type Future = BoxFuture<
7544                            tonic::Response<Self::Response>,
7545                            tonic::Status,
7546                        >;
7547                        fn call(
7548                            &mut self,
7549                            request: tonic::Request<super::RedeemInviteLinkRequest>,
7550                        ) -> Self::Future {
7551                            let inner = Arc::clone(&self.0);
7552                            let fut = async move {
7553                                <T as InviteLinkService>::redeem_invite_link(
7554                                        &inner,
7555                                        request,
7556                                    )
7557                                    .await
7558                            };
7559                            Box::pin(fut)
7560                        }
7561                    }
7562                    let accept_compression_encodings = self.accept_compression_encodings;
7563                    let send_compression_encodings = self.send_compression_encodings;
7564                    let max_decoding_message_size = self.max_decoding_message_size;
7565                    let max_encoding_message_size = self.max_encoding_message_size;
7566                    let inner = self.inner.clone();
7567                    let fut = async move {
7568                        let method = RedeemInviteLinkSvc(inner);
7569                        let codec = tonic_prost::ProstCodec::default();
7570                        let mut grpc = tonic::server::Grpc::new(codec)
7571                            .apply_compression_config(
7572                                accept_compression_encodings,
7573                                send_compression_encodings,
7574                            )
7575                            .apply_max_message_size_config(
7576                                max_decoding_message_size,
7577                                max_encoding_message_size,
7578                            );
7579                        let res = grpc.unary(method, req).await;
7580                        Ok(res)
7581                    };
7582                    Box::pin(fut)
7583                }
7584                _ => {
7585                    Box::pin(async move {
7586                        let mut response = http::Response::new(
7587                            tonic::body::Body::default(),
7588                        );
7589                        let headers = response.headers_mut();
7590                        headers
7591                            .insert(
7592                                tonic::Status::GRPC_STATUS,
7593                                (tonic::Code::Unimplemented as i32).into(),
7594                            );
7595                        headers
7596                            .insert(
7597                                http::header::CONTENT_TYPE,
7598                                tonic::metadata::GRPC_CONTENT_TYPE,
7599                            );
7600                        Ok(response)
7601                    })
7602                }
7603            }
7604        }
7605    }
7606    impl<T> Clone for InviteLinkServiceServer<T> {
7607        fn clone(&self) -> Self {
7608            let inner = self.inner.clone();
7609            Self {
7610                inner,
7611                accept_compression_encodings: self.accept_compression_encodings,
7612                send_compression_encodings: self.send_compression_encodings,
7613                max_decoding_message_size: self.max_decoding_message_size,
7614                max_encoding_message_size: self.max_encoding_message_size,
7615            }
7616        }
7617    }
7618    /// Generated gRPC service name
7619    pub const SERVICE_NAME: &str = "pidgr.v1.InviteLinkService";
7620    impl<T> tonic::server::NamedService for InviteLinkServiceServer<T> {
7621        const NAME: &'static str = SERVICE_NAME;
7622    }
7623}
7624/// Generated client implementations.
7625pub mod member_service_client {
7626    #![allow(
7627        unused_variables,
7628        dead_code,
7629        missing_docs,
7630        clippy::wildcard_imports,
7631        clippy::let_unit_value,
7632    )]
7633    use tonic::codegen::*;
7634    use tonic::codegen::http::Uri;
7635    /** Manages members (users) within an organization.
7636 All RPCs operate within the caller's org (extracted from JWT).
7637*/
7638    #[derive(Debug, Clone)]
7639    pub struct MemberServiceClient<T> {
7640        inner: tonic::client::Grpc<T>,
7641    }
7642    impl MemberServiceClient<tonic::transport::Channel> {
7643        /// Attempt to create a new client by connecting to a given endpoint.
7644        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
7645        where
7646            D: TryInto<tonic::transport::Endpoint>,
7647            D::Error: Into<StdError>,
7648        {
7649            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
7650            Ok(Self::new(conn))
7651        }
7652    }
7653    impl<T> MemberServiceClient<T>
7654    where
7655        T: tonic::client::GrpcService<tonic::body::Body>,
7656        T::Error: Into<StdError>,
7657        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
7658        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
7659    {
7660        pub fn new(inner: T) -> Self {
7661            let inner = tonic::client::Grpc::new(inner);
7662            Self { inner }
7663        }
7664        pub fn with_origin(inner: T, origin: Uri) -> Self {
7665            let inner = tonic::client::Grpc::with_origin(inner, origin);
7666            Self { inner }
7667        }
7668        pub fn with_interceptor<F>(
7669            inner: T,
7670            interceptor: F,
7671        ) -> MemberServiceClient<InterceptedService<T, F>>
7672        where
7673            F: tonic::service::Interceptor,
7674            T::ResponseBody: Default,
7675            T: tonic::codegen::Service<
7676                http::Request<tonic::body::Body>,
7677                Response = http::Response<
7678                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
7679                >,
7680            >,
7681            <T as tonic::codegen::Service<
7682                http::Request<tonic::body::Body>,
7683            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
7684        {
7685            MemberServiceClient::new(InterceptedService::new(inner, interceptor))
7686        }
7687        /// Compress requests with the given encoding.
7688        ///
7689        /// This requires the server to support it otherwise it might respond with an
7690        /// error.
7691        #[must_use]
7692        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7693            self.inner = self.inner.send_compressed(encoding);
7694            self
7695        }
7696        /// Enable decompressing responses.
7697        #[must_use]
7698        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7699            self.inner = self.inner.accept_compressed(encoding);
7700            self
7701        }
7702        /// Limits the maximum size of a decoded message.
7703        ///
7704        /// Default: `4MB`
7705        #[must_use]
7706        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7707            self.inner = self.inner.max_decoding_message_size(limit);
7708            self
7709        }
7710        /// Limits the maximum size of an encoded message.
7711        ///
7712        /// Default: `usize::MAX`
7713        #[must_use]
7714        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7715            self.inner = self.inner.max_encoding_message_size(limit);
7716            self
7717        }
7718        /** Invite a new user to the organization via email.
7719 Authorization: Requires PERMISSION_MEMBERS_INVITE.
7720*/
7721        pub async fn invite_user(
7722            &mut self,
7723            request: impl tonic::IntoRequest<super::InviteUserRequest>,
7724        ) -> std::result::Result<
7725            tonic::Response<super::InviteUserResponse>,
7726            tonic::Status,
7727        > {
7728            self.inner
7729                .ready()
7730                .await
7731                .map_err(|e| {
7732                    tonic::Status::unknown(
7733                        format!("Service was not ready: {}", e.into()),
7734                    )
7735                })?;
7736            let codec = tonic_prost::ProstCodec::default();
7737            let path = http::uri::PathAndQuery::from_static(
7738                "/pidgr.v1.MemberService/InviteUser",
7739            );
7740            let mut req = request.into_request();
7741            req.extensions_mut()
7742                .insert(GrpcMethod::new("pidgr.v1.MemberService", "InviteUser"));
7743            self.inner.unary(req, path, codec).await
7744        }
7745        /** Retrieve a user by ID within the organization.
7746 Self-lookup (empty user_id) is allowed for any authenticated user.
7747 Authorization: Requires PERMISSION_MEMBERS_READ for other users.
7748*/
7749        pub async fn get_user(
7750            &mut self,
7751            request: impl tonic::IntoRequest<super::GetUserRequest>,
7752        ) -> std::result::Result<
7753            tonic::Response<super::GetUserResponse>,
7754            tonic::Status,
7755        > {
7756            self.inner
7757                .ready()
7758                .await
7759                .map_err(|e| {
7760                    tonic::Status::unknown(
7761                        format!("Service was not ready: {}", e.into()),
7762                    )
7763                })?;
7764            let codec = tonic_prost::ProstCodec::default();
7765            let path = http::uri::PathAndQuery::from_static(
7766                "/pidgr.v1.MemberService/GetUser",
7767            );
7768            let mut req = request.into_request();
7769            req.extensions_mut()
7770                .insert(GrpcMethod::new("pidgr.v1.MemberService", "GetUser"));
7771            self.inner.unary(req, path, codec).await
7772        }
7773        /** List all users in the organization with pagination.
7774 Authorization: Requires PERMISSION_MEMBERS_READ.
7775*/
7776        pub async fn list_users(
7777            &mut self,
7778            request: impl tonic::IntoRequest<super::ListUsersRequest>,
7779        ) -> std::result::Result<
7780            tonic::Response<super::ListUsersResponse>,
7781            tonic::Status,
7782        > {
7783            self.inner
7784                .ready()
7785                .await
7786                .map_err(|e| {
7787                    tonic::Status::unknown(
7788                        format!("Service was not ready: {}", e.into()),
7789                    )
7790                })?;
7791            let codec = tonic_prost::ProstCodec::default();
7792            let path = http::uri::PathAndQuery::from_static(
7793                "/pidgr.v1.MemberService/ListUsers",
7794            );
7795            let mut req = request.into_request();
7796            req.extensions_mut()
7797                .insert(GrpcMethod::new("pidgr.v1.MemberService", "ListUsers"));
7798            self.inner.unary(req, path, codec).await
7799        }
7800        /** Change a user's role within the organization.
7801 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
7802*/
7803        pub async fn update_user_role(
7804            &mut self,
7805            request: impl tonic::IntoRequest<super::UpdateUserRoleRequest>,
7806        ) -> std::result::Result<
7807            tonic::Response<super::UpdateUserRoleResponse>,
7808            tonic::Status,
7809        > {
7810            self.inner
7811                .ready()
7812                .await
7813                .map_err(|e| {
7814                    tonic::Status::unknown(
7815                        format!("Service was not ready: {}", e.into()),
7816                    )
7817                })?;
7818            let codec = tonic_prost::ProstCodec::default();
7819            let path = http::uri::PathAndQuery::from_static(
7820                "/pidgr.v1.MemberService/UpdateUserRole",
7821            );
7822            let mut req = request.into_request();
7823            req.extensions_mut()
7824                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserRole"));
7825            self.inner.unary(req, path, codec).await
7826        }
7827        /** Deactivate a user within the organization.
7828 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
7829*/
7830        pub async fn deactivate_user(
7831            &mut self,
7832            request: impl tonic::IntoRequest<super::DeactivateUserRequest>,
7833        ) -> std::result::Result<
7834            tonic::Response<super::DeactivateUserResponse>,
7835            tonic::Status,
7836        > {
7837            self.inner
7838                .ready()
7839                .await
7840                .map_err(|e| {
7841                    tonic::Status::unknown(
7842                        format!("Service was not ready: {}", e.into()),
7843                    )
7844                })?;
7845            let codec = tonic_prost::ProstCodec::default();
7846            let path = http::uri::PathAndQuery::from_static(
7847                "/pidgr.v1.MemberService/DeactivateUser",
7848            );
7849            let mut req = request.into_request();
7850            req.extensions_mut()
7851                .insert(GrpcMethod::new("pidgr.v1.MemberService", "DeactivateUser"));
7852            self.inner.unary(req, path, codec).await
7853        }
7854        /** Reactivate a deactivated user, restoring their status to INVITED.
7855 The user must complete the invite link flow again to become ACTIVE.
7856 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
7857*/
7858        pub async fn reactivate_user(
7859            &mut self,
7860            request: impl tonic::IntoRequest<super::ReactivateUserRequest>,
7861        ) -> std::result::Result<
7862            tonic::Response<super::ReactivateUserResponse>,
7863            tonic::Status,
7864        > {
7865            self.inner
7866                .ready()
7867                .await
7868                .map_err(|e| {
7869                    tonic::Status::unknown(
7870                        format!("Service was not ready: {}", e.into()),
7871                    )
7872                })?;
7873            let codec = tonic_prost::ProstCodec::default();
7874            let path = http::uri::PathAndQuery::from_static(
7875                "/pidgr.v1.MemberService/ReactivateUser",
7876            );
7877            let mut req = request.into_request();
7878            req.extensions_mut()
7879                .insert(GrpcMethod::new("pidgr.v1.MemberService", "ReactivateUser"));
7880            self.inner.unary(req, path, codec).await
7881        }
7882        /** Revoke an invitation for a user who has not yet completed registration.
7883 Hard-deletes the user record (INVITED users have no data to preserve).
7884 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
7885*/
7886        pub async fn revoke_invite(
7887            &mut self,
7888            request: impl tonic::IntoRequest<super::RevokeInviteRequest>,
7889        ) -> std::result::Result<
7890            tonic::Response<super::RevokeInviteResponse>,
7891            tonic::Status,
7892        > {
7893            self.inner
7894                .ready()
7895                .await
7896                .map_err(|e| {
7897                    tonic::Status::unknown(
7898                        format!("Service was not ready: {}", e.into()),
7899                    )
7900                })?;
7901            let codec = tonic_prost::ProstCodec::default();
7902            let path = http::uri::PathAndQuery::from_static(
7903                "/pidgr.v1.MemberService/RevokeInvite",
7904            );
7905            let mut req = request.into_request();
7906            req.extensions_mut()
7907                .insert(GrpcMethod::new("pidgr.v1.MemberService", "RevokeInvite"));
7908            self.inner.unary(req, path, codec).await
7909        }
7910        /** Update a user's profile attributes (department, title, etc.).
7911 Self-update (empty user_id or matching JWT sub) requires no special permission.
7912 Updating another user requires PERMISSION_MEMBERS_MANAGE.
7913*/
7914        pub async fn update_user_profile(
7915            &mut self,
7916            request: impl tonic::IntoRequest<super::UpdateUserProfileRequest>,
7917        ) -> std::result::Result<
7918            tonic::Response<super::UpdateUserProfileResponse>,
7919            tonic::Status,
7920        > {
7921            self.inner
7922                .ready()
7923                .await
7924                .map_err(|e| {
7925                    tonic::Status::unknown(
7926                        format!("Service was not ready: {}", e.into()),
7927                    )
7928                })?;
7929            let codec = tonic_prost::ProstCodec::default();
7930            let path = http::uri::PathAndQuery::from_static(
7931                "/pidgr.v1.MemberService/UpdateUserProfile",
7932            );
7933            let mut req = request.into_request();
7934            req.extensions_mut()
7935                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserProfile"));
7936            self.inner.unary(req, path, codec).await
7937        }
7938        /** Retrieve the caller's platform settings (theme, etc.).
7939 Authorization: Any authenticated user (self-only).
7940*/
7941        pub async fn get_user_settings(
7942            &mut self,
7943            request: impl tonic::IntoRequest<super::GetUserSettingsRequest>,
7944        ) -> std::result::Result<
7945            tonic::Response<super::GetUserSettingsResponse>,
7946            tonic::Status,
7947        > {
7948            self.inner
7949                .ready()
7950                .await
7951                .map_err(|e| {
7952                    tonic::Status::unknown(
7953                        format!("Service was not ready: {}", e.into()),
7954                    )
7955                })?;
7956            let codec = tonic_prost::ProstCodec::default();
7957            let path = http::uri::PathAndQuery::from_static(
7958                "/pidgr.v1.MemberService/GetUserSettings",
7959            );
7960            let mut req = request.into_request();
7961            req.extensions_mut()
7962                .insert(GrpcMethod::new("pidgr.v1.MemberService", "GetUserSettings"));
7963            self.inner.unary(req, path, codec).await
7964        }
7965        /** Update the caller's platform settings.
7966 Only fields with non-default values are applied; others are left unchanged.
7967 Authorization: Any authenticated user (self-only).
7968*/
7969        pub async fn update_user_settings(
7970            &mut self,
7971            request: impl tonic::IntoRequest<super::UpdateUserSettingsRequest>,
7972        ) -> std::result::Result<
7973            tonic::Response<super::UpdateUserSettingsResponse>,
7974            tonic::Status,
7975        > {
7976            self.inner
7977                .ready()
7978                .await
7979                .map_err(|e| {
7980                    tonic::Status::unknown(
7981                        format!("Service was not ready: {}", e.into()),
7982                    )
7983                })?;
7984            let codec = tonic_prost::ProstCodec::default();
7985            let path = http::uri::PathAndQuery::from_static(
7986                "/pidgr.v1.MemberService/UpdateUserSettings",
7987            );
7988            let mut req = request.into_request();
7989            req.extensions_mut()
7990                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserSettings"));
7991            self.inner.unary(req, path, codec).await
7992        }
7993        /** Invite multiple users to the organization in a single call.
7994 Emails are deduplicated. Each email is processed independently — individual
7995 failures do not abort the batch. Identity provider calls are parallelized (bounded concurrency).
7996 Authorization: Requires PERMISSION_MEMBERS_INVITE.
7997*/
7998        pub async fn bulk_invite_users(
7999            &mut self,
8000            request: impl tonic::IntoRequest<super::BulkInviteUsersRequest>,
8001        ) -> std::result::Result<
8002            tonic::Response<super::BulkInviteUsersResponse>,
8003            tonic::Status,
8004        > {
8005            self.inner
8006                .ready()
8007                .await
8008                .map_err(|e| {
8009                    tonic::Status::unknown(
8010                        format!("Service was not ready: {}", e.into()),
8011                    )
8012                })?;
8013            let codec = tonic_prost::ProstCodec::default();
8014            let path = http::uri::PathAndQuery::from_static(
8015                "/pidgr.v1.MemberService/BulkInviteUsers",
8016            );
8017            let mut req = request.into_request();
8018            req.extensions_mut()
8019                .insert(GrpcMethod::new("pidgr.v1.MemberService", "BulkInviteUsers"));
8020            self.inner.unary(req, path, codec).await
8021        }
8022        /** Confirm passkey enrollment after client-side WebAuthn registration.
8023 Verifies the caller has at least one registered credential server-side,
8024 then marks the user as passkey-enrolled in the identity provider.
8025 Authorization: Any authenticated user (self-only, no permission required).
8026*/
8027        pub async fn confirm_passkey_enrollment(
8028            &mut self,
8029            request: impl tonic::IntoRequest<super::ConfirmPasskeyEnrollmentRequest>,
8030        ) -> std::result::Result<
8031            tonic::Response<super::ConfirmPasskeyEnrollmentResponse>,
8032            tonic::Status,
8033        > {
8034            self.inner
8035                .ready()
8036                .await
8037                .map_err(|e| {
8038                    tonic::Status::unknown(
8039                        format!("Service was not ready: {}", e.into()),
8040                    )
8041                })?;
8042            let codec = tonic_prost::ProstCodec::default();
8043            let path = http::uri::PathAndQuery::from_static(
8044                "/pidgr.v1.MemberService/ConfirmPasskeyEnrollment",
8045            );
8046            let mut req = request.into_request();
8047            req.extensions_mut()
8048                .insert(
8049                    GrpcMethod::new("pidgr.v1.MemberService", "ConfirmPasskeyEnrollment"),
8050                );
8051            self.inner.unary(req, path, codec).await
8052        }
8053        /** Update the data governance region for a user. Triggers a data migration
8054 workflow if the region changed. Admin-only operation.
8055 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
8056*/
8057        pub async fn update_user_region(
8058            &mut self,
8059            request: impl tonic::IntoRequest<super::UpdateUserRegionRequest>,
8060        ) -> std::result::Result<
8061            tonic::Response<super::UpdateUserRegionResponse>,
8062            tonic::Status,
8063        > {
8064            self.inner
8065                .ready()
8066                .await
8067                .map_err(|e| {
8068                    tonic::Status::unknown(
8069                        format!("Service was not ready: {}", e.into()),
8070                    )
8071                })?;
8072            let codec = tonic_prost::ProstCodec::default();
8073            let path = http::uri::PathAndQuery::from_static(
8074                "/pidgr.v1.MemberService/UpdateUserRegion",
8075            );
8076            let mut req = request.into_request();
8077            req.extensions_mut()
8078                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserRegion"));
8079            self.inner.unary(req, path, codec).await
8080        }
8081    }
8082}
8083/// Generated server implementations.
8084pub mod member_service_server {
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    /// Generated trait containing gRPC methods that should be implemented for use with MemberServiceServer.
8094    #[async_trait]
8095    pub trait MemberService: std::marker::Send + std::marker::Sync + 'static {
8096        /** Invite a new user to the organization via email.
8097 Authorization: Requires PERMISSION_MEMBERS_INVITE.
8098*/
8099        async fn invite_user(
8100            &self,
8101            request: tonic::Request<super::InviteUserRequest>,
8102        ) -> std::result::Result<
8103            tonic::Response<super::InviteUserResponse>,
8104            tonic::Status,
8105        >;
8106        /** Retrieve a user by ID within the organization.
8107 Self-lookup (empty user_id) is allowed for any authenticated user.
8108 Authorization: Requires PERMISSION_MEMBERS_READ for other users.
8109*/
8110        async fn get_user(
8111            &self,
8112            request: tonic::Request<super::GetUserRequest>,
8113        ) -> std::result::Result<tonic::Response<super::GetUserResponse>, tonic::Status>;
8114        /** List all users in the organization with pagination.
8115 Authorization: Requires PERMISSION_MEMBERS_READ.
8116*/
8117        async fn list_users(
8118            &self,
8119            request: tonic::Request<super::ListUsersRequest>,
8120        ) -> std::result::Result<
8121            tonic::Response<super::ListUsersResponse>,
8122            tonic::Status,
8123        >;
8124        /** Change a user's role within the organization.
8125 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
8126*/
8127        async fn update_user_role(
8128            &self,
8129            request: tonic::Request<super::UpdateUserRoleRequest>,
8130        ) -> std::result::Result<
8131            tonic::Response<super::UpdateUserRoleResponse>,
8132            tonic::Status,
8133        >;
8134        /** Deactivate a user within the organization.
8135 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
8136*/
8137        async fn deactivate_user(
8138            &self,
8139            request: tonic::Request<super::DeactivateUserRequest>,
8140        ) -> std::result::Result<
8141            tonic::Response<super::DeactivateUserResponse>,
8142            tonic::Status,
8143        >;
8144        /** Reactivate a deactivated user, restoring their status to INVITED.
8145 The user must complete the invite link flow again to become ACTIVE.
8146 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
8147*/
8148        async fn reactivate_user(
8149            &self,
8150            request: tonic::Request<super::ReactivateUserRequest>,
8151        ) -> std::result::Result<
8152            tonic::Response<super::ReactivateUserResponse>,
8153            tonic::Status,
8154        >;
8155        /** Revoke an invitation for a user who has not yet completed registration.
8156 Hard-deletes the user record (INVITED users have no data to preserve).
8157 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
8158*/
8159        async fn revoke_invite(
8160            &self,
8161            request: tonic::Request<super::RevokeInviteRequest>,
8162        ) -> std::result::Result<
8163            tonic::Response<super::RevokeInviteResponse>,
8164            tonic::Status,
8165        >;
8166        /** Update a user's profile attributes (department, title, etc.).
8167 Self-update (empty user_id or matching JWT sub) requires no special permission.
8168 Updating another user requires PERMISSION_MEMBERS_MANAGE.
8169*/
8170        async fn update_user_profile(
8171            &self,
8172            request: tonic::Request<super::UpdateUserProfileRequest>,
8173        ) -> std::result::Result<
8174            tonic::Response<super::UpdateUserProfileResponse>,
8175            tonic::Status,
8176        >;
8177        /** Retrieve the caller's platform settings (theme, etc.).
8178 Authorization: Any authenticated user (self-only).
8179*/
8180        async fn get_user_settings(
8181            &self,
8182            request: tonic::Request<super::GetUserSettingsRequest>,
8183        ) -> std::result::Result<
8184            tonic::Response<super::GetUserSettingsResponse>,
8185            tonic::Status,
8186        >;
8187        /** Update the caller's platform settings.
8188 Only fields with non-default values are applied; others are left unchanged.
8189 Authorization: Any authenticated user (self-only).
8190*/
8191        async fn update_user_settings(
8192            &self,
8193            request: tonic::Request<super::UpdateUserSettingsRequest>,
8194        ) -> std::result::Result<
8195            tonic::Response<super::UpdateUserSettingsResponse>,
8196            tonic::Status,
8197        >;
8198        /** Invite multiple users to the organization in a single call.
8199 Emails are deduplicated. Each email is processed independently — individual
8200 failures do not abort the batch. Identity provider calls are parallelized (bounded concurrency).
8201 Authorization: Requires PERMISSION_MEMBERS_INVITE.
8202*/
8203        async fn bulk_invite_users(
8204            &self,
8205            request: tonic::Request<super::BulkInviteUsersRequest>,
8206        ) -> std::result::Result<
8207            tonic::Response<super::BulkInviteUsersResponse>,
8208            tonic::Status,
8209        >;
8210        /** Confirm passkey enrollment after client-side WebAuthn registration.
8211 Verifies the caller has at least one registered credential server-side,
8212 then marks the user as passkey-enrolled in the identity provider.
8213 Authorization: Any authenticated user (self-only, no permission required).
8214*/
8215        async fn confirm_passkey_enrollment(
8216            &self,
8217            request: tonic::Request<super::ConfirmPasskeyEnrollmentRequest>,
8218        ) -> std::result::Result<
8219            tonic::Response<super::ConfirmPasskeyEnrollmentResponse>,
8220            tonic::Status,
8221        >;
8222        /** Update the data governance region for a user. Triggers a data migration
8223 workflow if the region changed. Admin-only operation.
8224 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
8225*/
8226        async fn update_user_region(
8227            &self,
8228            request: tonic::Request<super::UpdateUserRegionRequest>,
8229        ) -> std::result::Result<
8230            tonic::Response<super::UpdateUserRegionResponse>,
8231            tonic::Status,
8232        >;
8233    }
8234    /** Manages members (users) within an organization.
8235 All RPCs operate within the caller's org (extracted from JWT).
8236*/
8237    #[derive(Debug)]
8238    pub struct MemberServiceServer<T> {
8239        inner: Arc<T>,
8240        accept_compression_encodings: EnabledCompressionEncodings,
8241        send_compression_encodings: EnabledCompressionEncodings,
8242        max_decoding_message_size: Option<usize>,
8243        max_encoding_message_size: Option<usize>,
8244    }
8245    impl<T> MemberServiceServer<T> {
8246        pub fn new(inner: T) -> Self {
8247            Self::from_arc(Arc::new(inner))
8248        }
8249        pub fn from_arc(inner: Arc<T>) -> Self {
8250            Self {
8251                inner,
8252                accept_compression_encodings: Default::default(),
8253                send_compression_encodings: Default::default(),
8254                max_decoding_message_size: None,
8255                max_encoding_message_size: None,
8256            }
8257        }
8258        pub fn with_interceptor<F>(
8259            inner: T,
8260            interceptor: F,
8261        ) -> InterceptedService<Self, F>
8262        where
8263            F: tonic::service::Interceptor,
8264        {
8265            InterceptedService::new(Self::new(inner), interceptor)
8266        }
8267        /// Enable decompressing requests with the given encoding.
8268        #[must_use]
8269        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8270            self.accept_compression_encodings.enable(encoding);
8271            self
8272        }
8273        /// Compress responses with the given encoding, if the client supports it.
8274        #[must_use]
8275        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8276            self.send_compression_encodings.enable(encoding);
8277            self
8278        }
8279        /// Limits the maximum size of a decoded message.
8280        ///
8281        /// Default: `4MB`
8282        #[must_use]
8283        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8284            self.max_decoding_message_size = Some(limit);
8285            self
8286        }
8287        /// Limits the maximum size of an encoded message.
8288        ///
8289        /// Default: `usize::MAX`
8290        #[must_use]
8291        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8292            self.max_encoding_message_size = Some(limit);
8293            self
8294        }
8295    }
8296    impl<T, B> tonic::codegen::Service<http::Request<B>> for MemberServiceServer<T>
8297    where
8298        T: MemberService,
8299        B: Body + std::marker::Send + 'static,
8300        B::Error: Into<StdError> + std::marker::Send + 'static,
8301    {
8302        type Response = http::Response<tonic::body::Body>;
8303        type Error = std::convert::Infallible;
8304        type Future = BoxFuture<Self::Response, Self::Error>;
8305        fn poll_ready(
8306            &mut self,
8307            _cx: &mut Context<'_>,
8308        ) -> Poll<std::result::Result<(), Self::Error>> {
8309            Poll::Ready(Ok(()))
8310        }
8311        fn call(&mut self, req: http::Request<B>) -> Self::Future {
8312            match req.uri().path() {
8313                "/pidgr.v1.MemberService/InviteUser" => {
8314                    #[allow(non_camel_case_types)]
8315                    struct InviteUserSvc<T: MemberService>(pub Arc<T>);
8316                    impl<
8317                        T: MemberService,
8318                    > tonic::server::UnaryService<super::InviteUserRequest>
8319                    for InviteUserSvc<T> {
8320                        type Response = super::InviteUserResponse;
8321                        type Future = BoxFuture<
8322                            tonic::Response<Self::Response>,
8323                            tonic::Status,
8324                        >;
8325                        fn call(
8326                            &mut self,
8327                            request: tonic::Request<super::InviteUserRequest>,
8328                        ) -> Self::Future {
8329                            let inner = Arc::clone(&self.0);
8330                            let fut = async move {
8331                                <T as MemberService>::invite_user(&inner, request).await
8332                            };
8333                            Box::pin(fut)
8334                        }
8335                    }
8336                    let accept_compression_encodings = self.accept_compression_encodings;
8337                    let send_compression_encodings = self.send_compression_encodings;
8338                    let max_decoding_message_size = self.max_decoding_message_size;
8339                    let max_encoding_message_size = self.max_encoding_message_size;
8340                    let inner = self.inner.clone();
8341                    let fut = async move {
8342                        let method = InviteUserSvc(inner);
8343                        let codec = tonic_prost::ProstCodec::default();
8344                        let mut grpc = tonic::server::Grpc::new(codec)
8345                            .apply_compression_config(
8346                                accept_compression_encodings,
8347                                send_compression_encodings,
8348                            )
8349                            .apply_max_message_size_config(
8350                                max_decoding_message_size,
8351                                max_encoding_message_size,
8352                            );
8353                        let res = grpc.unary(method, req).await;
8354                        Ok(res)
8355                    };
8356                    Box::pin(fut)
8357                }
8358                "/pidgr.v1.MemberService/GetUser" => {
8359                    #[allow(non_camel_case_types)]
8360                    struct GetUserSvc<T: MemberService>(pub Arc<T>);
8361                    impl<
8362                        T: MemberService,
8363                    > tonic::server::UnaryService<super::GetUserRequest>
8364                    for GetUserSvc<T> {
8365                        type Response = super::GetUserResponse;
8366                        type Future = BoxFuture<
8367                            tonic::Response<Self::Response>,
8368                            tonic::Status,
8369                        >;
8370                        fn call(
8371                            &mut self,
8372                            request: tonic::Request<super::GetUserRequest>,
8373                        ) -> Self::Future {
8374                            let inner = Arc::clone(&self.0);
8375                            let fut = async move {
8376                                <T as MemberService>::get_user(&inner, request).await
8377                            };
8378                            Box::pin(fut)
8379                        }
8380                    }
8381                    let accept_compression_encodings = self.accept_compression_encodings;
8382                    let send_compression_encodings = self.send_compression_encodings;
8383                    let max_decoding_message_size = self.max_decoding_message_size;
8384                    let max_encoding_message_size = self.max_encoding_message_size;
8385                    let inner = self.inner.clone();
8386                    let fut = async move {
8387                        let method = GetUserSvc(inner);
8388                        let codec = tonic_prost::ProstCodec::default();
8389                        let mut grpc = tonic::server::Grpc::new(codec)
8390                            .apply_compression_config(
8391                                accept_compression_encodings,
8392                                send_compression_encodings,
8393                            )
8394                            .apply_max_message_size_config(
8395                                max_decoding_message_size,
8396                                max_encoding_message_size,
8397                            );
8398                        let res = grpc.unary(method, req).await;
8399                        Ok(res)
8400                    };
8401                    Box::pin(fut)
8402                }
8403                "/pidgr.v1.MemberService/ListUsers" => {
8404                    #[allow(non_camel_case_types)]
8405                    struct ListUsersSvc<T: MemberService>(pub Arc<T>);
8406                    impl<
8407                        T: MemberService,
8408                    > tonic::server::UnaryService<super::ListUsersRequest>
8409                    for ListUsersSvc<T> {
8410                        type Response = super::ListUsersResponse;
8411                        type Future = BoxFuture<
8412                            tonic::Response<Self::Response>,
8413                            tonic::Status,
8414                        >;
8415                        fn call(
8416                            &mut self,
8417                            request: tonic::Request<super::ListUsersRequest>,
8418                        ) -> Self::Future {
8419                            let inner = Arc::clone(&self.0);
8420                            let fut = async move {
8421                                <T as MemberService>::list_users(&inner, request).await
8422                            };
8423                            Box::pin(fut)
8424                        }
8425                    }
8426                    let accept_compression_encodings = self.accept_compression_encodings;
8427                    let send_compression_encodings = self.send_compression_encodings;
8428                    let max_decoding_message_size = self.max_decoding_message_size;
8429                    let max_encoding_message_size = self.max_encoding_message_size;
8430                    let inner = self.inner.clone();
8431                    let fut = async move {
8432                        let method = ListUsersSvc(inner);
8433                        let codec = tonic_prost::ProstCodec::default();
8434                        let mut grpc = tonic::server::Grpc::new(codec)
8435                            .apply_compression_config(
8436                                accept_compression_encodings,
8437                                send_compression_encodings,
8438                            )
8439                            .apply_max_message_size_config(
8440                                max_decoding_message_size,
8441                                max_encoding_message_size,
8442                            );
8443                        let res = grpc.unary(method, req).await;
8444                        Ok(res)
8445                    };
8446                    Box::pin(fut)
8447                }
8448                "/pidgr.v1.MemberService/UpdateUserRole" => {
8449                    #[allow(non_camel_case_types)]
8450                    struct UpdateUserRoleSvc<T: MemberService>(pub Arc<T>);
8451                    impl<
8452                        T: MemberService,
8453                    > tonic::server::UnaryService<super::UpdateUserRoleRequest>
8454                    for UpdateUserRoleSvc<T> {
8455                        type Response = super::UpdateUserRoleResponse;
8456                        type Future = BoxFuture<
8457                            tonic::Response<Self::Response>,
8458                            tonic::Status,
8459                        >;
8460                        fn call(
8461                            &mut self,
8462                            request: tonic::Request<super::UpdateUserRoleRequest>,
8463                        ) -> Self::Future {
8464                            let inner = Arc::clone(&self.0);
8465                            let fut = async move {
8466                                <T as MemberService>::update_user_role(&inner, request)
8467                                    .await
8468                            };
8469                            Box::pin(fut)
8470                        }
8471                    }
8472                    let accept_compression_encodings = self.accept_compression_encodings;
8473                    let send_compression_encodings = self.send_compression_encodings;
8474                    let max_decoding_message_size = self.max_decoding_message_size;
8475                    let max_encoding_message_size = self.max_encoding_message_size;
8476                    let inner = self.inner.clone();
8477                    let fut = async move {
8478                        let method = UpdateUserRoleSvc(inner);
8479                        let codec = tonic_prost::ProstCodec::default();
8480                        let mut grpc = tonic::server::Grpc::new(codec)
8481                            .apply_compression_config(
8482                                accept_compression_encodings,
8483                                send_compression_encodings,
8484                            )
8485                            .apply_max_message_size_config(
8486                                max_decoding_message_size,
8487                                max_encoding_message_size,
8488                            );
8489                        let res = grpc.unary(method, req).await;
8490                        Ok(res)
8491                    };
8492                    Box::pin(fut)
8493                }
8494                "/pidgr.v1.MemberService/DeactivateUser" => {
8495                    #[allow(non_camel_case_types)]
8496                    struct DeactivateUserSvc<T: MemberService>(pub Arc<T>);
8497                    impl<
8498                        T: MemberService,
8499                    > tonic::server::UnaryService<super::DeactivateUserRequest>
8500                    for DeactivateUserSvc<T> {
8501                        type Response = super::DeactivateUserResponse;
8502                        type Future = BoxFuture<
8503                            tonic::Response<Self::Response>,
8504                            tonic::Status,
8505                        >;
8506                        fn call(
8507                            &mut self,
8508                            request: tonic::Request<super::DeactivateUserRequest>,
8509                        ) -> Self::Future {
8510                            let inner = Arc::clone(&self.0);
8511                            let fut = async move {
8512                                <T as MemberService>::deactivate_user(&inner, request).await
8513                            };
8514                            Box::pin(fut)
8515                        }
8516                    }
8517                    let accept_compression_encodings = self.accept_compression_encodings;
8518                    let send_compression_encodings = self.send_compression_encodings;
8519                    let max_decoding_message_size = self.max_decoding_message_size;
8520                    let max_encoding_message_size = self.max_encoding_message_size;
8521                    let inner = self.inner.clone();
8522                    let fut = async move {
8523                        let method = DeactivateUserSvc(inner);
8524                        let codec = tonic_prost::ProstCodec::default();
8525                        let mut grpc = tonic::server::Grpc::new(codec)
8526                            .apply_compression_config(
8527                                accept_compression_encodings,
8528                                send_compression_encodings,
8529                            )
8530                            .apply_max_message_size_config(
8531                                max_decoding_message_size,
8532                                max_encoding_message_size,
8533                            );
8534                        let res = grpc.unary(method, req).await;
8535                        Ok(res)
8536                    };
8537                    Box::pin(fut)
8538                }
8539                "/pidgr.v1.MemberService/ReactivateUser" => {
8540                    #[allow(non_camel_case_types)]
8541                    struct ReactivateUserSvc<T: MemberService>(pub Arc<T>);
8542                    impl<
8543                        T: MemberService,
8544                    > tonic::server::UnaryService<super::ReactivateUserRequest>
8545                    for ReactivateUserSvc<T> {
8546                        type Response = super::ReactivateUserResponse;
8547                        type Future = BoxFuture<
8548                            tonic::Response<Self::Response>,
8549                            tonic::Status,
8550                        >;
8551                        fn call(
8552                            &mut self,
8553                            request: tonic::Request<super::ReactivateUserRequest>,
8554                        ) -> Self::Future {
8555                            let inner = Arc::clone(&self.0);
8556                            let fut = async move {
8557                                <T as MemberService>::reactivate_user(&inner, request).await
8558                            };
8559                            Box::pin(fut)
8560                        }
8561                    }
8562                    let accept_compression_encodings = self.accept_compression_encodings;
8563                    let send_compression_encodings = self.send_compression_encodings;
8564                    let max_decoding_message_size = self.max_decoding_message_size;
8565                    let max_encoding_message_size = self.max_encoding_message_size;
8566                    let inner = self.inner.clone();
8567                    let fut = async move {
8568                        let method = ReactivateUserSvc(inner);
8569                        let codec = tonic_prost::ProstCodec::default();
8570                        let mut grpc = tonic::server::Grpc::new(codec)
8571                            .apply_compression_config(
8572                                accept_compression_encodings,
8573                                send_compression_encodings,
8574                            )
8575                            .apply_max_message_size_config(
8576                                max_decoding_message_size,
8577                                max_encoding_message_size,
8578                            );
8579                        let res = grpc.unary(method, req).await;
8580                        Ok(res)
8581                    };
8582                    Box::pin(fut)
8583                }
8584                "/pidgr.v1.MemberService/RevokeInvite" => {
8585                    #[allow(non_camel_case_types)]
8586                    struct RevokeInviteSvc<T: MemberService>(pub Arc<T>);
8587                    impl<
8588                        T: MemberService,
8589                    > tonic::server::UnaryService<super::RevokeInviteRequest>
8590                    for RevokeInviteSvc<T> {
8591                        type Response = super::RevokeInviteResponse;
8592                        type Future = BoxFuture<
8593                            tonic::Response<Self::Response>,
8594                            tonic::Status,
8595                        >;
8596                        fn call(
8597                            &mut self,
8598                            request: tonic::Request<super::RevokeInviteRequest>,
8599                        ) -> Self::Future {
8600                            let inner = Arc::clone(&self.0);
8601                            let fut = async move {
8602                                <T as MemberService>::revoke_invite(&inner, request).await
8603                            };
8604                            Box::pin(fut)
8605                        }
8606                    }
8607                    let accept_compression_encodings = self.accept_compression_encodings;
8608                    let send_compression_encodings = self.send_compression_encodings;
8609                    let max_decoding_message_size = self.max_decoding_message_size;
8610                    let max_encoding_message_size = self.max_encoding_message_size;
8611                    let inner = self.inner.clone();
8612                    let fut = async move {
8613                        let method = RevokeInviteSvc(inner);
8614                        let codec = tonic_prost::ProstCodec::default();
8615                        let mut grpc = tonic::server::Grpc::new(codec)
8616                            .apply_compression_config(
8617                                accept_compression_encodings,
8618                                send_compression_encodings,
8619                            )
8620                            .apply_max_message_size_config(
8621                                max_decoding_message_size,
8622                                max_encoding_message_size,
8623                            );
8624                        let res = grpc.unary(method, req).await;
8625                        Ok(res)
8626                    };
8627                    Box::pin(fut)
8628                }
8629                "/pidgr.v1.MemberService/UpdateUserProfile" => {
8630                    #[allow(non_camel_case_types)]
8631                    struct UpdateUserProfileSvc<T: MemberService>(pub Arc<T>);
8632                    impl<
8633                        T: MemberService,
8634                    > tonic::server::UnaryService<super::UpdateUserProfileRequest>
8635                    for UpdateUserProfileSvc<T> {
8636                        type Response = super::UpdateUserProfileResponse;
8637                        type Future = BoxFuture<
8638                            tonic::Response<Self::Response>,
8639                            tonic::Status,
8640                        >;
8641                        fn call(
8642                            &mut self,
8643                            request: tonic::Request<super::UpdateUserProfileRequest>,
8644                        ) -> Self::Future {
8645                            let inner = Arc::clone(&self.0);
8646                            let fut = async move {
8647                                <T as MemberService>::update_user_profile(&inner, request)
8648                                    .await
8649                            };
8650                            Box::pin(fut)
8651                        }
8652                    }
8653                    let accept_compression_encodings = self.accept_compression_encodings;
8654                    let send_compression_encodings = self.send_compression_encodings;
8655                    let max_decoding_message_size = self.max_decoding_message_size;
8656                    let max_encoding_message_size = self.max_encoding_message_size;
8657                    let inner = self.inner.clone();
8658                    let fut = async move {
8659                        let method = UpdateUserProfileSvc(inner);
8660                        let codec = tonic_prost::ProstCodec::default();
8661                        let mut grpc = tonic::server::Grpc::new(codec)
8662                            .apply_compression_config(
8663                                accept_compression_encodings,
8664                                send_compression_encodings,
8665                            )
8666                            .apply_max_message_size_config(
8667                                max_decoding_message_size,
8668                                max_encoding_message_size,
8669                            );
8670                        let res = grpc.unary(method, req).await;
8671                        Ok(res)
8672                    };
8673                    Box::pin(fut)
8674                }
8675                "/pidgr.v1.MemberService/GetUserSettings" => {
8676                    #[allow(non_camel_case_types)]
8677                    struct GetUserSettingsSvc<T: MemberService>(pub Arc<T>);
8678                    impl<
8679                        T: MemberService,
8680                    > tonic::server::UnaryService<super::GetUserSettingsRequest>
8681                    for GetUserSettingsSvc<T> {
8682                        type Response = super::GetUserSettingsResponse;
8683                        type Future = BoxFuture<
8684                            tonic::Response<Self::Response>,
8685                            tonic::Status,
8686                        >;
8687                        fn call(
8688                            &mut self,
8689                            request: tonic::Request<super::GetUserSettingsRequest>,
8690                        ) -> Self::Future {
8691                            let inner = Arc::clone(&self.0);
8692                            let fut = async move {
8693                                <T as MemberService>::get_user_settings(&inner, request)
8694                                    .await
8695                            };
8696                            Box::pin(fut)
8697                        }
8698                    }
8699                    let accept_compression_encodings = self.accept_compression_encodings;
8700                    let send_compression_encodings = self.send_compression_encodings;
8701                    let max_decoding_message_size = self.max_decoding_message_size;
8702                    let max_encoding_message_size = self.max_encoding_message_size;
8703                    let inner = self.inner.clone();
8704                    let fut = async move {
8705                        let method = GetUserSettingsSvc(inner);
8706                        let codec = tonic_prost::ProstCodec::default();
8707                        let mut grpc = tonic::server::Grpc::new(codec)
8708                            .apply_compression_config(
8709                                accept_compression_encodings,
8710                                send_compression_encodings,
8711                            )
8712                            .apply_max_message_size_config(
8713                                max_decoding_message_size,
8714                                max_encoding_message_size,
8715                            );
8716                        let res = grpc.unary(method, req).await;
8717                        Ok(res)
8718                    };
8719                    Box::pin(fut)
8720                }
8721                "/pidgr.v1.MemberService/UpdateUserSettings" => {
8722                    #[allow(non_camel_case_types)]
8723                    struct UpdateUserSettingsSvc<T: MemberService>(pub Arc<T>);
8724                    impl<
8725                        T: MemberService,
8726                    > tonic::server::UnaryService<super::UpdateUserSettingsRequest>
8727                    for UpdateUserSettingsSvc<T> {
8728                        type Response = super::UpdateUserSettingsResponse;
8729                        type Future = BoxFuture<
8730                            tonic::Response<Self::Response>,
8731                            tonic::Status,
8732                        >;
8733                        fn call(
8734                            &mut self,
8735                            request: tonic::Request<super::UpdateUserSettingsRequest>,
8736                        ) -> Self::Future {
8737                            let inner = Arc::clone(&self.0);
8738                            let fut = async move {
8739                                <T as MemberService>::update_user_settings(&inner, request)
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 = UpdateUserSettingsSvc(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.MemberService/BulkInviteUsers" => {
8768                    #[allow(non_camel_case_types)]
8769                    struct BulkInviteUsersSvc<T: MemberService>(pub Arc<T>);
8770                    impl<
8771                        T: MemberService,
8772                    > tonic::server::UnaryService<super::BulkInviteUsersRequest>
8773                    for BulkInviteUsersSvc<T> {
8774                        type Response = super::BulkInviteUsersResponse;
8775                        type Future = BoxFuture<
8776                            tonic::Response<Self::Response>,
8777                            tonic::Status,
8778                        >;
8779                        fn call(
8780                            &mut self,
8781                            request: tonic::Request<super::BulkInviteUsersRequest>,
8782                        ) -> Self::Future {
8783                            let inner = Arc::clone(&self.0);
8784                            let fut = async move {
8785                                <T as MemberService>::bulk_invite_users(&inner, request)
8786                                    .await
8787                            };
8788                            Box::pin(fut)
8789                        }
8790                    }
8791                    let accept_compression_encodings = self.accept_compression_encodings;
8792                    let send_compression_encodings = self.send_compression_encodings;
8793                    let max_decoding_message_size = self.max_decoding_message_size;
8794                    let max_encoding_message_size = self.max_encoding_message_size;
8795                    let inner = self.inner.clone();
8796                    let fut = async move {
8797                        let method = BulkInviteUsersSvc(inner);
8798                        let codec = tonic_prost::ProstCodec::default();
8799                        let mut grpc = tonic::server::Grpc::new(codec)
8800                            .apply_compression_config(
8801                                accept_compression_encodings,
8802                                send_compression_encodings,
8803                            )
8804                            .apply_max_message_size_config(
8805                                max_decoding_message_size,
8806                                max_encoding_message_size,
8807                            );
8808                        let res = grpc.unary(method, req).await;
8809                        Ok(res)
8810                    };
8811                    Box::pin(fut)
8812                }
8813                "/pidgr.v1.MemberService/ConfirmPasskeyEnrollment" => {
8814                    #[allow(non_camel_case_types)]
8815                    struct ConfirmPasskeyEnrollmentSvc<T: MemberService>(pub Arc<T>);
8816                    impl<
8817                        T: MemberService,
8818                    > tonic::server::UnaryService<super::ConfirmPasskeyEnrollmentRequest>
8819                    for ConfirmPasskeyEnrollmentSvc<T> {
8820                        type Response = super::ConfirmPasskeyEnrollmentResponse;
8821                        type Future = BoxFuture<
8822                            tonic::Response<Self::Response>,
8823                            tonic::Status,
8824                        >;
8825                        fn call(
8826                            &mut self,
8827                            request: tonic::Request<
8828                                super::ConfirmPasskeyEnrollmentRequest,
8829                            >,
8830                        ) -> Self::Future {
8831                            let inner = Arc::clone(&self.0);
8832                            let fut = async move {
8833                                <T as MemberService>::confirm_passkey_enrollment(
8834                                        &inner,
8835                                        request,
8836                                    )
8837                                    .await
8838                            };
8839                            Box::pin(fut)
8840                        }
8841                    }
8842                    let accept_compression_encodings = self.accept_compression_encodings;
8843                    let send_compression_encodings = self.send_compression_encodings;
8844                    let max_decoding_message_size = self.max_decoding_message_size;
8845                    let max_encoding_message_size = self.max_encoding_message_size;
8846                    let inner = self.inner.clone();
8847                    let fut = async move {
8848                        let method = ConfirmPasskeyEnrollmentSvc(inner);
8849                        let codec = tonic_prost::ProstCodec::default();
8850                        let mut grpc = tonic::server::Grpc::new(codec)
8851                            .apply_compression_config(
8852                                accept_compression_encodings,
8853                                send_compression_encodings,
8854                            )
8855                            .apply_max_message_size_config(
8856                                max_decoding_message_size,
8857                                max_encoding_message_size,
8858                            );
8859                        let res = grpc.unary(method, req).await;
8860                        Ok(res)
8861                    };
8862                    Box::pin(fut)
8863                }
8864                "/pidgr.v1.MemberService/UpdateUserRegion" => {
8865                    #[allow(non_camel_case_types)]
8866                    struct UpdateUserRegionSvc<T: MemberService>(pub Arc<T>);
8867                    impl<
8868                        T: MemberService,
8869                    > tonic::server::UnaryService<super::UpdateUserRegionRequest>
8870                    for UpdateUserRegionSvc<T> {
8871                        type Response = super::UpdateUserRegionResponse;
8872                        type Future = BoxFuture<
8873                            tonic::Response<Self::Response>,
8874                            tonic::Status,
8875                        >;
8876                        fn call(
8877                            &mut self,
8878                            request: tonic::Request<super::UpdateUserRegionRequest>,
8879                        ) -> Self::Future {
8880                            let inner = Arc::clone(&self.0);
8881                            let fut = async move {
8882                                <T as MemberService>::update_user_region(&inner, request)
8883                                    .await
8884                            };
8885                            Box::pin(fut)
8886                        }
8887                    }
8888                    let accept_compression_encodings = self.accept_compression_encodings;
8889                    let send_compression_encodings = self.send_compression_encodings;
8890                    let max_decoding_message_size = self.max_decoding_message_size;
8891                    let max_encoding_message_size = self.max_encoding_message_size;
8892                    let inner = self.inner.clone();
8893                    let fut = async move {
8894                        let method = UpdateUserRegionSvc(inner);
8895                        let codec = tonic_prost::ProstCodec::default();
8896                        let mut grpc = tonic::server::Grpc::new(codec)
8897                            .apply_compression_config(
8898                                accept_compression_encodings,
8899                                send_compression_encodings,
8900                            )
8901                            .apply_max_message_size_config(
8902                                max_decoding_message_size,
8903                                max_encoding_message_size,
8904                            );
8905                        let res = grpc.unary(method, req).await;
8906                        Ok(res)
8907                    };
8908                    Box::pin(fut)
8909                }
8910                _ => {
8911                    Box::pin(async move {
8912                        let mut response = http::Response::new(
8913                            tonic::body::Body::default(),
8914                        );
8915                        let headers = response.headers_mut();
8916                        headers
8917                            .insert(
8918                                tonic::Status::GRPC_STATUS,
8919                                (tonic::Code::Unimplemented as i32).into(),
8920                            );
8921                        headers
8922                            .insert(
8923                                http::header::CONTENT_TYPE,
8924                                tonic::metadata::GRPC_CONTENT_TYPE,
8925                            );
8926                        Ok(response)
8927                    })
8928                }
8929            }
8930        }
8931    }
8932    impl<T> Clone for MemberServiceServer<T> {
8933        fn clone(&self) -> Self {
8934            let inner = self.inner.clone();
8935            Self {
8936                inner,
8937                accept_compression_encodings: self.accept_compression_encodings,
8938                send_compression_encodings: self.send_compression_encodings,
8939                max_decoding_message_size: self.max_decoding_message_size,
8940                max_encoding_message_size: self.max_encoding_message_size,
8941            }
8942        }
8943    }
8944    /// Generated gRPC service name
8945    pub const SERVICE_NAME: &str = "pidgr.v1.MemberService";
8946    impl<T> tonic::server::NamedService for MemberServiceServer<T> {
8947        const NAME: &'static str = SERVICE_NAME;
8948    }
8949}
8950/// Generated client implementations.
8951pub mod organization_service_client {
8952    #![allow(
8953        unused_variables,
8954        dead_code,
8955        missing_docs,
8956        clippy::wildcard_imports,
8957        clippy::let_unit_value,
8958    )]
8959    use tonic::codegen::*;
8960    use tonic::codegen::http::Uri;
8961    /** Manages organizations (tenants) in the Pidgr platform.
8962 Most RPCs operate within the caller's org (extracted from JWT).
8963 CreateOrganization supports API key auth or JWT auth (self-service onboarding).
8964*/
8965    #[derive(Debug, Clone)]
8966    pub struct OrganizationServiceClient<T> {
8967        inner: tonic::client::Grpc<T>,
8968    }
8969    impl OrganizationServiceClient<tonic::transport::Channel> {
8970        /// Attempt to create a new client by connecting to a given endpoint.
8971        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
8972        where
8973            D: TryInto<tonic::transport::Endpoint>,
8974            D::Error: Into<StdError>,
8975        {
8976            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
8977            Ok(Self::new(conn))
8978        }
8979    }
8980    impl<T> OrganizationServiceClient<T>
8981    where
8982        T: tonic::client::GrpcService<tonic::body::Body>,
8983        T::Error: Into<StdError>,
8984        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
8985        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
8986    {
8987        pub fn new(inner: T) -> Self {
8988            let inner = tonic::client::Grpc::new(inner);
8989            Self { inner }
8990        }
8991        pub fn with_origin(inner: T, origin: Uri) -> Self {
8992            let inner = tonic::client::Grpc::with_origin(inner, origin);
8993            Self { inner }
8994        }
8995        pub fn with_interceptor<F>(
8996            inner: T,
8997            interceptor: F,
8998        ) -> OrganizationServiceClient<InterceptedService<T, F>>
8999        where
9000            F: tonic::service::Interceptor,
9001            T::ResponseBody: Default,
9002            T: tonic::codegen::Service<
9003                http::Request<tonic::body::Body>,
9004                Response = http::Response<
9005                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
9006                >,
9007            >,
9008            <T as tonic::codegen::Service<
9009                http::Request<tonic::body::Body>,
9010            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
9011        {
9012            OrganizationServiceClient::new(InterceptedService::new(inner, interceptor))
9013        }
9014        /// Compress requests with the given encoding.
9015        ///
9016        /// This requires the server to support it otherwise it might respond with an
9017        /// error.
9018        #[must_use]
9019        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9020            self.inner = self.inner.send_compressed(encoding);
9021            self
9022        }
9023        /// Enable decompressing responses.
9024        #[must_use]
9025        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9026            self.inner = self.inner.accept_compressed(encoding);
9027            self
9028        }
9029        /// Limits the maximum size of a decoded message.
9030        ///
9031        /// Default: `4MB`
9032        #[must_use]
9033        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9034            self.inner = self.inner.max_decoding_message_size(limit);
9035            self
9036        }
9037        /// Limits the maximum size of an encoded message.
9038        ///
9039        /// Default: `usize::MAX`
9040        #[must_use]
9041        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9042            self.inner = self.inner.max_encoding_message_size(limit);
9043            self
9044        }
9045        /** Create a new organization. JWT auth only — the caller becomes the initial
9046 admin. Add further admins via CreateInviteLink.
9047 Authorization: Authenticated user (no specific permission required).
9048*/
9049        pub async fn create_organization(
9050            &mut self,
9051            request: impl tonic::IntoRequest<super::CreateOrganizationRequest>,
9052        ) -> std::result::Result<
9053            tonic::Response<super::CreateOrganizationResponse>,
9054            tonic::Status,
9055        > {
9056            self.inner
9057                .ready()
9058                .await
9059                .map_err(|e| {
9060                    tonic::Status::unknown(
9061                        format!("Service was not ready: {}", e.into()),
9062                    )
9063                })?;
9064            let codec = tonic_prost::ProstCodec::default();
9065            let path = http::uri::PathAndQuery::from_static(
9066                "/pidgr.v1.OrganizationService/CreateOrganization",
9067            );
9068            let mut req = request.into_request();
9069            req.extensions_mut()
9070                .insert(
9071                    GrpcMethod::new("pidgr.v1.OrganizationService", "CreateOrganization"),
9072                );
9073            self.inner.unary(req, path, codec).await
9074        }
9075        /** Retrieve the organization for the authenticated user.
9076 Authorization: Requires PERMISSION_ORG_READ.
9077*/
9078        pub async fn get_organization(
9079            &mut self,
9080            request: impl tonic::IntoRequest<super::GetOrganizationRequest>,
9081        ) -> std::result::Result<
9082            tonic::Response<super::GetOrganizationResponse>,
9083            tonic::Status,
9084        > {
9085            self.inner
9086                .ready()
9087                .await
9088                .map_err(|e| {
9089                    tonic::Status::unknown(
9090                        format!("Service was not ready: {}", e.into()),
9091                    )
9092                })?;
9093            let codec = tonic_prost::ProstCodec::default();
9094            let path = http::uri::PathAndQuery::from_static(
9095                "/pidgr.v1.OrganizationService/GetOrganization",
9096            );
9097            let mut req = request.into_request();
9098            req.extensions_mut()
9099                .insert(
9100                    GrpcMethod::new("pidgr.v1.OrganizationService", "GetOrganization"),
9101                );
9102            self.inner.unary(req, path, codec).await
9103        }
9104        /** Update organization settings (name, default workflow, industry, company size).
9105 Authorization: Requires PERMISSION_ORG_WRITE.
9106*/
9107        pub async fn update_organization(
9108            &mut self,
9109            request: impl tonic::IntoRequest<super::UpdateOrganizationRequest>,
9110        ) -> std::result::Result<
9111            tonic::Response<super::UpdateOrganizationResponse>,
9112            tonic::Status,
9113        > {
9114            self.inner
9115                .ready()
9116                .await
9117                .map_err(|e| {
9118                    tonic::Status::unknown(
9119                        format!("Service was not ready: {}", e.into()),
9120                    )
9121                })?;
9122            let codec = tonic_prost::ProstCodec::default();
9123            let path = http::uri::PathAndQuery::from_static(
9124                "/pidgr.v1.OrganizationService/UpdateOrganization",
9125            );
9126            let mut req = request.into_request();
9127            req.extensions_mut()
9128                .insert(
9129                    GrpcMethod::new("pidgr.v1.OrganizationService", "UpdateOrganization"),
9130                );
9131            self.inner.unary(req, path, codec).await
9132        }
9133        /** Replace all SSO attribute mappings for the organization.
9134 Authorization: Requires PERMISSION_ORG_WRITE.
9135*/
9136        pub async fn update_sso_attribute_mappings(
9137            &mut self,
9138            request: impl tonic::IntoRequest<super::UpdateSsoAttributeMappingsRequest>,
9139        ) -> std::result::Result<
9140            tonic::Response<super::UpdateSsoAttributeMappingsResponse>,
9141            tonic::Status,
9142        > {
9143            self.inner
9144                .ready()
9145                .await
9146                .map_err(|e| {
9147                    tonic::Status::unknown(
9148                        format!("Service was not ready: {}", e.into()),
9149                    )
9150                })?;
9151            let codec = tonic_prost::ProstCodec::default();
9152            let path = http::uri::PathAndQuery::from_static(
9153                "/pidgr.v1.OrganizationService/UpdateSsoAttributeMappings",
9154            );
9155            let mut req = request.into_request();
9156            req.extensions_mut()
9157                .insert(
9158                    GrpcMethod::new(
9159                        "pidgr.v1.OrganizationService",
9160                        "UpdateSsoAttributeMappings",
9161                    ),
9162                );
9163            self.inner.unary(req, path, codec).await
9164        }
9165        /** Rotate the analytics salt and optionally increase the bucket count for k-anonymization.
9166 Authorization: Requires PERMISSION_PRIVACY_WRITE.
9167*/
9168        pub async fn rotate_analytics_salt(
9169            &mut self,
9170            request: impl tonic::IntoRequest<super::RotateAnalyticsSaltRequest>,
9171        ) -> std::result::Result<
9172            tonic::Response<super::RotateAnalyticsSaltResponse>,
9173            tonic::Status,
9174        > {
9175            self.inner
9176                .ready()
9177                .await
9178                .map_err(|e| {
9179                    tonic::Status::unknown(
9180                        format!("Service was not ready: {}", e.into()),
9181                    )
9182                })?;
9183            let codec = tonic_prost::ProstCodec::default();
9184            let path = http::uri::PathAndQuery::from_static(
9185                "/pidgr.v1.OrganizationService/RotateAnalyticsSalt",
9186            );
9187            let mut req = request.into_request();
9188            req.extensions_mut()
9189                .insert(
9190                    GrpcMethod::new(
9191                        "pidgr.v1.OrganizationService",
9192                        "RotateAnalyticsSalt",
9193                    ),
9194                );
9195            self.inner.unary(req, path, codec).await
9196        }
9197        /** Update the differential privacy epsilon parameter.
9198 Authorization: Requires PERMISSION_PRIVACY_WRITE.
9199*/
9200        pub async fn update_analytics_epsilon(
9201            &mut self,
9202            request: impl tonic::IntoRequest<super::UpdateAnalyticsEpsilonRequest>,
9203        ) -> std::result::Result<
9204            tonic::Response<super::UpdateAnalyticsEpsilonResponse>,
9205            tonic::Status,
9206        > {
9207            self.inner
9208                .ready()
9209                .await
9210                .map_err(|e| {
9211                    tonic::Status::unknown(
9212                        format!("Service was not ready: {}", e.into()),
9213                    )
9214                })?;
9215            let codec = tonic_prost::ProstCodec::default();
9216            let path = http::uri::PathAndQuery::from_static(
9217                "/pidgr.v1.OrganizationService/UpdateAnalyticsEpsilon",
9218            );
9219            let mut req = request.into_request();
9220            req.extensions_mut()
9221                .insert(
9222                    GrpcMethod::new(
9223                        "pidgr.v1.OrganizationService",
9224                        "UpdateAnalyticsEpsilon",
9225                    ),
9226                );
9227            self.inner.unary(req, path, codec).await
9228        }
9229        /** Create a sandbox organization for testing configurations.
9230 Sandbox orgs auto-delete after expires_at. The caller becomes super admin.
9231 Authorization: Any authenticated user. Limited to 3 concurrent sandboxes
9232 per user to prevent abuse.
9233*/
9234        pub async fn create_sandbox_organization(
9235            &mut self,
9236            request: impl tonic::IntoRequest<super::CreateSandboxOrganizationRequest>,
9237        ) -> std::result::Result<
9238            tonic::Response<super::CreateSandboxOrganizationResponse>,
9239            tonic::Status,
9240        > {
9241            self.inner
9242                .ready()
9243                .await
9244                .map_err(|e| {
9245                    tonic::Status::unknown(
9246                        format!("Service was not ready: {}", e.into()),
9247                    )
9248                })?;
9249            let codec = tonic_prost::ProstCodec::default();
9250            let path = http::uri::PathAndQuery::from_static(
9251                "/pidgr.v1.OrganizationService/CreateSandboxOrganization",
9252            );
9253            let mut req = request.into_request();
9254            req.extensions_mut()
9255                .insert(
9256                    GrpcMethod::new(
9257                        "pidgr.v1.OrganizationService",
9258                        "CreateSandboxOrganization",
9259                    ),
9260                );
9261            self.inner.unary(req, path, codec).await
9262        }
9263        /** Delete a sandbox organization immediately. Starts the DeleteOrgWorkflow
9264 which handles cleanup across DB, Cognito, S3, Temporal, and regional
9265 content stores.
9266 Authorization: Super admin of the target sandbox OR its creator.
9267*/
9268        pub async fn delete_sandbox_organization(
9269            &mut self,
9270            request: impl tonic::IntoRequest<super::DeleteSandboxOrganizationRequest>,
9271        ) -> std::result::Result<
9272            tonic::Response<super::DeleteSandboxOrganizationResponse>,
9273            tonic::Status,
9274        > {
9275            self.inner
9276                .ready()
9277                .await
9278                .map_err(|e| {
9279                    tonic::Status::unknown(
9280                        format!("Service was not ready: {}", e.into()),
9281                    )
9282                })?;
9283            let codec = tonic_prost::ProstCodec::default();
9284            let path = http::uri::PathAndQuery::from_static(
9285                "/pidgr.v1.OrganizationService/DeleteSandboxOrganization",
9286            );
9287            let mut req = request.into_request();
9288            req.extensions_mut()
9289                .insert(
9290                    GrpcMethod::new(
9291                        "pidgr.v1.OrganizationService",
9292                        "DeleteSandboxOrganization",
9293                    ),
9294                );
9295            self.inner.unary(req, path, codec).await
9296        }
9297        /** List sandbox fixtures available for seeding new sandbox orgs. The catalog
9298 is backend-owned; admin UI populates the "fill with sample data" checkbox
9299 or dropdown from this response.
9300 Authorization: Any authenticated user.
9301*/
9302        pub async fn list_sandbox_fixtures(
9303            &mut self,
9304            request: impl tonic::IntoRequest<super::ListSandboxFixturesRequest>,
9305        ) -> std::result::Result<
9306            tonic::Response<super::ListSandboxFixturesResponse>,
9307            tonic::Status,
9308        > {
9309            self.inner
9310                .ready()
9311                .await
9312                .map_err(|e| {
9313                    tonic::Status::unknown(
9314                        format!("Service was not ready: {}", e.into()),
9315                    )
9316                })?;
9317            let codec = tonic_prost::ProstCodec::default();
9318            let path = http::uri::PathAndQuery::from_static(
9319                "/pidgr.v1.OrganizationService/ListSandboxFixtures",
9320            );
9321            let mut req = request.into_request();
9322            req.extensions_mut()
9323                .insert(
9324                    GrpcMethod::new(
9325                        "pidgr.v1.OrganizationService",
9326                        "ListSandboxFixtures",
9327                    ),
9328                );
9329            self.inner.unary(req, path, codec).await
9330        }
9331        /** List all organizations the authenticated user belongs to.
9332 Org-exempt: callable without org context (only requires valid JWT).
9333 Used by the admin org switcher to discover available orgs.
9334 Excludes expired sandbox organizations.
9335 Authorization: Authenticated user (no specific permission required).
9336*/
9337        pub async fn list_user_organizations(
9338            &mut self,
9339            request: impl tonic::IntoRequest<super::ListUserOrganizationsRequest>,
9340        ) -> std::result::Result<
9341            tonic::Response<super::ListUserOrganizationsResponse>,
9342            tonic::Status,
9343        > {
9344            self.inner
9345                .ready()
9346                .await
9347                .map_err(|e| {
9348                    tonic::Status::unknown(
9349                        format!("Service was not ready: {}", e.into()),
9350                    )
9351                })?;
9352            let codec = tonic_prost::ProstCodec::default();
9353            let path = http::uri::PathAndQuery::from_static(
9354                "/pidgr.v1.OrganizationService/ListUserOrganizations",
9355            );
9356            let mut req = request.into_request();
9357            req.extensions_mut()
9358                .insert(
9359                    GrpcMethod::new(
9360                        "pidgr.v1.OrganizationService",
9361                        "ListUserOrganizations",
9362                    ),
9363                );
9364            self.inner.unary(req, path, codec).await
9365        }
9366        /** List only the sandbox organizations the authenticated user belongs to.
9367 Org-exempt: callable without org context. The admin UI's /sandboxes
9368 management page is the primary consumer — it's a user-level surface
9369 rather than org-scoped, so this RPC is user-scoped too.
9370 Excludes already-expired sandboxes (pending cleanup).
9371 Authorization: Authenticated user (no specific permission required).
9372*/
9373        pub async fn list_user_sandboxes(
9374            &mut self,
9375            request: impl tonic::IntoRequest<super::ListUserSandboxesRequest>,
9376        ) -> std::result::Result<
9377            tonic::Response<super::ListUserSandboxesResponse>,
9378            tonic::Status,
9379        > {
9380            self.inner
9381                .ready()
9382                .await
9383                .map_err(|e| {
9384                    tonic::Status::unknown(
9385                        format!("Service was not ready: {}", e.into()),
9386                    )
9387                })?;
9388            let codec = tonic_prost::ProstCodec::default();
9389            let path = http::uri::PathAndQuery::from_static(
9390                "/pidgr.v1.OrganizationService/ListUserSandboxes",
9391            );
9392            let mut req = request.into_request();
9393            req.extensions_mut()
9394                .insert(
9395                    GrpcMethod::new("pidgr.v1.OrganizationService", "ListUserSandboxes"),
9396                );
9397            self.inner.unary(req, path, codec).await
9398        }
9399    }
9400}
9401/// Generated server implementations.
9402pub mod organization_service_server {
9403    #![allow(
9404        unused_variables,
9405        dead_code,
9406        missing_docs,
9407        clippy::wildcard_imports,
9408        clippy::let_unit_value,
9409    )]
9410    use tonic::codegen::*;
9411    /// Generated trait containing gRPC methods that should be implemented for use with OrganizationServiceServer.
9412    #[async_trait]
9413    pub trait OrganizationService: std::marker::Send + std::marker::Sync + 'static {
9414        /** Create a new organization. JWT auth only — the caller becomes the initial
9415 admin. Add further admins via CreateInviteLink.
9416 Authorization: Authenticated user (no specific permission required).
9417*/
9418        async fn create_organization(
9419            &self,
9420            request: tonic::Request<super::CreateOrganizationRequest>,
9421        ) -> std::result::Result<
9422            tonic::Response<super::CreateOrganizationResponse>,
9423            tonic::Status,
9424        >;
9425        /** Retrieve the organization for the authenticated user.
9426 Authorization: Requires PERMISSION_ORG_READ.
9427*/
9428        async fn get_organization(
9429            &self,
9430            request: tonic::Request<super::GetOrganizationRequest>,
9431        ) -> std::result::Result<
9432            tonic::Response<super::GetOrganizationResponse>,
9433            tonic::Status,
9434        >;
9435        /** Update organization settings (name, default workflow, industry, company size).
9436 Authorization: Requires PERMISSION_ORG_WRITE.
9437*/
9438        async fn update_organization(
9439            &self,
9440            request: tonic::Request<super::UpdateOrganizationRequest>,
9441        ) -> std::result::Result<
9442            tonic::Response<super::UpdateOrganizationResponse>,
9443            tonic::Status,
9444        >;
9445        /** Replace all SSO attribute mappings for the organization.
9446 Authorization: Requires PERMISSION_ORG_WRITE.
9447*/
9448        async fn update_sso_attribute_mappings(
9449            &self,
9450            request: tonic::Request<super::UpdateSsoAttributeMappingsRequest>,
9451        ) -> std::result::Result<
9452            tonic::Response<super::UpdateSsoAttributeMappingsResponse>,
9453            tonic::Status,
9454        >;
9455        /** Rotate the analytics salt and optionally increase the bucket count for k-anonymization.
9456 Authorization: Requires PERMISSION_PRIVACY_WRITE.
9457*/
9458        async fn rotate_analytics_salt(
9459            &self,
9460            request: tonic::Request<super::RotateAnalyticsSaltRequest>,
9461        ) -> std::result::Result<
9462            tonic::Response<super::RotateAnalyticsSaltResponse>,
9463            tonic::Status,
9464        >;
9465        /** Update the differential privacy epsilon parameter.
9466 Authorization: Requires PERMISSION_PRIVACY_WRITE.
9467*/
9468        async fn update_analytics_epsilon(
9469            &self,
9470            request: tonic::Request<super::UpdateAnalyticsEpsilonRequest>,
9471        ) -> std::result::Result<
9472            tonic::Response<super::UpdateAnalyticsEpsilonResponse>,
9473            tonic::Status,
9474        >;
9475        /** Create a sandbox organization for testing configurations.
9476 Sandbox orgs auto-delete after expires_at. The caller becomes super admin.
9477 Authorization: Any authenticated user. Limited to 3 concurrent sandboxes
9478 per user to prevent abuse.
9479*/
9480        async fn create_sandbox_organization(
9481            &self,
9482            request: tonic::Request<super::CreateSandboxOrganizationRequest>,
9483        ) -> std::result::Result<
9484            tonic::Response<super::CreateSandboxOrganizationResponse>,
9485            tonic::Status,
9486        >;
9487        /** Delete a sandbox organization immediately. Starts the DeleteOrgWorkflow
9488 which handles cleanup across DB, Cognito, S3, Temporal, and regional
9489 content stores.
9490 Authorization: Super admin of the target sandbox OR its creator.
9491*/
9492        async fn delete_sandbox_organization(
9493            &self,
9494            request: tonic::Request<super::DeleteSandboxOrganizationRequest>,
9495        ) -> std::result::Result<
9496            tonic::Response<super::DeleteSandboxOrganizationResponse>,
9497            tonic::Status,
9498        >;
9499        /** List sandbox fixtures available for seeding new sandbox orgs. The catalog
9500 is backend-owned; admin UI populates the "fill with sample data" checkbox
9501 or dropdown from this response.
9502 Authorization: Any authenticated user.
9503*/
9504        async fn list_sandbox_fixtures(
9505            &self,
9506            request: tonic::Request<super::ListSandboxFixturesRequest>,
9507        ) -> std::result::Result<
9508            tonic::Response<super::ListSandboxFixturesResponse>,
9509            tonic::Status,
9510        >;
9511        /** List all organizations the authenticated user belongs to.
9512 Org-exempt: callable without org context (only requires valid JWT).
9513 Used by the admin org switcher to discover available orgs.
9514 Excludes expired sandbox organizations.
9515 Authorization: Authenticated user (no specific permission required).
9516*/
9517        async fn list_user_organizations(
9518            &self,
9519            request: tonic::Request<super::ListUserOrganizationsRequest>,
9520        ) -> std::result::Result<
9521            tonic::Response<super::ListUserOrganizationsResponse>,
9522            tonic::Status,
9523        >;
9524        /** List only the sandbox organizations the authenticated user belongs to.
9525 Org-exempt: callable without org context. The admin UI's /sandboxes
9526 management page is the primary consumer — it's a user-level surface
9527 rather than org-scoped, so this RPC is user-scoped too.
9528 Excludes already-expired sandboxes (pending cleanup).
9529 Authorization: Authenticated user (no specific permission required).
9530*/
9531        async fn list_user_sandboxes(
9532            &self,
9533            request: tonic::Request<super::ListUserSandboxesRequest>,
9534        ) -> std::result::Result<
9535            tonic::Response<super::ListUserSandboxesResponse>,
9536            tonic::Status,
9537        >;
9538    }
9539    /** Manages organizations (tenants) in the Pidgr platform.
9540 Most RPCs operate within the caller's org (extracted from JWT).
9541 CreateOrganization supports API key auth or JWT auth (self-service onboarding).
9542*/
9543    #[derive(Debug)]
9544    pub struct OrganizationServiceServer<T> {
9545        inner: Arc<T>,
9546        accept_compression_encodings: EnabledCompressionEncodings,
9547        send_compression_encodings: EnabledCompressionEncodings,
9548        max_decoding_message_size: Option<usize>,
9549        max_encoding_message_size: Option<usize>,
9550    }
9551    impl<T> OrganizationServiceServer<T> {
9552        pub fn new(inner: T) -> Self {
9553            Self::from_arc(Arc::new(inner))
9554        }
9555        pub fn from_arc(inner: Arc<T>) -> Self {
9556            Self {
9557                inner,
9558                accept_compression_encodings: Default::default(),
9559                send_compression_encodings: Default::default(),
9560                max_decoding_message_size: None,
9561                max_encoding_message_size: None,
9562            }
9563        }
9564        pub fn with_interceptor<F>(
9565            inner: T,
9566            interceptor: F,
9567        ) -> InterceptedService<Self, F>
9568        where
9569            F: tonic::service::Interceptor,
9570        {
9571            InterceptedService::new(Self::new(inner), interceptor)
9572        }
9573        /// Enable decompressing requests with the given encoding.
9574        #[must_use]
9575        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9576            self.accept_compression_encodings.enable(encoding);
9577            self
9578        }
9579        /// Compress responses with the given encoding, if the client supports it.
9580        #[must_use]
9581        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9582            self.send_compression_encodings.enable(encoding);
9583            self
9584        }
9585        /// Limits the maximum size of a decoded message.
9586        ///
9587        /// Default: `4MB`
9588        #[must_use]
9589        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9590            self.max_decoding_message_size = Some(limit);
9591            self
9592        }
9593        /// Limits the maximum size of an encoded message.
9594        ///
9595        /// Default: `usize::MAX`
9596        #[must_use]
9597        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9598            self.max_encoding_message_size = Some(limit);
9599            self
9600        }
9601    }
9602    impl<T, B> tonic::codegen::Service<http::Request<B>> for OrganizationServiceServer<T>
9603    where
9604        T: OrganizationService,
9605        B: Body + std::marker::Send + 'static,
9606        B::Error: Into<StdError> + std::marker::Send + 'static,
9607    {
9608        type Response = http::Response<tonic::body::Body>;
9609        type Error = std::convert::Infallible;
9610        type Future = BoxFuture<Self::Response, Self::Error>;
9611        fn poll_ready(
9612            &mut self,
9613            _cx: &mut Context<'_>,
9614        ) -> Poll<std::result::Result<(), Self::Error>> {
9615            Poll::Ready(Ok(()))
9616        }
9617        fn call(&mut self, req: http::Request<B>) -> Self::Future {
9618            match req.uri().path() {
9619                "/pidgr.v1.OrganizationService/CreateOrganization" => {
9620                    #[allow(non_camel_case_types)]
9621                    struct CreateOrganizationSvc<T: OrganizationService>(pub Arc<T>);
9622                    impl<
9623                        T: OrganizationService,
9624                    > tonic::server::UnaryService<super::CreateOrganizationRequest>
9625                    for CreateOrganizationSvc<T> {
9626                        type Response = super::CreateOrganizationResponse;
9627                        type Future = BoxFuture<
9628                            tonic::Response<Self::Response>,
9629                            tonic::Status,
9630                        >;
9631                        fn call(
9632                            &mut self,
9633                            request: tonic::Request<super::CreateOrganizationRequest>,
9634                        ) -> Self::Future {
9635                            let inner = Arc::clone(&self.0);
9636                            let fut = async move {
9637                                <T as OrganizationService>::create_organization(
9638                                        &inner,
9639                                        request,
9640                                    )
9641                                    .await
9642                            };
9643                            Box::pin(fut)
9644                        }
9645                    }
9646                    let accept_compression_encodings = self.accept_compression_encodings;
9647                    let send_compression_encodings = self.send_compression_encodings;
9648                    let max_decoding_message_size = self.max_decoding_message_size;
9649                    let max_encoding_message_size = self.max_encoding_message_size;
9650                    let inner = self.inner.clone();
9651                    let fut = async move {
9652                        let method = CreateOrganizationSvc(inner);
9653                        let codec = tonic_prost::ProstCodec::default();
9654                        let mut grpc = tonic::server::Grpc::new(codec)
9655                            .apply_compression_config(
9656                                accept_compression_encodings,
9657                                send_compression_encodings,
9658                            )
9659                            .apply_max_message_size_config(
9660                                max_decoding_message_size,
9661                                max_encoding_message_size,
9662                            );
9663                        let res = grpc.unary(method, req).await;
9664                        Ok(res)
9665                    };
9666                    Box::pin(fut)
9667                }
9668                "/pidgr.v1.OrganizationService/GetOrganization" => {
9669                    #[allow(non_camel_case_types)]
9670                    struct GetOrganizationSvc<T: OrganizationService>(pub Arc<T>);
9671                    impl<
9672                        T: OrganizationService,
9673                    > tonic::server::UnaryService<super::GetOrganizationRequest>
9674                    for GetOrganizationSvc<T> {
9675                        type Response = super::GetOrganizationResponse;
9676                        type Future = BoxFuture<
9677                            tonic::Response<Self::Response>,
9678                            tonic::Status,
9679                        >;
9680                        fn call(
9681                            &mut self,
9682                            request: tonic::Request<super::GetOrganizationRequest>,
9683                        ) -> Self::Future {
9684                            let inner = Arc::clone(&self.0);
9685                            let fut = async move {
9686                                <T as OrganizationService>::get_organization(
9687                                        &inner,
9688                                        request,
9689                                    )
9690                                    .await
9691                            };
9692                            Box::pin(fut)
9693                        }
9694                    }
9695                    let accept_compression_encodings = self.accept_compression_encodings;
9696                    let send_compression_encodings = self.send_compression_encodings;
9697                    let max_decoding_message_size = self.max_decoding_message_size;
9698                    let max_encoding_message_size = self.max_encoding_message_size;
9699                    let inner = self.inner.clone();
9700                    let fut = async move {
9701                        let method = GetOrganizationSvc(inner);
9702                        let codec = tonic_prost::ProstCodec::default();
9703                        let mut grpc = tonic::server::Grpc::new(codec)
9704                            .apply_compression_config(
9705                                accept_compression_encodings,
9706                                send_compression_encodings,
9707                            )
9708                            .apply_max_message_size_config(
9709                                max_decoding_message_size,
9710                                max_encoding_message_size,
9711                            );
9712                        let res = grpc.unary(method, req).await;
9713                        Ok(res)
9714                    };
9715                    Box::pin(fut)
9716                }
9717                "/pidgr.v1.OrganizationService/UpdateOrganization" => {
9718                    #[allow(non_camel_case_types)]
9719                    struct UpdateOrganizationSvc<T: OrganizationService>(pub Arc<T>);
9720                    impl<
9721                        T: OrganizationService,
9722                    > tonic::server::UnaryService<super::UpdateOrganizationRequest>
9723                    for UpdateOrganizationSvc<T> {
9724                        type Response = super::UpdateOrganizationResponse;
9725                        type Future = BoxFuture<
9726                            tonic::Response<Self::Response>,
9727                            tonic::Status,
9728                        >;
9729                        fn call(
9730                            &mut self,
9731                            request: tonic::Request<super::UpdateOrganizationRequest>,
9732                        ) -> Self::Future {
9733                            let inner = Arc::clone(&self.0);
9734                            let fut = async move {
9735                                <T as OrganizationService>::update_organization(
9736                                        &inner,
9737                                        request,
9738                                    )
9739                                    .await
9740                            };
9741                            Box::pin(fut)
9742                        }
9743                    }
9744                    let accept_compression_encodings = self.accept_compression_encodings;
9745                    let send_compression_encodings = self.send_compression_encodings;
9746                    let max_decoding_message_size = self.max_decoding_message_size;
9747                    let max_encoding_message_size = self.max_encoding_message_size;
9748                    let inner = self.inner.clone();
9749                    let fut = async move {
9750                        let method = UpdateOrganizationSvc(inner);
9751                        let codec = tonic_prost::ProstCodec::default();
9752                        let mut grpc = tonic::server::Grpc::new(codec)
9753                            .apply_compression_config(
9754                                accept_compression_encodings,
9755                                send_compression_encodings,
9756                            )
9757                            .apply_max_message_size_config(
9758                                max_decoding_message_size,
9759                                max_encoding_message_size,
9760                            );
9761                        let res = grpc.unary(method, req).await;
9762                        Ok(res)
9763                    };
9764                    Box::pin(fut)
9765                }
9766                "/pidgr.v1.OrganizationService/UpdateSsoAttributeMappings" => {
9767                    #[allow(non_camel_case_types)]
9768                    struct UpdateSsoAttributeMappingsSvc<T: OrganizationService>(
9769                        pub Arc<T>,
9770                    );
9771                    impl<
9772                        T: OrganizationService,
9773                    > tonic::server::UnaryService<
9774                        super::UpdateSsoAttributeMappingsRequest,
9775                    > for UpdateSsoAttributeMappingsSvc<T> {
9776                        type Response = super::UpdateSsoAttributeMappingsResponse;
9777                        type Future = BoxFuture<
9778                            tonic::Response<Self::Response>,
9779                            tonic::Status,
9780                        >;
9781                        fn call(
9782                            &mut self,
9783                            request: tonic::Request<
9784                                super::UpdateSsoAttributeMappingsRequest,
9785                            >,
9786                        ) -> Self::Future {
9787                            let inner = Arc::clone(&self.0);
9788                            let fut = async move {
9789                                <T as OrganizationService>::update_sso_attribute_mappings(
9790                                        &inner,
9791                                        request,
9792                                    )
9793                                    .await
9794                            };
9795                            Box::pin(fut)
9796                        }
9797                    }
9798                    let accept_compression_encodings = self.accept_compression_encodings;
9799                    let send_compression_encodings = self.send_compression_encodings;
9800                    let max_decoding_message_size = self.max_decoding_message_size;
9801                    let max_encoding_message_size = self.max_encoding_message_size;
9802                    let inner = self.inner.clone();
9803                    let fut = async move {
9804                        let method = UpdateSsoAttributeMappingsSvc(inner);
9805                        let codec = tonic_prost::ProstCodec::default();
9806                        let mut grpc = tonic::server::Grpc::new(codec)
9807                            .apply_compression_config(
9808                                accept_compression_encodings,
9809                                send_compression_encodings,
9810                            )
9811                            .apply_max_message_size_config(
9812                                max_decoding_message_size,
9813                                max_encoding_message_size,
9814                            );
9815                        let res = grpc.unary(method, req).await;
9816                        Ok(res)
9817                    };
9818                    Box::pin(fut)
9819                }
9820                "/pidgr.v1.OrganizationService/RotateAnalyticsSalt" => {
9821                    #[allow(non_camel_case_types)]
9822                    struct RotateAnalyticsSaltSvc<T: OrganizationService>(pub Arc<T>);
9823                    impl<
9824                        T: OrganizationService,
9825                    > tonic::server::UnaryService<super::RotateAnalyticsSaltRequest>
9826                    for RotateAnalyticsSaltSvc<T> {
9827                        type Response = super::RotateAnalyticsSaltResponse;
9828                        type Future = BoxFuture<
9829                            tonic::Response<Self::Response>,
9830                            tonic::Status,
9831                        >;
9832                        fn call(
9833                            &mut self,
9834                            request: tonic::Request<super::RotateAnalyticsSaltRequest>,
9835                        ) -> Self::Future {
9836                            let inner = Arc::clone(&self.0);
9837                            let fut = async move {
9838                                <T as OrganizationService>::rotate_analytics_salt(
9839                                        &inner,
9840                                        request,
9841                                    )
9842                                    .await
9843                            };
9844                            Box::pin(fut)
9845                        }
9846                    }
9847                    let accept_compression_encodings = self.accept_compression_encodings;
9848                    let send_compression_encodings = self.send_compression_encodings;
9849                    let max_decoding_message_size = self.max_decoding_message_size;
9850                    let max_encoding_message_size = self.max_encoding_message_size;
9851                    let inner = self.inner.clone();
9852                    let fut = async move {
9853                        let method = RotateAnalyticsSaltSvc(inner);
9854                        let codec = tonic_prost::ProstCodec::default();
9855                        let mut grpc = tonic::server::Grpc::new(codec)
9856                            .apply_compression_config(
9857                                accept_compression_encodings,
9858                                send_compression_encodings,
9859                            )
9860                            .apply_max_message_size_config(
9861                                max_decoding_message_size,
9862                                max_encoding_message_size,
9863                            );
9864                        let res = grpc.unary(method, req).await;
9865                        Ok(res)
9866                    };
9867                    Box::pin(fut)
9868                }
9869                "/pidgr.v1.OrganizationService/UpdateAnalyticsEpsilon" => {
9870                    #[allow(non_camel_case_types)]
9871                    struct UpdateAnalyticsEpsilonSvc<T: OrganizationService>(pub Arc<T>);
9872                    impl<
9873                        T: OrganizationService,
9874                    > tonic::server::UnaryService<super::UpdateAnalyticsEpsilonRequest>
9875                    for UpdateAnalyticsEpsilonSvc<T> {
9876                        type Response = super::UpdateAnalyticsEpsilonResponse;
9877                        type Future = BoxFuture<
9878                            tonic::Response<Self::Response>,
9879                            tonic::Status,
9880                        >;
9881                        fn call(
9882                            &mut self,
9883                            request: tonic::Request<super::UpdateAnalyticsEpsilonRequest>,
9884                        ) -> Self::Future {
9885                            let inner = Arc::clone(&self.0);
9886                            let fut = async move {
9887                                <T as OrganizationService>::update_analytics_epsilon(
9888                                        &inner,
9889                                        request,
9890                                    )
9891                                    .await
9892                            };
9893                            Box::pin(fut)
9894                        }
9895                    }
9896                    let accept_compression_encodings = self.accept_compression_encodings;
9897                    let send_compression_encodings = self.send_compression_encodings;
9898                    let max_decoding_message_size = self.max_decoding_message_size;
9899                    let max_encoding_message_size = self.max_encoding_message_size;
9900                    let inner = self.inner.clone();
9901                    let fut = async move {
9902                        let method = UpdateAnalyticsEpsilonSvc(inner);
9903                        let codec = tonic_prost::ProstCodec::default();
9904                        let mut grpc = tonic::server::Grpc::new(codec)
9905                            .apply_compression_config(
9906                                accept_compression_encodings,
9907                                send_compression_encodings,
9908                            )
9909                            .apply_max_message_size_config(
9910                                max_decoding_message_size,
9911                                max_encoding_message_size,
9912                            );
9913                        let res = grpc.unary(method, req).await;
9914                        Ok(res)
9915                    };
9916                    Box::pin(fut)
9917                }
9918                "/pidgr.v1.OrganizationService/CreateSandboxOrganization" => {
9919                    #[allow(non_camel_case_types)]
9920                    struct CreateSandboxOrganizationSvc<T: OrganizationService>(
9921                        pub Arc<T>,
9922                    );
9923                    impl<
9924                        T: OrganizationService,
9925                    > tonic::server::UnaryService<
9926                        super::CreateSandboxOrganizationRequest,
9927                    > for CreateSandboxOrganizationSvc<T> {
9928                        type Response = super::CreateSandboxOrganizationResponse;
9929                        type Future = BoxFuture<
9930                            tonic::Response<Self::Response>,
9931                            tonic::Status,
9932                        >;
9933                        fn call(
9934                            &mut self,
9935                            request: tonic::Request<
9936                                super::CreateSandboxOrganizationRequest,
9937                            >,
9938                        ) -> Self::Future {
9939                            let inner = Arc::clone(&self.0);
9940                            let fut = async move {
9941                                <T as OrganizationService>::create_sandbox_organization(
9942                                        &inner,
9943                                        request,
9944                                    )
9945                                    .await
9946                            };
9947                            Box::pin(fut)
9948                        }
9949                    }
9950                    let accept_compression_encodings = self.accept_compression_encodings;
9951                    let send_compression_encodings = self.send_compression_encodings;
9952                    let max_decoding_message_size = self.max_decoding_message_size;
9953                    let max_encoding_message_size = self.max_encoding_message_size;
9954                    let inner = self.inner.clone();
9955                    let fut = async move {
9956                        let method = CreateSandboxOrganizationSvc(inner);
9957                        let codec = tonic_prost::ProstCodec::default();
9958                        let mut grpc = tonic::server::Grpc::new(codec)
9959                            .apply_compression_config(
9960                                accept_compression_encodings,
9961                                send_compression_encodings,
9962                            )
9963                            .apply_max_message_size_config(
9964                                max_decoding_message_size,
9965                                max_encoding_message_size,
9966                            );
9967                        let res = grpc.unary(method, req).await;
9968                        Ok(res)
9969                    };
9970                    Box::pin(fut)
9971                }
9972                "/pidgr.v1.OrganizationService/DeleteSandboxOrganization" => {
9973                    #[allow(non_camel_case_types)]
9974                    struct DeleteSandboxOrganizationSvc<T: OrganizationService>(
9975                        pub Arc<T>,
9976                    );
9977                    impl<
9978                        T: OrganizationService,
9979                    > tonic::server::UnaryService<
9980                        super::DeleteSandboxOrganizationRequest,
9981                    > for DeleteSandboxOrganizationSvc<T> {
9982                        type Response = super::DeleteSandboxOrganizationResponse;
9983                        type Future = BoxFuture<
9984                            tonic::Response<Self::Response>,
9985                            tonic::Status,
9986                        >;
9987                        fn call(
9988                            &mut self,
9989                            request: tonic::Request<
9990                                super::DeleteSandboxOrganizationRequest,
9991                            >,
9992                        ) -> Self::Future {
9993                            let inner = Arc::clone(&self.0);
9994                            let fut = async move {
9995                                <T as OrganizationService>::delete_sandbox_organization(
9996                                        &inner,
9997                                        request,
9998                                    )
9999                                    .await
10000                            };
10001                            Box::pin(fut)
10002                        }
10003                    }
10004                    let accept_compression_encodings = self.accept_compression_encodings;
10005                    let send_compression_encodings = self.send_compression_encodings;
10006                    let max_decoding_message_size = self.max_decoding_message_size;
10007                    let max_encoding_message_size = self.max_encoding_message_size;
10008                    let inner = self.inner.clone();
10009                    let fut = async move {
10010                        let method = DeleteSandboxOrganizationSvc(inner);
10011                        let codec = tonic_prost::ProstCodec::default();
10012                        let mut grpc = tonic::server::Grpc::new(codec)
10013                            .apply_compression_config(
10014                                accept_compression_encodings,
10015                                send_compression_encodings,
10016                            )
10017                            .apply_max_message_size_config(
10018                                max_decoding_message_size,
10019                                max_encoding_message_size,
10020                            );
10021                        let res = grpc.unary(method, req).await;
10022                        Ok(res)
10023                    };
10024                    Box::pin(fut)
10025                }
10026                "/pidgr.v1.OrganizationService/ListSandboxFixtures" => {
10027                    #[allow(non_camel_case_types)]
10028                    struct ListSandboxFixturesSvc<T: OrganizationService>(pub Arc<T>);
10029                    impl<
10030                        T: OrganizationService,
10031                    > tonic::server::UnaryService<super::ListSandboxFixturesRequest>
10032                    for ListSandboxFixturesSvc<T> {
10033                        type Response = super::ListSandboxFixturesResponse;
10034                        type Future = BoxFuture<
10035                            tonic::Response<Self::Response>,
10036                            tonic::Status,
10037                        >;
10038                        fn call(
10039                            &mut self,
10040                            request: tonic::Request<super::ListSandboxFixturesRequest>,
10041                        ) -> Self::Future {
10042                            let inner = Arc::clone(&self.0);
10043                            let fut = async move {
10044                                <T as OrganizationService>::list_sandbox_fixtures(
10045                                        &inner,
10046                                        request,
10047                                    )
10048                                    .await
10049                            };
10050                            Box::pin(fut)
10051                        }
10052                    }
10053                    let accept_compression_encodings = self.accept_compression_encodings;
10054                    let send_compression_encodings = self.send_compression_encodings;
10055                    let max_decoding_message_size = self.max_decoding_message_size;
10056                    let max_encoding_message_size = self.max_encoding_message_size;
10057                    let inner = self.inner.clone();
10058                    let fut = async move {
10059                        let method = ListSandboxFixturesSvc(inner);
10060                        let codec = tonic_prost::ProstCodec::default();
10061                        let mut grpc = tonic::server::Grpc::new(codec)
10062                            .apply_compression_config(
10063                                accept_compression_encodings,
10064                                send_compression_encodings,
10065                            )
10066                            .apply_max_message_size_config(
10067                                max_decoding_message_size,
10068                                max_encoding_message_size,
10069                            );
10070                        let res = grpc.unary(method, req).await;
10071                        Ok(res)
10072                    };
10073                    Box::pin(fut)
10074                }
10075                "/pidgr.v1.OrganizationService/ListUserOrganizations" => {
10076                    #[allow(non_camel_case_types)]
10077                    struct ListUserOrganizationsSvc<T: OrganizationService>(pub Arc<T>);
10078                    impl<
10079                        T: OrganizationService,
10080                    > tonic::server::UnaryService<super::ListUserOrganizationsRequest>
10081                    for ListUserOrganizationsSvc<T> {
10082                        type Response = super::ListUserOrganizationsResponse;
10083                        type Future = BoxFuture<
10084                            tonic::Response<Self::Response>,
10085                            tonic::Status,
10086                        >;
10087                        fn call(
10088                            &mut self,
10089                            request: tonic::Request<super::ListUserOrganizationsRequest>,
10090                        ) -> Self::Future {
10091                            let inner = Arc::clone(&self.0);
10092                            let fut = async move {
10093                                <T as OrganizationService>::list_user_organizations(
10094                                        &inner,
10095                                        request,
10096                                    )
10097                                    .await
10098                            };
10099                            Box::pin(fut)
10100                        }
10101                    }
10102                    let accept_compression_encodings = self.accept_compression_encodings;
10103                    let send_compression_encodings = self.send_compression_encodings;
10104                    let max_decoding_message_size = self.max_decoding_message_size;
10105                    let max_encoding_message_size = self.max_encoding_message_size;
10106                    let inner = self.inner.clone();
10107                    let fut = async move {
10108                        let method = ListUserOrganizationsSvc(inner);
10109                        let codec = tonic_prost::ProstCodec::default();
10110                        let mut grpc = tonic::server::Grpc::new(codec)
10111                            .apply_compression_config(
10112                                accept_compression_encodings,
10113                                send_compression_encodings,
10114                            )
10115                            .apply_max_message_size_config(
10116                                max_decoding_message_size,
10117                                max_encoding_message_size,
10118                            );
10119                        let res = grpc.unary(method, req).await;
10120                        Ok(res)
10121                    };
10122                    Box::pin(fut)
10123                }
10124                "/pidgr.v1.OrganizationService/ListUserSandboxes" => {
10125                    #[allow(non_camel_case_types)]
10126                    struct ListUserSandboxesSvc<T: OrganizationService>(pub Arc<T>);
10127                    impl<
10128                        T: OrganizationService,
10129                    > tonic::server::UnaryService<super::ListUserSandboxesRequest>
10130                    for ListUserSandboxesSvc<T> {
10131                        type Response = super::ListUserSandboxesResponse;
10132                        type Future = BoxFuture<
10133                            tonic::Response<Self::Response>,
10134                            tonic::Status,
10135                        >;
10136                        fn call(
10137                            &mut self,
10138                            request: tonic::Request<super::ListUserSandboxesRequest>,
10139                        ) -> Self::Future {
10140                            let inner = Arc::clone(&self.0);
10141                            let fut = async move {
10142                                <T as OrganizationService>::list_user_sandboxes(
10143                                        &inner,
10144                                        request,
10145                                    )
10146                                    .await
10147                            };
10148                            Box::pin(fut)
10149                        }
10150                    }
10151                    let accept_compression_encodings = self.accept_compression_encodings;
10152                    let send_compression_encodings = self.send_compression_encodings;
10153                    let max_decoding_message_size = self.max_decoding_message_size;
10154                    let max_encoding_message_size = self.max_encoding_message_size;
10155                    let inner = self.inner.clone();
10156                    let fut = async move {
10157                        let method = ListUserSandboxesSvc(inner);
10158                        let codec = tonic_prost::ProstCodec::default();
10159                        let mut grpc = tonic::server::Grpc::new(codec)
10160                            .apply_compression_config(
10161                                accept_compression_encodings,
10162                                send_compression_encodings,
10163                            )
10164                            .apply_max_message_size_config(
10165                                max_decoding_message_size,
10166                                max_encoding_message_size,
10167                            );
10168                        let res = grpc.unary(method, req).await;
10169                        Ok(res)
10170                    };
10171                    Box::pin(fut)
10172                }
10173                _ => {
10174                    Box::pin(async move {
10175                        let mut response = http::Response::new(
10176                            tonic::body::Body::default(),
10177                        );
10178                        let headers = response.headers_mut();
10179                        headers
10180                            .insert(
10181                                tonic::Status::GRPC_STATUS,
10182                                (tonic::Code::Unimplemented as i32).into(),
10183                            );
10184                        headers
10185                            .insert(
10186                                http::header::CONTENT_TYPE,
10187                                tonic::metadata::GRPC_CONTENT_TYPE,
10188                            );
10189                        Ok(response)
10190                    })
10191                }
10192            }
10193        }
10194    }
10195    impl<T> Clone for OrganizationServiceServer<T> {
10196        fn clone(&self) -> Self {
10197            let inner = self.inner.clone();
10198            Self {
10199                inner,
10200                accept_compression_encodings: self.accept_compression_encodings,
10201                send_compression_encodings: self.send_compression_encodings,
10202                max_decoding_message_size: self.max_decoding_message_size,
10203                max_encoding_message_size: self.max_encoding_message_size,
10204            }
10205        }
10206    }
10207    /// Generated gRPC service name
10208    pub const SERVICE_NAME: &str = "pidgr.v1.OrganizationService";
10209    impl<T> tonic::server::NamedService for OrganizationServiceServer<T> {
10210        const NAME: &'static str = SERVICE_NAME;
10211    }
10212}
10213/// Generated client implementations.
10214pub mod render_service_client {
10215    #![allow(
10216        unused_variables,
10217        dead_code,
10218        missing_docs,
10219        clippy::wildcard_imports,
10220        clippy::let_unit_value,
10221    )]
10222    use tonic::codegen::*;
10223    use tonic::codegen::http::Uri;
10224    /** Internal service for batch template rendering.
10225*/
10226    #[derive(Debug, Clone)]
10227    pub struct RenderServiceClient<T> {
10228        inner: tonic::client::Grpc<T>,
10229    }
10230    impl RenderServiceClient<tonic::transport::Channel> {
10231        /// Attempt to create a new client by connecting to a given endpoint.
10232        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
10233        where
10234            D: TryInto<tonic::transport::Endpoint>,
10235            D::Error: Into<StdError>,
10236        {
10237            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
10238            Ok(Self::new(conn))
10239        }
10240    }
10241    impl<T> RenderServiceClient<T>
10242    where
10243        T: tonic::client::GrpcService<tonic::body::Body>,
10244        T::Error: Into<StdError>,
10245        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
10246        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
10247    {
10248        pub fn new(inner: T) -> Self {
10249            let inner = tonic::client::Grpc::new(inner);
10250            Self { inner }
10251        }
10252        pub fn with_origin(inner: T, origin: Uri) -> Self {
10253            let inner = tonic::client::Grpc::with_origin(inner, origin);
10254            Self { inner }
10255        }
10256        pub fn with_interceptor<F>(
10257            inner: T,
10258            interceptor: F,
10259        ) -> RenderServiceClient<InterceptedService<T, F>>
10260        where
10261            F: tonic::service::Interceptor,
10262            T::ResponseBody: Default,
10263            T: tonic::codegen::Service<
10264                http::Request<tonic::body::Body>,
10265                Response = http::Response<
10266                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
10267                >,
10268            >,
10269            <T as tonic::codegen::Service<
10270                http::Request<tonic::body::Body>,
10271            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
10272        {
10273            RenderServiceClient::new(InterceptedService::new(inner, interceptor))
10274        }
10275        /// Compress requests with the given encoding.
10276        ///
10277        /// This requires the server to support it otherwise it might respond with an
10278        /// error.
10279        #[must_use]
10280        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10281            self.inner = self.inner.send_compressed(encoding);
10282            self
10283        }
10284        /// Enable decompressing responses.
10285        #[must_use]
10286        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10287            self.inner = self.inner.accept_compressed(encoding);
10288            self
10289        }
10290        /// Limits the maximum size of a decoded message.
10291        ///
10292        /// Default: `4MB`
10293        #[must_use]
10294        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10295            self.inner = self.inner.max_decoding_message_size(limit);
10296            self
10297        }
10298        /// Limits the maximum size of an encoded message.
10299        ///
10300        /// Default: `usize::MAX`
10301        #[must_use]
10302        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10303            self.inner = self.inner.max_encoding_message_size(limit);
10304            self
10305        }
10306        /** Render a template for multiple users, streaming results as each completes.
10307 Authorization: Internal server-to-server only. Not exposed to external clients.
10308*/
10309        pub async fn render_batch(
10310            &mut self,
10311            request: impl tonic::IntoRequest<super::RenderBatchRequest>,
10312        ) -> std::result::Result<
10313            tonic::Response<tonic::codec::Streaming<super::RenderBatchResponse>>,
10314            tonic::Status,
10315        > {
10316            self.inner
10317                .ready()
10318                .await
10319                .map_err(|e| {
10320                    tonic::Status::unknown(
10321                        format!("Service was not ready: {}", e.into()),
10322                    )
10323                })?;
10324            let codec = tonic_prost::ProstCodec::default();
10325            let path = http::uri::PathAndQuery::from_static(
10326                "/pidgr.v1.RenderService/RenderBatch",
10327            );
10328            let mut req = request.into_request();
10329            req.extensions_mut()
10330                .insert(GrpcMethod::new("pidgr.v1.RenderService", "RenderBatch"));
10331            self.inner.server_streaming(req, path, codec).await
10332        }
10333    }
10334}
10335/// Generated server implementations.
10336pub mod render_service_server {
10337    #![allow(
10338        unused_variables,
10339        dead_code,
10340        missing_docs,
10341        clippy::wildcard_imports,
10342        clippy::let_unit_value,
10343    )]
10344    use tonic::codegen::*;
10345    /// Generated trait containing gRPC methods that should be implemented for use with RenderServiceServer.
10346    #[async_trait]
10347    pub trait RenderService: std::marker::Send + std::marker::Sync + 'static {
10348        /// Server streaming response type for the RenderBatch method.
10349        type RenderBatchStream: tonic::codegen::tokio_stream::Stream<
10350                Item = std::result::Result<super::RenderBatchResponse, tonic::Status>,
10351            >
10352            + std::marker::Send
10353            + 'static;
10354        /** Render a template for multiple users, streaming results as each completes.
10355 Authorization: Internal server-to-server only. Not exposed to external clients.
10356*/
10357        async fn render_batch(
10358            &self,
10359            request: tonic::Request<super::RenderBatchRequest>,
10360        ) -> std::result::Result<
10361            tonic::Response<Self::RenderBatchStream>,
10362            tonic::Status,
10363        >;
10364    }
10365    /** Internal service for batch template rendering.
10366*/
10367    #[derive(Debug)]
10368    pub struct RenderServiceServer<T> {
10369        inner: Arc<T>,
10370        accept_compression_encodings: EnabledCompressionEncodings,
10371        send_compression_encodings: EnabledCompressionEncodings,
10372        max_decoding_message_size: Option<usize>,
10373        max_encoding_message_size: Option<usize>,
10374    }
10375    impl<T> RenderServiceServer<T> {
10376        pub fn new(inner: T) -> Self {
10377            Self::from_arc(Arc::new(inner))
10378        }
10379        pub fn from_arc(inner: Arc<T>) -> Self {
10380            Self {
10381                inner,
10382                accept_compression_encodings: Default::default(),
10383                send_compression_encodings: Default::default(),
10384                max_decoding_message_size: None,
10385                max_encoding_message_size: None,
10386            }
10387        }
10388        pub fn with_interceptor<F>(
10389            inner: T,
10390            interceptor: F,
10391        ) -> InterceptedService<Self, F>
10392        where
10393            F: tonic::service::Interceptor,
10394        {
10395            InterceptedService::new(Self::new(inner), interceptor)
10396        }
10397        /// Enable decompressing requests with the given encoding.
10398        #[must_use]
10399        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10400            self.accept_compression_encodings.enable(encoding);
10401            self
10402        }
10403        /// Compress responses with the given encoding, if the client supports it.
10404        #[must_use]
10405        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10406            self.send_compression_encodings.enable(encoding);
10407            self
10408        }
10409        /// Limits the maximum size of a decoded message.
10410        ///
10411        /// Default: `4MB`
10412        #[must_use]
10413        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10414            self.max_decoding_message_size = Some(limit);
10415            self
10416        }
10417        /// Limits the maximum size of an encoded message.
10418        ///
10419        /// Default: `usize::MAX`
10420        #[must_use]
10421        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10422            self.max_encoding_message_size = Some(limit);
10423            self
10424        }
10425    }
10426    impl<T, B> tonic::codegen::Service<http::Request<B>> for RenderServiceServer<T>
10427    where
10428        T: RenderService,
10429        B: Body + std::marker::Send + 'static,
10430        B::Error: Into<StdError> + std::marker::Send + 'static,
10431    {
10432        type Response = http::Response<tonic::body::Body>;
10433        type Error = std::convert::Infallible;
10434        type Future = BoxFuture<Self::Response, Self::Error>;
10435        fn poll_ready(
10436            &mut self,
10437            _cx: &mut Context<'_>,
10438        ) -> Poll<std::result::Result<(), Self::Error>> {
10439            Poll::Ready(Ok(()))
10440        }
10441        fn call(&mut self, req: http::Request<B>) -> Self::Future {
10442            match req.uri().path() {
10443                "/pidgr.v1.RenderService/RenderBatch" => {
10444                    #[allow(non_camel_case_types)]
10445                    struct RenderBatchSvc<T: RenderService>(pub Arc<T>);
10446                    impl<
10447                        T: RenderService,
10448                    > tonic::server::ServerStreamingService<super::RenderBatchRequest>
10449                    for RenderBatchSvc<T> {
10450                        type Response = super::RenderBatchResponse;
10451                        type ResponseStream = T::RenderBatchStream;
10452                        type Future = BoxFuture<
10453                            tonic::Response<Self::ResponseStream>,
10454                            tonic::Status,
10455                        >;
10456                        fn call(
10457                            &mut self,
10458                            request: tonic::Request<super::RenderBatchRequest>,
10459                        ) -> Self::Future {
10460                            let inner = Arc::clone(&self.0);
10461                            let fut = async move {
10462                                <T as RenderService>::render_batch(&inner, request).await
10463                            };
10464                            Box::pin(fut)
10465                        }
10466                    }
10467                    let accept_compression_encodings = self.accept_compression_encodings;
10468                    let send_compression_encodings = self.send_compression_encodings;
10469                    let max_decoding_message_size = self.max_decoding_message_size;
10470                    let max_encoding_message_size = self.max_encoding_message_size;
10471                    let inner = self.inner.clone();
10472                    let fut = async move {
10473                        let method = RenderBatchSvc(inner);
10474                        let codec = tonic_prost::ProstCodec::default();
10475                        let mut grpc = tonic::server::Grpc::new(codec)
10476                            .apply_compression_config(
10477                                accept_compression_encodings,
10478                                send_compression_encodings,
10479                            )
10480                            .apply_max_message_size_config(
10481                                max_decoding_message_size,
10482                                max_encoding_message_size,
10483                            );
10484                        let res = grpc.server_streaming(method, req).await;
10485                        Ok(res)
10486                    };
10487                    Box::pin(fut)
10488                }
10489                _ => {
10490                    Box::pin(async move {
10491                        let mut response = http::Response::new(
10492                            tonic::body::Body::default(),
10493                        );
10494                        let headers = response.headers_mut();
10495                        headers
10496                            .insert(
10497                                tonic::Status::GRPC_STATUS,
10498                                (tonic::Code::Unimplemented as i32).into(),
10499                            );
10500                        headers
10501                            .insert(
10502                                http::header::CONTENT_TYPE,
10503                                tonic::metadata::GRPC_CONTENT_TYPE,
10504                            );
10505                        Ok(response)
10506                    })
10507                }
10508            }
10509        }
10510    }
10511    impl<T> Clone for RenderServiceServer<T> {
10512        fn clone(&self) -> Self {
10513            let inner = self.inner.clone();
10514            Self {
10515                inner,
10516                accept_compression_encodings: self.accept_compression_encodings,
10517                send_compression_encodings: self.send_compression_encodings,
10518                max_decoding_message_size: self.max_decoding_message_size,
10519                max_encoding_message_size: self.max_encoding_message_size,
10520            }
10521        }
10522    }
10523    /// Generated gRPC service name
10524    pub const SERVICE_NAME: &str = "pidgr.v1.RenderService";
10525    impl<T> tonic::server::NamedService for RenderServiceServer<T> {
10526        const NAME: &'static str = SERVICE_NAME;
10527    }
10528}
10529/// Generated client implementations.
10530pub mod replay_service_client {
10531    #![allow(
10532        unused_variables,
10533        dead_code,
10534        missing_docs,
10535        clippy::wildcard_imports,
10536        clippy::let_unit_value,
10537    )]
10538    use tonic::codegen::*;
10539    use tonic::codegen::http::Uri;
10540    /** Proxies the analytics provider's session recording API, keeping credentials server-side.
10541 All data is fetched from the analytics provider on demand; no recording data is stored in pidgr.
10542*/
10543    #[derive(Debug, Clone)]
10544    pub struct ReplayServiceClient<T> {
10545        inner: tonic::client::Grpc<T>,
10546    }
10547    impl ReplayServiceClient<tonic::transport::Channel> {
10548        /// Attempt to create a new client by connecting to a given endpoint.
10549        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
10550        where
10551            D: TryInto<tonic::transport::Endpoint>,
10552            D::Error: Into<StdError>,
10553        {
10554            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
10555            Ok(Self::new(conn))
10556        }
10557    }
10558    impl<T> ReplayServiceClient<T>
10559    where
10560        T: tonic::client::GrpcService<tonic::body::Body>,
10561        T::Error: Into<StdError>,
10562        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
10563        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
10564    {
10565        pub fn new(inner: T) -> Self {
10566            let inner = tonic::client::Grpc::new(inner);
10567            Self { inner }
10568        }
10569        pub fn with_origin(inner: T, origin: Uri) -> Self {
10570            let inner = tonic::client::Grpc::with_origin(inner, origin);
10571            Self { inner }
10572        }
10573        pub fn with_interceptor<F>(
10574            inner: T,
10575            interceptor: F,
10576        ) -> ReplayServiceClient<InterceptedService<T, F>>
10577        where
10578            F: tonic::service::Interceptor,
10579            T::ResponseBody: Default,
10580            T: tonic::codegen::Service<
10581                http::Request<tonic::body::Body>,
10582                Response = http::Response<
10583                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
10584                >,
10585            >,
10586            <T as tonic::codegen::Service<
10587                http::Request<tonic::body::Body>,
10588            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
10589        {
10590            ReplayServiceClient::new(InterceptedService::new(inner, interceptor))
10591        }
10592        /// Compress requests with the given encoding.
10593        ///
10594        /// This requires the server to support it otherwise it might respond with an
10595        /// error.
10596        #[must_use]
10597        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10598            self.inner = self.inner.send_compressed(encoding);
10599            self
10600        }
10601        /// Enable decompressing responses.
10602        #[must_use]
10603        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10604            self.inner = self.inner.accept_compressed(encoding);
10605            self
10606        }
10607        /// Limits the maximum size of a decoded message.
10608        ///
10609        /// Default: `4MB`
10610        #[must_use]
10611        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10612            self.inner = self.inner.max_decoding_message_size(limit);
10613            self
10614        }
10615        /// Limits the maximum size of an encoded message.
10616        ///
10617        /// Default: `usize::MAX`
10618        #[must_use]
10619        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10620            self.inner = self.inner.max_encoding_message_size(limit);
10621            self
10622        }
10623        /** List recent session recordings with optional campaign and time range filters.
10624 Authorization: Requires CAMPAIGNS_READ permission.
10625*/
10626        pub async fn list_session_recordings(
10627            &mut self,
10628            request: impl tonic::IntoRequest<super::ListSessionRecordingsRequest>,
10629        ) -> std::result::Result<
10630            tonic::Response<super::ListSessionRecordingsResponse>,
10631            tonic::Status,
10632        > {
10633            self.inner
10634                .ready()
10635                .await
10636                .map_err(|e| {
10637                    tonic::Status::unknown(
10638                        format!("Service was not ready: {}", e.into()),
10639                    )
10640                })?;
10641            let codec = tonic_prost::ProstCodec::default();
10642            let path = http::uri::PathAndQuery::from_static(
10643                "/pidgr.v1.ReplayService/ListSessionRecordings",
10644            );
10645            let mut req = request.into_request();
10646            req.extensions_mut()
10647                .insert(
10648                    GrpcMethod::new("pidgr.v1.ReplayService", "ListSessionRecordings"),
10649                );
10650            self.inner.unary(req, path, codec).await
10651        }
10652        /** Fetch the full rrweb snapshot data for a single recording.
10653 Authorization: Requires CAMPAIGNS_READ permission.
10654*/
10655        pub async fn get_session_snapshots(
10656            &mut self,
10657            request: impl tonic::IntoRequest<super::GetSessionSnapshotsRequest>,
10658        ) -> std::result::Result<
10659            tonic::Response<super::GetSessionSnapshotsResponse>,
10660            tonic::Status,
10661        > {
10662            self.inner
10663                .ready()
10664                .await
10665                .map_err(|e| {
10666                    tonic::Status::unknown(
10667                        format!("Service was not ready: {}", e.into()),
10668                    )
10669                })?;
10670            let codec = tonic_prost::ProstCodec::default();
10671            let path = http::uri::PathAndQuery::from_static(
10672                "/pidgr.v1.ReplayService/GetSessionSnapshots",
10673            );
10674            let mut req = request.into_request();
10675            req.extensions_mut()
10676                .insert(
10677                    GrpcMethod::new("pidgr.v1.ReplayService", "GetSessionSnapshots"),
10678                );
10679            self.inner.unary(req, path, codec).await
10680        }
10681    }
10682}
10683/// Generated server implementations.
10684pub mod replay_service_server {
10685    #![allow(
10686        unused_variables,
10687        dead_code,
10688        missing_docs,
10689        clippy::wildcard_imports,
10690        clippy::let_unit_value,
10691    )]
10692    use tonic::codegen::*;
10693    /// Generated trait containing gRPC methods that should be implemented for use with ReplayServiceServer.
10694    #[async_trait]
10695    pub trait ReplayService: std::marker::Send + std::marker::Sync + 'static {
10696        /** List recent session recordings with optional campaign and time range filters.
10697 Authorization: Requires CAMPAIGNS_READ permission.
10698*/
10699        async fn list_session_recordings(
10700            &self,
10701            request: tonic::Request<super::ListSessionRecordingsRequest>,
10702        ) -> std::result::Result<
10703            tonic::Response<super::ListSessionRecordingsResponse>,
10704            tonic::Status,
10705        >;
10706        /** Fetch the full rrweb snapshot data for a single recording.
10707 Authorization: Requires CAMPAIGNS_READ permission.
10708*/
10709        async fn get_session_snapshots(
10710            &self,
10711            request: tonic::Request<super::GetSessionSnapshotsRequest>,
10712        ) -> std::result::Result<
10713            tonic::Response<super::GetSessionSnapshotsResponse>,
10714            tonic::Status,
10715        >;
10716    }
10717    /** Proxies the analytics provider's session recording API, keeping credentials server-side.
10718 All data is fetched from the analytics provider on demand; no recording data is stored in pidgr.
10719*/
10720    #[derive(Debug)]
10721    pub struct ReplayServiceServer<T> {
10722        inner: Arc<T>,
10723        accept_compression_encodings: EnabledCompressionEncodings,
10724        send_compression_encodings: EnabledCompressionEncodings,
10725        max_decoding_message_size: Option<usize>,
10726        max_encoding_message_size: Option<usize>,
10727    }
10728    impl<T> ReplayServiceServer<T> {
10729        pub fn new(inner: T) -> Self {
10730            Self::from_arc(Arc::new(inner))
10731        }
10732        pub fn from_arc(inner: Arc<T>) -> Self {
10733            Self {
10734                inner,
10735                accept_compression_encodings: Default::default(),
10736                send_compression_encodings: Default::default(),
10737                max_decoding_message_size: None,
10738                max_encoding_message_size: None,
10739            }
10740        }
10741        pub fn with_interceptor<F>(
10742            inner: T,
10743            interceptor: F,
10744        ) -> InterceptedService<Self, F>
10745        where
10746            F: tonic::service::Interceptor,
10747        {
10748            InterceptedService::new(Self::new(inner), interceptor)
10749        }
10750        /// Enable decompressing requests with the given encoding.
10751        #[must_use]
10752        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10753            self.accept_compression_encodings.enable(encoding);
10754            self
10755        }
10756        /// Compress responses with the given encoding, if the client supports it.
10757        #[must_use]
10758        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10759            self.send_compression_encodings.enable(encoding);
10760            self
10761        }
10762        /// Limits the maximum size of a decoded message.
10763        ///
10764        /// Default: `4MB`
10765        #[must_use]
10766        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10767            self.max_decoding_message_size = Some(limit);
10768            self
10769        }
10770        /// Limits the maximum size of an encoded message.
10771        ///
10772        /// Default: `usize::MAX`
10773        #[must_use]
10774        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10775            self.max_encoding_message_size = Some(limit);
10776            self
10777        }
10778    }
10779    impl<T, B> tonic::codegen::Service<http::Request<B>> for ReplayServiceServer<T>
10780    where
10781        T: ReplayService,
10782        B: Body + std::marker::Send + 'static,
10783        B::Error: Into<StdError> + std::marker::Send + 'static,
10784    {
10785        type Response = http::Response<tonic::body::Body>;
10786        type Error = std::convert::Infallible;
10787        type Future = BoxFuture<Self::Response, Self::Error>;
10788        fn poll_ready(
10789            &mut self,
10790            _cx: &mut Context<'_>,
10791        ) -> Poll<std::result::Result<(), Self::Error>> {
10792            Poll::Ready(Ok(()))
10793        }
10794        fn call(&mut self, req: http::Request<B>) -> Self::Future {
10795            match req.uri().path() {
10796                "/pidgr.v1.ReplayService/ListSessionRecordings" => {
10797                    #[allow(non_camel_case_types)]
10798                    struct ListSessionRecordingsSvc<T: ReplayService>(pub Arc<T>);
10799                    impl<
10800                        T: ReplayService,
10801                    > tonic::server::UnaryService<super::ListSessionRecordingsRequest>
10802                    for ListSessionRecordingsSvc<T> {
10803                        type Response = super::ListSessionRecordingsResponse;
10804                        type Future = BoxFuture<
10805                            tonic::Response<Self::Response>,
10806                            tonic::Status,
10807                        >;
10808                        fn call(
10809                            &mut self,
10810                            request: tonic::Request<super::ListSessionRecordingsRequest>,
10811                        ) -> Self::Future {
10812                            let inner = Arc::clone(&self.0);
10813                            let fut = async move {
10814                                <T as ReplayService>::list_session_recordings(
10815                                        &inner,
10816                                        request,
10817                                    )
10818                                    .await
10819                            };
10820                            Box::pin(fut)
10821                        }
10822                    }
10823                    let accept_compression_encodings = self.accept_compression_encodings;
10824                    let send_compression_encodings = self.send_compression_encodings;
10825                    let max_decoding_message_size = self.max_decoding_message_size;
10826                    let max_encoding_message_size = self.max_encoding_message_size;
10827                    let inner = self.inner.clone();
10828                    let fut = async move {
10829                        let method = ListSessionRecordingsSvc(inner);
10830                        let codec = tonic_prost::ProstCodec::default();
10831                        let mut grpc = tonic::server::Grpc::new(codec)
10832                            .apply_compression_config(
10833                                accept_compression_encodings,
10834                                send_compression_encodings,
10835                            )
10836                            .apply_max_message_size_config(
10837                                max_decoding_message_size,
10838                                max_encoding_message_size,
10839                            );
10840                        let res = grpc.unary(method, req).await;
10841                        Ok(res)
10842                    };
10843                    Box::pin(fut)
10844                }
10845                "/pidgr.v1.ReplayService/GetSessionSnapshots" => {
10846                    #[allow(non_camel_case_types)]
10847                    struct GetSessionSnapshotsSvc<T: ReplayService>(pub Arc<T>);
10848                    impl<
10849                        T: ReplayService,
10850                    > tonic::server::UnaryService<super::GetSessionSnapshotsRequest>
10851                    for GetSessionSnapshotsSvc<T> {
10852                        type Response = super::GetSessionSnapshotsResponse;
10853                        type Future = BoxFuture<
10854                            tonic::Response<Self::Response>,
10855                            tonic::Status,
10856                        >;
10857                        fn call(
10858                            &mut self,
10859                            request: tonic::Request<super::GetSessionSnapshotsRequest>,
10860                        ) -> Self::Future {
10861                            let inner = Arc::clone(&self.0);
10862                            let fut = async move {
10863                                <T as ReplayService>::get_session_snapshots(&inner, request)
10864                                    .await
10865                            };
10866                            Box::pin(fut)
10867                        }
10868                    }
10869                    let accept_compression_encodings = self.accept_compression_encodings;
10870                    let send_compression_encodings = self.send_compression_encodings;
10871                    let max_decoding_message_size = self.max_decoding_message_size;
10872                    let max_encoding_message_size = self.max_encoding_message_size;
10873                    let inner = self.inner.clone();
10874                    let fut = async move {
10875                        let method = GetSessionSnapshotsSvc(inner);
10876                        let codec = tonic_prost::ProstCodec::default();
10877                        let mut grpc = tonic::server::Grpc::new(codec)
10878                            .apply_compression_config(
10879                                accept_compression_encodings,
10880                                send_compression_encodings,
10881                            )
10882                            .apply_max_message_size_config(
10883                                max_decoding_message_size,
10884                                max_encoding_message_size,
10885                            );
10886                        let res = grpc.unary(method, req).await;
10887                        Ok(res)
10888                    };
10889                    Box::pin(fut)
10890                }
10891                _ => {
10892                    Box::pin(async move {
10893                        let mut response = http::Response::new(
10894                            tonic::body::Body::default(),
10895                        );
10896                        let headers = response.headers_mut();
10897                        headers
10898                            .insert(
10899                                tonic::Status::GRPC_STATUS,
10900                                (tonic::Code::Unimplemented as i32).into(),
10901                            );
10902                        headers
10903                            .insert(
10904                                http::header::CONTENT_TYPE,
10905                                tonic::metadata::GRPC_CONTENT_TYPE,
10906                            );
10907                        Ok(response)
10908                    })
10909                }
10910            }
10911        }
10912    }
10913    impl<T> Clone for ReplayServiceServer<T> {
10914        fn clone(&self) -> Self {
10915            let inner = self.inner.clone();
10916            Self {
10917                inner,
10918                accept_compression_encodings: self.accept_compression_encodings,
10919                send_compression_encodings: self.send_compression_encodings,
10920                max_decoding_message_size: self.max_decoding_message_size,
10921                max_encoding_message_size: self.max_encoding_message_size,
10922            }
10923        }
10924    }
10925    /// Generated gRPC service name
10926    pub const SERVICE_NAME: &str = "pidgr.v1.ReplayService";
10927    impl<T> tonic::server::NamedService for ReplayServiceServer<T> {
10928        const NAME: &'static str = SERVICE_NAME;
10929    }
10930}
10931/// Generated client implementations.
10932pub mod role_service_client {
10933    #![allow(
10934        unused_variables,
10935        dead_code,
10936        missing_docs,
10937        clippy::wildcard_imports,
10938        clippy::let_unit_value,
10939    )]
10940    use tonic::codegen::*;
10941    use tonic::codegen::http::Uri;
10942    /** Manages roles and their permissions within an organization.
10943 All RPCs operate within the caller's org (extracted from JWT).
10944*/
10945    #[derive(Debug, Clone)]
10946    pub struct RoleServiceClient<T> {
10947        inner: tonic::client::Grpc<T>,
10948    }
10949    impl RoleServiceClient<tonic::transport::Channel> {
10950        /// Attempt to create a new client by connecting to a given endpoint.
10951        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
10952        where
10953            D: TryInto<tonic::transport::Endpoint>,
10954            D::Error: Into<StdError>,
10955        {
10956            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
10957            Ok(Self::new(conn))
10958        }
10959    }
10960    impl<T> RoleServiceClient<T>
10961    where
10962        T: tonic::client::GrpcService<tonic::body::Body>,
10963        T::Error: Into<StdError>,
10964        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
10965        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
10966    {
10967        pub fn new(inner: T) -> Self {
10968            let inner = tonic::client::Grpc::new(inner);
10969            Self { inner }
10970        }
10971        pub fn with_origin(inner: T, origin: Uri) -> Self {
10972            let inner = tonic::client::Grpc::with_origin(inner, origin);
10973            Self { inner }
10974        }
10975        pub fn with_interceptor<F>(
10976            inner: T,
10977            interceptor: F,
10978        ) -> RoleServiceClient<InterceptedService<T, F>>
10979        where
10980            F: tonic::service::Interceptor,
10981            T::ResponseBody: Default,
10982            T: tonic::codegen::Service<
10983                http::Request<tonic::body::Body>,
10984                Response = http::Response<
10985                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
10986                >,
10987            >,
10988            <T as tonic::codegen::Service<
10989                http::Request<tonic::body::Body>,
10990            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
10991        {
10992            RoleServiceClient::new(InterceptedService::new(inner, interceptor))
10993        }
10994        /// Compress requests with the given encoding.
10995        ///
10996        /// This requires the server to support it otherwise it might respond with an
10997        /// error.
10998        #[must_use]
10999        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11000            self.inner = self.inner.send_compressed(encoding);
11001            self
11002        }
11003        /// Enable decompressing responses.
11004        #[must_use]
11005        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11006            self.inner = self.inner.accept_compressed(encoding);
11007            self
11008        }
11009        /// Limits the maximum size of a decoded message.
11010        ///
11011        /// Default: `4MB`
11012        #[must_use]
11013        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11014            self.inner = self.inner.max_decoding_message_size(limit);
11015            self
11016        }
11017        /// Limits the maximum size of an encoded message.
11018        ///
11019        /// Default: `usize::MAX`
11020        #[must_use]
11021        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11022            self.inner = self.inner.max_encoding_message_size(limit);
11023            self
11024        }
11025        /** List all roles in the organization with their permission sets.
11026 Authorization: Requires PERMISSION_ORG_READ.
11027*/
11028        pub async fn list_roles(
11029            &mut self,
11030            request: impl tonic::IntoRequest<super::ListRolesRequest>,
11031        ) -> std::result::Result<
11032            tonic::Response<super::ListRolesResponse>,
11033            tonic::Status,
11034        > {
11035            self.inner
11036                .ready()
11037                .await
11038                .map_err(|e| {
11039                    tonic::Status::unknown(
11040                        format!("Service was not ready: {}", e.into()),
11041                    )
11042                })?;
11043            let codec = tonic_prost::ProstCodec::default();
11044            let path = http::uri::PathAndQuery::from_static(
11045                "/pidgr.v1.RoleService/ListRoles",
11046            );
11047            let mut req = request.into_request();
11048            req.extensions_mut()
11049                .insert(GrpcMethod::new("pidgr.v1.RoleService", "ListRoles"));
11050            self.inner.unary(req, path, codec).await
11051        }
11052        /** Create a new custom role with a name and initial permissions.
11053 Slug is auto-generated from the name and immutable after creation.
11054 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
11055*/
11056        pub async fn create_role(
11057            &mut self,
11058            request: impl tonic::IntoRequest<super::CreateRoleRequest>,
11059        ) -> std::result::Result<
11060            tonic::Response<super::CreateRoleResponse>,
11061            tonic::Status,
11062        > {
11063            self.inner
11064                .ready()
11065                .await
11066                .map_err(|e| {
11067                    tonic::Status::unknown(
11068                        format!("Service was not ready: {}", e.into()),
11069                    )
11070                })?;
11071            let codec = tonic_prost::ProstCodec::default();
11072            let path = http::uri::PathAndQuery::from_static(
11073                "/pidgr.v1.RoleService/CreateRole",
11074            );
11075            let mut req = request.into_request();
11076            req.extensions_mut()
11077                .insert(GrpcMethod::new("pidgr.v1.RoleService", "CreateRole"));
11078            self.inner.unary(req, path, codec).await
11079        }
11080        /** Update a role's name and/or permissions.
11081 System roles (is_system=true) cannot be updated.
11082 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
11083*/
11084        pub async fn update_role(
11085            &mut self,
11086            request: impl tonic::IntoRequest<super::UpdateRoleRequest>,
11087        ) -> std::result::Result<
11088            tonic::Response<super::UpdateRoleResponse>,
11089            tonic::Status,
11090        > {
11091            self.inner
11092                .ready()
11093                .await
11094                .map_err(|e| {
11095                    tonic::Status::unknown(
11096                        format!("Service was not ready: {}", e.into()),
11097                    )
11098                })?;
11099            let codec = tonic_prost::ProstCodec::default();
11100            let path = http::uri::PathAndQuery::from_static(
11101                "/pidgr.v1.RoleService/UpdateRole",
11102            );
11103            let mut req = request.into_request();
11104            req.extensions_mut()
11105                .insert(GrpcMethod::new("pidgr.v1.RoleService", "UpdateRole"));
11106            self.inner.unary(req, path, codec).await
11107        }
11108        /** Delete a role. Fails if any users are assigned to it.
11109 System roles (is_system=true) cannot be deleted.
11110 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
11111*/
11112        pub async fn delete_role(
11113            &mut self,
11114            request: impl tonic::IntoRequest<super::DeleteRoleRequest>,
11115        ) -> std::result::Result<
11116            tonic::Response<super::DeleteRoleResponse>,
11117            tonic::Status,
11118        > {
11119            self.inner
11120                .ready()
11121                .await
11122                .map_err(|e| {
11123                    tonic::Status::unknown(
11124                        format!("Service was not ready: {}", e.into()),
11125                    )
11126                })?;
11127            let codec = tonic_prost::ProstCodec::default();
11128            let path = http::uri::PathAndQuery::from_static(
11129                "/pidgr.v1.RoleService/DeleteRole",
11130            );
11131            let mut req = request.into_request();
11132            req.extensions_mut()
11133                .insert(GrpcMethod::new("pidgr.v1.RoleService", "DeleteRole"));
11134            self.inner.unary(req, path, codec).await
11135        }
11136    }
11137}
11138/// Generated server implementations.
11139pub mod role_service_server {
11140    #![allow(
11141        unused_variables,
11142        dead_code,
11143        missing_docs,
11144        clippy::wildcard_imports,
11145        clippy::let_unit_value,
11146    )]
11147    use tonic::codegen::*;
11148    /// Generated trait containing gRPC methods that should be implemented for use with RoleServiceServer.
11149    #[async_trait]
11150    pub trait RoleService: std::marker::Send + std::marker::Sync + 'static {
11151        /** List all roles in the organization with their permission sets.
11152 Authorization: Requires PERMISSION_ORG_READ.
11153*/
11154        async fn list_roles(
11155            &self,
11156            request: tonic::Request<super::ListRolesRequest>,
11157        ) -> std::result::Result<
11158            tonic::Response<super::ListRolesResponse>,
11159            tonic::Status,
11160        >;
11161        /** Create a new custom role with a name and initial permissions.
11162 Slug is auto-generated from the name and immutable after creation.
11163 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
11164*/
11165        async fn create_role(
11166            &self,
11167            request: tonic::Request<super::CreateRoleRequest>,
11168        ) -> std::result::Result<
11169            tonic::Response<super::CreateRoleResponse>,
11170            tonic::Status,
11171        >;
11172        /** Update a role's name and/or permissions.
11173 System roles (is_system=true) cannot be updated.
11174 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
11175*/
11176        async fn update_role(
11177            &self,
11178            request: tonic::Request<super::UpdateRoleRequest>,
11179        ) -> std::result::Result<
11180            tonic::Response<super::UpdateRoleResponse>,
11181            tonic::Status,
11182        >;
11183        /** Delete a role. Fails if any users are assigned to it.
11184 System roles (is_system=true) cannot be deleted.
11185 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
11186*/
11187        async fn delete_role(
11188            &self,
11189            request: tonic::Request<super::DeleteRoleRequest>,
11190        ) -> std::result::Result<
11191            tonic::Response<super::DeleteRoleResponse>,
11192            tonic::Status,
11193        >;
11194    }
11195    /** Manages roles and their permissions within an organization.
11196 All RPCs operate within the caller's org (extracted from JWT).
11197*/
11198    #[derive(Debug)]
11199    pub struct RoleServiceServer<T> {
11200        inner: Arc<T>,
11201        accept_compression_encodings: EnabledCompressionEncodings,
11202        send_compression_encodings: EnabledCompressionEncodings,
11203        max_decoding_message_size: Option<usize>,
11204        max_encoding_message_size: Option<usize>,
11205    }
11206    impl<T> RoleServiceServer<T> {
11207        pub fn new(inner: T) -> Self {
11208            Self::from_arc(Arc::new(inner))
11209        }
11210        pub fn from_arc(inner: Arc<T>) -> Self {
11211            Self {
11212                inner,
11213                accept_compression_encodings: Default::default(),
11214                send_compression_encodings: Default::default(),
11215                max_decoding_message_size: None,
11216                max_encoding_message_size: None,
11217            }
11218        }
11219        pub fn with_interceptor<F>(
11220            inner: T,
11221            interceptor: F,
11222        ) -> InterceptedService<Self, F>
11223        where
11224            F: tonic::service::Interceptor,
11225        {
11226            InterceptedService::new(Self::new(inner), interceptor)
11227        }
11228        /// Enable decompressing requests with the given encoding.
11229        #[must_use]
11230        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11231            self.accept_compression_encodings.enable(encoding);
11232            self
11233        }
11234        /// Compress responses with the given encoding, if the client supports it.
11235        #[must_use]
11236        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11237            self.send_compression_encodings.enable(encoding);
11238            self
11239        }
11240        /// Limits the maximum size of a decoded message.
11241        ///
11242        /// Default: `4MB`
11243        #[must_use]
11244        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11245            self.max_decoding_message_size = Some(limit);
11246            self
11247        }
11248        /// Limits the maximum size of an encoded message.
11249        ///
11250        /// Default: `usize::MAX`
11251        #[must_use]
11252        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11253            self.max_encoding_message_size = Some(limit);
11254            self
11255        }
11256    }
11257    impl<T, B> tonic::codegen::Service<http::Request<B>> for RoleServiceServer<T>
11258    where
11259        T: RoleService,
11260        B: Body + std::marker::Send + 'static,
11261        B::Error: Into<StdError> + std::marker::Send + 'static,
11262    {
11263        type Response = http::Response<tonic::body::Body>;
11264        type Error = std::convert::Infallible;
11265        type Future = BoxFuture<Self::Response, Self::Error>;
11266        fn poll_ready(
11267            &mut self,
11268            _cx: &mut Context<'_>,
11269        ) -> Poll<std::result::Result<(), Self::Error>> {
11270            Poll::Ready(Ok(()))
11271        }
11272        fn call(&mut self, req: http::Request<B>) -> Self::Future {
11273            match req.uri().path() {
11274                "/pidgr.v1.RoleService/ListRoles" => {
11275                    #[allow(non_camel_case_types)]
11276                    struct ListRolesSvc<T: RoleService>(pub Arc<T>);
11277                    impl<
11278                        T: RoleService,
11279                    > tonic::server::UnaryService<super::ListRolesRequest>
11280                    for ListRolesSvc<T> {
11281                        type Response = super::ListRolesResponse;
11282                        type Future = BoxFuture<
11283                            tonic::Response<Self::Response>,
11284                            tonic::Status,
11285                        >;
11286                        fn call(
11287                            &mut self,
11288                            request: tonic::Request<super::ListRolesRequest>,
11289                        ) -> Self::Future {
11290                            let inner = Arc::clone(&self.0);
11291                            let fut = async move {
11292                                <T as RoleService>::list_roles(&inner, request).await
11293                            };
11294                            Box::pin(fut)
11295                        }
11296                    }
11297                    let accept_compression_encodings = self.accept_compression_encodings;
11298                    let send_compression_encodings = self.send_compression_encodings;
11299                    let max_decoding_message_size = self.max_decoding_message_size;
11300                    let max_encoding_message_size = self.max_encoding_message_size;
11301                    let inner = self.inner.clone();
11302                    let fut = async move {
11303                        let method = ListRolesSvc(inner);
11304                        let codec = tonic_prost::ProstCodec::default();
11305                        let mut grpc = tonic::server::Grpc::new(codec)
11306                            .apply_compression_config(
11307                                accept_compression_encodings,
11308                                send_compression_encodings,
11309                            )
11310                            .apply_max_message_size_config(
11311                                max_decoding_message_size,
11312                                max_encoding_message_size,
11313                            );
11314                        let res = grpc.unary(method, req).await;
11315                        Ok(res)
11316                    };
11317                    Box::pin(fut)
11318                }
11319                "/pidgr.v1.RoleService/CreateRole" => {
11320                    #[allow(non_camel_case_types)]
11321                    struct CreateRoleSvc<T: RoleService>(pub Arc<T>);
11322                    impl<
11323                        T: RoleService,
11324                    > tonic::server::UnaryService<super::CreateRoleRequest>
11325                    for CreateRoleSvc<T> {
11326                        type Response = super::CreateRoleResponse;
11327                        type Future = BoxFuture<
11328                            tonic::Response<Self::Response>,
11329                            tonic::Status,
11330                        >;
11331                        fn call(
11332                            &mut self,
11333                            request: tonic::Request<super::CreateRoleRequest>,
11334                        ) -> Self::Future {
11335                            let inner = Arc::clone(&self.0);
11336                            let fut = async move {
11337                                <T as RoleService>::create_role(&inner, request).await
11338                            };
11339                            Box::pin(fut)
11340                        }
11341                    }
11342                    let accept_compression_encodings = self.accept_compression_encodings;
11343                    let send_compression_encodings = self.send_compression_encodings;
11344                    let max_decoding_message_size = self.max_decoding_message_size;
11345                    let max_encoding_message_size = self.max_encoding_message_size;
11346                    let inner = self.inner.clone();
11347                    let fut = async move {
11348                        let method = CreateRoleSvc(inner);
11349                        let codec = tonic_prost::ProstCodec::default();
11350                        let mut grpc = tonic::server::Grpc::new(codec)
11351                            .apply_compression_config(
11352                                accept_compression_encodings,
11353                                send_compression_encodings,
11354                            )
11355                            .apply_max_message_size_config(
11356                                max_decoding_message_size,
11357                                max_encoding_message_size,
11358                            );
11359                        let res = grpc.unary(method, req).await;
11360                        Ok(res)
11361                    };
11362                    Box::pin(fut)
11363                }
11364                "/pidgr.v1.RoleService/UpdateRole" => {
11365                    #[allow(non_camel_case_types)]
11366                    struct UpdateRoleSvc<T: RoleService>(pub Arc<T>);
11367                    impl<
11368                        T: RoleService,
11369                    > tonic::server::UnaryService<super::UpdateRoleRequest>
11370                    for UpdateRoleSvc<T> {
11371                        type Response = super::UpdateRoleResponse;
11372                        type Future = BoxFuture<
11373                            tonic::Response<Self::Response>,
11374                            tonic::Status,
11375                        >;
11376                        fn call(
11377                            &mut self,
11378                            request: tonic::Request<super::UpdateRoleRequest>,
11379                        ) -> Self::Future {
11380                            let inner = Arc::clone(&self.0);
11381                            let fut = async move {
11382                                <T as RoleService>::update_role(&inner, request).await
11383                            };
11384                            Box::pin(fut)
11385                        }
11386                    }
11387                    let accept_compression_encodings = self.accept_compression_encodings;
11388                    let send_compression_encodings = self.send_compression_encodings;
11389                    let max_decoding_message_size = self.max_decoding_message_size;
11390                    let max_encoding_message_size = self.max_encoding_message_size;
11391                    let inner = self.inner.clone();
11392                    let fut = async move {
11393                        let method = UpdateRoleSvc(inner);
11394                        let codec = tonic_prost::ProstCodec::default();
11395                        let mut grpc = tonic::server::Grpc::new(codec)
11396                            .apply_compression_config(
11397                                accept_compression_encodings,
11398                                send_compression_encodings,
11399                            )
11400                            .apply_max_message_size_config(
11401                                max_decoding_message_size,
11402                                max_encoding_message_size,
11403                            );
11404                        let res = grpc.unary(method, req).await;
11405                        Ok(res)
11406                    };
11407                    Box::pin(fut)
11408                }
11409                "/pidgr.v1.RoleService/DeleteRole" => {
11410                    #[allow(non_camel_case_types)]
11411                    struct DeleteRoleSvc<T: RoleService>(pub Arc<T>);
11412                    impl<
11413                        T: RoleService,
11414                    > tonic::server::UnaryService<super::DeleteRoleRequest>
11415                    for DeleteRoleSvc<T> {
11416                        type Response = super::DeleteRoleResponse;
11417                        type Future = BoxFuture<
11418                            tonic::Response<Self::Response>,
11419                            tonic::Status,
11420                        >;
11421                        fn call(
11422                            &mut self,
11423                            request: tonic::Request<super::DeleteRoleRequest>,
11424                        ) -> Self::Future {
11425                            let inner = Arc::clone(&self.0);
11426                            let fut = async move {
11427                                <T as RoleService>::delete_role(&inner, request).await
11428                            };
11429                            Box::pin(fut)
11430                        }
11431                    }
11432                    let accept_compression_encodings = self.accept_compression_encodings;
11433                    let send_compression_encodings = self.send_compression_encodings;
11434                    let max_decoding_message_size = self.max_decoding_message_size;
11435                    let max_encoding_message_size = self.max_encoding_message_size;
11436                    let inner = self.inner.clone();
11437                    let fut = async move {
11438                        let method = DeleteRoleSvc(inner);
11439                        let codec = tonic_prost::ProstCodec::default();
11440                        let mut grpc = tonic::server::Grpc::new(codec)
11441                            .apply_compression_config(
11442                                accept_compression_encodings,
11443                                send_compression_encodings,
11444                            )
11445                            .apply_max_message_size_config(
11446                                max_decoding_message_size,
11447                                max_encoding_message_size,
11448                            );
11449                        let res = grpc.unary(method, req).await;
11450                        Ok(res)
11451                    };
11452                    Box::pin(fut)
11453                }
11454                _ => {
11455                    Box::pin(async move {
11456                        let mut response = http::Response::new(
11457                            tonic::body::Body::default(),
11458                        );
11459                        let headers = response.headers_mut();
11460                        headers
11461                            .insert(
11462                                tonic::Status::GRPC_STATUS,
11463                                (tonic::Code::Unimplemented as i32).into(),
11464                            );
11465                        headers
11466                            .insert(
11467                                http::header::CONTENT_TYPE,
11468                                tonic::metadata::GRPC_CONTENT_TYPE,
11469                            );
11470                        Ok(response)
11471                    })
11472                }
11473            }
11474        }
11475    }
11476    impl<T> Clone for RoleServiceServer<T> {
11477        fn clone(&self) -> Self {
11478            let inner = self.inner.clone();
11479            Self {
11480                inner,
11481                accept_compression_encodings: self.accept_compression_encodings,
11482                send_compression_encodings: self.send_compression_encodings,
11483                max_decoding_message_size: self.max_decoding_message_size,
11484                max_encoding_message_size: self.max_encoding_message_size,
11485            }
11486        }
11487    }
11488    /// Generated gRPC service name
11489    pub const SERVICE_NAME: &str = "pidgr.v1.RoleService";
11490    impl<T> tonic::server::NamedService for RoleServiceServer<T> {
11491        const NAME: &'static str = SERVICE_NAME;
11492    }
11493}
11494/// Generated client implementations.
11495pub mod sso_service_client {
11496    #![allow(
11497        unused_variables,
11498        dead_code,
11499        missing_docs,
11500        clippy::wildcard_imports,
11501        clippy::let_unit_value,
11502    )]
11503    use tonic::codegen::*;
11504    use tonic::codegen::http::Uri;
11505    /** Manages SSO identity provider configuration for organizations.
11506*/
11507    #[derive(Debug, Clone)]
11508    pub struct SsoServiceClient<T> {
11509        inner: tonic::client::Grpc<T>,
11510    }
11511    impl SsoServiceClient<tonic::transport::Channel> {
11512        /// Attempt to create a new client by connecting to a given endpoint.
11513        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
11514        where
11515            D: TryInto<tonic::transport::Endpoint>,
11516            D::Error: Into<StdError>,
11517        {
11518            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
11519            Ok(Self::new(conn))
11520        }
11521    }
11522    impl<T> SsoServiceClient<T>
11523    where
11524        T: tonic::client::GrpcService<tonic::body::Body>,
11525        T::Error: Into<StdError>,
11526        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
11527        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
11528    {
11529        pub fn new(inner: T) -> Self {
11530            let inner = tonic::client::Grpc::new(inner);
11531            Self { inner }
11532        }
11533        pub fn with_origin(inner: T, origin: Uri) -> Self {
11534            let inner = tonic::client::Grpc::with_origin(inner, origin);
11535            Self { inner }
11536        }
11537        pub fn with_interceptor<F>(
11538            inner: T,
11539            interceptor: F,
11540        ) -> SsoServiceClient<InterceptedService<T, F>>
11541        where
11542            F: tonic::service::Interceptor,
11543            T::ResponseBody: Default,
11544            T: tonic::codegen::Service<
11545                http::Request<tonic::body::Body>,
11546                Response = http::Response<
11547                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
11548                >,
11549            >,
11550            <T as tonic::codegen::Service<
11551                http::Request<tonic::body::Body>,
11552            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
11553        {
11554            SsoServiceClient::new(InterceptedService::new(inner, interceptor))
11555        }
11556        /// Compress requests with the given encoding.
11557        ///
11558        /// This requires the server to support it otherwise it might respond with an
11559        /// error.
11560        #[must_use]
11561        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11562            self.inner = self.inner.send_compressed(encoding);
11563            self
11564        }
11565        /// Enable decompressing responses.
11566        #[must_use]
11567        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11568            self.inner = self.inner.accept_compressed(encoding);
11569            self
11570        }
11571        /// Limits the maximum size of a decoded message.
11572        ///
11573        /// Default: `4MB`
11574        #[must_use]
11575        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11576            self.inner = self.inner.max_decoding_message_size(limit);
11577            self
11578        }
11579        /// Limits the maximum size of an encoded message.
11580        ///
11581        /// Default: `usize::MAX`
11582        #[must_use]
11583        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11584            self.inner = self.inner.max_encoding_message_size(limit);
11585            self
11586        }
11587        /** Check if an email domain has SSO configured.
11588 This is a pre-authentication endpoint — no JWT required.
11589 Authorization: None (public).
11590*/
11591        pub async fn check_sso_by_domain(
11592            &mut self,
11593            request: impl tonic::IntoRequest<super::CheckSsoByDomainRequest>,
11594        ) -> std::result::Result<
11595            tonic::Response<super::CheckSsoByDomainResponse>,
11596            tonic::Status,
11597        > {
11598            self.inner
11599                .ready()
11600                .await
11601                .map_err(|e| {
11602                    tonic::Status::unknown(
11603                        format!("Service was not ready: {}", e.into()),
11604                    )
11605                })?;
11606            let codec = tonic_prost::ProstCodec::default();
11607            let path = http::uri::PathAndQuery::from_static(
11608                "/pidgr.v1.SSOService/CheckSSOByDomain",
11609            );
11610            let mut req = request.into_request();
11611            req.extensions_mut()
11612                .insert(GrpcMethod::new("pidgr.v1.SSOService", "CheckSSOByDomain"));
11613            self.inner.unary(req, path, codec).await
11614        }
11615        /** Create an SSO provider for the organization.
11616 Validates the metadata URL before saving.
11617 Creates the corresponding identity provider in the auth service.
11618 Authorization: Requires PERMISSION_ORG_WRITE.
11619*/
11620        pub async fn create_sso_provider(
11621            &mut self,
11622            request: impl tonic::IntoRequest<super::CreateSsoProviderRequest>,
11623        ) -> std::result::Result<
11624            tonic::Response<super::CreateSsoProviderResponse>,
11625            tonic::Status,
11626        > {
11627            self.inner
11628                .ready()
11629                .await
11630                .map_err(|e| {
11631                    tonic::Status::unknown(
11632                        format!("Service was not ready: {}", e.into()),
11633                    )
11634                })?;
11635            let codec = tonic_prost::ProstCodec::default();
11636            let path = http::uri::PathAndQuery::from_static(
11637                "/pidgr.v1.SSOService/CreateSSOProvider",
11638            );
11639            let mut req = request.into_request();
11640            req.extensions_mut()
11641                .insert(GrpcMethod::new("pidgr.v1.SSOService", "CreateSSOProvider"));
11642            self.inner.unary(req, path, codec).await
11643        }
11644        /** Get the organization's SSO provider configuration.
11645 Authorization: Requires PERMISSION_ORG_READ.
11646*/
11647        pub async fn get_sso_provider(
11648            &mut self,
11649            request: impl tonic::IntoRequest<super::GetSsoProviderRequest>,
11650        ) -> std::result::Result<
11651            tonic::Response<super::GetSsoProviderResponse>,
11652            tonic::Status,
11653        > {
11654            self.inner
11655                .ready()
11656                .await
11657                .map_err(|e| {
11658                    tonic::Status::unknown(
11659                        format!("Service was not ready: {}", e.into()),
11660                    )
11661                })?;
11662            let codec = tonic_prost::ProstCodec::default();
11663            let path = http::uri::PathAndQuery::from_static(
11664                "/pidgr.v1.SSOService/GetSSOProvider",
11665            );
11666            let mut req = request.into_request();
11667            req.extensions_mut()
11668                .insert(GrpcMethod::new("pidgr.v1.SSOService", "GetSSOProvider"));
11669            self.inner.unary(req, path, codec).await
11670        }
11671        /** Delete the organization's SSO provider.
11672 Deletes the corresponding identity provider from the auth service.
11673 Users with that domain fall back to passkey/OTP.
11674 Authorization: Requires PERMISSION_ORG_WRITE.
11675*/
11676        pub async fn delete_sso_provider(
11677            &mut self,
11678            request: impl tonic::IntoRequest<super::DeleteSsoProviderRequest>,
11679        ) -> std::result::Result<
11680            tonic::Response<super::DeleteSsoProviderResponse>,
11681            tonic::Status,
11682        > {
11683            self.inner
11684                .ready()
11685                .await
11686                .map_err(|e| {
11687                    tonic::Status::unknown(
11688                        format!("Service was not ready: {}", e.into()),
11689                    )
11690                })?;
11691            let codec = tonic_prost::ProstCodec::default();
11692            let path = http::uri::PathAndQuery::from_static(
11693                "/pidgr.v1.SSOService/DeleteSSOProvider",
11694            );
11695            let mut req = request.into_request();
11696            req.extensions_mut()
11697                .insert(GrpcMethod::new("pidgr.v1.SSOService", "DeleteSSOProvider"));
11698            self.inner.unary(req, path, codec).await
11699        }
11700    }
11701}
11702/// Generated server implementations.
11703pub mod sso_service_server {
11704    #![allow(
11705        unused_variables,
11706        dead_code,
11707        missing_docs,
11708        clippy::wildcard_imports,
11709        clippy::let_unit_value,
11710    )]
11711    use tonic::codegen::*;
11712    /// Generated trait containing gRPC methods that should be implemented for use with SsoServiceServer.
11713    #[async_trait]
11714    pub trait SsoService: std::marker::Send + std::marker::Sync + 'static {
11715        /** Check if an email domain has SSO configured.
11716 This is a pre-authentication endpoint — no JWT required.
11717 Authorization: None (public).
11718*/
11719        async fn check_sso_by_domain(
11720            &self,
11721            request: tonic::Request<super::CheckSsoByDomainRequest>,
11722        ) -> std::result::Result<
11723            tonic::Response<super::CheckSsoByDomainResponse>,
11724            tonic::Status,
11725        >;
11726        /** Create an SSO provider for the organization.
11727 Validates the metadata URL before saving.
11728 Creates the corresponding identity provider in the auth service.
11729 Authorization: Requires PERMISSION_ORG_WRITE.
11730*/
11731        async fn create_sso_provider(
11732            &self,
11733            request: tonic::Request<super::CreateSsoProviderRequest>,
11734        ) -> std::result::Result<
11735            tonic::Response<super::CreateSsoProviderResponse>,
11736            tonic::Status,
11737        >;
11738        /** Get the organization's SSO provider configuration.
11739 Authorization: Requires PERMISSION_ORG_READ.
11740*/
11741        async fn get_sso_provider(
11742            &self,
11743            request: tonic::Request<super::GetSsoProviderRequest>,
11744        ) -> std::result::Result<
11745            tonic::Response<super::GetSsoProviderResponse>,
11746            tonic::Status,
11747        >;
11748        /** Delete the organization's SSO provider.
11749 Deletes the corresponding identity provider from the auth service.
11750 Users with that domain fall back to passkey/OTP.
11751 Authorization: Requires PERMISSION_ORG_WRITE.
11752*/
11753        async fn delete_sso_provider(
11754            &self,
11755            request: tonic::Request<super::DeleteSsoProviderRequest>,
11756        ) -> std::result::Result<
11757            tonic::Response<super::DeleteSsoProviderResponse>,
11758            tonic::Status,
11759        >;
11760    }
11761    /** Manages SSO identity provider configuration for organizations.
11762*/
11763    #[derive(Debug)]
11764    pub struct SsoServiceServer<T> {
11765        inner: Arc<T>,
11766        accept_compression_encodings: EnabledCompressionEncodings,
11767        send_compression_encodings: EnabledCompressionEncodings,
11768        max_decoding_message_size: Option<usize>,
11769        max_encoding_message_size: Option<usize>,
11770    }
11771    impl<T> SsoServiceServer<T> {
11772        pub fn new(inner: T) -> Self {
11773            Self::from_arc(Arc::new(inner))
11774        }
11775        pub fn from_arc(inner: Arc<T>) -> Self {
11776            Self {
11777                inner,
11778                accept_compression_encodings: Default::default(),
11779                send_compression_encodings: Default::default(),
11780                max_decoding_message_size: None,
11781                max_encoding_message_size: None,
11782            }
11783        }
11784        pub fn with_interceptor<F>(
11785            inner: T,
11786            interceptor: F,
11787        ) -> InterceptedService<Self, F>
11788        where
11789            F: tonic::service::Interceptor,
11790        {
11791            InterceptedService::new(Self::new(inner), interceptor)
11792        }
11793        /// Enable decompressing requests with the given encoding.
11794        #[must_use]
11795        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11796            self.accept_compression_encodings.enable(encoding);
11797            self
11798        }
11799        /// Compress responses with the given encoding, if the client supports it.
11800        #[must_use]
11801        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11802            self.send_compression_encodings.enable(encoding);
11803            self
11804        }
11805        /// Limits the maximum size of a decoded message.
11806        ///
11807        /// Default: `4MB`
11808        #[must_use]
11809        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11810            self.max_decoding_message_size = Some(limit);
11811            self
11812        }
11813        /// Limits the maximum size of an encoded message.
11814        ///
11815        /// Default: `usize::MAX`
11816        #[must_use]
11817        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11818            self.max_encoding_message_size = Some(limit);
11819            self
11820        }
11821    }
11822    impl<T, B> tonic::codegen::Service<http::Request<B>> for SsoServiceServer<T>
11823    where
11824        T: SsoService,
11825        B: Body + std::marker::Send + 'static,
11826        B::Error: Into<StdError> + std::marker::Send + 'static,
11827    {
11828        type Response = http::Response<tonic::body::Body>;
11829        type Error = std::convert::Infallible;
11830        type Future = BoxFuture<Self::Response, Self::Error>;
11831        fn poll_ready(
11832            &mut self,
11833            _cx: &mut Context<'_>,
11834        ) -> Poll<std::result::Result<(), Self::Error>> {
11835            Poll::Ready(Ok(()))
11836        }
11837        fn call(&mut self, req: http::Request<B>) -> Self::Future {
11838            match req.uri().path() {
11839                "/pidgr.v1.SSOService/CheckSSOByDomain" => {
11840                    #[allow(non_camel_case_types)]
11841                    struct CheckSSOByDomainSvc<T: SsoService>(pub Arc<T>);
11842                    impl<
11843                        T: SsoService,
11844                    > tonic::server::UnaryService<super::CheckSsoByDomainRequest>
11845                    for CheckSSOByDomainSvc<T> {
11846                        type Response = super::CheckSsoByDomainResponse;
11847                        type Future = BoxFuture<
11848                            tonic::Response<Self::Response>,
11849                            tonic::Status,
11850                        >;
11851                        fn call(
11852                            &mut self,
11853                            request: tonic::Request<super::CheckSsoByDomainRequest>,
11854                        ) -> Self::Future {
11855                            let inner = Arc::clone(&self.0);
11856                            let fut = async move {
11857                                <T as SsoService>::check_sso_by_domain(&inner, request)
11858                                    .await
11859                            };
11860                            Box::pin(fut)
11861                        }
11862                    }
11863                    let accept_compression_encodings = self.accept_compression_encodings;
11864                    let send_compression_encodings = self.send_compression_encodings;
11865                    let max_decoding_message_size = self.max_decoding_message_size;
11866                    let max_encoding_message_size = self.max_encoding_message_size;
11867                    let inner = self.inner.clone();
11868                    let fut = async move {
11869                        let method = CheckSSOByDomainSvc(inner);
11870                        let codec = tonic_prost::ProstCodec::default();
11871                        let mut grpc = tonic::server::Grpc::new(codec)
11872                            .apply_compression_config(
11873                                accept_compression_encodings,
11874                                send_compression_encodings,
11875                            )
11876                            .apply_max_message_size_config(
11877                                max_decoding_message_size,
11878                                max_encoding_message_size,
11879                            );
11880                        let res = grpc.unary(method, req).await;
11881                        Ok(res)
11882                    };
11883                    Box::pin(fut)
11884                }
11885                "/pidgr.v1.SSOService/CreateSSOProvider" => {
11886                    #[allow(non_camel_case_types)]
11887                    struct CreateSSOProviderSvc<T: SsoService>(pub Arc<T>);
11888                    impl<
11889                        T: SsoService,
11890                    > tonic::server::UnaryService<super::CreateSsoProviderRequest>
11891                    for CreateSSOProviderSvc<T> {
11892                        type Response = super::CreateSsoProviderResponse;
11893                        type Future = BoxFuture<
11894                            tonic::Response<Self::Response>,
11895                            tonic::Status,
11896                        >;
11897                        fn call(
11898                            &mut self,
11899                            request: tonic::Request<super::CreateSsoProviderRequest>,
11900                        ) -> Self::Future {
11901                            let inner = Arc::clone(&self.0);
11902                            let fut = async move {
11903                                <T as SsoService>::create_sso_provider(&inner, request)
11904                                    .await
11905                            };
11906                            Box::pin(fut)
11907                        }
11908                    }
11909                    let accept_compression_encodings = self.accept_compression_encodings;
11910                    let send_compression_encodings = self.send_compression_encodings;
11911                    let max_decoding_message_size = self.max_decoding_message_size;
11912                    let max_encoding_message_size = self.max_encoding_message_size;
11913                    let inner = self.inner.clone();
11914                    let fut = async move {
11915                        let method = CreateSSOProviderSvc(inner);
11916                        let codec = tonic_prost::ProstCodec::default();
11917                        let mut grpc = tonic::server::Grpc::new(codec)
11918                            .apply_compression_config(
11919                                accept_compression_encodings,
11920                                send_compression_encodings,
11921                            )
11922                            .apply_max_message_size_config(
11923                                max_decoding_message_size,
11924                                max_encoding_message_size,
11925                            );
11926                        let res = grpc.unary(method, req).await;
11927                        Ok(res)
11928                    };
11929                    Box::pin(fut)
11930                }
11931                "/pidgr.v1.SSOService/GetSSOProvider" => {
11932                    #[allow(non_camel_case_types)]
11933                    struct GetSSOProviderSvc<T: SsoService>(pub Arc<T>);
11934                    impl<
11935                        T: SsoService,
11936                    > tonic::server::UnaryService<super::GetSsoProviderRequest>
11937                    for GetSSOProviderSvc<T> {
11938                        type Response = super::GetSsoProviderResponse;
11939                        type Future = BoxFuture<
11940                            tonic::Response<Self::Response>,
11941                            tonic::Status,
11942                        >;
11943                        fn call(
11944                            &mut self,
11945                            request: tonic::Request<super::GetSsoProviderRequest>,
11946                        ) -> Self::Future {
11947                            let inner = Arc::clone(&self.0);
11948                            let fut = async move {
11949                                <T as SsoService>::get_sso_provider(&inner, request).await
11950                            };
11951                            Box::pin(fut)
11952                        }
11953                    }
11954                    let accept_compression_encodings = self.accept_compression_encodings;
11955                    let send_compression_encodings = self.send_compression_encodings;
11956                    let max_decoding_message_size = self.max_decoding_message_size;
11957                    let max_encoding_message_size = self.max_encoding_message_size;
11958                    let inner = self.inner.clone();
11959                    let fut = async move {
11960                        let method = GetSSOProviderSvc(inner);
11961                        let codec = tonic_prost::ProstCodec::default();
11962                        let mut grpc = tonic::server::Grpc::new(codec)
11963                            .apply_compression_config(
11964                                accept_compression_encodings,
11965                                send_compression_encodings,
11966                            )
11967                            .apply_max_message_size_config(
11968                                max_decoding_message_size,
11969                                max_encoding_message_size,
11970                            );
11971                        let res = grpc.unary(method, req).await;
11972                        Ok(res)
11973                    };
11974                    Box::pin(fut)
11975                }
11976                "/pidgr.v1.SSOService/DeleteSSOProvider" => {
11977                    #[allow(non_camel_case_types)]
11978                    struct DeleteSSOProviderSvc<T: SsoService>(pub Arc<T>);
11979                    impl<
11980                        T: SsoService,
11981                    > tonic::server::UnaryService<super::DeleteSsoProviderRequest>
11982                    for DeleteSSOProviderSvc<T> {
11983                        type Response = super::DeleteSsoProviderResponse;
11984                        type Future = BoxFuture<
11985                            tonic::Response<Self::Response>,
11986                            tonic::Status,
11987                        >;
11988                        fn call(
11989                            &mut self,
11990                            request: tonic::Request<super::DeleteSsoProviderRequest>,
11991                        ) -> Self::Future {
11992                            let inner = Arc::clone(&self.0);
11993                            let fut = async move {
11994                                <T as SsoService>::delete_sso_provider(&inner, request)
11995                                    .await
11996                            };
11997                            Box::pin(fut)
11998                        }
11999                    }
12000                    let accept_compression_encodings = self.accept_compression_encodings;
12001                    let send_compression_encodings = self.send_compression_encodings;
12002                    let max_decoding_message_size = self.max_decoding_message_size;
12003                    let max_encoding_message_size = self.max_encoding_message_size;
12004                    let inner = self.inner.clone();
12005                    let fut = async move {
12006                        let method = DeleteSSOProviderSvc(inner);
12007                        let codec = tonic_prost::ProstCodec::default();
12008                        let mut grpc = tonic::server::Grpc::new(codec)
12009                            .apply_compression_config(
12010                                accept_compression_encodings,
12011                                send_compression_encodings,
12012                            )
12013                            .apply_max_message_size_config(
12014                                max_decoding_message_size,
12015                                max_encoding_message_size,
12016                            );
12017                        let res = grpc.unary(method, req).await;
12018                        Ok(res)
12019                    };
12020                    Box::pin(fut)
12021                }
12022                _ => {
12023                    Box::pin(async move {
12024                        let mut response = http::Response::new(
12025                            tonic::body::Body::default(),
12026                        );
12027                        let headers = response.headers_mut();
12028                        headers
12029                            .insert(
12030                                tonic::Status::GRPC_STATUS,
12031                                (tonic::Code::Unimplemented as i32).into(),
12032                            );
12033                        headers
12034                            .insert(
12035                                http::header::CONTENT_TYPE,
12036                                tonic::metadata::GRPC_CONTENT_TYPE,
12037                            );
12038                        Ok(response)
12039                    })
12040                }
12041            }
12042        }
12043    }
12044    impl<T> Clone for SsoServiceServer<T> {
12045        fn clone(&self) -> Self {
12046            let inner = self.inner.clone();
12047            Self {
12048                inner,
12049                accept_compression_encodings: self.accept_compression_encodings,
12050                send_compression_encodings: self.send_compression_encodings,
12051                max_decoding_message_size: self.max_decoding_message_size,
12052                max_encoding_message_size: self.max_encoding_message_size,
12053            }
12054        }
12055    }
12056    /// Generated gRPC service name
12057    pub const SERVICE_NAME: &str = "pidgr.v1.SSOService";
12058    impl<T> tonic::server::NamedService for SsoServiceServer<T> {
12059        const NAME: &'static str = SERVICE_NAME;
12060    }
12061}
12062/// Generated client implementations.
12063pub mod team_service_client {
12064    #![allow(
12065        unused_variables,
12066        dead_code,
12067        missing_docs,
12068        clippy::wildcard_imports,
12069        clippy::let_unit_value,
12070    )]
12071    use tonic::codegen::*;
12072    use tonic::codegen::http::Uri;
12073    /** Manages organizational teams (departments, divisions) within an organization.
12074 Teams represent the organizational structure and can serve as sender identity.
12075 All RPCs operate within the caller's org (extracted from JWT).
12076*/
12077    #[derive(Debug, Clone)]
12078    pub struct TeamServiceClient<T> {
12079        inner: tonic::client::Grpc<T>,
12080    }
12081    impl TeamServiceClient<tonic::transport::Channel> {
12082        /// Attempt to create a new client by connecting to a given endpoint.
12083        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
12084        where
12085            D: TryInto<tonic::transport::Endpoint>,
12086            D::Error: Into<StdError>,
12087        {
12088            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
12089            Ok(Self::new(conn))
12090        }
12091    }
12092    impl<T> TeamServiceClient<T>
12093    where
12094        T: tonic::client::GrpcService<tonic::body::Body>,
12095        T::Error: Into<StdError>,
12096        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
12097        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
12098    {
12099        pub fn new(inner: T) -> Self {
12100            let inner = tonic::client::Grpc::new(inner);
12101            Self { inner }
12102        }
12103        pub fn with_origin(inner: T, origin: Uri) -> Self {
12104            let inner = tonic::client::Grpc::with_origin(inner, origin);
12105            Self { inner }
12106        }
12107        pub fn with_interceptor<F>(
12108            inner: T,
12109            interceptor: F,
12110        ) -> TeamServiceClient<InterceptedService<T, F>>
12111        where
12112            F: tonic::service::Interceptor,
12113            T::ResponseBody: Default,
12114            T: tonic::codegen::Service<
12115                http::Request<tonic::body::Body>,
12116                Response = http::Response<
12117                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
12118                >,
12119            >,
12120            <T as tonic::codegen::Service<
12121                http::Request<tonic::body::Body>,
12122            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
12123        {
12124            TeamServiceClient::new(InterceptedService::new(inner, interceptor))
12125        }
12126        /// Compress requests with the given encoding.
12127        ///
12128        /// This requires the server to support it otherwise it might respond with an
12129        /// error.
12130        #[must_use]
12131        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
12132            self.inner = self.inner.send_compressed(encoding);
12133            self
12134        }
12135        /// Enable decompressing responses.
12136        #[must_use]
12137        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
12138            self.inner = self.inner.accept_compressed(encoding);
12139            self
12140        }
12141        /// Limits the maximum size of a decoded message.
12142        ///
12143        /// Default: `4MB`
12144        #[must_use]
12145        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
12146            self.inner = self.inner.max_decoding_message_size(limit);
12147            self
12148        }
12149        /// Limits the maximum size of an encoded message.
12150        ///
12151        /// Default: `usize::MAX`
12152        #[must_use]
12153        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
12154            self.inner = self.inner.max_encoding_message_size(limit);
12155            self
12156        }
12157        /** Create a new team in the organization.
12158 Authorization: Requires PERMISSION_TEAMS_WRITE or PERMISSION_TEAMS_ALL_WRITE.
12159*/
12160        pub async fn create_team(
12161            &mut self,
12162            request: impl tonic::IntoRequest<super::CreateTeamRequest>,
12163        ) -> std::result::Result<
12164            tonic::Response<super::CreateTeamResponse>,
12165            tonic::Status,
12166        > {
12167            self.inner
12168                .ready()
12169                .await
12170                .map_err(|e| {
12171                    tonic::Status::unknown(
12172                        format!("Service was not ready: {}", e.into()),
12173                    )
12174                })?;
12175            let codec = tonic_prost::ProstCodec::default();
12176            let path = http::uri::PathAndQuery::from_static(
12177                "/pidgr.v1.TeamService/CreateTeam",
12178            );
12179            let mut req = request.into_request();
12180            req.extensions_mut()
12181                .insert(GrpcMethod::new("pidgr.v1.TeamService", "CreateTeam"));
12182            self.inner.unary(req, path, codec).await
12183        }
12184        /** Retrieve a team by ID.
12185 Authorization: Caller must be a member of the team, or have
12186 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
12187*/
12188        pub async fn get_team(
12189            &mut self,
12190            request: impl tonic::IntoRequest<super::GetTeamRequest>,
12191        ) -> std::result::Result<
12192            tonic::Response<super::GetTeamResponse>,
12193            tonic::Status,
12194        > {
12195            self.inner
12196                .ready()
12197                .await
12198                .map_err(|e| {
12199                    tonic::Status::unknown(
12200                        format!("Service was not ready: {}", e.into()),
12201                    )
12202                })?;
12203            let codec = tonic_prost::ProstCodec::default();
12204            let path = http::uri::PathAndQuery::from_static(
12205                "/pidgr.v1.TeamService/GetTeam",
12206            );
12207            let mut req = request.into_request();
12208            req.extensions_mut()
12209                .insert(GrpcMethod::new("pidgr.v1.TeamService", "GetTeam"));
12210            self.inner.unary(req, path, codec).await
12211        }
12212        /** List teams in the organization with pagination.
12213 Without PERMISSION_TEAMS_ALL_READ/ALL_WRITE, returns only teams the caller belongs to.
12214*/
12215        pub async fn list_teams(
12216            &mut self,
12217            request: impl tonic::IntoRequest<super::ListTeamsRequest>,
12218        ) -> std::result::Result<
12219            tonic::Response<super::ListTeamsResponse>,
12220            tonic::Status,
12221        > {
12222            self.inner
12223                .ready()
12224                .await
12225                .map_err(|e| {
12226                    tonic::Status::unknown(
12227                        format!("Service was not ready: {}", e.into()),
12228                    )
12229                })?;
12230            let codec = tonic_prost::ProstCodec::default();
12231            let path = http::uri::PathAndQuery::from_static(
12232                "/pidgr.v1.TeamService/ListTeams",
12233            );
12234            let mut req = request.into_request();
12235            req.extensions_mut()
12236                .insert(GrpcMethod::new("pidgr.v1.TeamService", "ListTeams"));
12237            self.inner.unary(req, path, codec).await
12238        }
12239        /** Update a team's name and/or description.
12240 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
12241*/
12242        pub async fn update_team(
12243            &mut self,
12244            request: impl tonic::IntoRequest<super::UpdateTeamRequest>,
12245        ) -> std::result::Result<
12246            tonic::Response<super::UpdateTeamResponse>,
12247            tonic::Status,
12248        > {
12249            self.inner
12250                .ready()
12251                .await
12252                .map_err(|e| {
12253                    tonic::Status::unknown(
12254                        format!("Service was not ready: {}", e.into()),
12255                    )
12256                })?;
12257            let codec = tonic_prost::ProstCodec::default();
12258            let path = http::uri::PathAndQuery::from_static(
12259                "/pidgr.v1.TeamService/UpdateTeam",
12260            );
12261            let mut req = request.into_request();
12262            req.extensions_mut()
12263                .insert(GrpcMethod::new("pidgr.v1.TeamService", "UpdateTeam"));
12264            self.inner.unary(req, path, codec).await
12265        }
12266        /** Delete a team and all its membership records. Default teams cannot be deleted.
12267 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
12268*/
12269        pub async fn delete_team(
12270            &mut self,
12271            request: impl tonic::IntoRequest<super::DeleteTeamRequest>,
12272        ) -> std::result::Result<
12273            tonic::Response<super::DeleteTeamResponse>,
12274            tonic::Status,
12275        > {
12276            self.inner
12277                .ready()
12278                .await
12279                .map_err(|e| {
12280                    tonic::Status::unknown(
12281                        format!("Service was not ready: {}", e.into()),
12282                    )
12283                })?;
12284            let codec = tonic_prost::ProstCodec::default();
12285            let path = http::uri::PathAndQuery::from_static(
12286                "/pidgr.v1.TeamService/DeleteTeam",
12287            );
12288            let mut req = request.into_request();
12289            req.extensions_mut()
12290                .insert(GrpcMethod::new("pidgr.v1.TeamService", "DeleteTeam"));
12291            self.inner.unary(req, path, codec).await
12292        }
12293        /** Add one or more users to a team (idempotent).
12294 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
12295*/
12296        pub async fn add_team_members(
12297            &mut self,
12298            request: impl tonic::IntoRequest<super::AddTeamMembersRequest>,
12299        ) -> std::result::Result<
12300            tonic::Response<super::AddTeamMembersResponse>,
12301            tonic::Status,
12302        > {
12303            self.inner
12304                .ready()
12305                .await
12306                .map_err(|e| {
12307                    tonic::Status::unknown(
12308                        format!("Service was not ready: {}", e.into()),
12309                    )
12310                })?;
12311            let codec = tonic_prost::ProstCodec::default();
12312            let path = http::uri::PathAndQuery::from_static(
12313                "/pidgr.v1.TeamService/AddTeamMembers",
12314            );
12315            let mut req = request.into_request();
12316            req.extensions_mut()
12317                .insert(GrpcMethod::new("pidgr.v1.TeamService", "AddTeamMembers"));
12318            self.inner.unary(req, path, codec).await
12319        }
12320        /** Remove one or more users from a team (idempotent).
12321 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
12322*/
12323        pub async fn remove_team_members(
12324            &mut self,
12325            request: impl tonic::IntoRequest<super::RemoveTeamMembersRequest>,
12326        ) -> std::result::Result<
12327            tonic::Response<super::RemoveTeamMembersResponse>,
12328            tonic::Status,
12329        > {
12330            self.inner
12331                .ready()
12332                .await
12333                .map_err(|e| {
12334                    tonic::Status::unknown(
12335                        format!("Service was not ready: {}", e.into()),
12336                    )
12337                })?;
12338            let codec = tonic_prost::ProstCodec::default();
12339            let path = http::uri::PathAndQuery::from_static(
12340                "/pidgr.v1.TeamService/RemoveTeamMembers",
12341            );
12342            let mut req = request.into_request();
12343            req.extensions_mut()
12344                .insert(GrpcMethod::new("pidgr.v1.TeamService", "RemoveTeamMembers"));
12345            self.inner.unary(req, path, codec).await
12346        }
12347        /** List members of a team with pagination.
12348 Authorization: Caller must be a member of the team, or have
12349 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
12350*/
12351        pub async fn list_team_members(
12352            &mut self,
12353            request: impl tonic::IntoRequest<super::ListTeamMembersRequest>,
12354        ) -> std::result::Result<
12355            tonic::Response<super::ListTeamMembersResponse>,
12356            tonic::Status,
12357        > {
12358            self.inner
12359                .ready()
12360                .await
12361                .map_err(|e| {
12362                    tonic::Status::unknown(
12363                        format!("Service was not ready: {}", e.into()),
12364                    )
12365                })?;
12366            let codec = tonic_prost::ProstCodec::default();
12367            let path = http::uri::PathAndQuery::from_static(
12368                "/pidgr.v1.TeamService/ListTeamMembers",
12369            );
12370            let mut req = request.into_request();
12371            req.extensions_mut()
12372                .insert(GrpcMethod::new("pidgr.v1.TeamService", "ListTeamMembers"));
12373            self.inner.unary(req, path, codec).await
12374        }
12375    }
12376}
12377/// Generated server implementations.
12378pub mod team_service_server {
12379    #![allow(
12380        unused_variables,
12381        dead_code,
12382        missing_docs,
12383        clippy::wildcard_imports,
12384        clippy::let_unit_value,
12385    )]
12386    use tonic::codegen::*;
12387    /// Generated trait containing gRPC methods that should be implemented for use with TeamServiceServer.
12388    #[async_trait]
12389    pub trait TeamService: std::marker::Send + std::marker::Sync + 'static {
12390        /** Create a new team in the organization.
12391 Authorization: Requires PERMISSION_TEAMS_WRITE or PERMISSION_TEAMS_ALL_WRITE.
12392*/
12393        async fn create_team(
12394            &self,
12395            request: tonic::Request<super::CreateTeamRequest>,
12396        ) -> std::result::Result<
12397            tonic::Response<super::CreateTeamResponse>,
12398            tonic::Status,
12399        >;
12400        /** Retrieve a team by ID.
12401 Authorization: Caller must be a member of the team, or have
12402 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
12403*/
12404        async fn get_team(
12405            &self,
12406            request: tonic::Request<super::GetTeamRequest>,
12407        ) -> std::result::Result<tonic::Response<super::GetTeamResponse>, tonic::Status>;
12408        /** List teams in the organization with pagination.
12409 Without PERMISSION_TEAMS_ALL_READ/ALL_WRITE, returns only teams the caller belongs to.
12410*/
12411        async fn list_teams(
12412            &self,
12413            request: tonic::Request<super::ListTeamsRequest>,
12414        ) -> std::result::Result<
12415            tonic::Response<super::ListTeamsResponse>,
12416            tonic::Status,
12417        >;
12418        /** Update a team's name and/or description.
12419 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
12420*/
12421        async fn update_team(
12422            &self,
12423            request: tonic::Request<super::UpdateTeamRequest>,
12424        ) -> std::result::Result<
12425            tonic::Response<super::UpdateTeamResponse>,
12426            tonic::Status,
12427        >;
12428        /** Delete a team and all its membership records. Default teams cannot be deleted.
12429 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
12430*/
12431        async fn delete_team(
12432            &self,
12433            request: tonic::Request<super::DeleteTeamRequest>,
12434        ) -> std::result::Result<
12435            tonic::Response<super::DeleteTeamResponse>,
12436            tonic::Status,
12437        >;
12438        /** Add one or more users to a team (idempotent).
12439 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
12440*/
12441        async fn add_team_members(
12442            &self,
12443            request: tonic::Request<super::AddTeamMembersRequest>,
12444        ) -> std::result::Result<
12445            tonic::Response<super::AddTeamMembersResponse>,
12446            tonic::Status,
12447        >;
12448        /** Remove one or more users from a team (idempotent).
12449 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
12450*/
12451        async fn remove_team_members(
12452            &self,
12453            request: tonic::Request<super::RemoveTeamMembersRequest>,
12454        ) -> std::result::Result<
12455            tonic::Response<super::RemoveTeamMembersResponse>,
12456            tonic::Status,
12457        >;
12458        /** List members of a team with pagination.
12459 Authorization: Caller must be a member of the team, or have
12460 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
12461*/
12462        async fn list_team_members(
12463            &self,
12464            request: tonic::Request<super::ListTeamMembersRequest>,
12465        ) -> std::result::Result<
12466            tonic::Response<super::ListTeamMembersResponse>,
12467            tonic::Status,
12468        >;
12469    }
12470    /** Manages organizational teams (departments, divisions) within an organization.
12471 Teams represent the organizational structure and can serve as sender identity.
12472 All RPCs operate within the caller's org (extracted from JWT).
12473*/
12474    #[derive(Debug)]
12475    pub struct TeamServiceServer<T> {
12476        inner: Arc<T>,
12477        accept_compression_encodings: EnabledCompressionEncodings,
12478        send_compression_encodings: EnabledCompressionEncodings,
12479        max_decoding_message_size: Option<usize>,
12480        max_encoding_message_size: Option<usize>,
12481    }
12482    impl<T> TeamServiceServer<T> {
12483        pub fn new(inner: T) -> Self {
12484            Self::from_arc(Arc::new(inner))
12485        }
12486        pub fn from_arc(inner: Arc<T>) -> Self {
12487            Self {
12488                inner,
12489                accept_compression_encodings: Default::default(),
12490                send_compression_encodings: Default::default(),
12491                max_decoding_message_size: None,
12492                max_encoding_message_size: None,
12493            }
12494        }
12495        pub fn with_interceptor<F>(
12496            inner: T,
12497            interceptor: F,
12498        ) -> InterceptedService<Self, F>
12499        where
12500            F: tonic::service::Interceptor,
12501        {
12502            InterceptedService::new(Self::new(inner), interceptor)
12503        }
12504        /// Enable decompressing requests with the given encoding.
12505        #[must_use]
12506        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
12507            self.accept_compression_encodings.enable(encoding);
12508            self
12509        }
12510        /// Compress responses with the given encoding, if the client supports it.
12511        #[must_use]
12512        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
12513            self.send_compression_encodings.enable(encoding);
12514            self
12515        }
12516        /// Limits the maximum size of a decoded message.
12517        ///
12518        /// Default: `4MB`
12519        #[must_use]
12520        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
12521            self.max_decoding_message_size = Some(limit);
12522            self
12523        }
12524        /// Limits the maximum size of an encoded message.
12525        ///
12526        /// Default: `usize::MAX`
12527        #[must_use]
12528        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
12529            self.max_encoding_message_size = Some(limit);
12530            self
12531        }
12532    }
12533    impl<T, B> tonic::codegen::Service<http::Request<B>> for TeamServiceServer<T>
12534    where
12535        T: TeamService,
12536        B: Body + std::marker::Send + 'static,
12537        B::Error: Into<StdError> + std::marker::Send + 'static,
12538    {
12539        type Response = http::Response<tonic::body::Body>;
12540        type Error = std::convert::Infallible;
12541        type Future = BoxFuture<Self::Response, Self::Error>;
12542        fn poll_ready(
12543            &mut self,
12544            _cx: &mut Context<'_>,
12545        ) -> Poll<std::result::Result<(), Self::Error>> {
12546            Poll::Ready(Ok(()))
12547        }
12548        fn call(&mut self, req: http::Request<B>) -> Self::Future {
12549            match req.uri().path() {
12550                "/pidgr.v1.TeamService/CreateTeam" => {
12551                    #[allow(non_camel_case_types)]
12552                    struct CreateTeamSvc<T: TeamService>(pub Arc<T>);
12553                    impl<
12554                        T: TeamService,
12555                    > tonic::server::UnaryService<super::CreateTeamRequest>
12556                    for CreateTeamSvc<T> {
12557                        type Response = super::CreateTeamResponse;
12558                        type Future = BoxFuture<
12559                            tonic::Response<Self::Response>,
12560                            tonic::Status,
12561                        >;
12562                        fn call(
12563                            &mut self,
12564                            request: tonic::Request<super::CreateTeamRequest>,
12565                        ) -> Self::Future {
12566                            let inner = Arc::clone(&self.0);
12567                            let fut = async move {
12568                                <T as TeamService>::create_team(&inner, request).await
12569                            };
12570                            Box::pin(fut)
12571                        }
12572                    }
12573                    let accept_compression_encodings = self.accept_compression_encodings;
12574                    let send_compression_encodings = self.send_compression_encodings;
12575                    let max_decoding_message_size = self.max_decoding_message_size;
12576                    let max_encoding_message_size = self.max_encoding_message_size;
12577                    let inner = self.inner.clone();
12578                    let fut = async move {
12579                        let method = CreateTeamSvc(inner);
12580                        let codec = tonic_prost::ProstCodec::default();
12581                        let mut grpc = tonic::server::Grpc::new(codec)
12582                            .apply_compression_config(
12583                                accept_compression_encodings,
12584                                send_compression_encodings,
12585                            )
12586                            .apply_max_message_size_config(
12587                                max_decoding_message_size,
12588                                max_encoding_message_size,
12589                            );
12590                        let res = grpc.unary(method, req).await;
12591                        Ok(res)
12592                    };
12593                    Box::pin(fut)
12594                }
12595                "/pidgr.v1.TeamService/GetTeam" => {
12596                    #[allow(non_camel_case_types)]
12597                    struct GetTeamSvc<T: TeamService>(pub Arc<T>);
12598                    impl<
12599                        T: TeamService,
12600                    > tonic::server::UnaryService<super::GetTeamRequest>
12601                    for GetTeamSvc<T> {
12602                        type Response = super::GetTeamResponse;
12603                        type Future = BoxFuture<
12604                            tonic::Response<Self::Response>,
12605                            tonic::Status,
12606                        >;
12607                        fn call(
12608                            &mut self,
12609                            request: tonic::Request<super::GetTeamRequest>,
12610                        ) -> Self::Future {
12611                            let inner = Arc::clone(&self.0);
12612                            let fut = async move {
12613                                <T as TeamService>::get_team(&inner, request).await
12614                            };
12615                            Box::pin(fut)
12616                        }
12617                    }
12618                    let accept_compression_encodings = self.accept_compression_encodings;
12619                    let send_compression_encodings = self.send_compression_encodings;
12620                    let max_decoding_message_size = self.max_decoding_message_size;
12621                    let max_encoding_message_size = self.max_encoding_message_size;
12622                    let inner = self.inner.clone();
12623                    let fut = async move {
12624                        let method = GetTeamSvc(inner);
12625                        let codec = tonic_prost::ProstCodec::default();
12626                        let mut grpc = tonic::server::Grpc::new(codec)
12627                            .apply_compression_config(
12628                                accept_compression_encodings,
12629                                send_compression_encodings,
12630                            )
12631                            .apply_max_message_size_config(
12632                                max_decoding_message_size,
12633                                max_encoding_message_size,
12634                            );
12635                        let res = grpc.unary(method, req).await;
12636                        Ok(res)
12637                    };
12638                    Box::pin(fut)
12639                }
12640                "/pidgr.v1.TeamService/ListTeams" => {
12641                    #[allow(non_camel_case_types)]
12642                    struct ListTeamsSvc<T: TeamService>(pub Arc<T>);
12643                    impl<
12644                        T: TeamService,
12645                    > tonic::server::UnaryService<super::ListTeamsRequest>
12646                    for ListTeamsSvc<T> {
12647                        type Response = super::ListTeamsResponse;
12648                        type Future = BoxFuture<
12649                            tonic::Response<Self::Response>,
12650                            tonic::Status,
12651                        >;
12652                        fn call(
12653                            &mut self,
12654                            request: tonic::Request<super::ListTeamsRequest>,
12655                        ) -> Self::Future {
12656                            let inner = Arc::clone(&self.0);
12657                            let fut = async move {
12658                                <T as TeamService>::list_teams(&inner, request).await
12659                            };
12660                            Box::pin(fut)
12661                        }
12662                    }
12663                    let accept_compression_encodings = self.accept_compression_encodings;
12664                    let send_compression_encodings = self.send_compression_encodings;
12665                    let max_decoding_message_size = self.max_decoding_message_size;
12666                    let max_encoding_message_size = self.max_encoding_message_size;
12667                    let inner = self.inner.clone();
12668                    let fut = async move {
12669                        let method = ListTeamsSvc(inner);
12670                        let codec = tonic_prost::ProstCodec::default();
12671                        let mut grpc = tonic::server::Grpc::new(codec)
12672                            .apply_compression_config(
12673                                accept_compression_encodings,
12674                                send_compression_encodings,
12675                            )
12676                            .apply_max_message_size_config(
12677                                max_decoding_message_size,
12678                                max_encoding_message_size,
12679                            );
12680                        let res = grpc.unary(method, req).await;
12681                        Ok(res)
12682                    };
12683                    Box::pin(fut)
12684                }
12685                "/pidgr.v1.TeamService/UpdateTeam" => {
12686                    #[allow(non_camel_case_types)]
12687                    struct UpdateTeamSvc<T: TeamService>(pub Arc<T>);
12688                    impl<
12689                        T: TeamService,
12690                    > tonic::server::UnaryService<super::UpdateTeamRequest>
12691                    for UpdateTeamSvc<T> {
12692                        type Response = super::UpdateTeamResponse;
12693                        type Future = BoxFuture<
12694                            tonic::Response<Self::Response>,
12695                            tonic::Status,
12696                        >;
12697                        fn call(
12698                            &mut self,
12699                            request: tonic::Request<super::UpdateTeamRequest>,
12700                        ) -> Self::Future {
12701                            let inner = Arc::clone(&self.0);
12702                            let fut = async move {
12703                                <T as TeamService>::update_team(&inner, request).await
12704                            };
12705                            Box::pin(fut)
12706                        }
12707                    }
12708                    let accept_compression_encodings = self.accept_compression_encodings;
12709                    let send_compression_encodings = self.send_compression_encodings;
12710                    let max_decoding_message_size = self.max_decoding_message_size;
12711                    let max_encoding_message_size = self.max_encoding_message_size;
12712                    let inner = self.inner.clone();
12713                    let fut = async move {
12714                        let method = UpdateTeamSvc(inner);
12715                        let codec = tonic_prost::ProstCodec::default();
12716                        let mut grpc = tonic::server::Grpc::new(codec)
12717                            .apply_compression_config(
12718                                accept_compression_encodings,
12719                                send_compression_encodings,
12720                            )
12721                            .apply_max_message_size_config(
12722                                max_decoding_message_size,
12723                                max_encoding_message_size,
12724                            );
12725                        let res = grpc.unary(method, req).await;
12726                        Ok(res)
12727                    };
12728                    Box::pin(fut)
12729                }
12730                "/pidgr.v1.TeamService/DeleteTeam" => {
12731                    #[allow(non_camel_case_types)]
12732                    struct DeleteTeamSvc<T: TeamService>(pub Arc<T>);
12733                    impl<
12734                        T: TeamService,
12735                    > tonic::server::UnaryService<super::DeleteTeamRequest>
12736                    for DeleteTeamSvc<T> {
12737                        type Response = super::DeleteTeamResponse;
12738                        type Future = BoxFuture<
12739                            tonic::Response<Self::Response>,
12740                            tonic::Status,
12741                        >;
12742                        fn call(
12743                            &mut self,
12744                            request: tonic::Request<super::DeleteTeamRequest>,
12745                        ) -> Self::Future {
12746                            let inner = Arc::clone(&self.0);
12747                            let fut = async move {
12748                                <T as TeamService>::delete_team(&inner, request).await
12749                            };
12750                            Box::pin(fut)
12751                        }
12752                    }
12753                    let accept_compression_encodings = self.accept_compression_encodings;
12754                    let send_compression_encodings = self.send_compression_encodings;
12755                    let max_decoding_message_size = self.max_decoding_message_size;
12756                    let max_encoding_message_size = self.max_encoding_message_size;
12757                    let inner = self.inner.clone();
12758                    let fut = async move {
12759                        let method = DeleteTeamSvc(inner);
12760                        let codec = tonic_prost::ProstCodec::default();
12761                        let mut grpc = tonic::server::Grpc::new(codec)
12762                            .apply_compression_config(
12763                                accept_compression_encodings,
12764                                send_compression_encodings,
12765                            )
12766                            .apply_max_message_size_config(
12767                                max_decoding_message_size,
12768                                max_encoding_message_size,
12769                            );
12770                        let res = grpc.unary(method, req).await;
12771                        Ok(res)
12772                    };
12773                    Box::pin(fut)
12774                }
12775                "/pidgr.v1.TeamService/AddTeamMembers" => {
12776                    #[allow(non_camel_case_types)]
12777                    struct AddTeamMembersSvc<T: TeamService>(pub Arc<T>);
12778                    impl<
12779                        T: TeamService,
12780                    > tonic::server::UnaryService<super::AddTeamMembersRequest>
12781                    for AddTeamMembersSvc<T> {
12782                        type Response = super::AddTeamMembersResponse;
12783                        type Future = BoxFuture<
12784                            tonic::Response<Self::Response>,
12785                            tonic::Status,
12786                        >;
12787                        fn call(
12788                            &mut self,
12789                            request: tonic::Request<super::AddTeamMembersRequest>,
12790                        ) -> Self::Future {
12791                            let inner = Arc::clone(&self.0);
12792                            let fut = async move {
12793                                <T as TeamService>::add_team_members(&inner, request).await
12794                            };
12795                            Box::pin(fut)
12796                        }
12797                    }
12798                    let accept_compression_encodings = self.accept_compression_encodings;
12799                    let send_compression_encodings = self.send_compression_encodings;
12800                    let max_decoding_message_size = self.max_decoding_message_size;
12801                    let max_encoding_message_size = self.max_encoding_message_size;
12802                    let inner = self.inner.clone();
12803                    let fut = async move {
12804                        let method = AddTeamMembersSvc(inner);
12805                        let codec = tonic_prost::ProstCodec::default();
12806                        let mut grpc = tonic::server::Grpc::new(codec)
12807                            .apply_compression_config(
12808                                accept_compression_encodings,
12809                                send_compression_encodings,
12810                            )
12811                            .apply_max_message_size_config(
12812                                max_decoding_message_size,
12813                                max_encoding_message_size,
12814                            );
12815                        let res = grpc.unary(method, req).await;
12816                        Ok(res)
12817                    };
12818                    Box::pin(fut)
12819                }
12820                "/pidgr.v1.TeamService/RemoveTeamMembers" => {
12821                    #[allow(non_camel_case_types)]
12822                    struct RemoveTeamMembersSvc<T: TeamService>(pub Arc<T>);
12823                    impl<
12824                        T: TeamService,
12825                    > tonic::server::UnaryService<super::RemoveTeamMembersRequest>
12826                    for RemoveTeamMembersSvc<T> {
12827                        type Response = super::RemoveTeamMembersResponse;
12828                        type Future = BoxFuture<
12829                            tonic::Response<Self::Response>,
12830                            tonic::Status,
12831                        >;
12832                        fn call(
12833                            &mut self,
12834                            request: tonic::Request<super::RemoveTeamMembersRequest>,
12835                        ) -> Self::Future {
12836                            let inner = Arc::clone(&self.0);
12837                            let fut = async move {
12838                                <T as TeamService>::remove_team_members(&inner, request)
12839                                    .await
12840                            };
12841                            Box::pin(fut)
12842                        }
12843                    }
12844                    let accept_compression_encodings = self.accept_compression_encodings;
12845                    let send_compression_encodings = self.send_compression_encodings;
12846                    let max_decoding_message_size = self.max_decoding_message_size;
12847                    let max_encoding_message_size = self.max_encoding_message_size;
12848                    let inner = self.inner.clone();
12849                    let fut = async move {
12850                        let method = RemoveTeamMembersSvc(inner);
12851                        let codec = tonic_prost::ProstCodec::default();
12852                        let mut grpc = tonic::server::Grpc::new(codec)
12853                            .apply_compression_config(
12854                                accept_compression_encodings,
12855                                send_compression_encodings,
12856                            )
12857                            .apply_max_message_size_config(
12858                                max_decoding_message_size,
12859                                max_encoding_message_size,
12860                            );
12861                        let res = grpc.unary(method, req).await;
12862                        Ok(res)
12863                    };
12864                    Box::pin(fut)
12865                }
12866                "/pidgr.v1.TeamService/ListTeamMembers" => {
12867                    #[allow(non_camel_case_types)]
12868                    struct ListTeamMembersSvc<T: TeamService>(pub Arc<T>);
12869                    impl<
12870                        T: TeamService,
12871                    > tonic::server::UnaryService<super::ListTeamMembersRequest>
12872                    for ListTeamMembersSvc<T> {
12873                        type Response = super::ListTeamMembersResponse;
12874                        type Future = BoxFuture<
12875                            tonic::Response<Self::Response>,
12876                            tonic::Status,
12877                        >;
12878                        fn call(
12879                            &mut self,
12880                            request: tonic::Request<super::ListTeamMembersRequest>,
12881                        ) -> Self::Future {
12882                            let inner = Arc::clone(&self.0);
12883                            let fut = async move {
12884                                <T as TeamService>::list_team_members(&inner, request).await
12885                            };
12886                            Box::pin(fut)
12887                        }
12888                    }
12889                    let accept_compression_encodings = self.accept_compression_encodings;
12890                    let send_compression_encodings = self.send_compression_encodings;
12891                    let max_decoding_message_size = self.max_decoding_message_size;
12892                    let max_encoding_message_size = self.max_encoding_message_size;
12893                    let inner = self.inner.clone();
12894                    let fut = async move {
12895                        let method = ListTeamMembersSvc(inner);
12896                        let codec = tonic_prost::ProstCodec::default();
12897                        let mut grpc = tonic::server::Grpc::new(codec)
12898                            .apply_compression_config(
12899                                accept_compression_encodings,
12900                                send_compression_encodings,
12901                            )
12902                            .apply_max_message_size_config(
12903                                max_decoding_message_size,
12904                                max_encoding_message_size,
12905                            );
12906                        let res = grpc.unary(method, req).await;
12907                        Ok(res)
12908                    };
12909                    Box::pin(fut)
12910                }
12911                _ => {
12912                    Box::pin(async move {
12913                        let mut response = http::Response::new(
12914                            tonic::body::Body::default(),
12915                        );
12916                        let headers = response.headers_mut();
12917                        headers
12918                            .insert(
12919                                tonic::Status::GRPC_STATUS,
12920                                (tonic::Code::Unimplemented as i32).into(),
12921                            );
12922                        headers
12923                            .insert(
12924                                http::header::CONTENT_TYPE,
12925                                tonic::metadata::GRPC_CONTENT_TYPE,
12926                            );
12927                        Ok(response)
12928                    })
12929                }
12930            }
12931        }
12932    }
12933    impl<T> Clone for TeamServiceServer<T> {
12934        fn clone(&self) -> Self {
12935            let inner = self.inner.clone();
12936            Self {
12937                inner,
12938                accept_compression_encodings: self.accept_compression_encodings,
12939                send_compression_encodings: self.send_compression_encodings,
12940                max_decoding_message_size: self.max_decoding_message_size,
12941                max_encoding_message_size: self.max_encoding_message_size,
12942            }
12943        }
12944    }
12945    /// Generated gRPC service name
12946    pub const SERVICE_NAME: &str = "pidgr.v1.TeamService";
12947    impl<T> tonic::server::NamedService for TeamServiceServer<T> {
12948        const NAME: &'static str = SERVICE_NAME;
12949    }
12950}
12951/// Generated client implementations.
12952pub mod template_service_client {
12953    #![allow(
12954        unused_variables,
12955        dead_code,
12956        missing_docs,
12957        clippy::wildcard_imports,
12958        clippy::let_unit_value,
12959    )]
12960    use tonic::codegen::*;
12961    use tonic::codegen::http::Uri;
12962    /** Manages versioned message templates used by campaigns.
12963 Templates are append-only — updates create new versions while preserving history.
12964*/
12965    #[derive(Debug, Clone)]
12966    pub struct TemplateServiceClient<T> {
12967        inner: tonic::client::Grpc<T>,
12968    }
12969    impl TemplateServiceClient<tonic::transport::Channel> {
12970        /// Attempt to create a new client by connecting to a given endpoint.
12971        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
12972        where
12973            D: TryInto<tonic::transport::Endpoint>,
12974            D::Error: Into<StdError>,
12975        {
12976            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
12977            Ok(Self::new(conn))
12978        }
12979    }
12980    impl<T> TemplateServiceClient<T>
12981    where
12982        T: tonic::client::GrpcService<tonic::body::Body>,
12983        T::Error: Into<StdError>,
12984        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
12985        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
12986    {
12987        pub fn new(inner: T) -> Self {
12988            let inner = tonic::client::Grpc::new(inner);
12989            Self { inner }
12990        }
12991        pub fn with_origin(inner: T, origin: Uri) -> Self {
12992            let inner = tonic::client::Grpc::with_origin(inner, origin);
12993            Self { inner }
12994        }
12995        pub fn with_interceptor<F>(
12996            inner: T,
12997            interceptor: F,
12998        ) -> TemplateServiceClient<InterceptedService<T, F>>
12999        where
13000            F: tonic::service::Interceptor,
13001            T::ResponseBody: Default,
13002            T: tonic::codegen::Service<
13003                http::Request<tonic::body::Body>,
13004                Response = http::Response<
13005                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
13006                >,
13007            >,
13008            <T as tonic::codegen::Service<
13009                http::Request<tonic::body::Body>,
13010            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
13011        {
13012            TemplateServiceClient::new(InterceptedService::new(inner, interceptor))
13013        }
13014        /// Compress requests with the given encoding.
13015        ///
13016        /// This requires the server to support it otherwise it might respond with an
13017        /// error.
13018        #[must_use]
13019        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13020            self.inner = self.inner.send_compressed(encoding);
13021            self
13022        }
13023        /// Enable decompressing responses.
13024        #[must_use]
13025        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13026            self.inner = self.inner.accept_compressed(encoding);
13027            self
13028        }
13029        /// Limits the maximum size of a decoded message.
13030        ///
13031        /// Default: `4MB`
13032        #[must_use]
13033        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13034            self.inner = self.inner.max_decoding_message_size(limit);
13035            self
13036        }
13037        /// Limits the maximum size of an encoded message.
13038        ///
13039        /// Default: `usize::MAX`
13040        #[must_use]
13041        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13042            self.inner = self.inner.max_encoding_message_size(limit);
13043            self
13044        }
13045        /** Create a new template with a body and variable definitions.
13046 Authorization: Requires MANAGER+ role.
13047*/
13048        pub async fn create_template(
13049            &mut self,
13050            request: impl tonic::IntoRequest<super::CreateTemplateRequest>,
13051        ) -> std::result::Result<
13052            tonic::Response<super::CreateTemplateResponse>,
13053            tonic::Status,
13054        > {
13055            self.inner
13056                .ready()
13057                .await
13058                .map_err(|e| {
13059                    tonic::Status::unknown(
13060                        format!("Service was not ready: {}", e.into()),
13061                    )
13062                })?;
13063            let codec = tonic_prost::ProstCodec::default();
13064            let path = http::uri::PathAndQuery::from_static(
13065                "/pidgr.v1.TemplateService/CreateTemplate",
13066            );
13067            let mut req = request.into_request();
13068            req.extensions_mut()
13069                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "CreateTemplate"));
13070            self.inner.unary(req, path, codec).await
13071        }
13072        /** Update an existing template, creating a new version.
13073 Authorization: Requires MANAGER+ role.
13074*/
13075        pub async fn update_template(
13076            &mut self,
13077            request: impl tonic::IntoRequest<super::UpdateTemplateRequest>,
13078        ) -> std::result::Result<
13079            tonic::Response<super::UpdateTemplateResponse>,
13080            tonic::Status,
13081        > {
13082            self.inner
13083                .ready()
13084                .await
13085                .map_err(|e| {
13086                    tonic::Status::unknown(
13087                        format!("Service was not ready: {}", e.into()),
13088                    )
13089                })?;
13090            let codec = tonic_prost::ProstCodec::default();
13091            let path = http::uri::PathAndQuery::from_static(
13092                "/pidgr.v1.TemplateService/UpdateTemplate",
13093            );
13094            let mut req = request.into_request();
13095            req.extensions_mut()
13096                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "UpdateTemplate"));
13097            self.inner.unary(req, path, codec).await
13098        }
13099        /** Retrieve a specific template by ID and optional version.
13100 Authorization: Authenticated user within the organization.
13101*/
13102        pub async fn get_template(
13103            &mut self,
13104            request: impl tonic::IntoRequest<super::GetTemplateRequest>,
13105        ) -> std::result::Result<
13106            tonic::Response<super::GetTemplateResponse>,
13107            tonic::Status,
13108        > {
13109            self.inner
13110                .ready()
13111                .await
13112                .map_err(|e| {
13113                    tonic::Status::unknown(
13114                        format!("Service was not ready: {}", e.into()),
13115                    )
13116                })?;
13117            let codec = tonic_prost::ProstCodec::default();
13118            let path = http::uri::PathAndQuery::from_static(
13119                "/pidgr.v1.TemplateService/GetTemplate",
13120            );
13121            let mut req = request.into_request();
13122            req.extensions_mut()
13123                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "GetTemplate"));
13124            self.inner.unary(req, path, codec).await
13125        }
13126        /** List all templates for the organization with pagination.
13127 Authorization: Authenticated user within the organization.
13128*/
13129        pub async fn list_templates(
13130            &mut self,
13131            request: impl tonic::IntoRequest<super::ListTemplatesRequest>,
13132        ) -> std::result::Result<
13133            tonic::Response<super::ListTemplatesResponse>,
13134            tonic::Status,
13135        > {
13136            self.inner
13137                .ready()
13138                .await
13139                .map_err(|e| {
13140                    tonic::Status::unknown(
13141                        format!("Service was not ready: {}", e.into()),
13142                    )
13143                })?;
13144            let codec = tonic_prost::ProstCodec::default();
13145            let path = http::uri::PathAndQuery::from_static(
13146                "/pidgr.v1.TemplateService/ListTemplates",
13147            );
13148            let mut req = request.into_request();
13149            req.extensions_mut()
13150                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "ListTemplates"));
13151            self.inner.unary(req, path, codec).await
13152        }
13153        /** Create a locale-specific translation of a template.
13154 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
13155*/
13156        pub async fn create_template_translation(
13157            &mut self,
13158            request: impl tonic::IntoRequest<super::CreateTemplateTranslationRequest>,
13159        ) -> std::result::Result<
13160            tonic::Response<super::CreateTemplateTranslationResponse>,
13161            tonic::Status,
13162        > {
13163            self.inner
13164                .ready()
13165                .await
13166                .map_err(|e| {
13167                    tonic::Status::unknown(
13168                        format!("Service was not ready: {}", e.into()),
13169                    )
13170                })?;
13171            let codec = tonic_prost::ProstCodec::default();
13172            let path = http::uri::PathAndQuery::from_static(
13173                "/pidgr.v1.TemplateService/CreateTemplateTranslation",
13174            );
13175            let mut req = request.into_request();
13176            req.extensions_mut()
13177                .insert(
13178                    GrpcMethod::new(
13179                        "pidgr.v1.TemplateService",
13180                        "CreateTemplateTranslation",
13181                    ),
13182                );
13183            self.inner.unary(req, path, codec).await
13184        }
13185        /** Update an existing template translation.
13186 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
13187*/
13188        pub async fn update_template_translation(
13189            &mut self,
13190            request: impl tonic::IntoRequest<super::UpdateTemplateTranslationRequest>,
13191        ) -> std::result::Result<
13192            tonic::Response<super::UpdateTemplateTranslationResponse>,
13193            tonic::Status,
13194        > {
13195            self.inner
13196                .ready()
13197                .await
13198                .map_err(|e| {
13199                    tonic::Status::unknown(
13200                        format!("Service was not ready: {}", e.into()),
13201                    )
13202                })?;
13203            let codec = tonic_prost::ProstCodec::default();
13204            let path = http::uri::PathAndQuery::from_static(
13205                "/pidgr.v1.TemplateService/UpdateTemplateTranslation",
13206            );
13207            let mut req = request.into_request();
13208            req.extensions_mut()
13209                .insert(
13210                    GrpcMethod::new(
13211                        "pidgr.v1.TemplateService",
13212                        "UpdateTemplateTranslation",
13213                    ),
13214                );
13215            self.inner.unary(req, path, codec).await
13216        }
13217        /** List all translations for a template version.
13218 Authorization: Requires PERMISSION_TEMPLATES_READ.
13219*/
13220        pub async fn list_template_translations(
13221            &mut self,
13222            request: impl tonic::IntoRequest<super::ListTemplateTranslationsRequest>,
13223        ) -> std::result::Result<
13224            tonic::Response<super::ListTemplateTranslationsResponse>,
13225            tonic::Status,
13226        > {
13227            self.inner
13228                .ready()
13229                .await
13230                .map_err(|e| {
13231                    tonic::Status::unknown(
13232                        format!("Service was not ready: {}", e.into()),
13233                    )
13234                })?;
13235            let codec = tonic_prost::ProstCodec::default();
13236            let path = http::uri::PathAndQuery::from_static(
13237                "/pidgr.v1.TemplateService/ListTemplateTranslations",
13238            );
13239            let mut req = request.into_request();
13240            req.extensions_mut()
13241                .insert(
13242                    GrpcMethod::new(
13243                        "pidgr.v1.TemplateService",
13244                        "ListTemplateTranslations",
13245                    ),
13246                );
13247            self.inner.unary(req, path, codec).await
13248        }
13249        /** Approve a template translation for use in campaigns.
13250 Authorization: Requires PERMISSION_TEMPLATES_REVIEW.
13251*/
13252        pub async fn approve_template_translation(
13253            &mut self,
13254            request: impl tonic::IntoRequest<super::ApproveTemplateTranslationRequest>,
13255        ) -> std::result::Result<
13256            tonic::Response<super::ApproveTemplateTranslationResponse>,
13257            tonic::Status,
13258        > {
13259            self.inner
13260                .ready()
13261                .await
13262                .map_err(|e| {
13263                    tonic::Status::unknown(
13264                        format!("Service was not ready: {}", e.into()),
13265                    )
13266                })?;
13267            let codec = tonic_prost::ProstCodec::default();
13268            let path = http::uri::PathAndQuery::from_static(
13269                "/pidgr.v1.TemplateService/ApproveTemplateTranslation",
13270            );
13271            let mut req = request.into_request();
13272            req.extensions_mut()
13273                .insert(
13274                    GrpcMethod::new(
13275                        "pidgr.v1.TemplateService",
13276                        "ApproveTemplateTranslation",
13277                    ),
13278                );
13279            self.inner.unary(req, path, codec).await
13280        }
13281    }
13282}
13283/// Generated server implementations.
13284pub mod template_service_server {
13285    #![allow(
13286        unused_variables,
13287        dead_code,
13288        missing_docs,
13289        clippy::wildcard_imports,
13290        clippy::let_unit_value,
13291    )]
13292    use tonic::codegen::*;
13293    /// Generated trait containing gRPC methods that should be implemented for use with TemplateServiceServer.
13294    #[async_trait]
13295    pub trait TemplateService: std::marker::Send + std::marker::Sync + 'static {
13296        /** Create a new template with a body and variable definitions.
13297 Authorization: Requires MANAGER+ role.
13298*/
13299        async fn create_template(
13300            &self,
13301            request: tonic::Request<super::CreateTemplateRequest>,
13302        ) -> std::result::Result<
13303            tonic::Response<super::CreateTemplateResponse>,
13304            tonic::Status,
13305        >;
13306        /** Update an existing template, creating a new version.
13307 Authorization: Requires MANAGER+ role.
13308*/
13309        async fn update_template(
13310            &self,
13311            request: tonic::Request<super::UpdateTemplateRequest>,
13312        ) -> std::result::Result<
13313            tonic::Response<super::UpdateTemplateResponse>,
13314            tonic::Status,
13315        >;
13316        /** Retrieve a specific template by ID and optional version.
13317 Authorization: Authenticated user within the organization.
13318*/
13319        async fn get_template(
13320            &self,
13321            request: tonic::Request<super::GetTemplateRequest>,
13322        ) -> std::result::Result<
13323            tonic::Response<super::GetTemplateResponse>,
13324            tonic::Status,
13325        >;
13326        /** List all templates for the organization with pagination.
13327 Authorization: Authenticated user within the organization.
13328*/
13329        async fn list_templates(
13330            &self,
13331            request: tonic::Request<super::ListTemplatesRequest>,
13332        ) -> std::result::Result<
13333            tonic::Response<super::ListTemplatesResponse>,
13334            tonic::Status,
13335        >;
13336        /** Create a locale-specific translation of a template.
13337 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
13338*/
13339        async fn create_template_translation(
13340            &self,
13341            request: tonic::Request<super::CreateTemplateTranslationRequest>,
13342        ) -> std::result::Result<
13343            tonic::Response<super::CreateTemplateTranslationResponse>,
13344            tonic::Status,
13345        >;
13346        /** Update an existing template translation.
13347 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
13348*/
13349        async fn update_template_translation(
13350            &self,
13351            request: tonic::Request<super::UpdateTemplateTranslationRequest>,
13352        ) -> std::result::Result<
13353            tonic::Response<super::UpdateTemplateTranslationResponse>,
13354            tonic::Status,
13355        >;
13356        /** List all translations for a template version.
13357 Authorization: Requires PERMISSION_TEMPLATES_READ.
13358*/
13359        async fn list_template_translations(
13360            &self,
13361            request: tonic::Request<super::ListTemplateTranslationsRequest>,
13362        ) -> std::result::Result<
13363            tonic::Response<super::ListTemplateTranslationsResponse>,
13364            tonic::Status,
13365        >;
13366        /** Approve a template translation for use in campaigns.
13367 Authorization: Requires PERMISSION_TEMPLATES_REVIEW.
13368*/
13369        async fn approve_template_translation(
13370            &self,
13371            request: tonic::Request<super::ApproveTemplateTranslationRequest>,
13372        ) -> std::result::Result<
13373            tonic::Response<super::ApproveTemplateTranslationResponse>,
13374            tonic::Status,
13375        >;
13376    }
13377    /** Manages versioned message templates used by campaigns.
13378 Templates are append-only — updates create new versions while preserving history.
13379*/
13380    #[derive(Debug)]
13381    pub struct TemplateServiceServer<T> {
13382        inner: Arc<T>,
13383        accept_compression_encodings: EnabledCompressionEncodings,
13384        send_compression_encodings: EnabledCompressionEncodings,
13385        max_decoding_message_size: Option<usize>,
13386        max_encoding_message_size: Option<usize>,
13387    }
13388    impl<T> TemplateServiceServer<T> {
13389        pub fn new(inner: T) -> Self {
13390            Self::from_arc(Arc::new(inner))
13391        }
13392        pub fn from_arc(inner: Arc<T>) -> Self {
13393            Self {
13394                inner,
13395                accept_compression_encodings: Default::default(),
13396                send_compression_encodings: Default::default(),
13397                max_decoding_message_size: None,
13398                max_encoding_message_size: None,
13399            }
13400        }
13401        pub fn with_interceptor<F>(
13402            inner: T,
13403            interceptor: F,
13404        ) -> InterceptedService<Self, F>
13405        where
13406            F: tonic::service::Interceptor,
13407        {
13408            InterceptedService::new(Self::new(inner), interceptor)
13409        }
13410        /// Enable decompressing requests with the given encoding.
13411        #[must_use]
13412        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13413            self.accept_compression_encodings.enable(encoding);
13414            self
13415        }
13416        /// Compress responses with the given encoding, if the client supports it.
13417        #[must_use]
13418        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13419            self.send_compression_encodings.enable(encoding);
13420            self
13421        }
13422        /// Limits the maximum size of a decoded message.
13423        ///
13424        /// Default: `4MB`
13425        #[must_use]
13426        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13427            self.max_decoding_message_size = Some(limit);
13428            self
13429        }
13430        /// Limits the maximum size of an encoded message.
13431        ///
13432        /// Default: `usize::MAX`
13433        #[must_use]
13434        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13435            self.max_encoding_message_size = Some(limit);
13436            self
13437        }
13438    }
13439    impl<T, B> tonic::codegen::Service<http::Request<B>> for TemplateServiceServer<T>
13440    where
13441        T: TemplateService,
13442        B: Body + std::marker::Send + 'static,
13443        B::Error: Into<StdError> + std::marker::Send + 'static,
13444    {
13445        type Response = http::Response<tonic::body::Body>;
13446        type Error = std::convert::Infallible;
13447        type Future = BoxFuture<Self::Response, Self::Error>;
13448        fn poll_ready(
13449            &mut self,
13450            _cx: &mut Context<'_>,
13451        ) -> Poll<std::result::Result<(), Self::Error>> {
13452            Poll::Ready(Ok(()))
13453        }
13454        fn call(&mut self, req: http::Request<B>) -> Self::Future {
13455            match req.uri().path() {
13456                "/pidgr.v1.TemplateService/CreateTemplate" => {
13457                    #[allow(non_camel_case_types)]
13458                    struct CreateTemplateSvc<T: TemplateService>(pub Arc<T>);
13459                    impl<
13460                        T: TemplateService,
13461                    > tonic::server::UnaryService<super::CreateTemplateRequest>
13462                    for CreateTemplateSvc<T> {
13463                        type Response = super::CreateTemplateResponse;
13464                        type Future = BoxFuture<
13465                            tonic::Response<Self::Response>,
13466                            tonic::Status,
13467                        >;
13468                        fn call(
13469                            &mut self,
13470                            request: tonic::Request<super::CreateTemplateRequest>,
13471                        ) -> Self::Future {
13472                            let inner = Arc::clone(&self.0);
13473                            let fut = async move {
13474                                <T as TemplateService>::create_template(&inner, request)
13475                                    .await
13476                            };
13477                            Box::pin(fut)
13478                        }
13479                    }
13480                    let accept_compression_encodings = self.accept_compression_encodings;
13481                    let send_compression_encodings = self.send_compression_encodings;
13482                    let max_decoding_message_size = self.max_decoding_message_size;
13483                    let max_encoding_message_size = self.max_encoding_message_size;
13484                    let inner = self.inner.clone();
13485                    let fut = async move {
13486                        let method = CreateTemplateSvc(inner);
13487                        let codec = tonic_prost::ProstCodec::default();
13488                        let mut grpc = tonic::server::Grpc::new(codec)
13489                            .apply_compression_config(
13490                                accept_compression_encodings,
13491                                send_compression_encodings,
13492                            )
13493                            .apply_max_message_size_config(
13494                                max_decoding_message_size,
13495                                max_encoding_message_size,
13496                            );
13497                        let res = grpc.unary(method, req).await;
13498                        Ok(res)
13499                    };
13500                    Box::pin(fut)
13501                }
13502                "/pidgr.v1.TemplateService/UpdateTemplate" => {
13503                    #[allow(non_camel_case_types)]
13504                    struct UpdateTemplateSvc<T: TemplateService>(pub Arc<T>);
13505                    impl<
13506                        T: TemplateService,
13507                    > tonic::server::UnaryService<super::UpdateTemplateRequest>
13508                    for UpdateTemplateSvc<T> {
13509                        type Response = super::UpdateTemplateResponse;
13510                        type Future = BoxFuture<
13511                            tonic::Response<Self::Response>,
13512                            tonic::Status,
13513                        >;
13514                        fn call(
13515                            &mut self,
13516                            request: tonic::Request<super::UpdateTemplateRequest>,
13517                        ) -> Self::Future {
13518                            let inner = Arc::clone(&self.0);
13519                            let fut = async move {
13520                                <T as TemplateService>::update_template(&inner, request)
13521                                    .await
13522                            };
13523                            Box::pin(fut)
13524                        }
13525                    }
13526                    let accept_compression_encodings = self.accept_compression_encodings;
13527                    let send_compression_encodings = self.send_compression_encodings;
13528                    let max_decoding_message_size = self.max_decoding_message_size;
13529                    let max_encoding_message_size = self.max_encoding_message_size;
13530                    let inner = self.inner.clone();
13531                    let fut = async move {
13532                        let method = UpdateTemplateSvc(inner);
13533                        let codec = tonic_prost::ProstCodec::default();
13534                        let mut grpc = tonic::server::Grpc::new(codec)
13535                            .apply_compression_config(
13536                                accept_compression_encodings,
13537                                send_compression_encodings,
13538                            )
13539                            .apply_max_message_size_config(
13540                                max_decoding_message_size,
13541                                max_encoding_message_size,
13542                            );
13543                        let res = grpc.unary(method, req).await;
13544                        Ok(res)
13545                    };
13546                    Box::pin(fut)
13547                }
13548                "/pidgr.v1.TemplateService/GetTemplate" => {
13549                    #[allow(non_camel_case_types)]
13550                    struct GetTemplateSvc<T: TemplateService>(pub Arc<T>);
13551                    impl<
13552                        T: TemplateService,
13553                    > tonic::server::UnaryService<super::GetTemplateRequest>
13554                    for GetTemplateSvc<T> {
13555                        type Response = super::GetTemplateResponse;
13556                        type Future = BoxFuture<
13557                            tonic::Response<Self::Response>,
13558                            tonic::Status,
13559                        >;
13560                        fn call(
13561                            &mut self,
13562                            request: tonic::Request<super::GetTemplateRequest>,
13563                        ) -> Self::Future {
13564                            let inner = Arc::clone(&self.0);
13565                            let fut = async move {
13566                                <T as TemplateService>::get_template(&inner, request).await
13567                            };
13568                            Box::pin(fut)
13569                        }
13570                    }
13571                    let accept_compression_encodings = self.accept_compression_encodings;
13572                    let send_compression_encodings = self.send_compression_encodings;
13573                    let max_decoding_message_size = self.max_decoding_message_size;
13574                    let max_encoding_message_size = self.max_encoding_message_size;
13575                    let inner = self.inner.clone();
13576                    let fut = async move {
13577                        let method = GetTemplateSvc(inner);
13578                        let codec = tonic_prost::ProstCodec::default();
13579                        let mut grpc = tonic::server::Grpc::new(codec)
13580                            .apply_compression_config(
13581                                accept_compression_encodings,
13582                                send_compression_encodings,
13583                            )
13584                            .apply_max_message_size_config(
13585                                max_decoding_message_size,
13586                                max_encoding_message_size,
13587                            );
13588                        let res = grpc.unary(method, req).await;
13589                        Ok(res)
13590                    };
13591                    Box::pin(fut)
13592                }
13593                "/pidgr.v1.TemplateService/ListTemplates" => {
13594                    #[allow(non_camel_case_types)]
13595                    struct ListTemplatesSvc<T: TemplateService>(pub Arc<T>);
13596                    impl<
13597                        T: TemplateService,
13598                    > tonic::server::UnaryService<super::ListTemplatesRequest>
13599                    for ListTemplatesSvc<T> {
13600                        type Response = super::ListTemplatesResponse;
13601                        type Future = BoxFuture<
13602                            tonic::Response<Self::Response>,
13603                            tonic::Status,
13604                        >;
13605                        fn call(
13606                            &mut self,
13607                            request: tonic::Request<super::ListTemplatesRequest>,
13608                        ) -> Self::Future {
13609                            let inner = Arc::clone(&self.0);
13610                            let fut = async move {
13611                                <T as TemplateService>::list_templates(&inner, request)
13612                                    .await
13613                            };
13614                            Box::pin(fut)
13615                        }
13616                    }
13617                    let accept_compression_encodings = self.accept_compression_encodings;
13618                    let send_compression_encodings = self.send_compression_encodings;
13619                    let max_decoding_message_size = self.max_decoding_message_size;
13620                    let max_encoding_message_size = self.max_encoding_message_size;
13621                    let inner = self.inner.clone();
13622                    let fut = async move {
13623                        let method = ListTemplatesSvc(inner);
13624                        let codec = tonic_prost::ProstCodec::default();
13625                        let mut grpc = tonic::server::Grpc::new(codec)
13626                            .apply_compression_config(
13627                                accept_compression_encodings,
13628                                send_compression_encodings,
13629                            )
13630                            .apply_max_message_size_config(
13631                                max_decoding_message_size,
13632                                max_encoding_message_size,
13633                            );
13634                        let res = grpc.unary(method, req).await;
13635                        Ok(res)
13636                    };
13637                    Box::pin(fut)
13638                }
13639                "/pidgr.v1.TemplateService/CreateTemplateTranslation" => {
13640                    #[allow(non_camel_case_types)]
13641                    struct CreateTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
13642                    impl<
13643                        T: TemplateService,
13644                    > tonic::server::UnaryService<
13645                        super::CreateTemplateTranslationRequest,
13646                    > for CreateTemplateTranslationSvc<T> {
13647                        type Response = super::CreateTemplateTranslationResponse;
13648                        type Future = BoxFuture<
13649                            tonic::Response<Self::Response>,
13650                            tonic::Status,
13651                        >;
13652                        fn call(
13653                            &mut self,
13654                            request: tonic::Request<
13655                                super::CreateTemplateTranslationRequest,
13656                            >,
13657                        ) -> Self::Future {
13658                            let inner = Arc::clone(&self.0);
13659                            let fut = async move {
13660                                <T as TemplateService>::create_template_translation(
13661                                        &inner,
13662                                        request,
13663                                    )
13664                                    .await
13665                            };
13666                            Box::pin(fut)
13667                        }
13668                    }
13669                    let accept_compression_encodings = self.accept_compression_encodings;
13670                    let send_compression_encodings = self.send_compression_encodings;
13671                    let max_decoding_message_size = self.max_decoding_message_size;
13672                    let max_encoding_message_size = self.max_encoding_message_size;
13673                    let inner = self.inner.clone();
13674                    let fut = async move {
13675                        let method = CreateTemplateTranslationSvc(inner);
13676                        let codec = tonic_prost::ProstCodec::default();
13677                        let mut grpc = tonic::server::Grpc::new(codec)
13678                            .apply_compression_config(
13679                                accept_compression_encodings,
13680                                send_compression_encodings,
13681                            )
13682                            .apply_max_message_size_config(
13683                                max_decoding_message_size,
13684                                max_encoding_message_size,
13685                            );
13686                        let res = grpc.unary(method, req).await;
13687                        Ok(res)
13688                    };
13689                    Box::pin(fut)
13690                }
13691                "/pidgr.v1.TemplateService/UpdateTemplateTranslation" => {
13692                    #[allow(non_camel_case_types)]
13693                    struct UpdateTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
13694                    impl<
13695                        T: TemplateService,
13696                    > tonic::server::UnaryService<
13697                        super::UpdateTemplateTranslationRequest,
13698                    > for UpdateTemplateTranslationSvc<T> {
13699                        type Response = super::UpdateTemplateTranslationResponse;
13700                        type Future = BoxFuture<
13701                            tonic::Response<Self::Response>,
13702                            tonic::Status,
13703                        >;
13704                        fn call(
13705                            &mut self,
13706                            request: tonic::Request<
13707                                super::UpdateTemplateTranslationRequest,
13708                            >,
13709                        ) -> Self::Future {
13710                            let inner = Arc::clone(&self.0);
13711                            let fut = async move {
13712                                <T as TemplateService>::update_template_translation(
13713                                        &inner,
13714                                        request,
13715                                    )
13716                                    .await
13717                            };
13718                            Box::pin(fut)
13719                        }
13720                    }
13721                    let accept_compression_encodings = self.accept_compression_encodings;
13722                    let send_compression_encodings = self.send_compression_encodings;
13723                    let max_decoding_message_size = self.max_decoding_message_size;
13724                    let max_encoding_message_size = self.max_encoding_message_size;
13725                    let inner = self.inner.clone();
13726                    let fut = async move {
13727                        let method = UpdateTemplateTranslationSvc(inner);
13728                        let codec = tonic_prost::ProstCodec::default();
13729                        let mut grpc = tonic::server::Grpc::new(codec)
13730                            .apply_compression_config(
13731                                accept_compression_encodings,
13732                                send_compression_encodings,
13733                            )
13734                            .apply_max_message_size_config(
13735                                max_decoding_message_size,
13736                                max_encoding_message_size,
13737                            );
13738                        let res = grpc.unary(method, req).await;
13739                        Ok(res)
13740                    };
13741                    Box::pin(fut)
13742                }
13743                "/pidgr.v1.TemplateService/ListTemplateTranslations" => {
13744                    #[allow(non_camel_case_types)]
13745                    struct ListTemplateTranslationsSvc<T: TemplateService>(pub Arc<T>);
13746                    impl<
13747                        T: TemplateService,
13748                    > tonic::server::UnaryService<super::ListTemplateTranslationsRequest>
13749                    for ListTemplateTranslationsSvc<T> {
13750                        type Response = super::ListTemplateTranslationsResponse;
13751                        type Future = BoxFuture<
13752                            tonic::Response<Self::Response>,
13753                            tonic::Status,
13754                        >;
13755                        fn call(
13756                            &mut self,
13757                            request: tonic::Request<
13758                                super::ListTemplateTranslationsRequest,
13759                            >,
13760                        ) -> Self::Future {
13761                            let inner = Arc::clone(&self.0);
13762                            let fut = async move {
13763                                <T as TemplateService>::list_template_translations(
13764                                        &inner,
13765                                        request,
13766                                    )
13767                                    .await
13768                            };
13769                            Box::pin(fut)
13770                        }
13771                    }
13772                    let accept_compression_encodings = self.accept_compression_encodings;
13773                    let send_compression_encodings = self.send_compression_encodings;
13774                    let max_decoding_message_size = self.max_decoding_message_size;
13775                    let max_encoding_message_size = self.max_encoding_message_size;
13776                    let inner = self.inner.clone();
13777                    let fut = async move {
13778                        let method = ListTemplateTranslationsSvc(inner);
13779                        let codec = tonic_prost::ProstCodec::default();
13780                        let mut grpc = tonic::server::Grpc::new(codec)
13781                            .apply_compression_config(
13782                                accept_compression_encodings,
13783                                send_compression_encodings,
13784                            )
13785                            .apply_max_message_size_config(
13786                                max_decoding_message_size,
13787                                max_encoding_message_size,
13788                            );
13789                        let res = grpc.unary(method, req).await;
13790                        Ok(res)
13791                    };
13792                    Box::pin(fut)
13793                }
13794                "/pidgr.v1.TemplateService/ApproveTemplateTranslation" => {
13795                    #[allow(non_camel_case_types)]
13796                    struct ApproveTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
13797                    impl<
13798                        T: TemplateService,
13799                    > tonic::server::UnaryService<
13800                        super::ApproveTemplateTranslationRequest,
13801                    > for ApproveTemplateTranslationSvc<T> {
13802                        type Response = super::ApproveTemplateTranslationResponse;
13803                        type Future = BoxFuture<
13804                            tonic::Response<Self::Response>,
13805                            tonic::Status,
13806                        >;
13807                        fn call(
13808                            &mut self,
13809                            request: tonic::Request<
13810                                super::ApproveTemplateTranslationRequest,
13811                            >,
13812                        ) -> Self::Future {
13813                            let inner = Arc::clone(&self.0);
13814                            let fut = async move {
13815                                <T as TemplateService>::approve_template_translation(
13816                                        &inner,
13817                                        request,
13818                                    )
13819                                    .await
13820                            };
13821                            Box::pin(fut)
13822                        }
13823                    }
13824                    let accept_compression_encodings = self.accept_compression_encodings;
13825                    let send_compression_encodings = self.send_compression_encodings;
13826                    let max_decoding_message_size = self.max_decoding_message_size;
13827                    let max_encoding_message_size = self.max_encoding_message_size;
13828                    let inner = self.inner.clone();
13829                    let fut = async move {
13830                        let method = ApproveTemplateTranslationSvc(inner);
13831                        let codec = tonic_prost::ProstCodec::default();
13832                        let mut grpc = tonic::server::Grpc::new(codec)
13833                            .apply_compression_config(
13834                                accept_compression_encodings,
13835                                send_compression_encodings,
13836                            )
13837                            .apply_max_message_size_config(
13838                                max_decoding_message_size,
13839                                max_encoding_message_size,
13840                            );
13841                        let res = grpc.unary(method, req).await;
13842                        Ok(res)
13843                    };
13844                    Box::pin(fut)
13845                }
13846                _ => {
13847                    Box::pin(async move {
13848                        let mut response = http::Response::new(
13849                            tonic::body::Body::default(),
13850                        );
13851                        let headers = response.headers_mut();
13852                        headers
13853                            .insert(
13854                                tonic::Status::GRPC_STATUS,
13855                                (tonic::Code::Unimplemented as i32).into(),
13856                            );
13857                        headers
13858                            .insert(
13859                                http::header::CONTENT_TYPE,
13860                                tonic::metadata::GRPC_CONTENT_TYPE,
13861                            );
13862                        Ok(response)
13863                    })
13864                }
13865            }
13866        }
13867    }
13868    impl<T> Clone for TemplateServiceServer<T> {
13869        fn clone(&self) -> Self {
13870            let inner = self.inner.clone();
13871            Self {
13872                inner,
13873                accept_compression_encodings: self.accept_compression_encodings,
13874                send_compression_encodings: self.send_compression_encodings,
13875                max_decoding_message_size: self.max_decoding_message_size,
13876                max_encoding_message_size: self.max_encoding_message_size,
13877            }
13878        }
13879    }
13880    /// Generated gRPC service name
13881    pub const SERVICE_NAME: &str = "pidgr.v1.TemplateService";
13882    impl<T> tonic::server::NamedService for TemplateServiceServer<T> {
13883        const NAME: &'static str = SERVICE_NAME;
13884    }
13885}