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        /** Break down a campaign's recipients by current archetype membership
3069 and return ack-rate per bucket, with k-anonymity gate applied.
3070 Only valid for campaigns whose originating_archetype is set.
3071 Authorization: Authenticated user within the organization.
3072*/
3073        pub async fn get_campaign_archetype_breakdown(
3074            &mut self,
3075            request: impl tonic::IntoRequest<super::GetCampaignArchetypeBreakdownRequest>,
3076        ) -> std::result::Result<
3077            tonic::Response<super::GetCampaignArchetypeBreakdownResponse>,
3078            tonic::Status,
3079        > {
3080            self.inner
3081                .ready()
3082                .await
3083                .map_err(|e| {
3084                    tonic::Status::unknown(
3085                        format!("Service was not ready: {}", e.into()),
3086                    )
3087                })?;
3088            let codec = tonic_prost::ProstCodec::default();
3089            let path = http::uri::PathAndQuery::from_static(
3090                "/pidgr.v1.CampaignService/GetCampaignArchetypeBreakdown",
3091            );
3092            let mut req = request.into_request();
3093            req.extensions_mut()
3094                .insert(
3095                    GrpcMethod::new(
3096                        "pidgr.v1.CampaignService",
3097                        "GetCampaignArchetypeBreakdown",
3098                    ),
3099                );
3100            self.inner.unary(req, path, codec).await
3101        }
3102    }
3103}
3104/// Generated server implementations.
3105pub mod campaign_service_server {
3106    #![allow(
3107        unused_variables,
3108        dead_code,
3109        missing_docs,
3110        clippy::wildcard_imports,
3111        clippy::let_unit_value,
3112    )]
3113    use tonic::codegen::*;
3114    /// Generated trait containing gRPC methods that should be implemented for use with CampaignServiceServer.
3115    #[async_trait]
3116    pub trait CampaignService: std::marker::Send + std::marker::Sync + 'static {
3117        /** Create a new campaign with a template, audience, and workflow.
3118 Authorization: Requires MANAGER+ role.
3119*/
3120        async fn create_campaign(
3121            &self,
3122            request: tonic::Request<super::CreateCampaignRequest>,
3123        ) -> std::result::Result<
3124            tonic::Response<super::CreateCampaignResponse>,
3125            tonic::Status,
3126        >;
3127        /** Start a created campaign, triggering its workflow execution via the orchestration engine.
3128 Authorization: Requires MANAGER+ role.
3129*/
3130        async fn start_campaign(
3131            &self,
3132            request: tonic::Request<super::StartCampaignRequest>,
3133        ) -> std::result::Result<
3134            tonic::Response<super::StartCampaignResponse>,
3135            tonic::Status,
3136        >;
3137        /** Retrieve a single campaign by ID.
3138 Authorization: Authenticated user within the organization.
3139*/
3140        async fn get_campaign(
3141            &self,
3142            request: tonic::Request<super::GetCampaignRequest>,
3143        ) -> std::result::Result<
3144            tonic::Response<super::GetCampaignResponse>,
3145            tonic::Status,
3146        >;
3147        /** List campaigns for the organization with pagination.
3148 Authorization: Authenticated user within the organization.
3149*/
3150        async fn list_campaigns(
3151            &self,
3152            request: tonic::Request<super::ListCampaignsRequest>,
3153        ) -> std::result::Result<
3154            tonic::Response<super::ListCampaignsResponse>,
3155            tonic::Status,
3156        >;
3157        /** Update a draft campaign (CREATED status only). Non-empty fields overwrite existing values.
3158 Authorization: Requires MANAGER+ role.
3159*/
3160        async fn update_campaign(
3161            &self,
3162            request: tonic::Request<super::UpdateCampaignRequest>,
3163        ) -> std::result::Result<
3164            tonic::Response<super::UpdateCampaignResponse>,
3165            tonic::Status,
3166        >;
3167        /** Cancel a running campaign, stopping further deliveries and reminders.
3168 Authorization: Requires MANAGER+ role.
3169*/
3170        async fn cancel_campaign(
3171            &self,
3172            request: tonic::Request<super::CancelCampaignRequest>,
3173        ) -> std::result::Result<
3174            tonic::Response<super::CancelCampaignResponse>,
3175            tonic::Status,
3176        >;
3177        /** List delivery records for a campaign, optionally filtered by status.
3178 Authorization: Authenticated user within the organization.
3179*/
3180        async fn list_deliveries(
3181            &self,
3182            request: tonic::Request<super::ListDeliveriesRequest>,
3183        ) -> std::result::Result<
3184            tonic::Response<super::ListDeliveriesResponse>,
3185            tonic::Status,
3186        >;
3187        /** Break down a campaign's recipients by current archetype membership
3188 and return ack-rate per bucket, with k-anonymity gate applied.
3189 Only valid for campaigns whose originating_archetype is set.
3190 Authorization: Authenticated user within the organization.
3191*/
3192        async fn get_campaign_archetype_breakdown(
3193            &self,
3194            request: tonic::Request<super::GetCampaignArchetypeBreakdownRequest>,
3195        ) -> std::result::Result<
3196            tonic::Response<super::GetCampaignArchetypeBreakdownResponse>,
3197            tonic::Status,
3198        >;
3199    }
3200    /** Manages the full lifecycle of communication campaigns — creation,
3201 execution, monitoring, and cancellation.
3202*/
3203    #[derive(Debug)]
3204    pub struct CampaignServiceServer<T> {
3205        inner: Arc<T>,
3206        accept_compression_encodings: EnabledCompressionEncodings,
3207        send_compression_encodings: EnabledCompressionEncodings,
3208        max_decoding_message_size: Option<usize>,
3209        max_encoding_message_size: Option<usize>,
3210    }
3211    impl<T> CampaignServiceServer<T> {
3212        pub fn new(inner: T) -> Self {
3213            Self::from_arc(Arc::new(inner))
3214        }
3215        pub fn from_arc(inner: Arc<T>) -> Self {
3216            Self {
3217                inner,
3218                accept_compression_encodings: Default::default(),
3219                send_compression_encodings: Default::default(),
3220                max_decoding_message_size: None,
3221                max_encoding_message_size: None,
3222            }
3223        }
3224        pub fn with_interceptor<F>(
3225            inner: T,
3226            interceptor: F,
3227        ) -> InterceptedService<Self, F>
3228        where
3229            F: tonic::service::Interceptor,
3230        {
3231            InterceptedService::new(Self::new(inner), interceptor)
3232        }
3233        /// Enable decompressing requests with the given encoding.
3234        #[must_use]
3235        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3236            self.accept_compression_encodings.enable(encoding);
3237            self
3238        }
3239        /// Compress responses with the given encoding, if the client supports it.
3240        #[must_use]
3241        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3242            self.send_compression_encodings.enable(encoding);
3243            self
3244        }
3245        /// Limits the maximum size of a decoded message.
3246        ///
3247        /// Default: `4MB`
3248        #[must_use]
3249        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3250            self.max_decoding_message_size = Some(limit);
3251            self
3252        }
3253        /// Limits the maximum size of an encoded message.
3254        ///
3255        /// Default: `usize::MAX`
3256        #[must_use]
3257        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3258            self.max_encoding_message_size = Some(limit);
3259            self
3260        }
3261    }
3262    impl<T, B> tonic::codegen::Service<http::Request<B>> for CampaignServiceServer<T>
3263    where
3264        T: CampaignService,
3265        B: Body + std::marker::Send + 'static,
3266        B::Error: Into<StdError> + std::marker::Send + 'static,
3267    {
3268        type Response = http::Response<tonic::body::Body>;
3269        type Error = std::convert::Infallible;
3270        type Future = BoxFuture<Self::Response, Self::Error>;
3271        fn poll_ready(
3272            &mut self,
3273            _cx: &mut Context<'_>,
3274        ) -> Poll<std::result::Result<(), Self::Error>> {
3275            Poll::Ready(Ok(()))
3276        }
3277        fn call(&mut self, req: http::Request<B>) -> Self::Future {
3278            match req.uri().path() {
3279                "/pidgr.v1.CampaignService/CreateCampaign" => {
3280                    #[allow(non_camel_case_types)]
3281                    struct CreateCampaignSvc<T: CampaignService>(pub Arc<T>);
3282                    impl<
3283                        T: CampaignService,
3284                    > tonic::server::UnaryService<super::CreateCampaignRequest>
3285                    for CreateCampaignSvc<T> {
3286                        type Response = super::CreateCampaignResponse;
3287                        type Future = BoxFuture<
3288                            tonic::Response<Self::Response>,
3289                            tonic::Status,
3290                        >;
3291                        fn call(
3292                            &mut self,
3293                            request: tonic::Request<super::CreateCampaignRequest>,
3294                        ) -> Self::Future {
3295                            let inner = Arc::clone(&self.0);
3296                            let fut = async move {
3297                                <T as CampaignService>::create_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 = CreateCampaignSvc(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/StartCampaign" => {
3326                    #[allow(non_camel_case_types)]
3327                    struct StartCampaignSvc<T: CampaignService>(pub Arc<T>);
3328                    impl<
3329                        T: CampaignService,
3330                    > tonic::server::UnaryService<super::StartCampaignRequest>
3331                    for StartCampaignSvc<T> {
3332                        type Response = super::StartCampaignResponse;
3333                        type Future = BoxFuture<
3334                            tonic::Response<Self::Response>,
3335                            tonic::Status,
3336                        >;
3337                        fn call(
3338                            &mut self,
3339                            request: tonic::Request<super::StartCampaignRequest>,
3340                        ) -> Self::Future {
3341                            let inner = Arc::clone(&self.0);
3342                            let fut = async move {
3343                                <T as CampaignService>::start_campaign(&inner, request)
3344                                    .await
3345                            };
3346                            Box::pin(fut)
3347                        }
3348                    }
3349                    let accept_compression_encodings = self.accept_compression_encodings;
3350                    let send_compression_encodings = self.send_compression_encodings;
3351                    let max_decoding_message_size = self.max_decoding_message_size;
3352                    let max_encoding_message_size = self.max_encoding_message_size;
3353                    let inner = self.inner.clone();
3354                    let fut = async move {
3355                        let method = StartCampaignSvc(inner);
3356                        let codec = tonic_prost::ProstCodec::default();
3357                        let mut grpc = tonic::server::Grpc::new(codec)
3358                            .apply_compression_config(
3359                                accept_compression_encodings,
3360                                send_compression_encodings,
3361                            )
3362                            .apply_max_message_size_config(
3363                                max_decoding_message_size,
3364                                max_encoding_message_size,
3365                            );
3366                        let res = grpc.unary(method, req).await;
3367                        Ok(res)
3368                    };
3369                    Box::pin(fut)
3370                }
3371                "/pidgr.v1.CampaignService/GetCampaign" => {
3372                    #[allow(non_camel_case_types)]
3373                    struct GetCampaignSvc<T: CampaignService>(pub Arc<T>);
3374                    impl<
3375                        T: CampaignService,
3376                    > tonic::server::UnaryService<super::GetCampaignRequest>
3377                    for GetCampaignSvc<T> {
3378                        type Response = super::GetCampaignResponse;
3379                        type Future = BoxFuture<
3380                            tonic::Response<Self::Response>,
3381                            tonic::Status,
3382                        >;
3383                        fn call(
3384                            &mut self,
3385                            request: tonic::Request<super::GetCampaignRequest>,
3386                        ) -> Self::Future {
3387                            let inner = Arc::clone(&self.0);
3388                            let fut = async move {
3389                                <T as CampaignService>::get_campaign(&inner, request).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 = GetCampaignSvc(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/ListCampaigns" => {
3417                    #[allow(non_camel_case_types)]
3418                    struct ListCampaignsSvc<T: CampaignService>(pub Arc<T>);
3419                    impl<
3420                        T: CampaignService,
3421                    > tonic::server::UnaryService<super::ListCampaignsRequest>
3422                    for ListCampaignsSvc<T> {
3423                        type Response = super::ListCampaignsResponse;
3424                        type Future = BoxFuture<
3425                            tonic::Response<Self::Response>,
3426                            tonic::Status,
3427                        >;
3428                        fn call(
3429                            &mut self,
3430                            request: tonic::Request<super::ListCampaignsRequest>,
3431                        ) -> Self::Future {
3432                            let inner = Arc::clone(&self.0);
3433                            let fut = async move {
3434                                <T as CampaignService>::list_campaigns(&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 = ListCampaignsSvc(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/UpdateCampaign" => {
3463                    #[allow(non_camel_case_types)]
3464                    struct UpdateCampaignSvc<T: CampaignService>(pub Arc<T>);
3465                    impl<
3466                        T: CampaignService,
3467                    > tonic::server::UnaryService<super::UpdateCampaignRequest>
3468                    for UpdateCampaignSvc<T> {
3469                        type Response = super::UpdateCampaignResponse;
3470                        type Future = BoxFuture<
3471                            tonic::Response<Self::Response>,
3472                            tonic::Status,
3473                        >;
3474                        fn call(
3475                            &mut self,
3476                            request: tonic::Request<super::UpdateCampaignRequest>,
3477                        ) -> Self::Future {
3478                            let inner = Arc::clone(&self.0);
3479                            let fut = async move {
3480                                <T as CampaignService>::update_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 = UpdateCampaignSvc(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/CancelCampaign" => {
3509                    #[allow(non_camel_case_types)]
3510                    struct CancelCampaignSvc<T: CampaignService>(pub Arc<T>);
3511                    impl<
3512                        T: CampaignService,
3513                    > tonic::server::UnaryService<super::CancelCampaignRequest>
3514                    for CancelCampaignSvc<T> {
3515                        type Response = super::CancelCampaignResponse;
3516                        type Future = BoxFuture<
3517                            tonic::Response<Self::Response>,
3518                            tonic::Status,
3519                        >;
3520                        fn call(
3521                            &mut self,
3522                            request: tonic::Request<super::CancelCampaignRequest>,
3523                        ) -> Self::Future {
3524                            let inner = Arc::clone(&self.0);
3525                            let fut = async move {
3526                                <T as CampaignService>::cancel_campaign(&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 = CancelCampaignSvc(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                "/pidgr.v1.CampaignService/ListDeliveries" => {
3555                    #[allow(non_camel_case_types)]
3556                    struct ListDeliveriesSvc<T: CampaignService>(pub Arc<T>);
3557                    impl<
3558                        T: CampaignService,
3559                    > tonic::server::UnaryService<super::ListDeliveriesRequest>
3560                    for ListDeliveriesSvc<T> {
3561                        type Response = super::ListDeliveriesResponse;
3562                        type Future = BoxFuture<
3563                            tonic::Response<Self::Response>,
3564                            tonic::Status,
3565                        >;
3566                        fn call(
3567                            &mut self,
3568                            request: tonic::Request<super::ListDeliveriesRequest>,
3569                        ) -> Self::Future {
3570                            let inner = Arc::clone(&self.0);
3571                            let fut = async move {
3572                                <T as CampaignService>::list_deliveries(&inner, request)
3573                                    .await
3574                            };
3575                            Box::pin(fut)
3576                        }
3577                    }
3578                    let accept_compression_encodings = self.accept_compression_encodings;
3579                    let send_compression_encodings = self.send_compression_encodings;
3580                    let max_decoding_message_size = self.max_decoding_message_size;
3581                    let max_encoding_message_size = self.max_encoding_message_size;
3582                    let inner = self.inner.clone();
3583                    let fut = async move {
3584                        let method = ListDeliveriesSvc(inner);
3585                        let codec = tonic_prost::ProstCodec::default();
3586                        let mut grpc = tonic::server::Grpc::new(codec)
3587                            .apply_compression_config(
3588                                accept_compression_encodings,
3589                                send_compression_encodings,
3590                            )
3591                            .apply_max_message_size_config(
3592                                max_decoding_message_size,
3593                                max_encoding_message_size,
3594                            );
3595                        let res = grpc.unary(method, req).await;
3596                        Ok(res)
3597                    };
3598                    Box::pin(fut)
3599                }
3600                "/pidgr.v1.CampaignService/GetCampaignArchetypeBreakdown" => {
3601                    #[allow(non_camel_case_types)]
3602                    struct GetCampaignArchetypeBreakdownSvc<T: CampaignService>(
3603                        pub Arc<T>,
3604                    );
3605                    impl<
3606                        T: CampaignService,
3607                    > tonic::server::UnaryService<
3608                        super::GetCampaignArchetypeBreakdownRequest,
3609                    > for GetCampaignArchetypeBreakdownSvc<T> {
3610                        type Response = super::GetCampaignArchetypeBreakdownResponse;
3611                        type Future = BoxFuture<
3612                            tonic::Response<Self::Response>,
3613                            tonic::Status,
3614                        >;
3615                        fn call(
3616                            &mut self,
3617                            request: tonic::Request<
3618                                super::GetCampaignArchetypeBreakdownRequest,
3619                            >,
3620                        ) -> Self::Future {
3621                            let inner = Arc::clone(&self.0);
3622                            let fut = async move {
3623                                <T as CampaignService>::get_campaign_archetype_breakdown(
3624                                        &inner,
3625                                        request,
3626                                    )
3627                                    .await
3628                            };
3629                            Box::pin(fut)
3630                        }
3631                    }
3632                    let accept_compression_encodings = self.accept_compression_encodings;
3633                    let send_compression_encodings = self.send_compression_encodings;
3634                    let max_decoding_message_size = self.max_decoding_message_size;
3635                    let max_encoding_message_size = self.max_encoding_message_size;
3636                    let inner = self.inner.clone();
3637                    let fut = async move {
3638                        let method = GetCampaignArchetypeBreakdownSvc(inner);
3639                        let codec = tonic_prost::ProstCodec::default();
3640                        let mut grpc = tonic::server::Grpc::new(codec)
3641                            .apply_compression_config(
3642                                accept_compression_encodings,
3643                                send_compression_encodings,
3644                            )
3645                            .apply_max_message_size_config(
3646                                max_decoding_message_size,
3647                                max_encoding_message_size,
3648                            );
3649                        let res = grpc.unary(method, req).await;
3650                        Ok(res)
3651                    };
3652                    Box::pin(fut)
3653                }
3654                _ => {
3655                    Box::pin(async move {
3656                        let mut response = http::Response::new(
3657                            tonic::body::Body::default(),
3658                        );
3659                        let headers = response.headers_mut();
3660                        headers
3661                            .insert(
3662                                tonic::Status::GRPC_STATUS,
3663                                (tonic::Code::Unimplemented as i32).into(),
3664                            );
3665                        headers
3666                            .insert(
3667                                http::header::CONTENT_TYPE,
3668                                tonic::metadata::GRPC_CONTENT_TYPE,
3669                            );
3670                        Ok(response)
3671                    })
3672                }
3673            }
3674        }
3675    }
3676    impl<T> Clone for CampaignServiceServer<T> {
3677        fn clone(&self) -> Self {
3678            let inner = self.inner.clone();
3679            Self {
3680                inner,
3681                accept_compression_encodings: self.accept_compression_encodings,
3682                send_compression_encodings: self.send_compression_encodings,
3683                max_decoding_message_size: self.max_decoding_message_size,
3684                max_encoding_message_size: self.max_encoding_message_size,
3685            }
3686        }
3687    }
3688    /// Generated gRPC service name
3689    pub const SERVICE_NAME: &str = "pidgr.v1.CampaignService";
3690    impl<T> tonic::server::NamedService for CampaignServiceServer<T> {
3691        const NAME: &'static str = SERVICE_NAME;
3692    }
3693}
3694/// Generated client implementations.
3695pub mod channel_events_service_client {
3696    #![allow(
3697        unused_variables,
3698        dead_code,
3699        missing_docs,
3700        clippy::wildcard_imports,
3701        clippy::let_unit_value,
3702    )]
3703    use tonic::codegen::*;
3704    use tonic::codegen::http::Uri;
3705    /** ChannelEventsService records third-party channel dispatch events into the
3706 platform's append-only audit table. Intended for internal-service callers
3707 behind a service-mesh / mTLS boundary; not exposed for end-user clients.
3708*/
3709    #[derive(Debug, Clone)]
3710    pub struct ChannelEventsServiceClient<T> {
3711        inner: tonic::client::Grpc<T>,
3712    }
3713    impl ChannelEventsServiceClient<tonic::transport::Channel> {
3714        /// Attempt to create a new client by connecting to a given endpoint.
3715        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
3716        where
3717            D: TryInto<tonic::transport::Endpoint>,
3718            D::Error: Into<StdError>,
3719        {
3720            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
3721            Ok(Self::new(conn))
3722        }
3723    }
3724    impl<T> ChannelEventsServiceClient<T>
3725    where
3726        T: tonic::client::GrpcService<tonic::body::Body>,
3727        T::Error: Into<StdError>,
3728        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
3729        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
3730    {
3731        pub fn new(inner: T) -> Self {
3732            let inner = tonic::client::Grpc::new(inner);
3733            Self { inner }
3734        }
3735        pub fn with_origin(inner: T, origin: Uri) -> Self {
3736            let inner = tonic::client::Grpc::with_origin(inner, origin);
3737            Self { inner }
3738        }
3739        pub fn with_interceptor<F>(
3740            inner: T,
3741            interceptor: F,
3742        ) -> ChannelEventsServiceClient<InterceptedService<T, F>>
3743        where
3744            F: tonic::service::Interceptor,
3745            T::ResponseBody: Default,
3746            T: tonic::codegen::Service<
3747                http::Request<tonic::body::Body>,
3748                Response = http::Response<
3749                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
3750                >,
3751            >,
3752            <T as tonic::codegen::Service<
3753                http::Request<tonic::body::Body>,
3754            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
3755        {
3756            ChannelEventsServiceClient::new(InterceptedService::new(inner, interceptor))
3757        }
3758        /// Compress requests with the given encoding.
3759        ///
3760        /// This requires the server to support it otherwise it might respond with an
3761        /// error.
3762        #[must_use]
3763        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3764            self.inner = self.inner.send_compressed(encoding);
3765            self
3766        }
3767        /// Enable decompressing responses.
3768        #[must_use]
3769        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3770            self.inner = self.inner.accept_compressed(encoding);
3771            self
3772        }
3773        /// Limits the maximum size of a decoded message.
3774        ///
3775        /// Default: `4MB`
3776        #[must_use]
3777        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3778            self.inner = self.inner.max_decoding_message_size(limit);
3779            self
3780        }
3781        /// Limits the maximum size of an encoded message.
3782        ///
3783        /// Default: `usize::MAX`
3784        #[must_use]
3785        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3786            self.inner = self.inner.max_encoding_message_size(limit);
3787            self
3788        }
3789        /** Record a single channel event. Returns accepted=false reason="duplicate"
3790 when the partial unique index rejects (caller treats as already-recorded,
3791 not as an error).
3792*/
3793        pub async fn record_channel_event(
3794            &mut self,
3795            request: impl tonic::IntoRequest<super::RecordChannelEventRequest>,
3796        ) -> std::result::Result<
3797            tonic::Response<super::RecordChannelEventResponse>,
3798            tonic::Status,
3799        > {
3800            self.inner
3801                .ready()
3802                .await
3803                .map_err(|e| {
3804                    tonic::Status::unknown(
3805                        format!("Service was not ready: {}", e.into()),
3806                    )
3807                })?;
3808            let codec = tonic_prost::ProstCodec::default();
3809            let path = http::uri::PathAndQuery::from_static(
3810                "/pidgr.v1.ChannelEventsService/RecordChannelEvent",
3811            );
3812            let mut req = request.into_request();
3813            req.extensions_mut()
3814                .insert(
3815                    GrpcMethod::new(
3816                        "pidgr.v1.ChannelEventsService",
3817                        "RecordChannelEvent",
3818                    ),
3819                );
3820            self.inner.unary(req, path, codec).await
3821        }
3822        /** Record N events in one round-trip. Used by webhook ingress when a
3823 provider delivers multiple state transitions in one payload (e.g. a
3824 batched delivery report). Best-effort per-row.
3825*/
3826        pub async fn record_channel_event_batch(
3827            &mut self,
3828            request: impl tonic::IntoRequest<super::RecordChannelEventBatchRequest>,
3829        ) -> std::result::Result<
3830            tonic::Response<super::RecordChannelEventBatchResponse>,
3831            tonic::Status,
3832        > {
3833            self.inner
3834                .ready()
3835                .await
3836                .map_err(|e| {
3837                    tonic::Status::unknown(
3838                        format!("Service was not ready: {}", e.into()),
3839                    )
3840                })?;
3841            let codec = tonic_prost::ProstCodec::default();
3842            let path = http::uri::PathAndQuery::from_static(
3843                "/pidgr.v1.ChannelEventsService/RecordChannelEventBatch",
3844            );
3845            let mut req = request.into_request();
3846            req.extensions_mut()
3847                .insert(
3848                    GrpcMethod::new(
3849                        "pidgr.v1.ChannelEventsService",
3850                        "RecordChannelEventBatch",
3851                    ),
3852                );
3853            self.inner.unary(req, path, codec).await
3854        }
3855    }
3856}
3857/// Generated server implementations.
3858pub mod channel_events_service_server {
3859    #![allow(
3860        unused_variables,
3861        dead_code,
3862        missing_docs,
3863        clippy::wildcard_imports,
3864        clippy::let_unit_value,
3865    )]
3866    use tonic::codegen::*;
3867    /// Generated trait containing gRPC methods that should be implemented for use with ChannelEventsServiceServer.
3868    #[async_trait]
3869    pub trait ChannelEventsService: std::marker::Send + std::marker::Sync + 'static {
3870        /** Record a single channel event. Returns accepted=false reason="duplicate"
3871 when the partial unique index rejects (caller treats as already-recorded,
3872 not as an error).
3873*/
3874        async fn record_channel_event(
3875            &self,
3876            request: tonic::Request<super::RecordChannelEventRequest>,
3877        ) -> std::result::Result<
3878            tonic::Response<super::RecordChannelEventResponse>,
3879            tonic::Status,
3880        >;
3881        /** Record N events in one round-trip. Used by webhook ingress when a
3882 provider delivers multiple state transitions in one payload (e.g. a
3883 batched delivery report). Best-effort per-row.
3884*/
3885        async fn record_channel_event_batch(
3886            &self,
3887            request: tonic::Request<super::RecordChannelEventBatchRequest>,
3888        ) -> std::result::Result<
3889            tonic::Response<super::RecordChannelEventBatchResponse>,
3890            tonic::Status,
3891        >;
3892    }
3893    /** ChannelEventsService records third-party channel dispatch events into the
3894 platform's append-only audit table. Intended for internal-service callers
3895 behind a service-mesh / mTLS boundary; not exposed for end-user clients.
3896*/
3897    #[derive(Debug)]
3898    pub struct ChannelEventsServiceServer<T> {
3899        inner: Arc<T>,
3900        accept_compression_encodings: EnabledCompressionEncodings,
3901        send_compression_encodings: EnabledCompressionEncodings,
3902        max_decoding_message_size: Option<usize>,
3903        max_encoding_message_size: Option<usize>,
3904    }
3905    impl<T> ChannelEventsServiceServer<T> {
3906        pub fn new(inner: T) -> Self {
3907            Self::from_arc(Arc::new(inner))
3908        }
3909        pub fn from_arc(inner: Arc<T>) -> Self {
3910            Self {
3911                inner,
3912                accept_compression_encodings: Default::default(),
3913                send_compression_encodings: Default::default(),
3914                max_decoding_message_size: None,
3915                max_encoding_message_size: None,
3916            }
3917        }
3918        pub fn with_interceptor<F>(
3919            inner: T,
3920            interceptor: F,
3921        ) -> InterceptedService<Self, F>
3922        where
3923            F: tonic::service::Interceptor,
3924        {
3925            InterceptedService::new(Self::new(inner), interceptor)
3926        }
3927        /// Enable decompressing requests with the given encoding.
3928        #[must_use]
3929        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3930            self.accept_compression_encodings.enable(encoding);
3931            self
3932        }
3933        /// Compress responses with the given encoding, if the client supports it.
3934        #[must_use]
3935        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3936            self.send_compression_encodings.enable(encoding);
3937            self
3938        }
3939        /// Limits the maximum size of a decoded message.
3940        ///
3941        /// Default: `4MB`
3942        #[must_use]
3943        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3944            self.max_decoding_message_size = Some(limit);
3945            self
3946        }
3947        /// Limits the maximum size of an encoded message.
3948        ///
3949        /// Default: `usize::MAX`
3950        #[must_use]
3951        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3952            self.max_encoding_message_size = Some(limit);
3953            self
3954        }
3955    }
3956    impl<T, B> tonic::codegen::Service<http::Request<B>>
3957    for ChannelEventsServiceServer<T>
3958    where
3959        T: ChannelEventsService,
3960        B: Body + std::marker::Send + 'static,
3961        B::Error: Into<StdError> + std::marker::Send + 'static,
3962    {
3963        type Response = http::Response<tonic::body::Body>;
3964        type Error = std::convert::Infallible;
3965        type Future = BoxFuture<Self::Response, Self::Error>;
3966        fn poll_ready(
3967            &mut self,
3968            _cx: &mut Context<'_>,
3969        ) -> Poll<std::result::Result<(), Self::Error>> {
3970            Poll::Ready(Ok(()))
3971        }
3972        fn call(&mut self, req: http::Request<B>) -> Self::Future {
3973            match req.uri().path() {
3974                "/pidgr.v1.ChannelEventsService/RecordChannelEvent" => {
3975                    #[allow(non_camel_case_types)]
3976                    struct RecordChannelEventSvc<T: ChannelEventsService>(pub Arc<T>);
3977                    impl<
3978                        T: ChannelEventsService,
3979                    > tonic::server::UnaryService<super::RecordChannelEventRequest>
3980                    for RecordChannelEventSvc<T> {
3981                        type Response = super::RecordChannelEventResponse;
3982                        type Future = BoxFuture<
3983                            tonic::Response<Self::Response>,
3984                            tonic::Status,
3985                        >;
3986                        fn call(
3987                            &mut self,
3988                            request: tonic::Request<super::RecordChannelEventRequest>,
3989                        ) -> Self::Future {
3990                            let inner = Arc::clone(&self.0);
3991                            let fut = async move {
3992                                <T as ChannelEventsService>::record_channel_event(
3993                                        &inner,
3994                                        request,
3995                                    )
3996                                    .await
3997                            };
3998                            Box::pin(fut)
3999                        }
4000                    }
4001                    let accept_compression_encodings = self.accept_compression_encodings;
4002                    let send_compression_encodings = self.send_compression_encodings;
4003                    let max_decoding_message_size = self.max_decoding_message_size;
4004                    let max_encoding_message_size = self.max_encoding_message_size;
4005                    let inner = self.inner.clone();
4006                    let fut = async move {
4007                        let method = RecordChannelEventSvc(inner);
4008                        let codec = tonic_prost::ProstCodec::default();
4009                        let mut grpc = tonic::server::Grpc::new(codec)
4010                            .apply_compression_config(
4011                                accept_compression_encodings,
4012                                send_compression_encodings,
4013                            )
4014                            .apply_max_message_size_config(
4015                                max_decoding_message_size,
4016                                max_encoding_message_size,
4017                            );
4018                        let res = grpc.unary(method, req).await;
4019                        Ok(res)
4020                    };
4021                    Box::pin(fut)
4022                }
4023                "/pidgr.v1.ChannelEventsService/RecordChannelEventBatch" => {
4024                    #[allow(non_camel_case_types)]
4025                    struct RecordChannelEventBatchSvc<T: ChannelEventsService>(
4026                        pub Arc<T>,
4027                    );
4028                    impl<
4029                        T: ChannelEventsService,
4030                    > tonic::server::UnaryService<super::RecordChannelEventBatchRequest>
4031                    for RecordChannelEventBatchSvc<T> {
4032                        type Response = super::RecordChannelEventBatchResponse;
4033                        type Future = BoxFuture<
4034                            tonic::Response<Self::Response>,
4035                            tonic::Status,
4036                        >;
4037                        fn call(
4038                            &mut self,
4039                            request: tonic::Request<
4040                                super::RecordChannelEventBatchRequest,
4041                            >,
4042                        ) -> Self::Future {
4043                            let inner = Arc::clone(&self.0);
4044                            let fut = async move {
4045                                <T as ChannelEventsService>::record_channel_event_batch(
4046                                        &inner,
4047                                        request,
4048                                    )
4049                                    .await
4050                            };
4051                            Box::pin(fut)
4052                        }
4053                    }
4054                    let accept_compression_encodings = self.accept_compression_encodings;
4055                    let send_compression_encodings = self.send_compression_encodings;
4056                    let max_decoding_message_size = self.max_decoding_message_size;
4057                    let max_encoding_message_size = self.max_encoding_message_size;
4058                    let inner = self.inner.clone();
4059                    let fut = async move {
4060                        let method = RecordChannelEventBatchSvc(inner);
4061                        let codec = tonic_prost::ProstCodec::default();
4062                        let mut grpc = tonic::server::Grpc::new(codec)
4063                            .apply_compression_config(
4064                                accept_compression_encodings,
4065                                send_compression_encodings,
4066                            )
4067                            .apply_max_message_size_config(
4068                                max_decoding_message_size,
4069                                max_encoding_message_size,
4070                            );
4071                        let res = grpc.unary(method, req).await;
4072                        Ok(res)
4073                    };
4074                    Box::pin(fut)
4075                }
4076                _ => {
4077                    Box::pin(async move {
4078                        let mut response = http::Response::new(
4079                            tonic::body::Body::default(),
4080                        );
4081                        let headers = response.headers_mut();
4082                        headers
4083                            .insert(
4084                                tonic::Status::GRPC_STATUS,
4085                                (tonic::Code::Unimplemented as i32).into(),
4086                            );
4087                        headers
4088                            .insert(
4089                                http::header::CONTENT_TYPE,
4090                                tonic::metadata::GRPC_CONTENT_TYPE,
4091                            );
4092                        Ok(response)
4093                    })
4094                }
4095            }
4096        }
4097    }
4098    impl<T> Clone for ChannelEventsServiceServer<T> {
4099        fn clone(&self) -> Self {
4100            let inner = self.inner.clone();
4101            Self {
4102                inner,
4103                accept_compression_encodings: self.accept_compression_encodings,
4104                send_compression_encodings: self.send_compression_encodings,
4105                max_decoding_message_size: self.max_decoding_message_size,
4106                max_encoding_message_size: self.max_encoding_message_size,
4107            }
4108        }
4109    }
4110    /// Generated gRPC service name
4111    pub const SERVICE_NAME: &str = "pidgr.v1.ChannelEventsService";
4112    impl<T> tonic::server::NamedService for ChannelEventsServiceServer<T> {
4113        const NAME: &'static str = SERVICE_NAME;
4114    }
4115}
4116/// Generated client implementations.
4117pub mod device_service_client {
4118    #![allow(
4119        unused_variables,
4120        dead_code,
4121        missing_docs,
4122        clippy::wildcard_imports,
4123        clippy::let_unit_value,
4124    )]
4125    use tonic::codegen::*;
4126    use tonic::codegen::http::Uri;
4127    /** Manages push notification device registration.
4128 Used by the mobile app to register push tokens and manage device lifecycle.
4129*/
4130    #[derive(Debug, Clone)]
4131    pub struct DeviceServiceClient<T> {
4132        inner: tonic::client::Grpc<T>,
4133    }
4134    impl DeviceServiceClient<tonic::transport::Channel> {
4135        /// Attempt to create a new client by connecting to a given endpoint.
4136        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4137        where
4138            D: TryInto<tonic::transport::Endpoint>,
4139            D::Error: Into<StdError>,
4140        {
4141            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4142            Ok(Self::new(conn))
4143        }
4144    }
4145    impl<T> DeviceServiceClient<T>
4146    where
4147        T: tonic::client::GrpcService<tonic::body::Body>,
4148        T::Error: Into<StdError>,
4149        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4150        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4151    {
4152        pub fn new(inner: T) -> Self {
4153            let inner = tonic::client::Grpc::new(inner);
4154            Self { inner }
4155        }
4156        pub fn with_origin(inner: T, origin: Uri) -> Self {
4157            let inner = tonic::client::Grpc::with_origin(inner, origin);
4158            Self { inner }
4159        }
4160        pub fn with_interceptor<F>(
4161            inner: T,
4162            interceptor: F,
4163        ) -> DeviceServiceClient<InterceptedService<T, F>>
4164        where
4165            F: tonic::service::Interceptor,
4166            T::ResponseBody: Default,
4167            T: tonic::codegen::Service<
4168                http::Request<tonic::body::Body>,
4169                Response = http::Response<
4170                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4171                >,
4172            >,
4173            <T as tonic::codegen::Service<
4174                http::Request<tonic::body::Body>,
4175            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4176        {
4177            DeviceServiceClient::new(InterceptedService::new(inner, interceptor))
4178        }
4179        /// Compress requests with the given encoding.
4180        ///
4181        /// This requires the server to support it otherwise it might respond with an
4182        /// error.
4183        #[must_use]
4184        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4185            self.inner = self.inner.send_compressed(encoding);
4186            self
4187        }
4188        /// Enable decompressing responses.
4189        #[must_use]
4190        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4191            self.inner = self.inner.accept_compressed(encoding);
4192            self
4193        }
4194        /// Limits the maximum size of a decoded message.
4195        ///
4196        /// Default: `4MB`
4197        #[must_use]
4198        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4199            self.inner = self.inner.max_decoding_message_size(limit);
4200            self
4201        }
4202        /// Limits the maximum size of an encoded message.
4203        ///
4204        /// Default: `usize::MAX`
4205        #[must_use]
4206        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4207            self.inner = self.inner.max_encoding_message_size(limit);
4208            self
4209        }
4210        /** Register a device with its push token for receiving notifications.
4211 Authorization: Authenticated user (own devices only).
4212*/
4213        pub async fn register(
4214            &mut self,
4215            request: impl tonic::IntoRequest<super::RegisterRequest>,
4216        ) -> std::result::Result<
4217            tonic::Response<super::RegisterResponse>,
4218            tonic::Status,
4219        > {
4220            self.inner
4221                .ready()
4222                .await
4223                .map_err(|e| {
4224                    tonic::Status::unknown(
4225                        format!("Service was not ready: {}", e.into()),
4226                    )
4227                })?;
4228            let codec = tonic_prost::ProstCodec::default();
4229            let path = http::uri::PathAndQuery::from_static(
4230                "/pidgr.v1.DeviceService/Register",
4231            );
4232            let mut req = request.into_request();
4233            req.extensions_mut()
4234                .insert(GrpcMethod::new("pidgr.v1.DeviceService", "Register"));
4235            self.inner.unary(req, path, codec).await
4236        }
4237        /** Deactivate a device, preventing further push notifications.
4238 Authorization: Authenticated user (own devices only).
4239*/
4240        pub async fn deactivate(
4241            &mut self,
4242            request: impl tonic::IntoRequest<super::DeactivateRequest>,
4243        ) -> std::result::Result<
4244            tonic::Response<super::DeactivateResponse>,
4245            tonic::Status,
4246        > {
4247            self.inner
4248                .ready()
4249                .await
4250                .map_err(|e| {
4251                    tonic::Status::unknown(
4252                        format!("Service was not ready: {}", e.into()),
4253                    )
4254                })?;
4255            let codec = tonic_prost::ProstCodec::default();
4256            let path = http::uri::PathAndQuery::from_static(
4257                "/pidgr.v1.DeviceService/Deactivate",
4258            );
4259            let mut req = request.into_request();
4260            req.extensions_mut()
4261                .insert(GrpcMethod::new("pidgr.v1.DeviceService", "Deactivate"));
4262            self.inner.unary(req, path, codec).await
4263        }
4264        /** List all devices registered to the authenticated user.
4265 Authorization: Authenticated user (own devices only).
4266*/
4267        pub async fn list_devices(
4268            &mut self,
4269            request: impl tonic::IntoRequest<super::ListDevicesRequest>,
4270        ) -> std::result::Result<
4271            tonic::Response<super::ListDevicesResponse>,
4272            tonic::Status,
4273        > {
4274            self.inner
4275                .ready()
4276                .await
4277                .map_err(|e| {
4278                    tonic::Status::unknown(
4279                        format!("Service was not ready: {}", e.into()),
4280                    )
4281                })?;
4282            let codec = tonic_prost::ProstCodec::default();
4283            let path = http::uri::PathAndQuery::from_static(
4284                "/pidgr.v1.DeviceService/ListDevices",
4285            );
4286            let mut req = request.into_request();
4287            req.extensions_mut()
4288                .insert(GrpcMethod::new("pidgr.v1.DeviceService", "ListDevices"));
4289            self.inner.unary(req, path, codec).await
4290        }
4291        /** List all devices for a specific organization member.
4292 Authorization: Requires MEMBERS_READ permission.
4293*/
4294        pub async fn list_member_devices(
4295            &mut self,
4296            request: impl tonic::IntoRequest<super::ListMemberDevicesRequest>,
4297        ) -> std::result::Result<
4298            tonic::Response<super::ListMemberDevicesResponse>,
4299            tonic::Status,
4300        > {
4301            self.inner
4302                .ready()
4303                .await
4304                .map_err(|e| {
4305                    tonic::Status::unknown(
4306                        format!("Service was not ready: {}", e.into()),
4307                    )
4308                })?;
4309            let codec = tonic_prost::ProstCodec::default();
4310            let path = http::uri::PathAndQuery::from_static(
4311                "/pidgr.v1.DeviceService/ListMemberDevices",
4312            );
4313            let mut req = request.into_request();
4314            req.extensions_mut()
4315                .insert(GrpcMethod::new("pidgr.v1.DeviceService", "ListMemberDevices"));
4316            self.inner.unary(req, path, codec).await
4317        }
4318    }
4319}
4320/// Generated server implementations.
4321pub mod device_service_server {
4322    #![allow(
4323        unused_variables,
4324        dead_code,
4325        missing_docs,
4326        clippy::wildcard_imports,
4327        clippy::let_unit_value,
4328    )]
4329    use tonic::codegen::*;
4330    /// Generated trait containing gRPC methods that should be implemented for use with DeviceServiceServer.
4331    #[async_trait]
4332    pub trait DeviceService: std::marker::Send + std::marker::Sync + 'static {
4333        /** Register a device with its push token for receiving notifications.
4334 Authorization: Authenticated user (own devices only).
4335*/
4336        async fn register(
4337            &self,
4338            request: tonic::Request<super::RegisterRequest>,
4339        ) -> std::result::Result<
4340            tonic::Response<super::RegisterResponse>,
4341            tonic::Status,
4342        >;
4343        /** Deactivate a device, preventing further push notifications.
4344 Authorization: Authenticated user (own devices only).
4345*/
4346        async fn deactivate(
4347            &self,
4348            request: tonic::Request<super::DeactivateRequest>,
4349        ) -> std::result::Result<
4350            tonic::Response<super::DeactivateResponse>,
4351            tonic::Status,
4352        >;
4353        /** List all devices registered to the authenticated user.
4354 Authorization: Authenticated user (own devices only).
4355*/
4356        async fn list_devices(
4357            &self,
4358            request: tonic::Request<super::ListDevicesRequest>,
4359        ) -> std::result::Result<
4360            tonic::Response<super::ListDevicesResponse>,
4361            tonic::Status,
4362        >;
4363        /** List all devices for a specific organization member.
4364 Authorization: Requires MEMBERS_READ permission.
4365*/
4366        async fn list_member_devices(
4367            &self,
4368            request: tonic::Request<super::ListMemberDevicesRequest>,
4369        ) -> std::result::Result<
4370            tonic::Response<super::ListMemberDevicesResponse>,
4371            tonic::Status,
4372        >;
4373    }
4374    /** Manages push notification device registration.
4375 Used by the mobile app to register push tokens and manage device lifecycle.
4376*/
4377    #[derive(Debug)]
4378    pub struct DeviceServiceServer<T> {
4379        inner: Arc<T>,
4380        accept_compression_encodings: EnabledCompressionEncodings,
4381        send_compression_encodings: EnabledCompressionEncodings,
4382        max_decoding_message_size: Option<usize>,
4383        max_encoding_message_size: Option<usize>,
4384    }
4385    impl<T> DeviceServiceServer<T> {
4386        pub fn new(inner: T) -> Self {
4387            Self::from_arc(Arc::new(inner))
4388        }
4389        pub fn from_arc(inner: Arc<T>) -> Self {
4390            Self {
4391                inner,
4392                accept_compression_encodings: Default::default(),
4393                send_compression_encodings: Default::default(),
4394                max_decoding_message_size: None,
4395                max_encoding_message_size: None,
4396            }
4397        }
4398        pub fn with_interceptor<F>(
4399            inner: T,
4400            interceptor: F,
4401        ) -> InterceptedService<Self, F>
4402        where
4403            F: tonic::service::Interceptor,
4404        {
4405            InterceptedService::new(Self::new(inner), interceptor)
4406        }
4407        /// Enable decompressing requests with the given encoding.
4408        #[must_use]
4409        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4410            self.accept_compression_encodings.enable(encoding);
4411            self
4412        }
4413        /// Compress responses with the given encoding, if the client supports it.
4414        #[must_use]
4415        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4416            self.send_compression_encodings.enable(encoding);
4417            self
4418        }
4419        /// Limits the maximum size of a decoded message.
4420        ///
4421        /// Default: `4MB`
4422        #[must_use]
4423        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4424            self.max_decoding_message_size = Some(limit);
4425            self
4426        }
4427        /// Limits the maximum size of an encoded message.
4428        ///
4429        /// Default: `usize::MAX`
4430        #[must_use]
4431        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4432            self.max_encoding_message_size = Some(limit);
4433            self
4434        }
4435    }
4436    impl<T, B> tonic::codegen::Service<http::Request<B>> for DeviceServiceServer<T>
4437    where
4438        T: DeviceService,
4439        B: Body + std::marker::Send + 'static,
4440        B::Error: Into<StdError> + std::marker::Send + 'static,
4441    {
4442        type Response = http::Response<tonic::body::Body>;
4443        type Error = std::convert::Infallible;
4444        type Future = BoxFuture<Self::Response, Self::Error>;
4445        fn poll_ready(
4446            &mut self,
4447            _cx: &mut Context<'_>,
4448        ) -> Poll<std::result::Result<(), Self::Error>> {
4449            Poll::Ready(Ok(()))
4450        }
4451        fn call(&mut self, req: http::Request<B>) -> Self::Future {
4452            match req.uri().path() {
4453                "/pidgr.v1.DeviceService/Register" => {
4454                    #[allow(non_camel_case_types)]
4455                    struct RegisterSvc<T: DeviceService>(pub Arc<T>);
4456                    impl<
4457                        T: DeviceService,
4458                    > tonic::server::UnaryService<super::RegisterRequest>
4459                    for RegisterSvc<T> {
4460                        type Response = super::RegisterResponse;
4461                        type Future = BoxFuture<
4462                            tonic::Response<Self::Response>,
4463                            tonic::Status,
4464                        >;
4465                        fn call(
4466                            &mut self,
4467                            request: tonic::Request<super::RegisterRequest>,
4468                        ) -> Self::Future {
4469                            let inner = Arc::clone(&self.0);
4470                            let fut = async move {
4471                                <T as DeviceService>::register(&inner, request).await
4472                            };
4473                            Box::pin(fut)
4474                        }
4475                    }
4476                    let accept_compression_encodings = self.accept_compression_encodings;
4477                    let send_compression_encodings = self.send_compression_encodings;
4478                    let max_decoding_message_size = self.max_decoding_message_size;
4479                    let max_encoding_message_size = self.max_encoding_message_size;
4480                    let inner = self.inner.clone();
4481                    let fut = async move {
4482                        let method = RegisterSvc(inner);
4483                        let codec = tonic_prost::ProstCodec::default();
4484                        let mut grpc = tonic::server::Grpc::new(codec)
4485                            .apply_compression_config(
4486                                accept_compression_encodings,
4487                                send_compression_encodings,
4488                            )
4489                            .apply_max_message_size_config(
4490                                max_decoding_message_size,
4491                                max_encoding_message_size,
4492                            );
4493                        let res = grpc.unary(method, req).await;
4494                        Ok(res)
4495                    };
4496                    Box::pin(fut)
4497                }
4498                "/pidgr.v1.DeviceService/Deactivate" => {
4499                    #[allow(non_camel_case_types)]
4500                    struct DeactivateSvc<T: DeviceService>(pub Arc<T>);
4501                    impl<
4502                        T: DeviceService,
4503                    > tonic::server::UnaryService<super::DeactivateRequest>
4504                    for DeactivateSvc<T> {
4505                        type Response = super::DeactivateResponse;
4506                        type Future = BoxFuture<
4507                            tonic::Response<Self::Response>,
4508                            tonic::Status,
4509                        >;
4510                        fn call(
4511                            &mut self,
4512                            request: tonic::Request<super::DeactivateRequest>,
4513                        ) -> Self::Future {
4514                            let inner = Arc::clone(&self.0);
4515                            let fut = async move {
4516                                <T as DeviceService>::deactivate(&inner, request).await
4517                            };
4518                            Box::pin(fut)
4519                        }
4520                    }
4521                    let accept_compression_encodings = self.accept_compression_encodings;
4522                    let send_compression_encodings = self.send_compression_encodings;
4523                    let max_decoding_message_size = self.max_decoding_message_size;
4524                    let max_encoding_message_size = self.max_encoding_message_size;
4525                    let inner = self.inner.clone();
4526                    let fut = async move {
4527                        let method = DeactivateSvc(inner);
4528                        let codec = tonic_prost::ProstCodec::default();
4529                        let mut grpc = tonic::server::Grpc::new(codec)
4530                            .apply_compression_config(
4531                                accept_compression_encodings,
4532                                send_compression_encodings,
4533                            )
4534                            .apply_max_message_size_config(
4535                                max_decoding_message_size,
4536                                max_encoding_message_size,
4537                            );
4538                        let res = grpc.unary(method, req).await;
4539                        Ok(res)
4540                    };
4541                    Box::pin(fut)
4542                }
4543                "/pidgr.v1.DeviceService/ListDevices" => {
4544                    #[allow(non_camel_case_types)]
4545                    struct ListDevicesSvc<T: DeviceService>(pub Arc<T>);
4546                    impl<
4547                        T: DeviceService,
4548                    > tonic::server::UnaryService<super::ListDevicesRequest>
4549                    for ListDevicesSvc<T> {
4550                        type Response = super::ListDevicesResponse;
4551                        type Future = BoxFuture<
4552                            tonic::Response<Self::Response>,
4553                            tonic::Status,
4554                        >;
4555                        fn call(
4556                            &mut self,
4557                            request: tonic::Request<super::ListDevicesRequest>,
4558                        ) -> Self::Future {
4559                            let inner = Arc::clone(&self.0);
4560                            let fut = async move {
4561                                <T as DeviceService>::list_devices(&inner, request).await
4562                            };
4563                            Box::pin(fut)
4564                        }
4565                    }
4566                    let accept_compression_encodings = self.accept_compression_encodings;
4567                    let send_compression_encodings = self.send_compression_encodings;
4568                    let max_decoding_message_size = self.max_decoding_message_size;
4569                    let max_encoding_message_size = self.max_encoding_message_size;
4570                    let inner = self.inner.clone();
4571                    let fut = async move {
4572                        let method = ListDevicesSvc(inner);
4573                        let codec = tonic_prost::ProstCodec::default();
4574                        let mut grpc = tonic::server::Grpc::new(codec)
4575                            .apply_compression_config(
4576                                accept_compression_encodings,
4577                                send_compression_encodings,
4578                            )
4579                            .apply_max_message_size_config(
4580                                max_decoding_message_size,
4581                                max_encoding_message_size,
4582                            );
4583                        let res = grpc.unary(method, req).await;
4584                        Ok(res)
4585                    };
4586                    Box::pin(fut)
4587                }
4588                "/pidgr.v1.DeviceService/ListMemberDevices" => {
4589                    #[allow(non_camel_case_types)]
4590                    struct ListMemberDevicesSvc<T: DeviceService>(pub Arc<T>);
4591                    impl<
4592                        T: DeviceService,
4593                    > tonic::server::UnaryService<super::ListMemberDevicesRequest>
4594                    for ListMemberDevicesSvc<T> {
4595                        type Response = super::ListMemberDevicesResponse;
4596                        type Future = BoxFuture<
4597                            tonic::Response<Self::Response>,
4598                            tonic::Status,
4599                        >;
4600                        fn call(
4601                            &mut self,
4602                            request: tonic::Request<super::ListMemberDevicesRequest>,
4603                        ) -> Self::Future {
4604                            let inner = Arc::clone(&self.0);
4605                            let fut = async move {
4606                                <T as DeviceService>::list_member_devices(&inner, request)
4607                                    .await
4608                            };
4609                            Box::pin(fut)
4610                        }
4611                    }
4612                    let accept_compression_encodings = self.accept_compression_encodings;
4613                    let send_compression_encodings = self.send_compression_encodings;
4614                    let max_decoding_message_size = self.max_decoding_message_size;
4615                    let max_encoding_message_size = self.max_encoding_message_size;
4616                    let inner = self.inner.clone();
4617                    let fut = async move {
4618                        let method = ListMemberDevicesSvc(inner);
4619                        let codec = tonic_prost::ProstCodec::default();
4620                        let mut grpc = tonic::server::Grpc::new(codec)
4621                            .apply_compression_config(
4622                                accept_compression_encodings,
4623                                send_compression_encodings,
4624                            )
4625                            .apply_max_message_size_config(
4626                                max_decoding_message_size,
4627                                max_encoding_message_size,
4628                            );
4629                        let res = grpc.unary(method, req).await;
4630                        Ok(res)
4631                    };
4632                    Box::pin(fut)
4633                }
4634                _ => {
4635                    Box::pin(async move {
4636                        let mut response = http::Response::new(
4637                            tonic::body::Body::default(),
4638                        );
4639                        let headers = response.headers_mut();
4640                        headers
4641                            .insert(
4642                                tonic::Status::GRPC_STATUS,
4643                                (tonic::Code::Unimplemented as i32).into(),
4644                            );
4645                        headers
4646                            .insert(
4647                                http::header::CONTENT_TYPE,
4648                                tonic::metadata::GRPC_CONTENT_TYPE,
4649                            );
4650                        Ok(response)
4651                    })
4652                }
4653            }
4654        }
4655    }
4656    impl<T> Clone for DeviceServiceServer<T> {
4657        fn clone(&self) -> Self {
4658            let inner = self.inner.clone();
4659            Self {
4660                inner,
4661                accept_compression_encodings: self.accept_compression_encodings,
4662                send_compression_encodings: self.send_compression_encodings,
4663                max_decoding_message_size: self.max_decoding_message_size,
4664                max_encoding_message_size: self.max_encoding_message_size,
4665            }
4666        }
4667    }
4668    /// Generated gRPC service name
4669    pub const SERVICE_NAME: &str = "pidgr.v1.DeviceService";
4670    impl<T> tonic::server::NamedService for DeviceServiceServer<T> {
4671        const NAME: &'static str = SERVICE_NAME;
4672    }
4673}
4674/// Generated client implementations.
4675pub mod group_service_client {
4676    #![allow(
4677        unused_variables,
4678        dead_code,
4679        missing_docs,
4680        clippy::wildcard_imports,
4681        clippy::let_unit_value,
4682    )]
4683    use tonic::codegen::*;
4684    use tonic::codegen::http::Uri;
4685    /** Manages groups and group membership within an organization.
4686 Groups are recipient collections used for campaign audience targeting.
4687 All RPCs operate within the caller's org (extracted from JWT).
4688*/
4689    #[derive(Debug, Clone)]
4690    pub struct GroupServiceClient<T> {
4691        inner: tonic::client::Grpc<T>,
4692    }
4693    impl GroupServiceClient<tonic::transport::Channel> {
4694        /// Attempt to create a new client by connecting to a given endpoint.
4695        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4696        where
4697            D: TryInto<tonic::transport::Endpoint>,
4698            D::Error: Into<StdError>,
4699        {
4700            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4701            Ok(Self::new(conn))
4702        }
4703    }
4704    impl<T> GroupServiceClient<T>
4705    where
4706        T: tonic::client::GrpcService<tonic::body::Body>,
4707        T::Error: Into<StdError>,
4708        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4709        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4710    {
4711        pub fn new(inner: T) -> Self {
4712            let inner = tonic::client::Grpc::new(inner);
4713            Self { inner }
4714        }
4715        pub fn with_origin(inner: T, origin: Uri) -> Self {
4716            let inner = tonic::client::Grpc::with_origin(inner, origin);
4717            Self { inner }
4718        }
4719        pub fn with_interceptor<F>(
4720            inner: T,
4721            interceptor: F,
4722        ) -> GroupServiceClient<InterceptedService<T, F>>
4723        where
4724            F: tonic::service::Interceptor,
4725            T::ResponseBody: Default,
4726            T: tonic::codegen::Service<
4727                http::Request<tonic::body::Body>,
4728                Response = http::Response<
4729                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4730                >,
4731            >,
4732            <T as tonic::codegen::Service<
4733                http::Request<tonic::body::Body>,
4734            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4735        {
4736            GroupServiceClient::new(InterceptedService::new(inner, interceptor))
4737        }
4738        /// Compress requests with the given encoding.
4739        ///
4740        /// This requires the server to support it otherwise it might respond with an
4741        /// error.
4742        #[must_use]
4743        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4744            self.inner = self.inner.send_compressed(encoding);
4745            self
4746        }
4747        /// Enable decompressing responses.
4748        #[must_use]
4749        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4750            self.inner = self.inner.accept_compressed(encoding);
4751            self
4752        }
4753        /// Limits the maximum size of a decoded message.
4754        ///
4755        /// Default: `4MB`
4756        #[must_use]
4757        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4758            self.inner = self.inner.max_decoding_message_size(limit);
4759            self
4760        }
4761        /// Limits the maximum size of an encoded message.
4762        ///
4763        /// Default: `usize::MAX`
4764        #[must_use]
4765        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4766            self.inner = self.inner.max_encoding_message_size(limit);
4767            self
4768        }
4769        /** Create a new group in the organization.
4770 Authorization: Requires PERMISSION_GROUPS_WRITE or PERMISSION_GROUPS_ALL_WRITE.
4771*/
4772        pub async fn create_group(
4773            &mut self,
4774            request: impl tonic::IntoRequest<super::CreateGroupRequest>,
4775        ) -> std::result::Result<
4776            tonic::Response<super::CreateGroupResponse>,
4777            tonic::Status,
4778        > {
4779            self.inner
4780                .ready()
4781                .await
4782                .map_err(|e| {
4783                    tonic::Status::unknown(
4784                        format!("Service was not ready: {}", e.into()),
4785                    )
4786                })?;
4787            let codec = tonic_prost::ProstCodec::default();
4788            let path = http::uri::PathAndQuery::from_static(
4789                "/pidgr.v1.GroupService/CreateGroup",
4790            );
4791            let mut req = request.into_request();
4792            req.extensions_mut()
4793                .insert(GrpcMethod::new("pidgr.v1.GroupService", "CreateGroup"));
4794            self.inner.unary(req, path, codec).await
4795        }
4796        /** Retrieve a group by ID.
4797 Authorization: Caller must be a member of the group, or have
4798 PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
4799*/
4800        pub async fn get_group(
4801            &mut self,
4802            request: impl tonic::IntoRequest<super::GetGroupRequest>,
4803        ) -> std::result::Result<
4804            tonic::Response<super::GetGroupResponse>,
4805            tonic::Status,
4806        > {
4807            self.inner
4808                .ready()
4809                .await
4810                .map_err(|e| {
4811                    tonic::Status::unknown(
4812                        format!("Service was not ready: {}", e.into()),
4813                    )
4814                })?;
4815            let codec = tonic_prost::ProstCodec::default();
4816            let path = http::uri::PathAndQuery::from_static(
4817                "/pidgr.v1.GroupService/GetGroup",
4818            );
4819            let mut req = request.into_request();
4820            req.extensions_mut()
4821                .insert(GrpcMethod::new("pidgr.v1.GroupService", "GetGroup"));
4822            self.inner.unary(req, path, codec).await
4823        }
4824        /** List groups in the organization with pagination.
4825 Without PERMISSION_GROUPS_ALL_READ/ALL_WRITE, returns only groups the caller belongs to.
4826*/
4827        pub async fn list_groups(
4828            &mut self,
4829            request: impl tonic::IntoRequest<super::ListGroupsRequest>,
4830        ) -> std::result::Result<
4831            tonic::Response<super::ListGroupsResponse>,
4832            tonic::Status,
4833        > {
4834            self.inner
4835                .ready()
4836                .await
4837                .map_err(|e| {
4838                    tonic::Status::unknown(
4839                        format!("Service was not ready: {}", e.into()),
4840                    )
4841                })?;
4842            let codec = tonic_prost::ProstCodec::default();
4843            let path = http::uri::PathAndQuery::from_static(
4844                "/pidgr.v1.GroupService/ListGroups",
4845            );
4846            let mut req = request.into_request();
4847            req.extensions_mut()
4848                .insert(GrpcMethod::new("pidgr.v1.GroupService", "ListGroups"));
4849            self.inner.unary(req, path, codec).await
4850        }
4851        /** Update a group's name and/or description.
4852 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
4853*/
4854        pub async fn update_group(
4855            &mut self,
4856            request: impl tonic::IntoRequest<super::UpdateGroupRequest>,
4857        ) -> std::result::Result<
4858            tonic::Response<super::UpdateGroupResponse>,
4859            tonic::Status,
4860        > {
4861            self.inner
4862                .ready()
4863                .await
4864                .map_err(|e| {
4865                    tonic::Status::unknown(
4866                        format!("Service was not ready: {}", e.into()),
4867                    )
4868                })?;
4869            let codec = tonic_prost::ProstCodec::default();
4870            let path = http::uri::PathAndQuery::from_static(
4871                "/pidgr.v1.GroupService/UpdateGroup",
4872            );
4873            let mut req = request.into_request();
4874            req.extensions_mut()
4875                .insert(GrpcMethod::new("pidgr.v1.GroupService", "UpdateGroup"));
4876            self.inner.unary(req, path, codec).await
4877        }
4878        /** Delete a group and all its membership records. Default groups cannot be deleted.
4879 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
4880*/
4881        pub async fn delete_group(
4882            &mut self,
4883            request: impl tonic::IntoRequest<super::DeleteGroupRequest>,
4884        ) -> std::result::Result<
4885            tonic::Response<super::DeleteGroupResponse>,
4886            tonic::Status,
4887        > {
4888            self.inner
4889                .ready()
4890                .await
4891                .map_err(|e| {
4892                    tonic::Status::unknown(
4893                        format!("Service was not ready: {}", e.into()),
4894                    )
4895                })?;
4896            let codec = tonic_prost::ProstCodec::default();
4897            let path = http::uri::PathAndQuery::from_static(
4898                "/pidgr.v1.GroupService/DeleteGroup",
4899            );
4900            let mut req = request.into_request();
4901            req.extensions_mut()
4902                .insert(GrpcMethod::new("pidgr.v1.GroupService", "DeleteGroup"));
4903            self.inner.unary(req, path, codec).await
4904        }
4905        /** Add one or more users to a group (idempotent).
4906 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
4907*/
4908        pub async fn add_group_members(
4909            &mut self,
4910            request: impl tonic::IntoRequest<super::AddGroupMembersRequest>,
4911        ) -> std::result::Result<
4912            tonic::Response<super::AddGroupMembersResponse>,
4913            tonic::Status,
4914        > {
4915            self.inner
4916                .ready()
4917                .await
4918                .map_err(|e| {
4919                    tonic::Status::unknown(
4920                        format!("Service was not ready: {}", e.into()),
4921                    )
4922                })?;
4923            let codec = tonic_prost::ProstCodec::default();
4924            let path = http::uri::PathAndQuery::from_static(
4925                "/pidgr.v1.GroupService/AddGroupMembers",
4926            );
4927            let mut req = request.into_request();
4928            req.extensions_mut()
4929                .insert(GrpcMethod::new("pidgr.v1.GroupService", "AddGroupMembers"));
4930            self.inner.unary(req, path, codec).await
4931        }
4932        /** Remove one or more users from a group (idempotent).
4933 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
4934*/
4935        pub async fn remove_group_members(
4936            &mut self,
4937            request: impl tonic::IntoRequest<super::RemoveGroupMembersRequest>,
4938        ) -> std::result::Result<
4939            tonic::Response<super::RemoveGroupMembersResponse>,
4940            tonic::Status,
4941        > {
4942            self.inner
4943                .ready()
4944                .await
4945                .map_err(|e| {
4946                    tonic::Status::unknown(
4947                        format!("Service was not ready: {}", e.into()),
4948                    )
4949                })?;
4950            let codec = tonic_prost::ProstCodec::default();
4951            let path = http::uri::PathAndQuery::from_static(
4952                "/pidgr.v1.GroupService/RemoveGroupMembers",
4953            );
4954            let mut req = request.into_request();
4955            req.extensions_mut()
4956                .insert(GrpcMethod::new("pidgr.v1.GroupService", "RemoveGroupMembers"));
4957            self.inner.unary(req, path, codec).await
4958        }
4959        /** List members of a group with pagination.
4960 Authorization: Caller must be a member of the group, or have
4961 PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
4962*/
4963        pub async fn list_group_members(
4964            &mut self,
4965            request: impl tonic::IntoRequest<super::ListGroupMembersRequest>,
4966        ) -> std::result::Result<
4967            tonic::Response<super::ListGroupMembersResponse>,
4968            tonic::Status,
4969        > {
4970            self.inner
4971                .ready()
4972                .await
4973                .map_err(|e| {
4974                    tonic::Status::unknown(
4975                        format!("Service was not ready: {}", e.into()),
4976                    )
4977                })?;
4978            let codec = tonic_prost::ProstCodec::default();
4979            let path = http::uri::PathAndQuery::from_static(
4980                "/pidgr.v1.GroupService/ListGroupMembers",
4981            );
4982            let mut req = request.into_request();
4983            req.extensions_mut()
4984                .insert(GrpcMethod::new("pidgr.v1.GroupService", "ListGroupMembers"));
4985            self.inner.unary(req, path, codec).await
4986        }
4987        /** Get group memberships for a batch of users.
4988 Used by campaign audience to show group badges.
4989 Authorization: Requires PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
4990*/
4991        pub async fn get_user_group_memberships(
4992            &mut self,
4993            request: impl tonic::IntoRequest<super::GetUserGroupMembershipsRequest>,
4994        ) -> std::result::Result<
4995            tonic::Response<super::GetUserGroupMembershipsResponse>,
4996            tonic::Status,
4997        > {
4998            self.inner
4999                .ready()
5000                .await
5001                .map_err(|e| {
5002                    tonic::Status::unknown(
5003                        format!("Service was not ready: {}", e.into()),
5004                    )
5005                })?;
5006            let codec = tonic_prost::ProstCodec::default();
5007            let path = http::uri::PathAndQuery::from_static(
5008                "/pidgr.v1.GroupService/GetUserGroupMemberships",
5009            );
5010            let mut req = request.into_request();
5011            req.extensions_mut()
5012                .insert(
5013                    GrpcMethod::new("pidgr.v1.GroupService", "GetUserGroupMemberships"),
5014                );
5015            self.inner.unary(req, path, codec).await
5016        }
5017    }
5018}
5019/// Generated server implementations.
5020pub mod group_service_server {
5021    #![allow(
5022        unused_variables,
5023        dead_code,
5024        missing_docs,
5025        clippy::wildcard_imports,
5026        clippy::let_unit_value,
5027    )]
5028    use tonic::codegen::*;
5029    /// Generated trait containing gRPC methods that should be implemented for use with GroupServiceServer.
5030    #[async_trait]
5031    pub trait GroupService: std::marker::Send + std::marker::Sync + 'static {
5032        /** Create a new group in the organization.
5033 Authorization: Requires PERMISSION_GROUPS_WRITE or PERMISSION_GROUPS_ALL_WRITE.
5034*/
5035        async fn create_group(
5036            &self,
5037            request: tonic::Request<super::CreateGroupRequest>,
5038        ) -> std::result::Result<
5039            tonic::Response<super::CreateGroupResponse>,
5040            tonic::Status,
5041        >;
5042        /** Retrieve a group by ID.
5043 Authorization: Caller must be a member of the group, or have
5044 PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
5045*/
5046        async fn get_group(
5047            &self,
5048            request: tonic::Request<super::GetGroupRequest>,
5049        ) -> std::result::Result<
5050            tonic::Response<super::GetGroupResponse>,
5051            tonic::Status,
5052        >;
5053        /** List groups in the organization with pagination.
5054 Without PERMISSION_GROUPS_ALL_READ/ALL_WRITE, returns only groups the caller belongs to.
5055*/
5056        async fn list_groups(
5057            &self,
5058            request: tonic::Request<super::ListGroupsRequest>,
5059        ) -> std::result::Result<
5060            tonic::Response<super::ListGroupsResponse>,
5061            tonic::Status,
5062        >;
5063        /** Update a group's name and/or description.
5064 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
5065*/
5066        async fn update_group(
5067            &self,
5068            request: tonic::Request<super::UpdateGroupRequest>,
5069        ) -> std::result::Result<
5070            tonic::Response<super::UpdateGroupResponse>,
5071            tonic::Status,
5072        >;
5073        /** Delete a group and all its membership records. Default groups cannot be deleted.
5074 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
5075*/
5076        async fn delete_group(
5077            &self,
5078            request: tonic::Request<super::DeleteGroupRequest>,
5079        ) -> std::result::Result<
5080            tonic::Response<super::DeleteGroupResponse>,
5081            tonic::Status,
5082        >;
5083        /** Add one or more users to a group (idempotent).
5084 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
5085*/
5086        async fn add_group_members(
5087            &self,
5088            request: tonic::Request<super::AddGroupMembersRequest>,
5089        ) -> std::result::Result<
5090            tonic::Response<super::AddGroupMembersResponse>,
5091            tonic::Status,
5092        >;
5093        /** Remove one or more users from a group (idempotent).
5094 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
5095*/
5096        async fn remove_group_members(
5097            &self,
5098            request: tonic::Request<super::RemoveGroupMembersRequest>,
5099        ) -> std::result::Result<
5100            tonic::Response<super::RemoveGroupMembersResponse>,
5101            tonic::Status,
5102        >;
5103        /** List members of a group with pagination.
5104 Authorization: Caller must be a member of the group, or have
5105 PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
5106*/
5107        async fn list_group_members(
5108            &self,
5109            request: tonic::Request<super::ListGroupMembersRequest>,
5110        ) -> std::result::Result<
5111            tonic::Response<super::ListGroupMembersResponse>,
5112            tonic::Status,
5113        >;
5114        /** Get group memberships for a batch of users.
5115 Used by campaign audience to show group badges.
5116 Authorization: Requires PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
5117*/
5118        async fn get_user_group_memberships(
5119            &self,
5120            request: tonic::Request<super::GetUserGroupMembershipsRequest>,
5121        ) -> std::result::Result<
5122            tonic::Response<super::GetUserGroupMembershipsResponse>,
5123            tonic::Status,
5124        >;
5125    }
5126    /** Manages groups and group membership within an organization.
5127 Groups are recipient collections used for campaign audience targeting.
5128 All RPCs operate within the caller's org (extracted from JWT).
5129*/
5130    #[derive(Debug)]
5131    pub struct GroupServiceServer<T> {
5132        inner: Arc<T>,
5133        accept_compression_encodings: EnabledCompressionEncodings,
5134        send_compression_encodings: EnabledCompressionEncodings,
5135        max_decoding_message_size: Option<usize>,
5136        max_encoding_message_size: Option<usize>,
5137    }
5138    impl<T> GroupServiceServer<T> {
5139        pub fn new(inner: T) -> Self {
5140            Self::from_arc(Arc::new(inner))
5141        }
5142        pub fn from_arc(inner: Arc<T>) -> Self {
5143            Self {
5144                inner,
5145                accept_compression_encodings: Default::default(),
5146                send_compression_encodings: Default::default(),
5147                max_decoding_message_size: None,
5148                max_encoding_message_size: None,
5149            }
5150        }
5151        pub fn with_interceptor<F>(
5152            inner: T,
5153            interceptor: F,
5154        ) -> InterceptedService<Self, F>
5155        where
5156            F: tonic::service::Interceptor,
5157        {
5158            InterceptedService::new(Self::new(inner), interceptor)
5159        }
5160        /// Enable decompressing requests with the given encoding.
5161        #[must_use]
5162        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5163            self.accept_compression_encodings.enable(encoding);
5164            self
5165        }
5166        /// Compress responses with the given encoding, if the client supports it.
5167        #[must_use]
5168        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5169            self.send_compression_encodings.enable(encoding);
5170            self
5171        }
5172        /// Limits the maximum size of a decoded message.
5173        ///
5174        /// Default: `4MB`
5175        #[must_use]
5176        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5177            self.max_decoding_message_size = Some(limit);
5178            self
5179        }
5180        /// Limits the maximum size of an encoded message.
5181        ///
5182        /// Default: `usize::MAX`
5183        #[must_use]
5184        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5185            self.max_encoding_message_size = Some(limit);
5186            self
5187        }
5188    }
5189    impl<T, B> tonic::codegen::Service<http::Request<B>> for GroupServiceServer<T>
5190    where
5191        T: GroupService,
5192        B: Body + std::marker::Send + 'static,
5193        B::Error: Into<StdError> + std::marker::Send + 'static,
5194    {
5195        type Response = http::Response<tonic::body::Body>;
5196        type Error = std::convert::Infallible;
5197        type Future = BoxFuture<Self::Response, Self::Error>;
5198        fn poll_ready(
5199            &mut self,
5200            _cx: &mut Context<'_>,
5201        ) -> Poll<std::result::Result<(), Self::Error>> {
5202            Poll::Ready(Ok(()))
5203        }
5204        fn call(&mut self, req: http::Request<B>) -> Self::Future {
5205            match req.uri().path() {
5206                "/pidgr.v1.GroupService/CreateGroup" => {
5207                    #[allow(non_camel_case_types)]
5208                    struct CreateGroupSvc<T: GroupService>(pub Arc<T>);
5209                    impl<
5210                        T: GroupService,
5211                    > tonic::server::UnaryService<super::CreateGroupRequest>
5212                    for CreateGroupSvc<T> {
5213                        type Response = super::CreateGroupResponse;
5214                        type Future = BoxFuture<
5215                            tonic::Response<Self::Response>,
5216                            tonic::Status,
5217                        >;
5218                        fn call(
5219                            &mut self,
5220                            request: tonic::Request<super::CreateGroupRequest>,
5221                        ) -> Self::Future {
5222                            let inner = Arc::clone(&self.0);
5223                            let fut = async move {
5224                                <T as GroupService>::create_group(&inner, request).await
5225                            };
5226                            Box::pin(fut)
5227                        }
5228                    }
5229                    let accept_compression_encodings = self.accept_compression_encodings;
5230                    let send_compression_encodings = self.send_compression_encodings;
5231                    let max_decoding_message_size = self.max_decoding_message_size;
5232                    let max_encoding_message_size = self.max_encoding_message_size;
5233                    let inner = self.inner.clone();
5234                    let fut = async move {
5235                        let method = CreateGroupSvc(inner);
5236                        let codec = tonic_prost::ProstCodec::default();
5237                        let mut grpc = tonic::server::Grpc::new(codec)
5238                            .apply_compression_config(
5239                                accept_compression_encodings,
5240                                send_compression_encodings,
5241                            )
5242                            .apply_max_message_size_config(
5243                                max_decoding_message_size,
5244                                max_encoding_message_size,
5245                            );
5246                        let res = grpc.unary(method, req).await;
5247                        Ok(res)
5248                    };
5249                    Box::pin(fut)
5250                }
5251                "/pidgr.v1.GroupService/GetGroup" => {
5252                    #[allow(non_camel_case_types)]
5253                    struct GetGroupSvc<T: GroupService>(pub Arc<T>);
5254                    impl<
5255                        T: GroupService,
5256                    > tonic::server::UnaryService<super::GetGroupRequest>
5257                    for GetGroupSvc<T> {
5258                        type Response = super::GetGroupResponse;
5259                        type Future = BoxFuture<
5260                            tonic::Response<Self::Response>,
5261                            tonic::Status,
5262                        >;
5263                        fn call(
5264                            &mut self,
5265                            request: tonic::Request<super::GetGroupRequest>,
5266                        ) -> Self::Future {
5267                            let inner = Arc::clone(&self.0);
5268                            let fut = async move {
5269                                <T as GroupService>::get_group(&inner, request).await
5270                            };
5271                            Box::pin(fut)
5272                        }
5273                    }
5274                    let accept_compression_encodings = self.accept_compression_encodings;
5275                    let send_compression_encodings = self.send_compression_encodings;
5276                    let max_decoding_message_size = self.max_decoding_message_size;
5277                    let max_encoding_message_size = self.max_encoding_message_size;
5278                    let inner = self.inner.clone();
5279                    let fut = async move {
5280                        let method = GetGroupSvc(inner);
5281                        let codec = tonic_prost::ProstCodec::default();
5282                        let mut grpc = tonic::server::Grpc::new(codec)
5283                            .apply_compression_config(
5284                                accept_compression_encodings,
5285                                send_compression_encodings,
5286                            )
5287                            .apply_max_message_size_config(
5288                                max_decoding_message_size,
5289                                max_encoding_message_size,
5290                            );
5291                        let res = grpc.unary(method, req).await;
5292                        Ok(res)
5293                    };
5294                    Box::pin(fut)
5295                }
5296                "/pidgr.v1.GroupService/ListGroups" => {
5297                    #[allow(non_camel_case_types)]
5298                    struct ListGroupsSvc<T: GroupService>(pub Arc<T>);
5299                    impl<
5300                        T: GroupService,
5301                    > tonic::server::UnaryService<super::ListGroupsRequest>
5302                    for ListGroupsSvc<T> {
5303                        type Response = super::ListGroupsResponse;
5304                        type Future = BoxFuture<
5305                            tonic::Response<Self::Response>,
5306                            tonic::Status,
5307                        >;
5308                        fn call(
5309                            &mut self,
5310                            request: tonic::Request<super::ListGroupsRequest>,
5311                        ) -> Self::Future {
5312                            let inner = Arc::clone(&self.0);
5313                            let fut = async move {
5314                                <T as GroupService>::list_groups(&inner, request).await
5315                            };
5316                            Box::pin(fut)
5317                        }
5318                    }
5319                    let accept_compression_encodings = self.accept_compression_encodings;
5320                    let send_compression_encodings = self.send_compression_encodings;
5321                    let max_decoding_message_size = self.max_decoding_message_size;
5322                    let max_encoding_message_size = self.max_encoding_message_size;
5323                    let inner = self.inner.clone();
5324                    let fut = async move {
5325                        let method = ListGroupsSvc(inner);
5326                        let codec = tonic_prost::ProstCodec::default();
5327                        let mut grpc = tonic::server::Grpc::new(codec)
5328                            .apply_compression_config(
5329                                accept_compression_encodings,
5330                                send_compression_encodings,
5331                            )
5332                            .apply_max_message_size_config(
5333                                max_decoding_message_size,
5334                                max_encoding_message_size,
5335                            );
5336                        let res = grpc.unary(method, req).await;
5337                        Ok(res)
5338                    };
5339                    Box::pin(fut)
5340                }
5341                "/pidgr.v1.GroupService/UpdateGroup" => {
5342                    #[allow(non_camel_case_types)]
5343                    struct UpdateGroupSvc<T: GroupService>(pub Arc<T>);
5344                    impl<
5345                        T: GroupService,
5346                    > tonic::server::UnaryService<super::UpdateGroupRequest>
5347                    for UpdateGroupSvc<T> {
5348                        type Response = super::UpdateGroupResponse;
5349                        type Future = BoxFuture<
5350                            tonic::Response<Self::Response>,
5351                            tonic::Status,
5352                        >;
5353                        fn call(
5354                            &mut self,
5355                            request: tonic::Request<super::UpdateGroupRequest>,
5356                        ) -> Self::Future {
5357                            let inner = Arc::clone(&self.0);
5358                            let fut = async move {
5359                                <T as GroupService>::update_group(&inner, request).await
5360                            };
5361                            Box::pin(fut)
5362                        }
5363                    }
5364                    let accept_compression_encodings = self.accept_compression_encodings;
5365                    let send_compression_encodings = self.send_compression_encodings;
5366                    let max_decoding_message_size = self.max_decoding_message_size;
5367                    let max_encoding_message_size = self.max_encoding_message_size;
5368                    let inner = self.inner.clone();
5369                    let fut = async move {
5370                        let method = UpdateGroupSvc(inner);
5371                        let codec = tonic_prost::ProstCodec::default();
5372                        let mut grpc = tonic::server::Grpc::new(codec)
5373                            .apply_compression_config(
5374                                accept_compression_encodings,
5375                                send_compression_encodings,
5376                            )
5377                            .apply_max_message_size_config(
5378                                max_decoding_message_size,
5379                                max_encoding_message_size,
5380                            );
5381                        let res = grpc.unary(method, req).await;
5382                        Ok(res)
5383                    };
5384                    Box::pin(fut)
5385                }
5386                "/pidgr.v1.GroupService/DeleteGroup" => {
5387                    #[allow(non_camel_case_types)]
5388                    struct DeleteGroupSvc<T: GroupService>(pub Arc<T>);
5389                    impl<
5390                        T: GroupService,
5391                    > tonic::server::UnaryService<super::DeleteGroupRequest>
5392                    for DeleteGroupSvc<T> {
5393                        type Response = super::DeleteGroupResponse;
5394                        type Future = BoxFuture<
5395                            tonic::Response<Self::Response>,
5396                            tonic::Status,
5397                        >;
5398                        fn call(
5399                            &mut self,
5400                            request: tonic::Request<super::DeleteGroupRequest>,
5401                        ) -> Self::Future {
5402                            let inner = Arc::clone(&self.0);
5403                            let fut = async move {
5404                                <T as GroupService>::delete_group(&inner, request).await
5405                            };
5406                            Box::pin(fut)
5407                        }
5408                    }
5409                    let accept_compression_encodings = self.accept_compression_encodings;
5410                    let send_compression_encodings = self.send_compression_encodings;
5411                    let max_decoding_message_size = self.max_decoding_message_size;
5412                    let max_encoding_message_size = self.max_encoding_message_size;
5413                    let inner = self.inner.clone();
5414                    let fut = async move {
5415                        let method = DeleteGroupSvc(inner);
5416                        let codec = tonic_prost::ProstCodec::default();
5417                        let mut grpc = tonic::server::Grpc::new(codec)
5418                            .apply_compression_config(
5419                                accept_compression_encodings,
5420                                send_compression_encodings,
5421                            )
5422                            .apply_max_message_size_config(
5423                                max_decoding_message_size,
5424                                max_encoding_message_size,
5425                            );
5426                        let res = grpc.unary(method, req).await;
5427                        Ok(res)
5428                    };
5429                    Box::pin(fut)
5430                }
5431                "/pidgr.v1.GroupService/AddGroupMembers" => {
5432                    #[allow(non_camel_case_types)]
5433                    struct AddGroupMembersSvc<T: GroupService>(pub Arc<T>);
5434                    impl<
5435                        T: GroupService,
5436                    > tonic::server::UnaryService<super::AddGroupMembersRequest>
5437                    for AddGroupMembersSvc<T> {
5438                        type Response = super::AddGroupMembersResponse;
5439                        type Future = BoxFuture<
5440                            tonic::Response<Self::Response>,
5441                            tonic::Status,
5442                        >;
5443                        fn call(
5444                            &mut self,
5445                            request: tonic::Request<super::AddGroupMembersRequest>,
5446                        ) -> Self::Future {
5447                            let inner = Arc::clone(&self.0);
5448                            let fut = async move {
5449                                <T as GroupService>::add_group_members(&inner, request)
5450                                    .await
5451                            };
5452                            Box::pin(fut)
5453                        }
5454                    }
5455                    let accept_compression_encodings = self.accept_compression_encodings;
5456                    let send_compression_encodings = self.send_compression_encodings;
5457                    let max_decoding_message_size = self.max_decoding_message_size;
5458                    let max_encoding_message_size = self.max_encoding_message_size;
5459                    let inner = self.inner.clone();
5460                    let fut = async move {
5461                        let method = AddGroupMembersSvc(inner);
5462                        let codec = tonic_prost::ProstCodec::default();
5463                        let mut grpc = tonic::server::Grpc::new(codec)
5464                            .apply_compression_config(
5465                                accept_compression_encodings,
5466                                send_compression_encodings,
5467                            )
5468                            .apply_max_message_size_config(
5469                                max_decoding_message_size,
5470                                max_encoding_message_size,
5471                            );
5472                        let res = grpc.unary(method, req).await;
5473                        Ok(res)
5474                    };
5475                    Box::pin(fut)
5476                }
5477                "/pidgr.v1.GroupService/RemoveGroupMembers" => {
5478                    #[allow(non_camel_case_types)]
5479                    struct RemoveGroupMembersSvc<T: GroupService>(pub Arc<T>);
5480                    impl<
5481                        T: GroupService,
5482                    > tonic::server::UnaryService<super::RemoveGroupMembersRequest>
5483                    for RemoveGroupMembersSvc<T> {
5484                        type Response = super::RemoveGroupMembersResponse;
5485                        type Future = BoxFuture<
5486                            tonic::Response<Self::Response>,
5487                            tonic::Status,
5488                        >;
5489                        fn call(
5490                            &mut self,
5491                            request: tonic::Request<super::RemoveGroupMembersRequest>,
5492                        ) -> Self::Future {
5493                            let inner = Arc::clone(&self.0);
5494                            let fut = async move {
5495                                <T as GroupService>::remove_group_members(&inner, request)
5496                                    .await
5497                            };
5498                            Box::pin(fut)
5499                        }
5500                    }
5501                    let accept_compression_encodings = self.accept_compression_encodings;
5502                    let send_compression_encodings = self.send_compression_encodings;
5503                    let max_decoding_message_size = self.max_decoding_message_size;
5504                    let max_encoding_message_size = self.max_encoding_message_size;
5505                    let inner = self.inner.clone();
5506                    let fut = async move {
5507                        let method = RemoveGroupMembersSvc(inner);
5508                        let codec = tonic_prost::ProstCodec::default();
5509                        let mut grpc = tonic::server::Grpc::new(codec)
5510                            .apply_compression_config(
5511                                accept_compression_encodings,
5512                                send_compression_encodings,
5513                            )
5514                            .apply_max_message_size_config(
5515                                max_decoding_message_size,
5516                                max_encoding_message_size,
5517                            );
5518                        let res = grpc.unary(method, req).await;
5519                        Ok(res)
5520                    };
5521                    Box::pin(fut)
5522                }
5523                "/pidgr.v1.GroupService/ListGroupMembers" => {
5524                    #[allow(non_camel_case_types)]
5525                    struct ListGroupMembersSvc<T: GroupService>(pub Arc<T>);
5526                    impl<
5527                        T: GroupService,
5528                    > tonic::server::UnaryService<super::ListGroupMembersRequest>
5529                    for ListGroupMembersSvc<T> {
5530                        type Response = super::ListGroupMembersResponse;
5531                        type Future = BoxFuture<
5532                            tonic::Response<Self::Response>,
5533                            tonic::Status,
5534                        >;
5535                        fn call(
5536                            &mut self,
5537                            request: tonic::Request<super::ListGroupMembersRequest>,
5538                        ) -> Self::Future {
5539                            let inner = Arc::clone(&self.0);
5540                            let fut = async move {
5541                                <T as GroupService>::list_group_members(&inner, request)
5542                                    .await
5543                            };
5544                            Box::pin(fut)
5545                        }
5546                    }
5547                    let accept_compression_encodings = self.accept_compression_encodings;
5548                    let send_compression_encodings = self.send_compression_encodings;
5549                    let max_decoding_message_size = self.max_decoding_message_size;
5550                    let max_encoding_message_size = self.max_encoding_message_size;
5551                    let inner = self.inner.clone();
5552                    let fut = async move {
5553                        let method = ListGroupMembersSvc(inner);
5554                        let codec = tonic_prost::ProstCodec::default();
5555                        let mut grpc = tonic::server::Grpc::new(codec)
5556                            .apply_compression_config(
5557                                accept_compression_encodings,
5558                                send_compression_encodings,
5559                            )
5560                            .apply_max_message_size_config(
5561                                max_decoding_message_size,
5562                                max_encoding_message_size,
5563                            );
5564                        let res = grpc.unary(method, req).await;
5565                        Ok(res)
5566                    };
5567                    Box::pin(fut)
5568                }
5569                "/pidgr.v1.GroupService/GetUserGroupMemberships" => {
5570                    #[allow(non_camel_case_types)]
5571                    struct GetUserGroupMembershipsSvc<T: GroupService>(pub Arc<T>);
5572                    impl<
5573                        T: GroupService,
5574                    > tonic::server::UnaryService<super::GetUserGroupMembershipsRequest>
5575                    for GetUserGroupMembershipsSvc<T> {
5576                        type Response = super::GetUserGroupMembershipsResponse;
5577                        type Future = BoxFuture<
5578                            tonic::Response<Self::Response>,
5579                            tonic::Status,
5580                        >;
5581                        fn call(
5582                            &mut self,
5583                            request: tonic::Request<
5584                                super::GetUserGroupMembershipsRequest,
5585                            >,
5586                        ) -> Self::Future {
5587                            let inner = Arc::clone(&self.0);
5588                            let fut = async move {
5589                                <T as GroupService>::get_user_group_memberships(
5590                                        &inner,
5591                                        request,
5592                                    )
5593                                    .await
5594                            };
5595                            Box::pin(fut)
5596                        }
5597                    }
5598                    let accept_compression_encodings = self.accept_compression_encodings;
5599                    let send_compression_encodings = self.send_compression_encodings;
5600                    let max_decoding_message_size = self.max_decoding_message_size;
5601                    let max_encoding_message_size = self.max_encoding_message_size;
5602                    let inner = self.inner.clone();
5603                    let fut = async move {
5604                        let method = GetUserGroupMembershipsSvc(inner);
5605                        let codec = tonic_prost::ProstCodec::default();
5606                        let mut grpc = tonic::server::Grpc::new(codec)
5607                            .apply_compression_config(
5608                                accept_compression_encodings,
5609                                send_compression_encodings,
5610                            )
5611                            .apply_max_message_size_config(
5612                                max_decoding_message_size,
5613                                max_encoding_message_size,
5614                            );
5615                        let res = grpc.unary(method, req).await;
5616                        Ok(res)
5617                    };
5618                    Box::pin(fut)
5619                }
5620                _ => {
5621                    Box::pin(async move {
5622                        let mut response = http::Response::new(
5623                            tonic::body::Body::default(),
5624                        );
5625                        let headers = response.headers_mut();
5626                        headers
5627                            .insert(
5628                                tonic::Status::GRPC_STATUS,
5629                                (tonic::Code::Unimplemented as i32).into(),
5630                            );
5631                        headers
5632                            .insert(
5633                                http::header::CONTENT_TYPE,
5634                                tonic::metadata::GRPC_CONTENT_TYPE,
5635                            );
5636                        Ok(response)
5637                    })
5638                }
5639            }
5640        }
5641    }
5642    impl<T> Clone for GroupServiceServer<T> {
5643        fn clone(&self) -> Self {
5644            let inner = self.inner.clone();
5645            Self {
5646                inner,
5647                accept_compression_encodings: self.accept_compression_encodings,
5648                send_compression_encodings: self.send_compression_encodings,
5649                max_decoding_message_size: self.max_decoding_message_size,
5650                max_encoding_message_size: self.max_encoding_message_size,
5651            }
5652        }
5653    }
5654    /// Generated gRPC service name
5655    pub const SERVICE_NAME: &str = "pidgr.v1.GroupService";
5656    impl<T> tonic::server::NamedService for GroupServiceServer<T> {
5657        const NAME: &'static str = SERVICE_NAME;
5658    }
5659}
5660/// Generated client implementations.
5661pub mod heatmap_service_client {
5662    #![allow(
5663        unused_variables,
5664        dead_code,
5665        missing_docs,
5666        clippy::wildcard_imports,
5667        clippy::let_unit_value,
5668    )]
5669    use tonic::codegen::*;
5670    use tonic::codegen::http::Uri;
5671    /** Manages touch event ingestion, heatmap data aggregation, and screen screenshots
5672 for mobile app interaction analytics.
5673*/
5674    #[derive(Debug, Clone)]
5675    pub struct HeatmapServiceClient<T> {
5676        inner: tonic::client::Grpc<T>,
5677    }
5678    impl HeatmapServiceClient<tonic::transport::Channel> {
5679        /// Attempt to create a new client by connecting to a given endpoint.
5680        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5681        where
5682            D: TryInto<tonic::transport::Endpoint>,
5683            D::Error: Into<StdError>,
5684        {
5685            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5686            Ok(Self::new(conn))
5687        }
5688    }
5689    impl<T> HeatmapServiceClient<T>
5690    where
5691        T: tonic::client::GrpcService<tonic::body::Body>,
5692        T::Error: Into<StdError>,
5693        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5694        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5695    {
5696        pub fn new(inner: T) -> Self {
5697            let inner = tonic::client::Grpc::new(inner);
5698            Self { inner }
5699        }
5700        pub fn with_origin(inner: T, origin: Uri) -> Self {
5701            let inner = tonic::client::Grpc::with_origin(inner, origin);
5702            Self { inner }
5703        }
5704        pub fn with_interceptor<F>(
5705            inner: T,
5706            interceptor: F,
5707        ) -> HeatmapServiceClient<InterceptedService<T, F>>
5708        where
5709            F: tonic::service::Interceptor,
5710            T::ResponseBody: Default,
5711            T: tonic::codegen::Service<
5712                http::Request<tonic::body::Body>,
5713                Response = http::Response<
5714                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
5715                >,
5716            >,
5717            <T as tonic::codegen::Service<
5718                http::Request<tonic::body::Body>,
5719            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
5720        {
5721            HeatmapServiceClient::new(InterceptedService::new(inner, interceptor))
5722        }
5723        /// Compress requests with the given encoding.
5724        ///
5725        /// This requires the server to support it otherwise it might respond with an
5726        /// error.
5727        #[must_use]
5728        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5729            self.inner = self.inner.send_compressed(encoding);
5730            self
5731        }
5732        /// Enable decompressing responses.
5733        #[must_use]
5734        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5735            self.inner = self.inner.accept_compressed(encoding);
5736            self
5737        }
5738        /// Limits the maximum size of a decoded message.
5739        ///
5740        /// Default: `4MB`
5741        #[must_use]
5742        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5743            self.inner = self.inner.max_decoding_message_size(limit);
5744            self
5745        }
5746        /// Limits the maximum size of an encoded message.
5747        ///
5748        /// Default: `usize::MAX`
5749        #[must_use]
5750        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5751            self.inner = self.inner.max_encoding_message_size(limit);
5752            self
5753        }
5754        /** Ingest a batch of touch events from the mobile app.
5755 Authorization: Authenticated mobile user.
5756*/
5757        pub async fn ingest_touch_events(
5758            &mut self,
5759            request: impl tonic::IntoRequest<super::IngestTouchEventsRequest>,
5760        ) -> std::result::Result<
5761            tonic::Response<super::IngestTouchEventsResponse>,
5762            tonic::Status,
5763        > {
5764            self.inner
5765                .ready()
5766                .await
5767                .map_err(|e| {
5768                    tonic::Status::unknown(
5769                        format!("Service was not ready: {}", e.into()),
5770                    )
5771                })?;
5772            let codec = tonic_prost::ProstCodec::default();
5773            let path = http::uri::PathAndQuery::from_static(
5774                "/pidgr.v1.HeatmapService/IngestTouchEvents",
5775            );
5776            let mut req = request.into_request();
5777            req.extensions_mut()
5778                .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "IngestTouchEvents"));
5779            self.inner.unary(req, path, codec).await
5780        }
5781        /** Query aggregated touch data for heatmap rendering.
5782 Authorization: Requires CAMPAIGNS_READ permission.
5783*/
5784        pub async fn query_heatmap_data(
5785            &mut self,
5786            request: impl tonic::IntoRequest<super::QueryHeatmapDataRequest>,
5787        ) -> std::result::Result<
5788            tonic::Response<super::QueryHeatmapDataResponse>,
5789            tonic::Status,
5790        > {
5791            self.inner
5792                .ready()
5793                .await
5794                .map_err(|e| {
5795                    tonic::Status::unknown(
5796                        format!("Service was not ready: {}", e.into()),
5797                    )
5798                })?;
5799            let codec = tonic_prost::ProstCodec::default();
5800            let path = http::uri::PathAndQuery::from_static(
5801                "/pidgr.v1.HeatmapService/QueryHeatmapData",
5802            );
5803            let mut req = request.into_request();
5804            req.extensions_mut()
5805                .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "QueryHeatmapData"));
5806            self.inner.unary(req, path, codec).await
5807        }
5808        /** List available screen screenshots for heatmap backgrounds.
5809 Authorization: Requires CAMPAIGNS_READ permission.
5810*/
5811        pub async fn list_screenshots(
5812            &mut self,
5813            request: impl tonic::IntoRequest<super::ListScreenshotsRequest>,
5814        ) -> std::result::Result<
5815            tonic::Response<super::ListScreenshotsResponse>,
5816            tonic::Status,
5817        > {
5818            self.inner
5819                .ready()
5820                .await
5821                .map_err(|e| {
5822                    tonic::Status::unknown(
5823                        format!("Service was not ready: {}", e.into()),
5824                    )
5825                })?;
5826            let codec = tonic_prost::ProstCodec::default();
5827            let path = http::uri::PathAndQuery::from_static(
5828                "/pidgr.v1.HeatmapService/ListScreenshots",
5829            );
5830            let mut req = request.into_request();
5831            req.extensions_mut()
5832                .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "ListScreenshots"));
5833            self.inner.unary(req, path, codec).await
5834        }
5835        /** Upload a screenshot captured from the mobile app for heatmap backdrops.
5836 Authorization: Authenticated mobile user.
5837*/
5838        pub async fn upload_screenshot(
5839            &mut self,
5840            request: impl tonic::IntoRequest<super::UploadScreenshotRequest>,
5841        ) -> std::result::Result<
5842            tonic::Response<super::UploadScreenshotResponse>,
5843            tonic::Status,
5844        > {
5845            self.inner
5846                .ready()
5847                .await
5848                .map_err(|e| {
5849                    tonic::Status::unknown(
5850                        format!("Service was not ready: {}", e.into()),
5851                    )
5852                })?;
5853            let codec = tonic_prost::ProstCodec::default();
5854            let path = http::uri::PathAndQuery::from_static(
5855                "/pidgr.v1.HeatmapService/UploadScreenshot",
5856            );
5857            let mut req = request.into_request();
5858            req.extensions_mut()
5859                .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "UploadScreenshot"));
5860            self.inner.unary(req, path, codec).await
5861        }
5862    }
5863}
5864/// Generated server implementations.
5865pub mod heatmap_service_server {
5866    #![allow(
5867        unused_variables,
5868        dead_code,
5869        missing_docs,
5870        clippy::wildcard_imports,
5871        clippy::let_unit_value,
5872    )]
5873    use tonic::codegen::*;
5874    /// Generated trait containing gRPC methods that should be implemented for use with HeatmapServiceServer.
5875    #[async_trait]
5876    pub trait HeatmapService: std::marker::Send + std::marker::Sync + 'static {
5877        /** Ingest a batch of touch events from the mobile app.
5878 Authorization: Authenticated mobile user.
5879*/
5880        async fn ingest_touch_events(
5881            &self,
5882            request: tonic::Request<super::IngestTouchEventsRequest>,
5883        ) -> std::result::Result<
5884            tonic::Response<super::IngestTouchEventsResponse>,
5885            tonic::Status,
5886        >;
5887        /** Query aggregated touch data for heatmap rendering.
5888 Authorization: Requires CAMPAIGNS_READ permission.
5889*/
5890        async fn query_heatmap_data(
5891            &self,
5892            request: tonic::Request<super::QueryHeatmapDataRequest>,
5893        ) -> std::result::Result<
5894            tonic::Response<super::QueryHeatmapDataResponse>,
5895            tonic::Status,
5896        >;
5897        /** List available screen screenshots for heatmap backgrounds.
5898 Authorization: Requires CAMPAIGNS_READ permission.
5899*/
5900        async fn list_screenshots(
5901            &self,
5902            request: tonic::Request<super::ListScreenshotsRequest>,
5903        ) -> std::result::Result<
5904            tonic::Response<super::ListScreenshotsResponse>,
5905            tonic::Status,
5906        >;
5907        /** Upload a screenshot captured from the mobile app for heatmap backdrops.
5908 Authorization: Authenticated mobile user.
5909*/
5910        async fn upload_screenshot(
5911            &self,
5912            request: tonic::Request<super::UploadScreenshotRequest>,
5913        ) -> std::result::Result<
5914            tonic::Response<super::UploadScreenshotResponse>,
5915            tonic::Status,
5916        >;
5917    }
5918    /** Manages touch event ingestion, heatmap data aggregation, and screen screenshots
5919 for mobile app interaction analytics.
5920*/
5921    #[derive(Debug)]
5922    pub struct HeatmapServiceServer<T> {
5923        inner: Arc<T>,
5924        accept_compression_encodings: EnabledCompressionEncodings,
5925        send_compression_encodings: EnabledCompressionEncodings,
5926        max_decoding_message_size: Option<usize>,
5927        max_encoding_message_size: Option<usize>,
5928    }
5929    impl<T> HeatmapServiceServer<T> {
5930        pub fn new(inner: T) -> Self {
5931            Self::from_arc(Arc::new(inner))
5932        }
5933        pub fn from_arc(inner: Arc<T>) -> Self {
5934            Self {
5935                inner,
5936                accept_compression_encodings: Default::default(),
5937                send_compression_encodings: Default::default(),
5938                max_decoding_message_size: None,
5939                max_encoding_message_size: None,
5940            }
5941        }
5942        pub fn with_interceptor<F>(
5943            inner: T,
5944            interceptor: F,
5945        ) -> InterceptedService<Self, F>
5946        where
5947            F: tonic::service::Interceptor,
5948        {
5949            InterceptedService::new(Self::new(inner), interceptor)
5950        }
5951        /// Enable decompressing requests with the given encoding.
5952        #[must_use]
5953        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5954            self.accept_compression_encodings.enable(encoding);
5955            self
5956        }
5957        /// Compress responses with the given encoding, if the client supports it.
5958        #[must_use]
5959        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5960            self.send_compression_encodings.enable(encoding);
5961            self
5962        }
5963        /// Limits the maximum size of a decoded message.
5964        ///
5965        /// Default: `4MB`
5966        #[must_use]
5967        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5968            self.max_decoding_message_size = Some(limit);
5969            self
5970        }
5971        /// Limits the maximum size of an encoded message.
5972        ///
5973        /// Default: `usize::MAX`
5974        #[must_use]
5975        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5976            self.max_encoding_message_size = Some(limit);
5977            self
5978        }
5979    }
5980    impl<T, B> tonic::codegen::Service<http::Request<B>> for HeatmapServiceServer<T>
5981    where
5982        T: HeatmapService,
5983        B: Body + std::marker::Send + 'static,
5984        B::Error: Into<StdError> + std::marker::Send + 'static,
5985    {
5986        type Response = http::Response<tonic::body::Body>;
5987        type Error = std::convert::Infallible;
5988        type Future = BoxFuture<Self::Response, Self::Error>;
5989        fn poll_ready(
5990            &mut self,
5991            _cx: &mut Context<'_>,
5992        ) -> Poll<std::result::Result<(), Self::Error>> {
5993            Poll::Ready(Ok(()))
5994        }
5995        fn call(&mut self, req: http::Request<B>) -> Self::Future {
5996            match req.uri().path() {
5997                "/pidgr.v1.HeatmapService/IngestTouchEvents" => {
5998                    #[allow(non_camel_case_types)]
5999                    struct IngestTouchEventsSvc<T: HeatmapService>(pub Arc<T>);
6000                    impl<
6001                        T: HeatmapService,
6002                    > tonic::server::UnaryService<super::IngestTouchEventsRequest>
6003                    for IngestTouchEventsSvc<T> {
6004                        type Response = super::IngestTouchEventsResponse;
6005                        type Future = BoxFuture<
6006                            tonic::Response<Self::Response>,
6007                            tonic::Status,
6008                        >;
6009                        fn call(
6010                            &mut self,
6011                            request: tonic::Request<super::IngestTouchEventsRequest>,
6012                        ) -> Self::Future {
6013                            let inner = Arc::clone(&self.0);
6014                            let fut = async move {
6015                                <T as HeatmapService>::ingest_touch_events(&inner, request)
6016                                    .await
6017                            };
6018                            Box::pin(fut)
6019                        }
6020                    }
6021                    let accept_compression_encodings = self.accept_compression_encodings;
6022                    let send_compression_encodings = self.send_compression_encodings;
6023                    let max_decoding_message_size = self.max_decoding_message_size;
6024                    let max_encoding_message_size = self.max_encoding_message_size;
6025                    let inner = self.inner.clone();
6026                    let fut = async move {
6027                        let method = IngestTouchEventsSvc(inner);
6028                        let codec = tonic_prost::ProstCodec::default();
6029                        let mut grpc = tonic::server::Grpc::new(codec)
6030                            .apply_compression_config(
6031                                accept_compression_encodings,
6032                                send_compression_encodings,
6033                            )
6034                            .apply_max_message_size_config(
6035                                max_decoding_message_size,
6036                                max_encoding_message_size,
6037                            );
6038                        let res = grpc.unary(method, req).await;
6039                        Ok(res)
6040                    };
6041                    Box::pin(fut)
6042                }
6043                "/pidgr.v1.HeatmapService/QueryHeatmapData" => {
6044                    #[allow(non_camel_case_types)]
6045                    struct QueryHeatmapDataSvc<T: HeatmapService>(pub Arc<T>);
6046                    impl<
6047                        T: HeatmapService,
6048                    > tonic::server::UnaryService<super::QueryHeatmapDataRequest>
6049                    for QueryHeatmapDataSvc<T> {
6050                        type Response = super::QueryHeatmapDataResponse;
6051                        type Future = BoxFuture<
6052                            tonic::Response<Self::Response>,
6053                            tonic::Status,
6054                        >;
6055                        fn call(
6056                            &mut self,
6057                            request: tonic::Request<super::QueryHeatmapDataRequest>,
6058                        ) -> Self::Future {
6059                            let inner = Arc::clone(&self.0);
6060                            let fut = async move {
6061                                <T as HeatmapService>::query_heatmap_data(&inner, request)
6062                                    .await
6063                            };
6064                            Box::pin(fut)
6065                        }
6066                    }
6067                    let accept_compression_encodings = self.accept_compression_encodings;
6068                    let send_compression_encodings = self.send_compression_encodings;
6069                    let max_decoding_message_size = self.max_decoding_message_size;
6070                    let max_encoding_message_size = self.max_encoding_message_size;
6071                    let inner = self.inner.clone();
6072                    let fut = async move {
6073                        let method = QueryHeatmapDataSvc(inner);
6074                        let codec = tonic_prost::ProstCodec::default();
6075                        let mut grpc = tonic::server::Grpc::new(codec)
6076                            .apply_compression_config(
6077                                accept_compression_encodings,
6078                                send_compression_encodings,
6079                            )
6080                            .apply_max_message_size_config(
6081                                max_decoding_message_size,
6082                                max_encoding_message_size,
6083                            );
6084                        let res = grpc.unary(method, req).await;
6085                        Ok(res)
6086                    };
6087                    Box::pin(fut)
6088                }
6089                "/pidgr.v1.HeatmapService/ListScreenshots" => {
6090                    #[allow(non_camel_case_types)]
6091                    struct ListScreenshotsSvc<T: HeatmapService>(pub Arc<T>);
6092                    impl<
6093                        T: HeatmapService,
6094                    > tonic::server::UnaryService<super::ListScreenshotsRequest>
6095                    for ListScreenshotsSvc<T> {
6096                        type Response = super::ListScreenshotsResponse;
6097                        type Future = BoxFuture<
6098                            tonic::Response<Self::Response>,
6099                            tonic::Status,
6100                        >;
6101                        fn call(
6102                            &mut self,
6103                            request: tonic::Request<super::ListScreenshotsRequest>,
6104                        ) -> Self::Future {
6105                            let inner = Arc::clone(&self.0);
6106                            let fut = async move {
6107                                <T as HeatmapService>::list_screenshots(&inner, request)
6108                                    .await
6109                            };
6110                            Box::pin(fut)
6111                        }
6112                    }
6113                    let accept_compression_encodings = self.accept_compression_encodings;
6114                    let send_compression_encodings = self.send_compression_encodings;
6115                    let max_decoding_message_size = self.max_decoding_message_size;
6116                    let max_encoding_message_size = self.max_encoding_message_size;
6117                    let inner = self.inner.clone();
6118                    let fut = async move {
6119                        let method = ListScreenshotsSvc(inner);
6120                        let codec = tonic_prost::ProstCodec::default();
6121                        let mut grpc = tonic::server::Grpc::new(codec)
6122                            .apply_compression_config(
6123                                accept_compression_encodings,
6124                                send_compression_encodings,
6125                            )
6126                            .apply_max_message_size_config(
6127                                max_decoding_message_size,
6128                                max_encoding_message_size,
6129                            );
6130                        let res = grpc.unary(method, req).await;
6131                        Ok(res)
6132                    };
6133                    Box::pin(fut)
6134                }
6135                "/pidgr.v1.HeatmapService/UploadScreenshot" => {
6136                    #[allow(non_camel_case_types)]
6137                    struct UploadScreenshotSvc<T: HeatmapService>(pub Arc<T>);
6138                    impl<
6139                        T: HeatmapService,
6140                    > tonic::server::UnaryService<super::UploadScreenshotRequest>
6141                    for UploadScreenshotSvc<T> {
6142                        type Response = super::UploadScreenshotResponse;
6143                        type Future = BoxFuture<
6144                            tonic::Response<Self::Response>,
6145                            tonic::Status,
6146                        >;
6147                        fn call(
6148                            &mut self,
6149                            request: tonic::Request<super::UploadScreenshotRequest>,
6150                        ) -> Self::Future {
6151                            let inner = Arc::clone(&self.0);
6152                            let fut = async move {
6153                                <T as HeatmapService>::upload_screenshot(&inner, request)
6154                                    .await
6155                            };
6156                            Box::pin(fut)
6157                        }
6158                    }
6159                    let accept_compression_encodings = self.accept_compression_encodings;
6160                    let send_compression_encodings = self.send_compression_encodings;
6161                    let max_decoding_message_size = self.max_decoding_message_size;
6162                    let max_encoding_message_size = self.max_encoding_message_size;
6163                    let inner = self.inner.clone();
6164                    let fut = async move {
6165                        let method = UploadScreenshotSvc(inner);
6166                        let codec = tonic_prost::ProstCodec::default();
6167                        let mut grpc = tonic::server::Grpc::new(codec)
6168                            .apply_compression_config(
6169                                accept_compression_encodings,
6170                                send_compression_encodings,
6171                            )
6172                            .apply_max_message_size_config(
6173                                max_decoding_message_size,
6174                                max_encoding_message_size,
6175                            );
6176                        let res = grpc.unary(method, req).await;
6177                        Ok(res)
6178                    };
6179                    Box::pin(fut)
6180                }
6181                _ => {
6182                    Box::pin(async move {
6183                        let mut response = http::Response::new(
6184                            tonic::body::Body::default(),
6185                        );
6186                        let headers = response.headers_mut();
6187                        headers
6188                            .insert(
6189                                tonic::Status::GRPC_STATUS,
6190                                (tonic::Code::Unimplemented as i32).into(),
6191                            );
6192                        headers
6193                            .insert(
6194                                http::header::CONTENT_TYPE,
6195                                tonic::metadata::GRPC_CONTENT_TYPE,
6196                            );
6197                        Ok(response)
6198                    })
6199                }
6200            }
6201        }
6202    }
6203    impl<T> Clone for HeatmapServiceServer<T> {
6204        fn clone(&self) -> Self {
6205            let inner = self.inner.clone();
6206            Self {
6207                inner,
6208                accept_compression_encodings: self.accept_compression_encodings,
6209                send_compression_encodings: self.send_compression_encodings,
6210                max_decoding_message_size: self.max_decoding_message_size,
6211                max_encoding_message_size: self.max_encoding_message_size,
6212            }
6213        }
6214    }
6215    /// Generated gRPC service name
6216    pub const SERVICE_NAME: &str = "pidgr.v1.HeatmapService";
6217    impl<T> tonic::server::NamedService for HeatmapServiceServer<T> {
6218        const NAME: &'static str = SERVICE_NAME;
6219    }
6220}
6221/// Generated client implementations.
6222pub mod inbox_service_client {
6223    #![allow(
6224        unused_variables,
6225        dead_code,
6226        missing_docs,
6227        clippy::wildcard_imports,
6228        clippy::let_unit_value,
6229    )]
6230    use tonic::codegen::*;
6231    use tonic::codegen::http::Uri;
6232    /** Provides the mobile app's inbox experience — syncing messages,
6233 tracking read status, and retrieving individual entries.
6234*/
6235    #[derive(Debug, Clone)]
6236    pub struct InboxServiceClient<T> {
6237        inner: tonic::client::Grpc<T>,
6238    }
6239    impl InboxServiceClient<tonic::transport::Channel> {
6240        /// Attempt to create a new client by connecting to a given endpoint.
6241        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6242        where
6243            D: TryInto<tonic::transport::Endpoint>,
6244            D::Error: Into<StdError>,
6245        {
6246            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6247            Ok(Self::new(conn))
6248        }
6249    }
6250    impl<T> InboxServiceClient<T>
6251    where
6252        T: tonic::client::GrpcService<tonic::body::Body>,
6253        T::Error: Into<StdError>,
6254        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6255        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6256    {
6257        pub fn new(inner: T) -> Self {
6258            let inner = tonic::client::Grpc::new(inner);
6259            Self { inner }
6260        }
6261        pub fn with_origin(inner: T, origin: Uri) -> Self {
6262            let inner = tonic::client::Grpc::with_origin(inner, origin);
6263            Self { inner }
6264        }
6265        pub fn with_interceptor<F>(
6266            inner: T,
6267            interceptor: F,
6268        ) -> InboxServiceClient<InterceptedService<T, F>>
6269        where
6270            F: tonic::service::Interceptor,
6271            T::ResponseBody: Default,
6272            T: tonic::codegen::Service<
6273                http::Request<tonic::body::Body>,
6274                Response = http::Response<
6275                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6276                >,
6277            >,
6278            <T as tonic::codegen::Service<
6279                http::Request<tonic::body::Body>,
6280            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6281        {
6282            InboxServiceClient::new(InterceptedService::new(inner, interceptor))
6283        }
6284        /// Compress requests with the given encoding.
6285        ///
6286        /// This requires the server to support it otherwise it might respond with an
6287        /// error.
6288        #[must_use]
6289        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6290            self.inner = self.inner.send_compressed(encoding);
6291            self
6292        }
6293        /// Enable decompressing responses.
6294        #[must_use]
6295        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6296            self.inner = self.inner.accept_compressed(encoding);
6297            self
6298        }
6299        /// Limits the maximum size of a decoded message.
6300        ///
6301        /// Default: `4MB`
6302        #[must_use]
6303        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6304            self.inner = self.inner.max_decoding_message_size(limit);
6305            self
6306        }
6307        /// Limits the maximum size of an encoded message.
6308        ///
6309        /// Default: `usize::MAX`
6310        #[must_use]
6311        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6312            self.inner = self.inner.max_encoding_message_size(limit);
6313            self
6314        }
6315        /** Sync inbox entries since a given timestamp for incremental updates.
6316 Authorization: Authenticated user (own inbox only).
6317*/
6318        pub async fn sync(
6319            &mut self,
6320            request: impl tonic::IntoRequest<super::SyncRequest>,
6321        ) -> std::result::Result<tonic::Response<super::SyncResponse>, tonic::Status> {
6322            self.inner
6323                .ready()
6324                .await
6325                .map_err(|e| {
6326                    tonic::Status::unknown(
6327                        format!("Service was not ready: {}", e.into()),
6328                    )
6329                })?;
6330            let codec = tonic_prost::ProstCodec::default();
6331            let path = http::uri::PathAndQuery::from_static(
6332                "/pidgr.v1.InboxService/Sync",
6333            );
6334            let mut req = request.into_request();
6335            req.extensions_mut()
6336                .insert(GrpcMethod::new("pidgr.v1.InboxService", "Sync"));
6337            self.inner.unary(req, path, codec).await
6338        }
6339        /** Mark a delivered message as read (analytics-only, does not affect workflow).
6340 Authorization: Authenticated user (own inbox only).
6341*/
6342        pub async fn mark_read(
6343            &mut self,
6344            request: impl tonic::IntoRequest<super::MarkReadRequest>,
6345        ) -> std::result::Result<
6346            tonic::Response<super::MarkReadResponse>,
6347            tonic::Status,
6348        > {
6349            self.inner
6350                .ready()
6351                .await
6352                .map_err(|e| {
6353                    tonic::Status::unknown(
6354                        format!("Service was not ready: {}", e.into()),
6355                    )
6356                })?;
6357            let codec = tonic_prost::ProstCodec::default();
6358            let path = http::uri::PathAndQuery::from_static(
6359                "/pidgr.v1.InboxService/MarkRead",
6360            );
6361            let mut req = request.into_request();
6362            req.extensions_mut()
6363                .insert(GrpcMethod::new("pidgr.v1.InboxService", "MarkRead"));
6364            self.inner.unary(req, path, codec).await
6365        }
6366        /** Retrieve a single inbox entry by delivery ID.
6367 Authorization: Authenticated user (own inbox only).
6368*/
6369        pub async fn get_message(
6370            &mut self,
6371            request: impl tonic::IntoRequest<super::GetMessageRequest>,
6372        ) -> std::result::Result<
6373            tonic::Response<super::GetMessageResponse>,
6374            tonic::Status,
6375        > {
6376            self.inner
6377                .ready()
6378                .await
6379                .map_err(|e| {
6380                    tonic::Status::unknown(
6381                        format!("Service was not ready: {}", e.into()),
6382                    )
6383                })?;
6384            let codec = tonic_prost::ProstCodec::default();
6385            let path = http::uri::PathAndQuery::from_static(
6386                "/pidgr.v1.InboxService/GetMessage",
6387            );
6388            let mut req = request.into_request();
6389            req.extensions_mut()
6390                .insert(GrpcMethod::new("pidgr.v1.InboxService", "GetMessage"));
6391            self.inner.unary(req, path, codec).await
6392        }
6393    }
6394}
6395/// Generated server implementations.
6396pub mod inbox_service_server {
6397    #![allow(
6398        unused_variables,
6399        dead_code,
6400        missing_docs,
6401        clippy::wildcard_imports,
6402        clippy::let_unit_value,
6403    )]
6404    use tonic::codegen::*;
6405    /// Generated trait containing gRPC methods that should be implemented for use with InboxServiceServer.
6406    #[async_trait]
6407    pub trait InboxService: std::marker::Send + std::marker::Sync + 'static {
6408        /** Sync inbox entries since a given timestamp for incremental updates.
6409 Authorization: Authenticated user (own inbox only).
6410*/
6411        async fn sync(
6412            &self,
6413            request: tonic::Request<super::SyncRequest>,
6414        ) -> std::result::Result<tonic::Response<super::SyncResponse>, tonic::Status>;
6415        /** Mark a delivered message as read (analytics-only, does not affect workflow).
6416 Authorization: Authenticated user (own inbox only).
6417*/
6418        async fn mark_read(
6419            &self,
6420            request: tonic::Request<super::MarkReadRequest>,
6421        ) -> std::result::Result<
6422            tonic::Response<super::MarkReadResponse>,
6423            tonic::Status,
6424        >;
6425        /** Retrieve a single inbox entry by delivery ID.
6426 Authorization: Authenticated user (own inbox only).
6427*/
6428        async fn get_message(
6429            &self,
6430            request: tonic::Request<super::GetMessageRequest>,
6431        ) -> std::result::Result<
6432            tonic::Response<super::GetMessageResponse>,
6433            tonic::Status,
6434        >;
6435    }
6436    /** Provides the mobile app's inbox experience — syncing messages,
6437 tracking read status, and retrieving individual entries.
6438*/
6439    #[derive(Debug)]
6440    pub struct InboxServiceServer<T> {
6441        inner: Arc<T>,
6442        accept_compression_encodings: EnabledCompressionEncodings,
6443        send_compression_encodings: EnabledCompressionEncodings,
6444        max_decoding_message_size: Option<usize>,
6445        max_encoding_message_size: Option<usize>,
6446    }
6447    impl<T> InboxServiceServer<T> {
6448        pub fn new(inner: T) -> Self {
6449            Self::from_arc(Arc::new(inner))
6450        }
6451        pub fn from_arc(inner: Arc<T>) -> Self {
6452            Self {
6453                inner,
6454                accept_compression_encodings: Default::default(),
6455                send_compression_encodings: Default::default(),
6456                max_decoding_message_size: None,
6457                max_encoding_message_size: None,
6458            }
6459        }
6460        pub fn with_interceptor<F>(
6461            inner: T,
6462            interceptor: F,
6463        ) -> InterceptedService<Self, F>
6464        where
6465            F: tonic::service::Interceptor,
6466        {
6467            InterceptedService::new(Self::new(inner), interceptor)
6468        }
6469        /// Enable decompressing requests with the given encoding.
6470        #[must_use]
6471        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6472            self.accept_compression_encodings.enable(encoding);
6473            self
6474        }
6475        /// Compress responses with the given encoding, if the client supports it.
6476        #[must_use]
6477        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6478            self.send_compression_encodings.enable(encoding);
6479            self
6480        }
6481        /// Limits the maximum size of a decoded message.
6482        ///
6483        /// Default: `4MB`
6484        #[must_use]
6485        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6486            self.max_decoding_message_size = Some(limit);
6487            self
6488        }
6489        /// Limits the maximum size of an encoded message.
6490        ///
6491        /// Default: `usize::MAX`
6492        #[must_use]
6493        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6494            self.max_encoding_message_size = Some(limit);
6495            self
6496        }
6497    }
6498    impl<T, B> tonic::codegen::Service<http::Request<B>> for InboxServiceServer<T>
6499    where
6500        T: InboxService,
6501        B: Body + std::marker::Send + 'static,
6502        B::Error: Into<StdError> + std::marker::Send + 'static,
6503    {
6504        type Response = http::Response<tonic::body::Body>;
6505        type Error = std::convert::Infallible;
6506        type Future = BoxFuture<Self::Response, Self::Error>;
6507        fn poll_ready(
6508            &mut self,
6509            _cx: &mut Context<'_>,
6510        ) -> Poll<std::result::Result<(), Self::Error>> {
6511            Poll::Ready(Ok(()))
6512        }
6513        fn call(&mut self, req: http::Request<B>) -> Self::Future {
6514            match req.uri().path() {
6515                "/pidgr.v1.InboxService/Sync" => {
6516                    #[allow(non_camel_case_types)]
6517                    struct SyncSvc<T: InboxService>(pub Arc<T>);
6518                    impl<T: InboxService> tonic::server::UnaryService<super::SyncRequest>
6519                    for SyncSvc<T> {
6520                        type Response = super::SyncResponse;
6521                        type Future = BoxFuture<
6522                            tonic::Response<Self::Response>,
6523                            tonic::Status,
6524                        >;
6525                        fn call(
6526                            &mut self,
6527                            request: tonic::Request<super::SyncRequest>,
6528                        ) -> Self::Future {
6529                            let inner = Arc::clone(&self.0);
6530                            let fut = async move {
6531                                <T as InboxService>::sync(&inner, request).await
6532                            };
6533                            Box::pin(fut)
6534                        }
6535                    }
6536                    let accept_compression_encodings = self.accept_compression_encodings;
6537                    let send_compression_encodings = self.send_compression_encodings;
6538                    let max_decoding_message_size = self.max_decoding_message_size;
6539                    let max_encoding_message_size = self.max_encoding_message_size;
6540                    let inner = self.inner.clone();
6541                    let fut = async move {
6542                        let method = SyncSvc(inner);
6543                        let codec = tonic_prost::ProstCodec::default();
6544                        let mut grpc = tonic::server::Grpc::new(codec)
6545                            .apply_compression_config(
6546                                accept_compression_encodings,
6547                                send_compression_encodings,
6548                            )
6549                            .apply_max_message_size_config(
6550                                max_decoding_message_size,
6551                                max_encoding_message_size,
6552                            );
6553                        let res = grpc.unary(method, req).await;
6554                        Ok(res)
6555                    };
6556                    Box::pin(fut)
6557                }
6558                "/pidgr.v1.InboxService/MarkRead" => {
6559                    #[allow(non_camel_case_types)]
6560                    struct MarkReadSvc<T: InboxService>(pub Arc<T>);
6561                    impl<
6562                        T: InboxService,
6563                    > tonic::server::UnaryService<super::MarkReadRequest>
6564                    for MarkReadSvc<T> {
6565                        type Response = super::MarkReadResponse;
6566                        type Future = BoxFuture<
6567                            tonic::Response<Self::Response>,
6568                            tonic::Status,
6569                        >;
6570                        fn call(
6571                            &mut self,
6572                            request: tonic::Request<super::MarkReadRequest>,
6573                        ) -> Self::Future {
6574                            let inner = Arc::clone(&self.0);
6575                            let fut = async move {
6576                                <T as InboxService>::mark_read(&inner, request).await
6577                            };
6578                            Box::pin(fut)
6579                        }
6580                    }
6581                    let accept_compression_encodings = self.accept_compression_encodings;
6582                    let send_compression_encodings = self.send_compression_encodings;
6583                    let max_decoding_message_size = self.max_decoding_message_size;
6584                    let max_encoding_message_size = self.max_encoding_message_size;
6585                    let inner = self.inner.clone();
6586                    let fut = async move {
6587                        let method = MarkReadSvc(inner);
6588                        let codec = tonic_prost::ProstCodec::default();
6589                        let mut grpc = tonic::server::Grpc::new(codec)
6590                            .apply_compression_config(
6591                                accept_compression_encodings,
6592                                send_compression_encodings,
6593                            )
6594                            .apply_max_message_size_config(
6595                                max_decoding_message_size,
6596                                max_encoding_message_size,
6597                            );
6598                        let res = grpc.unary(method, req).await;
6599                        Ok(res)
6600                    };
6601                    Box::pin(fut)
6602                }
6603                "/pidgr.v1.InboxService/GetMessage" => {
6604                    #[allow(non_camel_case_types)]
6605                    struct GetMessageSvc<T: InboxService>(pub Arc<T>);
6606                    impl<
6607                        T: InboxService,
6608                    > tonic::server::UnaryService<super::GetMessageRequest>
6609                    for GetMessageSvc<T> {
6610                        type Response = super::GetMessageResponse;
6611                        type Future = BoxFuture<
6612                            tonic::Response<Self::Response>,
6613                            tonic::Status,
6614                        >;
6615                        fn call(
6616                            &mut self,
6617                            request: tonic::Request<super::GetMessageRequest>,
6618                        ) -> Self::Future {
6619                            let inner = Arc::clone(&self.0);
6620                            let fut = async move {
6621                                <T as InboxService>::get_message(&inner, request).await
6622                            };
6623                            Box::pin(fut)
6624                        }
6625                    }
6626                    let accept_compression_encodings = self.accept_compression_encodings;
6627                    let send_compression_encodings = self.send_compression_encodings;
6628                    let max_decoding_message_size = self.max_decoding_message_size;
6629                    let max_encoding_message_size = self.max_encoding_message_size;
6630                    let inner = self.inner.clone();
6631                    let fut = async move {
6632                        let method = GetMessageSvc(inner);
6633                        let codec = tonic_prost::ProstCodec::default();
6634                        let mut grpc = tonic::server::Grpc::new(codec)
6635                            .apply_compression_config(
6636                                accept_compression_encodings,
6637                                send_compression_encodings,
6638                            )
6639                            .apply_max_message_size_config(
6640                                max_decoding_message_size,
6641                                max_encoding_message_size,
6642                            );
6643                        let res = grpc.unary(method, req).await;
6644                        Ok(res)
6645                    };
6646                    Box::pin(fut)
6647                }
6648                _ => {
6649                    Box::pin(async move {
6650                        let mut response = http::Response::new(
6651                            tonic::body::Body::default(),
6652                        );
6653                        let headers = response.headers_mut();
6654                        headers
6655                            .insert(
6656                                tonic::Status::GRPC_STATUS,
6657                                (tonic::Code::Unimplemented as i32).into(),
6658                            );
6659                        headers
6660                            .insert(
6661                                http::header::CONTENT_TYPE,
6662                                tonic::metadata::GRPC_CONTENT_TYPE,
6663                            );
6664                        Ok(response)
6665                    })
6666                }
6667            }
6668        }
6669    }
6670    impl<T> Clone for InboxServiceServer<T> {
6671        fn clone(&self) -> Self {
6672            let inner = self.inner.clone();
6673            Self {
6674                inner,
6675                accept_compression_encodings: self.accept_compression_encodings,
6676                send_compression_encodings: self.send_compression_encodings,
6677                max_decoding_message_size: self.max_decoding_message_size,
6678                max_encoding_message_size: self.max_encoding_message_size,
6679            }
6680        }
6681    }
6682    /// Generated gRPC service name
6683    pub const SERVICE_NAME: &str = "pidgr.v1.InboxService";
6684    impl<T> tonic::server::NamedService for InboxServiceServer<T> {
6685        const NAME: &'static str = SERVICE_NAME;
6686    }
6687}
6688/// Generated client implementations.
6689pub mod insights_service_client {
6690    #![allow(
6691        unused_variables,
6692        dead_code,
6693        missing_docs,
6694        clippy::wildcard_imports,
6695        clippy::let_unit_value,
6696    )]
6697    use tonic::codegen::*;
6698    use tonic::codegen::http::Uri;
6699    /** Provides cohort-level AI insights for campaign planning and optimization.
6700 All predictions are aggregate — no individual-level profiling.
6701 Data is derived from k-anonymized, differential-privacy-noised behavioral features.
6702 All RPCs operate within the caller's org (extracted from JWT).
6703*/
6704    #[derive(Debug, Clone)]
6705    pub struct InsightsServiceClient<T> {
6706        inner: tonic::client::Grpc<T>,
6707    }
6708    impl InsightsServiceClient<tonic::transport::Channel> {
6709        /// Attempt to create a new client by connecting to a given endpoint.
6710        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6711        where
6712            D: TryInto<tonic::transport::Endpoint>,
6713            D::Error: Into<StdError>,
6714        {
6715            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6716            Ok(Self::new(conn))
6717        }
6718    }
6719    impl<T> InsightsServiceClient<T>
6720    where
6721        T: tonic::client::GrpcService<tonic::body::Body>,
6722        T::Error: Into<StdError>,
6723        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6724        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6725    {
6726        pub fn new(inner: T) -> Self {
6727            let inner = tonic::client::Grpc::new(inner);
6728            Self { inner }
6729        }
6730        pub fn with_origin(inner: T, origin: Uri) -> Self {
6731            let inner = tonic::client::Grpc::with_origin(inner, origin);
6732            Self { inner }
6733        }
6734        pub fn with_interceptor<F>(
6735            inner: T,
6736            interceptor: F,
6737        ) -> InsightsServiceClient<InterceptedService<T, F>>
6738        where
6739            F: tonic::service::Interceptor,
6740            T::ResponseBody: Default,
6741            T: tonic::codegen::Service<
6742                http::Request<tonic::body::Body>,
6743                Response = http::Response<
6744                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6745                >,
6746            >,
6747            <T as tonic::codegen::Service<
6748                http::Request<tonic::body::Body>,
6749            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6750        {
6751            InsightsServiceClient::new(InterceptedService::new(inner, interceptor))
6752        }
6753        /// Compress requests with the given encoding.
6754        ///
6755        /// This requires the server to support it otherwise it might respond with an
6756        /// error.
6757        #[must_use]
6758        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6759            self.inner = self.inner.send_compressed(encoding);
6760            self
6761        }
6762        /// Enable decompressing responses.
6763        #[must_use]
6764        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6765            self.inner = self.inner.accept_compressed(encoding);
6766            self
6767        }
6768        /// Limits the maximum size of a decoded message.
6769        ///
6770        /// Default: `4MB`
6771        #[must_use]
6772        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6773            self.inner = self.inner.max_decoding_message_size(limit);
6774            self
6775        }
6776        /// Limits the maximum size of an encoded message.
6777        ///
6778        /// Default: `usize::MAX`
6779        #[must_use]
6780        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6781            self.inner = self.inner.max_encoding_message_size(limit);
6782            self
6783        }
6784        /** Retrieve behavioral archetypes for a group based on anonymous feature vectors.
6785 Returns empty archetypes if insufficient data (cold start).
6786 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
6787*/
6788        pub async fn get_group_archetypes(
6789            &mut self,
6790            request: impl tonic::IntoRequest<super::GetGroupArchetypesRequest>,
6791        ) -> std::result::Result<
6792            tonic::Response<super::GetGroupArchetypesResponse>,
6793            tonic::Status,
6794        > {
6795            self.inner
6796                .ready()
6797                .await
6798                .map_err(|e| {
6799                    tonic::Status::unknown(
6800                        format!("Service was not ready: {}", e.into()),
6801                    )
6802                })?;
6803            let codec = tonic_prost::ProstCodec::default();
6804            let path = http::uri::PathAndQuery::from_static(
6805                "/pidgr.v1.InsightsService/GetGroupArchetypes",
6806            );
6807            let mut req = request.into_request();
6808            req.extensions_mut()
6809                .insert(
6810                    GrpcMethod::new("pidgr.v1.InsightsService", "GetGroupArchetypes"),
6811                );
6812            self.inner.unary(req, path, codec).await
6813        }
6814        /** Predict cohort-level ACK rate for a campaign targeting a specific group.
6815 Returns a confidence interval that narrows as more campaign data accumulates.
6816 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
6817*/
6818        pub async fn predict_campaign_ack(
6819            &mut self,
6820            request: impl tonic::IntoRequest<super::PredictCampaignAckRequest>,
6821        ) -> std::result::Result<
6822            tonic::Response<super::PredictCampaignAckResponse>,
6823            tonic::Status,
6824        > {
6825            self.inner
6826                .ready()
6827                .await
6828                .map_err(|e| {
6829                    tonic::Status::unknown(
6830                        format!("Service was not ready: {}", e.into()),
6831                    )
6832                })?;
6833            let codec = tonic_prost::ProstCodec::default();
6834            let path = http::uri::PathAndQuery::from_static(
6835                "/pidgr.v1.InsightsService/PredictCampaignACK",
6836            );
6837            let mut req = request.into_request();
6838            req.extensions_mut()
6839                .insert(
6840                    GrpcMethod::new("pidgr.v1.InsightsService", "PredictCampaignACK"),
6841                );
6842            self.inner.unary(req, path, codec).await
6843        }
6844        /** Get campaign configuration advisory (prediction + suggested escalation + archetypes).
6845 Advisory is informational only — never drives automated decisions.
6846 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
6847*/
6848        pub async fn get_campaign_advisory(
6849            &mut self,
6850            request: impl tonic::IntoRequest<super::GetCampaignAdvisoryRequest>,
6851        ) -> std::result::Result<
6852            tonic::Response<super::GetCampaignAdvisoryResponse>,
6853            tonic::Status,
6854        > {
6855            self.inner
6856                .ready()
6857                .await
6858                .map_err(|e| {
6859                    tonic::Status::unknown(
6860                        format!("Service was not ready: {}", e.into()),
6861                    )
6862                })?;
6863            let codec = tonic_prost::ProstCodec::default();
6864            let path = http::uri::PathAndQuery::from_static(
6865                "/pidgr.v1.InsightsService/GetCampaignAdvisory",
6866            );
6867            let mut req = request.into_request();
6868            req.extensions_mut()
6869                .insert(
6870                    GrpcMethod::new("pidgr.v1.InsightsService", "GetCampaignAdvisory"),
6871                );
6872            self.inner.unary(req, path, codec).await
6873        }
6874        /** Generate an AI-powered narrative summary of a group's insights.
6875 Combines archetype, prediction, and campaign data into human-readable analysis.
6876 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
6877*/
6878        pub async fn get_insight_narrative(
6879            &mut self,
6880            request: impl tonic::IntoRequest<super::GetInsightNarrativeRequest>,
6881        ) -> std::result::Result<
6882            tonic::Response<super::GetInsightNarrativeResponse>,
6883            tonic::Status,
6884        > {
6885            self.inner
6886                .ready()
6887                .await
6888                .map_err(|e| {
6889                    tonic::Status::unknown(
6890                        format!("Service was not ready: {}", e.into()),
6891                    )
6892                })?;
6893            let codec = tonic_prost::ProstCodec::default();
6894            let path = http::uri::PathAndQuery::from_static(
6895                "/pidgr.v1.InsightsService/GetInsightNarrative",
6896            );
6897            let mut req = request.into_request();
6898            req.extensions_mut()
6899                .insert(
6900                    GrpcMethod::new("pidgr.v1.InsightsService", "GetInsightNarrative"),
6901                );
6902            self.inner.unary(req, path, codec).await
6903        }
6904        /** Manually trigger the ML training pipeline for the caller's organization.
6905 Rate-limited by ml_manual_limit_monthly (default 3 per month, auto-resets).
6906 Authorization: Requires PERMISSION_ORGANIZATION_WRITE.
6907*/
6908        pub async fn trigger_ml_pipeline(
6909            &mut self,
6910            request: impl tonic::IntoRequest<super::TriggerMlPipelineRequest>,
6911        ) -> std::result::Result<
6912            tonic::Response<super::TriggerMlPipelineResponse>,
6913            tonic::Status,
6914        > {
6915            self.inner
6916                .ready()
6917                .await
6918                .map_err(|e| {
6919                    tonic::Status::unknown(
6920                        format!("Service was not ready: {}", e.into()),
6921                    )
6922                })?;
6923            let codec = tonic_prost::ProstCodec::default();
6924            let path = http::uri::PathAndQuery::from_static(
6925                "/pidgr.v1.InsightsService/TriggerMLPipeline",
6926            );
6927            let mut req = request.into_request();
6928            req.extensions_mut()
6929                .insert(
6930                    GrpcMethod::new("pidgr.v1.InsightsService", "TriggerMLPipeline"),
6931                );
6932            self.inner.unary(req, path, codec).await
6933        }
6934        /** Manually retrigger archetype clustering for a single group, reusing
6935 the already-deployed SageMaker clustering model. Cheaper than a
6936 full TriggerMLPipeline run because no training happens. Shares the
6937 same ml_manual_limit_monthly quota as TriggerMLPipeline — callers
6938 get N manual retrains per month across both RPCs.
6939 Authorization: Requires PERMISSION_ORGANIZATION_WRITE.
6940*/
6941        pub async fn trigger_archetype_clustering(
6942            &mut self,
6943            request: impl tonic::IntoRequest<super::TriggerArchetypeClusteringRequest>,
6944        ) -> std::result::Result<
6945            tonic::Response<super::TriggerArchetypeClusteringResponse>,
6946            tonic::Status,
6947        > {
6948            self.inner
6949                .ready()
6950                .await
6951                .map_err(|e| {
6952                    tonic::Status::unknown(
6953                        format!("Service was not ready: {}", e.into()),
6954                    )
6955                })?;
6956            let codec = tonic_prost::ProstCodec::default();
6957            let path = http::uri::PathAndQuery::from_static(
6958                "/pidgr.v1.InsightsService/TriggerArchetypeClustering",
6959            );
6960            let mut req = request.into_request();
6961            req.extensions_mut()
6962                .insert(
6963                    GrpcMethod::new(
6964                        "pidgr.v1.InsightsService",
6965                        "TriggerArchetypeClustering",
6966                    ),
6967                );
6968            self.inner.unary(req, path, codec).await
6969        }
6970        /** Draft a campaign body for the given archetype using Bedrock with the
6971 campaign-for-archetype prompt template. Used by the Compass
6972 "Target this archetype" CTA to pre-fill the wizard's body field.
6973 Cross-org group_id returns PERMISSION_DENIED, unknown archetype_label
6974 returns NOT_FOUND.
6975 Authorization: Requires PERMISSION_CAMPAIGNS_WRITE.
6976*/
6977        pub async fn generate_campaign_body_draft(
6978            &mut self,
6979            request: impl tonic::IntoRequest<super::GenerateCampaignBodyDraftRequest>,
6980        ) -> std::result::Result<
6981            tonic::Response<super::GenerateCampaignBodyDraftResponse>,
6982            tonic::Status,
6983        > {
6984            self.inner
6985                .ready()
6986                .await
6987                .map_err(|e| {
6988                    tonic::Status::unknown(
6989                        format!("Service was not ready: {}", e.into()),
6990                    )
6991                })?;
6992            let codec = tonic_prost::ProstCodec::default();
6993            let path = http::uri::PathAndQuery::from_static(
6994                "/pidgr.v1.InsightsService/GenerateCampaignBodyDraft",
6995            );
6996            let mut req = request.into_request();
6997            req.extensions_mut()
6998                .insert(
6999                    GrpcMethod::new(
7000                        "pidgr.v1.InsightsService",
7001                        "GenerateCampaignBodyDraft",
7002                    ),
7003                );
7004            self.inner.unary(req, path, codec).await
7005        }
7006    }
7007}
7008/// Generated server implementations.
7009pub mod insights_service_server {
7010    #![allow(
7011        unused_variables,
7012        dead_code,
7013        missing_docs,
7014        clippy::wildcard_imports,
7015        clippy::let_unit_value,
7016    )]
7017    use tonic::codegen::*;
7018    /// Generated trait containing gRPC methods that should be implemented for use with InsightsServiceServer.
7019    #[async_trait]
7020    pub trait InsightsService: std::marker::Send + std::marker::Sync + 'static {
7021        /** Retrieve behavioral archetypes for a group based on anonymous feature vectors.
7022 Returns empty archetypes if insufficient data (cold start).
7023 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7024*/
7025        async fn get_group_archetypes(
7026            &self,
7027            request: tonic::Request<super::GetGroupArchetypesRequest>,
7028        ) -> std::result::Result<
7029            tonic::Response<super::GetGroupArchetypesResponse>,
7030            tonic::Status,
7031        >;
7032        /** Predict cohort-level ACK rate for a campaign targeting a specific group.
7033 Returns a confidence interval that narrows as more campaign data accumulates.
7034 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7035*/
7036        async fn predict_campaign_ack(
7037            &self,
7038            request: tonic::Request<super::PredictCampaignAckRequest>,
7039        ) -> std::result::Result<
7040            tonic::Response<super::PredictCampaignAckResponse>,
7041            tonic::Status,
7042        >;
7043        /** Get campaign configuration advisory (prediction + suggested escalation + archetypes).
7044 Advisory is informational only — never drives automated decisions.
7045 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7046*/
7047        async fn get_campaign_advisory(
7048            &self,
7049            request: tonic::Request<super::GetCampaignAdvisoryRequest>,
7050        ) -> std::result::Result<
7051            tonic::Response<super::GetCampaignAdvisoryResponse>,
7052            tonic::Status,
7053        >;
7054        /** Generate an AI-powered narrative summary of a group's insights.
7055 Combines archetype, prediction, and campaign data into human-readable analysis.
7056 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7057*/
7058        async fn get_insight_narrative(
7059            &self,
7060            request: tonic::Request<super::GetInsightNarrativeRequest>,
7061        ) -> std::result::Result<
7062            tonic::Response<super::GetInsightNarrativeResponse>,
7063            tonic::Status,
7064        >;
7065        /** Manually trigger the ML training pipeline for the caller's organization.
7066 Rate-limited by ml_manual_limit_monthly (default 3 per month, auto-resets).
7067 Authorization: Requires PERMISSION_ORGANIZATION_WRITE.
7068*/
7069        async fn trigger_ml_pipeline(
7070            &self,
7071            request: tonic::Request<super::TriggerMlPipelineRequest>,
7072        ) -> std::result::Result<
7073            tonic::Response<super::TriggerMlPipelineResponse>,
7074            tonic::Status,
7075        >;
7076        /** Manually retrigger archetype clustering for a single group, reusing
7077 the already-deployed SageMaker clustering model. Cheaper than a
7078 full TriggerMLPipeline run because no training happens. Shares the
7079 same ml_manual_limit_monthly quota as TriggerMLPipeline — callers
7080 get N manual retrains per month across both RPCs.
7081 Authorization: Requires PERMISSION_ORGANIZATION_WRITE.
7082*/
7083        async fn trigger_archetype_clustering(
7084            &self,
7085            request: tonic::Request<super::TriggerArchetypeClusteringRequest>,
7086        ) -> std::result::Result<
7087            tonic::Response<super::TriggerArchetypeClusteringResponse>,
7088            tonic::Status,
7089        >;
7090        /** Draft a campaign body for the given archetype using Bedrock with the
7091 campaign-for-archetype prompt template. Used by the Compass
7092 "Target this archetype" CTA to pre-fill the wizard's body field.
7093 Cross-org group_id returns PERMISSION_DENIED, unknown archetype_label
7094 returns NOT_FOUND.
7095 Authorization: Requires PERMISSION_CAMPAIGNS_WRITE.
7096*/
7097        async fn generate_campaign_body_draft(
7098            &self,
7099            request: tonic::Request<super::GenerateCampaignBodyDraftRequest>,
7100        ) -> std::result::Result<
7101            tonic::Response<super::GenerateCampaignBodyDraftResponse>,
7102            tonic::Status,
7103        >;
7104    }
7105    /** Provides cohort-level AI insights for campaign planning and optimization.
7106 All predictions are aggregate — no individual-level profiling.
7107 Data is derived from k-anonymized, differential-privacy-noised behavioral features.
7108 All RPCs operate within the caller's org (extracted from JWT).
7109*/
7110    #[derive(Debug)]
7111    pub struct InsightsServiceServer<T> {
7112        inner: Arc<T>,
7113        accept_compression_encodings: EnabledCompressionEncodings,
7114        send_compression_encodings: EnabledCompressionEncodings,
7115        max_decoding_message_size: Option<usize>,
7116        max_encoding_message_size: Option<usize>,
7117    }
7118    impl<T> InsightsServiceServer<T> {
7119        pub fn new(inner: T) -> Self {
7120            Self::from_arc(Arc::new(inner))
7121        }
7122        pub fn from_arc(inner: Arc<T>) -> Self {
7123            Self {
7124                inner,
7125                accept_compression_encodings: Default::default(),
7126                send_compression_encodings: Default::default(),
7127                max_decoding_message_size: None,
7128                max_encoding_message_size: None,
7129            }
7130        }
7131        pub fn with_interceptor<F>(
7132            inner: T,
7133            interceptor: F,
7134        ) -> InterceptedService<Self, F>
7135        where
7136            F: tonic::service::Interceptor,
7137        {
7138            InterceptedService::new(Self::new(inner), interceptor)
7139        }
7140        /// Enable decompressing requests with the given encoding.
7141        #[must_use]
7142        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7143            self.accept_compression_encodings.enable(encoding);
7144            self
7145        }
7146        /// Compress responses with the given encoding, if the client supports it.
7147        #[must_use]
7148        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7149            self.send_compression_encodings.enable(encoding);
7150            self
7151        }
7152        /// Limits the maximum size of a decoded message.
7153        ///
7154        /// Default: `4MB`
7155        #[must_use]
7156        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7157            self.max_decoding_message_size = Some(limit);
7158            self
7159        }
7160        /// Limits the maximum size of an encoded message.
7161        ///
7162        /// Default: `usize::MAX`
7163        #[must_use]
7164        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7165            self.max_encoding_message_size = Some(limit);
7166            self
7167        }
7168    }
7169    impl<T, B> tonic::codegen::Service<http::Request<B>> for InsightsServiceServer<T>
7170    where
7171        T: InsightsService,
7172        B: Body + std::marker::Send + 'static,
7173        B::Error: Into<StdError> + std::marker::Send + 'static,
7174    {
7175        type Response = http::Response<tonic::body::Body>;
7176        type Error = std::convert::Infallible;
7177        type Future = BoxFuture<Self::Response, Self::Error>;
7178        fn poll_ready(
7179            &mut self,
7180            _cx: &mut Context<'_>,
7181        ) -> Poll<std::result::Result<(), Self::Error>> {
7182            Poll::Ready(Ok(()))
7183        }
7184        fn call(&mut self, req: http::Request<B>) -> Self::Future {
7185            match req.uri().path() {
7186                "/pidgr.v1.InsightsService/GetGroupArchetypes" => {
7187                    #[allow(non_camel_case_types)]
7188                    struct GetGroupArchetypesSvc<T: InsightsService>(pub Arc<T>);
7189                    impl<
7190                        T: InsightsService,
7191                    > tonic::server::UnaryService<super::GetGroupArchetypesRequest>
7192                    for GetGroupArchetypesSvc<T> {
7193                        type Response = super::GetGroupArchetypesResponse;
7194                        type Future = BoxFuture<
7195                            tonic::Response<Self::Response>,
7196                            tonic::Status,
7197                        >;
7198                        fn call(
7199                            &mut self,
7200                            request: tonic::Request<super::GetGroupArchetypesRequest>,
7201                        ) -> Self::Future {
7202                            let inner = Arc::clone(&self.0);
7203                            let fut = async move {
7204                                <T as InsightsService>::get_group_archetypes(
7205                                        &inner,
7206                                        request,
7207                                    )
7208                                    .await
7209                            };
7210                            Box::pin(fut)
7211                        }
7212                    }
7213                    let accept_compression_encodings = self.accept_compression_encodings;
7214                    let send_compression_encodings = self.send_compression_encodings;
7215                    let max_decoding_message_size = self.max_decoding_message_size;
7216                    let max_encoding_message_size = self.max_encoding_message_size;
7217                    let inner = self.inner.clone();
7218                    let fut = async move {
7219                        let method = GetGroupArchetypesSvc(inner);
7220                        let codec = tonic_prost::ProstCodec::default();
7221                        let mut grpc = tonic::server::Grpc::new(codec)
7222                            .apply_compression_config(
7223                                accept_compression_encodings,
7224                                send_compression_encodings,
7225                            )
7226                            .apply_max_message_size_config(
7227                                max_decoding_message_size,
7228                                max_encoding_message_size,
7229                            );
7230                        let res = grpc.unary(method, req).await;
7231                        Ok(res)
7232                    };
7233                    Box::pin(fut)
7234                }
7235                "/pidgr.v1.InsightsService/PredictCampaignACK" => {
7236                    #[allow(non_camel_case_types)]
7237                    struct PredictCampaignACKSvc<T: InsightsService>(pub Arc<T>);
7238                    impl<
7239                        T: InsightsService,
7240                    > tonic::server::UnaryService<super::PredictCampaignAckRequest>
7241                    for PredictCampaignACKSvc<T> {
7242                        type Response = super::PredictCampaignAckResponse;
7243                        type Future = BoxFuture<
7244                            tonic::Response<Self::Response>,
7245                            tonic::Status,
7246                        >;
7247                        fn call(
7248                            &mut self,
7249                            request: tonic::Request<super::PredictCampaignAckRequest>,
7250                        ) -> Self::Future {
7251                            let inner = Arc::clone(&self.0);
7252                            let fut = async move {
7253                                <T as InsightsService>::predict_campaign_ack(
7254                                        &inner,
7255                                        request,
7256                                    )
7257                                    .await
7258                            };
7259                            Box::pin(fut)
7260                        }
7261                    }
7262                    let accept_compression_encodings = self.accept_compression_encodings;
7263                    let send_compression_encodings = self.send_compression_encodings;
7264                    let max_decoding_message_size = self.max_decoding_message_size;
7265                    let max_encoding_message_size = self.max_encoding_message_size;
7266                    let inner = self.inner.clone();
7267                    let fut = async move {
7268                        let method = PredictCampaignACKSvc(inner);
7269                        let codec = tonic_prost::ProstCodec::default();
7270                        let mut grpc = tonic::server::Grpc::new(codec)
7271                            .apply_compression_config(
7272                                accept_compression_encodings,
7273                                send_compression_encodings,
7274                            )
7275                            .apply_max_message_size_config(
7276                                max_decoding_message_size,
7277                                max_encoding_message_size,
7278                            );
7279                        let res = grpc.unary(method, req).await;
7280                        Ok(res)
7281                    };
7282                    Box::pin(fut)
7283                }
7284                "/pidgr.v1.InsightsService/GetCampaignAdvisory" => {
7285                    #[allow(non_camel_case_types)]
7286                    struct GetCampaignAdvisorySvc<T: InsightsService>(pub Arc<T>);
7287                    impl<
7288                        T: InsightsService,
7289                    > tonic::server::UnaryService<super::GetCampaignAdvisoryRequest>
7290                    for GetCampaignAdvisorySvc<T> {
7291                        type Response = super::GetCampaignAdvisoryResponse;
7292                        type Future = BoxFuture<
7293                            tonic::Response<Self::Response>,
7294                            tonic::Status,
7295                        >;
7296                        fn call(
7297                            &mut self,
7298                            request: tonic::Request<super::GetCampaignAdvisoryRequest>,
7299                        ) -> Self::Future {
7300                            let inner = Arc::clone(&self.0);
7301                            let fut = async move {
7302                                <T as InsightsService>::get_campaign_advisory(
7303                                        &inner,
7304                                        request,
7305                                    )
7306                                    .await
7307                            };
7308                            Box::pin(fut)
7309                        }
7310                    }
7311                    let accept_compression_encodings = self.accept_compression_encodings;
7312                    let send_compression_encodings = self.send_compression_encodings;
7313                    let max_decoding_message_size = self.max_decoding_message_size;
7314                    let max_encoding_message_size = self.max_encoding_message_size;
7315                    let inner = self.inner.clone();
7316                    let fut = async move {
7317                        let method = GetCampaignAdvisorySvc(inner);
7318                        let codec = tonic_prost::ProstCodec::default();
7319                        let mut grpc = tonic::server::Grpc::new(codec)
7320                            .apply_compression_config(
7321                                accept_compression_encodings,
7322                                send_compression_encodings,
7323                            )
7324                            .apply_max_message_size_config(
7325                                max_decoding_message_size,
7326                                max_encoding_message_size,
7327                            );
7328                        let res = grpc.unary(method, req).await;
7329                        Ok(res)
7330                    };
7331                    Box::pin(fut)
7332                }
7333                "/pidgr.v1.InsightsService/GetInsightNarrative" => {
7334                    #[allow(non_camel_case_types)]
7335                    struct GetInsightNarrativeSvc<T: InsightsService>(pub Arc<T>);
7336                    impl<
7337                        T: InsightsService,
7338                    > tonic::server::UnaryService<super::GetInsightNarrativeRequest>
7339                    for GetInsightNarrativeSvc<T> {
7340                        type Response = super::GetInsightNarrativeResponse;
7341                        type Future = BoxFuture<
7342                            tonic::Response<Self::Response>,
7343                            tonic::Status,
7344                        >;
7345                        fn call(
7346                            &mut self,
7347                            request: tonic::Request<super::GetInsightNarrativeRequest>,
7348                        ) -> Self::Future {
7349                            let inner = Arc::clone(&self.0);
7350                            let fut = async move {
7351                                <T as InsightsService>::get_insight_narrative(
7352                                        &inner,
7353                                        request,
7354                                    )
7355                                    .await
7356                            };
7357                            Box::pin(fut)
7358                        }
7359                    }
7360                    let accept_compression_encodings = self.accept_compression_encodings;
7361                    let send_compression_encodings = self.send_compression_encodings;
7362                    let max_decoding_message_size = self.max_decoding_message_size;
7363                    let max_encoding_message_size = self.max_encoding_message_size;
7364                    let inner = self.inner.clone();
7365                    let fut = async move {
7366                        let method = GetInsightNarrativeSvc(inner);
7367                        let codec = tonic_prost::ProstCodec::default();
7368                        let mut grpc = tonic::server::Grpc::new(codec)
7369                            .apply_compression_config(
7370                                accept_compression_encodings,
7371                                send_compression_encodings,
7372                            )
7373                            .apply_max_message_size_config(
7374                                max_decoding_message_size,
7375                                max_encoding_message_size,
7376                            );
7377                        let res = grpc.unary(method, req).await;
7378                        Ok(res)
7379                    };
7380                    Box::pin(fut)
7381                }
7382                "/pidgr.v1.InsightsService/TriggerMLPipeline" => {
7383                    #[allow(non_camel_case_types)]
7384                    struct TriggerMLPipelineSvc<T: InsightsService>(pub Arc<T>);
7385                    impl<
7386                        T: InsightsService,
7387                    > tonic::server::UnaryService<super::TriggerMlPipelineRequest>
7388                    for TriggerMLPipelineSvc<T> {
7389                        type Response = super::TriggerMlPipelineResponse;
7390                        type Future = BoxFuture<
7391                            tonic::Response<Self::Response>,
7392                            tonic::Status,
7393                        >;
7394                        fn call(
7395                            &mut self,
7396                            request: tonic::Request<super::TriggerMlPipelineRequest>,
7397                        ) -> Self::Future {
7398                            let inner = Arc::clone(&self.0);
7399                            let fut = async move {
7400                                <T as InsightsService>::trigger_ml_pipeline(&inner, request)
7401                                    .await
7402                            };
7403                            Box::pin(fut)
7404                        }
7405                    }
7406                    let accept_compression_encodings = self.accept_compression_encodings;
7407                    let send_compression_encodings = self.send_compression_encodings;
7408                    let max_decoding_message_size = self.max_decoding_message_size;
7409                    let max_encoding_message_size = self.max_encoding_message_size;
7410                    let inner = self.inner.clone();
7411                    let fut = async move {
7412                        let method = TriggerMLPipelineSvc(inner);
7413                        let codec = tonic_prost::ProstCodec::default();
7414                        let mut grpc = tonic::server::Grpc::new(codec)
7415                            .apply_compression_config(
7416                                accept_compression_encodings,
7417                                send_compression_encodings,
7418                            )
7419                            .apply_max_message_size_config(
7420                                max_decoding_message_size,
7421                                max_encoding_message_size,
7422                            );
7423                        let res = grpc.unary(method, req).await;
7424                        Ok(res)
7425                    };
7426                    Box::pin(fut)
7427                }
7428                "/pidgr.v1.InsightsService/TriggerArchetypeClustering" => {
7429                    #[allow(non_camel_case_types)]
7430                    struct TriggerArchetypeClusteringSvc<T: InsightsService>(pub Arc<T>);
7431                    impl<
7432                        T: InsightsService,
7433                    > tonic::server::UnaryService<
7434                        super::TriggerArchetypeClusteringRequest,
7435                    > for TriggerArchetypeClusteringSvc<T> {
7436                        type Response = super::TriggerArchetypeClusteringResponse;
7437                        type Future = BoxFuture<
7438                            tonic::Response<Self::Response>,
7439                            tonic::Status,
7440                        >;
7441                        fn call(
7442                            &mut self,
7443                            request: tonic::Request<
7444                                super::TriggerArchetypeClusteringRequest,
7445                            >,
7446                        ) -> Self::Future {
7447                            let inner = Arc::clone(&self.0);
7448                            let fut = async move {
7449                                <T as InsightsService>::trigger_archetype_clustering(
7450                                        &inner,
7451                                        request,
7452                                    )
7453                                    .await
7454                            };
7455                            Box::pin(fut)
7456                        }
7457                    }
7458                    let accept_compression_encodings = self.accept_compression_encodings;
7459                    let send_compression_encodings = self.send_compression_encodings;
7460                    let max_decoding_message_size = self.max_decoding_message_size;
7461                    let max_encoding_message_size = self.max_encoding_message_size;
7462                    let inner = self.inner.clone();
7463                    let fut = async move {
7464                        let method = TriggerArchetypeClusteringSvc(inner);
7465                        let codec = tonic_prost::ProstCodec::default();
7466                        let mut grpc = tonic::server::Grpc::new(codec)
7467                            .apply_compression_config(
7468                                accept_compression_encodings,
7469                                send_compression_encodings,
7470                            )
7471                            .apply_max_message_size_config(
7472                                max_decoding_message_size,
7473                                max_encoding_message_size,
7474                            );
7475                        let res = grpc.unary(method, req).await;
7476                        Ok(res)
7477                    };
7478                    Box::pin(fut)
7479                }
7480                "/pidgr.v1.InsightsService/GenerateCampaignBodyDraft" => {
7481                    #[allow(non_camel_case_types)]
7482                    struct GenerateCampaignBodyDraftSvc<T: InsightsService>(pub Arc<T>);
7483                    impl<
7484                        T: InsightsService,
7485                    > tonic::server::UnaryService<
7486                        super::GenerateCampaignBodyDraftRequest,
7487                    > for GenerateCampaignBodyDraftSvc<T> {
7488                        type Response = super::GenerateCampaignBodyDraftResponse;
7489                        type Future = BoxFuture<
7490                            tonic::Response<Self::Response>,
7491                            tonic::Status,
7492                        >;
7493                        fn call(
7494                            &mut self,
7495                            request: tonic::Request<
7496                                super::GenerateCampaignBodyDraftRequest,
7497                            >,
7498                        ) -> Self::Future {
7499                            let inner = Arc::clone(&self.0);
7500                            let fut = async move {
7501                                <T as InsightsService>::generate_campaign_body_draft(
7502                                        &inner,
7503                                        request,
7504                                    )
7505                                    .await
7506                            };
7507                            Box::pin(fut)
7508                        }
7509                    }
7510                    let accept_compression_encodings = self.accept_compression_encodings;
7511                    let send_compression_encodings = self.send_compression_encodings;
7512                    let max_decoding_message_size = self.max_decoding_message_size;
7513                    let max_encoding_message_size = self.max_encoding_message_size;
7514                    let inner = self.inner.clone();
7515                    let fut = async move {
7516                        let method = GenerateCampaignBodyDraftSvc(inner);
7517                        let codec = tonic_prost::ProstCodec::default();
7518                        let mut grpc = tonic::server::Grpc::new(codec)
7519                            .apply_compression_config(
7520                                accept_compression_encodings,
7521                                send_compression_encodings,
7522                            )
7523                            .apply_max_message_size_config(
7524                                max_decoding_message_size,
7525                                max_encoding_message_size,
7526                            );
7527                        let res = grpc.unary(method, req).await;
7528                        Ok(res)
7529                    };
7530                    Box::pin(fut)
7531                }
7532                _ => {
7533                    Box::pin(async move {
7534                        let mut response = http::Response::new(
7535                            tonic::body::Body::default(),
7536                        );
7537                        let headers = response.headers_mut();
7538                        headers
7539                            .insert(
7540                                tonic::Status::GRPC_STATUS,
7541                                (tonic::Code::Unimplemented as i32).into(),
7542                            );
7543                        headers
7544                            .insert(
7545                                http::header::CONTENT_TYPE,
7546                                tonic::metadata::GRPC_CONTENT_TYPE,
7547                            );
7548                        Ok(response)
7549                    })
7550                }
7551            }
7552        }
7553    }
7554    impl<T> Clone for InsightsServiceServer<T> {
7555        fn clone(&self) -> Self {
7556            let inner = self.inner.clone();
7557            Self {
7558                inner,
7559                accept_compression_encodings: self.accept_compression_encodings,
7560                send_compression_encodings: self.send_compression_encodings,
7561                max_decoding_message_size: self.max_decoding_message_size,
7562                max_encoding_message_size: self.max_encoding_message_size,
7563            }
7564        }
7565    }
7566    /// Generated gRPC service name
7567    pub const SERVICE_NAME: &str = "pidgr.v1.InsightsService";
7568    impl<T> tonic::server::NamedService for InsightsServiceServer<T> {
7569        const NAME: &'static str = SERVICE_NAME;
7570    }
7571}
7572/// Generated client implementations.
7573pub mod invite_link_service_client {
7574    #![allow(
7575        unused_variables,
7576        dead_code,
7577        missing_docs,
7578        clippy::wildcard_imports,
7579        clippy::let_unit_value,
7580    )]
7581    use tonic::codegen::*;
7582    use tonic::codegen::http::Uri;
7583    /** Manages shareable invite links for organization self-join.
7584 Create, List, and Revoke require JWT + PERMISSION_MEMBERS_INVITE.
7585 ValidateInviteLink is unauthenticated — the token IS the authorization.
7586 RedeemInviteLink requires a valid JWT.
7587*/
7588    #[derive(Debug, Clone)]
7589    pub struct InviteLinkServiceClient<T> {
7590        inner: tonic::client::Grpc<T>,
7591    }
7592    impl InviteLinkServiceClient<tonic::transport::Channel> {
7593        /// Attempt to create a new client by connecting to a given endpoint.
7594        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
7595        where
7596            D: TryInto<tonic::transport::Endpoint>,
7597            D::Error: Into<StdError>,
7598        {
7599            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
7600            Ok(Self::new(conn))
7601        }
7602    }
7603    impl<T> InviteLinkServiceClient<T>
7604    where
7605        T: tonic::client::GrpcService<tonic::body::Body>,
7606        T::Error: Into<StdError>,
7607        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
7608        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
7609    {
7610        pub fn new(inner: T) -> Self {
7611            let inner = tonic::client::Grpc::new(inner);
7612            Self { inner }
7613        }
7614        pub fn with_origin(inner: T, origin: Uri) -> Self {
7615            let inner = tonic::client::Grpc::with_origin(inner, origin);
7616            Self { inner }
7617        }
7618        pub fn with_interceptor<F>(
7619            inner: T,
7620            interceptor: F,
7621        ) -> InviteLinkServiceClient<InterceptedService<T, F>>
7622        where
7623            F: tonic::service::Interceptor,
7624            T::ResponseBody: Default,
7625            T: tonic::codegen::Service<
7626                http::Request<tonic::body::Body>,
7627                Response = http::Response<
7628                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
7629                >,
7630            >,
7631            <T as tonic::codegen::Service<
7632                http::Request<tonic::body::Body>,
7633            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
7634        {
7635            InviteLinkServiceClient::new(InterceptedService::new(inner, interceptor))
7636        }
7637        /// Compress requests with the given encoding.
7638        ///
7639        /// This requires the server to support it otherwise it might respond with an
7640        /// error.
7641        #[must_use]
7642        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7643            self.inner = self.inner.send_compressed(encoding);
7644            self
7645        }
7646        /// Enable decompressing responses.
7647        #[must_use]
7648        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7649            self.inner = self.inner.accept_compressed(encoding);
7650            self
7651        }
7652        /// Limits the maximum size of a decoded message.
7653        ///
7654        /// Default: `4MB`
7655        #[must_use]
7656        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7657            self.inner = self.inner.max_decoding_message_size(limit);
7658            self
7659        }
7660        /// Limits the maximum size of an encoded message.
7661        ///
7662        /// Default: `usize::MAX`
7663        #[must_use]
7664        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7665            self.inner = self.inner.max_encoding_message_size(limit);
7666            self
7667        }
7668        /** Create a new shareable invite link for the organization.
7669 Authorization: Requires PERMISSION_MEMBERS_INVITE.
7670*/
7671        pub async fn create_invite_link(
7672            &mut self,
7673            request: impl tonic::IntoRequest<super::CreateInviteLinkRequest>,
7674        ) -> std::result::Result<
7675            tonic::Response<super::CreateInviteLinkResponse>,
7676            tonic::Status,
7677        > {
7678            self.inner
7679                .ready()
7680                .await
7681                .map_err(|e| {
7682                    tonic::Status::unknown(
7683                        format!("Service was not ready: {}", e.into()),
7684                    )
7685                })?;
7686            let codec = tonic_prost::ProstCodec::default();
7687            let path = http::uri::PathAndQuery::from_static(
7688                "/pidgr.v1.InviteLinkService/CreateInviteLink",
7689            );
7690            let mut req = request.into_request();
7691            req.extensions_mut()
7692                .insert(
7693                    GrpcMethod::new("pidgr.v1.InviteLinkService", "CreateInviteLink"),
7694                );
7695            self.inner.unary(req, path, codec).await
7696        }
7697        /** List all invite links for the organization.
7698 Authorization: Requires PERMISSION_MEMBERS_INVITE.
7699*/
7700        pub async fn list_invite_links(
7701            &mut self,
7702            request: impl tonic::IntoRequest<super::ListInviteLinksRequest>,
7703        ) -> std::result::Result<
7704            tonic::Response<super::ListInviteLinksResponse>,
7705            tonic::Status,
7706        > {
7707            self.inner
7708                .ready()
7709                .await
7710                .map_err(|e| {
7711                    tonic::Status::unknown(
7712                        format!("Service was not ready: {}", e.into()),
7713                    )
7714                })?;
7715            let codec = tonic_prost::ProstCodec::default();
7716            let path = http::uri::PathAndQuery::from_static(
7717                "/pidgr.v1.InviteLinkService/ListInviteLinks",
7718            );
7719            let mut req = request.into_request();
7720            req.extensions_mut()
7721                .insert(
7722                    GrpcMethod::new("pidgr.v1.InviteLinkService", "ListInviteLinks"),
7723                );
7724            self.inner.unary(req, path, codec).await
7725        }
7726        /** Revoke an invite link, making it immediately unusable. Idempotent.
7727 Authorization: Requires PERMISSION_MEMBERS_INVITE.
7728*/
7729        pub async fn revoke_invite_link(
7730            &mut self,
7731            request: impl tonic::IntoRequest<super::RevokeInviteLinkRequest>,
7732        ) -> std::result::Result<
7733            tonic::Response<super::RevokeInviteLinkResponse>,
7734            tonic::Status,
7735        > {
7736            self.inner
7737                .ready()
7738                .await
7739                .map_err(|e| {
7740                    tonic::Status::unknown(
7741                        format!("Service was not ready: {}", e.into()),
7742                    )
7743                })?;
7744            let codec = tonic_prost::ProstCodec::default();
7745            let path = http::uri::PathAndQuery::from_static(
7746                "/pidgr.v1.InviteLinkService/RevokeInviteLink",
7747            );
7748            let mut req = request.into_request();
7749            req.extensions_mut()
7750                .insert(
7751                    GrpcMethod::new("pidgr.v1.InviteLinkService", "RevokeInviteLink"),
7752                );
7753            self.inner.unary(req, path, codec).await
7754        }
7755        /** Validate an invite link and provision a user account if needed.
7756 This is a pre-authentication endpoint — no JWT required.
7757 Rate limited to 10 requests per minute per IP.
7758 Authorization: None (token-based).
7759*/
7760        pub async fn validate_invite_link(
7761            &mut self,
7762            request: impl tonic::IntoRequest<super::ValidateInviteLinkRequest>,
7763        ) -> std::result::Result<
7764            tonic::Response<super::ValidateInviteLinkResponse>,
7765            tonic::Status,
7766        > {
7767            self.inner
7768                .ready()
7769                .await
7770                .map_err(|e| {
7771                    tonic::Status::unknown(
7772                        format!("Service was not ready: {}", e.into()),
7773                    )
7774                })?;
7775            let codec = tonic_prost::ProstCodec::default();
7776            let path = http::uri::PathAndQuery::from_static(
7777                "/pidgr.v1.InviteLinkService/ValidateInviteLink",
7778            );
7779            let mut req = request.into_request();
7780            req.extensions_mut()
7781                .insert(
7782                    GrpcMethod::new("pidgr.v1.InviteLinkService", "ValidateInviteLink"),
7783                );
7784            self.inner.unary(req, path, codec).await
7785        }
7786        /** Redeem an invite link to join an organization.
7787 Requires a valid JWT — the email is extracted from the token.
7788 Authorization: JWT required.
7789*/
7790        pub async fn redeem_invite_link(
7791            &mut self,
7792            request: impl tonic::IntoRequest<super::RedeemInviteLinkRequest>,
7793        ) -> std::result::Result<
7794            tonic::Response<super::RedeemInviteLinkResponse>,
7795            tonic::Status,
7796        > {
7797            self.inner
7798                .ready()
7799                .await
7800                .map_err(|e| {
7801                    tonic::Status::unknown(
7802                        format!("Service was not ready: {}", e.into()),
7803                    )
7804                })?;
7805            let codec = tonic_prost::ProstCodec::default();
7806            let path = http::uri::PathAndQuery::from_static(
7807                "/pidgr.v1.InviteLinkService/RedeemInviteLink",
7808            );
7809            let mut req = request.into_request();
7810            req.extensions_mut()
7811                .insert(
7812                    GrpcMethod::new("pidgr.v1.InviteLinkService", "RedeemInviteLink"),
7813                );
7814            self.inner.unary(req, path, codec).await
7815        }
7816    }
7817}
7818/// Generated server implementations.
7819pub mod invite_link_service_server {
7820    #![allow(
7821        unused_variables,
7822        dead_code,
7823        missing_docs,
7824        clippy::wildcard_imports,
7825        clippy::let_unit_value,
7826    )]
7827    use tonic::codegen::*;
7828    /// Generated trait containing gRPC methods that should be implemented for use with InviteLinkServiceServer.
7829    #[async_trait]
7830    pub trait InviteLinkService: std::marker::Send + std::marker::Sync + 'static {
7831        /** Create a new shareable invite link for the organization.
7832 Authorization: Requires PERMISSION_MEMBERS_INVITE.
7833*/
7834        async fn create_invite_link(
7835            &self,
7836            request: tonic::Request<super::CreateInviteLinkRequest>,
7837        ) -> std::result::Result<
7838            tonic::Response<super::CreateInviteLinkResponse>,
7839            tonic::Status,
7840        >;
7841        /** List all invite links for the organization.
7842 Authorization: Requires PERMISSION_MEMBERS_INVITE.
7843*/
7844        async fn list_invite_links(
7845            &self,
7846            request: tonic::Request<super::ListInviteLinksRequest>,
7847        ) -> std::result::Result<
7848            tonic::Response<super::ListInviteLinksResponse>,
7849            tonic::Status,
7850        >;
7851        /** Revoke an invite link, making it immediately unusable. Idempotent.
7852 Authorization: Requires PERMISSION_MEMBERS_INVITE.
7853*/
7854        async fn revoke_invite_link(
7855            &self,
7856            request: tonic::Request<super::RevokeInviteLinkRequest>,
7857        ) -> std::result::Result<
7858            tonic::Response<super::RevokeInviteLinkResponse>,
7859            tonic::Status,
7860        >;
7861        /** Validate an invite link and provision a user account if needed.
7862 This is a pre-authentication endpoint — no JWT required.
7863 Rate limited to 10 requests per minute per IP.
7864 Authorization: None (token-based).
7865*/
7866        async fn validate_invite_link(
7867            &self,
7868            request: tonic::Request<super::ValidateInviteLinkRequest>,
7869        ) -> std::result::Result<
7870            tonic::Response<super::ValidateInviteLinkResponse>,
7871            tonic::Status,
7872        >;
7873        /** Redeem an invite link to join an organization.
7874 Requires a valid JWT — the email is extracted from the token.
7875 Authorization: JWT required.
7876*/
7877        async fn redeem_invite_link(
7878            &self,
7879            request: tonic::Request<super::RedeemInviteLinkRequest>,
7880        ) -> std::result::Result<
7881            tonic::Response<super::RedeemInviteLinkResponse>,
7882            tonic::Status,
7883        >;
7884    }
7885    /** Manages shareable invite links for organization self-join.
7886 Create, List, and Revoke require JWT + PERMISSION_MEMBERS_INVITE.
7887 ValidateInviteLink is unauthenticated — the token IS the authorization.
7888 RedeemInviteLink requires a valid JWT.
7889*/
7890    #[derive(Debug)]
7891    pub struct InviteLinkServiceServer<T> {
7892        inner: Arc<T>,
7893        accept_compression_encodings: EnabledCompressionEncodings,
7894        send_compression_encodings: EnabledCompressionEncodings,
7895        max_decoding_message_size: Option<usize>,
7896        max_encoding_message_size: Option<usize>,
7897    }
7898    impl<T> InviteLinkServiceServer<T> {
7899        pub fn new(inner: T) -> Self {
7900            Self::from_arc(Arc::new(inner))
7901        }
7902        pub fn from_arc(inner: Arc<T>) -> Self {
7903            Self {
7904                inner,
7905                accept_compression_encodings: Default::default(),
7906                send_compression_encodings: Default::default(),
7907                max_decoding_message_size: None,
7908                max_encoding_message_size: None,
7909            }
7910        }
7911        pub fn with_interceptor<F>(
7912            inner: T,
7913            interceptor: F,
7914        ) -> InterceptedService<Self, F>
7915        where
7916            F: tonic::service::Interceptor,
7917        {
7918            InterceptedService::new(Self::new(inner), interceptor)
7919        }
7920        /// Enable decompressing requests with the given encoding.
7921        #[must_use]
7922        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7923            self.accept_compression_encodings.enable(encoding);
7924            self
7925        }
7926        /// Compress responses with the given encoding, if the client supports it.
7927        #[must_use]
7928        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7929            self.send_compression_encodings.enable(encoding);
7930            self
7931        }
7932        /// Limits the maximum size of a decoded message.
7933        ///
7934        /// Default: `4MB`
7935        #[must_use]
7936        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7937            self.max_decoding_message_size = Some(limit);
7938            self
7939        }
7940        /// Limits the maximum size of an encoded message.
7941        ///
7942        /// Default: `usize::MAX`
7943        #[must_use]
7944        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7945            self.max_encoding_message_size = Some(limit);
7946            self
7947        }
7948    }
7949    impl<T, B> tonic::codegen::Service<http::Request<B>> for InviteLinkServiceServer<T>
7950    where
7951        T: InviteLinkService,
7952        B: Body + std::marker::Send + 'static,
7953        B::Error: Into<StdError> + std::marker::Send + 'static,
7954    {
7955        type Response = http::Response<tonic::body::Body>;
7956        type Error = std::convert::Infallible;
7957        type Future = BoxFuture<Self::Response, Self::Error>;
7958        fn poll_ready(
7959            &mut self,
7960            _cx: &mut Context<'_>,
7961        ) -> Poll<std::result::Result<(), Self::Error>> {
7962            Poll::Ready(Ok(()))
7963        }
7964        fn call(&mut self, req: http::Request<B>) -> Self::Future {
7965            match req.uri().path() {
7966                "/pidgr.v1.InviteLinkService/CreateInviteLink" => {
7967                    #[allow(non_camel_case_types)]
7968                    struct CreateInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
7969                    impl<
7970                        T: InviteLinkService,
7971                    > tonic::server::UnaryService<super::CreateInviteLinkRequest>
7972                    for CreateInviteLinkSvc<T> {
7973                        type Response = super::CreateInviteLinkResponse;
7974                        type Future = BoxFuture<
7975                            tonic::Response<Self::Response>,
7976                            tonic::Status,
7977                        >;
7978                        fn call(
7979                            &mut self,
7980                            request: tonic::Request<super::CreateInviteLinkRequest>,
7981                        ) -> Self::Future {
7982                            let inner = Arc::clone(&self.0);
7983                            let fut = async move {
7984                                <T as InviteLinkService>::create_invite_link(
7985                                        &inner,
7986                                        request,
7987                                    )
7988                                    .await
7989                            };
7990                            Box::pin(fut)
7991                        }
7992                    }
7993                    let accept_compression_encodings = self.accept_compression_encodings;
7994                    let send_compression_encodings = self.send_compression_encodings;
7995                    let max_decoding_message_size = self.max_decoding_message_size;
7996                    let max_encoding_message_size = self.max_encoding_message_size;
7997                    let inner = self.inner.clone();
7998                    let fut = async move {
7999                        let method = CreateInviteLinkSvc(inner);
8000                        let codec = tonic_prost::ProstCodec::default();
8001                        let mut grpc = tonic::server::Grpc::new(codec)
8002                            .apply_compression_config(
8003                                accept_compression_encodings,
8004                                send_compression_encodings,
8005                            )
8006                            .apply_max_message_size_config(
8007                                max_decoding_message_size,
8008                                max_encoding_message_size,
8009                            );
8010                        let res = grpc.unary(method, req).await;
8011                        Ok(res)
8012                    };
8013                    Box::pin(fut)
8014                }
8015                "/pidgr.v1.InviteLinkService/ListInviteLinks" => {
8016                    #[allow(non_camel_case_types)]
8017                    struct ListInviteLinksSvc<T: InviteLinkService>(pub Arc<T>);
8018                    impl<
8019                        T: InviteLinkService,
8020                    > tonic::server::UnaryService<super::ListInviteLinksRequest>
8021                    for ListInviteLinksSvc<T> {
8022                        type Response = super::ListInviteLinksResponse;
8023                        type Future = BoxFuture<
8024                            tonic::Response<Self::Response>,
8025                            tonic::Status,
8026                        >;
8027                        fn call(
8028                            &mut self,
8029                            request: tonic::Request<super::ListInviteLinksRequest>,
8030                        ) -> Self::Future {
8031                            let inner = Arc::clone(&self.0);
8032                            let fut = async move {
8033                                <T as InviteLinkService>::list_invite_links(&inner, request)
8034                                    .await
8035                            };
8036                            Box::pin(fut)
8037                        }
8038                    }
8039                    let accept_compression_encodings = self.accept_compression_encodings;
8040                    let send_compression_encodings = self.send_compression_encodings;
8041                    let max_decoding_message_size = self.max_decoding_message_size;
8042                    let max_encoding_message_size = self.max_encoding_message_size;
8043                    let inner = self.inner.clone();
8044                    let fut = async move {
8045                        let method = ListInviteLinksSvc(inner);
8046                        let codec = tonic_prost::ProstCodec::default();
8047                        let mut grpc = tonic::server::Grpc::new(codec)
8048                            .apply_compression_config(
8049                                accept_compression_encodings,
8050                                send_compression_encodings,
8051                            )
8052                            .apply_max_message_size_config(
8053                                max_decoding_message_size,
8054                                max_encoding_message_size,
8055                            );
8056                        let res = grpc.unary(method, req).await;
8057                        Ok(res)
8058                    };
8059                    Box::pin(fut)
8060                }
8061                "/pidgr.v1.InviteLinkService/RevokeInviteLink" => {
8062                    #[allow(non_camel_case_types)]
8063                    struct RevokeInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
8064                    impl<
8065                        T: InviteLinkService,
8066                    > tonic::server::UnaryService<super::RevokeInviteLinkRequest>
8067                    for RevokeInviteLinkSvc<T> {
8068                        type Response = super::RevokeInviteLinkResponse;
8069                        type Future = BoxFuture<
8070                            tonic::Response<Self::Response>,
8071                            tonic::Status,
8072                        >;
8073                        fn call(
8074                            &mut self,
8075                            request: tonic::Request<super::RevokeInviteLinkRequest>,
8076                        ) -> Self::Future {
8077                            let inner = Arc::clone(&self.0);
8078                            let fut = async move {
8079                                <T as InviteLinkService>::revoke_invite_link(
8080                                        &inner,
8081                                        request,
8082                                    )
8083                                    .await
8084                            };
8085                            Box::pin(fut)
8086                        }
8087                    }
8088                    let accept_compression_encodings = self.accept_compression_encodings;
8089                    let send_compression_encodings = self.send_compression_encodings;
8090                    let max_decoding_message_size = self.max_decoding_message_size;
8091                    let max_encoding_message_size = self.max_encoding_message_size;
8092                    let inner = self.inner.clone();
8093                    let fut = async move {
8094                        let method = RevokeInviteLinkSvc(inner);
8095                        let codec = tonic_prost::ProstCodec::default();
8096                        let mut grpc = tonic::server::Grpc::new(codec)
8097                            .apply_compression_config(
8098                                accept_compression_encodings,
8099                                send_compression_encodings,
8100                            )
8101                            .apply_max_message_size_config(
8102                                max_decoding_message_size,
8103                                max_encoding_message_size,
8104                            );
8105                        let res = grpc.unary(method, req).await;
8106                        Ok(res)
8107                    };
8108                    Box::pin(fut)
8109                }
8110                "/pidgr.v1.InviteLinkService/ValidateInviteLink" => {
8111                    #[allow(non_camel_case_types)]
8112                    struct ValidateInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
8113                    impl<
8114                        T: InviteLinkService,
8115                    > tonic::server::UnaryService<super::ValidateInviteLinkRequest>
8116                    for ValidateInviteLinkSvc<T> {
8117                        type Response = super::ValidateInviteLinkResponse;
8118                        type Future = BoxFuture<
8119                            tonic::Response<Self::Response>,
8120                            tonic::Status,
8121                        >;
8122                        fn call(
8123                            &mut self,
8124                            request: tonic::Request<super::ValidateInviteLinkRequest>,
8125                        ) -> Self::Future {
8126                            let inner = Arc::clone(&self.0);
8127                            let fut = async move {
8128                                <T as InviteLinkService>::validate_invite_link(
8129                                        &inner,
8130                                        request,
8131                                    )
8132                                    .await
8133                            };
8134                            Box::pin(fut)
8135                        }
8136                    }
8137                    let accept_compression_encodings = self.accept_compression_encodings;
8138                    let send_compression_encodings = self.send_compression_encodings;
8139                    let max_decoding_message_size = self.max_decoding_message_size;
8140                    let max_encoding_message_size = self.max_encoding_message_size;
8141                    let inner = self.inner.clone();
8142                    let fut = async move {
8143                        let method = ValidateInviteLinkSvc(inner);
8144                        let codec = tonic_prost::ProstCodec::default();
8145                        let mut grpc = tonic::server::Grpc::new(codec)
8146                            .apply_compression_config(
8147                                accept_compression_encodings,
8148                                send_compression_encodings,
8149                            )
8150                            .apply_max_message_size_config(
8151                                max_decoding_message_size,
8152                                max_encoding_message_size,
8153                            );
8154                        let res = grpc.unary(method, req).await;
8155                        Ok(res)
8156                    };
8157                    Box::pin(fut)
8158                }
8159                "/pidgr.v1.InviteLinkService/RedeemInviteLink" => {
8160                    #[allow(non_camel_case_types)]
8161                    struct RedeemInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
8162                    impl<
8163                        T: InviteLinkService,
8164                    > tonic::server::UnaryService<super::RedeemInviteLinkRequest>
8165                    for RedeemInviteLinkSvc<T> {
8166                        type Response = super::RedeemInviteLinkResponse;
8167                        type Future = BoxFuture<
8168                            tonic::Response<Self::Response>,
8169                            tonic::Status,
8170                        >;
8171                        fn call(
8172                            &mut self,
8173                            request: tonic::Request<super::RedeemInviteLinkRequest>,
8174                        ) -> Self::Future {
8175                            let inner = Arc::clone(&self.0);
8176                            let fut = async move {
8177                                <T as InviteLinkService>::redeem_invite_link(
8178                                        &inner,
8179                                        request,
8180                                    )
8181                                    .await
8182                            };
8183                            Box::pin(fut)
8184                        }
8185                    }
8186                    let accept_compression_encodings = self.accept_compression_encodings;
8187                    let send_compression_encodings = self.send_compression_encodings;
8188                    let max_decoding_message_size = self.max_decoding_message_size;
8189                    let max_encoding_message_size = self.max_encoding_message_size;
8190                    let inner = self.inner.clone();
8191                    let fut = async move {
8192                        let method = RedeemInviteLinkSvc(inner);
8193                        let codec = tonic_prost::ProstCodec::default();
8194                        let mut grpc = tonic::server::Grpc::new(codec)
8195                            .apply_compression_config(
8196                                accept_compression_encodings,
8197                                send_compression_encodings,
8198                            )
8199                            .apply_max_message_size_config(
8200                                max_decoding_message_size,
8201                                max_encoding_message_size,
8202                            );
8203                        let res = grpc.unary(method, req).await;
8204                        Ok(res)
8205                    };
8206                    Box::pin(fut)
8207                }
8208                _ => {
8209                    Box::pin(async move {
8210                        let mut response = http::Response::new(
8211                            tonic::body::Body::default(),
8212                        );
8213                        let headers = response.headers_mut();
8214                        headers
8215                            .insert(
8216                                tonic::Status::GRPC_STATUS,
8217                                (tonic::Code::Unimplemented as i32).into(),
8218                            );
8219                        headers
8220                            .insert(
8221                                http::header::CONTENT_TYPE,
8222                                tonic::metadata::GRPC_CONTENT_TYPE,
8223                            );
8224                        Ok(response)
8225                    })
8226                }
8227            }
8228        }
8229    }
8230    impl<T> Clone for InviteLinkServiceServer<T> {
8231        fn clone(&self) -> Self {
8232            let inner = self.inner.clone();
8233            Self {
8234                inner,
8235                accept_compression_encodings: self.accept_compression_encodings,
8236                send_compression_encodings: self.send_compression_encodings,
8237                max_decoding_message_size: self.max_decoding_message_size,
8238                max_encoding_message_size: self.max_encoding_message_size,
8239            }
8240        }
8241    }
8242    /// Generated gRPC service name
8243    pub const SERVICE_NAME: &str = "pidgr.v1.InviteLinkService";
8244    impl<T> tonic::server::NamedService for InviteLinkServiceServer<T> {
8245        const NAME: &'static str = SERVICE_NAME;
8246    }
8247}
8248/// Generated client implementations.
8249pub mod member_service_client {
8250    #![allow(
8251        unused_variables,
8252        dead_code,
8253        missing_docs,
8254        clippy::wildcard_imports,
8255        clippy::let_unit_value,
8256    )]
8257    use tonic::codegen::*;
8258    use tonic::codegen::http::Uri;
8259    /** Manages members (users) within an organization.
8260 All RPCs operate within the caller's org (extracted from JWT).
8261*/
8262    #[derive(Debug, Clone)]
8263    pub struct MemberServiceClient<T> {
8264        inner: tonic::client::Grpc<T>,
8265    }
8266    impl MemberServiceClient<tonic::transport::Channel> {
8267        /// Attempt to create a new client by connecting to a given endpoint.
8268        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
8269        where
8270            D: TryInto<tonic::transport::Endpoint>,
8271            D::Error: Into<StdError>,
8272        {
8273            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
8274            Ok(Self::new(conn))
8275        }
8276    }
8277    impl<T> MemberServiceClient<T>
8278    where
8279        T: tonic::client::GrpcService<tonic::body::Body>,
8280        T::Error: Into<StdError>,
8281        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
8282        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
8283    {
8284        pub fn new(inner: T) -> Self {
8285            let inner = tonic::client::Grpc::new(inner);
8286            Self { inner }
8287        }
8288        pub fn with_origin(inner: T, origin: Uri) -> Self {
8289            let inner = tonic::client::Grpc::with_origin(inner, origin);
8290            Self { inner }
8291        }
8292        pub fn with_interceptor<F>(
8293            inner: T,
8294            interceptor: F,
8295        ) -> MemberServiceClient<InterceptedService<T, F>>
8296        where
8297            F: tonic::service::Interceptor,
8298            T::ResponseBody: Default,
8299            T: tonic::codegen::Service<
8300                http::Request<tonic::body::Body>,
8301                Response = http::Response<
8302                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
8303                >,
8304            >,
8305            <T as tonic::codegen::Service<
8306                http::Request<tonic::body::Body>,
8307            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
8308        {
8309            MemberServiceClient::new(InterceptedService::new(inner, interceptor))
8310        }
8311        /// Compress requests with the given encoding.
8312        ///
8313        /// This requires the server to support it otherwise it might respond with an
8314        /// error.
8315        #[must_use]
8316        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8317            self.inner = self.inner.send_compressed(encoding);
8318            self
8319        }
8320        /// Enable decompressing responses.
8321        #[must_use]
8322        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8323            self.inner = self.inner.accept_compressed(encoding);
8324            self
8325        }
8326        /// Limits the maximum size of a decoded message.
8327        ///
8328        /// Default: `4MB`
8329        #[must_use]
8330        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8331            self.inner = self.inner.max_decoding_message_size(limit);
8332            self
8333        }
8334        /// Limits the maximum size of an encoded message.
8335        ///
8336        /// Default: `usize::MAX`
8337        #[must_use]
8338        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8339            self.inner = self.inner.max_encoding_message_size(limit);
8340            self
8341        }
8342        /** Invite a new user to the organization via email.
8343 Authorization: Requires PERMISSION_MEMBERS_INVITE.
8344*/
8345        pub async fn invite_user(
8346            &mut self,
8347            request: impl tonic::IntoRequest<super::InviteUserRequest>,
8348        ) -> std::result::Result<
8349            tonic::Response<super::InviteUserResponse>,
8350            tonic::Status,
8351        > {
8352            self.inner
8353                .ready()
8354                .await
8355                .map_err(|e| {
8356                    tonic::Status::unknown(
8357                        format!("Service was not ready: {}", e.into()),
8358                    )
8359                })?;
8360            let codec = tonic_prost::ProstCodec::default();
8361            let path = http::uri::PathAndQuery::from_static(
8362                "/pidgr.v1.MemberService/InviteUser",
8363            );
8364            let mut req = request.into_request();
8365            req.extensions_mut()
8366                .insert(GrpcMethod::new("pidgr.v1.MemberService", "InviteUser"));
8367            self.inner.unary(req, path, codec).await
8368        }
8369        /** Retrieve a user by ID within the organization.
8370 Self-lookup (empty user_id) is allowed for any authenticated user.
8371 Authorization: Requires PERMISSION_MEMBERS_READ for other users.
8372*/
8373        pub async fn get_user(
8374            &mut self,
8375            request: impl tonic::IntoRequest<super::GetUserRequest>,
8376        ) -> std::result::Result<
8377            tonic::Response<super::GetUserResponse>,
8378            tonic::Status,
8379        > {
8380            self.inner
8381                .ready()
8382                .await
8383                .map_err(|e| {
8384                    tonic::Status::unknown(
8385                        format!("Service was not ready: {}", e.into()),
8386                    )
8387                })?;
8388            let codec = tonic_prost::ProstCodec::default();
8389            let path = http::uri::PathAndQuery::from_static(
8390                "/pidgr.v1.MemberService/GetUser",
8391            );
8392            let mut req = request.into_request();
8393            req.extensions_mut()
8394                .insert(GrpcMethod::new("pidgr.v1.MemberService", "GetUser"));
8395            self.inner.unary(req, path, codec).await
8396        }
8397        /** List all users in the organization with pagination.
8398 Authorization: Requires PERMISSION_MEMBERS_READ.
8399*/
8400        pub async fn list_users(
8401            &mut self,
8402            request: impl tonic::IntoRequest<super::ListUsersRequest>,
8403        ) -> std::result::Result<
8404            tonic::Response<super::ListUsersResponse>,
8405            tonic::Status,
8406        > {
8407            self.inner
8408                .ready()
8409                .await
8410                .map_err(|e| {
8411                    tonic::Status::unknown(
8412                        format!("Service was not ready: {}", e.into()),
8413                    )
8414                })?;
8415            let codec = tonic_prost::ProstCodec::default();
8416            let path = http::uri::PathAndQuery::from_static(
8417                "/pidgr.v1.MemberService/ListUsers",
8418            );
8419            let mut req = request.into_request();
8420            req.extensions_mut()
8421                .insert(GrpcMethod::new("pidgr.v1.MemberService", "ListUsers"));
8422            self.inner.unary(req, path, codec).await
8423        }
8424        /** Change a user's role within the organization.
8425 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
8426*/
8427        pub async fn update_user_role(
8428            &mut self,
8429            request: impl tonic::IntoRequest<super::UpdateUserRoleRequest>,
8430        ) -> std::result::Result<
8431            tonic::Response<super::UpdateUserRoleResponse>,
8432            tonic::Status,
8433        > {
8434            self.inner
8435                .ready()
8436                .await
8437                .map_err(|e| {
8438                    tonic::Status::unknown(
8439                        format!("Service was not ready: {}", e.into()),
8440                    )
8441                })?;
8442            let codec = tonic_prost::ProstCodec::default();
8443            let path = http::uri::PathAndQuery::from_static(
8444                "/pidgr.v1.MemberService/UpdateUserRole",
8445            );
8446            let mut req = request.into_request();
8447            req.extensions_mut()
8448                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserRole"));
8449            self.inner.unary(req, path, codec).await
8450        }
8451        /** Deactivate a user within the organization.
8452 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
8453*/
8454        pub async fn deactivate_user(
8455            &mut self,
8456            request: impl tonic::IntoRequest<super::DeactivateUserRequest>,
8457        ) -> std::result::Result<
8458            tonic::Response<super::DeactivateUserResponse>,
8459            tonic::Status,
8460        > {
8461            self.inner
8462                .ready()
8463                .await
8464                .map_err(|e| {
8465                    tonic::Status::unknown(
8466                        format!("Service was not ready: {}", e.into()),
8467                    )
8468                })?;
8469            let codec = tonic_prost::ProstCodec::default();
8470            let path = http::uri::PathAndQuery::from_static(
8471                "/pidgr.v1.MemberService/DeactivateUser",
8472            );
8473            let mut req = request.into_request();
8474            req.extensions_mut()
8475                .insert(GrpcMethod::new("pidgr.v1.MemberService", "DeactivateUser"));
8476            self.inner.unary(req, path, codec).await
8477        }
8478        /** Reactivate a deactivated user, restoring their status to INVITED.
8479 The user must complete the invite link flow again to become ACTIVE.
8480 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
8481*/
8482        pub async fn reactivate_user(
8483            &mut self,
8484            request: impl tonic::IntoRequest<super::ReactivateUserRequest>,
8485        ) -> std::result::Result<
8486            tonic::Response<super::ReactivateUserResponse>,
8487            tonic::Status,
8488        > {
8489            self.inner
8490                .ready()
8491                .await
8492                .map_err(|e| {
8493                    tonic::Status::unknown(
8494                        format!("Service was not ready: {}", e.into()),
8495                    )
8496                })?;
8497            let codec = tonic_prost::ProstCodec::default();
8498            let path = http::uri::PathAndQuery::from_static(
8499                "/pidgr.v1.MemberService/ReactivateUser",
8500            );
8501            let mut req = request.into_request();
8502            req.extensions_mut()
8503                .insert(GrpcMethod::new("pidgr.v1.MemberService", "ReactivateUser"));
8504            self.inner.unary(req, path, codec).await
8505        }
8506        /** Revoke an invitation for a user who has not yet completed registration.
8507 Hard-deletes the user record (INVITED users have no data to preserve).
8508 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
8509*/
8510        pub async fn revoke_invite(
8511            &mut self,
8512            request: impl tonic::IntoRequest<super::RevokeInviteRequest>,
8513        ) -> std::result::Result<
8514            tonic::Response<super::RevokeInviteResponse>,
8515            tonic::Status,
8516        > {
8517            self.inner
8518                .ready()
8519                .await
8520                .map_err(|e| {
8521                    tonic::Status::unknown(
8522                        format!("Service was not ready: {}", e.into()),
8523                    )
8524                })?;
8525            let codec = tonic_prost::ProstCodec::default();
8526            let path = http::uri::PathAndQuery::from_static(
8527                "/pidgr.v1.MemberService/RevokeInvite",
8528            );
8529            let mut req = request.into_request();
8530            req.extensions_mut()
8531                .insert(GrpcMethod::new("pidgr.v1.MemberService", "RevokeInvite"));
8532            self.inner.unary(req, path, codec).await
8533        }
8534        /** Update a user's profile attributes (department, title, etc.).
8535 Self-update (empty user_id or matching JWT sub) requires no special permission.
8536 Updating another user requires PERMISSION_MEMBERS_MANAGE.
8537*/
8538        pub async fn update_user_profile(
8539            &mut self,
8540            request: impl tonic::IntoRequest<super::UpdateUserProfileRequest>,
8541        ) -> std::result::Result<
8542            tonic::Response<super::UpdateUserProfileResponse>,
8543            tonic::Status,
8544        > {
8545            self.inner
8546                .ready()
8547                .await
8548                .map_err(|e| {
8549                    tonic::Status::unknown(
8550                        format!("Service was not ready: {}", e.into()),
8551                    )
8552                })?;
8553            let codec = tonic_prost::ProstCodec::default();
8554            let path = http::uri::PathAndQuery::from_static(
8555                "/pidgr.v1.MemberService/UpdateUserProfile",
8556            );
8557            let mut req = request.into_request();
8558            req.extensions_mut()
8559                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserProfile"));
8560            self.inner.unary(req, path, codec).await
8561        }
8562        /** Retrieve the caller's platform settings (theme, etc.).
8563 Authorization: Any authenticated user (self-only).
8564*/
8565        pub async fn get_user_settings(
8566            &mut self,
8567            request: impl tonic::IntoRequest<super::GetUserSettingsRequest>,
8568        ) -> std::result::Result<
8569            tonic::Response<super::GetUserSettingsResponse>,
8570            tonic::Status,
8571        > {
8572            self.inner
8573                .ready()
8574                .await
8575                .map_err(|e| {
8576                    tonic::Status::unknown(
8577                        format!("Service was not ready: {}", e.into()),
8578                    )
8579                })?;
8580            let codec = tonic_prost::ProstCodec::default();
8581            let path = http::uri::PathAndQuery::from_static(
8582                "/pidgr.v1.MemberService/GetUserSettings",
8583            );
8584            let mut req = request.into_request();
8585            req.extensions_mut()
8586                .insert(GrpcMethod::new("pidgr.v1.MemberService", "GetUserSettings"));
8587            self.inner.unary(req, path, codec).await
8588        }
8589        /** Update the caller's platform settings.
8590 Only fields with non-default values are applied; others are left unchanged.
8591 Authorization: Any authenticated user (self-only).
8592*/
8593        pub async fn update_user_settings(
8594            &mut self,
8595            request: impl tonic::IntoRequest<super::UpdateUserSettingsRequest>,
8596        ) -> std::result::Result<
8597            tonic::Response<super::UpdateUserSettingsResponse>,
8598            tonic::Status,
8599        > {
8600            self.inner
8601                .ready()
8602                .await
8603                .map_err(|e| {
8604                    tonic::Status::unknown(
8605                        format!("Service was not ready: {}", e.into()),
8606                    )
8607                })?;
8608            let codec = tonic_prost::ProstCodec::default();
8609            let path = http::uri::PathAndQuery::from_static(
8610                "/pidgr.v1.MemberService/UpdateUserSettings",
8611            );
8612            let mut req = request.into_request();
8613            req.extensions_mut()
8614                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserSettings"));
8615            self.inner.unary(req, path, codec).await
8616        }
8617        /** Invite multiple users to the organization in a single call.
8618 Emails are deduplicated. Each email is processed independently — individual
8619 failures do not abort the batch. Identity provider calls are parallelized (bounded concurrency).
8620 Authorization: Requires PERMISSION_MEMBERS_INVITE.
8621*/
8622        pub async fn bulk_invite_users(
8623            &mut self,
8624            request: impl tonic::IntoRequest<super::BulkInviteUsersRequest>,
8625        ) -> std::result::Result<
8626            tonic::Response<super::BulkInviteUsersResponse>,
8627            tonic::Status,
8628        > {
8629            self.inner
8630                .ready()
8631                .await
8632                .map_err(|e| {
8633                    tonic::Status::unknown(
8634                        format!("Service was not ready: {}", e.into()),
8635                    )
8636                })?;
8637            let codec = tonic_prost::ProstCodec::default();
8638            let path = http::uri::PathAndQuery::from_static(
8639                "/pidgr.v1.MemberService/BulkInviteUsers",
8640            );
8641            let mut req = request.into_request();
8642            req.extensions_mut()
8643                .insert(GrpcMethod::new("pidgr.v1.MemberService", "BulkInviteUsers"));
8644            self.inner.unary(req, path, codec).await
8645        }
8646        /** Confirm passkey enrollment after client-side WebAuthn registration.
8647 Verifies the caller has at least one registered credential server-side,
8648 then marks the user as passkey-enrolled in the identity provider.
8649 Authorization: Any authenticated user (self-only, no permission required).
8650*/
8651        pub async fn confirm_passkey_enrollment(
8652            &mut self,
8653            request: impl tonic::IntoRequest<super::ConfirmPasskeyEnrollmentRequest>,
8654        ) -> std::result::Result<
8655            tonic::Response<super::ConfirmPasskeyEnrollmentResponse>,
8656            tonic::Status,
8657        > {
8658            self.inner
8659                .ready()
8660                .await
8661                .map_err(|e| {
8662                    tonic::Status::unknown(
8663                        format!("Service was not ready: {}", e.into()),
8664                    )
8665                })?;
8666            let codec = tonic_prost::ProstCodec::default();
8667            let path = http::uri::PathAndQuery::from_static(
8668                "/pidgr.v1.MemberService/ConfirmPasskeyEnrollment",
8669            );
8670            let mut req = request.into_request();
8671            req.extensions_mut()
8672                .insert(
8673                    GrpcMethod::new("pidgr.v1.MemberService", "ConfirmPasskeyEnrollment"),
8674                );
8675            self.inner.unary(req, path, codec).await
8676        }
8677        /** Update the data governance region for a user. Triggers a data migration
8678 workflow if the region changed. Admin-only operation.
8679 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
8680*/
8681        pub async fn update_user_region(
8682            &mut self,
8683            request: impl tonic::IntoRequest<super::UpdateUserRegionRequest>,
8684        ) -> std::result::Result<
8685            tonic::Response<super::UpdateUserRegionResponse>,
8686            tonic::Status,
8687        > {
8688            self.inner
8689                .ready()
8690                .await
8691                .map_err(|e| {
8692                    tonic::Status::unknown(
8693                        format!("Service was not ready: {}", e.into()),
8694                    )
8695                })?;
8696            let codec = tonic_prost::ProstCodec::default();
8697            let path = http::uri::PathAndQuery::from_static(
8698                "/pidgr.v1.MemberService/UpdateUserRegion",
8699            );
8700            let mut req = request.into_request();
8701            req.extensions_mut()
8702                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserRegion"));
8703            self.inner.unary(req, path, codec).await
8704        }
8705    }
8706}
8707/// Generated server implementations.
8708pub mod member_service_server {
8709    #![allow(
8710        unused_variables,
8711        dead_code,
8712        missing_docs,
8713        clippy::wildcard_imports,
8714        clippy::let_unit_value,
8715    )]
8716    use tonic::codegen::*;
8717    /// Generated trait containing gRPC methods that should be implemented for use with MemberServiceServer.
8718    #[async_trait]
8719    pub trait MemberService: std::marker::Send + std::marker::Sync + 'static {
8720        /** Invite a new user to the organization via email.
8721 Authorization: Requires PERMISSION_MEMBERS_INVITE.
8722*/
8723        async fn invite_user(
8724            &self,
8725            request: tonic::Request<super::InviteUserRequest>,
8726        ) -> std::result::Result<
8727            tonic::Response<super::InviteUserResponse>,
8728            tonic::Status,
8729        >;
8730        /** Retrieve a user by ID within the organization.
8731 Self-lookup (empty user_id) is allowed for any authenticated user.
8732 Authorization: Requires PERMISSION_MEMBERS_READ for other users.
8733*/
8734        async fn get_user(
8735            &self,
8736            request: tonic::Request<super::GetUserRequest>,
8737        ) -> std::result::Result<tonic::Response<super::GetUserResponse>, tonic::Status>;
8738        /** List all users in the organization with pagination.
8739 Authorization: Requires PERMISSION_MEMBERS_READ.
8740*/
8741        async fn list_users(
8742            &self,
8743            request: tonic::Request<super::ListUsersRequest>,
8744        ) -> std::result::Result<
8745            tonic::Response<super::ListUsersResponse>,
8746            tonic::Status,
8747        >;
8748        /** Change a user's role within the organization.
8749 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
8750*/
8751        async fn update_user_role(
8752            &self,
8753            request: tonic::Request<super::UpdateUserRoleRequest>,
8754        ) -> std::result::Result<
8755            tonic::Response<super::UpdateUserRoleResponse>,
8756            tonic::Status,
8757        >;
8758        /** Deactivate a user within the organization.
8759 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
8760*/
8761        async fn deactivate_user(
8762            &self,
8763            request: tonic::Request<super::DeactivateUserRequest>,
8764        ) -> std::result::Result<
8765            tonic::Response<super::DeactivateUserResponse>,
8766            tonic::Status,
8767        >;
8768        /** Reactivate a deactivated user, restoring their status to INVITED.
8769 The user must complete the invite link flow again to become ACTIVE.
8770 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
8771*/
8772        async fn reactivate_user(
8773            &self,
8774            request: tonic::Request<super::ReactivateUserRequest>,
8775        ) -> std::result::Result<
8776            tonic::Response<super::ReactivateUserResponse>,
8777            tonic::Status,
8778        >;
8779        /** Revoke an invitation for a user who has not yet completed registration.
8780 Hard-deletes the user record (INVITED users have no data to preserve).
8781 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
8782*/
8783        async fn revoke_invite(
8784            &self,
8785            request: tonic::Request<super::RevokeInviteRequest>,
8786        ) -> std::result::Result<
8787            tonic::Response<super::RevokeInviteResponse>,
8788            tonic::Status,
8789        >;
8790        /** Update a user's profile attributes (department, title, etc.).
8791 Self-update (empty user_id or matching JWT sub) requires no special permission.
8792 Updating another user requires PERMISSION_MEMBERS_MANAGE.
8793*/
8794        async fn update_user_profile(
8795            &self,
8796            request: tonic::Request<super::UpdateUserProfileRequest>,
8797        ) -> std::result::Result<
8798            tonic::Response<super::UpdateUserProfileResponse>,
8799            tonic::Status,
8800        >;
8801        /** Retrieve the caller's platform settings (theme, etc.).
8802 Authorization: Any authenticated user (self-only).
8803*/
8804        async fn get_user_settings(
8805            &self,
8806            request: tonic::Request<super::GetUserSettingsRequest>,
8807        ) -> std::result::Result<
8808            tonic::Response<super::GetUserSettingsResponse>,
8809            tonic::Status,
8810        >;
8811        /** Update the caller's platform settings.
8812 Only fields with non-default values are applied; others are left unchanged.
8813 Authorization: Any authenticated user (self-only).
8814*/
8815        async fn update_user_settings(
8816            &self,
8817            request: tonic::Request<super::UpdateUserSettingsRequest>,
8818        ) -> std::result::Result<
8819            tonic::Response<super::UpdateUserSettingsResponse>,
8820            tonic::Status,
8821        >;
8822        /** Invite multiple users to the organization in a single call.
8823 Emails are deduplicated. Each email is processed independently — individual
8824 failures do not abort the batch. Identity provider calls are parallelized (bounded concurrency).
8825 Authorization: Requires PERMISSION_MEMBERS_INVITE.
8826*/
8827        async fn bulk_invite_users(
8828            &self,
8829            request: tonic::Request<super::BulkInviteUsersRequest>,
8830        ) -> std::result::Result<
8831            tonic::Response<super::BulkInviteUsersResponse>,
8832            tonic::Status,
8833        >;
8834        /** Confirm passkey enrollment after client-side WebAuthn registration.
8835 Verifies the caller has at least one registered credential server-side,
8836 then marks the user as passkey-enrolled in the identity provider.
8837 Authorization: Any authenticated user (self-only, no permission required).
8838*/
8839        async fn confirm_passkey_enrollment(
8840            &self,
8841            request: tonic::Request<super::ConfirmPasskeyEnrollmentRequest>,
8842        ) -> std::result::Result<
8843            tonic::Response<super::ConfirmPasskeyEnrollmentResponse>,
8844            tonic::Status,
8845        >;
8846        /** Update the data governance region for a user. Triggers a data migration
8847 workflow if the region changed. Admin-only operation.
8848 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
8849*/
8850        async fn update_user_region(
8851            &self,
8852            request: tonic::Request<super::UpdateUserRegionRequest>,
8853        ) -> std::result::Result<
8854            tonic::Response<super::UpdateUserRegionResponse>,
8855            tonic::Status,
8856        >;
8857    }
8858    /** Manages members (users) within an organization.
8859 All RPCs operate within the caller's org (extracted from JWT).
8860*/
8861    #[derive(Debug)]
8862    pub struct MemberServiceServer<T> {
8863        inner: Arc<T>,
8864        accept_compression_encodings: EnabledCompressionEncodings,
8865        send_compression_encodings: EnabledCompressionEncodings,
8866        max_decoding_message_size: Option<usize>,
8867        max_encoding_message_size: Option<usize>,
8868    }
8869    impl<T> MemberServiceServer<T> {
8870        pub fn new(inner: T) -> Self {
8871            Self::from_arc(Arc::new(inner))
8872        }
8873        pub fn from_arc(inner: Arc<T>) -> Self {
8874            Self {
8875                inner,
8876                accept_compression_encodings: Default::default(),
8877                send_compression_encodings: Default::default(),
8878                max_decoding_message_size: None,
8879                max_encoding_message_size: None,
8880            }
8881        }
8882        pub fn with_interceptor<F>(
8883            inner: T,
8884            interceptor: F,
8885        ) -> InterceptedService<Self, F>
8886        where
8887            F: tonic::service::Interceptor,
8888        {
8889            InterceptedService::new(Self::new(inner), interceptor)
8890        }
8891        /// Enable decompressing requests with the given encoding.
8892        #[must_use]
8893        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8894            self.accept_compression_encodings.enable(encoding);
8895            self
8896        }
8897        /// Compress responses with the given encoding, if the client supports it.
8898        #[must_use]
8899        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8900            self.send_compression_encodings.enable(encoding);
8901            self
8902        }
8903        /// Limits the maximum size of a decoded message.
8904        ///
8905        /// Default: `4MB`
8906        #[must_use]
8907        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8908            self.max_decoding_message_size = Some(limit);
8909            self
8910        }
8911        /// Limits the maximum size of an encoded message.
8912        ///
8913        /// Default: `usize::MAX`
8914        #[must_use]
8915        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8916            self.max_encoding_message_size = Some(limit);
8917            self
8918        }
8919    }
8920    impl<T, B> tonic::codegen::Service<http::Request<B>> for MemberServiceServer<T>
8921    where
8922        T: MemberService,
8923        B: Body + std::marker::Send + 'static,
8924        B::Error: Into<StdError> + std::marker::Send + 'static,
8925    {
8926        type Response = http::Response<tonic::body::Body>;
8927        type Error = std::convert::Infallible;
8928        type Future = BoxFuture<Self::Response, Self::Error>;
8929        fn poll_ready(
8930            &mut self,
8931            _cx: &mut Context<'_>,
8932        ) -> Poll<std::result::Result<(), Self::Error>> {
8933            Poll::Ready(Ok(()))
8934        }
8935        fn call(&mut self, req: http::Request<B>) -> Self::Future {
8936            match req.uri().path() {
8937                "/pidgr.v1.MemberService/InviteUser" => {
8938                    #[allow(non_camel_case_types)]
8939                    struct InviteUserSvc<T: MemberService>(pub Arc<T>);
8940                    impl<
8941                        T: MemberService,
8942                    > tonic::server::UnaryService<super::InviteUserRequest>
8943                    for InviteUserSvc<T> {
8944                        type Response = super::InviteUserResponse;
8945                        type Future = BoxFuture<
8946                            tonic::Response<Self::Response>,
8947                            tonic::Status,
8948                        >;
8949                        fn call(
8950                            &mut self,
8951                            request: tonic::Request<super::InviteUserRequest>,
8952                        ) -> Self::Future {
8953                            let inner = Arc::clone(&self.0);
8954                            let fut = async move {
8955                                <T as MemberService>::invite_user(&inner, request).await
8956                            };
8957                            Box::pin(fut)
8958                        }
8959                    }
8960                    let accept_compression_encodings = self.accept_compression_encodings;
8961                    let send_compression_encodings = self.send_compression_encodings;
8962                    let max_decoding_message_size = self.max_decoding_message_size;
8963                    let max_encoding_message_size = self.max_encoding_message_size;
8964                    let inner = self.inner.clone();
8965                    let fut = async move {
8966                        let method = InviteUserSvc(inner);
8967                        let codec = tonic_prost::ProstCodec::default();
8968                        let mut grpc = tonic::server::Grpc::new(codec)
8969                            .apply_compression_config(
8970                                accept_compression_encodings,
8971                                send_compression_encodings,
8972                            )
8973                            .apply_max_message_size_config(
8974                                max_decoding_message_size,
8975                                max_encoding_message_size,
8976                            );
8977                        let res = grpc.unary(method, req).await;
8978                        Ok(res)
8979                    };
8980                    Box::pin(fut)
8981                }
8982                "/pidgr.v1.MemberService/GetUser" => {
8983                    #[allow(non_camel_case_types)]
8984                    struct GetUserSvc<T: MemberService>(pub Arc<T>);
8985                    impl<
8986                        T: MemberService,
8987                    > tonic::server::UnaryService<super::GetUserRequest>
8988                    for GetUserSvc<T> {
8989                        type Response = super::GetUserResponse;
8990                        type Future = BoxFuture<
8991                            tonic::Response<Self::Response>,
8992                            tonic::Status,
8993                        >;
8994                        fn call(
8995                            &mut self,
8996                            request: tonic::Request<super::GetUserRequest>,
8997                        ) -> Self::Future {
8998                            let inner = Arc::clone(&self.0);
8999                            let fut = async move {
9000                                <T as MemberService>::get_user(&inner, request).await
9001                            };
9002                            Box::pin(fut)
9003                        }
9004                    }
9005                    let accept_compression_encodings = self.accept_compression_encodings;
9006                    let send_compression_encodings = self.send_compression_encodings;
9007                    let max_decoding_message_size = self.max_decoding_message_size;
9008                    let max_encoding_message_size = self.max_encoding_message_size;
9009                    let inner = self.inner.clone();
9010                    let fut = async move {
9011                        let method = GetUserSvc(inner);
9012                        let codec = tonic_prost::ProstCodec::default();
9013                        let mut grpc = tonic::server::Grpc::new(codec)
9014                            .apply_compression_config(
9015                                accept_compression_encodings,
9016                                send_compression_encodings,
9017                            )
9018                            .apply_max_message_size_config(
9019                                max_decoding_message_size,
9020                                max_encoding_message_size,
9021                            );
9022                        let res = grpc.unary(method, req).await;
9023                        Ok(res)
9024                    };
9025                    Box::pin(fut)
9026                }
9027                "/pidgr.v1.MemberService/ListUsers" => {
9028                    #[allow(non_camel_case_types)]
9029                    struct ListUsersSvc<T: MemberService>(pub Arc<T>);
9030                    impl<
9031                        T: MemberService,
9032                    > tonic::server::UnaryService<super::ListUsersRequest>
9033                    for ListUsersSvc<T> {
9034                        type Response = super::ListUsersResponse;
9035                        type Future = BoxFuture<
9036                            tonic::Response<Self::Response>,
9037                            tonic::Status,
9038                        >;
9039                        fn call(
9040                            &mut self,
9041                            request: tonic::Request<super::ListUsersRequest>,
9042                        ) -> Self::Future {
9043                            let inner = Arc::clone(&self.0);
9044                            let fut = async move {
9045                                <T as MemberService>::list_users(&inner, request).await
9046                            };
9047                            Box::pin(fut)
9048                        }
9049                    }
9050                    let accept_compression_encodings = self.accept_compression_encodings;
9051                    let send_compression_encodings = self.send_compression_encodings;
9052                    let max_decoding_message_size = self.max_decoding_message_size;
9053                    let max_encoding_message_size = self.max_encoding_message_size;
9054                    let inner = self.inner.clone();
9055                    let fut = async move {
9056                        let method = ListUsersSvc(inner);
9057                        let codec = tonic_prost::ProstCodec::default();
9058                        let mut grpc = tonic::server::Grpc::new(codec)
9059                            .apply_compression_config(
9060                                accept_compression_encodings,
9061                                send_compression_encodings,
9062                            )
9063                            .apply_max_message_size_config(
9064                                max_decoding_message_size,
9065                                max_encoding_message_size,
9066                            );
9067                        let res = grpc.unary(method, req).await;
9068                        Ok(res)
9069                    };
9070                    Box::pin(fut)
9071                }
9072                "/pidgr.v1.MemberService/UpdateUserRole" => {
9073                    #[allow(non_camel_case_types)]
9074                    struct UpdateUserRoleSvc<T: MemberService>(pub Arc<T>);
9075                    impl<
9076                        T: MemberService,
9077                    > tonic::server::UnaryService<super::UpdateUserRoleRequest>
9078                    for UpdateUserRoleSvc<T> {
9079                        type Response = super::UpdateUserRoleResponse;
9080                        type Future = BoxFuture<
9081                            tonic::Response<Self::Response>,
9082                            tonic::Status,
9083                        >;
9084                        fn call(
9085                            &mut self,
9086                            request: tonic::Request<super::UpdateUserRoleRequest>,
9087                        ) -> Self::Future {
9088                            let inner = Arc::clone(&self.0);
9089                            let fut = async move {
9090                                <T as MemberService>::update_user_role(&inner, request)
9091                                    .await
9092                            };
9093                            Box::pin(fut)
9094                        }
9095                    }
9096                    let accept_compression_encodings = self.accept_compression_encodings;
9097                    let send_compression_encodings = self.send_compression_encodings;
9098                    let max_decoding_message_size = self.max_decoding_message_size;
9099                    let max_encoding_message_size = self.max_encoding_message_size;
9100                    let inner = self.inner.clone();
9101                    let fut = async move {
9102                        let method = UpdateUserRoleSvc(inner);
9103                        let codec = tonic_prost::ProstCodec::default();
9104                        let mut grpc = tonic::server::Grpc::new(codec)
9105                            .apply_compression_config(
9106                                accept_compression_encodings,
9107                                send_compression_encodings,
9108                            )
9109                            .apply_max_message_size_config(
9110                                max_decoding_message_size,
9111                                max_encoding_message_size,
9112                            );
9113                        let res = grpc.unary(method, req).await;
9114                        Ok(res)
9115                    };
9116                    Box::pin(fut)
9117                }
9118                "/pidgr.v1.MemberService/DeactivateUser" => {
9119                    #[allow(non_camel_case_types)]
9120                    struct DeactivateUserSvc<T: MemberService>(pub Arc<T>);
9121                    impl<
9122                        T: MemberService,
9123                    > tonic::server::UnaryService<super::DeactivateUserRequest>
9124                    for DeactivateUserSvc<T> {
9125                        type Response = super::DeactivateUserResponse;
9126                        type Future = BoxFuture<
9127                            tonic::Response<Self::Response>,
9128                            tonic::Status,
9129                        >;
9130                        fn call(
9131                            &mut self,
9132                            request: tonic::Request<super::DeactivateUserRequest>,
9133                        ) -> Self::Future {
9134                            let inner = Arc::clone(&self.0);
9135                            let fut = async move {
9136                                <T as MemberService>::deactivate_user(&inner, request).await
9137                            };
9138                            Box::pin(fut)
9139                        }
9140                    }
9141                    let accept_compression_encodings = self.accept_compression_encodings;
9142                    let send_compression_encodings = self.send_compression_encodings;
9143                    let max_decoding_message_size = self.max_decoding_message_size;
9144                    let max_encoding_message_size = self.max_encoding_message_size;
9145                    let inner = self.inner.clone();
9146                    let fut = async move {
9147                        let method = DeactivateUserSvc(inner);
9148                        let codec = tonic_prost::ProstCodec::default();
9149                        let mut grpc = tonic::server::Grpc::new(codec)
9150                            .apply_compression_config(
9151                                accept_compression_encodings,
9152                                send_compression_encodings,
9153                            )
9154                            .apply_max_message_size_config(
9155                                max_decoding_message_size,
9156                                max_encoding_message_size,
9157                            );
9158                        let res = grpc.unary(method, req).await;
9159                        Ok(res)
9160                    };
9161                    Box::pin(fut)
9162                }
9163                "/pidgr.v1.MemberService/ReactivateUser" => {
9164                    #[allow(non_camel_case_types)]
9165                    struct ReactivateUserSvc<T: MemberService>(pub Arc<T>);
9166                    impl<
9167                        T: MemberService,
9168                    > tonic::server::UnaryService<super::ReactivateUserRequest>
9169                    for ReactivateUserSvc<T> {
9170                        type Response = super::ReactivateUserResponse;
9171                        type Future = BoxFuture<
9172                            tonic::Response<Self::Response>,
9173                            tonic::Status,
9174                        >;
9175                        fn call(
9176                            &mut self,
9177                            request: tonic::Request<super::ReactivateUserRequest>,
9178                        ) -> Self::Future {
9179                            let inner = Arc::clone(&self.0);
9180                            let fut = async move {
9181                                <T as MemberService>::reactivate_user(&inner, request).await
9182                            };
9183                            Box::pin(fut)
9184                        }
9185                    }
9186                    let accept_compression_encodings = self.accept_compression_encodings;
9187                    let send_compression_encodings = self.send_compression_encodings;
9188                    let max_decoding_message_size = self.max_decoding_message_size;
9189                    let max_encoding_message_size = self.max_encoding_message_size;
9190                    let inner = self.inner.clone();
9191                    let fut = async move {
9192                        let method = ReactivateUserSvc(inner);
9193                        let codec = tonic_prost::ProstCodec::default();
9194                        let mut grpc = tonic::server::Grpc::new(codec)
9195                            .apply_compression_config(
9196                                accept_compression_encodings,
9197                                send_compression_encodings,
9198                            )
9199                            .apply_max_message_size_config(
9200                                max_decoding_message_size,
9201                                max_encoding_message_size,
9202                            );
9203                        let res = grpc.unary(method, req).await;
9204                        Ok(res)
9205                    };
9206                    Box::pin(fut)
9207                }
9208                "/pidgr.v1.MemberService/RevokeInvite" => {
9209                    #[allow(non_camel_case_types)]
9210                    struct RevokeInviteSvc<T: MemberService>(pub Arc<T>);
9211                    impl<
9212                        T: MemberService,
9213                    > tonic::server::UnaryService<super::RevokeInviteRequest>
9214                    for RevokeInviteSvc<T> {
9215                        type Response = super::RevokeInviteResponse;
9216                        type Future = BoxFuture<
9217                            tonic::Response<Self::Response>,
9218                            tonic::Status,
9219                        >;
9220                        fn call(
9221                            &mut self,
9222                            request: tonic::Request<super::RevokeInviteRequest>,
9223                        ) -> Self::Future {
9224                            let inner = Arc::clone(&self.0);
9225                            let fut = async move {
9226                                <T as MemberService>::revoke_invite(&inner, request).await
9227                            };
9228                            Box::pin(fut)
9229                        }
9230                    }
9231                    let accept_compression_encodings = self.accept_compression_encodings;
9232                    let send_compression_encodings = self.send_compression_encodings;
9233                    let max_decoding_message_size = self.max_decoding_message_size;
9234                    let max_encoding_message_size = self.max_encoding_message_size;
9235                    let inner = self.inner.clone();
9236                    let fut = async move {
9237                        let method = RevokeInviteSvc(inner);
9238                        let codec = tonic_prost::ProstCodec::default();
9239                        let mut grpc = tonic::server::Grpc::new(codec)
9240                            .apply_compression_config(
9241                                accept_compression_encodings,
9242                                send_compression_encodings,
9243                            )
9244                            .apply_max_message_size_config(
9245                                max_decoding_message_size,
9246                                max_encoding_message_size,
9247                            );
9248                        let res = grpc.unary(method, req).await;
9249                        Ok(res)
9250                    };
9251                    Box::pin(fut)
9252                }
9253                "/pidgr.v1.MemberService/UpdateUserProfile" => {
9254                    #[allow(non_camel_case_types)]
9255                    struct UpdateUserProfileSvc<T: MemberService>(pub Arc<T>);
9256                    impl<
9257                        T: MemberService,
9258                    > tonic::server::UnaryService<super::UpdateUserProfileRequest>
9259                    for UpdateUserProfileSvc<T> {
9260                        type Response = super::UpdateUserProfileResponse;
9261                        type Future = BoxFuture<
9262                            tonic::Response<Self::Response>,
9263                            tonic::Status,
9264                        >;
9265                        fn call(
9266                            &mut self,
9267                            request: tonic::Request<super::UpdateUserProfileRequest>,
9268                        ) -> Self::Future {
9269                            let inner = Arc::clone(&self.0);
9270                            let fut = async move {
9271                                <T as MemberService>::update_user_profile(&inner, request)
9272                                    .await
9273                            };
9274                            Box::pin(fut)
9275                        }
9276                    }
9277                    let accept_compression_encodings = self.accept_compression_encodings;
9278                    let send_compression_encodings = self.send_compression_encodings;
9279                    let max_decoding_message_size = self.max_decoding_message_size;
9280                    let max_encoding_message_size = self.max_encoding_message_size;
9281                    let inner = self.inner.clone();
9282                    let fut = async move {
9283                        let method = UpdateUserProfileSvc(inner);
9284                        let codec = tonic_prost::ProstCodec::default();
9285                        let mut grpc = tonic::server::Grpc::new(codec)
9286                            .apply_compression_config(
9287                                accept_compression_encodings,
9288                                send_compression_encodings,
9289                            )
9290                            .apply_max_message_size_config(
9291                                max_decoding_message_size,
9292                                max_encoding_message_size,
9293                            );
9294                        let res = grpc.unary(method, req).await;
9295                        Ok(res)
9296                    };
9297                    Box::pin(fut)
9298                }
9299                "/pidgr.v1.MemberService/GetUserSettings" => {
9300                    #[allow(non_camel_case_types)]
9301                    struct GetUserSettingsSvc<T: MemberService>(pub Arc<T>);
9302                    impl<
9303                        T: MemberService,
9304                    > tonic::server::UnaryService<super::GetUserSettingsRequest>
9305                    for GetUserSettingsSvc<T> {
9306                        type Response = super::GetUserSettingsResponse;
9307                        type Future = BoxFuture<
9308                            tonic::Response<Self::Response>,
9309                            tonic::Status,
9310                        >;
9311                        fn call(
9312                            &mut self,
9313                            request: tonic::Request<super::GetUserSettingsRequest>,
9314                        ) -> Self::Future {
9315                            let inner = Arc::clone(&self.0);
9316                            let fut = async move {
9317                                <T as MemberService>::get_user_settings(&inner, request)
9318                                    .await
9319                            };
9320                            Box::pin(fut)
9321                        }
9322                    }
9323                    let accept_compression_encodings = self.accept_compression_encodings;
9324                    let send_compression_encodings = self.send_compression_encodings;
9325                    let max_decoding_message_size = self.max_decoding_message_size;
9326                    let max_encoding_message_size = self.max_encoding_message_size;
9327                    let inner = self.inner.clone();
9328                    let fut = async move {
9329                        let method = GetUserSettingsSvc(inner);
9330                        let codec = tonic_prost::ProstCodec::default();
9331                        let mut grpc = tonic::server::Grpc::new(codec)
9332                            .apply_compression_config(
9333                                accept_compression_encodings,
9334                                send_compression_encodings,
9335                            )
9336                            .apply_max_message_size_config(
9337                                max_decoding_message_size,
9338                                max_encoding_message_size,
9339                            );
9340                        let res = grpc.unary(method, req).await;
9341                        Ok(res)
9342                    };
9343                    Box::pin(fut)
9344                }
9345                "/pidgr.v1.MemberService/UpdateUserSettings" => {
9346                    #[allow(non_camel_case_types)]
9347                    struct UpdateUserSettingsSvc<T: MemberService>(pub Arc<T>);
9348                    impl<
9349                        T: MemberService,
9350                    > tonic::server::UnaryService<super::UpdateUserSettingsRequest>
9351                    for UpdateUserSettingsSvc<T> {
9352                        type Response = super::UpdateUserSettingsResponse;
9353                        type Future = BoxFuture<
9354                            tonic::Response<Self::Response>,
9355                            tonic::Status,
9356                        >;
9357                        fn call(
9358                            &mut self,
9359                            request: tonic::Request<super::UpdateUserSettingsRequest>,
9360                        ) -> Self::Future {
9361                            let inner = Arc::clone(&self.0);
9362                            let fut = async move {
9363                                <T as MemberService>::update_user_settings(&inner, request)
9364                                    .await
9365                            };
9366                            Box::pin(fut)
9367                        }
9368                    }
9369                    let accept_compression_encodings = self.accept_compression_encodings;
9370                    let send_compression_encodings = self.send_compression_encodings;
9371                    let max_decoding_message_size = self.max_decoding_message_size;
9372                    let max_encoding_message_size = self.max_encoding_message_size;
9373                    let inner = self.inner.clone();
9374                    let fut = async move {
9375                        let method = UpdateUserSettingsSvc(inner);
9376                        let codec = tonic_prost::ProstCodec::default();
9377                        let mut grpc = tonic::server::Grpc::new(codec)
9378                            .apply_compression_config(
9379                                accept_compression_encodings,
9380                                send_compression_encodings,
9381                            )
9382                            .apply_max_message_size_config(
9383                                max_decoding_message_size,
9384                                max_encoding_message_size,
9385                            );
9386                        let res = grpc.unary(method, req).await;
9387                        Ok(res)
9388                    };
9389                    Box::pin(fut)
9390                }
9391                "/pidgr.v1.MemberService/BulkInviteUsers" => {
9392                    #[allow(non_camel_case_types)]
9393                    struct BulkInviteUsersSvc<T: MemberService>(pub Arc<T>);
9394                    impl<
9395                        T: MemberService,
9396                    > tonic::server::UnaryService<super::BulkInviteUsersRequest>
9397                    for BulkInviteUsersSvc<T> {
9398                        type Response = super::BulkInviteUsersResponse;
9399                        type Future = BoxFuture<
9400                            tonic::Response<Self::Response>,
9401                            tonic::Status,
9402                        >;
9403                        fn call(
9404                            &mut self,
9405                            request: tonic::Request<super::BulkInviteUsersRequest>,
9406                        ) -> Self::Future {
9407                            let inner = Arc::clone(&self.0);
9408                            let fut = async move {
9409                                <T as MemberService>::bulk_invite_users(&inner, request)
9410                                    .await
9411                            };
9412                            Box::pin(fut)
9413                        }
9414                    }
9415                    let accept_compression_encodings = self.accept_compression_encodings;
9416                    let send_compression_encodings = self.send_compression_encodings;
9417                    let max_decoding_message_size = self.max_decoding_message_size;
9418                    let max_encoding_message_size = self.max_encoding_message_size;
9419                    let inner = self.inner.clone();
9420                    let fut = async move {
9421                        let method = BulkInviteUsersSvc(inner);
9422                        let codec = tonic_prost::ProstCodec::default();
9423                        let mut grpc = tonic::server::Grpc::new(codec)
9424                            .apply_compression_config(
9425                                accept_compression_encodings,
9426                                send_compression_encodings,
9427                            )
9428                            .apply_max_message_size_config(
9429                                max_decoding_message_size,
9430                                max_encoding_message_size,
9431                            );
9432                        let res = grpc.unary(method, req).await;
9433                        Ok(res)
9434                    };
9435                    Box::pin(fut)
9436                }
9437                "/pidgr.v1.MemberService/ConfirmPasskeyEnrollment" => {
9438                    #[allow(non_camel_case_types)]
9439                    struct ConfirmPasskeyEnrollmentSvc<T: MemberService>(pub Arc<T>);
9440                    impl<
9441                        T: MemberService,
9442                    > tonic::server::UnaryService<super::ConfirmPasskeyEnrollmentRequest>
9443                    for ConfirmPasskeyEnrollmentSvc<T> {
9444                        type Response = super::ConfirmPasskeyEnrollmentResponse;
9445                        type Future = BoxFuture<
9446                            tonic::Response<Self::Response>,
9447                            tonic::Status,
9448                        >;
9449                        fn call(
9450                            &mut self,
9451                            request: tonic::Request<
9452                                super::ConfirmPasskeyEnrollmentRequest,
9453                            >,
9454                        ) -> Self::Future {
9455                            let inner = Arc::clone(&self.0);
9456                            let fut = async move {
9457                                <T as MemberService>::confirm_passkey_enrollment(
9458                                        &inner,
9459                                        request,
9460                                    )
9461                                    .await
9462                            };
9463                            Box::pin(fut)
9464                        }
9465                    }
9466                    let accept_compression_encodings = self.accept_compression_encodings;
9467                    let send_compression_encodings = self.send_compression_encodings;
9468                    let max_decoding_message_size = self.max_decoding_message_size;
9469                    let max_encoding_message_size = self.max_encoding_message_size;
9470                    let inner = self.inner.clone();
9471                    let fut = async move {
9472                        let method = ConfirmPasskeyEnrollmentSvc(inner);
9473                        let codec = tonic_prost::ProstCodec::default();
9474                        let mut grpc = tonic::server::Grpc::new(codec)
9475                            .apply_compression_config(
9476                                accept_compression_encodings,
9477                                send_compression_encodings,
9478                            )
9479                            .apply_max_message_size_config(
9480                                max_decoding_message_size,
9481                                max_encoding_message_size,
9482                            );
9483                        let res = grpc.unary(method, req).await;
9484                        Ok(res)
9485                    };
9486                    Box::pin(fut)
9487                }
9488                "/pidgr.v1.MemberService/UpdateUserRegion" => {
9489                    #[allow(non_camel_case_types)]
9490                    struct UpdateUserRegionSvc<T: MemberService>(pub Arc<T>);
9491                    impl<
9492                        T: MemberService,
9493                    > tonic::server::UnaryService<super::UpdateUserRegionRequest>
9494                    for UpdateUserRegionSvc<T> {
9495                        type Response = super::UpdateUserRegionResponse;
9496                        type Future = BoxFuture<
9497                            tonic::Response<Self::Response>,
9498                            tonic::Status,
9499                        >;
9500                        fn call(
9501                            &mut self,
9502                            request: tonic::Request<super::UpdateUserRegionRequest>,
9503                        ) -> Self::Future {
9504                            let inner = Arc::clone(&self.0);
9505                            let fut = async move {
9506                                <T as MemberService>::update_user_region(&inner, request)
9507                                    .await
9508                            };
9509                            Box::pin(fut)
9510                        }
9511                    }
9512                    let accept_compression_encodings = self.accept_compression_encodings;
9513                    let send_compression_encodings = self.send_compression_encodings;
9514                    let max_decoding_message_size = self.max_decoding_message_size;
9515                    let max_encoding_message_size = self.max_encoding_message_size;
9516                    let inner = self.inner.clone();
9517                    let fut = async move {
9518                        let method = UpdateUserRegionSvc(inner);
9519                        let codec = tonic_prost::ProstCodec::default();
9520                        let mut grpc = tonic::server::Grpc::new(codec)
9521                            .apply_compression_config(
9522                                accept_compression_encodings,
9523                                send_compression_encodings,
9524                            )
9525                            .apply_max_message_size_config(
9526                                max_decoding_message_size,
9527                                max_encoding_message_size,
9528                            );
9529                        let res = grpc.unary(method, req).await;
9530                        Ok(res)
9531                    };
9532                    Box::pin(fut)
9533                }
9534                _ => {
9535                    Box::pin(async move {
9536                        let mut response = http::Response::new(
9537                            tonic::body::Body::default(),
9538                        );
9539                        let headers = response.headers_mut();
9540                        headers
9541                            .insert(
9542                                tonic::Status::GRPC_STATUS,
9543                                (tonic::Code::Unimplemented as i32).into(),
9544                            );
9545                        headers
9546                            .insert(
9547                                http::header::CONTENT_TYPE,
9548                                tonic::metadata::GRPC_CONTENT_TYPE,
9549                            );
9550                        Ok(response)
9551                    })
9552                }
9553            }
9554        }
9555    }
9556    impl<T> Clone for MemberServiceServer<T> {
9557        fn clone(&self) -> Self {
9558            let inner = self.inner.clone();
9559            Self {
9560                inner,
9561                accept_compression_encodings: self.accept_compression_encodings,
9562                send_compression_encodings: self.send_compression_encodings,
9563                max_decoding_message_size: self.max_decoding_message_size,
9564                max_encoding_message_size: self.max_encoding_message_size,
9565            }
9566        }
9567    }
9568    /// Generated gRPC service name
9569    pub const SERVICE_NAME: &str = "pidgr.v1.MemberService";
9570    impl<T> tonic::server::NamedService for MemberServiceServer<T> {
9571        const NAME: &'static str = SERVICE_NAME;
9572    }
9573}
9574/// Generated client implementations.
9575pub mod organization_service_client {
9576    #![allow(
9577        unused_variables,
9578        dead_code,
9579        missing_docs,
9580        clippy::wildcard_imports,
9581        clippy::let_unit_value,
9582    )]
9583    use tonic::codegen::*;
9584    use tonic::codegen::http::Uri;
9585    /** Manages organizations (tenants) in the Pidgr platform.
9586 Most RPCs operate within the caller's org (extracted from JWT).
9587 CreateOrganization supports API key auth or JWT auth (self-service onboarding).
9588*/
9589    #[derive(Debug, Clone)]
9590    pub struct OrganizationServiceClient<T> {
9591        inner: tonic::client::Grpc<T>,
9592    }
9593    impl OrganizationServiceClient<tonic::transport::Channel> {
9594        /// Attempt to create a new client by connecting to a given endpoint.
9595        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
9596        where
9597            D: TryInto<tonic::transport::Endpoint>,
9598            D::Error: Into<StdError>,
9599        {
9600            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
9601            Ok(Self::new(conn))
9602        }
9603    }
9604    impl<T> OrganizationServiceClient<T>
9605    where
9606        T: tonic::client::GrpcService<tonic::body::Body>,
9607        T::Error: Into<StdError>,
9608        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
9609        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
9610    {
9611        pub fn new(inner: T) -> Self {
9612            let inner = tonic::client::Grpc::new(inner);
9613            Self { inner }
9614        }
9615        pub fn with_origin(inner: T, origin: Uri) -> Self {
9616            let inner = tonic::client::Grpc::with_origin(inner, origin);
9617            Self { inner }
9618        }
9619        pub fn with_interceptor<F>(
9620            inner: T,
9621            interceptor: F,
9622        ) -> OrganizationServiceClient<InterceptedService<T, F>>
9623        where
9624            F: tonic::service::Interceptor,
9625            T::ResponseBody: Default,
9626            T: tonic::codegen::Service<
9627                http::Request<tonic::body::Body>,
9628                Response = http::Response<
9629                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
9630                >,
9631            >,
9632            <T as tonic::codegen::Service<
9633                http::Request<tonic::body::Body>,
9634            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
9635        {
9636            OrganizationServiceClient::new(InterceptedService::new(inner, interceptor))
9637        }
9638        /// Compress requests with the given encoding.
9639        ///
9640        /// This requires the server to support it otherwise it might respond with an
9641        /// error.
9642        #[must_use]
9643        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9644            self.inner = self.inner.send_compressed(encoding);
9645            self
9646        }
9647        /// Enable decompressing responses.
9648        #[must_use]
9649        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9650            self.inner = self.inner.accept_compressed(encoding);
9651            self
9652        }
9653        /// Limits the maximum size of a decoded message.
9654        ///
9655        /// Default: `4MB`
9656        #[must_use]
9657        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9658            self.inner = self.inner.max_decoding_message_size(limit);
9659            self
9660        }
9661        /// Limits the maximum size of an encoded message.
9662        ///
9663        /// Default: `usize::MAX`
9664        #[must_use]
9665        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9666            self.inner = self.inner.max_encoding_message_size(limit);
9667            self
9668        }
9669        /** Create a new organization. JWT auth only — the caller becomes the initial
9670 admin. Add further admins via CreateInviteLink.
9671 Authorization: Authenticated user (no specific permission required).
9672*/
9673        pub async fn create_organization(
9674            &mut self,
9675            request: impl tonic::IntoRequest<super::CreateOrganizationRequest>,
9676        ) -> std::result::Result<
9677            tonic::Response<super::CreateOrganizationResponse>,
9678            tonic::Status,
9679        > {
9680            self.inner
9681                .ready()
9682                .await
9683                .map_err(|e| {
9684                    tonic::Status::unknown(
9685                        format!("Service was not ready: {}", e.into()),
9686                    )
9687                })?;
9688            let codec = tonic_prost::ProstCodec::default();
9689            let path = http::uri::PathAndQuery::from_static(
9690                "/pidgr.v1.OrganizationService/CreateOrganization",
9691            );
9692            let mut req = request.into_request();
9693            req.extensions_mut()
9694                .insert(
9695                    GrpcMethod::new("pidgr.v1.OrganizationService", "CreateOrganization"),
9696                );
9697            self.inner.unary(req, path, codec).await
9698        }
9699        /** Retrieve the organization for the authenticated user.
9700 Authorization: Requires PERMISSION_ORG_READ.
9701*/
9702        pub async fn get_organization(
9703            &mut self,
9704            request: impl tonic::IntoRequest<super::GetOrganizationRequest>,
9705        ) -> std::result::Result<
9706            tonic::Response<super::GetOrganizationResponse>,
9707            tonic::Status,
9708        > {
9709            self.inner
9710                .ready()
9711                .await
9712                .map_err(|e| {
9713                    tonic::Status::unknown(
9714                        format!("Service was not ready: {}", e.into()),
9715                    )
9716                })?;
9717            let codec = tonic_prost::ProstCodec::default();
9718            let path = http::uri::PathAndQuery::from_static(
9719                "/pidgr.v1.OrganizationService/GetOrganization",
9720            );
9721            let mut req = request.into_request();
9722            req.extensions_mut()
9723                .insert(
9724                    GrpcMethod::new("pidgr.v1.OrganizationService", "GetOrganization"),
9725                );
9726            self.inner.unary(req, path, codec).await
9727        }
9728        /** Update organization settings (name, default workflow, industry, company size).
9729 Authorization: Requires PERMISSION_ORG_WRITE.
9730*/
9731        pub async fn update_organization(
9732            &mut self,
9733            request: impl tonic::IntoRequest<super::UpdateOrganizationRequest>,
9734        ) -> std::result::Result<
9735            tonic::Response<super::UpdateOrganizationResponse>,
9736            tonic::Status,
9737        > {
9738            self.inner
9739                .ready()
9740                .await
9741                .map_err(|e| {
9742                    tonic::Status::unknown(
9743                        format!("Service was not ready: {}", e.into()),
9744                    )
9745                })?;
9746            let codec = tonic_prost::ProstCodec::default();
9747            let path = http::uri::PathAndQuery::from_static(
9748                "/pidgr.v1.OrganizationService/UpdateOrganization",
9749            );
9750            let mut req = request.into_request();
9751            req.extensions_mut()
9752                .insert(
9753                    GrpcMethod::new("pidgr.v1.OrganizationService", "UpdateOrganization"),
9754                );
9755            self.inner.unary(req, path, codec).await
9756        }
9757        /** Replace all SSO attribute mappings for the organization.
9758 Authorization: Requires PERMISSION_ORG_WRITE.
9759*/
9760        pub async fn update_sso_attribute_mappings(
9761            &mut self,
9762            request: impl tonic::IntoRequest<super::UpdateSsoAttributeMappingsRequest>,
9763        ) -> std::result::Result<
9764            tonic::Response<super::UpdateSsoAttributeMappingsResponse>,
9765            tonic::Status,
9766        > {
9767            self.inner
9768                .ready()
9769                .await
9770                .map_err(|e| {
9771                    tonic::Status::unknown(
9772                        format!("Service was not ready: {}", e.into()),
9773                    )
9774                })?;
9775            let codec = tonic_prost::ProstCodec::default();
9776            let path = http::uri::PathAndQuery::from_static(
9777                "/pidgr.v1.OrganizationService/UpdateSsoAttributeMappings",
9778            );
9779            let mut req = request.into_request();
9780            req.extensions_mut()
9781                .insert(
9782                    GrpcMethod::new(
9783                        "pidgr.v1.OrganizationService",
9784                        "UpdateSsoAttributeMappings",
9785                    ),
9786                );
9787            self.inner.unary(req, path, codec).await
9788        }
9789        /** Rotate the analytics salt and optionally increase the bucket count for k-anonymization.
9790 Authorization: Requires PERMISSION_PRIVACY_WRITE.
9791*/
9792        pub async fn rotate_analytics_salt(
9793            &mut self,
9794            request: impl tonic::IntoRequest<super::RotateAnalyticsSaltRequest>,
9795        ) -> std::result::Result<
9796            tonic::Response<super::RotateAnalyticsSaltResponse>,
9797            tonic::Status,
9798        > {
9799            self.inner
9800                .ready()
9801                .await
9802                .map_err(|e| {
9803                    tonic::Status::unknown(
9804                        format!("Service was not ready: {}", e.into()),
9805                    )
9806                })?;
9807            let codec = tonic_prost::ProstCodec::default();
9808            let path = http::uri::PathAndQuery::from_static(
9809                "/pidgr.v1.OrganizationService/RotateAnalyticsSalt",
9810            );
9811            let mut req = request.into_request();
9812            req.extensions_mut()
9813                .insert(
9814                    GrpcMethod::new(
9815                        "pidgr.v1.OrganizationService",
9816                        "RotateAnalyticsSalt",
9817                    ),
9818                );
9819            self.inner.unary(req, path, codec).await
9820        }
9821        /** Update the differential privacy epsilon parameter.
9822 Authorization: Requires PERMISSION_PRIVACY_WRITE.
9823*/
9824        pub async fn update_analytics_epsilon(
9825            &mut self,
9826            request: impl tonic::IntoRequest<super::UpdateAnalyticsEpsilonRequest>,
9827        ) -> std::result::Result<
9828            tonic::Response<super::UpdateAnalyticsEpsilonResponse>,
9829            tonic::Status,
9830        > {
9831            self.inner
9832                .ready()
9833                .await
9834                .map_err(|e| {
9835                    tonic::Status::unknown(
9836                        format!("Service was not ready: {}", e.into()),
9837                    )
9838                })?;
9839            let codec = tonic_prost::ProstCodec::default();
9840            let path = http::uri::PathAndQuery::from_static(
9841                "/pidgr.v1.OrganizationService/UpdateAnalyticsEpsilon",
9842            );
9843            let mut req = request.into_request();
9844            req.extensions_mut()
9845                .insert(
9846                    GrpcMethod::new(
9847                        "pidgr.v1.OrganizationService",
9848                        "UpdateAnalyticsEpsilon",
9849                    ),
9850                );
9851            self.inner.unary(req, path, codec).await
9852        }
9853        /** Create a sandbox organization for testing configurations.
9854 Sandbox orgs auto-delete after expires_at. The caller becomes super admin.
9855 Authorization: Any authenticated user. Limited to 3 concurrent sandboxes
9856 per user to prevent abuse.
9857*/
9858        pub async fn create_sandbox_organization(
9859            &mut self,
9860            request: impl tonic::IntoRequest<super::CreateSandboxOrganizationRequest>,
9861        ) -> std::result::Result<
9862            tonic::Response<super::CreateSandboxOrganizationResponse>,
9863            tonic::Status,
9864        > {
9865            self.inner
9866                .ready()
9867                .await
9868                .map_err(|e| {
9869                    tonic::Status::unknown(
9870                        format!("Service was not ready: {}", e.into()),
9871                    )
9872                })?;
9873            let codec = tonic_prost::ProstCodec::default();
9874            let path = http::uri::PathAndQuery::from_static(
9875                "/pidgr.v1.OrganizationService/CreateSandboxOrganization",
9876            );
9877            let mut req = request.into_request();
9878            req.extensions_mut()
9879                .insert(
9880                    GrpcMethod::new(
9881                        "pidgr.v1.OrganizationService",
9882                        "CreateSandboxOrganization",
9883                    ),
9884                );
9885            self.inner.unary(req, path, codec).await
9886        }
9887        /** Delete a sandbox organization immediately. Starts the DeleteOrgWorkflow
9888 which handles cleanup across DB, Cognito, S3, Temporal, and regional
9889 content stores.
9890 Authorization: Super admin of the target sandbox OR its creator.
9891*/
9892        pub async fn delete_sandbox_organization(
9893            &mut self,
9894            request: impl tonic::IntoRequest<super::DeleteSandboxOrganizationRequest>,
9895        ) -> std::result::Result<
9896            tonic::Response<super::DeleteSandboxOrganizationResponse>,
9897            tonic::Status,
9898        > {
9899            self.inner
9900                .ready()
9901                .await
9902                .map_err(|e| {
9903                    tonic::Status::unknown(
9904                        format!("Service was not ready: {}", e.into()),
9905                    )
9906                })?;
9907            let codec = tonic_prost::ProstCodec::default();
9908            let path = http::uri::PathAndQuery::from_static(
9909                "/pidgr.v1.OrganizationService/DeleteSandboxOrganization",
9910            );
9911            let mut req = request.into_request();
9912            req.extensions_mut()
9913                .insert(
9914                    GrpcMethod::new(
9915                        "pidgr.v1.OrganizationService",
9916                        "DeleteSandboxOrganization",
9917                    ),
9918                );
9919            self.inner.unary(req, path, codec).await
9920        }
9921        /** List sandbox fixtures available for seeding new sandbox orgs. The catalog
9922 is backend-owned; admin UI populates the "fill with sample data" checkbox
9923 or dropdown from this response.
9924 Authorization: Any authenticated user.
9925*/
9926        pub async fn list_sandbox_fixtures(
9927            &mut self,
9928            request: impl tonic::IntoRequest<super::ListSandboxFixturesRequest>,
9929        ) -> std::result::Result<
9930            tonic::Response<super::ListSandboxFixturesResponse>,
9931            tonic::Status,
9932        > {
9933            self.inner
9934                .ready()
9935                .await
9936                .map_err(|e| {
9937                    tonic::Status::unknown(
9938                        format!("Service was not ready: {}", e.into()),
9939                    )
9940                })?;
9941            let codec = tonic_prost::ProstCodec::default();
9942            let path = http::uri::PathAndQuery::from_static(
9943                "/pidgr.v1.OrganizationService/ListSandboxFixtures",
9944            );
9945            let mut req = request.into_request();
9946            req.extensions_mut()
9947                .insert(
9948                    GrpcMethod::new(
9949                        "pidgr.v1.OrganizationService",
9950                        "ListSandboxFixtures",
9951                    ),
9952                );
9953            self.inner.unary(req, path, codec).await
9954        }
9955        /** List all organizations the authenticated user belongs to.
9956 Org-exempt: callable without org context (only requires valid JWT).
9957 Used by the admin org switcher to discover available orgs.
9958 Excludes expired sandbox organizations.
9959 Authorization: Authenticated user (no specific permission required).
9960*/
9961        pub async fn list_user_organizations(
9962            &mut self,
9963            request: impl tonic::IntoRequest<super::ListUserOrganizationsRequest>,
9964        ) -> std::result::Result<
9965            tonic::Response<super::ListUserOrganizationsResponse>,
9966            tonic::Status,
9967        > {
9968            self.inner
9969                .ready()
9970                .await
9971                .map_err(|e| {
9972                    tonic::Status::unknown(
9973                        format!("Service was not ready: {}", e.into()),
9974                    )
9975                })?;
9976            let codec = tonic_prost::ProstCodec::default();
9977            let path = http::uri::PathAndQuery::from_static(
9978                "/pidgr.v1.OrganizationService/ListUserOrganizations",
9979            );
9980            let mut req = request.into_request();
9981            req.extensions_mut()
9982                .insert(
9983                    GrpcMethod::new(
9984                        "pidgr.v1.OrganizationService",
9985                        "ListUserOrganizations",
9986                    ),
9987                );
9988            self.inner.unary(req, path, codec).await
9989        }
9990        /** List only the sandbox organizations the authenticated user belongs to.
9991 Org-exempt: callable without org context. The admin UI's /sandboxes
9992 management page is the primary consumer — it's a user-level surface
9993 rather than org-scoped, so this RPC is user-scoped too.
9994 Excludes already-expired sandboxes (pending cleanup).
9995 Authorization: Authenticated user (no specific permission required).
9996*/
9997        pub async fn list_user_sandboxes(
9998            &mut self,
9999            request: impl tonic::IntoRequest<super::ListUserSandboxesRequest>,
10000        ) -> std::result::Result<
10001            tonic::Response<super::ListUserSandboxesResponse>,
10002            tonic::Status,
10003        > {
10004            self.inner
10005                .ready()
10006                .await
10007                .map_err(|e| {
10008                    tonic::Status::unknown(
10009                        format!("Service was not ready: {}", e.into()),
10010                    )
10011                })?;
10012            let codec = tonic_prost::ProstCodec::default();
10013            let path = http::uri::PathAndQuery::from_static(
10014                "/pidgr.v1.OrganizationService/ListUserSandboxes",
10015            );
10016            let mut req = request.into_request();
10017            req.extensions_mut()
10018                .insert(
10019                    GrpcMethod::new("pidgr.v1.OrganizationService", "ListUserSandboxes"),
10020                );
10021            self.inner.unary(req, path, codec).await
10022        }
10023    }
10024}
10025/// Generated server implementations.
10026pub mod organization_service_server {
10027    #![allow(
10028        unused_variables,
10029        dead_code,
10030        missing_docs,
10031        clippy::wildcard_imports,
10032        clippy::let_unit_value,
10033    )]
10034    use tonic::codegen::*;
10035    /// Generated trait containing gRPC methods that should be implemented for use with OrganizationServiceServer.
10036    #[async_trait]
10037    pub trait OrganizationService: std::marker::Send + std::marker::Sync + 'static {
10038        /** Create a new organization. JWT auth only — the caller becomes the initial
10039 admin. Add further admins via CreateInviteLink.
10040 Authorization: Authenticated user (no specific permission required).
10041*/
10042        async fn create_organization(
10043            &self,
10044            request: tonic::Request<super::CreateOrganizationRequest>,
10045        ) -> std::result::Result<
10046            tonic::Response<super::CreateOrganizationResponse>,
10047            tonic::Status,
10048        >;
10049        /** Retrieve the organization for the authenticated user.
10050 Authorization: Requires PERMISSION_ORG_READ.
10051*/
10052        async fn get_organization(
10053            &self,
10054            request: tonic::Request<super::GetOrganizationRequest>,
10055        ) -> std::result::Result<
10056            tonic::Response<super::GetOrganizationResponse>,
10057            tonic::Status,
10058        >;
10059        /** Update organization settings (name, default workflow, industry, company size).
10060 Authorization: Requires PERMISSION_ORG_WRITE.
10061*/
10062        async fn update_organization(
10063            &self,
10064            request: tonic::Request<super::UpdateOrganizationRequest>,
10065        ) -> std::result::Result<
10066            tonic::Response<super::UpdateOrganizationResponse>,
10067            tonic::Status,
10068        >;
10069        /** Replace all SSO attribute mappings for the organization.
10070 Authorization: Requires PERMISSION_ORG_WRITE.
10071*/
10072        async fn update_sso_attribute_mappings(
10073            &self,
10074            request: tonic::Request<super::UpdateSsoAttributeMappingsRequest>,
10075        ) -> std::result::Result<
10076            tonic::Response<super::UpdateSsoAttributeMappingsResponse>,
10077            tonic::Status,
10078        >;
10079        /** Rotate the analytics salt and optionally increase the bucket count for k-anonymization.
10080 Authorization: Requires PERMISSION_PRIVACY_WRITE.
10081*/
10082        async fn rotate_analytics_salt(
10083            &self,
10084            request: tonic::Request<super::RotateAnalyticsSaltRequest>,
10085        ) -> std::result::Result<
10086            tonic::Response<super::RotateAnalyticsSaltResponse>,
10087            tonic::Status,
10088        >;
10089        /** Update the differential privacy epsilon parameter.
10090 Authorization: Requires PERMISSION_PRIVACY_WRITE.
10091*/
10092        async fn update_analytics_epsilon(
10093            &self,
10094            request: tonic::Request<super::UpdateAnalyticsEpsilonRequest>,
10095        ) -> std::result::Result<
10096            tonic::Response<super::UpdateAnalyticsEpsilonResponse>,
10097            tonic::Status,
10098        >;
10099        /** Create a sandbox organization for testing configurations.
10100 Sandbox orgs auto-delete after expires_at. The caller becomes super admin.
10101 Authorization: Any authenticated user. Limited to 3 concurrent sandboxes
10102 per user to prevent abuse.
10103*/
10104        async fn create_sandbox_organization(
10105            &self,
10106            request: tonic::Request<super::CreateSandboxOrganizationRequest>,
10107        ) -> std::result::Result<
10108            tonic::Response<super::CreateSandboxOrganizationResponse>,
10109            tonic::Status,
10110        >;
10111        /** Delete a sandbox organization immediately. Starts the DeleteOrgWorkflow
10112 which handles cleanup across DB, Cognito, S3, Temporal, and regional
10113 content stores.
10114 Authorization: Super admin of the target sandbox OR its creator.
10115*/
10116        async fn delete_sandbox_organization(
10117            &self,
10118            request: tonic::Request<super::DeleteSandboxOrganizationRequest>,
10119        ) -> std::result::Result<
10120            tonic::Response<super::DeleteSandboxOrganizationResponse>,
10121            tonic::Status,
10122        >;
10123        /** List sandbox fixtures available for seeding new sandbox orgs. The catalog
10124 is backend-owned; admin UI populates the "fill with sample data" checkbox
10125 or dropdown from this response.
10126 Authorization: Any authenticated user.
10127*/
10128        async fn list_sandbox_fixtures(
10129            &self,
10130            request: tonic::Request<super::ListSandboxFixturesRequest>,
10131        ) -> std::result::Result<
10132            tonic::Response<super::ListSandboxFixturesResponse>,
10133            tonic::Status,
10134        >;
10135        /** List all organizations the authenticated user belongs to.
10136 Org-exempt: callable without org context (only requires valid JWT).
10137 Used by the admin org switcher to discover available orgs.
10138 Excludes expired sandbox organizations.
10139 Authorization: Authenticated user (no specific permission required).
10140*/
10141        async fn list_user_organizations(
10142            &self,
10143            request: tonic::Request<super::ListUserOrganizationsRequest>,
10144        ) -> std::result::Result<
10145            tonic::Response<super::ListUserOrganizationsResponse>,
10146            tonic::Status,
10147        >;
10148        /** List only the sandbox organizations the authenticated user belongs to.
10149 Org-exempt: callable without org context. The admin UI's /sandboxes
10150 management page is the primary consumer — it's a user-level surface
10151 rather than org-scoped, so this RPC is user-scoped too.
10152 Excludes already-expired sandboxes (pending cleanup).
10153 Authorization: Authenticated user (no specific permission required).
10154*/
10155        async fn list_user_sandboxes(
10156            &self,
10157            request: tonic::Request<super::ListUserSandboxesRequest>,
10158        ) -> std::result::Result<
10159            tonic::Response<super::ListUserSandboxesResponse>,
10160            tonic::Status,
10161        >;
10162    }
10163    /** Manages organizations (tenants) in the Pidgr platform.
10164 Most RPCs operate within the caller's org (extracted from JWT).
10165 CreateOrganization supports API key auth or JWT auth (self-service onboarding).
10166*/
10167    #[derive(Debug)]
10168    pub struct OrganizationServiceServer<T> {
10169        inner: Arc<T>,
10170        accept_compression_encodings: EnabledCompressionEncodings,
10171        send_compression_encodings: EnabledCompressionEncodings,
10172        max_decoding_message_size: Option<usize>,
10173        max_encoding_message_size: Option<usize>,
10174    }
10175    impl<T> OrganizationServiceServer<T> {
10176        pub fn new(inner: T) -> Self {
10177            Self::from_arc(Arc::new(inner))
10178        }
10179        pub fn from_arc(inner: Arc<T>) -> Self {
10180            Self {
10181                inner,
10182                accept_compression_encodings: Default::default(),
10183                send_compression_encodings: Default::default(),
10184                max_decoding_message_size: None,
10185                max_encoding_message_size: None,
10186            }
10187        }
10188        pub fn with_interceptor<F>(
10189            inner: T,
10190            interceptor: F,
10191        ) -> InterceptedService<Self, F>
10192        where
10193            F: tonic::service::Interceptor,
10194        {
10195            InterceptedService::new(Self::new(inner), interceptor)
10196        }
10197        /// Enable decompressing requests with the given encoding.
10198        #[must_use]
10199        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10200            self.accept_compression_encodings.enable(encoding);
10201            self
10202        }
10203        /// Compress responses with the given encoding, if the client supports it.
10204        #[must_use]
10205        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10206            self.send_compression_encodings.enable(encoding);
10207            self
10208        }
10209        /// Limits the maximum size of a decoded message.
10210        ///
10211        /// Default: `4MB`
10212        #[must_use]
10213        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10214            self.max_decoding_message_size = Some(limit);
10215            self
10216        }
10217        /// Limits the maximum size of an encoded message.
10218        ///
10219        /// Default: `usize::MAX`
10220        #[must_use]
10221        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10222            self.max_encoding_message_size = Some(limit);
10223            self
10224        }
10225    }
10226    impl<T, B> tonic::codegen::Service<http::Request<B>> for OrganizationServiceServer<T>
10227    where
10228        T: OrganizationService,
10229        B: Body + std::marker::Send + 'static,
10230        B::Error: Into<StdError> + std::marker::Send + 'static,
10231    {
10232        type Response = http::Response<tonic::body::Body>;
10233        type Error = std::convert::Infallible;
10234        type Future = BoxFuture<Self::Response, Self::Error>;
10235        fn poll_ready(
10236            &mut self,
10237            _cx: &mut Context<'_>,
10238        ) -> Poll<std::result::Result<(), Self::Error>> {
10239            Poll::Ready(Ok(()))
10240        }
10241        fn call(&mut self, req: http::Request<B>) -> Self::Future {
10242            match req.uri().path() {
10243                "/pidgr.v1.OrganizationService/CreateOrganization" => {
10244                    #[allow(non_camel_case_types)]
10245                    struct CreateOrganizationSvc<T: OrganizationService>(pub Arc<T>);
10246                    impl<
10247                        T: OrganizationService,
10248                    > tonic::server::UnaryService<super::CreateOrganizationRequest>
10249                    for CreateOrganizationSvc<T> {
10250                        type Response = super::CreateOrganizationResponse;
10251                        type Future = BoxFuture<
10252                            tonic::Response<Self::Response>,
10253                            tonic::Status,
10254                        >;
10255                        fn call(
10256                            &mut self,
10257                            request: tonic::Request<super::CreateOrganizationRequest>,
10258                        ) -> Self::Future {
10259                            let inner = Arc::clone(&self.0);
10260                            let fut = async move {
10261                                <T as OrganizationService>::create_organization(
10262                                        &inner,
10263                                        request,
10264                                    )
10265                                    .await
10266                            };
10267                            Box::pin(fut)
10268                        }
10269                    }
10270                    let accept_compression_encodings = self.accept_compression_encodings;
10271                    let send_compression_encodings = self.send_compression_encodings;
10272                    let max_decoding_message_size = self.max_decoding_message_size;
10273                    let max_encoding_message_size = self.max_encoding_message_size;
10274                    let inner = self.inner.clone();
10275                    let fut = async move {
10276                        let method = CreateOrganizationSvc(inner);
10277                        let codec = tonic_prost::ProstCodec::default();
10278                        let mut grpc = tonic::server::Grpc::new(codec)
10279                            .apply_compression_config(
10280                                accept_compression_encodings,
10281                                send_compression_encodings,
10282                            )
10283                            .apply_max_message_size_config(
10284                                max_decoding_message_size,
10285                                max_encoding_message_size,
10286                            );
10287                        let res = grpc.unary(method, req).await;
10288                        Ok(res)
10289                    };
10290                    Box::pin(fut)
10291                }
10292                "/pidgr.v1.OrganizationService/GetOrganization" => {
10293                    #[allow(non_camel_case_types)]
10294                    struct GetOrganizationSvc<T: OrganizationService>(pub Arc<T>);
10295                    impl<
10296                        T: OrganizationService,
10297                    > tonic::server::UnaryService<super::GetOrganizationRequest>
10298                    for GetOrganizationSvc<T> {
10299                        type Response = super::GetOrganizationResponse;
10300                        type Future = BoxFuture<
10301                            tonic::Response<Self::Response>,
10302                            tonic::Status,
10303                        >;
10304                        fn call(
10305                            &mut self,
10306                            request: tonic::Request<super::GetOrganizationRequest>,
10307                        ) -> Self::Future {
10308                            let inner = Arc::clone(&self.0);
10309                            let fut = async move {
10310                                <T as OrganizationService>::get_organization(
10311                                        &inner,
10312                                        request,
10313                                    )
10314                                    .await
10315                            };
10316                            Box::pin(fut)
10317                        }
10318                    }
10319                    let accept_compression_encodings = self.accept_compression_encodings;
10320                    let send_compression_encodings = self.send_compression_encodings;
10321                    let max_decoding_message_size = self.max_decoding_message_size;
10322                    let max_encoding_message_size = self.max_encoding_message_size;
10323                    let inner = self.inner.clone();
10324                    let fut = async move {
10325                        let method = GetOrganizationSvc(inner);
10326                        let codec = tonic_prost::ProstCodec::default();
10327                        let mut grpc = tonic::server::Grpc::new(codec)
10328                            .apply_compression_config(
10329                                accept_compression_encodings,
10330                                send_compression_encodings,
10331                            )
10332                            .apply_max_message_size_config(
10333                                max_decoding_message_size,
10334                                max_encoding_message_size,
10335                            );
10336                        let res = grpc.unary(method, req).await;
10337                        Ok(res)
10338                    };
10339                    Box::pin(fut)
10340                }
10341                "/pidgr.v1.OrganizationService/UpdateOrganization" => {
10342                    #[allow(non_camel_case_types)]
10343                    struct UpdateOrganizationSvc<T: OrganizationService>(pub Arc<T>);
10344                    impl<
10345                        T: OrganizationService,
10346                    > tonic::server::UnaryService<super::UpdateOrganizationRequest>
10347                    for UpdateOrganizationSvc<T> {
10348                        type Response = super::UpdateOrganizationResponse;
10349                        type Future = BoxFuture<
10350                            tonic::Response<Self::Response>,
10351                            tonic::Status,
10352                        >;
10353                        fn call(
10354                            &mut self,
10355                            request: tonic::Request<super::UpdateOrganizationRequest>,
10356                        ) -> Self::Future {
10357                            let inner = Arc::clone(&self.0);
10358                            let fut = async move {
10359                                <T as OrganizationService>::update_organization(
10360                                        &inner,
10361                                        request,
10362                                    )
10363                                    .await
10364                            };
10365                            Box::pin(fut)
10366                        }
10367                    }
10368                    let accept_compression_encodings = self.accept_compression_encodings;
10369                    let send_compression_encodings = self.send_compression_encodings;
10370                    let max_decoding_message_size = self.max_decoding_message_size;
10371                    let max_encoding_message_size = self.max_encoding_message_size;
10372                    let inner = self.inner.clone();
10373                    let fut = async move {
10374                        let method = UpdateOrganizationSvc(inner);
10375                        let codec = tonic_prost::ProstCodec::default();
10376                        let mut grpc = tonic::server::Grpc::new(codec)
10377                            .apply_compression_config(
10378                                accept_compression_encodings,
10379                                send_compression_encodings,
10380                            )
10381                            .apply_max_message_size_config(
10382                                max_decoding_message_size,
10383                                max_encoding_message_size,
10384                            );
10385                        let res = grpc.unary(method, req).await;
10386                        Ok(res)
10387                    };
10388                    Box::pin(fut)
10389                }
10390                "/pidgr.v1.OrganizationService/UpdateSsoAttributeMappings" => {
10391                    #[allow(non_camel_case_types)]
10392                    struct UpdateSsoAttributeMappingsSvc<T: OrganizationService>(
10393                        pub Arc<T>,
10394                    );
10395                    impl<
10396                        T: OrganizationService,
10397                    > tonic::server::UnaryService<
10398                        super::UpdateSsoAttributeMappingsRequest,
10399                    > for UpdateSsoAttributeMappingsSvc<T> {
10400                        type Response = super::UpdateSsoAttributeMappingsResponse;
10401                        type Future = BoxFuture<
10402                            tonic::Response<Self::Response>,
10403                            tonic::Status,
10404                        >;
10405                        fn call(
10406                            &mut self,
10407                            request: tonic::Request<
10408                                super::UpdateSsoAttributeMappingsRequest,
10409                            >,
10410                        ) -> Self::Future {
10411                            let inner = Arc::clone(&self.0);
10412                            let fut = async move {
10413                                <T as OrganizationService>::update_sso_attribute_mappings(
10414                                        &inner,
10415                                        request,
10416                                    )
10417                                    .await
10418                            };
10419                            Box::pin(fut)
10420                        }
10421                    }
10422                    let accept_compression_encodings = self.accept_compression_encodings;
10423                    let send_compression_encodings = self.send_compression_encodings;
10424                    let max_decoding_message_size = self.max_decoding_message_size;
10425                    let max_encoding_message_size = self.max_encoding_message_size;
10426                    let inner = self.inner.clone();
10427                    let fut = async move {
10428                        let method = UpdateSsoAttributeMappingsSvc(inner);
10429                        let codec = tonic_prost::ProstCodec::default();
10430                        let mut grpc = tonic::server::Grpc::new(codec)
10431                            .apply_compression_config(
10432                                accept_compression_encodings,
10433                                send_compression_encodings,
10434                            )
10435                            .apply_max_message_size_config(
10436                                max_decoding_message_size,
10437                                max_encoding_message_size,
10438                            );
10439                        let res = grpc.unary(method, req).await;
10440                        Ok(res)
10441                    };
10442                    Box::pin(fut)
10443                }
10444                "/pidgr.v1.OrganizationService/RotateAnalyticsSalt" => {
10445                    #[allow(non_camel_case_types)]
10446                    struct RotateAnalyticsSaltSvc<T: OrganizationService>(pub Arc<T>);
10447                    impl<
10448                        T: OrganizationService,
10449                    > tonic::server::UnaryService<super::RotateAnalyticsSaltRequest>
10450                    for RotateAnalyticsSaltSvc<T> {
10451                        type Response = super::RotateAnalyticsSaltResponse;
10452                        type Future = BoxFuture<
10453                            tonic::Response<Self::Response>,
10454                            tonic::Status,
10455                        >;
10456                        fn call(
10457                            &mut self,
10458                            request: tonic::Request<super::RotateAnalyticsSaltRequest>,
10459                        ) -> Self::Future {
10460                            let inner = Arc::clone(&self.0);
10461                            let fut = async move {
10462                                <T as OrganizationService>::rotate_analytics_salt(
10463                                        &inner,
10464                                        request,
10465                                    )
10466                                    .await
10467                            };
10468                            Box::pin(fut)
10469                        }
10470                    }
10471                    let accept_compression_encodings = self.accept_compression_encodings;
10472                    let send_compression_encodings = self.send_compression_encodings;
10473                    let max_decoding_message_size = self.max_decoding_message_size;
10474                    let max_encoding_message_size = self.max_encoding_message_size;
10475                    let inner = self.inner.clone();
10476                    let fut = async move {
10477                        let method = RotateAnalyticsSaltSvc(inner);
10478                        let codec = tonic_prost::ProstCodec::default();
10479                        let mut grpc = tonic::server::Grpc::new(codec)
10480                            .apply_compression_config(
10481                                accept_compression_encodings,
10482                                send_compression_encodings,
10483                            )
10484                            .apply_max_message_size_config(
10485                                max_decoding_message_size,
10486                                max_encoding_message_size,
10487                            );
10488                        let res = grpc.unary(method, req).await;
10489                        Ok(res)
10490                    };
10491                    Box::pin(fut)
10492                }
10493                "/pidgr.v1.OrganizationService/UpdateAnalyticsEpsilon" => {
10494                    #[allow(non_camel_case_types)]
10495                    struct UpdateAnalyticsEpsilonSvc<T: OrganizationService>(pub Arc<T>);
10496                    impl<
10497                        T: OrganizationService,
10498                    > tonic::server::UnaryService<super::UpdateAnalyticsEpsilonRequest>
10499                    for UpdateAnalyticsEpsilonSvc<T> {
10500                        type Response = super::UpdateAnalyticsEpsilonResponse;
10501                        type Future = BoxFuture<
10502                            tonic::Response<Self::Response>,
10503                            tonic::Status,
10504                        >;
10505                        fn call(
10506                            &mut self,
10507                            request: tonic::Request<super::UpdateAnalyticsEpsilonRequest>,
10508                        ) -> Self::Future {
10509                            let inner = Arc::clone(&self.0);
10510                            let fut = async move {
10511                                <T as OrganizationService>::update_analytics_epsilon(
10512                                        &inner,
10513                                        request,
10514                                    )
10515                                    .await
10516                            };
10517                            Box::pin(fut)
10518                        }
10519                    }
10520                    let accept_compression_encodings = self.accept_compression_encodings;
10521                    let send_compression_encodings = self.send_compression_encodings;
10522                    let max_decoding_message_size = self.max_decoding_message_size;
10523                    let max_encoding_message_size = self.max_encoding_message_size;
10524                    let inner = self.inner.clone();
10525                    let fut = async move {
10526                        let method = UpdateAnalyticsEpsilonSvc(inner);
10527                        let codec = tonic_prost::ProstCodec::default();
10528                        let mut grpc = tonic::server::Grpc::new(codec)
10529                            .apply_compression_config(
10530                                accept_compression_encodings,
10531                                send_compression_encodings,
10532                            )
10533                            .apply_max_message_size_config(
10534                                max_decoding_message_size,
10535                                max_encoding_message_size,
10536                            );
10537                        let res = grpc.unary(method, req).await;
10538                        Ok(res)
10539                    };
10540                    Box::pin(fut)
10541                }
10542                "/pidgr.v1.OrganizationService/CreateSandboxOrganization" => {
10543                    #[allow(non_camel_case_types)]
10544                    struct CreateSandboxOrganizationSvc<T: OrganizationService>(
10545                        pub Arc<T>,
10546                    );
10547                    impl<
10548                        T: OrganizationService,
10549                    > tonic::server::UnaryService<
10550                        super::CreateSandboxOrganizationRequest,
10551                    > for CreateSandboxOrganizationSvc<T> {
10552                        type Response = super::CreateSandboxOrganizationResponse;
10553                        type Future = BoxFuture<
10554                            tonic::Response<Self::Response>,
10555                            tonic::Status,
10556                        >;
10557                        fn call(
10558                            &mut self,
10559                            request: tonic::Request<
10560                                super::CreateSandboxOrganizationRequest,
10561                            >,
10562                        ) -> Self::Future {
10563                            let inner = Arc::clone(&self.0);
10564                            let fut = async move {
10565                                <T as OrganizationService>::create_sandbox_organization(
10566                                        &inner,
10567                                        request,
10568                                    )
10569                                    .await
10570                            };
10571                            Box::pin(fut)
10572                        }
10573                    }
10574                    let accept_compression_encodings = self.accept_compression_encodings;
10575                    let send_compression_encodings = self.send_compression_encodings;
10576                    let max_decoding_message_size = self.max_decoding_message_size;
10577                    let max_encoding_message_size = self.max_encoding_message_size;
10578                    let inner = self.inner.clone();
10579                    let fut = async move {
10580                        let method = CreateSandboxOrganizationSvc(inner);
10581                        let codec = tonic_prost::ProstCodec::default();
10582                        let mut grpc = tonic::server::Grpc::new(codec)
10583                            .apply_compression_config(
10584                                accept_compression_encodings,
10585                                send_compression_encodings,
10586                            )
10587                            .apply_max_message_size_config(
10588                                max_decoding_message_size,
10589                                max_encoding_message_size,
10590                            );
10591                        let res = grpc.unary(method, req).await;
10592                        Ok(res)
10593                    };
10594                    Box::pin(fut)
10595                }
10596                "/pidgr.v1.OrganizationService/DeleteSandboxOrganization" => {
10597                    #[allow(non_camel_case_types)]
10598                    struct DeleteSandboxOrganizationSvc<T: OrganizationService>(
10599                        pub Arc<T>,
10600                    );
10601                    impl<
10602                        T: OrganizationService,
10603                    > tonic::server::UnaryService<
10604                        super::DeleteSandboxOrganizationRequest,
10605                    > for DeleteSandboxOrganizationSvc<T> {
10606                        type Response = super::DeleteSandboxOrganizationResponse;
10607                        type Future = BoxFuture<
10608                            tonic::Response<Self::Response>,
10609                            tonic::Status,
10610                        >;
10611                        fn call(
10612                            &mut self,
10613                            request: tonic::Request<
10614                                super::DeleteSandboxOrganizationRequest,
10615                            >,
10616                        ) -> Self::Future {
10617                            let inner = Arc::clone(&self.0);
10618                            let fut = async move {
10619                                <T as OrganizationService>::delete_sandbox_organization(
10620                                        &inner,
10621                                        request,
10622                                    )
10623                                    .await
10624                            };
10625                            Box::pin(fut)
10626                        }
10627                    }
10628                    let accept_compression_encodings = self.accept_compression_encodings;
10629                    let send_compression_encodings = self.send_compression_encodings;
10630                    let max_decoding_message_size = self.max_decoding_message_size;
10631                    let max_encoding_message_size = self.max_encoding_message_size;
10632                    let inner = self.inner.clone();
10633                    let fut = async move {
10634                        let method = DeleteSandboxOrganizationSvc(inner);
10635                        let codec = tonic_prost::ProstCodec::default();
10636                        let mut grpc = tonic::server::Grpc::new(codec)
10637                            .apply_compression_config(
10638                                accept_compression_encodings,
10639                                send_compression_encodings,
10640                            )
10641                            .apply_max_message_size_config(
10642                                max_decoding_message_size,
10643                                max_encoding_message_size,
10644                            );
10645                        let res = grpc.unary(method, req).await;
10646                        Ok(res)
10647                    };
10648                    Box::pin(fut)
10649                }
10650                "/pidgr.v1.OrganizationService/ListSandboxFixtures" => {
10651                    #[allow(non_camel_case_types)]
10652                    struct ListSandboxFixturesSvc<T: OrganizationService>(pub Arc<T>);
10653                    impl<
10654                        T: OrganizationService,
10655                    > tonic::server::UnaryService<super::ListSandboxFixturesRequest>
10656                    for ListSandboxFixturesSvc<T> {
10657                        type Response = super::ListSandboxFixturesResponse;
10658                        type Future = BoxFuture<
10659                            tonic::Response<Self::Response>,
10660                            tonic::Status,
10661                        >;
10662                        fn call(
10663                            &mut self,
10664                            request: tonic::Request<super::ListSandboxFixturesRequest>,
10665                        ) -> Self::Future {
10666                            let inner = Arc::clone(&self.0);
10667                            let fut = async move {
10668                                <T as OrganizationService>::list_sandbox_fixtures(
10669                                        &inner,
10670                                        request,
10671                                    )
10672                                    .await
10673                            };
10674                            Box::pin(fut)
10675                        }
10676                    }
10677                    let accept_compression_encodings = self.accept_compression_encodings;
10678                    let send_compression_encodings = self.send_compression_encodings;
10679                    let max_decoding_message_size = self.max_decoding_message_size;
10680                    let max_encoding_message_size = self.max_encoding_message_size;
10681                    let inner = self.inner.clone();
10682                    let fut = async move {
10683                        let method = ListSandboxFixturesSvc(inner);
10684                        let codec = tonic_prost::ProstCodec::default();
10685                        let mut grpc = tonic::server::Grpc::new(codec)
10686                            .apply_compression_config(
10687                                accept_compression_encodings,
10688                                send_compression_encodings,
10689                            )
10690                            .apply_max_message_size_config(
10691                                max_decoding_message_size,
10692                                max_encoding_message_size,
10693                            );
10694                        let res = grpc.unary(method, req).await;
10695                        Ok(res)
10696                    };
10697                    Box::pin(fut)
10698                }
10699                "/pidgr.v1.OrganizationService/ListUserOrganizations" => {
10700                    #[allow(non_camel_case_types)]
10701                    struct ListUserOrganizationsSvc<T: OrganizationService>(pub Arc<T>);
10702                    impl<
10703                        T: OrganizationService,
10704                    > tonic::server::UnaryService<super::ListUserOrganizationsRequest>
10705                    for ListUserOrganizationsSvc<T> {
10706                        type Response = super::ListUserOrganizationsResponse;
10707                        type Future = BoxFuture<
10708                            tonic::Response<Self::Response>,
10709                            tonic::Status,
10710                        >;
10711                        fn call(
10712                            &mut self,
10713                            request: tonic::Request<super::ListUserOrganizationsRequest>,
10714                        ) -> Self::Future {
10715                            let inner = Arc::clone(&self.0);
10716                            let fut = async move {
10717                                <T as OrganizationService>::list_user_organizations(
10718                                        &inner,
10719                                        request,
10720                                    )
10721                                    .await
10722                            };
10723                            Box::pin(fut)
10724                        }
10725                    }
10726                    let accept_compression_encodings = self.accept_compression_encodings;
10727                    let send_compression_encodings = self.send_compression_encodings;
10728                    let max_decoding_message_size = self.max_decoding_message_size;
10729                    let max_encoding_message_size = self.max_encoding_message_size;
10730                    let inner = self.inner.clone();
10731                    let fut = async move {
10732                        let method = ListUserOrganizationsSvc(inner);
10733                        let codec = tonic_prost::ProstCodec::default();
10734                        let mut grpc = tonic::server::Grpc::new(codec)
10735                            .apply_compression_config(
10736                                accept_compression_encodings,
10737                                send_compression_encodings,
10738                            )
10739                            .apply_max_message_size_config(
10740                                max_decoding_message_size,
10741                                max_encoding_message_size,
10742                            );
10743                        let res = grpc.unary(method, req).await;
10744                        Ok(res)
10745                    };
10746                    Box::pin(fut)
10747                }
10748                "/pidgr.v1.OrganizationService/ListUserSandboxes" => {
10749                    #[allow(non_camel_case_types)]
10750                    struct ListUserSandboxesSvc<T: OrganizationService>(pub Arc<T>);
10751                    impl<
10752                        T: OrganizationService,
10753                    > tonic::server::UnaryService<super::ListUserSandboxesRequest>
10754                    for ListUserSandboxesSvc<T> {
10755                        type Response = super::ListUserSandboxesResponse;
10756                        type Future = BoxFuture<
10757                            tonic::Response<Self::Response>,
10758                            tonic::Status,
10759                        >;
10760                        fn call(
10761                            &mut self,
10762                            request: tonic::Request<super::ListUserSandboxesRequest>,
10763                        ) -> Self::Future {
10764                            let inner = Arc::clone(&self.0);
10765                            let fut = async move {
10766                                <T as OrganizationService>::list_user_sandboxes(
10767                                        &inner,
10768                                        request,
10769                                    )
10770                                    .await
10771                            };
10772                            Box::pin(fut)
10773                        }
10774                    }
10775                    let accept_compression_encodings = self.accept_compression_encodings;
10776                    let send_compression_encodings = self.send_compression_encodings;
10777                    let max_decoding_message_size = self.max_decoding_message_size;
10778                    let max_encoding_message_size = self.max_encoding_message_size;
10779                    let inner = self.inner.clone();
10780                    let fut = async move {
10781                        let method = ListUserSandboxesSvc(inner);
10782                        let codec = tonic_prost::ProstCodec::default();
10783                        let mut grpc = tonic::server::Grpc::new(codec)
10784                            .apply_compression_config(
10785                                accept_compression_encodings,
10786                                send_compression_encodings,
10787                            )
10788                            .apply_max_message_size_config(
10789                                max_decoding_message_size,
10790                                max_encoding_message_size,
10791                            );
10792                        let res = grpc.unary(method, req).await;
10793                        Ok(res)
10794                    };
10795                    Box::pin(fut)
10796                }
10797                _ => {
10798                    Box::pin(async move {
10799                        let mut response = http::Response::new(
10800                            tonic::body::Body::default(),
10801                        );
10802                        let headers = response.headers_mut();
10803                        headers
10804                            .insert(
10805                                tonic::Status::GRPC_STATUS,
10806                                (tonic::Code::Unimplemented as i32).into(),
10807                            );
10808                        headers
10809                            .insert(
10810                                http::header::CONTENT_TYPE,
10811                                tonic::metadata::GRPC_CONTENT_TYPE,
10812                            );
10813                        Ok(response)
10814                    })
10815                }
10816            }
10817        }
10818    }
10819    impl<T> Clone for OrganizationServiceServer<T> {
10820        fn clone(&self) -> Self {
10821            let inner = self.inner.clone();
10822            Self {
10823                inner,
10824                accept_compression_encodings: self.accept_compression_encodings,
10825                send_compression_encodings: self.send_compression_encodings,
10826                max_decoding_message_size: self.max_decoding_message_size,
10827                max_encoding_message_size: self.max_encoding_message_size,
10828            }
10829        }
10830    }
10831    /// Generated gRPC service name
10832    pub const SERVICE_NAME: &str = "pidgr.v1.OrganizationService";
10833    impl<T> tonic::server::NamedService for OrganizationServiceServer<T> {
10834        const NAME: &'static str = SERVICE_NAME;
10835    }
10836}
10837/// Generated client implementations.
10838pub mod render_service_client {
10839    #![allow(
10840        unused_variables,
10841        dead_code,
10842        missing_docs,
10843        clippy::wildcard_imports,
10844        clippy::let_unit_value,
10845    )]
10846    use tonic::codegen::*;
10847    use tonic::codegen::http::Uri;
10848    /** Internal service for batch template rendering.
10849*/
10850    #[derive(Debug, Clone)]
10851    pub struct RenderServiceClient<T> {
10852        inner: tonic::client::Grpc<T>,
10853    }
10854    impl RenderServiceClient<tonic::transport::Channel> {
10855        /// Attempt to create a new client by connecting to a given endpoint.
10856        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
10857        where
10858            D: TryInto<tonic::transport::Endpoint>,
10859            D::Error: Into<StdError>,
10860        {
10861            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
10862            Ok(Self::new(conn))
10863        }
10864    }
10865    impl<T> RenderServiceClient<T>
10866    where
10867        T: tonic::client::GrpcService<tonic::body::Body>,
10868        T::Error: Into<StdError>,
10869        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
10870        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
10871    {
10872        pub fn new(inner: T) -> Self {
10873            let inner = tonic::client::Grpc::new(inner);
10874            Self { inner }
10875        }
10876        pub fn with_origin(inner: T, origin: Uri) -> Self {
10877            let inner = tonic::client::Grpc::with_origin(inner, origin);
10878            Self { inner }
10879        }
10880        pub fn with_interceptor<F>(
10881            inner: T,
10882            interceptor: F,
10883        ) -> RenderServiceClient<InterceptedService<T, F>>
10884        where
10885            F: tonic::service::Interceptor,
10886            T::ResponseBody: Default,
10887            T: tonic::codegen::Service<
10888                http::Request<tonic::body::Body>,
10889                Response = http::Response<
10890                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
10891                >,
10892            >,
10893            <T as tonic::codegen::Service<
10894                http::Request<tonic::body::Body>,
10895            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
10896        {
10897            RenderServiceClient::new(InterceptedService::new(inner, interceptor))
10898        }
10899        /// Compress requests with the given encoding.
10900        ///
10901        /// This requires the server to support it otherwise it might respond with an
10902        /// error.
10903        #[must_use]
10904        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10905            self.inner = self.inner.send_compressed(encoding);
10906            self
10907        }
10908        /// Enable decompressing responses.
10909        #[must_use]
10910        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10911            self.inner = self.inner.accept_compressed(encoding);
10912            self
10913        }
10914        /// Limits the maximum size of a decoded message.
10915        ///
10916        /// Default: `4MB`
10917        #[must_use]
10918        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10919            self.inner = self.inner.max_decoding_message_size(limit);
10920            self
10921        }
10922        /// Limits the maximum size of an encoded message.
10923        ///
10924        /// Default: `usize::MAX`
10925        #[must_use]
10926        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10927            self.inner = self.inner.max_encoding_message_size(limit);
10928            self
10929        }
10930        /** Render a template for multiple users, streaming results as each completes.
10931 Authorization: Internal server-to-server only. Not exposed to external clients.
10932*/
10933        pub async fn render_batch(
10934            &mut self,
10935            request: impl tonic::IntoRequest<super::RenderBatchRequest>,
10936        ) -> std::result::Result<
10937            tonic::Response<tonic::codec::Streaming<super::RenderBatchResponse>>,
10938            tonic::Status,
10939        > {
10940            self.inner
10941                .ready()
10942                .await
10943                .map_err(|e| {
10944                    tonic::Status::unknown(
10945                        format!("Service was not ready: {}", e.into()),
10946                    )
10947                })?;
10948            let codec = tonic_prost::ProstCodec::default();
10949            let path = http::uri::PathAndQuery::from_static(
10950                "/pidgr.v1.RenderService/RenderBatch",
10951            );
10952            let mut req = request.into_request();
10953            req.extensions_mut()
10954                .insert(GrpcMethod::new("pidgr.v1.RenderService", "RenderBatch"));
10955            self.inner.server_streaming(req, path, codec).await
10956        }
10957    }
10958}
10959/// Generated server implementations.
10960pub mod render_service_server {
10961    #![allow(
10962        unused_variables,
10963        dead_code,
10964        missing_docs,
10965        clippy::wildcard_imports,
10966        clippy::let_unit_value,
10967    )]
10968    use tonic::codegen::*;
10969    /// Generated trait containing gRPC methods that should be implemented for use with RenderServiceServer.
10970    #[async_trait]
10971    pub trait RenderService: std::marker::Send + std::marker::Sync + 'static {
10972        /// Server streaming response type for the RenderBatch method.
10973        type RenderBatchStream: tonic::codegen::tokio_stream::Stream<
10974                Item = std::result::Result<super::RenderBatchResponse, tonic::Status>,
10975            >
10976            + std::marker::Send
10977            + 'static;
10978        /** Render a template for multiple users, streaming results as each completes.
10979 Authorization: Internal server-to-server only. Not exposed to external clients.
10980*/
10981        async fn render_batch(
10982            &self,
10983            request: tonic::Request<super::RenderBatchRequest>,
10984        ) -> std::result::Result<
10985            tonic::Response<Self::RenderBatchStream>,
10986            tonic::Status,
10987        >;
10988    }
10989    /** Internal service for batch template rendering.
10990*/
10991    #[derive(Debug)]
10992    pub struct RenderServiceServer<T> {
10993        inner: Arc<T>,
10994        accept_compression_encodings: EnabledCompressionEncodings,
10995        send_compression_encodings: EnabledCompressionEncodings,
10996        max_decoding_message_size: Option<usize>,
10997        max_encoding_message_size: Option<usize>,
10998    }
10999    impl<T> RenderServiceServer<T> {
11000        pub fn new(inner: T) -> Self {
11001            Self::from_arc(Arc::new(inner))
11002        }
11003        pub fn from_arc(inner: Arc<T>) -> Self {
11004            Self {
11005                inner,
11006                accept_compression_encodings: Default::default(),
11007                send_compression_encodings: Default::default(),
11008                max_decoding_message_size: None,
11009                max_encoding_message_size: None,
11010            }
11011        }
11012        pub fn with_interceptor<F>(
11013            inner: T,
11014            interceptor: F,
11015        ) -> InterceptedService<Self, F>
11016        where
11017            F: tonic::service::Interceptor,
11018        {
11019            InterceptedService::new(Self::new(inner), interceptor)
11020        }
11021        /// Enable decompressing requests with the given encoding.
11022        #[must_use]
11023        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11024            self.accept_compression_encodings.enable(encoding);
11025            self
11026        }
11027        /// Compress responses with the given encoding, if the client supports it.
11028        #[must_use]
11029        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11030            self.send_compression_encodings.enable(encoding);
11031            self
11032        }
11033        /// Limits the maximum size of a decoded message.
11034        ///
11035        /// Default: `4MB`
11036        #[must_use]
11037        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11038            self.max_decoding_message_size = Some(limit);
11039            self
11040        }
11041        /// Limits the maximum size of an encoded message.
11042        ///
11043        /// Default: `usize::MAX`
11044        #[must_use]
11045        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11046            self.max_encoding_message_size = Some(limit);
11047            self
11048        }
11049    }
11050    impl<T, B> tonic::codegen::Service<http::Request<B>> for RenderServiceServer<T>
11051    where
11052        T: RenderService,
11053        B: Body + std::marker::Send + 'static,
11054        B::Error: Into<StdError> + std::marker::Send + 'static,
11055    {
11056        type Response = http::Response<tonic::body::Body>;
11057        type Error = std::convert::Infallible;
11058        type Future = BoxFuture<Self::Response, Self::Error>;
11059        fn poll_ready(
11060            &mut self,
11061            _cx: &mut Context<'_>,
11062        ) -> Poll<std::result::Result<(), Self::Error>> {
11063            Poll::Ready(Ok(()))
11064        }
11065        fn call(&mut self, req: http::Request<B>) -> Self::Future {
11066            match req.uri().path() {
11067                "/pidgr.v1.RenderService/RenderBatch" => {
11068                    #[allow(non_camel_case_types)]
11069                    struct RenderBatchSvc<T: RenderService>(pub Arc<T>);
11070                    impl<
11071                        T: RenderService,
11072                    > tonic::server::ServerStreamingService<super::RenderBatchRequest>
11073                    for RenderBatchSvc<T> {
11074                        type Response = super::RenderBatchResponse;
11075                        type ResponseStream = T::RenderBatchStream;
11076                        type Future = BoxFuture<
11077                            tonic::Response<Self::ResponseStream>,
11078                            tonic::Status,
11079                        >;
11080                        fn call(
11081                            &mut self,
11082                            request: tonic::Request<super::RenderBatchRequest>,
11083                        ) -> Self::Future {
11084                            let inner = Arc::clone(&self.0);
11085                            let fut = async move {
11086                                <T as RenderService>::render_batch(&inner, request).await
11087                            };
11088                            Box::pin(fut)
11089                        }
11090                    }
11091                    let accept_compression_encodings = self.accept_compression_encodings;
11092                    let send_compression_encodings = self.send_compression_encodings;
11093                    let max_decoding_message_size = self.max_decoding_message_size;
11094                    let max_encoding_message_size = self.max_encoding_message_size;
11095                    let inner = self.inner.clone();
11096                    let fut = async move {
11097                        let method = RenderBatchSvc(inner);
11098                        let codec = tonic_prost::ProstCodec::default();
11099                        let mut grpc = tonic::server::Grpc::new(codec)
11100                            .apply_compression_config(
11101                                accept_compression_encodings,
11102                                send_compression_encodings,
11103                            )
11104                            .apply_max_message_size_config(
11105                                max_decoding_message_size,
11106                                max_encoding_message_size,
11107                            );
11108                        let res = grpc.server_streaming(method, req).await;
11109                        Ok(res)
11110                    };
11111                    Box::pin(fut)
11112                }
11113                _ => {
11114                    Box::pin(async move {
11115                        let mut response = http::Response::new(
11116                            tonic::body::Body::default(),
11117                        );
11118                        let headers = response.headers_mut();
11119                        headers
11120                            .insert(
11121                                tonic::Status::GRPC_STATUS,
11122                                (tonic::Code::Unimplemented as i32).into(),
11123                            );
11124                        headers
11125                            .insert(
11126                                http::header::CONTENT_TYPE,
11127                                tonic::metadata::GRPC_CONTENT_TYPE,
11128                            );
11129                        Ok(response)
11130                    })
11131                }
11132            }
11133        }
11134    }
11135    impl<T> Clone for RenderServiceServer<T> {
11136        fn clone(&self) -> Self {
11137            let inner = self.inner.clone();
11138            Self {
11139                inner,
11140                accept_compression_encodings: self.accept_compression_encodings,
11141                send_compression_encodings: self.send_compression_encodings,
11142                max_decoding_message_size: self.max_decoding_message_size,
11143                max_encoding_message_size: self.max_encoding_message_size,
11144            }
11145        }
11146    }
11147    /// Generated gRPC service name
11148    pub const SERVICE_NAME: &str = "pidgr.v1.RenderService";
11149    impl<T> tonic::server::NamedService for RenderServiceServer<T> {
11150        const NAME: &'static str = SERVICE_NAME;
11151    }
11152}
11153/// Generated client implementations.
11154pub mod replay_service_client {
11155    #![allow(
11156        unused_variables,
11157        dead_code,
11158        missing_docs,
11159        clippy::wildcard_imports,
11160        clippy::let_unit_value,
11161    )]
11162    use tonic::codegen::*;
11163    use tonic::codegen::http::Uri;
11164    /** Proxies the analytics provider's session recording API, keeping credentials server-side.
11165 All data is fetched from the analytics provider on demand; no recording data is stored in pidgr.
11166*/
11167    #[derive(Debug, Clone)]
11168    pub struct ReplayServiceClient<T> {
11169        inner: tonic::client::Grpc<T>,
11170    }
11171    impl ReplayServiceClient<tonic::transport::Channel> {
11172        /// Attempt to create a new client by connecting to a given endpoint.
11173        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
11174        where
11175            D: TryInto<tonic::transport::Endpoint>,
11176            D::Error: Into<StdError>,
11177        {
11178            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
11179            Ok(Self::new(conn))
11180        }
11181    }
11182    impl<T> ReplayServiceClient<T>
11183    where
11184        T: tonic::client::GrpcService<tonic::body::Body>,
11185        T::Error: Into<StdError>,
11186        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
11187        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
11188    {
11189        pub fn new(inner: T) -> Self {
11190            let inner = tonic::client::Grpc::new(inner);
11191            Self { inner }
11192        }
11193        pub fn with_origin(inner: T, origin: Uri) -> Self {
11194            let inner = tonic::client::Grpc::with_origin(inner, origin);
11195            Self { inner }
11196        }
11197        pub fn with_interceptor<F>(
11198            inner: T,
11199            interceptor: F,
11200        ) -> ReplayServiceClient<InterceptedService<T, F>>
11201        where
11202            F: tonic::service::Interceptor,
11203            T::ResponseBody: Default,
11204            T: tonic::codegen::Service<
11205                http::Request<tonic::body::Body>,
11206                Response = http::Response<
11207                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
11208                >,
11209            >,
11210            <T as tonic::codegen::Service<
11211                http::Request<tonic::body::Body>,
11212            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
11213        {
11214            ReplayServiceClient::new(InterceptedService::new(inner, interceptor))
11215        }
11216        /// Compress requests with the given encoding.
11217        ///
11218        /// This requires the server to support it otherwise it might respond with an
11219        /// error.
11220        #[must_use]
11221        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11222            self.inner = self.inner.send_compressed(encoding);
11223            self
11224        }
11225        /// Enable decompressing responses.
11226        #[must_use]
11227        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11228            self.inner = self.inner.accept_compressed(encoding);
11229            self
11230        }
11231        /// Limits the maximum size of a decoded message.
11232        ///
11233        /// Default: `4MB`
11234        #[must_use]
11235        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11236            self.inner = self.inner.max_decoding_message_size(limit);
11237            self
11238        }
11239        /// Limits the maximum size of an encoded message.
11240        ///
11241        /// Default: `usize::MAX`
11242        #[must_use]
11243        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11244            self.inner = self.inner.max_encoding_message_size(limit);
11245            self
11246        }
11247        /** List recent session recordings with optional campaign and time range filters.
11248 Authorization: Requires CAMPAIGNS_READ permission.
11249*/
11250        pub async fn list_session_recordings(
11251            &mut self,
11252            request: impl tonic::IntoRequest<super::ListSessionRecordingsRequest>,
11253        ) -> std::result::Result<
11254            tonic::Response<super::ListSessionRecordingsResponse>,
11255            tonic::Status,
11256        > {
11257            self.inner
11258                .ready()
11259                .await
11260                .map_err(|e| {
11261                    tonic::Status::unknown(
11262                        format!("Service was not ready: {}", e.into()),
11263                    )
11264                })?;
11265            let codec = tonic_prost::ProstCodec::default();
11266            let path = http::uri::PathAndQuery::from_static(
11267                "/pidgr.v1.ReplayService/ListSessionRecordings",
11268            );
11269            let mut req = request.into_request();
11270            req.extensions_mut()
11271                .insert(
11272                    GrpcMethod::new("pidgr.v1.ReplayService", "ListSessionRecordings"),
11273                );
11274            self.inner.unary(req, path, codec).await
11275        }
11276        /** Fetch the full rrweb snapshot data for a single recording.
11277 Authorization: Requires CAMPAIGNS_READ permission.
11278*/
11279        pub async fn get_session_snapshots(
11280            &mut self,
11281            request: impl tonic::IntoRequest<super::GetSessionSnapshotsRequest>,
11282        ) -> std::result::Result<
11283            tonic::Response<super::GetSessionSnapshotsResponse>,
11284            tonic::Status,
11285        > {
11286            self.inner
11287                .ready()
11288                .await
11289                .map_err(|e| {
11290                    tonic::Status::unknown(
11291                        format!("Service was not ready: {}", e.into()),
11292                    )
11293                })?;
11294            let codec = tonic_prost::ProstCodec::default();
11295            let path = http::uri::PathAndQuery::from_static(
11296                "/pidgr.v1.ReplayService/GetSessionSnapshots",
11297            );
11298            let mut req = request.into_request();
11299            req.extensions_mut()
11300                .insert(
11301                    GrpcMethod::new("pidgr.v1.ReplayService", "GetSessionSnapshots"),
11302                );
11303            self.inner.unary(req, path, codec).await
11304        }
11305    }
11306}
11307/// Generated server implementations.
11308pub mod replay_service_server {
11309    #![allow(
11310        unused_variables,
11311        dead_code,
11312        missing_docs,
11313        clippy::wildcard_imports,
11314        clippy::let_unit_value,
11315    )]
11316    use tonic::codegen::*;
11317    /// Generated trait containing gRPC methods that should be implemented for use with ReplayServiceServer.
11318    #[async_trait]
11319    pub trait ReplayService: std::marker::Send + std::marker::Sync + 'static {
11320        /** List recent session recordings with optional campaign and time range filters.
11321 Authorization: Requires CAMPAIGNS_READ permission.
11322*/
11323        async fn list_session_recordings(
11324            &self,
11325            request: tonic::Request<super::ListSessionRecordingsRequest>,
11326        ) -> std::result::Result<
11327            tonic::Response<super::ListSessionRecordingsResponse>,
11328            tonic::Status,
11329        >;
11330        /** Fetch the full rrweb snapshot data for a single recording.
11331 Authorization: Requires CAMPAIGNS_READ permission.
11332*/
11333        async fn get_session_snapshots(
11334            &self,
11335            request: tonic::Request<super::GetSessionSnapshotsRequest>,
11336        ) -> std::result::Result<
11337            tonic::Response<super::GetSessionSnapshotsResponse>,
11338            tonic::Status,
11339        >;
11340    }
11341    /** Proxies the analytics provider's session recording API, keeping credentials server-side.
11342 All data is fetched from the analytics provider on demand; no recording data is stored in pidgr.
11343*/
11344    #[derive(Debug)]
11345    pub struct ReplayServiceServer<T> {
11346        inner: Arc<T>,
11347        accept_compression_encodings: EnabledCompressionEncodings,
11348        send_compression_encodings: EnabledCompressionEncodings,
11349        max_decoding_message_size: Option<usize>,
11350        max_encoding_message_size: Option<usize>,
11351    }
11352    impl<T> ReplayServiceServer<T> {
11353        pub fn new(inner: T) -> Self {
11354            Self::from_arc(Arc::new(inner))
11355        }
11356        pub fn from_arc(inner: Arc<T>) -> Self {
11357            Self {
11358                inner,
11359                accept_compression_encodings: Default::default(),
11360                send_compression_encodings: Default::default(),
11361                max_decoding_message_size: None,
11362                max_encoding_message_size: None,
11363            }
11364        }
11365        pub fn with_interceptor<F>(
11366            inner: T,
11367            interceptor: F,
11368        ) -> InterceptedService<Self, F>
11369        where
11370            F: tonic::service::Interceptor,
11371        {
11372            InterceptedService::new(Self::new(inner), interceptor)
11373        }
11374        /// Enable decompressing requests with the given encoding.
11375        #[must_use]
11376        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11377            self.accept_compression_encodings.enable(encoding);
11378            self
11379        }
11380        /// Compress responses with the given encoding, if the client supports it.
11381        #[must_use]
11382        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11383            self.send_compression_encodings.enable(encoding);
11384            self
11385        }
11386        /// Limits the maximum size of a decoded message.
11387        ///
11388        /// Default: `4MB`
11389        #[must_use]
11390        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11391            self.max_decoding_message_size = Some(limit);
11392            self
11393        }
11394        /// Limits the maximum size of an encoded message.
11395        ///
11396        /// Default: `usize::MAX`
11397        #[must_use]
11398        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11399            self.max_encoding_message_size = Some(limit);
11400            self
11401        }
11402    }
11403    impl<T, B> tonic::codegen::Service<http::Request<B>> for ReplayServiceServer<T>
11404    where
11405        T: ReplayService,
11406        B: Body + std::marker::Send + 'static,
11407        B::Error: Into<StdError> + std::marker::Send + 'static,
11408    {
11409        type Response = http::Response<tonic::body::Body>;
11410        type Error = std::convert::Infallible;
11411        type Future = BoxFuture<Self::Response, Self::Error>;
11412        fn poll_ready(
11413            &mut self,
11414            _cx: &mut Context<'_>,
11415        ) -> Poll<std::result::Result<(), Self::Error>> {
11416            Poll::Ready(Ok(()))
11417        }
11418        fn call(&mut self, req: http::Request<B>) -> Self::Future {
11419            match req.uri().path() {
11420                "/pidgr.v1.ReplayService/ListSessionRecordings" => {
11421                    #[allow(non_camel_case_types)]
11422                    struct ListSessionRecordingsSvc<T: ReplayService>(pub Arc<T>);
11423                    impl<
11424                        T: ReplayService,
11425                    > tonic::server::UnaryService<super::ListSessionRecordingsRequest>
11426                    for ListSessionRecordingsSvc<T> {
11427                        type Response = super::ListSessionRecordingsResponse;
11428                        type Future = BoxFuture<
11429                            tonic::Response<Self::Response>,
11430                            tonic::Status,
11431                        >;
11432                        fn call(
11433                            &mut self,
11434                            request: tonic::Request<super::ListSessionRecordingsRequest>,
11435                        ) -> Self::Future {
11436                            let inner = Arc::clone(&self.0);
11437                            let fut = async move {
11438                                <T as ReplayService>::list_session_recordings(
11439                                        &inner,
11440                                        request,
11441                                    )
11442                                    .await
11443                            };
11444                            Box::pin(fut)
11445                        }
11446                    }
11447                    let accept_compression_encodings = self.accept_compression_encodings;
11448                    let send_compression_encodings = self.send_compression_encodings;
11449                    let max_decoding_message_size = self.max_decoding_message_size;
11450                    let max_encoding_message_size = self.max_encoding_message_size;
11451                    let inner = self.inner.clone();
11452                    let fut = async move {
11453                        let method = ListSessionRecordingsSvc(inner);
11454                        let codec = tonic_prost::ProstCodec::default();
11455                        let mut grpc = tonic::server::Grpc::new(codec)
11456                            .apply_compression_config(
11457                                accept_compression_encodings,
11458                                send_compression_encodings,
11459                            )
11460                            .apply_max_message_size_config(
11461                                max_decoding_message_size,
11462                                max_encoding_message_size,
11463                            );
11464                        let res = grpc.unary(method, req).await;
11465                        Ok(res)
11466                    };
11467                    Box::pin(fut)
11468                }
11469                "/pidgr.v1.ReplayService/GetSessionSnapshots" => {
11470                    #[allow(non_camel_case_types)]
11471                    struct GetSessionSnapshotsSvc<T: ReplayService>(pub Arc<T>);
11472                    impl<
11473                        T: ReplayService,
11474                    > tonic::server::UnaryService<super::GetSessionSnapshotsRequest>
11475                    for GetSessionSnapshotsSvc<T> {
11476                        type Response = super::GetSessionSnapshotsResponse;
11477                        type Future = BoxFuture<
11478                            tonic::Response<Self::Response>,
11479                            tonic::Status,
11480                        >;
11481                        fn call(
11482                            &mut self,
11483                            request: tonic::Request<super::GetSessionSnapshotsRequest>,
11484                        ) -> Self::Future {
11485                            let inner = Arc::clone(&self.0);
11486                            let fut = async move {
11487                                <T as ReplayService>::get_session_snapshots(&inner, request)
11488                                    .await
11489                            };
11490                            Box::pin(fut)
11491                        }
11492                    }
11493                    let accept_compression_encodings = self.accept_compression_encodings;
11494                    let send_compression_encodings = self.send_compression_encodings;
11495                    let max_decoding_message_size = self.max_decoding_message_size;
11496                    let max_encoding_message_size = self.max_encoding_message_size;
11497                    let inner = self.inner.clone();
11498                    let fut = async move {
11499                        let method = GetSessionSnapshotsSvc(inner);
11500                        let codec = tonic_prost::ProstCodec::default();
11501                        let mut grpc = tonic::server::Grpc::new(codec)
11502                            .apply_compression_config(
11503                                accept_compression_encodings,
11504                                send_compression_encodings,
11505                            )
11506                            .apply_max_message_size_config(
11507                                max_decoding_message_size,
11508                                max_encoding_message_size,
11509                            );
11510                        let res = grpc.unary(method, req).await;
11511                        Ok(res)
11512                    };
11513                    Box::pin(fut)
11514                }
11515                _ => {
11516                    Box::pin(async move {
11517                        let mut response = http::Response::new(
11518                            tonic::body::Body::default(),
11519                        );
11520                        let headers = response.headers_mut();
11521                        headers
11522                            .insert(
11523                                tonic::Status::GRPC_STATUS,
11524                                (tonic::Code::Unimplemented as i32).into(),
11525                            );
11526                        headers
11527                            .insert(
11528                                http::header::CONTENT_TYPE,
11529                                tonic::metadata::GRPC_CONTENT_TYPE,
11530                            );
11531                        Ok(response)
11532                    })
11533                }
11534            }
11535        }
11536    }
11537    impl<T> Clone for ReplayServiceServer<T> {
11538        fn clone(&self) -> Self {
11539            let inner = self.inner.clone();
11540            Self {
11541                inner,
11542                accept_compression_encodings: self.accept_compression_encodings,
11543                send_compression_encodings: self.send_compression_encodings,
11544                max_decoding_message_size: self.max_decoding_message_size,
11545                max_encoding_message_size: self.max_encoding_message_size,
11546            }
11547        }
11548    }
11549    /// Generated gRPC service name
11550    pub const SERVICE_NAME: &str = "pidgr.v1.ReplayService";
11551    impl<T> tonic::server::NamedService for ReplayServiceServer<T> {
11552        const NAME: &'static str = SERVICE_NAME;
11553    }
11554}
11555/// Generated client implementations.
11556pub mod role_service_client {
11557    #![allow(
11558        unused_variables,
11559        dead_code,
11560        missing_docs,
11561        clippy::wildcard_imports,
11562        clippy::let_unit_value,
11563    )]
11564    use tonic::codegen::*;
11565    use tonic::codegen::http::Uri;
11566    /** Manages roles and their permissions within an organization.
11567 All RPCs operate within the caller's org (extracted from JWT).
11568*/
11569    #[derive(Debug, Clone)]
11570    pub struct RoleServiceClient<T> {
11571        inner: tonic::client::Grpc<T>,
11572    }
11573    impl RoleServiceClient<tonic::transport::Channel> {
11574        /// Attempt to create a new client by connecting to a given endpoint.
11575        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
11576        where
11577            D: TryInto<tonic::transport::Endpoint>,
11578            D::Error: Into<StdError>,
11579        {
11580            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
11581            Ok(Self::new(conn))
11582        }
11583    }
11584    impl<T> RoleServiceClient<T>
11585    where
11586        T: tonic::client::GrpcService<tonic::body::Body>,
11587        T::Error: Into<StdError>,
11588        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
11589        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
11590    {
11591        pub fn new(inner: T) -> Self {
11592            let inner = tonic::client::Grpc::new(inner);
11593            Self { inner }
11594        }
11595        pub fn with_origin(inner: T, origin: Uri) -> Self {
11596            let inner = tonic::client::Grpc::with_origin(inner, origin);
11597            Self { inner }
11598        }
11599        pub fn with_interceptor<F>(
11600            inner: T,
11601            interceptor: F,
11602        ) -> RoleServiceClient<InterceptedService<T, F>>
11603        where
11604            F: tonic::service::Interceptor,
11605            T::ResponseBody: Default,
11606            T: tonic::codegen::Service<
11607                http::Request<tonic::body::Body>,
11608                Response = http::Response<
11609                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
11610                >,
11611            >,
11612            <T as tonic::codegen::Service<
11613                http::Request<tonic::body::Body>,
11614            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
11615        {
11616            RoleServiceClient::new(InterceptedService::new(inner, interceptor))
11617        }
11618        /// Compress requests with the given encoding.
11619        ///
11620        /// This requires the server to support it otherwise it might respond with an
11621        /// error.
11622        #[must_use]
11623        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11624            self.inner = self.inner.send_compressed(encoding);
11625            self
11626        }
11627        /// Enable decompressing responses.
11628        #[must_use]
11629        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11630            self.inner = self.inner.accept_compressed(encoding);
11631            self
11632        }
11633        /// Limits the maximum size of a decoded message.
11634        ///
11635        /// Default: `4MB`
11636        #[must_use]
11637        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11638            self.inner = self.inner.max_decoding_message_size(limit);
11639            self
11640        }
11641        /// Limits the maximum size of an encoded message.
11642        ///
11643        /// Default: `usize::MAX`
11644        #[must_use]
11645        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11646            self.inner = self.inner.max_encoding_message_size(limit);
11647            self
11648        }
11649        /** List all roles in the organization with their permission sets.
11650 Authorization: Requires PERMISSION_ORG_READ.
11651*/
11652        pub async fn list_roles(
11653            &mut self,
11654            request: impl tonic::IntoRequest<super::ListRolesRequest>,
11655        ) -> std::result::Result<
11656            tonic::Response<super::ListRolesResponse>,
11657            tonic::Status,
11658        > {
11659            self.inner
11660                .ready()
11661                .await
11662                .map_err(|e| {
11663                    tonic::Status::unknown(
11664                        format!("Service was not ready: {}", e.into()),
11665                    )
11666                })?;
11667            let codec = tonic_prost::ProstCodec::default();
11668            let path = http::uri::PathAndQuery::from_static(
11669                "/pidgr.v1.RoleService/ListRoles",
11670            );
11671            let mut req = request.into_request();
11672            req.extensions_mut()
11673                .insert(GrpcMethod::new("pidgr.v1.RoleService", "ListRoles"));
11674            self.inner.unary(req, path, codec).await
11675        }
11676        /** Create a new custom role with a name and initial permissions.
11677 Slug is auto-generated from the name and immutable after creation.
11678 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
11679*/
11680        pub async fn create_role(
11681            &mut self,
11682            request: impl tonic::IntoRequest<super::CreateRoleRequest>,
11683        ) -> std::result::Result<
11684            tonic::Response<super::CreateRoleResponse>,
11685            tonic::Status,
11686        > {
11687            self.inner
11688                .ready()
11689                .await
11690                .map_err(|e| {
11691                    tonic::Status::unknown(
11692                        format!("Service was not ready: {}", e.into()),
11693                    )
11694                })?;
11695            let codec = tonic_prost::ProstCodec::default();
11696            let path = http::uri::PathAndQuery::from_static(
11697                "/pidgr.v1.RoleService/CreateRole",
11698            );
11699            let mut req = request.into_request();
11700            req.extensions_mut()
11701                .insert(GrpcMethod::new("pidgr.v1.RoleService", "CreateRole"));
11702            self.inner.unary(req, path, codec).await
11703        }
11704        /** Update a role's name and/or permissions.
11705 System roles (is_system=true) cannot be updated.
11706 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
11707*/
11708        pub async fn update_role(
11709            &mut self,
11710            request: impl tonic::IntoRequest<super::UpdateRoleRequest>,
11711        ) -> std::result::Result<
11712            tonic::Response<super::UpdateRoleResponse>,
11713            tonic::Status,
11714        > {
11715            self.inner
11716                .ready()
11717                .await
11718                .map_err(|e| {
11719                    tonic::Status::unknown(
11720                        format!("Service was not ready: {}", e.into()),
11721                    )
11722                })?;
11723            let codec = tonic_prost::ProstCodec::default();
11724            let path = http::uri::PathAndQuery::from_static(
11725                "/pidgr.v1.RoleService/UpdateRole",
11726            );
11727            let mut req = request.into_request();
11728            req.extensions_mut()
11729                .insert(GrpcMethod::new("pidgr.v1.RoleService", "UpdateRole"));
11730            self.inner.unary(req, path, codec).await
11731        }
11732        /** Delete a role. Fails if any users are assigned to it.
11733 System roles (is_system=true) cannot be deleted.
11734 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
11735*/
11736        pub async fn delete_role(
11737            &mut self,
11738            request: impl tonic::IntoRequest<super::DeleteRoleRequest>,
11739        ) -> std::result::Result<
11740            tonic::Response<super::DeleteRoleResponse>,
11741            tonic::Status,
11742        > {
11743            self.inner
11744                .ready()
11745                .await
11746                .map_err(|e| {
11747                    tonic::Status::unknown(
11748                        format!("Service was not ready: {}", e.into()),
11749                    )
11750                })?;
11751            let codec = tonic_prost::ProstCodec::default();
11752            let path = http::uri::PathAndQuery::from_static(
11753                "/pidgr.v1.RoleService/DeleteRole",
11754            );
11755            let mut req = request.into_request();
11756            req.extensions_mut()
11757                .insert(GrpcMethod::new("pidgr.v1.RoleService", "DeleteRole"));
11758            self.inner.unary(req, path, codec).await
11759        }
11760    }
11761}
11762/// Generated server implementations.
11763pub mod role_service_server {
11764    #![allow(
11765        unused_variables,
11766        dead_code,
11767        missing_docs,
11768        clippy::wildcard_imports,
11769        clippy::let_unit_value,
11770    )]
11771    use tonic::codegen::*;
11772    /// Generated trait containing gRPC methods that should be implemented for use with RoleServiceServer.
11773    #[async_trait]
11774    pub trait RoleService: std::marker::Send + std::marker::Sync + 'static {
11775        /** List all roles in the organization with their permission sets.
11776 Authorization: Requires PERMISSION_ORG_READ.
11777*/
11778        async fn list_roles(
11779            &self,
11780            request: tonic::Request<super::ListRolesRequest>,
11781        ) -> std::result::Result<
11782            tonic::Response<super::ListRolesResponse>,
11783            tonic::Status,
11784        >;
11785        /** Create a new custom role with a name and initial permissions.
11786 Slug is auto-generated from the name and immutable after creation.
11787 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
11788*/
11789        async fn create_role(
11790            &self,
11791            request: tonic::Request<super::CreateRoleRequest>,
11792        ) -> std::result::Result<
11793            tonic::Response<super::CreateRoleResponse>,
11794            tonic::Status,
11795        >;
11796        /** Update a role's name and/or permissions.
11797 System roles (is_system=true) cannot be updated.
11798 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
11799*/
11800        async fn update_role(
11801            &self,
11802            request: tonic::Request<super::UpdateRoleRequest>,
11803        ) -> std::result::Result<
11804            tonic::Response<super::UpdateRoleResponse>,
11805            tonic::Status,
11806        >;
11807        /** Delete a role. Fails if any users are assigned to it.
11808 System roles (is_system=true) cannot be deleted.
11809 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
11810*/
11811        async fn delete_role(
11812            &self,
11813            request: tonic::Request<super::DeleteRoleRequest>,
11814        ) -> std::result::Result<
11815            tonic::Response<super::DeleteRoleResponse>,
11816            tonic::Status,
11817        >;
11818    }
11819    /** Manages roles and their permissions within an organization.
11820 All RPCs operate within the caller's org (extracted from JWT).
11821*/
11822    #[derive(Debug)]
11823    pub struct RoleServiceServer<T> {
11824        inner: Arc<T>,
11825        accept_compression_encodings: EnabledCompressionEncodings,
11826        send_compression_encodings: EnabledCompressionEncodings,
11827        max_decoding_message_size: Option<usize>,
11828        max_encoding_message_size: Option<usize>,
11829    }
11830    impl<T> RoleServiceServer<T> {
11831        pub fn new(inner: T) -> Self {
11832            Self::from_arc(Arc::new(inner))
11833        }
11834        pub fn from_arc(inner: Arc<T>) -> Self {
11835            Self {
11836                inner,
11837                accept_compression_encodings: Default::default(),
11838                send_compression_encodings: Default::default(),
11839                max_decoding_message_size: None,
11840                max_encoding_message_size: None,
11841            }
11842        }
11843        pub fn with_interceptor<F>(
11844            inner: T,
11845            interceptor: F,
11846        ) -> InterceptedService<Self, F>
11847        where
11848            F: tonic::service::Interceptor,
11849        {
11850            InterceptedService::new(Self::new(inner), interceptor)
11851        }
11852        /// Enable decompressing requests with the given encoding.
11853        #[must_use]
11854        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11855            self.accept_compression_encodings.enable(encoding);
11856            self
11857        }
11858        /// Compress responses with the given encoding, if the client supports it.
11859        #[must_use]
11860        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11861            self.send_compression_encodings.enable(encoding);
11862            self
11863        }
11864        /// Limits the maximum size of a decoded message.
11865        ///
11866        /// Default: `4MB`
11867        #[must_use]
11868        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11869            self.max_decoding_message_size = Some(limit);
11870            self
11871        }
11872        /// Limits the maximum size of an encoded message.
11873        ///
11874        /// Default: `usize::MAX`
11875        #[must_use]
11876        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11877            self.max_encoding_message_size = Some(limit);
11878            self
11879        }
11880    }
11881    impl<T, B> tonic::codegen::Service<http::Request<B>> for RoleServiceServer<T>
11882    where
11883        T: RoleService,
11884        B: Body + std::marker::Send + 'static,
11885        B::Error: Into<StdError> + std::marker::Send + 'static,
11886    {
11887        type Response = http::Response<tonic::body::Body>;
11888        type Error = std::convert::Infallible;
11889        type Future = BoxFuture<Self::Response, Self::Error>;
11890        fn poll_ready(
11891            &mut self,
11892            _cx: &mut Context<'_>,
11893        ) -> Poll<std::result::Result<(), Self::Error>> {
11894            Poll::Ready(Ok(()))
11895        }
11896        fn call(&mut self, req: http::Request<B>) -> Self::Future {
11897            match req.uri().path() {
11898                "/pidgr.v1.RoleService/ListRoles" => {
11899                    #[allow(non_camel_case_types)]
11900                    struct ListRolesSvc<T: RoleService>(pub Arc<T>);
11901                    impl<
11902                        T: RoleService,
11903                    > tonic::server::UnaryService<super::ListRolesRequest>
11904                    for ListRolesSvc<T> {
11905                        type Response = super::ListRolesResponse;
11906                        type Future = BoxFuture<
11907                            tonic::Response<Self::Response>,
11908                            tonic::Status,
11909                        >;
11910                        fn call(
11911                            &mut self,
11912                            request: tonic::Request<super::ListRolesRequest>,
11913                        ) -> Self::Future {
11914                            let inner = Arc::clone(&self.0);
11915                            let fut = async move {
11916                                <T as RoleService>::list_roles(&inner, request).await
11917                            };
11918                            Box::pin(fut)
11919                        }
11920                    }
11921                    let accept_compression_encodings = self.accept_compression_encodings;
11922                    let send_compression_encodings = self.send_compression_encodings;
11923                    let max_decoding_message_size = self.max_decoding_message_size;
11924                    let max_encoding_message_size = self.max_encoding_message_size;
11925                    let inner = self.inner.clone();
11926                    let fut = async move {
11927                        let method = ListRolesSvc(inner);
11928                        let codec = tonic_prost::ProstCodec::default();
11929                        let mut grpc = tonic::server::Grpc::new(codec)
11930                            .apply_compression_config(
11931                                accept_compression_encodings,
11932                                send_compression_encodings,
11933                            )
11934                            .apply_max_message_size_config(
11935                                max_decoding_message_size,
11936                                max_encoding_message_size,
11937                            );
11938                        let res = grpc.unary(method, req).await;
11939                        Ok(res)
11940                    };
11941                    Box::pin(fut)
11942                }
11943                "/pidgr.v1.RoleService/CreateRole" => {
11944                    #[allow(non_camel_case_types)]
11945                    struct CreateRoleSvc<T: RoleService>(pub Arc<T>);
11946                    impl<
11947                        T: RoleService,
11948                    > tonic::server::UnaryService<super::CreateRoleRequest>
11949                    for CreateRoleSvc<T> {
11950                        type Response = super::CreateRoleResponse;
11951                        type Future = BoxFuture<
11952                            tonic::Response<Self::Response>,
11953                            tonic::Status,
11954                        >;
11955                        fn call(
11956                            &mut self,
11957                            request: tonic::Request<super::CreateRoleRequest>,
11958                        ) -> Self::Future {
11959                            let inner = Arc::clone(&self.0);
11960                            let fut = async move {
11961                                <T as RoleService>::create_role(&inner, request).await
11962                            };
11963                            Box::pin(fut)
11964                        }
11965                    }
11966                    let accept_compression_encodings = self.accept_compression_encodings;
11967                    let send_compression_encodings = self.send_compression_encodings;
11968                    let max_decoding_message_size = self.max_decoding_message_size;
11969                    let max_encoding_message_size = self.max_encoding_message_size;
11970                    let inner = self.inner.clone();
11971                    let fut = async move {
11972                        let method = CreateRoleSvc(inner);
11973                        let codec = tonic_prost::ProstCodec::default();
11974                        let mut grpc = tonic::server::Grpc::new(codec)
11975                            .apply_compression_config(
11976                                accept_compression_encodings,
11977                                send_compression_encodings,
11978                            )
11979                            .apply_max_message_size_config(
11980                                max_decoding_message_size,
11981                                max_encoding_message_size,
11982                            );
11983                        let res = grpc.unary(method, req).await;
11984                        Ok(res)
11985                    };
11986                    Box::pin(fut)
11987                }
11988                "/pidgr.v1.RoleService/UpdateRole" => {
11989                    #[allow(non_camel_case_types)]
11990                    struct UpdateRoleSvc<T: RoleService>(pub Arc<T>);
11991                    impl<
11992                        T: RoleService,
11993                    > tonic::server::UnaryService<super::UpdateRoleRequest>
11994                    for UpdateRoleSvc<T> {
11995                        type Response = super::UpdateRoleResponse;
11996                        type Future = BoxFuture<
11997                            tonic::Response<Self::Response>,
11998                            tonic::Status,
11999                        >;
12000                        fn call(
12001                            &mut self,
12002                            request: tonic::Request<super::UpdateRoleRequest>,
12003                        ) -> Self::Future {
12004                            let inner = Arc::clone(&self.0);
12005                            let fut = async move {
12006                                <T as RoleService>::update_role(&inner, request).await
12007                            };
12008                            Box::pin(fut)
12009                        }
12010                    }
12011                    let accept_compression_encodings = self.accept_compression_encodings;
12012                    let send_compression_encodings = self.send_compression_encodings;
12013                    let max_decoding_message_size = self.max_decoding_message_size;
12014                    let max_encoding_message_size = self.max_encoding_message_size;
12015                    let inner = self.inner.clone();
12016                    let fut = async move {
12017                        let method = UpdateRoleSvc(inner);
12018                        let codec = tonic_prost::ProstCodec::default();
12019                        let mut grpc = tonic::server::Grpc::new(codec)
12020                            .apply_compression_config(
12021                                accept_compression_encodings,
12022                                send_compression_encodings,
12023                            )
12024                            .apply_max_message_size_config(
12025                                max_decoding_message_size,
12026                                max_encoding_message_size,
12027                            );
12028                        let res = grpc.unary(method, req).await;
12029                        Ok(res)
12030                    };
12031                    Box::pin(fut)
12032                }
12033                "/pidgr.v1.RoleService/DeleteRole" => {
12034                    #[allow(non_camel_case_types)]
12035                    struct DeleteRoleSvc<T: RoleService>(pub Arc<T>);
12036                    impl<
12037                        T: RoleService,
12038                    > tonic::server::UnaryService<super::DeleteRoleRequest>
12039                    for DeleteRoleSvc<T> {
12040                        type Response = super::DeleteRoleResponse;
12041                        type Future = BoxFuture<
12042                            tonic::Response<Self::Response>,
12043                            tonic::Status,
12044                        >;
12045                        fn call(
12046                            &mut self,
12047                            request: tonic::Request<super::DeleteRoleRequest>,
12048                        ) -> Self::Future {
12049                            let inner = Arc::clone(&self.0);
12050                            let fut = async move {
12051                                <T as RoleService>::delete_role(&inner, request).await
12052                            };
12053                            Box::pin(fut)
12054                        }
12055                    }
12056                    let accept_compression_encodings = self.accept_compression_encodings;
12057                    let send_compression_encodings = self.send_compression_encodings;
12058                    let max_decoding_message_size = self.max_decoding_message_size;
12059                    let max_encoding_message_size = self.max_encoding_message_size;
12060                    let inner = self.inner.clone();
12061                    let fut = async move {
12062                        let method = DeleteRoleSvc(inner);
12063                        let codec = tonic_prost::ProstCodec::default();
12064                        let mut grpc = tonic::server::Grpc::new(codec)
12065                            .apply_compression_config(
12066                                accept_compression_encodings,
12067                                send_compression_encodings,
12068                            )
12069                            .apply_max_message_size_config(
12070                                max_decoding_message_size,
12071                                max_encoding_message_size,
12072                            );
12073                        let res = grpc.unary(method, req).await;
12074                        Ok(res)
12075                    };
12076                    Box::pin(fut)
12077                }
12078                _ => {
12079                    Box::pin(async move {
12080                        let mut response = http::Response::new(
12081                            tonic::body::Body::default(),
12082                        );
12083                        let headers = response.headers_mut();
12084                        headers
12085                            .insert(
12086                                tonic::Status::GRPC_STATUS,
12087                                (tonic::Code::Unimplemented as i32).into(),
12088                            );
12089                        headers
12090                            .insert(
12091                                http::header::CONTENT_TYPE,
12092                                tonic::metadata::GRPC_CONTENT_TYPE,
12093                            );
12094                        Ok(response)
12095                    })
12096                }
12097            }
12098        }
12099    }
12100    impl<T> Clone for RoleServiceServer<T> {
12101        fn clone(&self) -> Self {
12102            let inner = self.inner.clone();
12103            Self {
12104                inner,
12105                accept_compression_encodings: self.accept_compression_encodings,
12106                send_compression_encodings: self.send_compression_encodings,
12107                max_decoding_message_size: self.max_decoding_message_size,
12108                max_encoding_message_size: self.max_encoding_message_size,
12109            }
12110        }
12111    }
12112    /// Generated gRPC service name
12113    pub const SERVICE_NAME: &str = "pidgr.v1.RoleService";
12114    impl<T> tonic::server::NamedService for RoleServiceServer<T> {
12115        const NAME: &'static str = SERVICE_NAME;
12116    }
12117}
12118/// Generated client implementations.
12119pub mod sso_service_client {
12120    #![allow(
12121        unused_variables,
12122        dead_code,
12123        missing_docs,
12124        clippy::wildcard_imports,
12125        clippy::let_unit_value,
12126    )]
12127    use tonic::codegen::*;
12128    use tonic::codegen::http::Uri;
12129    /** Manages SSO identity provider configuration for organizations.
12130*/
12131    #[derive(Debug, Clone)]
12132    pub struct SsoServiceClient<T> {
12133        inner: tonic::client::Grpc<T>,
12134    }
12135    impl SsoServiceClient<tonic::transport::Channel> {
12136        /// Attempt to create a new client by connecting to a given endpoint.
12137        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
12138        where
12139            D: TryInto<tonic::transport::Endpoint>,
12140            D::Error: Into<StdError>,
12141        {
12142            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
12143            Ok(Self::new(conn))
12144        }
12145    }
12146    impl<T> SsoServiceClient<T>
12147    where
12148        T: tonic::client::GrpcService<tonic::body::Body>,
12149        T::Error: Into<StdError>,
12150        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
12151        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
12152    {
12153        pub fn new(inner: T) -> Self {
12154            let inner = tonic::client::Grpc::new(inner);
12155            Self { inner }
12156        }
12157        pub fn with_origin(inner: T, origin: Uri) -> Self {
12158            let inner = tonic::client::Grpc::with_origin(inner, origin);
12159            Self { inner }
12160        }
12161        pub fn with_interceptor<F>(
12162            inner: T,
12163            interceptor: F,
12164        ) -> SsoServiceClient<InterceptedService<T, F>>
12165        where
12166            F: tonic::service::Interceptor,
12167            T::ResponseBody: Default,
12168            T: tonic::codegen::Service<
12169                http::Request<tonic::body::Body>,
12170                Response = http::Response<
12171                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
12172                >,
12173            >,
12174            <T as tonic::codegen::Service<
12175                http::Request<tonic::body::Body>,
12176            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
12177        {
12178            SsoServiceClient::new(InterceptedService::new(inner, interceptor))
12179        }
12180        /// Compress requests with the given encoding.
12181        ///
12182        /// This requires the server to support it otherwise it might respond with an
12183        /// error.
12184        #[must_use]
12185        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
12186            self.inner = self.inner.send_compressed(encoding);
12187            self
12188        }
12189        /// Enable decompressing responses.
12190        #[must_use]
12191        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
12192            self.inner = self.inner.accept_compressed(encoding);
12193            self
12194        }
12195        /// Limits the maximum size of a decoded message.
12196        ///
12197        /// Default: `4MB`
12198        #[must_use]
12199        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
12200            self.inner = self.inner.max_decoding_message_size(limit);
12201            self
12202        }
12203        /// Limits the maximum size of an encoded message.
12204        ///
12205        /// Default: `usize::MAX`
12206        #[must_use]
12207        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
12208            self.inner = self.inner.max_encoding_message_size(limit);
12209            self
12210        }
12211        /** Check if an email domain has SSO configured.
12212 This is a pre-authentication endpoint — no JWT required.
12213 Authorization: None (public).
12214*/
12215        pub async fn check_sso_by_domain(
12216            &mut self,
12217            request: impl tonic::IntoRequest<super::CheckSsoByDomainRequest>,
12218        ) -> std::result::Result<
12219            tonic::Response<super::CheckSsoByDomainResponse>,
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.SSOService/CheckSSOByDomain",
12233            );
12234            let mut req = request.into_request();
12235            req.extensions_mut()
12236                .insert(GrpcMethod::new("pidgr.v1.SSOService", "CheckSSOByDomain"));
12237            self.inner.unary(req, path, codec).await
12238        }
12239        /** Create an SSO provider for the organization.
12240 Validates the metadata URL before saving.
12241 Creates the corresponding identity provider in the auth service.
12242 Authorization: Requires PERMISSION_ORG_WRITE.
12243*/
12244        pub async fn create_sso_provider(
12245            &mut self,
12246            request: impl tonic::IntoRequest<super::CreateSsoProviderRequest>,
12247        ) -> std::result::Result<
12248            tonic::Response<super::CreateSsoProviderResponse>,
12249            tonic::Status,
12250        > {
12251            self.inner
12252                .ready()
12253                .await
12254                .map_err(|e| {
12255                    tonic::Status::unknown(
12256                        format!("Service was not ready: {}", e.into()),
12257                    )
12258                })?;
12259            let codec = tonic_prost::ProstCodec::default();
12260            let path = http::uri::PathAndQuery::from_static(
12261                "/pidgr.v1.SSOService/CreateSSOProvider",
12262            );
12263            let mut req = request.into_request();
12264            req.extensions_mut()
12265                .insert(GrpcMethod::new("pidgr.v1.SSOService", "CreateSSOProvider"));
12266            self.inner.unary(req, path, codec).await
12267        }
12268        /** Get the organization's SSO provider configuration.
12269 Authorization: Requires PERMISSION_ORG_READ.
12270*/
12271        pub async fn get_sso_provider(
12272            &mut self,
12273            request: impl tonic::IntoRequest<super::GetSsoProviderRequest>,
12274        ) -> std::result::Result<
12275            tonic::Response<super::GetSsoProviderResponse>,
12276            tonic::Status,
12277        > {
12278            self.inner
12279                .ready()
12280                .await
12281                .map_err(|e| {
12282                    tonic::Status::unknown(
12283                        format!("Service was not ready: {}", e.into()),
12284                    )
12285                })?;
12286            let codec = tonic_prost::ProstCodec::default();
12287            let path = http::uri::PathAndQuery::from_static(
12288                "/pidgr.v1.SSOService/GetSSOProvider",
12289            );
12290            let mut req = request.into_request();
12291            req.extensions_mut()
12292                .insert(GrpcMethod::new("pidgr.v1.SSOService", "GetSSOProvider"));
12293            self.inner.unary(req, path, codec).await
12294        }
12295        /** Delete the organization's SSO provider.
12296 Deletes the corresponding identity provider from the auth service.
12297 Users with that domain fall back to passkey/OTP.
12298 Authorization: Requires PERMISSION_ORG_WRITE.
12299*/
12300        pub async fn delete_sso_provider(
12301            &mut self,
12302            request: impl tonic::IntoRequest<super::DeleteSsoProviderRequest>,
12303        ) -> std::result::Result<
12304            tonic::Response<super::DeleteSsoProviderResponse>,
12305            tonic::Status,
12306        > {
12307            self.inner
12308                .ready()
12309                .await
12310                .map_err(|e| {
12311                    tonic::Status::unknown(
12312                        format!("Service was not ready: {}", e.into()),
12313                    )
12314                })?;
12315            let codec = tonic_prost::ProstCodec::default();
12316            let path = http::uri::PathAndQuery::from_static(
12317                "/pidgr.v1.SSOService/DeleteSSOProvider",
12318            );
12319            let mut req = request.into_request();
12320            req.extensions_mut()
12321                .insert(GrpcMethod::new("pidgr.v1.SSOService", "DeleteSSOProvider"));
12322            self.inner.unary(req, path, codec).await
12323        }
12324    }
12325}
12326/// Generated server implementations.
12327pub mod sso_service_server {
12328    #![allow(
12329        unused_variables,
12330        dead_code,
12331        missing_docs,
12332        clippy::wildcard_imports,
12333        clippy::let_unit_value,
12334    )]
12335    use tonic::codegen::*;
12336    /// Generated trait containing gRPC methods that should be implemented for use with SsoServiceServer.
12337    #[async_trait]
12338    pub trait SsoService: std::marker::Send + std::marker::Sync + 'static {
12339        /** Check if an email domain has SSO configured.
12340 This is a pre-authentication endpoint — no JWT required.
12341 Authorization: None (public).
12342*/
12343        async fn check_sso_by_domain(
12344            &self,
12345            request: tonic::Request<super::CheckSsoByDomainRequest>,
12346        ) -> std::result::Result<
12347            tonic::Response<super::CheckSsoByDomainResponse>,
12348            tonic::Status,
12349        >;
12350        /** Create an SSO provider for the organization.
12351 Validates the metadata URL before saving.
12352 Creates the corresponding identity provider in the auth service.
12353 Authorization: Requires PERMISSION_ORG_WRITE.
12354*/
12355        async fn create_sso_provider(
12356            &self,
12357            request: tonic::Request<super::CreateSsoProviderRequest>,
12358        ) -> std::result::Result<
12359            tonic::Response<super::CreateSsoProviderResponse>,
12360            tonic::Status,
12361        >;
12362        /** Get the organization's SSO provider configuration.
12363 Authorization: Requires PERMISSION_ORG_READ.
12364*/
12365        async fn get_sso_provider(
12366            &self,
12367            request: tonic::Request<super::GetSsoProviderRequest>,
12368        ) -> std::result::Result<
12369            tonic::Response<super::GetSsoProviderResponse>,
12370            tonic::Status,
12371        >;
12372        /** Delete the organization's SSO provider.
12373 Deletes the corresponding identity provider from the auth service.
12374 Users with that domain fall back to passkey/OTP.
12375 Authorization: Requires PERMISSION_ORG_WRITE.
12376*/
12377        async fn delete_sso_provider(
12378            &self,
12379            request: tonic::Request<super::DeleteSsoProviderRequest>,
12380        ) -> std::result::Result<
12381            tonic::Response<super::DeleteSsoProviderResponse>,
12382            tonic::Status,
12383        >;
12384    }
12385    /** Manages SSO identity provider configuration for organizations.
12386*/
12387    #[derive(Debug)]
12388    pub struct SsoServiceServer<T> {
12389        inner: Arc<T>,
12390        accept_compression_encodings: EnabledCompressionEncodings,
12391        send_compression_encodings: EnabledCompressionEncodings,
12392        max_decoding_message_size: Option<usize>,
12393        max_encoding_message_size: Option<usize>,
12394    }
12395    impl<T> SsoServiceServer<T> {
12396        pub fn new(inner: T) -> Self {
12397            Self::from_arc(Arc::new(inner))
12398        }
12399        pub fn from_arc(inner: Arc<T>) -> Self {
12400            Self {
12401                inner,
12402                accept_compression_encodings: Default::default(),
12403                send_compression_encodings: Default::default(),
12404                max_decoding_message_size: None,
12405                max_encoding_message_size: None,
12406            }
12407        }
12408        pub fn with_interceptor<F>(
12409            inner: T,
12410            interceptor: F,
12411        ) -> InterceptedService<Self, F>
12412        where
12413            F: tonic::service::Interceptor,
12414        {
12415            InterceptedService::new(Self::new(inner), interceptor)
12416        }
12417        /// Enable decompressing requests with the given encoding.
12418        #[must_use]
12419        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
12420            self.accept_compression_encodings.enable(encoding);
12421            self
12422        }
12423        /// Compress responses with the given encoding, if the client supports it.
12424        #[must_use]
12425        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
12426            self.send_compression_encodings.enable(encoding);
12427            self
12428        }
12429        /// Limits the maximum size of a decoded message.
12430        ///
12431        /// Default: `4MB`
12432        #[must_use]
12433        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
12434            self.max_decoding_message_size = Some(limit);
12435            self
12436        }
12437        /// Limits the maximum size of an encoded message.
12438        ///
12439        /// Default: `usize::MAX`
12440        #[must_use]
12441        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
12442            self.max_encoding_message_size = Some(limit);
12443            self
12444        }
12445    }
12446    impl<T, B> tonic::codegen::Service<http::Request<B>> for SsoServiceServer<T>
12447    where
12448        T: SsoService,
12449        B: Body + std::marker::Send + 'static,
12450        B::Error: Into<StdError> + std::marker::Send + 'static,
12451    {
12452        type Response = http::Response<tonic::body::Body>;
12453        type Error = std::convert::Infallible;
12454        type Future = BoxFuture<Self::Response, Self::Error>;
12455        fn poll_ready(
12456            &mut self,
12457            _cx: &mut Context<'_>,
12458        ) -> Poll<std::result::Result<(), Self::Error>> {
12459            Poll::Ready(Ok(()))
12460        }
12461        fn call(&mut self, req: http::Request<B>) -> Self::Future {
12462            match req.uri().path() {
12463                "/pidgr.v1.SSOService/CheckSSOByDomain" => {
12464                    #[allow(non_camel_case_types)]
12465                    struct CheckSSOByDomainSvc<T: SsoService>(pub Arc<T>);
12466                    impl<
12467                        T: SsoService,
12468                    > tonic::server::UnaryService<super::CheckSsoByDomainRequest>
12469                    for CheckSSOByDomainSvc<T> {
12470                        type Response = super::CheckSsoByDomainResponse;
12471                        type Future = BoxFuture<
12472                            tonic::Response<Self::Response>,
12473                            tonic::Status,
12474                        >;
12475                        fn call(
12476                            &mut self,
12477                            request: tonic::Request<super::CheckSsoByDomainRequest>,
12478                        ) -> Self::Future {
12479                            let inner = Arc::clone(&self.0);
12480                            let fut = async move {
12481                                <T as SsoService>::check_sso_by_domain(&inner, request)
12482                                    .await
12483                            };
12484                            Box::pin(fut)
12485                        }
12486                    }
12487                    let accept_compression_encodings = self.accept_compression_encodings;
12488                    let send_compression_encodings = self.send_compression_encodings;
12489                    let max_decoding_message_size = self.max_decoding_message_size;
12490                    let max_encoding_message_size = self.max_encoding_message_size;
12491                    let inner = self.inner.clone();
12492                    let fut = async move {
12493                        let method = CheckSSOByDomainSvc(inner);
12494                        let codec = tonic_prost::ProstCodec::default();
12495                        let mut grpc = tonic::server::Grpc::new(codec)
12496                            .apply_compression_config(
12497                                accept_compression_encodings,
12498                                send_compression_encodings,
12499                            )
12500                            .apply_max_message_size_config(
12501                                max_decoding_message_size,
12502                                max_encoding_message_size,
12503                            );
12504                        let res = grpc.unary(method, req).await;
12505                        Ok(res)
12506                    };
12507                    Box::pin(fut)
12508                }
12509                "/pidgr.v1.SSOService/CreateSSOProvider" => {
12510                    #[allow(non_camel_case_types)]
12511                    struct CreateSSOProviderSvc<T: SsoService>(pub Arc<T>);
12512                    impl<
12513                        T: SsoService,
12514                    > tonic::server::UnaryService<super::CreateSsoProviderRequest>
12515                    for CreateSSOProviderSvc<T> {
12516                        type Response = super::CreateSsoProviderResponse;
12517                        type Future = BoxFuture<
12518                            tonic::Response<Self::Response>,
12519                            tonic::Status,
12520                        >;
12521                        fn call(
12522                            &mut self,
12523                            request: tonic::Request<super::CreateSsoProviderRequest>,
12524                        ) -> Self::Future {
12525                            let inner = Arc::clone(&self.0);
12526                            let fut = async move {
12527                                <T as SsoService>::create_sso_provider(&inner, request)
12528                                    .await
12529                            };
12530                            Box::pin(fut)
12531                        }
12532                    }
12533                    let accept_compression_encodings = self.accept_compression_encodings;
12534                    let send_compression_encodings = self.send_compression_encodings;
12535                    let max_decoding_message_size = self.max_decoding_message_size;
12536                    let max_encoding_message_size = self.max_encoding_message_size;
12537                    let inner = self.inner.clone();
12538                    let fut = async move {
12539                        let method = CreateSSOProviderSvc(inner);
12540                        let codec = tonic_prost::ProstCodec::default();
12541                        let mut grpc = tonic::server::Grpc::new(codec)
12542                            .apply_compression_config(
12543                                accept_compression_encodings,
12544                                send_compression_encodings,
12545                            )
12546                            .apply_max_message_size_config(
12547                                max_decoding_message_size,
12548                                max_encoding_message_size,
12549                            );
12550                        let res = grpc.unary(method, req).await;
12551                        Ok(res)
12552                    };
12553                    Box::pin(fut)
12554                }
12555                "/pidgr.v1.SSOService/GetSSOProvider" => {
12556                    #[allow(non_camel_case_types)]
12557                    struct GetSSOProviderSvc<T: SsoService>(pub Arc<T>);
12558                    impl<
12559                        T: SsoService,
12560                    > tonic::server::UnaryService<super::GetSsoProviderRequest>
12561                    for GetSSOProviderSvc<T> {
12562                        type Response = super::GetSsoProviderResponse;
12563                        type Future = BoxFuture<
12564                            tonic::Response<Self::Response>,
12565                            tonic::Status,
12566                        >;
12567                        fn call(
12568                            &mut self,
12569                            request: tonic::Request<super::GetSsoProviderRequest>,
12570                        ) -> Self::Future {
12571                            let inner = Arc::clone(&self.0);
12572                            let fut = async move {
12573                                <T as SsoService>::get_sso_provider(&inner, request).await
12574                            };
12575                            Box::pin(fut)
12576                        }
12577                    }
12578                    let accept_compression_encodings = self.accept_compression_encodings;
12579                    let send_compression_encodings = self.send_compression_encodings;
12580                    let max_decoding_message_size = self.max_decoding_message_size;
12581                    let max_encoding_message_size = self.max_encoding_message_size;
12582                    let inner = self.inner.clone();
12583                    let fut = async move {
12584                        let method = GetSSOProviderSvc(inner);
12585                        let codec = tonic_prost::ProstCodec::default();
12586                        let mut grpc = tonic::server::Grpc::new(codec)
12587                            .apply_compression_config(
12588                                accept_compression_encodings,
12589                                send_compression_encodings,
12590                            )
12591                            .apply_max_message_size_config(
12592                                max_decoding_message_size,
12593                                max_encoding_message_size,
12594                            );
12595                        let res = grpc.unary(method, req).await;
12596                        Ok(res)
12597                    };
12598                    Box::pin(fut)
12599                }
12600                "/pidgr.v1.SSOService/DeleteSSOProvider" => {
12601                    #[allow(non_camel_case_types)]
12602                    struct DeleteSSOProviderSvc<T: SsoService>(pub Arc<T>);
12603                    impl<
12604                        T: SsoService,
12605                    > tonic::server::UnaryService<super::DeleteSsoProviderRequest>
12606                    for DeleteSSOProviderSvc<T> {
12607                        type Response = super::DeleteSsoProviderResponse;
12608                        type Future = BoxFuture<
12609                            tonic::Response<Self::Response>,
12610                            tonic::Status,
12611                        >;
12612                        fn call(
12613                            &mut self,
12614                            request: tonic::Request<super::DeleteSsoProviderRequest>,
12615                        ) -> Self::Future {
12616                            let inner = Arc::clone(&self.0);
12617                            let fut = async move {
12618                                <T as SsoService>::delete_sso_provider(&inner, request)
12619                                    .await
12620                            };
12621                            Box::pin(fut)
12622                        }
12623                    }
12624                    let accept_compression_encodings = self.accept_compression_encodings;
12625                    let send_compression_encodings = self.send_compression_encodings;
12626                    let max_decoding_message_size = self.max_decoding_message_size;
12627                    let max_encoding_message_size = self.max_encoding_message_size;
12628                    let inner = self.inner.clone();
12629                    let fut = async move {
12630                        let method = DeleteSSOProviderSvc(inner);
12631                        let codec = tonic_prost::ProstCodec::default();
12632                        let mut grpc = tonic::server::Grpc::new(codec)
12633                            .apply_compression_config(
12634                                accept_compression_encodings,
12635                                send_compression_encodings,
12636                            )
12637                            .apply_max_message_size_config(
12638                                max_decoding_message_size,
12639                                max_encoding_message_size,
12640                            );
12641                        let res = grpc.unary(method, req).await;
12642                        Ok(res)
12643                    };
12644                    Box::pin(fut)
12645                }
12646                _ => {
12647                    Box::pin(async move {
12648                        let mut response = http::Response::new(
12649                            tonic::body::Body::default(),
12650                        );
12651                        let headers = response.headers_mut();
12652                        headers
12653                            .insert(
12654                                tonic::Status::GRPC_STATUS,
12655                                (tonic::Code::Unimplemented as i32).into(),
12656                            );
12657                        headers
12658                            .insert(
12659                                http::header::CONTENT_TYPE,
12660                                tonic::metadata::GRPC_CONTENT_TYPE,
12661                            );
12662                        Ok(response)
12663                    })
12664                }
12665            }
12666        }
12667    }
12668    impl<T> Clone for SsoServiceServer<T> {
12669        fn clone(&self) -> Self {
12670            let inner = self.inner.clone();
12671            Self {
12672                inner,
12673                accept_compression_encodings: self.accept_compression_encodings,
12674                send_compression_encodings: self.send_compression_encodings,
12675                max_decoding_message_size: self.max_decoding_message_size,
12676                max_encoding_message_size: self.max_encoding_message_size,
12677            }
12678        }
12679    }
12680    /// Generated gRPC service name
12681    pub const SERVICE_NAME: &str = "pidgr.v1.SSOService";
12682    impl<T> tonic::server::NamedService for SsoServiceServer<T> {
12683        const NAME: &'static str = SERVICE_NAME;
12684    }
12685}
12686/// Generated client implementations.
12687pub mod team_service_client {
12688    #![allow(
12689        unused_variables,
12690        dead_code,
12691        missing_docs,
12692        clippy::wildcard_imports,
12693        clippy::let_unit_value,
12694    )]
12695    use tonic::codegen::*;
12696    use tonic::codegen::http::Uri;
12697    /** Manages organizational teams (departments, divisions) within an organization.
12698 Teams represent the organizational structure and can serve as sender identity.
12699 All RPCs operate within the caller's org (extracted from JWT).
12700*/
12701    #[derive(Debug, Clone)]
12702    pub struct TeamServiceClient<T> {
12703        inner: tonic::client::Grpc<T>,
12704    }
12705    impl TeamServiceClient<tonic::transport::Channel> {
12706        /// Attempt to create a new client by connecting to a given endpoint.
12707        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
12708        where
12709            D: TryInto<tonic::transport::Endpoint>,
12710            D::Error: Into<StdError>,
12711        {
12712            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
12713            Ok(Self::new(conn))
12714        }
12715    }
12716    impl<T> TeamServiceClient<T>
12717    where
12718        T: tonic::client::GrpcService<tonic::body::Body>,
12719        T::Error: Into<StdError>,
12720        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
12721        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
12722    {
12723        pub fn new(inner: T) -> Self {
12724            let inner = tonic::client::Grpc::new(inner);
12725            Self { inner }
12726        }
12727        pub fn with_origin(inner: T, origin: Uri) -> Self {
12728            let inner = tonic::client::Grpc::with_origin(inner, origin);
12729            Self { inner }
12730        }
12731        pub fn with_interceptor<F>(
12732            inner: T,
12733            interceptor: F,
12734        ) -> TeamServiceClient<InterceptedService<T, F>>
12735        where
12736            F: tonic::service::Interceptor,
12737            T::ResponseBody: Default,
12738            T: tonic::codegen::Service<
12739                http::Request<tonic::body::Body>,
12740                Response = http::Response<
12741                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
12742                >,
12743            >,
12744            <T as tonic::codegen::Service<
12745                http::Request<tonic::body::Body>,
12746            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
12747        {
12748            TeamServiceClient::new(InterceptedService::new(inner, interceptor))
12749        }
12750        /// Compress requests with the given encoding.
12751        ///
12752        /// This requires the server to support it otherwise it might respond with an
12753        /// error.
12754        #[must_use]
12755        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
12756            self.inner = self.inner.send_compressed(encoding);
12757            self
12758        }
12759        /// Enable decompressing responses.
12760        #[must_use]
12761        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
12762            self.inner = self.inner.accept_compressed(encoding);
12763            self
12764        }
12765        /// Limits the maximum size of a decoded message.
12766        ///
12767        /// Default: `4MB`
12768        #[must_use]
12769        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
12770            self.inner = self.inner.max_decoding_message_size(limit);
12771            self
12772        }
12773        /// Limits the maximum size of an encoded message.
12774        ///
12775        /// Default: `usize::MAX`
12776        #[must_use]
12777        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
12778            self.inner = self.inner.max_encoding_message_size(limit);
12779            self
12780        }
12781        /** Create a new team in the organization.
12782 Authorization: Requires PERMISSION_TEAMS_WRITE or PERMISSION_TEAMS_ALL_WRITE.
12783*/
12784        pub async fn create_team(
12785            &mut self,
12786            request: impl tonic::IntoRequest<super::CreateTeamRequest>,
12787        ) -> std::result::Result<
12788            tonic::Response<super::CreateTeamResponse>,
12789            tonic::Status,
12790        > {
12791            self.inner
12792                .ready()
12793                .await
12794                .map_err(|e| {
12795                    tonic::Status::unknown(
12796                        format!("Service was not ready: {}", e.into()),
12797                    )
12798                })?;
12799            let codec = tonic_prost::ProstCodec::default();
12800            let path = http::uri::PathAndQuery::from_static(
12801                "/pidgr.v1.TeamService/CreateTeam",
12802            );
12803            let mut req = request.into_request();
12804            req.extensions_mut()
12805                .insert(GrpcMethod::new("pidgr.v1.TeamService", "CreateTeam"));
12806            self.inner.unary(req, path, codec).await
12807        }
12808        /** Retrieve a team by ID.
12809 Authorization: Caller must be a member of the team, or have
12810 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
12811*/
12812        pub async fn get_team(
12813            &mut self,
12814            request: impl tonic::IntoRequest<super::GetTeamRequest>,
12815        ) -> std::result::Result<
12816            tonic::Response<super::GetTeamResponse>,
12817            tonic::Status,
12818        > {
12819            self.inner
12820                .ready()
12821                .await
12822                .map_err(|e| {
12823                    tonic::Status::unknown(
12824                        format!("Service was not ready: {}", e.into()),
12825                    )
12826                })?;
12827            let codec = tonic_prost::ProstCodec::default();
12828            let path = http::uri::PathAndQuery::from_static(
12829                "/pidgr.v1.TeamService/GetTeam",
12830            );
12831            let mut req = request.into_request();
12832            req.extensions_mut()
12833                .insert(GrpcMethod::new("pidgr.v1.TeamService", "GetTeam"));
12834            self.inner.unary(req, path, codec).await
12835        }
12836        /** List teams in the organization with pagination.
12837 Without PERMISSION_TEAMS_ALL_READ/ALL_WRITE, returns only teams the caller belongs to.
12838*/
12839        pub async fn list_teams(
12840            &mut self,
12841            request: impl tonic::IntoRequest<super::ListTeamsRequest>,
12842        ) -> std::result::Result<
12843            tonic::Response<super::ListTeamsResponse>,
12844            tonic::Status,
12845        > {
12846            self.inner
12847                .ready()
12848                .await
12849                .map_err(|e| {
12850                    tonic::Status::unknown(
12851                        format!("Service was not ready: {}", e.into()),
12852                    )
12853                })?;
12854            let codec = tonic_prost::ProstCodec::default();
12855            let path = http::uri::PathAndQuery::from_static(
12856                "/pidgr.v1.TeamService/ListTeams",
12857            );
12858            let mut req = request.into_request();
12859            req.extensions_mut()
12860                .insert(GrpcMethod::new("pidgr.v1.TeamService", "ListTeams"));
12861            self.inner.unary(req, path, codec).await
12862        }
12863        /** Update a team's name and/or description.
12864 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
12865*/
12866        pub async fn update_team(
12867            &mut self,
12868            request: impl tonic::IntoRequest<super::UpdateTeamRequest>,
12869        ) -> std::result::Result<
12870            tonic::Response<super::UpdateTeamResponse>,
12871            tonic::Status,
12872        > {
12873            self.inner
12874                .ready()
12875                .await
12876                .map_err(|e| {
12877                    tonic::Status::unknown(
12878                        format!("Service was not ready: {}", e.into()),
12879                    )
12880                })?;
12881            let codec = tonic_prost::ProstCodec::default();
12882            let path = http::uri::PathAndQuery::from_static(
12883                "/pidgr.v1.TeamService/UpdateTeam",
12884            );
12885            let mut req = request.into_request();
12886            req.extensions_mut()
12887                .insert(GrpcMethod::new("pidgr.v1.TeamService", "UpdateTeam"));
12888            self.inner.unary(req, path, codec).await
12889        }
12890        /** Delete a team and all its membership records. Default teams cannot be deleted.
12891 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
12892*/
12893        pub async fn delete_team(
12894            &mut self,
12895            request: impl tonic::IntoRequest<super::DeleteTeamRequest>,
12896        ) -> std::result::Result<
12897            tonic::Response<super::DeleteTeamResponse>,
12898            tonic::Status,
12899        > {
12900            self.inner
12901                .ready()
12902                .await
12903                .map_err(|e| {
12904                    tonic::Status::unknown(
12905                        format!("Service was not ready: {}", e.into()),
12906                    )
12907                })?;
12908            let codec = tonic_prost::ProstCodec::default();
12909            let path = http::uri::PathAndQuery::from_static(
12910                "/pidgr.v1.TeamService/DeleteTeam",
12911            );
12912            let mut req = request.into_request();
12913            req.extensions_mut()
12914                .insert(GrpcMethod::new("pidgr.v1.TeamService", "DeleteTeam"));
12915            self.inner.unary(req, path, codec).await
12916        }
12917        /** Add one or more users to a team (idempotent).
12918 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
12919*/
12920        pub async fn add_team_members(
12921            &mut self,
12922            request: impl tonic::IntoRequest<super::AddTeamMembersRequest>,
12923        ) -> std::result::Result<
12924            tonic::Response<super::AddTeamMembersResponse>,
12925            tonic::Status,
12926        > {
12927            self.inner
12928                .ready()
12929                .await
12930                .map_err(|e| {
12931                    tonic::Status::unknown(
12932                        format!("Service was not ready: {}", e.into()),
12933                    )
12934                })?;
12935            let codec = tonic_prost::ProstCodec::default();
12936            let path = http::uri::PathAndQuery::from_static(
12937                "/pidgr.v1.TeamService/AddTeamMembers",
12938            );
12939            let mut req = request.into_request();
12940            req.extensions_mut()
12941                .insert(GrpcMethod::new("pidgr.v1.TeamService", "AddTeamMembers"));
12942            self.inner.unary(req, path, codec).await
12943        }
12944        /** Remove one or more users from a team (idempotent).
12945 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
12946*/
12947        pub async fn remove_team_members(
12948            &mut self,
12949            request: impl tonic::IntoRequest<super::RemoveTeamMembersRequest>,
12950        ) -> std::result::Result<
12951            tonic::Response<super::RemoveTeamMembersResponse>,
12952            tonic::Status,
12953        > {
12954            self.inner
12955                .ready()
12956                .await
12957                .map_err(|e| {
12958                    tonic::Status::unknown(
12959                        format!("Service was not ready: {}", e.into()),
12960                    )
12961                })?;
12962            let codec = tonic_prost::ProstCodec::default();
12963            let path = http::uri::PathAndQuery::from_static(
12964                "/pidgr.v1.TeamService/RemoveTeamMembers",
12965            );
12966            let mut req = request.into_request();
12967            req.extensions_mut()
12968                .insert(GrpcMethod::new("pidgr.v1.TeamService", "RemoveTeamMembers"));
12969            self.inner.unary(req, path, codec).await
12970        }
12971        /** List members of a team with pagination.
12972 Authorization: Caller must be a member of the team, or have
12973 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
12974*/
12975        pub async fn list_team_members(
12976            &mut self,
12977            request: impl tonic::IntoRequest<super::ListTeamMembersRequest>,
12978        ) -> std::result::Result<
12979            tonic::Response<super::ListTeamMembersResponse>,
12980            tonic::Status,
12981        > {
12982            self.inner
12983                .ready()
12984                .await
12985                .map_err(|e| {
12986                    tonic::Status::unknown(
12987                        format!("Service was not ready: {}", e.into()),
12988                    )
12989                })?;
12990            let codec = tonic_prost::ProstCodec::default();
12991            let path = http::uri::PathAndQuery::from_static(
12992                "/pidgr.v1.TeamService/ListTeamMembers",
12993            );
12994            let mut req = request.into_request();
12995            req.extensions_mut()
12996                .insert(GrpcMethod::new("pidgr.v1.TeamService", "ListTeamMembers"));
12997            self.inner.unary(req, path, codec).await
12998        }
12999    }
13000}
13001/// Generated server implementations.
13002pub mod team_service_server {
13003    #![allow(
13004        unused_variables,
13005        dead_code,
13006        missing_docs,
13007        clippy::wildcard_imports,
13008        clippy::let_unit_value,
13009    )]
13010    use tonic::codegen::*;
13011    /// Generated trait containing gRPC methods that should be implemented for use with TeamServiceServer.
13012    #[async_trait]
13013    pub trait TeamService: std::marker::Send + std::marker::Sync + 'static {
13014        /** Create a new team in the organization.
13015 Authorization: Requires PERMISSION_TEAMS_WRITE or PERMISSION_TEAMS_ALL_WRITE.
13016*/
13017        async fn create_team(
13018            &self,
13019            request: tonic::Request<super::CreateTeamRequest>,
13020        ) -> std::result::Result<
13021            tonic::Response<super::CreateTeamResponse>,
13022            tonic::Status,
13023        >;
13024        /** Retrieve a team by ID.
13025 Authorization: Caller must be a member of the team, or have
13026 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
13027*/
13028        async fn get_team(
13029            &self,
13030            request: tonic::Request<super::GetTeamRequest>,
13031        ) -> std::result::Result<tonic::Response<super::GetTeamResponse>, tonic::Status>;
13032        /** List teams in the organization with pagination.
13033 Without PERMISSION_TEAMS_ALL_READ/ALL_WRITE, returns only teams the caller belongs to.
13034*/
13035        async fn list_teams(
13036            &self,
13037            request: tonic::Request<super::ListTeamsRequest>,
13038        ) -> std::result::Result<
13039            tonic::Response<super::ListTeamsResponse>,
13040            tonic::Status,
13041        >;
13042        /** Update a team's name and/or description.
13043 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
13044*/
13045        async fn update_team(
13046            &self,
13047            request: tonic::Request<super::UpdateTeamRequest>,
13048        ) -> std::result::Result<
13049            tonic::Response<super::UpdateTeamResponse>,
13050            tonic::Status,
13051        >;
13052        /** Delete a team and all its membership records. Default teams cannot be deleted.
13053 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
13054*/
13055        async fn delete_team(
13056            &self,
13057            request: tonic::Request<super::DeleteTeamRequest>,
13058        ) -> std::result::Result<
13059            tonic::Response<super::DeleteTeamResponse>,
13060            tonic::Status,
13061        >;
13062        /** Add one or more users to a team (idempotent).
13063 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
13064*/
13065        async fn add_team_members(
13066            &self,
13067            request: tonic::Request<super::AddTeamMembersRequest>,
13068        ) -> std::result::Result<
13069            tonic::Response<super::AddTeamMembersResponse>,
13070            tonic::Status,
13071        >;
13072        /** Remove one or more users from a team (idempotent).
13073 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
13074*/
13075        async fn remove_team_members(
13076            &self,
13077            request: tonic::Request<super::RemoveTeamMembersRequest>,
13078        ) -> std::result::Result<
13079            tonic::Response<super::RemoveTeamMembersResponse>,
13080            tonic::Status,
13081        >;
13082        /** List members of a team with pagination.
13083 Authorization: Caller must be a member of the team, or have
13084 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
13085*/
13086        async fn list_team_members(
13087            &self,
13088            request: tonic::Request<super::ListTeamMembersRequest>,
13089        ) -> std::result::Result<
13090            tonic::Response<super::ListTeamMembersResponse>,
13091            tonic::Status,
13092        >;
13093    }
13094    /** Manages organizational teams (departments, divisions) within an organization.
13095 Teams represent the organizational structure and can serve as sender identity.
13096 All RPCs operate within the caller's org (extracted from JWT).
13097*/
13098    #[derive(Debug)]
13099    pub struct TeamServiceServer<T> {
13100        inner: Arc<T>,
13101        accept_compression_encodings: EnabledCompressionEncodings,
13102        send_compression_encodings: EnabledCompressionEncodings,
13103        max_decoding_message_size: Option<usize>,
13104        max_encoding_message_size: Option<usize>,
13105    }
13106    impl<T> TeamServiceServer<T> {
13107        pub fn new(inner: T) -> Self {
13108            Self::from_arc(Arc::new(inner))
13109        }
13110        pub fn from_arc(inner: Arc<T>) -> Self {
13111            Self {
13112                inner,
13113                accept_compression_encodings: Default::default(),
13114                send_compression_encodings: Default::default(),
13115                max_decoding_message_size: None,
13116                max_encoding_message_size: None,
13117            }
13118        }
13119        pub fn with_interceptor<F>(
13120            inner: T,
13121            interceptor: F,
13122        ) -> InterceptedService<Self, F>
13123        where
13124            F: tonic::service::Interceptor,
13125        {
13126            InterceptedService::new(Self::new(inner), interceptor)
13127        }
13128        /// Enable decompressing requests with the given encoding.
13129        #[must_use]
13130        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13131            self.accept_compression_encodings.enable(encoding);
13132            self
13133        }
13134        /// Compress responses with the given encoding, if the client supports it.
13135        #[must_use]
13136        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13137            self.send_compression_encodings.enable(encoding);
13138            self
13139        }
13140        /// Limits the maximum size of a decoded message.
13141        ///
13142        /// Default: `4MB`
13143        #[must_use]
13144        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13145            self.max_decoding_message_size = Some(limit);
13146            self
13147        }
13148        /// Limits the maximum size of an encoded message.
13149        ///
13150        /// Default: `usize::MAX`
13151        #[must_use]
13152        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13153            self.max_encoding_message_size = Some(limit);
13154            self
13155        }
13156    }
13157    impl<T, B> tonic::codegen::Service<http::Request<B>> for TeamServiceServer<T>
13158    where
13159        T: TeamService,
13160        B: Body + std::marker::Send + 'static,
13161        B::Error: Into<StdError> + std::marker::Send + 'static,
13162    {
13163        type Response = http::Response<tonic::body::Body>;
13164        type Error = std::convert::Infallible;
13165        type Future = BoxFuture<Self::Response, Self::Error>;
13166        fn poll_ready(
13167            &mut self,
13168            _cx: &mut Context<'_>,
13169        ) -> Poll<std::result::Result<(), Self::Error>> {
13170            Poll::Ready(Ok(()))
13171        }
13172        fn call(&mut self, req: http::Request<B>) -> Self::Future {
13173            match req.uri().path() {
13174                "/pidgr.v1.TeamService/CreateTeam" => {
13175                    #[allow(non_camel_case_types)]
13176                    struct CreateTeamSvc<T: TeamService>(pub Arc<T>);
13177                    impl<
13178                        T: TeamService,
13179                    > tonic::server::UnaryService<super::CreateTeamRequest>
13180                    for CreateTeamSvc<T> {
13181                        type Response = super::CreateTeamResponse;
13182                        type Future = BoxFuture<
13183                            tonic::Response<Self::Response>,
13184                            tonic::Status,
13185                        >;
13186                        fn call(
13187                            &mut self,
13188                            request: tonic::Request<super::CreateTeamRequest>,
13189                        ) -> Self::Future {
13190                            let inner = Arc::clone(&self.0);
13191                            let fut = async move {
13192                                <T as TeamService>::create_team(&inner, request).await
13193                            };
13194                            Box::pin(fut)
13195                        }
13196                    }
13197                    let accept_compression_encodings = self.accept_compression_encodings;
13198                    let send_compression_encodings = self.send_compression_encodings;
13199                    let max_decoding_message_size = self.max_decoding_message_size;
13200                    let max_encoding_message_size = self.max_encoding_message_size;
13201                    let inner = self.inner.clone();
13202                    let fut = async move {
13203                        let method = CreateTeamSvc(inner);
13204                        let codec = tonic_prost::ProstCodec::default();
13205                        let mut grpc = tonic::server::Grpc::new(codec)
13206                            .apply_compression_config(
13207                                accept_compression_encodings,
13208                                send_compression_encodings,
13209                            )
13210                            .apply_max_message_size_config(
13211                                max_decoding_message_size,
13212                                max_encoding_message_size,
13213                            );
13214                        let res = grpc.unary(method, req).await;
13215                        Ok(res)
13216                    };
13217                    Box::pin(fut)
13218                }
13219                "/pidgr.v1.TeamService/GetTeam" => {
13220                    #[allow(non_camel_case_types)]
13221                    struct GetTeamSvc<T: TeamService>(pub Arc<T>);
13222                    impl<
13223                        T: TeamService,
13224                    > tonic::server::UnaryService<super::GetTeamRequest>
13225                    for GetTeamSvc<T> {
13226                        type Response = super::GetTeamResponse;
13227                        type Future = BoxFuture<
13228                            tonic::Response<Self::Response>,
13229                            tonic::Status,
13230                        >;
13231                        fn call(
13232                            &mut self,
13233                            request: tonic::Request<super::GetTeamRequest>,
13234                        ) -> Self::Future {
13235                            let inner = Arc::clone(&self.0);
13236                            let fut = async move {
13237                                <T as TeamService>::get_team(&inner, request).await
13238                            };
13239                            Box::pin(fut)
13240                        }
13241                    }
13242                    let accept_compression_encodings = self.accept_compression_encodings;
13243                    let send_compression_encodings = self.send_compression_encodings;
13244                    let max_decoding_message_size = self.max_decoding_message_size;
13245                    let max_encoding_message_size = self.max_encoding_message_size;
13246                    let inner = self.inner.clone();
13247                    let fut = async move {
13248                        let method = GetTeamSvc(inner);
13249                        let codec = tonic_prost::ProstCodec::default();
13250                        let mut grpc = tonic::server::Grpc::new(codec)
13251                            .apply_compression_config(
13252                                accept_compression_encodings,
13253                                send_compression_encodings,
13254                            )
13255                            .apply_max_message_size_config(
13256                                max_decoding_message_size,
13257                                max_encoding_message_size,
13258                            );
13259                        let res = grpc.unary(method, req).await;
13260                        Ok(res)
13261                    };
13262                    Box::pin(fut)
13263                }
13264                "/pidgr.v1.TeamService/ListTeams" => {
13265                    #[allow(non_camel_case_types)]
13266                    struct ListTeamsSvc<T: TeamService>(pub Arc<T>);
13267                    impl<
13268                        T: TeamService,
13269                    > tonic::server::UnaryService<super::ListTeamsRequest>
13270                    for ListTeamsSvc<T> {
13271                        type Response = super::ListTeamsResponse;
13272                        type Future = BoxFuture<
13273                            tonic::Response<Self::Response>,
13274                            tonic::Status,
13275                        >;
13276                        fn call(
13277                            &mut self,
13278                            request: tonic::Request<super::ListTeamsRequest>,
13279                        ) -> Self::Future {
13280                            let inner = Arc::clone(&self.0);
13281                            let fut = async move {
13282                                <T as TeamService>::list_teams(&inner, request).await
13283                            };
13284                            Box::pin(fut)
13285                        }
13286                    }
13287                    let accept_compression_encodings = self.accept_compression_encodings;
13288                    let send_compression_encodings = self.send_compression_encodings;
13289                    let max_decoding_message_size = self.max_decoding_message_size;
13290                    let max_encoding_message_size = self.max_encoding_message_size;
13291                    let inner = self.inner.clone();
13292                    let fut = async move {
13293                        let method = ListTeamsSvc(inner);
13294                        let codec = tonic_prost::ProstCodec::default();
13295                        let mut grpc = tonic::server::Grpc::new(codec)
13296                            .apply_compression_config(
13297                                accept_compression_encodings,
13298                                send_compression_encodings,
13299                            )
13300                            .apply_max_message_size_config(
13301                                max_decoding_message_size,
13302                                max_encoding_message_size,
13303                            );
13304                        let res = grpc.unary(method, req).await;
13305                        Ok(res)
13306                    };
13307                    Box::pin(fut)
13308                }
13309                "/pidgr.v1.TeamService/UpdateTeam" => {
13310                    #[allow(non_camel_case_types)]
13311                    struct UpdateTeamSvc<T: TeamService>(pub Arc<T>);
13312                    impl<
13313                        T: TeamService,
13314                    > tonic::server::UnaryService<super::UpdateTeamRequest>
13315                    for UpdateTeamSvc<T> {
13316                        type Response = super::UpdateTeamResponse;
13317                        type Future = BoxFuture<
13318                            tonic::Response<Self::Response>,
13319                            tonic::Status,
13320                        >;
13321                        fn call(
13322                            &mut self,
13323                            request: tonic::Request<super::UpdateTeamRequest>,
13324                        ) -> Self::Future {
13325                            let inner = Arc::clone(&self.0);
13326                            let fut = async move {
13327                                <T as TeamService>::update_team(&inner, request).await
13328                            };
13329                            Box::pin(fut)
13330                        }
13331                    }
13332                    let accept_compression_encodings = self.accept_compression_encodings;
13333                    let send_compression_encodings = self.send_compression_encodings;
13334                    let max_decoding_message_size = self.max_decoding_message_size;
13335                    let max_encoding_message_size = self.max_encoding_message_size;
13336                    let inner = self.inner.clone();
13337                    let fut = async move {
13338                        let method = UpdateTeamSvc(inner);
13339                        let codec = tonic_prost::ProstCodec::default();
13340                        let mut grpc = tonic::server::Grpc::new(codec)
13341                            .apply_compression_config(
13342                                accept_compression_encodings,
13343                                send_compression_encodings,
13344                            )
13345                            .apply_max_message_size_config(
13346                                max_decoding_message_size,
13347                                max_encoding_message_size,
13348                            );
13349                        let res = grpc.unary(method, req).await;
13350                        Ok(res)
13351                    };
13352                    Box::pin(fut)
13353                }
13354                "/pidgr.v1.TeamService/DeleteTeam" => {
13355                    #[allow(non_camel_case_types)]
13356                    struct DeleteTeamSvc<T: TeamService>(pub Arc<T>);
13357                    impl<
13358                        T: TeamService,
13359                    > tonic::server::UnaryService<super::DeleteTeamRequest>
13360                    for DeleteTeamSvc<T> {
13361                        type Response = super::DeleteTeamResponse;
13362                        type Future = BoxFuture<
13363                            tonic::Response<Self::Response>,
13364                            tonic::Status,
13365                        >;
13366                        fn call(
13367                            &mut self,
13368                            request: tonic::Request<super::DeleteTeamRequest>,
13369                        ) -> Self::Future {
13370                            let inner = Arc::clone(&self.0);
13371                            let fut = async move {
13372                                <T as TeamService>::delete_team(&inner, request).await
13373                            };
13374                            Box::pin(fut)
13375                        }
13376                    }
13377                    let accept_compression_encodings = self.accept_compression_encodings;
13378                    let send_compression_encodings = self.send_compression_encodings;
13379                    let max_decoding_message_size = self.max_decoding_message_size;
13380                    let max_encoding_message_size = self.max_encoding_message_size;
13381                    let inner = self.inner.clone();
13382                    let fut = async move {
13383                        let method = DeleteTeamSvc(inner);
13384                        let codec = tonic_prost::ProstCodec::default();
13385                        let mut grpc = tonic::server::Grpc::new(codec)
13386                            .apply_compression_config(
13387                                accept_compression_encodings,
13388                                send_compression_encodings,
13389                            )
13390                            .apply_max_message_size_config(
13391                                max_decoding_message_size,
13392                                max_encoding_message_size,
13393                            );
13394                        let res = grpc.unary(method, req).await;
13395                        Ok(res)
13396                    };
13397                    Box::pin(fut)
13398                }
13399                "/pidgr.v1.TeamService/AddTeamMembers" => {
13400                    #[allow(non_camel_case_types)]
13401                    struct AddTeamMembersSvc<T: TeamService>(pub Arc<T>);
13402                    impl<
13403                        T: TeamService,
13404                    > tonic::server::UnaryService<super::AddTeamMembersRequest>
13405                    for AddTeamMembersSvc<T> {
13406                        type Response = super::AddTeamMembersResponse;
13407                        type Future = BoxFuture<
13408                            tonic::Response<Self::Response>,
13409                            tonic::Status,
13410                        >;
13411                        fn call(
13412                            &mut self,
13413                            request: tonic::Request<super::AddTeamMembersRequest>,
13414                        ) -> Self::Future {
13415                            let inner = Arc::clone(&self.0);
13416                            let fut = async move {
13417                                <T as TeamService>::add_team_members(&inner, request).await
13418                            };
13419                            Box::pin(fut)
13420                        }
13421                    }
13422                    let accept_compression_encodings = self.accept_compression_encodings;
13423                    let send_compression_encodings = self.send_compression_encodings;
13424                    let max_decoding_message_size = self.max_decoding_message_size;
13425                    let max_encoding_message_size = self.max_encoding_message_size;
13426                    let inner = self.inner.clone();
13427                    let fut = async move {
13428                        let method = AddTeamMembersSvc(inner);
13429                        let codec = tonic_prost::ProstCodec::default();
13430                        let mut grpc = tonic::server::Grpc::new(codec)
13431                            .apply_compression_config(
13432                                accept_compression_encodings,
13433                                send_compression_encodings,
13434                            )
13435                            .apply_max_message_size_config(
13436                                max_decoding_message_size,
13437                                max_encoding_message_size,
13438                            );
13439                        let res = grpc.unary(method, req).await;
13440                        Ok(res)
13441                    };
13442                    Box::pin(fut)
13443                }
13444                "/pidgr.v1.TeamService/RemoveTeamMembers" => {
13445                    #[allow(non_camel_case_types)]
13446                    struct RemoveTeamMembersSvc<T: TeamService>(pub Arc<T>);
13447                    impl<
13448                        T: TeamService,
13449                    > tonic::server::UnaryService<super::RemoveTeamMembersRequest>
13450                    for RemoveTeamMembersSvc<T> {
13451                        type Response = super::RemoveTeamMembersResponse;
13452                        type Future = BoxFuture<
13453                            tonic::Response<Self::Response>,
13454                            tonic::Status,
13455                        >;
13456                        fn call(
13457                            &mut self,
13458                            request: tonic::Request<super::RemoveTeamMembersRequest>,
13459                        ) -> Self::Future {
13460                            let inner = Arc::clone(&self.0);
13461                            let fut = async move {
13462                                <T as TeamService>::remove_team_members(&inner, request)
13463                                    .await
13464                            };
13465                            Box::pin(fut)
13466                        }
13467                    }
13468                    let accept_compression_encodings = self.accept_compression_encodings;
13469                    let send_compression_encodings = self.send_compression_encodings;
13470                    let max_decoding_message_size = self.max_decoding_message_size;
13471                    let max_encoding_message_size = self.max_encoding_message_size;
13472                    let inner = self.inner.clone();
13473                    let fut = async move {
13474                        let method = RemoveTeamMembersSvc(inner);
13475                        let codec = tonic_prost::ProstCodec::default();
13476                        let mut grpc = tonic::server::Grpc::new(codec)
13477                            .apply_compression_config(
13478                                accept_compression_encodings,
13479                                send_compression_encodings,
13480                            )
13481                            .apply_max_message_size_config(
13482                                max_decoding_message_size,
13483                                max_encoding_message_size,
13484                            );
13485                        let res = grpc.unary(method, req).await;
13486                        Ok(res)
13487                    };
13488                    Box::pin(fut)
13489                }
13490                "/pidgr.v1.TeamService/ListTeamMembers" => {
13491                    #[allow(non_camel_case_types)]
13492                    struct ListTeamMembersSvc<T: TeamService>(pub Arc<T>);
13493                    impl<
13494                        T: TeamService,
13495                    > tonic::server::UnaryService<super::ListTeamMembersRequest>
13496                    for ListTeamMembersSvc<T> {
13497                        type Response = super::ListTeamMembersResponse;
13498                        type Future = BoxFuture<
13499                            tonic::Response<Self::Response>,
13500                            tonic::Status,
13501                        >;
13502                        fn call(
13503                            &mut self,
13504                            request: tonic::Request<super::ListTeamMembersRequest>,
13505                        ) -> Self::Future {
13506                            let inner = Arc::clone(&self.0);
13507                            let fut = async move {
13508                                <T as TeamService>::list_team_members(&inner, request).await
13509                            };
13510                            Box::pin(fut)
13511                        }
13512                    }
13513                    let accept_compression_encodings = self.accept_compression_encodings;
13514                    let send_compression_encodings = self.send_compression_encodings;
13515                    let max_decoding_message_size = self.max_decoding_message_size;
13516                    let max_encoding_message_size = self.max_encoding_message_size;
13517                    let inner = self.inner.clone();
13518                    let fut = async move {
13519                        let method = ListTeamMembersSvc(inner);
13520                        let codec = tonic_prost::ProstCodec::default();
13521                        let mut grpc = tonic::server::Grpc::new(codec)
13522                            .apply_compression_config(
13523                                accept_compression_encodings,
13524                                send_compression_encodings,
13525                            )
13526                            .apply_max_message_size_config(
13527                                max_decoding_message_size,
13528                                max_encoding_message_size,
13529                            );
13530                        let res = grpc.unary(method, req).await;
13531                        Ok(res)
13532                    };
13533                    Box::pin(fut)
13534                }
13535                _ => {
13536                    Box::pin(async move {
13537                        let mut response = http::Response::new(
13538                            tonic::body::Body::default(),
13539                        );
13540                        let headers = response.headers_mut();
13541                        headers
13542                            .insert(
13543                                tonic::Status::GRPC_STATUS,
13544                                (tonic::Code::Unimplemented as i32).into(),
13545                            );
13546                        headers
13547                            .insert(
13548                                http::header::CONTENT_TYPE,
13549                                tonic::metadata::GRPC_CONTENT_TYPE,
13550                            );
13551                        Ok(response)
13552                    })
13553                }
13554            }
13555        }
13556    }
13557    impl<T> Clone for TeamServiceServer<T> {
13558        fn clone(&self) -> Self {
13559            let inner = self.inner.clone();
13560            Self {
13561                inner,
13562                accept_compression_encodings: self.accept_compression_encodings,
13563                send_compression_encodings: self.send_compression_encodings,
13564                max_decoding_message_size: self.max_decoding_message_size,
13565                max_encoding_message_size: self.max_encoding_message_size,
13566            }
13567        }
13568    }
13569    /// Generated gRPC service name
13570    pub const SERVICE_NAME: &str = "pidgr.v1.TeamService";
13571    impl<T> tonic::server::NamedService for TeamServiceServer<T> {
13572        const NAME: &'static str = SERVICE_NAME;
13573    }
13574}
13575/// Generated client implementations.
13576pub mod template_service_client {
13577    #![allow(
13578        unused_variables,
13579        dead_code,
13580        missing_docs,
13581        clippy::wildcard_imports,
13582        clippy::let_unit_value,
13583    )]
13584    use tonic::codegen::*;
13585    use tonic::codegen::http::Uri;
13586    /** Manages versioned message templates used by campaigns.
13587 Templates are append-only — updates create new versions while preserving history.
13588*/
13589    #[derive(Debug, Clone)]
13590    pub struct TemplateServiceClient<T> {
13591        inner: tonic::client::Grpc<T>,
13592    }
13593    impl TemplateServiceClient<tonic::transport::Channel> {
13594        /// Attempt to create a new client by connecting to a given endpoint.
13595        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
13596        where
13597            D: TryInto<tonic::transport::Endpoint>,
13598            D::Error: Into<StdError>,
13599        {
13600            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
13601            Ok(Self::new(conn))
13602        }
13603    }
13604    impl<T> TemplateServiceClient<T>
13605    where
13606        T: tonic::client::GrpcService<tonic::body::Body>,
13607        T::Error: Into<StdError>,
13608        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
13609        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
13610    {
13611        pub fn new(inner: T) -> Self {
13612            let inner = tonic::client::Grpc::new(inner);
13613            Self { inner }
13614        }
13615        pub fn with_origin(inner: T, origin: Uri) -> Self {
13616            let inner = tonic::client::Grpc::with_origin(inner, origin);
13617            Self { inner }
13618        }
13619        pub fn with_interceptor<F>(
13620            inner: T,
13621            interceptor: F,
13622        ) -> TemplateServiceClient<InterceptedService<T, F>>
13623        where
13624            F: tonic::service::Interceptor,
13625            T::ResponseBody: Default,
13626            T: tonic::codegen::Service<
13627                http::Request<tonic::body::Body>,
13628                Response = http::Response<
13629                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
13630                >,
13631            >,
13632            <T as tonic::codegen::Service<
13633                http::Request<tonic::body::Body>,
13634            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
13635        {
13636            TemplateServiceClient::new(InterceptedService::new(inner, interceptor))
13637        }
13638        /// Compress requests with the given encoding.
13639        ///
13640        /// This requires the server to support it otherwise it might respond with an
13641        /// error.
13642        #[must_use]
13643        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13644            self.inner = self.inner.send_compressed(encoding);
13645            self
13646        }
13647        /// Enable decompressing responses.
13648        #[must_use]
13649        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13650            self.inner = self.inner.accept_compressed(encoding);
13651            self
13652        }
13653        /// Limits the maximum size of a decoded message.
13654        ///
13655        /// Default: `4MB`
13656        #[must_use]
13657        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13658            self.inner = self.inner.max_decoding_message_size(limit);
13659            self
13660        }
13661        /// Limits the maximum size of an encoded message.
13662        ///
13663        /// Default: `usize::MAX`
13664        #[must_use]
13665        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13666            self.inner = self.inner.max_encoding_message_size(limit);
13667            self
13668        }
13669        /** Create a new template with a body and variable definitions.
13670 Authorization: Requires MANAGER+ role.
13671*/
13672        pub async fn create_template(
13673            &mut self,
13674            request: impl tonic::IntoRequest<super::CreateTemplateRequest>,
13675        ) -> std::result::Result<
13676            tonic::Response<super::CreateTemplateResponse>,
13677            tonic::Status,
13678        > {
13679            self.inner
13680                .ready()
13681                .await
13682                .map_err(|e| {
13683                    tonic::Status::unknown(
13684                        format!("Service was not ready: {}", e.into()),
13685                    )
13686                })?;
13687            let codec = tonic_prost::ProstCodec::default();
13688            let path = http::uri::PathAndQuery::from_static(
13689                "/pidgr.v1.TemplateService/CreateTemplate",
13690            );
13691            let mut req = request.into_request();
13692            req.extensions_mut()
13693                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "CreateTemplate"));
13694            self.inner.unary(req, path, codec).await
13695        }
13696        /** Update an existing template, creating a new version.
13697 Authorization: Requires MANAGER+ role.
13698*/
13699        pub async fn update_template(
13700            &mut self,
13701            request: impl tonic::IntoRequest<super::UpdateTemplateRequest>,
13702        ) -> std::result::Result<
13703            tonic::Response<super::UpdateTemplateResponse>,
13704            tonic::Status,
13705        > {
13706            self.inner
13707                .ready()
13708                .await
13709                .map_err(|e| {
13710                    tonic::Status::unknown(
13711                        format!("Service was not ready: {}", e.into()),
13712                    )
13713                })?;
13714            let codec = tonic_prost::ProstCodec::default();
13715            let path = http::uri::PathAndQuery::from_static(
13716                "/pidgr.v1.TemplateService/UpdateTemplate",
13717            );
13718            let mut req = request.into_request();
13719            req.extensions_mut()
13720                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "UpdateTemplate"));
13721            self.inner.unary(req, path, codec).await
13722        }
13723        /** Retrieve a specific template by ID and optional version.
13724 Authorization: Authenticated user within the organization.
13725*/
13726        pub async fn get_template(
13727            &mut self,
13728            request: impl tonic::IntoRequest<super::GetTemplateRequest>,
13729        ) -> std::result::Result<
13730            tonic::Response<super::GetTemplateResponse>,
13731            tonic::Status,
13732        > {
13733            self.inner
13734                .ready()
13735                .await
13736                .map_err(|e| {
13737                    tonic::Status::unknown(
13738                        format!("Service was not ready: {}", e.into()),
13739                    )
13740                })?;
13741            let codec = tonic_prost::ProstCodec::default();
13742            let path = http::uri::PathAndQuery::from_static(
13743                "/pidgr.v1.TemplateService/GetTemplate",
13744            );
13745            let mut req = request.into_request();
13746            req.extensions_mut()
13747                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "GetTemplate"));
13748            self.inner.unary(req, path, codec).await
13749        }
13750        /** List all templates for the organization with pagination.
13751 Authorization: Authenticated user within the organization.
13752*/
13753        pub async fn list_templates(
13754            &mut self,
13755            request: impl tonic::IntoRequest<super::ListTemplatesRequest>,
13756        ) -> std::result::Result<
13757            tonic::Response<super::ListTemplatesResponse>,
13758            tonic::Status,
13759        > {
13760            self.inner
13761                .ready()
13762                .await
13763                .map_err(|e| {
13764                    tonic::Status::unknown(
13765                        format!("Service was not ready: {}", e.into()),
13766                    )
13767                })?;
13768            let codec = tonic_prost::ProstCodec::default();
13769            let path = http::uri::PathAndQuery::from_static(
13770                "/pidgr.v1.TemplateService/ListTemplates",
13771            );
13772            let mut req = request.into_request();
13773            req.extensions_mut()
13774                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "ListTemplates"));
13775            self.inner.unary(req, path, codec).await
13776        }
13777        /** Create a locale-specific translation of a template.
13778 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
13779*/
13780        pub async fn create_template_translation(
13781            &mut self,
13782            request: impl tonic::IntoRequest<super::CreateTemplateTranslationRequest>,
13783        ) -> std::result::Result<
13784            tonic::Response<super::CreateTemplateTranslationResponse>,
13785            tonic::Status,
13786        > {
13787            self.inner
13788                .ready()
13789                .await
13790                .map_err(|e| {
13791                    tonic::Status::unknown(
13792                        format!("Service was not ready: {}", e.into()),
13793                    )
13794                })?;
13795            let codec = tonic_prost::ProstCodec::default();
13796            let path = http::uri::PathAndQuery::from_static(
13797                "/pidgr.v1.TemplateService/CreateTemplateTranslation",
13798            );
13799            let mut req = request.into_request();
13800            req.extensions_mut()
13801                .insert(
13802                    GrpcMethod::new(
13803                        "pidgr.v1.TemplateService",
13804                        "CreateTemplateTranslation",
13805                    ),
13806                );
13807            self.inner.unary(req, path, codec).await
13808        }
13809        /** Update an existing template translation.
13810 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
13811*/
13812        pub async fn update_template_translation(
13813            &mut self,
13814            request: impl tonic::IntoRequest<super::UpdateTemplateTranslationRequest>,
13815        ) -> std::result::Result<
13816            tonic::Response<super::UpdateTemplateTranslationResponse>,
13817            tonic::Status,
13818        > {
13819            self.inner
13820                .ready()
13821                .await
13822                .map_err(|e| {
13823                    tonic::Status::unknown(
13824                        format!("Service was not ready: {}", e.into()),
13825                    )
13826                })?;
13827            let codec = tonic_prost::ProstCodec::default();
13828            let path = http::uri::PathAndQuery::from_static(
13829                "/pidgr.v1.TemplateService/UpdateTemplateTranslation",
13830            );
13831            let mut req = request.into_request();
13832            req.extensions_mut()
13833                .insert(
13834                    GrpcMethod::new(
13835                        "pidgr.v1.TemplateService",
13836                        "UpdateTemplateTranslation",
13837                    ),
13838                );
13839            self.inner.unary(req, path, codec).await
13840        }
13841        /** List all translations for a template version.
13842 Authorization: Requires PERMISSION_TEMPLATES_READ.
13843*/
13844        pub async fn list_template_translations(
13845            &mut self,
13846            request: impl tonic::IntoRequest<super::ListTemplateTranslationsRequest>,
13847        ) -> std::result::Result<
13848            tonic::Response<super::ListTemplateTranslationsResponse>,
13849            tonic::Status,
13850        > {
13851            self.inner
13852                .ready()
13853                .await
13854                .map_err(|e| {
13855                    tonic::Status::unknown(
13856                        format!("Service was not ready: {}", e.into()),
13857                    )
13858                })?;
13859            let codec = tonic_prost::ProstCodec::default();
13860            let path = http::uri::PathAndQuery::from_static(
13861                "/pidgr.v1.TemplateService/ListTemplateTranslations",
13862            );
13863            let mut req = request.into_request();
13864            req.extensions_mut()
13865                .insert(
13866                    GrpcMethod::new(
13867                        "pidgr.v1.TemplateService",
13868                        "ListTemplateTranslations",
13869                    ),
13870                );
13871            self.inner.unary(req, path, codec).await
13872        }
13873        /** Approve a template translation for use in campaigns.
13874 Authorization: Requires PERMISSION_TEMPLATES_REVIEW.
13875*/
13876        pub async fn approve_template_translation(
13877            &mut self,
13878            request: impl tonic::IntoRequest<super::ApproveTemplateTranslationRequest>,
13879        ) -> std::result::Result<
13880            tonic::Response<super::ApproveTemplateTranslationResponse>,
13881            tonic::Status,
13882        > {
13883            self.inner
13884                .ready()
13885                .await
13886                .map_err(|e| {
13887                    tonic::Status::unknown(
13888                        format!("Service was not ready: {}", e.into()),
13889                    )
13890                })?;
13891            let codec = tonic_prost::ProstCodec::default();
13892            let path = http::uri::PathAndQuery::from_static(
13893                "/pidgr.v1.TemplateService/ApproveTemplateTranslation",
13894            );
13895            let mut req = request.into_request();
13896            req.extensions_mut()
13897                .insert(
13898                    GrpcMethod::new(
13899                        "pidgr.v1.TemplateService",
13900                        "ApproveTemplateTranslation",
13901                    ),
13902                );
13903            self.inner.unary(req, path, codec).await
13904        }
13905    }
13906}
13907/// Generated server implementations.
13908pub mod template_service_server {
13909    #![allow(
13910        unused_variables,
13911        dead_code,
13912        missing_docs,
13913        clippy::wildcard_imports,
13914        clippy::let_unit_value,
13915    )]
13916    use tonic::codegen::*;
13917    /// Generated trait containing gRPC methods that should be implemented for use with TemplateServiceServer.
13918    #[async_trait]
13919    pub trait TemplateService: std::marker::Send + std::marker::Sync + 'static {
13920        /** Create a new template with a body and variable definitions.
13921 Authorization: Requires MANAGER+ role.
13922*/
13923        async fn create_template(
13924            &self,
13925            request: tonic::Request<super::CreateTemplateRequest>,
13926        ) -> std::result::Result<
13927            tonic::Response<super::CreateTemplateResponse>,
13928            tonic::Status,
13929        >;
13930        /** Update an existing template, creating a new version.
13931 Authorization: Requires MANAGER+ role.
13932*/
13933        async fn update_template(
13934            &self,
13935            request: tonic::Request<super::UpdateTemplateRequest>,
13936        ) -> std::result::Result<
13937            tonic::Response<super::UpdateTemplateResponse>,
13938            tonic::Status,
13939        >;
13940        /** Retrieve a specific template by ID and optional version.
13941 Authorization: Authenticated user within the organization.
13942*/
13943        async fn get_template(
13944            &self,
13945            request: tonic::Request<super::GetTemplateRequest>,
13946        ) -> std::result::Result<
13947            tonic::Response<super::GetTemplateResponse>,
13948            tonic::Status,
13949        >;
13950        /** List all templates for the organization with pagination.
13951 Authorization: Authenticated user within the organization.
13952*/
13953        async fn list_templates(
13954            &self,
13955            request: tonic::Request<super::ListTemplatesRequest>,
13956        ) -> std::result::Result<
13957            tonic::Response<super::ListTemplatesResponse>,
13958            tonic::Status,
13959        >;
13960        /** Create a locale-specific translation of a template.
13961 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
13962*/
13963        async fn create_template_translation(
13964            &self,
13965            request: tonic::Request<super::CreateTemplateTranslationRequest>,
13966        ) -> std::result::Result<
13967            tonic::Response<super::CreateTemplateTranslationResponse>,
13968            tonic::Status,
13969        >;
13970        /** Update an existing template translation.
13971 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
13972*/
13973        async fn update_template_translation(
13974            &self,
13975            request: tonic::Request<super::UpdateTemplateTranslationRequest>,
13976        ) -> std::result::Result<
13977            tonic::Response<super::UpdateTemplateTranslationResponse>,
13978            tonic::Status,
13979        >;
13980        /** List all translations for a template version.
13981 Authorization: Requires PERMISSION_TEMPLATES_READ.
13982*/
13983        async fn list_template_translations(
13984            &self,
13985            request: tonic::Request<super::ListTemplateTranslationsRequest>,
13986        ) -> std::result::Result<
13987            tonic::Response<super::ListTemplateTranslationsResponse>,
13988            tonic::Status,
13989        >;
13990        /** Approve a template translation for use in campaigns.
13991 Authorization: Requires PERMISSION_TEMPLATES_REVIEW.
13992*/
13993        async fn approve_template_translation(
13994            &self,
13995            request: tonic::Request<super::ApproveTemplateTranslationRequest>,
13996        ) -> std::result::Result<
13997            tonic::Response<super::ApproveTemplateTranslationResponse>,
13998            tonic::Status,
13999        >;
14000    }
14001    /** Manages versioned message templates used by campaigns.
14002 Templates are append-only — updates create new versions while preserving history.
14003*/
14004    #[derive(Debug)]
14005    pub struct TemplateServiceServer<T> {
14006        inner: Arc<T>,
14007        accept_compression_encodings: EnabledCompressionEncodings,
14008        send_compression_encodings: EnabledCompressionEncodings,
14009        max_decoding_message_size: Option<usize>,
14010        max_encoding_message_size: Option<usize>,
14011    }
14012    impl<T> TemplateServiceServer<T> {
14013        pub fn new(inner: T) -> Self {
14014            Self::from_arc(Arc::new(inner))
14015        }
14016        pub fn from_arc(inner: Arc<T>) -> Self {
14017            Self {
14018                inner,
14019                accept_compression_encodings: Default::default(),
14020                send_compression_encodings: Default::default(),
14021                max_decoding_message_size: None,
14022                max_encoding_message_size: None,
14023            }
14024        }
14025        pub fn with_interceptor<F>(
14026            inner: T,
14027            interceptor: F,
14028        ) -> InterceptedService<Self, F>
14029        where
14030            F: tonic::service::Interceptor,
14031        {
14032            InterceptedService::new(Self::new(inner), interceptor)
14033        }
14034        /// Enable decompressing requests with the given encoding.
14035        #[must_use]
14036        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
14037            self.accept_compression_encodings.enable(encoding);
14038            self
14039        }
14040        /// Compress responses with the given encoding, if the client supports it.
14041        #[must_use]
14042        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
14043            self.send_compression_encodings.enable(encoding);
14044            self
14045        }
14046        /// Limits the maximum size of a decoded message.
14047        ///
14048        /// Default: `4MB`
14049        #[must_use]
14050        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
14051            self.max_decoding_message_size = Some(limit);
14052            self
14053        }
14054        /// Limits the maximum size of an encoded message.
14055        ///
14056        /// Default: `usize::MAX`
14057        #[must_use]
14058        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
14059            self.max_encoding_message_size = Some(limit);
14060            self
14061        }
14062    }
14063    impl<T, B> tonic::codegen::Service<http::Request<B>> for TemplateServiceServer<T>
14064    where
14065        T: TemplateService,
14066        B: Body + std::marker::Send + 'static,
14067        B::Error: Into<StdError> + std::marker::Send + 'static,
14068    {
14069        type Response = http::Response<tonic::body::Body>;
14070        type Error = std::convert::Infallible;
14071        type Future = BoxFuture<Self::Response, Self::Error>;
14072        fn poll_ready(
14073            &mut self,
14074            _cx: &mut Context<'_>,
14075        ) -> Poll<std::result::Result<(), Self::Error>> {
14076            Poll::Ready(Ok(()))
14077        }
14078        fn call(&mut self, req: http::Request<B>) -> Self::Future {
14079            match req.uri().path() {
14080                "/pidgr.v1.TemplateService/CreateTemplate" => {
14081                    #[allow(non_camel_case_types)]
14082                    struct CreateTemplateSvc<T: TemplateService>(pub Arc<T>);
14083                    impl<
14084                        T: TemplateService,
14085                    > tonic::server::UnaryService<super::CreateTemplateRequest>
14086                    for CreateTemplateSvc<T> {
14087                        type Response = super::CreateTemplateResponse;
14088                        type Future = BoxFuture<
14089                            tonic::Response<Self::Response>,
14090                            tonic::Status,
14091                        >;
14092                        fn call(
14093                            &mut self,
14094                            request: tonic::Request<super::CreateTemplateRequest>,
14095                        ) -> Self::Future {
14096                            let inner = Arc::clone(&self.0);
14097                            let fut = async move {
14098                                <T as TemplateService>::create_template(&inner, request)
14099                                    .await
14100                            };
14101                            Box::pin(fut)
14102                        }
14103                    }
14104                    let accept_compression_encodings = self.accept_compression_encodings;
14105                    let send_compression_encodings = self.send_compression_encodings;
14106                    let max_decoding_message_size = self.max_decoding_message_size;
14107                    let max_encoding_message_size = self.max_encoding_message_size;
14108                    let inner = self.inner.clone();
14109                    let fut = async move {
14110                        let method = CreateTemplateSvc(inner);
14111                        let codec = tonic_prost::ProstCodec::default();
14112                        let mut grpc = tonic::server::Grpc::new(codec)
14113                            .apply_compression_config(
14114                                accept_compression_encodings,
14115                                send_compression_encodings,
14116                            )
14117                            .apply_max_message_size_config(
14118                                max_decoding_message_size,
14119                                max_encoding_message_size,
14120                            );
14121                        let res = grpc.unary(method, req).await;
14122                        Ok(res)
14123                    };
14124                    Box::pin(fut)
14125                }
14126                "/pidgr.v1.TemplateService/UpdateTemplate" => {
14127                    #[allow(non_camel_case_types)]
14128                    struct UpdateTemplateSvc<T: TemplateService>(pub Arc<T>);
14129                    impl<
14130                        T: TemplateService,
14131                    > tonic::server::UnaryService<super::UpdateTemplateRequest>
14132                    for UpdateTemplateSvc<T> {
14133                        type Response = super::UpdateTemplateResponse;
14134                        type Future = BoxFuture<
14135                            tonic::Response<Self::Response>,
14136                            tonic::Status,
14137                        >;
14138                        fn call(
14139                            &mut self,
14140                            request: tonic::Request<super::UpdateTemplateRequest>,
14141                        ) -> Self::Future {
14142                            let inner = Arc::clone(&self.0);
14143                            let fut = async move {
14144                                <T as TemplateService>::update_template(&inner, request)
14145                                    .await
14146                            };
14147                            Box::pin(fut)
14148                        }
14149                    }
14150                    let accept_compression_encodings = self.accept_compression_encodings;
14151                    let send_compression_encodings = self.send_compression_encodings;
14152                    let max_decoding_message_size = self.max_decoding_message_size;
14153                    let max_encoding_message_size = self.max_encoding_message_size;
14154                    let inner = self.inner.clone();
14155                    let fut = async move {
14156                        let method = UpdateTemplateSvc(inner);
14157                        let codec = tonic_prost::ProstCodec::default();
14158                        let mut grpc = tonic::server::Grpc::new(codec)
14159                            .apply_compression_config(
14160                                accept_compression_encodings,
14161                                send_compression_encodings,
14162                            )
14163                            .apply_max_message_size_config(
14164                                max_decoding_message_size,
14165                                max_encoding_message_size,
14166                            );
14167                        let res = grpc.unary(method, req).await;
14168                        Ok(res)
14169                    };
14170                    Box::pin(fut)
14171                }
14172                "/pidgr.v1.TemplateService/GetTemplate" => {
14173                    #[allow(non_camel_case_types)]
14174                    struct GetTemplateSvc<T: TemplateService>(pub Arc<T>);
14175                    impl<
14176                        T: TemplateService,
14177                    > tonic::server::UnaryService<super::GetTemplateRequest>
14178                    for GetTemplateSvc<T> {
14179                        type Response = super::GetTemplateResponse;
14180                        type Future = BoxFuture<
14181                            tonic::Response<Self::Response>,
14182                            tonic::Status,
14183                        >;
14184                        fn call(
14185                            &mut self,
14186                            request: tonic::Request<super::GetTemplateRequest>,
14187                        ) -> Self::Future {
14188                            let inner = Arc::clone(&self.0);
14189                            let fut = async move {
14190                                <T as TemplateService>::get_template(&inner, request).await
14191                            };
14192                            Box::pin(fut)
14193                        }
14194                    }
14195                    let accept_compression_encodings = self.accept_compression_encodings;
14196                    let send_compression_encodings = self.send_compression_encodings;
14197                    let max_decoding_message_size = self.max_decoding_message_size;
14198                    let max_encoding_message_size = self.max_encoding_message_size;
14199                    let inner = self.inner.clone();
14200                    let fut = async move {
14201                        let method = GetTemplateSvc(inner);
14202                        let codec = tonic_prost::ProstCodec::default();
14203                        let mut grpc = tonic::server::Grpc::new(codec)
14204                            .apply_compression_config(
14205                                accept_compression_encodings,
14206                                send_compression_encodings,
14207                            )
14208                            .apply_max_message_size_config(
14209                                max_decoding_message_size,
14210                                max_encoding_message_size,
14211                            );
14212                        let res = grpc.unary(method, req).await;
14213                        Ok(res)
14214                    };
14215                    Box::pin(fut)
14216                }
14217                "/pidgr.v1.TemplateService/ListTemplates" => {
14218                    #[allow(non_camel_case_types)]
14219                    struct ListTemplatesSvc<T: TemplateService>(pub Arc<T>);
14220                    impl<
14221                        T: TemplateService,
14222                    > tonic::server::UnaryService<super::ListTemplatesRequest>
14223                    for ListTemplatesSvc<T> {
14224                        type Response = super::ListTemplatesResponse;
14225                        type Future = BoxFuture<
14226                            tonic::Response<Self::Response>,
14227                            tonic::Status,
14228                        >;
14229                        fn call(
14230                            &mut self,
14231                            request: tonic::Request<super::ListTemplatesRequest>,
14232                        ) -> Self::Future {
14233                            let inner = Arc::clone(&self.0);
14234                            let fut = async move {
14235                                <T as TemplateService>::list_templates(&inner, request)
14236                                    .await
14237                            };
14238                            Box::pin(fut)
14239                        }
14240                    }
14241                    let accept_compression_encodings = self.accept_compression_encodings;
14242                    let send_compression_encodings = self.send_compression_encodings;
14243                    let max_decoding_message_size = self.max_decoding_message_size;
14244                    let max_encoding_message_size = self.max_encoding_message_size;
14245                    let inner = self.inner.clone();
14246                    let fut = async move {
14247                        let method = ListTemplatesSvc(inner);
14248                        let codec = tonic_prost::ProstCodec::default();
14249                        let mut grpc = tonic::server::Grpc::new(codec)
14250                            .apply_compression_config(
14251                                accept_compression_encodings,
14252                                send_compression_encodings,
14253                            )
14254                            .apply_max_message_size_config(
14255                                max_decoding_message_size,
14256                                max_encoding_message_size,
14257                            );
14258                        let res = grpc.unary(method, req).await;
14259                        Ok(res)
14260                    };
14261                    Box::pin(fut)
14262                }
14263                "/pidgr.v1.TemplateService/CreateTemplateTranslation" => {
14264                    #[allow(non_camel_case_types)]
14265                    struct CreateTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
14266                    impl<
14267                        T: TemplateService,
14268                    > tonic::server::UnaryService<
14269                        super::CreateTemplateTranslationRequest,
14270                    > for CreateTemplateTranslationSvc<T> {
14271                        type Response = super::CreateTemplateTranslationResponse;
14272                        type Future = BoxFuture<
14273                            tonic::Response<Self::Response>,
14274                            tonic::Status,
14275                        >;
14276                        fn call(
14277                            &mut self,
14278                            request: tonic::Request<
14279                                super::CreateTemplateTranslationRequest,
14280                            >,
14281                        ) -> Self::Future {
14282                            let inner = Arc::clone(&self.0);
14283                            let fut = async move {
14284                                <T as TemplateService>::create_template_translation(
14285                                        &inner,
14286                                        request,
14287                                    )
14288                                    .await
14289                            };
14290                            Box::pin(fut)
14291                        }
14292                    }
14293                    let accept_compression_encodings = self.accept_compression_encodings;
14294                    let send_compression_encodings = self.send_compression_encodings;
14295                    let max_decoding_message_size = self.max_decoding_message_size;
14296                    let max_encoding_message_size = self.max_encoding_message_size;
14297                    let inner = self.inner.clone();
14298                    let fut = async move {
14299                        let method = CreateTemplateTranslationSvc(inner);
14300                        let codec = tonic_prost::ProstCodec::default();
14301                        let mut grpc = tonic::server::Grpc::new(codec)
14302                            .apply_compression_config(
14303                                accept_compression_encodings,
14304                                send_compression_encodings,
14305                            )
14306                            .apply_max_message_size_config(
14307                                max_decoding_message_size,
14308                                max_encoding_message_size,
14309                            );
14310                        let res = grpc.unary(method, req).await;
14311                        Ok(res)
14312                    };
14313                    Box::pin(fut)
14314                }
14315                "/pidgr.v1.TemplateService/UpdateTemplateTranslation" => {
14316                    #[allow(non_camel_case_types)]
14317                    struct UpdateTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
14318                    impl<
14319                        T: TemplateService,
14320                    > tonic::server::UnaryService<
14321                        super::UpdateTemplateTranslationRequest,
14322                    > for UpdateTemplateTranslationSvc<T> {
14323                        type Response = super::UpdateTemplateTranslationResponse;
14324                        type Future = BoxFuture<
14325                            tonic::Response<Self::Response>,
14326                            tonic::Status,
14327                        >;
14328                        fn call(
14329                            &mut self,
14330                            request: tonic::Request<
14331                                super::UpdateTemplateTranslationRequest,
14332                            >,
14333                        ) -> Self::Future {
14334                            let inner = Arc::clone(&self.0);
14335                            let fut = async move {
14336                                <T as TemplateService>::update_template_translation(
14337                                        &inner,
14338                                        request,
14339                                    )
14340                                    .await
14341                            };
14342                            Box::pin(fut)
14343                        }
14344                    }
14345                    let accept_compression_encodings = self.accept_compression_encodings;
14346                    let send_compression_encodings = self.send_compression_encodings;
14347                    let max_decoding_message_size = self.max_decoding_message_size;
14348                    let max_encoding_message_size = self.max_encoding_message_size;
14349                    let inner = self.inner.clone();
14350                    let fut = async move {
14351                        let method = UpdateTemplateTranslationSvc(inner);
14352                        let codec = tonic_prost::ProstCodec::default();
14353                        let mut grpc = tonic::server::Grpc::new(codec)
14354                            .apply_compression_config(
14355                                accept_compression_encodings,
14356                                send_compression_encodings,
14357                            )
14358                            .apply_max_message_size_config(
14359                                max_decoding_message_size,
14360                                max_encoding_message_size,
14361                            );
14362                        let res = grpc.unary(method, req).await;
14363                        Ok(res)
14364                    };
14365                    Box::pin(fut)
14366                }
14367                "/pidgr.v1.TemplateService/ListTemplateTranslations" => {
14368                    #[allow(non_camel_case_types)]
14369                    struct ListTemplateTranslationsSvc<T: TemplateService>(pub Arc<T>);
14370                    impl<
14371                        T: TemplateService,
14372                    > tonic::server::UnaryService<super::ListTemplateTranslationsRequest>
14373                    for ListTemplateTranslationsSvc<T> {
14374                        type Response = super::ListTemplateTranslationsResponse;
14375                        type Future = BoxFuture<
14376                            tonic::Response<Self::Response>,
14377                            tonic::Status,
14378                        >;
14379                        fn call(
14380                            &mut self,
14381                            request: tonic::Request<
14382                                super::ListTemplateTranslationsRequest,
14383                            >,
14384                        ) -> Self::Future {
14385                            let inner = Arc::clone(&self.0);
14386                            let fut = async move {
14387                                <T as TemplateService>::list_template_translations(
14388                                        &inner,
14389                                        request,
14390                                    )
14391                                    .await
14392                            };
14393                            Box::pin(fut)
14394                        }
14395                    }
14396                    let accept_compression_encodings = self.accept_compression_encodings;
14397                    let send_compression_encodings = self.send_compression_encodings;
14398                    let max_decoding_message_size = self.max_decoding_message_size;
14399                    let max_encoding_message_size = self.max_encoding_message_size;
14400                    let inner = self.inner.clone();
14401                    let fut = async move {
14402                        let method = ListTemplateTranslationsSvc(inner);
14403                        let codec = tonic_prost::ProstCodec::default();
14404                        let mut grpc = tonic::server::Grpc::new(codec)
14405                            .apply_compression_config(
14406                                accept_compression_encodings,
14407                                send_compression_encodings,
14408                            )
14409                            .apply_max_message_size_config(
14410                                max_decoding_message_size,
14411                                max_encoding_message_size,
14412                            );
14413                        let res = grpc.unary(method, req).await;
14414                        Ok(res)
14415                    };
14416                    Box::pin(fut)
14417                }
14418                "/pidgr.v1.TemplateService/ApproveTemplateTranslation" => {
14419                    #[allow(non_camel_case_types)]
14420                    struct ApproveTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
14421                    impl<
14422                        T: TemplateService,
14423                    > tonic::server::UnaryService<
14424                        super::ApproveTemplateTranslationRequest,
14425                    > for ApproveTemplateTranslationSvc<T> {
14426                        type Response = super::ApproveTemplateTranslationResponse;
14427                        type Future = BoxFuture<
14428                            tonic::Response<Self::Response>,
14429                            tonic::Status,
14430                        >;
14431                        fn call(
14432                            &mut self,
14433                            request: tonic::Request<
14434                                super::ApproveTemplateTranslationRequest,
14435                            >,
14436                        ) -> Self::Future {
14437                            let inner = Arc::clone(&self.0);
14438                            let fut = async move {
14439                                <T as TemplateService>::approve_template_translation(
14440                                        &inner,
14441                                        request,
14442                                    )
14443                                    .await
14444                            };
14445                            Box::pin(fut)
14446                        }
14447                    }
14448                    let accept_compression_encodings = self.accept_compression_encodings;
14449                    let send_compression_encodings = self.send_compression_encodings;
14450                    let max_decoding_message_size = self.max_decoding_message_size;
14451                    let max_encoding_message_size = self.max_encoding_message_size;
14452                    let inner = self.inner.clone();
14453                    let fut = async move {
14454                        let method = ApproveTemplateTranslationSvc(inner);
14455                        let codec = tonic_prost::ProstCodec::default();
14456                        let mut grpc = tonic::server::Grpc::new(codec)
14457                            .apply_compression_config(
14458                                accept_compression_encodings,
14459                                send_compression_encodings,
14460                            )
14461                            .apply_max_message_size_config(
14462                                max_decoding_message_size,
14463                                max_encoding_message_size,
14464                            );
14465                        let res = grpc.unary(method, req).await;
14466                        Ok(res)
14467                    };
14468                    Box::pin(fut)
14469                }
14470                _ => {
14471                    Box::pin(async move {
14472                        let mut response = http::Response::new(
14473                            tonic::body::Body::default(),
14474                        );
14475                        let headers = response.headers_mut();
14476                        headers
14477                            .insert(
14478                                tonic::Status::GRPC_STATUS,
14479                                (tonic::Code::Unimplemented as i32).into(),
14480                            );
14481                        headers
14482                            .insert(
14483                                http::header::CONTENT_TYPE,
14484                                tonic::metadata::GRPC_CONTENT_TYPE,
14485                            );
14486                        Ok(response)
14487                    })
14488                }
14489            }
14490        }
14491    }
14492    impl<T> Clone for TemplateServiceServer<T> {
14493        fn clone(&self) -> Self {
14494            let inner = self.inner.clone();
14495            Self {
14496                inner,
14497                accept_compression_encodings: self.accept_compression_encodings,
14498                send_compression_encodings: self.send_compression_encodings,
14499                max_decoding_message_size: self.max_decoding_message_size,
14500                max_encoding_message_size: self.max_encoding_message_size,
14501            }
14502        }
14503    }
14504    /// Generated gRPC service name
14505    pub const SERVICE_NAME: &str = "pidgr.v1.TemplateService";
14506    impl<T> tonic::server::NamedService for TemplateServiceServer<T> {
14507        const NAME: &'static str = SERVICE_NAME;
14508    }
14509}