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