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 channel_events_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    /** ChannelEventsService records third-party channel dispatch events into the
815 platform's append-only audit table. Intended for internal-service callers
816 behind a service-mesh / mTLS boundary; not exposed for end-user clients.
817*/
818    #[derive(Debug, Clone)]
819    pub struct ChannelEventsServiceClient<T> {
820        inner: tonic::client::Grpc<T>,
821    }
822    impl ChannelEventsServiceClient<tonic::transport::Channel> {
823        /// Attempt to create a new client by connecting to a given endpoint.
824        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
825        where
826            D: TryInto<tonic::transport::Endpoint>,
827            D::Error: Into<StdError>,
828        {
829            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
830            Ok(Self::new(conn))
831        }
832    }
833    impl<T> ChannelEventsServiceClient<T>
834    where
835        T: tonic::client::GrpcService<tonic::body::Body>,
836        T::Error: Into<StdError>,
837        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
838        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
839    {
840        pub fn new(inner: T) -> Self {
841            let inner = tonic::client::Grpc::new(inner);
842            Self { inner }
843        }
844        pub fn with_origin(inner: T, origin: Uri) -> Self {
845            let inner = tonic::client::Grpc::with_origin(inner, origin);
846            Self { inner }
847        }
848        pub fn with_interceptor<F>(
849            inner: T,
850            interceptor: F,
851        ) -> ChannelEventsServiceClient<InterceptedService<T, F>>
852        where
853            F: tonic::service::Interceptor,
854            T::ResponseBody: Default,
855            T: tonic::codegen::Service<
856                http::Request<tonic::body::Body>,
857                Response = http::Response<
858                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
859                >,
860            >,
861            <T as tonic::codegen::Service<
862                http::Request<tonic::body::Body>,
863            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
864        {
865            ChannelEventsServiceClient::new(InterceptedService::new(inner, interceptor))
866        }
867        /// Compress requests with the given encoding.
868        ///
869        /// This requires the server to support it otherwise it might respond with an
870        /// error.
871        #[must_use]
872        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
873            self.inner = self.inner.send_compressed(encoding);
874            self
875        }
876        /// Enable decompressing responses.
877        #[must_use]
878        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
879            self.inner = self.inner.accept_compressed(encoding);
880            self
881        }
882        /// Limits the maximum size of a decoded message.
883        ///
884        /// Default: `4MB`
885        #[must_use]
886        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
887            self.inner = self.inner.max_decoding_message_size(limit);
888            self
889        }
890        /// Limits the maximum size of an encoded message.
891        ///
892        /// Default: `usize::MAX`
893        #[must_use]
894        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
895            self.inner = self.inner.max_encoding_message_size(limit);
896            self
897        }
898        /** Record a single channel event. Returns accepted=false reason="duplicate"
899 when the partial unique index rejects (caller treats as already-recorded,
900 not as an error).
901*/
902        pub async fn record_channel_event(
903            &mut self,
904            request: impl tonic::IntoRequest<super::RecordChannelEventRequest>,
905        ) -> std::result::Result<
906            tonic::Response<super::RecordChannelEventResponse>,
907            tonic::Status,
908        > {
909            self.inner
910                .ready()
911                .await
912                .map_err(|e| {
913                    tonic::Status::unknown(
914                        format!("Service was not ready: {}", e.into()),
915                    )
916                })?;
917            let codec = tonic_prost::ProstCodec::default();
918            let path = http::uri::PathAndQuery::from_static(
919                "/pidgr.v1.ChannelEventsService/RecordChannelEvent",
920            );
921            let mut req = request.into_request();
922            req.extensions_mut()
923                .insert(
924                    GrpcMethod::new(
925                        "pidgr.v1.ChannelEventsService",
926                        "RecordChannelEvent",
927                    ),
928                );
929            self.inner.unary(req, path, codec).await
930        }
931        /** Record N events in one round-trip. Used by webhook ingress when a
932 provider delivers multiple state transitions in one payload (e.g. a
933 batched delivery report). Best-effort per-row.
934*/
935        pub async fn record_channel_event_batch(
936            &mut self,
937            request: impl tonic::IntoRequest<super::RecordChannelEventBatchRequest>,
938        ) -> std::result::Result<
939            tonic::Response<super::RecordChannelEventBatchResponse>,
940            tonic::Status,
941        > {
942            self.inner
943                .ready()
944                .await
945                .map_err(|e| {
946                    tonic::Status::unknown(
947                        format!("Service was not ready: {}", e.into()),
948                    )
949                })?;
950            let codec = tonic_prost::ProstCodec::default();
951            let path = http::uri::PathAndQuery::from_static(
952                "/pidgr.v1.ChannelEventsService/RecordChannelEventBatch",
953            );
954            let mut req = request.into_request();
955            req.extensions_mut()
956                .insert(
957                    GrpcMethod::new(
958                        "pidgr.v1.ChannelEventsService",
959                        "RecordChannelEventBatch",
960                    ),
961                );
962            self.inner.unary(req, path, codec).await
963        }
964    }
965}
966/// Generated server implementations.
967pub mod channel_events_service_server {
968    #![allow(
969        unused_variables,
970        dead_code,
971        missing_docs,
972        clippy::wildcard_imports,
973        clippy::let_unit_value,
974    )]
975    use tonic::codegen::*;
976    /// Generated trait containing gRPC methods that should be implemented for use with ChannelEventsServiceServer.
977    #[async_trait]
978    pub trait ChannelEventsService: std::marker::Send + std::marker::Sync + 'static {
979        /** Record a single channel event. Returns accepted=false reason="duplicate"
980 when the partial unique index rejects (caller treats as already-recorded,
981 not as an error).
982*/
983        async fn record_channel_event(
984            &self,
985            request: tonic::Request<super::RecordChannelEventRequest>,
986        ) -> std::result::Result<
987            tonic::Response<super::RecordChannelEventResponse>,
988            tonic::Status,
989        >;
990        /** Record N events in one round-trip. Used by webhook ingress when a
991 provider delivers multiple state transitions in one payload (e.g. a
992 batched delivery report). Best-effort per-row.
993*/
994        async fn record_channel_event_batch(
995            &self,
996            request: tonic::Request<super::RecordChannelEventBatchRequest>,
997        ) -> std::result::Result<
998            tonic::Response<super::RecordChannelEventBatchResponse>,
999            tonic::Status,
1000        >;
1001    }
1002    /** ChannelEventsService records third-party channel dispatch events into the
1003 platform's append-only audit table. Intended for internal-service callers
1004 behind a service-mesh / mTLS boundary; not exposed for end-user clients.
1005*/
1006    #[derive(Debug)]
1007    pub struct ChannelEventsServiceServer<T> {
1008        inner: Arc<T>,
1009        accept_compression_encodings: EnabledCompressionEncodings,
1010        send_compression_encodings: EnabledCompressionEncodings,
1011        max_decoding_message_size: Option<usize>,
1012        max_encoding_message_size: Option<usize>,
1013    }
1014    impl<T> ChannelEventsServiceServer<T> {
1015        pub fn new(inner: T) -> Self {
1016            Self::from_arc(Arc::new(inner))
1017        }
1018        pub fn from_arc(inner: Arc<T>) -> Self {
1019            Self {
1020                inner,
1021                accept_compression_encodings: Default::default(),
1022                send_compression_encodings: Default::default(),
1023                max_decoding_message_size: None,
1024                max_encoding_message_size: None,
1025            }
1026        }
1027        pub fn with_interceptor<F>(
1028            inner: T,
1029            interceptor: F,
1030        ) -> InterceptedService<Self, F>
1031        where
1032            F: tonic::service::Interceptor,
1033        {
1034            InterceptedService::new(Self::new(inner), interceptor)
1035        }
1036        /// Enable decompressing requests with the given encoding.
1037        #[must_use]
1038        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1039            self.accept_compression_encodings.enable(encoding);
1040            self
1041        }
1042        /// Compress responses with the given encoding, if the client supports it.
1043        #[must_use]
1044        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1045            self.send_compression_encodings.enable(encoding);
1046            self
1047        }
1048        /// Limits the maximum size of a decoded message.
1049        ///
1050        /// Default: `4MB`
1051        #[must_use]
1052        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1053            self.max_decoding_message_size = Some(limit);
1054            self
1055        }
1056        /// Limits the maximum size of an encoded message.
1057        ///
1058        /// Default: `usize::MAX`
1059        #[must_use]
1060        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1061            self.max_encoding_message_size = Some(limit);
1062            self
1063        }
1064    }
1065    impl<T, B> tonic::codegen::Service<http::Request<B>>
1066    for ChannelEventsServiceServer<T>
1067    where
1068        T: ChannelEventsService,
1069        B: Body + std::marker::Send + 'static,
1070        B::Error: Into<StdError> + std::marker::Send + 'static,
1071    {
1072        type Response = http::Response<tonic::body::Body>;
1073        type Error = std::convert::Infallible;
1074        type Future = BoxFuture<Self::Response, Self::Error>;
1075        fn poll_ready(
1076            &mut self,
1077            _cx: &mut Context<'_>,
1078        ) -> Poll<std::result::Result<(), Self::Error>> {
1079            Poll::Ready(Ok(()))
1080        }
1081        fn call(&mut self, req: http::Request<B>) -> Self::Future {
1082            match req.uri().path() {
1083                "/pidgr.v1.ChannelEventsService/RecordChannelEvent" => {
1084                    #[allow(non_camel_case_types)]
1085                    struct RecordChannelEventSvc<T: ChannelEventsService>(pub Arc<T>);
1086                    impl<
1087                        T: ChannelEventsService,
1088                    > tonic::server::UnaryService<super::RecordChannelEventRequest>
1089                    for RecordChannelEventSvc<T> {
1090                        type Response = super::RecordChannelEventResponse;
1091                        type Future = BoxFuture<
1092                            tonic::Response<Self::Response>,
1093                            tonic::Status,
1094                        >;
1095                        fn call(
1096                            &mut self,
1097                            request: tonic::Request<super::RecordChannelEventRequest>,
1098                        ) -> Self::Future {
1099                            let inner = Arc::clone(&self.0);
1100                            let fut = async move {
1101                                <T as ChannelEventsService>::record_channel_event(
1102                                        &inner,
1103                                        request,
1104                                    )
1105                                    .await
1106                            };
1107                            Box::pin(fut)
1108                        }
1109                    }
1110                    let accept_compression_encodings = self.accept_compression_encodings;
1111                    let send_compression_encodings = self.send_compression_encodings;
1112                    let max_decoding_message_size = self.max_decoding_message_size;
1113                    let max_encoding_message_size = self.max_encoding_message_size;
1114                    let inner = self.inner.clone();
1115                    let fut = async move {
1116                        let method = RecordChannelEventSvc(inner);
1117                        let codec = tonic_prost::ProstCodec::default();
1118                        let mut grpc = tonic::server::Grpc::new(codec)
1119                            .apply_compression_config(
1120                                accept_compression_encodings,
1121                                send_compression_encodings,
1122                            )
1123                            .apply_max_message_size_config(
1124                                max_decoding_message_size,
1125                                max_encoding_message_size,
1126                            );
1127                        let res = grpc.unary(method, req).await;
1128                        Ok(res)
1129                    };
1130                    Box::pin(fut)
1131                }
1132                "/pidgr.v1.ChannelEventsService/RecordChannelEventBatch" => {
1133                    #[allow(non_camel_case_types)]
1134                    struct RecordChannelEventBatchSvc<T: ChannelEventsService>(
1135                        pub Arc<T>,
1136                    );
1137                    impl<
1138                        T: ChannelEventsService,
1139                    > tonic::server::UnaryService<super::RecordChannelEventBatchRequest>
1140                    for RecordChannelEventBatchSvc<T> {
1141                        type Response = super::RecordChannelEventBatchResponse;
1142                        type Future = BoxFuture<
1143                            tonic::Response<Self::Response>,
1144                            tonic::Status,
1145                        >;
1146                        fn call(
1147                            &mut self,
1148                            request: tonic::Request<
1149                                super::RecordChannelEventBatchRequest,
1150                            >,
1151                        ) -> Self::Future {
1152                            let inner = Arc::clone(&self.0);
1153                            let fut = async move {
1154                                <T as ChannelEventsService>::record_channel_event_batch(
1155                                        &inner,
1156                                        request,
1157                                    )
1158                                    .await
1159                            };
1160                            Box::pin(fut)
1161                        }
1162                    }
1163                    let accept_compression_encodings = self.accept_compression_encodings;
1164                    let send_compression_encodings = self.send_compression_encodings;
1165                    let max_decoding_message_size = self.max_decoding_message_size;
1166                    let max_encoding_message_size = self.max_encoding_message_size;
1167                    let inner = self.inner.clone();
1168                    let fut = async move {
1169                        let method = RecordChannelEventBatchSvc(inner);
1170                        let codec = tonic_prost::ProstCodec::default();
1171                        let mut grpc = tonic::server::Grpc::new(codec)
1172                            .apply_compression_config(
1173                                accept_compression_encodings,
1174                                send_compression_encodings,
1175                            )
1176                            .apply_max_message_size_config(
1177                                max_decoding_message_size,
1178                                max_encoding_message_size,
1179                            );
1180                        let res = grpc.unary(method, req).await;
1181                        Ok(res)
1182                    };
1183                    Box::pin(fut)
1184                }
1185                _ => {
1186                    Box::pin(async move {
1187                        let mut response = http::Response::new(
1188                            tonic::body::Body::default(),
1189                        );
1190                        let headers = response.headers_mut();
1191                        headers
1192                            .insert(
1193                                tonic::Status::GRPC_STATUS,
1194                                (tonic::Code::Unimplemented as i32).into(),
1195                            );
1196                        headers
1197                            .insert(
1198                                http::header::CONTENT_TYPE,
1199                                tonic::metadata::GRPC_CONTENT_TYPE,
1200                            );
1201                        Ok(response)
1202                    })
1203                }
1204            }
1205        }
1206    }
1207    impl<T> Clone for ChannelEventsServiceServer<T> {
1208        fn clone(&self) -> Self {
1209            let inner = self.inner.clone();
1210            Self {
1211                inner,
1212                accept_compression_encodings: self.accept_compression_encodings,
1213                send_compression_encodings: self.send_compression_encodings,
1214                max_decoding_message_size: self.max_decoding_message_size,
1215                max_encoding_message_size: self.max_encoding_message_size,
1216            }
1217        }
1218    }
1219    /// Generated gRPC service name
1220    pub const SERVICE_NAME: &str = "pidgr.v1.ChannelEventsService";
1221    impl<T> tonic::server::NamedService for ChannelEventsServiceServer<T> {
1222        const NAME: &'static str = SERVICE_NAME;
1223    }
1224}
1225/// Generated client implementations.
1226pub mod api_key_service_client {
1227    #![allow(
1228        unused_variables,
1229        dead_code,
1230        missing_docs,
1231        clippy::wildcard_imports,
1232        clippy::let_unit_value,
1233    )]
1234    use tonic::codegen::*;
1235    use tonic::codegen::http::Uri;
1236    /** Manages scoped API keys for programmatic access.
1237 All RPCs operate within the caller's org (extracted from JWT).
1238*/
1239    #[derive(Debug, Clone)]
1240    pub struct ApiKeyServiceClient<T> {
1241        inner: tonic::client::Grpc<T>,
1242    }
1243    impl ApiKeyServiceClient<tonic::transport::Channel> {
1244        /// Attempt to create a new client by connecting to a given endpoint.
1245        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1246        where
1247            D: TryInto<tonic::transport::Endpoint>,
1248            D::Error: Into<StdError>,
1249        {
1250            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1251            Ok(Self::new(conn))
1252        }
1253    }
1254    impl<T> ApiKeyServiceClient<T>
1255    where
1256        T: tonic::client::GrpcService<tonic::body::Body>,
1257        T::Error: Into<StdError>,
1258        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1259        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1260    {
1261        pub fn new(inner: T) -> Self {
1262            let inner = tonic::client::Grpc::new(inner);
1263            Self { inner }
1264        }
1265        pub fn with_origin(inner: T, origin: Uri) -> Self {
1266            let inner = tonic::client::Grpc::with_origin(inner, origin);
1267            Self { inner }
1268        }
1269        pub fn with_interceptor<F>(
1270            inner: T,
1271            interceptor: F,
1272        ) -> ApiKeyServiceClient<InterceptedService<T, F>>
1273        where
1274            F: tonic::service::Interceptor,
1275            T::ResponseBody: Default,
1276            T: tonic::codegen::Service<
1277                http::Request<tonic::body::Body>,
1278                Response = http::Response<
1279                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
1280                >,
1281            >,
1282            <T as tonic::codegen::Service<
1283                http::Request<tonic::body::Body>,
1284            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1285        {
1286            ApiKeyServiceClient::new(InterceptedService::new(inner, interceptor))
1287        }
1288        /// Compress requests with the given encoding.
1289        ///
1290        /// This requires the server to support it otherwise it might respond with an
1291        /// error.
1292        #[must_use]
1293        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1294            self.inner = self.inner.send_compressed(encoding);
1295            self
1296        }
1297        /// Enable decompressing responses.
1298        #[must_use]
1299        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1300            self.inner = self.inner.accept_compressed(encoding);
1301            self
1302        }
1303        /// Limits the maximum size of a decoded message.
1304        ///
1305        /// Default: `4MB`
1306        #[must_use]
1307        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1308            self.inner = self.inner.max_decoding_message_size(limit);
1309            self
1310        }
1311        /// Limits the maximum size of an encoded message.
1312        ///
1313        /// Default: `usize::MAX`
1314        #[must_use]
1315        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1316            self.inner = self.inner.max_encoding_message_size(limit);
1317            self
1318        }
1319        /** Create a new scoped API key with specific permissions.
1320 The full secret key is only returned in the response — store it securely.
1321 Authorization: Requires PERMISSION_ORG_WRITE.
1322*/
1323        pub async fn create_api_key(
1324            &mut self,
1325            request: impl tonic::IntoRequest<super::CreateApiKeyRequest>,
1326        ) -> std::result::Result<
1327            tonic::Response<super::CreateApiKeyResponse>,
1328            tonic::Status,
1329        > {
1330            self.inner
1331                .ready()
1332                .await
1333                .map_err(|e| {
1334                    tonic::Status::unknown(
1335                        format!("Service was not ready: {}", e.into()),
1336                    )
1337                })?;
1338            let codec = tonic_prost::ProstCodec::default();
1339            let path = http::uri::PathAndQuery::from_static(
1340                "/pidgr.v1.ApiKeyService/CreateApiKey",
1341            );
1342            let mut req = request.into_request();
1343            req.extensions_mut()
1344                .insert(GrpcMethod::new("pidgr.v1.ApiKeyService", "CreateApiKey"));
1345            self.inner.unary(req, path, codec).await
1346        }
1347        /** List all active API keys in the organization (metadata only, no secrets).
1348 Authorization: Requires PERMISSION_ORG_READ.
1349*/
1350        pub async fn list_api_keys(
1351            &mut self,
1352            request: impl tonic::IntoRequest<super::ListApiKeysRequest>,
1353        ) -> std::result::Result<
1354            tonic::Response<super::ListApiKeysResponse>,
1355            tonic::Status,
1356        > {
1357            self.inner
1358                .ready()
1359                .await
1360                .map_err(|e| {
1361                    tonic::Status::unknown(
1362                        format!("Service was not ready: {}", e.into()),
1363                    )
1364                })?;
1365            let codec = tonic_prost::ProstCodec::default();
1366            let path = http::uri::PathAndQuery::from_static(
1367                "/pidgr.v1.ApiKeyService/ListApiKeys",
1368            );
1369            let mut req = request.into_request();
1370            req.extensions_mut()
1371                .insert(GrpcMethod::new("pidgr.v1.ApiKeyService", "ListApiKeys"));
1372            self.inner.unary(req, path, codec).await
1373        }
1374        /** Revoke an API key. The key becomes immediately unusable.
1375 Authorization: Requires PERMISSION_ORG_WRITE.
1376*/
1377        pub async fn revoke_api_key(
1378            &mut self,
1379            request: impl tonic::IntoRequest<super::RevokeApiKeyRequest>,
1380        ) -> std::result::Result<
1381            tonic::Response<super::RevokeApiKeyResponse>,
1382            tonic::Status,
1383        > {
1384            self.inner
1385                .ready()
1386                .await
1387                .map_err(|e| {
1388                    tonic::Status::unknown(
1389                        format!("Service was not ready: {}", e.into()),
1390                    )
1391                })?;
1392            let codec = tonic_prost::ProstCodec::default();
1393            let path = http::uri::PathAndQuery::from_static(
1394                "/pidgr.v1.ApiKeyService/RevokeApiKey",
1395            );
1396            let mut req = request.into_request();
1397            req.extensions_mut()
1398                .insert(GrpcMethod::new("pidgr.v1.ApiKeyService", "RevokeApiKey"));
1399            self.inner.unary(req, path, codec).await
1400        }
1401    }
1402}
1403/// Generated server implementations.
1404pub mod api_key_service_server {
1405    #![allow(
1406        unused_variables,
1407        dead_code,
1408        missing_docs,
1409        clippy::wildcard_imports,
1410        clippy::let_unit_value,
1411    )]
1412    use tonic::codegen::*;
1413    /// Generated trait containing gRPC methods that should be implemented for use with ApiKeyServiceServer.
1414    #[async_trait]
1415    pub trait ApiKeyService: std::marker::Send + std::marker::Sync + 'static {
1416        /** Create a new scoped API key with specific permissions.
1417 The full secret key is only returned in the response — store it securely.
1418 Authorization: Requires PERMISSION_ORG_WRITE.
1419*/
1420        async fn create_api_key(
1421            &self,
1422            request: tonic::Request<super::CreateApiKeyRequest>,
1423        ) -> std::result::Result<
1424            tonic::Response<super::CreateApiKeyResponse>,
1425            tonic::Status,
1426        >;
1427        /** List all active API keys in the organization (metadata only, no secrets).
1428 Authorization: Requires PERMISSION_ORG_READ.
1429*/
1430        async fn list_api_keys(
1431            &self,
1432            request: tonic::Request<super::ListApiKeysRequest>,
1433        ) -> std::result::Result<
1434            tonic::Response<super::ListApiKeysResponse>,
1435            tonic::Status,
1436        >;
1437        /** Revoke an API key. The key becomes immediately unusable.
1438 Authorization: Requires PERMISSION_ORG_WRITE.
1439*/
1440        async fn revoke_api_key(
1441            &self,
1442            request: tonic::Request<super::RevokeApiKeyRequest>,
1443        ) -> std::result::Result<
1444            tonic::Response<super::RevokeApiKeyResponse>,
1445            tonic::Status,
1446        >;
1447    }
1448    /** Manages scoped API keys for programmatic access.
1449 All RPCs operate within the caller's org (extracted from JWT).
1450*/
1451    #[derive(Debug)]
1452    pub struct ApiKeyServiceServer<T> {
1453        inner: Arc<T>,
1454        accept_compression_encodings: EnabledCompressionEncodings,
1455        send_compression_encodings: EnabledCompressionEncodings,
1456        max_decoding_message_size: Option<usize>,
1457        max_encoding_message_size: Option<usize>,
1458    }
1459    impl<T> ApiKeyServiceServer<T> {
1460        pub fn new(inner: T) -> Self {
1461            Self::from_arc(Arc::new(inner))
1462        }
1463        pub fn from_arc(inner: Arc<T>) -> Self {
1464            Self {
1465                inner,
1466                accept_compression_encodings: Default::default(),
1467                send_compression_encodings: Default::default(),
1468                max_decoding_message_size: None,
1469                max_encoding_message_size: None,
1470            }
1471        }
1472        pub fn with_interceptor<F>(
1473            inner: T,
1474            interceptor: F,
1475        ) -> InterceptedService<Self, F>
1476        where
1477            F: tonic::service::Interceptor,
1478        {
1479            InterceptedService::new(Self::new(inner), interceptor)
1480        }
1481        /// Enable decompressing requests with the given encoding.
1482        #[must_use]
1483        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1484            self.accept_compression_encodings.enable(encoding);
1485            self
1486        }
1487        /// Compress responses with the given encoding, if the client supports it.
1488        #[must_use]
1489        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1490            self.send_compression_encodings.enable(encoding);
1491            self
1492        }
1493        /// Limits the maximum size of a decoded message.
1494        ///
1495        /// Default: `4MB`
1496        #[must_use]
1497        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1498            self.max_decoding_message_size = Some(limit);
1499            self
1500        }
1501        /// Limits the maximum size of an encoded message.
1502        ///
1503        /// Default: `usize::MAX`
1504        #[must_use]
1505        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1506            self.max_encoding_message_size = Some(limit);
1507            self
1508        }
1509    }
1510    impl<T, B> tonic::codegen::Service<http::Request<B>> for ApiKeyServiceServer<T>
1511    where
1512        T: ApiKeyService,
1513        B: Body + std::marker::Send + 'static,
1514        B::Error: Into<StdError> + std::marker::Send + 'static,
1515    {
1516        type Response = http::Response<tonic::body::Body>;
1517        type Error = std::convert::Infallible;
1518        type Future = BoxFuture<Self::Response, Self::Error>;
1519        fn poll_ready(
1520            &mut self,
1521            _cx: &mut Context<'_>,
1522        ) -> Poll<std::result::Result<(), Self::Error>> {
1523            Poll::Ready(Ok(()))
1524        }
1525        fn call(&mut self, req: http::Request<B>) -> Self::Future {
1526            match req.uri().path() {
1527                "/pidgr.v1.ApiKeyService/CreateApiKey" => {
1528                    #[allow(non_camel_case_types)]
1529                    struct CreateApiKeySvc<T: ApiKeyService>(pub Arc<T>);
1530                    impl<
1531                        T: ApiKeyService,
1532                    > tonic::server::UnaryService<super::CreateApiKeyRequest>
1533                    for CreateApiKeySvc<T> {
1534                        type Response = super::CreateApiKeyResponse;
1535                        type Future = BoxFuture<
1536                            tonic::Response<Self::Response>,
1537                            tonic::Status,
1538                        >;
1539                        fn call(
1540                            &mut self,
1541                            request: tonic::Request<super::CreateApiKeyRequest>,
1542                        ) -> Self::Future {
1543                            let inner = Arc::clone(&self.0);
1544                            let fut = async move {
1545                                <T as ApiKeyService>::create_api_key(&inner, request).await
1546                            };
1547                            Box::pin(fut)
1548                        }
1549                    }
1550                    let accept_compression_encodings = self.accept_compression_encodings;
1551                    let send_compression_encodings = self.send_compression_encodings;
1552                    let max_decoding_message_size = self.max_decoding_message_size;
1553                    let max_encoding_message_size = self.max_encoding_message_size;
1554                    let inner = self.inner.clone();
1555                    let fut = async move {
1556                        let method = CreateApiKeySvc(inner);
1557                        let codec = tonic_prost::ProstCodec::default();
1558                        let mut grpc = tonic::server::Grpc::new(codec)
1559                            .apply_compression_config(
1560                                accept_compression_encodings,
1561                                send_compression_encodings,
1562                            )
1563                            .apply_max_message_size_config(
1564                                max_decoding_message_size,
1565                                max_encoding_message_size,
1566                            );
1567                        let res = grpc.unary(method, req).await;
1568                        Ok(res)
1569                    };
1570                    Box::pin(fut)
1571                }
1572                "/pidgr.v1.ApiKeyService/ListApiKeys" => {
1573                    #[allow(non_camel_case_types)]
1574                    struct ListApiKeysSvc<T: ApiKeyService>(pub Arc<T>);
1575                    impl<
1576                        T: ApiKeyService,
1577                    > tonic::server::UnaryService<super::ListApiKeysRequest>
1578                    for ListApiKeysSvc<T> {
1579                        type Response = super::ListApiKeysResponse;
1580                        type Future = BoxFuture<
1581                            tonic::Response<Self::Response>,
1582                            tonic::Status,
1583                        >;
1584                        fn call(
1585                            &mut self,
1586                            request: tonic::Request<super::ListApiKeysRequest>,
1587                        ) -> Self::Future {
1588                            let inner = Arc::clone(&self.0);
1589                            let fut = async move {
1590                                <T as ApiKeyService>::list_api_keys(&inner, request).await
1591                            };
1592                            Box::pin(fut)
1593                        }
1594                    }
1595                    let accept_compression_encodings = self.accept_compression_encodings;
1596                    let send_compression_encodings = self.send_compression_encodings;
1597                    let max_decoding_message_size = self.max_decoding_message_size;
1598                    let max_encoding_message_size = self.max_encoding_message_size;
1599                    let inner = self.inner.clone();
1600                    let fut = async move {
1601                        let method = ListApiKeysSvc(inner);
1602                        let codec = tonic_prost::ProstCodec::default();
1603                        let mut grpc = tonic::server::Grpc::new(codec)
1604                            .apply_compression_config(
1605                                accept_compression_encodings,
1606                                send_compression_encodings,
1607                            )
1608                            .apply_max_message_size_config(
1609                                max_decoding_message_size,
1610                                max_encoding_message_size,
1611                            );
1612                        let res = grpc.unary(method, req).await;
1613                        Ok(res)
1614                    };
1615                    Box::pin(fut)
1616                }
1617                "/pidgr.v1.ApiKeyService/RevokeApiKey" => {
1618                    #[allow(non_camel_case_types)]
1619                    struct RevokeApiKeySvc<T: ApiKeyService>(pub Arc<T>);
1620                    impl<
1621                        T: ApiKeyService,
1622                    > tonic::server::UnaryService<super::RevokeApiKeyRequest>
1623                    for RevokeApiKeySvc<T> {
1624                        type Response = super::RevokeApiKeyResponse;
1625                        type Future = BoxFuture<
1626                            tonic::Response<Self::Response>,
1627                            tonic::Status,
1628                        >;
1629                        fn call(
1630                            &mut self,
1631                            request: tonic::Request<super::RevokeApiKeyRequest>,
1632                        ) -> Self::Future {
1633                            let inner = Arc::clone(&self.0);
1634                            let fut = async move {
1635                                <T as ApiKeyService>::revoke_api_key(&inner, request).await
1636                            };
1637                            Box::pin(fut)
1638                        }
1639                    }
1640                    let accept_compression_encodings = self.accept_compression_encodings;
1641                    let send_compression_encodings = self.send_compression_encodings;
1642                    let max_decoding_message_size = self.max_decoding_message_size;
1643                    let max_encoding_message_size = self.max_encoding_message_size;
1644                    let inner = self.inner.clone();
1645                    let fut = async move {
1646                        let method = RevokeApiKeySvc(inner);
1647                        let codec = tonic_prost::ProstCodec::default();
1648                        let mut grpc = tonic::server::Grpc::new(codec)
1649                            .apply_compression_config(
1650                                accept_compression_encodings,
1651                                send_compression_encodings,
1652                            )
1653                            .apply_max_message_size_config(
1654                                max_decoding_message_size,
1655                                max_encoding_message_size,
1656                            );
1657                        let res = grpc.unary(method, req).await;
1658                        Ok(res)
1659                    };
1660                    Box::pin(fut)
1661                }
1662                _ => {
1663                    Box::pin(async move {
1664                        let mut response = http::Response::new(
1665                            tonic::body::Body::default(),
1666                        );
1667                        let headers = response.headers_mut();
1668                        headers
1669                            .insert(
1670                                tonic::Status::GRPC_STATUS,
1671                                (tonic::Code::Unimplemented as i32).into(),
1672                            );
1673                        headers
1674                            .insert(
1675                                http::header::CONTENT_TYPE,
1676                                tonic::metadata::GRPC_CONTENT_TYPE,
1677                            );
1678                        Ok(response)
1679                    })
1680                }
1681            }
1682        }
1683    }
1684    impl<T> Clone for ApiKeyServiceServer<T> {
1685        fn clone(&self) -> Self {
1686            let inner = self.inner.clone();
1687            Self {
1688                inner,
1689                accept_compression_encodings: self.accept_compression_encodings,
1690                send_compression_encodings: self.send_compression_encodings,
1691                max_decoding_message_size: self.max_decoding_message_size,
1692                max_encoding_message_size: self.max_encoding_message_size,
1693            }
1694        }
1695    }
1696    /// Generated gRPC service name
1697    pub const SERVICE_NAME: &str = "pidgr.v1.ApiKeyService";
1698    impl<T> tonic::server::NamedService for ApiKeyServiceServer<T> {
1699        const NAME: &'static str = SERVICE_NAME;
1700    }
1701}
1702/// Generated client implementations.
1703pub mod privacy_service_client {
1704    #![allow(
1705        unused_variables,
1706        dead_code,
1707        missing_docs,
1708        clippy::wildcard_imports,
1709        clippy::let_unit_value,
1710    )]
1711    use tonic::codegen::*;
1712    use tonic::codegen::http::Uri;
1713    /** PrivacyService handles GDPR/LGPD data subject rights.
1714 All RPCs extract org_id from the JWT — it is never in request messages.
1715*/
1716    #[derive(Debug, Clone)]
1717    pub struct PrivacyServiceClient<T> {
1718        inner: tonic::client::Grpc<T>,
1719    }
1720    impl PrivacyServiceClient<tonic::transport::Channel> {
1721        /// Attempt to create a new client by connecting to a given endpoint.
1722        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1723        where
1724            D: TryInto<tonic::transport::Endpoint>,
1725            D::Error: Into<StdError>,
1726        {
1727            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1728            Ok(Self::new(conn))
1729        }
1730    }
1731    impl<T> PrivacyServiceClient<T>
1732    where
1733        T: tonic::client::GrpcService<tonic::body::Body>,
1734        T::Error: Into<StdError>,
1735        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1736        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1737    {
1738        pub fn new(inner: T) -> Self {
1739            let inner = tonic::client::Grpc::new(inner);
1740            Self { inner }
1741        }
1742        pub fn with_origin(inner: T, origin: Uri) -> Self {
1743            let inner = tonic::client::Grpc::with_origin(inner, origin);
1744            Self { inner }
1745        }
1746        pub fn with_interceptor<F>(
1747            inner: T,
1748            interceptor: F,
1749        ) -> PrivacyServiceClient<InterceptedService<T, F>>
1750        where
1751            F: tonic::service::Interceptor,
1752            T::ResponseBody: Default,
1753            T: tonic::codegen::Service<
1754                http::Request<tonic::body::Body>,
1755                Response = http::Response<
1756                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
1757                >,
1758            >,
1759            <T as tonic::codegen::Service<
1760                http::Request<tonic::body::Body>,
1761            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1762        {
1763            PrivacyServiceClient::new(InterceptedService::new(inner, interceptor))
1764        }
1765        /// Compress requests with the given encoding.
1766        ///
1767        /// This requires the server to support it otherwise it might respond with an
1768        /// error.
1769        #[must_use]
1770        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1771            self.inner = self.inner.send_compressed(encoding);
1772            self
1773        }
1774        /// Enable decompressing responses.
1775        #[must_use]
1776        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1777            self.inner = self.inner.accept_compressed(encoding);
1778            self
1779        }
1780        /// Limits the maximum size of a decoded message.
1781        ///
1782        /// Default: `4MB`
1783        #[must_use]
1784        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1785            self.inner = self.inner.max_decoding_message_size(limit);
1786            self
1787        }
1788        /// Limits the maximum size of an encoded message.
1789        ///
1790        /// Default: `usize::MAX`
1791        #[must_use]
1792        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1793            self.inner = self.inner.max_encoding_message_size(limit);
1794            self
1795        }
1796        /** Export all personal data associated with a user as a downloadable ZIP.
1797 Async operation — returns immediately with PENDING status, sends push
1798 notification when the export is ready.
1799 Auth: Requires JWT. Callable by the user themselves or an org admin.
1800*/
1801        pub async fn export_user_data(
1802            &mut self,
1803            request: impl tonic::IntoRequest<super::ExportUserDataRequest>,
1804        ) -> std::result::Result<
1805            tonic::Response<super::ExportUserDataResponse>,
1806            tonic::Status,
1807        > {
1808            self.inner
1809                .ready()
1810                .await
1811                .map_err(|e| {
1812                    tonic::Status::unknown(
1813                        format!("Service was not ready: {}", e.into()),
1814                    )
1815                })?;
1816            let codec = tonic_prost::ProstCodec::default();
1817            let path = http::uri::PathAndQuery::from_static(
1818                "/pidgr.v1.PrivacyService/ExportUserData",
1819            );
1820            let mut req = request.into_request();
1821            req.extensions_mut()
1822                .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "ExportUserData"));
1823            self.inner.unary(req, path, codec).await
1824        }
1825        /** Delete or anonymize all personal data associated with a user.
1826 Deletion has a 30-day grace period during which processing is restricted
1827 and the request can be cancelled. After 30 days, deletion is irreversible.
1828 Auth: Requires JWT. Admin only.
1829*/
1830        pub async fn delete_user_data(
1831            &mut self,
1832            request: impl tonic::IntoRequest<super::DeleteUserDataRequest>,
1833        ) -> std::result::Result<
1834            tonic::Response<super::DeleteUserDataResponse>,
1835            tonic::Status,
1836        > {
1837            self.inner
1838                .ready()
1839                .await
1840                .map_err(|e| {
1841                    tonic::Status::unknown(
1842                        format!("Service was not ready: {}", e.into()),
1843                    )
1844                })?;
1845            let codec = tonic_prost::ProstCodec::default();
1846            let path = http::uri::PathAndQuery::from_static(
1847                "/pidgr.v1.PrivacyService/DeleteUserData",
1848            );
1849            let mut req = request.into_request();
1850            req.extensions_mut()
1851                .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "DeleteUserData"));
1852            self.inner.unary(req, path, codec).await
1853        }
1854        /** Correct personal data for a user. Propagates corrections to all stored
1855 locations (profile, delivery records, analytics metadata).
1856 Auth: Requires JWT. Callable by the user themselves or an org admin.
1857*/
1858        pub async fn rectify_user_data(
1859            &mut self,
1860            request: impl tonic::IntoRequest<super::RectifyUserDataRequest>,
1861        ) -> std::result::Result<
1862            tonic::Response<super::RectifyUserDataResponse>,
1863            tonic::Status,
1864        > {
1865            self.inner
1866                .ready()
1867                .await
1868                .map_err(|e| {
1869                    tonic::Status::unknown(
1870                        format!("Service was not ready: {}", e.into()),
1871                    )
1872                })?;
1873            let codec = tonic_prost::ProstCodec::default();
1874            let path = http::uri::PathAndQuery::from_static(
1875                "/pidgr.v1.PrivacyService/RectifyUserData",
1876            );
1877            let mut req = request.into_request();
1878            req.extensions_mut()
1879                .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "RectifyUserData"));
1880            self.inner.unary(req, path, codec).await
1881        }
1882        /** Restrict or unrestrict processing for a user. When restricted, the API
1883 skips this user in campaigns, analytics, and session replay.
1884 Auth: Requires JWT. Admin only.
1885*/
1886        pub async fn restrict_processing(
1887            &mut self,
1888            request: impl tonic::IntoRequest<super::RestrictProcessingRequest>,
1889        ) -> std::result::Result<
1890            tonic::Response<super::RestrictProcessingResponse>,
1891            tonic::Status,
1892        > {
1893            self.inner
1894                .ready()
1895                .await
1896                .map_err(|e| {
1897                    tonic::Status::unknown(
1898                        format!("Service was not ready: {}", e.into()),
1899                    )
1900                })?;
1901            let codec = tonic_prost::ProstCodec::default();
1902            let path = http::uri::PathAndQuery::from_static(
1903                "/pidgr.v1.PrivacyService/RestrictProcessing",
1904            );
1905            let mut req = request.into_request();
1906            req.extensions_mut()
1907                .insert(
1908                    GrpcMethod::new("pidgr.v1.PrivacyService", "RestrictProcessing"),
1909                );
1910            self.inner.unary(req, path, codec).await
1911        }
1912        /** Confirm whether personal data exists for a user and list data categories.
1913 LGPD-specific: confirmação de existência (Art. 18, I).
1914 Auth: Requires JWT. Admin only.
1915*/
1916        pub async fn get_data_existence_confirmation(
1917            &mut self,
1918            request: impl tonic::IntoRequest<super::GetDataExistenceConfirmationRequest>,
1919        ) -> std::result::Result<
1920            tonic::Response<super::GetDataExistenceConfirmationResponse>,
1921            tonic::Status,
1922        > {
1923            self.inner
1924                .ready()
1925                .await
1926                .map_err(|e| {
1927                    tonic::Status::unknown(
1928                        format!("Service was not ready: {}", e.into()),
1929                    )
1930                })?;
1931            let codec = tonic_prost::ProstCodec::default();
1932            let path = http::uri::PathAndQuery::from_static(
1933                "/pidgr.v1.PrivacyService/GetDataExistenceConfirmation",
1934            );
1935            let mut req = request.into_request();
1936            req.extensions_mut()
1937                .insert(
1938                    GrpcMethod::new(
1939                        "pidgr.v1.PrivacyService",
1940                        "GetDataExistenceConfirmation",
1941                    ),
1942                );
1943            self.inner.unary(req, path, codec).await
1944        }
1945        /** List privacy requests for the organization, with optional filters.
1946 Used by the admin UI to show scheduled deletions table.
1947 Auth: Requires JWT. Admin only.
1948*/
1949        pub async fn list_privacy_requests(
1950            &mut self,
1951            request: impl tonic::IntoRequest<super::ListPrivacyRequestsRequest>,
1952        ) -> std::result::Result<
1953            tonic::Response<super::ListPrivacyRequestsResponse>,
1954            tonic::Status,
1955        > {
1956            self.inner
1957                .ready()
1958                .await
1959                .map_err(|e| {
1960                    tonic::Status::unknown(
1961                        format!("Service was not ready: {}", e.into()),
1962                    )
1963                })?;
1964            let codec = tonic_prost::ProstCodec::default();
1965            let path = http::uri::PathAndQuery::from_static(
1966                "/pidgr.v1.PrivacyService/ListPrivacyRequests",
1967            );
1968            let mut req = request.into_request();
1969            req.extensions_mut()
1970                .insert(
1971                    GrpcMethod::new("pidgr.v1.PrivacyService", "ListPrivacyRequests"),
1972                );
1973            self.inner.unary(req, path, codec).await
1974        }
1975        /** Cancel a pending deletion request. Reactivates the user and aborts
1976 the deletion workflow. Only valid during the 30-day grace period.
1977 Auth: Requires JWT. Admin only.
1978*/
1979        pub async fn cancel_deletion(
1980            &mut self,
1981            request: impl tonic::IntoRequest<super::CancelDeletionRequest>,
1982        ) -> std::result::Result<
1983            tonic::Response<super::CancelDeletionResponse>,
1984            tonic::Status,
1985        > {
1986            self.inner
1987                .ready()
1988                .await
1989                .map_err(|e| {
1990                    tonic::Status::unknown(
1991                        format!("Service was not ready: {}", e.into()),
1992                    )
1993                })?;
1994            let codec = tonic_prost::ProstCodec::default();
1995            let path = http::uri::PathAndQuery::from_static(
1996                "/pidgr.v1.PrivacyService/CancelDeletion",
1997            );
1998            let mut req = request.into_request();
1999            req.extensions_mut()
2000                .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "CancelDeletion"));
2001            self.inner.unary(req, path, codec).await
2002        }
2003        /** Skip the grace period and delete immediately. Signals the deletion
2004 workflow to proceed without waiting for the 30-day timer.
2005 Auth: Requires JWT. Admin only.
2006*/
2007        pub async fn immediate_delete(
2008            &mut self,
2009            request: impl tonic::IntoRequest<super::ImmediateDeleteRequest>,
2010        ) -> std::result::Result<
2011            tonic::Response<super::ImmediateDeleteResponse>,
2012            tonic::Status,
2013        > {
2014            self.inner
2015                .ready()
2016                .await
2017                .map_err(|e| {
2018                    tonic::Status::unknown(
2019                        format!("Service was not ready: {}", e.into()),
2020                    )
2021                })?;
2022            let codec = tonic_prost::ProstCodec::default();
2023            let path = http::uri::PathAndQuery::from_static(
2024                "/pidgr.v1.PrivacyService/ImmediateDelete",
2025            );
2026            let mut req = request.into_request();
2027            req.extensions_mut()
2028                .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "ImmediateDelete"));
2029            self.inner.unary(req, path, codec).await
2030        }
2031        /** List the calling user's own privacy requests (export, rectify).
2032 The server extracts user_id from the JWT — no admin permission required.
2033 Auth: Requires JWT. Any authenticated user.
2034*/
2035        pub async fn list_my_privacy_requests(
2036            &mut self,
2037            request: impl tonic::IntoRequest<super::ListMyPrivacyRequestsRequest>,
2038        ) -> std::result::Result<
2039            tonic::Response<super::ListMyPrivacyRequestsResponse>,
2040            tonic::Status,
2041        > {
2042            self.inner
2043                .ready()
2044                .await
2045                .map_err(|e| {
2046                    tonic::Status::unknown(
2047                        format!("Service was not ready: {}", e.into()),
2048                    )
2049                })?;
2050            let codec = tonic_prost::ProstCodec::default();
2051            let path = http::uri::PathAndQuery::from_static(
2052                "/pidgr.v1.PrivacyService/ListMyPrivacyRequests",
2053            );
2054            let mut req = request.into_request();
2055            req.extensions_mut()
2056                .insert(
2057                    GrpcMethod::new("pidgr.v1.PrivacyService", "ListMyPrivacyRequests"),
2058                );
2059            self.inner.unary(req, path, codec).await
2060        }
2061    }
2062}
2063/// Generated server implementations.
2064pub mod privacy_service_server {
2065    #![allow(
2066        unused_variables,
2067        dead_code,
2068        missing_docs,
2069        clippy::wildcard_imports,
2070        clippy::let_unit_value,
2071    )]
2072    use tonic::codegen::*;
2073    /// Generated trait containing gRPC methods that should be implemented for use with PrivacyServiceServer.
2074    #[async_trait]
2075    pub trait PrivacyService: std::marker::Send + std::marker::Sync + 'static {
2076        /** Export all personal data associated with a user as a downloadable ZIP.
2077 Async operation — returns immediately with PENDING status, sends push
2078 notification when the export is ready.
2079 Auth: Requires JWT. Callable by the user themselves or an org admin.
2080*/
2081        async fn export_user_data(
2082            &self,
2083            request: tonic::Request<super::ExportUserDataRequest>,
2084        ) -> std::result::Result<
2085            tonic::Response<super::ExportUserDataResponse>,
2086            tonic::Status,
2087        >;
2088        /** Delete or anonymize all personal data associated with a user.
2089 Deletion has a 30-day grace period during which processing is restricted
2090 and the request can be cancelled. After 30 days, deletion is irreversible.
2091 Auth: Requires JWT. Admin only.
2092*/
2093        async fn delete_user_data(
2094            &self,
2095            request: tonic::Request<super::DeleteUserDataRequest>,
2096        ) -> std::result::Result<
2097            tonic::Response<super::DeleteUserDataResponse>,
2098            tonic::Status,
2099        >;
2100        /** Correct personal data for a user. Propagates corrections to all stored
2101 locations (profile, delivery records, analytics metadata).
2102 Auth: Requires JWT. Callable by the user themselves or an org admin.
2103*/
2104        async fn rectify_user_data(
2105            &self,
2106            request: tonic::Request<super::RectifyUserDataRequest>,
2107        ) -> std::result::Result<
2108            tonic::Response<super::RectifyUserDataResponse>,
2109            tonic::Status,
2110        >;
2111        /** Restrict or unrestrict processing for a user. When restricted, the API
2112 skips this user in campaigns, analytics, and session replay.
2113 Auth: Requires JWT. Admin only.
2114*/
2115        async fn restrict_processing(
2116            &self,
2117            request: tonic::Request<super::RestrictProcessingRequest>,
2118        ) -> std::result::Result<
2119            tonic::Response<super::RestrictProcessingResponse>,
2120            tonic::Status,
2121        >;
2122        /** Confirm whether personal data exists for a user and list data categories.
2123 LGPD-specific: confirmação de existência (Art. 18, I).
2124 Auth: Requires JWT. Admin only.
2125*/
2126        async fn get_data_existence_confirmation(
2127            &self,
2128            request: tonic::Request<super::GetDataExistenceConfirmationRequest>,
2129        ) -> std::result::Result<
2130            tonic::Response<super::GetDataExistenceConfirmationResponse>,
2131            tonic::Status,
2132        >;
2133        /** List privacy requests for the organization, with optional filters.
2134 Used by the admin UI to show scheduled deletions table.
2135 Auth: Requires JWT. Admin only.
2136*/
2137        async fn list_privacy_requests(
2138            &self,
2139            request: tonic::Request<super::ListPrivacyRequestsRequest>,
2140        ) -> std::result::Result<
2141            tonic::Response<super::ListPrivacyRequestsResponse>,
2142            tonic::Status,
2143        >;
2144        /** Cancel a pending deletion request. Reactivates the user and aborts
2145 the deletion workflow. Only valid during the 30-day grace period.
2146 Auth: Requires JWT. Admin only.
2147*/
2148        async fn cancel_deletion(
2149            &self,
2150            request: tonic::Request<super::CancelDeletionRequest>,
2151        ) -> std::result::Result<
2152            tonic::Response<super::CancelDeletionResponse>,
2153            tonic::Status,
2154        >;
2155        /** Skip the grace period and delete immediately. Signals the deletion
2156 workflow to proceed without waiting for the 30-day timer.
2157 Auth: Requires JWT. Admin only.
2158*/
2159        async fn immediate_delete(
2160            &self,
2161            request: tonic::Request<super::ImmediateDeleteRequest>,
2162        ) -> std::result::Result<
2163            tonic::Response<super::ImmediateDeleteResponse>,
2164            tonic::Status,
2165        >;
2166        /** List the calling user's own privacy requests (export, rectify).
2167 The server extracts user_id from the JWT — no admin permission required.
2168 Auth: Requires JWT. Any authenticated user.
2169*/
2170        async fn list_my_privacy_requests(
2171            &self,
2172            request: tonic::Request<super::ListMyPrivacyRequestsRequest>,
2173        ) -> std::result::Result<
2174            tonic::Response<super::ListMyPrivacyRequestsResponse>,
2175            tonic::Status,
2176        >;
2177    }
2178    /** PrivacyService handles GDPR/LGPD data subject rights.
2179 All RPCs extract org_id from the JWT — it is never in request messages.
2180*/
2181    #[derive(Debug)]
2182    pub struct PrivacyServiceServer<T> {
2183        inner: Arc<T>,
2184        accept_compression_encodings: EnabledCompressionEncodings,
2185        send_compression_encodings: EnabledCompressionEncodings,
2186        max_decoding_message_size: Option<usize>,
2187        max_encoding_message_size: Option<usize>,
2188    }
2189    impl<T> PrivacyServiceServer<T> {
2190        pub fn new(inner: T) -> Self {
2191            Self::from_arc(Arc::new(inner))
2192        }
2193        pub fn from_arc(inner: Arc<T>) -> Self {
2194            Self {
2195                inner,
2196                accept_compression_encodings: Default::default(),
2197                send_compression_encodings: Default::default(),
2198                max_decoding_message_size: None,
2199                max_encoding_message_size: None,
2200            }
2201        }
2202        pub fn with_interceptor<F>(
2203            inner: T,
2204            interceptor: F,
2205        ) -> InterceptedService<Self, F>
2206        where
2207            F: tonic::service::Interceptor,
2208        {
2209            InterceptedService::new(Self::new(inner), interceptor)
2210        }
2211        /// Enable decompressing requests with the given encoding.
2212        #[must_use]
2213        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2214            self.accept_compression_encodings.enable(encoding);
2215            self
2216        }
2217        /// Compress responses with the given encoding, if the client supports it.
2218        #[must_use]
2219        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2220            self.send_compression_encodings.enable(encoding);
2221            self
2222        }
2223        /// Limits the maximum size of a decoded message.
2224        ///
2225        /// Default: `4MB`
2226        #[must_use]
2227        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2228            self.max_decoding_message_size = Some(limit);
2229            self
2230        }
2231        /// Limits the maximum size of an encoded message.
2232        ///
2233        /// Default: `usize::MAX`
2234        #[must_use]
2235        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2236            self.max_encoding_message_size = Some(limit);
2237            self
2238        }
2239    }
2240    impl<T, B> tonic::codegen::Service<http::Request<B>> for PrivacyServiceServer<T>
2241    where
2242        T: PrivacyService,
2243        B: Body + std::marker::Send + 'static,
2244        B::Error: Into<StdError> + std::marker::Send + 'static,
2245    {
2246        type Response = http::Response<tonic::body::Body>;
2247        type Error = std::convert::Infallible;
2248        type Future = BoxFuture<Self::Response, Self::Error>;
2249        fn poll_ready(
2250            &mut self,
2251            _cx: &mut Context<'_>,
2252        ) -> Poll<std::result::Result<(), Self::Error>> {
2253            Poll::Ready(Ok(()))
2254        }
2255        fn call(&mut self, req: http::Request<B>) -> Self::Future {
2256            match req.uri().path() {
2257                "/pidgr.v1.PrivacyService/ExportUserData" => {
2258                    #[allow(non_camel_case_types)]
2259                    struct ExportUserDataSvc<T: PrivacyService>(pub Arc<T>);
2260                    impl<
2261                        T: PrivacyService,
2262                    > tonic::server::UnaryService<super::ExportUserDataRequest>
2263                    for ExportUserDataSvc<T> {
2264                        type Response = super::ExportUserDataResponse;
2265                        type Future = BoxFuture<
2266                            tonic::Response<Self::Response>,
2267                            tonic::Status,
2268                        >;
2269                        fn call(
2270                            &mut self,
2271                            request: tonic::Request<super::ExportUserDataRequest>,
2272                        ) -> Self::Future {
2273                            let inner = Arc::clone(&self.0);
2274                            let fut = async move {
2275                                <T as PrivacyService>::export_user_data(&inner, request)
2276                                    .await
2277                            };
2278                            Box::pin(fut)
2279                        }
2280                    }
2281                    let accept_compression_encodings = self.accept_compression_encodings;
2282                    let send_compression_encodings = self.send_compression_encodings;
2283                    let max_decoding_message_size = self.max_decoding_message_size;
2284                    let max_encoding_message_size = self.max_encoding_message_size;
2285                    let inner = self.inner.clone();
2286                    let fut = async move {
2287                        let method = ExportUserDataSvc(inner);
2288                        let codec = tonic_prost::ProstCodec::default();
2289                        let mut grpc = tonic::server::Grpc::new(codec)
2290                            .apply_compression_config(
2291                                accept_compression_encodings,
2292                                send_compression_encodings,
2293                            )
2294                            .apply_max_message_size_config(
2295                                max_decoding_message_size,
2296                                max_encoding_message_size,
2297                            );
2298                        let res = grpc.unary(method, req).await;
2299                        Ok(res)
2300                    };
2301                    Box::pin(fut)
2302                }
2303                "/pidgr.v1.PrivacyService/DeleteUserData" => {
2304                    #[allow(non_camel_case_types)]
2305                    struct DeleteUserDataSvc<T: PrivacyService>(pub Arc<T>);
2306                    impl<
2307                        T: PrivacyService,
2308                    > tonic::server::UnaryService<super::DeleteUserDataRequest>
2309                    for DeleteUserDataSvc<T> {
2310                        type Response = super::DeleteUserDataResponse;
2311                        type Future = BoxFuture<
2312                            tonic::Response<Self::Response>,
2313                            tonic::Status,
2314                        >;
2315                        fn call(
2316                            &mut self,
2317                            request: tonic::Request<super::DeleteUserDataRequest>,
2318                        ) -> Self::Future {
2319                            let inner = Arc::clone(&self.0);
2320                            let fut = async move {
2321                                <T as PrivacyService>::delete_user_data(&inner, request)
2322                                    .await
2323                            };
2324                            Box::pin(fut)
2325                        }
2326                    }
2327                    let accept_compression_encodings = self.accept_compression_encodings;
2328                    let send_compression_encodings = self.send_compression_encodings;
2329                    let max_decoding_message_size = self.max_decoding_message_size;
2330                    let max_encoding_message_size = self.max_encoding_message_size;
2331                    let inner = self.inner.clone();
2332                    let fut = async move {
2333                        let method = DeleteUserDataSvc(inner);
2334                        let codec = tonic_prost::ProstCodec::default();
2335                        let mut grpc = tonic::server::Grpc::new(codec)
2336                            .apply_compression_config(
2337                                accept_compression_encodings,
2338                                send_compression_encodings,
2339                            )
2340                            .apply_max_message_size_config(
2341                                max_decoding_message_size,
2342                                max_encoding_message_size,
2343                            );
2344                        let res = grpc.unary(method, req).await;
2345                        Ok(res)
2346                    };
2347                    Box::pin(fut)
2348                }
2349                "/pidgr.v1.PrivacyService/RectifyUserData" => {
2350                    #[allow(non_camel_case_types)]
2351                    struct RectifyUserDataSvc<T: PrivacyService>(pub Arc<T>);
2352                    impl<
2353                        T: PrivacyService,
2354                    > tonic::server::UnaryService<super::RectifyUserDataRequest>
2355                    for RectifyUserDataSvc<T> {
2356                        type Response = super::RectifyUserDataResponse;
2357                        type Future = BoxFuture<
2358                            tonic::Response<Self::Response>,
2359                            tonic::Status,
2360                        >;
2361                        fn call(
2362                            &mut self,
2363                            request: tonic::Request<super::RectifyUserDataRequest>,
2364                        ) -> Self::Future {
2365                            let inner = Arc::clone(&self.0);
2366                            let fut = async move {
2367                                <T as PrivacyService>::rectify_user_data(&inner, request)
2368                                    .await
2369                            };
2370                            Box::pin(fut)
2371                        }
2372                    }
2373                    let accept_compression_encodings = self.accept_compression_encodings;
2374                    let send_compression_encodings = self.send_compression_encodings;
2375                    let max_decoding_message_size = self.max_decoding_message_size;
2376                    let max_encoding_message_size = self.max_encoding_message_size;
2377                    let inner = self.inner.clone();
2378                    let fut = async move {
2379                        let method = RectifyUserDataSvc(inner);
2380                        let codec = tonic_prost::ProstCodec::default();
2381                        let mut grpc = tonic::server::Grpc::new(codec)
2382                            .apply_compression_config(
2383                                accept_compression_encodings,
2384                                send_compression_encodings,
2385                            )
2386                            .apply_max_message_size_config(
2387                                max_decoding_message_size,
2388                                max_encoding_message_size,
2389                            );
2390                        let res = grpc.unary(method, req).await;
2391                        Ok(res)
2392                    };
2393                    Box::pin(fut)
2394                }
2395                "/pidgr.v1.PrivacyService/RestrictProcessing" => {
2396                    #[allow(non_camel_case_types)]
2397                    struct RestrictProcessingSvc<T: PrivacyService>(pub Arc<T>);
2398                    impl<
2399                        T: PrivacyService,
2400                    > tonic::server::UnaryService<super::RestrictProcessingRequest>
2401                    for RestrictProcessingSvc<T> {
2402                        type Response = super::RestrictProcessingResponse;
2403                        type Future = BoxFuture<
2404                            tonic::Response<Self::Response>,
2405                            tonic::Status,
2406                        >;
2407                        fn call(
2408                            &mut self,
2409                            request: tonic::Request<super::RestrictProcessingRequest>,
2410                        ) -> Self::Future {
2411                            let inner = Arc::clone(&self.0);
2412                            let fut = async move {
2413                                <T as PrivacyService>::restrict_processing(&inner, request)
2414                                    .await
2415                            };
2416                            Box::pin(fut)
2417                        }
2418                    }
2419                    let accept_compression_encodings = self.accept_compression_encodings;
2420                    let send_compression_encodings = self.send_compression_encodings;
2421                    let max_decoding_message_size = self.max_decoding_message_size;
2422                    let max_encoding_message_size = self.max_encoding_message_size;
2423                    let inner = self.inner.clone();
2424                    let fut = async move {
2425                        let method = RestrictProcessingSvc(inner);
2426                        let codec = tonic_prost::ProstCodec::default();
2427                        let mut grpc = tonic::server::Grpc::new(codec)
2428                            .apply_compression_config(
2429                                accept_compression_encodings,
2430                                send_compression_encodings,
2431                            )
2432                            .apply_max_message_size_config(
2433                                max_decoding_message_size,
2434                                max_encoding_message_size,
2435                            );
2436                        let res = grpc.unary(method, req).await;
2437                        Ok(res)
2438                    };
2439                    Box::pin(fut)
2440                }
2441                "/pidgr.v1.PrivacyService/GetDataExistenceConfirmation" => {
2442                    #[allow(non_camel_case_types)]
2443                    struct GetDataExistenceConfirmationSvc<T: PrivacyService>(
2444                        pub Arc<T>,
2445                    );
2446                    impl<
2447                        T: PrivacyService,
2448                    > tonic::server::UnaryService<
2449                        super::GetDataExistenceConfirmationRequest,
2450                    > for GetDataExistenceConfirmationSvc<T> {
2451                        type Response = super::GetDataExistenceConfirmationResponse;
2452                        type Future = BoxFuture<
2453                            tonic::Response<Self::Response>,
2454                            tonic::Status,
2455                        >;
2456                        fn call(
2457                            &mut self,
2458                            request: tonic::Request<
2459                                super::GetDataExistenceConfirmationRequest,
2460                            >,
2461                        ) -> Self::Future {
2462                            let inner = Arc::clone(&self.0);
2463                            let fut = async move {
2464                                <T as PrivacyService>::get_data_existence_confirmation(
2465                                        &inner,
2466                                        request,
2467                                    )
2468                                    .await
2469                            };
2470                            Box::pin(fut)
2471                        }
2472                    }
2473                    let accept_compression_encodings = self.accept_compression_encodings;
2474                    let send_compression_encodings = self.send_compression_encodings;
2475                    let max_decoding_message_size = self.max_decoding_message_size;
2476                    let max_encoding_message_size = self.max_encoding_message_size;
2477                    let inner = self.inner.clone();
2478                    let fut = async move {
2479                        let method = GetDataExistenceConfirmationSvc(inner);
2480                        let codec = tonic_prost::ProstCodec::default();
2481                        let mut grpc = tonic::server::Grpc::new(codec)
2482                            .apply_compression_config(
2483                                accept_compression_encodings,
2484                                send_compression_encodings,
2485                            )
2486                            .apply_max_message_size_config(
2487                                max_decoding_message_size,
2488                                max_encoding_message_size,
2489                            );
2490                        let res = grpc.unary(method, req).await;
2491                        Ok(res)
2492                    };
2493                    Box::pin(fut)
2494                }
2495                "/pidgr.v1.PrivacyService/ListPrivacyRequests" => {
2496                    #[allow(non_camel_case_types)]
2497                    struct ListPrivacyRequestsSvc<T: PrivacyService>(pub Arc<T>);
2498                    impl<
2499                        T: PrivacyService,
2500                    > tonic::server::UnaryService<super::ListPrivacyRequestsRequest>
2501                    for ListPrivacyRequestsSvc<T> {
2502                        type Response = super::ListPrivacyRequestsResponse;
2503                        type Future = BoxFuture<
2504                            tonic::Response<Self::Response>,
2505                            tonic::Status,
2506                        >;
2507                        fn call(
2508                            &mut self,
2509                            request: tonic::Request<super::ListPrivacyRequestsRequest>,
2510                        ) -> Self::Future {
2511                            let inner = Arc::clone(&self.0);
2512                            let fut = async move {
2513                                <T as PrivacyService>::list_privacy_requests(
2514                                        &inner,
2515                                        request,
2516                                    )
2517                                    .await
2518                            };
2519                            Box::pin(fut)
2520                        }
2521                    }
2522                    let accept_compression_encodings = self.accept_compression_encodings;
2523                    let send_compression_encodings = self.send_compression_encodings;
2524                    let max_decoding_message_size = self.max_decoding_message_size;
2525                    let max_encoding_message_size = self.max_encoding_message_size;
2526                    let inner = self.inner.clone();
2527                    let fut = async move {
2528                        let method = ListPrivacyRequestsSvc(inner);
2529                        let codec = tonic_prost::ProstCodec::default();
2530                        let mut grpc = tonic::server::Grpc::new(codec)
2531                            .apply_compression_config(
2532                                accept_compression_encodings,
2533                                send_compression_encodings,
2534                            )
2535                            .apply_max_message_size_config(
2536                                max_decoding_message_size,
2537                                max_encoding_message_size,
2538                            );
2539                        let res = grpc.unary(method, req).await;
2540                        Ok(res)
2541                    };
2542                    Box::pin(fut)
2543                }
2544                "/pidgr.v1.PrivacyService/CancelDeletion" => {
2545                    #[allow(non_camel_case_types)]
2546                    struct CancelDeletionSvc<T: PrivacyService>(pub Arc<T>);
2547                    impl<
2548                        T: PrivacyService,
2549                    > tonic::server::UnaryService<super::CancelDeletionRequest>
2550                    for CancelDeletionSvc<T> {
2551                        type Response = super::CancelDeletionResponse;
2552                        type Future = BoxFuture<
2553                            tonic::Response<Self::Response>,
2554                            tonic::Status,
2555                        >;
2556                        fn call(
2557                            &mut self,
2558                            request: tonic::Request<super::CancelDeletionRequest>,
2559                        ) -> Self::Future {
2560                            let inner = Arc::clone(&self.0);
2561                            let fut = async move {
2562                                <T as PrivacyService>::cancel_deletion(&inner, request)
2563                                    .await
2564                            };
2565                            Box::pin(fut)
2566                        }
2567                    }
2568                    let accept_compression_encodings = self.accept_compression_encodings;
2569                    let send_compression_encodings = self.send_compression_encodings;
2570                    let max_decoding_message_size = self.max_decoding_message_size;
2571                    let max_encoding_message_size = self.max_encoding_message_size;
2572                    let inner = self.inner.clone();
2573                    let fut = async move {
2574                        let method = CancelDeletionSvc(inner);
2575                        let codec = tonic_prost::ProstCodec::default();
2576                        let mut grpc = tonic::server::Grpc::new(codec)
2577                            .apply_compression_config(
2578                                accept_compression_encodings,
2579                                send_compression_encodings,
2580                            )
2581                            .apply_max_message_size_config(
2582                                max_decoding_message_size,
2583                                max_encoding_message_size,
2584                            );
2585                        let res = grpc.unary(method, req).await;
2586                        Ok(res)
2587                    };
2588                    Box::pin(fut)
2589                }
2590                "/pidgr.v1.PrivacyService/ImmediateDelete" => {
2591                    #[allow(non_camel_case_types)]
2592                    struct ImmediateDeleteSvc<T: PrivacyService>(pub Arc<T>);
2593                    impl<
2594                        T: PrivacyService,
2595                    > tonic::server::UnaryService<super::ImmediateDeleteRequest>
2596                    for ImmediateDeleteSvc<T> {
2597                        type Response = super::ImmediateDeleteResponse;
2598                        type Future = BoxFuture<
2599                            tonic::Response<Self::Response>,
2600                            tonic::Status,
2601                        >;
2602                        fn call(
2603                            &mut self,
2604                            request: tonic::Request<super::ImmediateDeleteRequest>,
2605                        ) -> Self::Future {
2606                            let inner = Arc::clone(&self.0);
2607                            let fut = async move {
2608                                <T as PrivacyService>::immediate_delete(&inner, request)
2609                                    .await
2610                            };
2611                            Box::pin(fut)
2612                        }
2613                    }
2614                    let accept_compression_encodings = self.accept_compression_encodings;
2615                    let send_compression_encodings = self.send_compression_encodings;
2616                    let max_decoding_message_size = self.max_decoding_message_size;
2617                    let max_encoding_message_size = self.max_encoding_message_size;
2618                    let inner = self.inner.clone();
2619                    let fut = async move {
2620                        let method = ImmediateDeleteSvc(inner);
2621                        let codec = tonic_prost::ProstCodec::default();
2622                        let mut grpc = tonic::server::Grpc::new(codec)
2623                            .apply_compression_config(
2624                                accept_compression_encodings,
2625                                send_compression_encodings,
2626                            )
2627                            .apply_max_message_size_config(
2628                                max_decoding_message_size,
2629                                max_encoding_message_size,
2630                            );
2631                        let res = grpc.unary(method, req).await;
2632                        Ok(res)
2633                    };
2634                    Box::pin(fut)
2635                }
2636                "/pidgr.v1.PrivacyService/ListMyPrivacyRequests" => {
2637                    #[allow(non_camel_case_types)]
2638                    struct ListMyPrivacyRequestsSvc<T: PrivacyService>(pub Arc<T>);
2639                    impl<
2640                        T: PrivacyService,
2641                    > tonic::server::UnaryService<super::ListMyPrivacyRequestsRequest>
2642                    for ListMyPrivacyRequestsSvc<T> {
2643                        type Response = super::ListMyPrivacyRequestsResponse;
2644                        type Future = BoxFuture<
2645                            tonic::Response<Self::Response>,
2646                            tonic::Status,
2647                        >;
2648                        fn call(
2649                            &mut self,
2650                            request: tonic::Request<super::ListMyPrivacyRequestsRequest>,
2651                        ) -> Self::Future {
2652                            let inner = Arc::clone(&self.0);
2653                            let fut = async move {
2654                                <T as PrivacyService>::list_my_privacy_requests(
2655                                        &inner,
2656                                        request,
2657                                    )
2658                                    .await
2659                            };
2660                            Box::pin(fut)
2661                        }
2662                    }
2663                    let accept_compression_encodings = self.accept_compression_encodings;
2664                    let send_compression_encodings = self.send_compression_encodings;
2665                    let max_decoding_message_size = self.max_decoding_message_size;
2666                    let max_encoding_message_size = self.max_encoding_message_size;
2667                    let inner = self.inner.clone();
2668                    let fut = async move {
2669                        let method = ListMyPrivacyRequestsSvc(inner);
2670                        let codec = tonic_prost::ProstCodec::default();
2671                        let mut grpc = tonic::server::Grpc::new(codec)
2672                            .apply_compression_config(
2673                                accept_compression_encodings,
2674                                send_compression_encodings,
2675                            )
2676                            .apply_max_message_size_config(
2677                                max_decoding_message_size,
2678                                max_encoding_message_size,
2679                            );
2680                        let res = grpc.unary(method, req).await;
2681                        Ok(res)
2682                    };
2683                    Box::pin(fut)
2684                }
2685                _ => {
2686                    Box::pin(async move {
2687                        let mut response = http::Response::new(
2688                            tonic::body::Body::default(),
2689                        );
2690                        let headers = response.headers_mut();
2691                        headers
2692                            .insert(
2693                                tonic::Status::GRPC_STATUS,
2694                                (tonic::Code::Unimplemented as i32).into(),
2695                            );
2696                        headers
2697                            .insert(
2698                                http::header::CONTENT_TYPE,
2699                                tonic::metadata::GRPC_CONTENT_TYPE,
2700                            );
2701                        Ok(response)
2702                    })
2703                }
2704            }
2705        }
2706    }
2707    impl<T> Clone for PrivacyServiceServer<T> {
2708        fn clone(&self) -> Self {
2709            let inner = self.inner.clone();
2710            Self {
2711                inner,
2712                accept_compression_encodings: self.accept_compression_encodings,
2713                send_compression_encodings: self.send_compression_encodings,
2714                max_decoding_message_size: self.max_decoding_message_size,
2715                max_encoding_message_size: self.max_encoding_message_size,
2716            }
2717        }
2718    }
2719    /// Generated gRPC service name
2720    pub const SERVICE_NAME: &str = "pidgr.v1.PrivacyService";
2721    impl<T> tonic::server::NamedService for PrivacyServiceServer<T> {
2722        const NAME: &'static str = SERVICE_NAME;
2723    }
2724}
2725/// Generated client implementations.
2726pub mod audit_service_client {
2727    #![allow(
2728        unused_variables,
2729        dead_code,
2730        missing_docs,
2731        clippy::wildcard_imports,
2732        clippy::let_unit_value,
2733    )]
2734    use tonic::codegen::*;
2735    use tonic::codegen::http::Uri;
2736    /** AuditService provides read access to the append-only audit trail, plus an
2737 internal-mTLS-only Append RPC for sibling services that need to record
2738 their own audit events into the shared trail.
2739
2740 All read RPCs extract org_id from the JWT — it is never in request
2741 messages. The Append RPC carries org_id explicitly because it is
2742 invoked over the internal mTLS mesh, not by a JWT-authenticated user.
2743*/
2744    #[derive(Debug, Clone)]
2745    pub struct AuditServiceClient<T> {
2746        inner: tonic::client::Grpc<T>,
2747    }
2748    impl AuditServiceClient<tonic::transport::Channel> {
2749        /// Attempt to create a new client by connecting to a given endpoint.
2750        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
2751        where
2752            D: TryInto<tonic::transport::Endpoint>,
2753            D::Error: Into<StdError>,
2754        {
2755            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
2756            Ok(Self::new(conn))
2757        }
2758    }
2759    impl<T> AuditServiceClient<T>
2760    where
2761        T: tonic::client::GrpcService<tonic::body::Body>,
2762        T::Error: Into<StdError>,
2763        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
2764        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
2765    {
2766        pub fn new(inner: T) -> Self {
2767            let inner = tonic::client::Grpc::new(inner);
2768            Self { inner }
2769        }
2770        pub fn with_origin(inner: T, origin: Uri) -> Self {
2771            let inner = tonic::client::Grpc::with_origin(inner, origin);
2772            Self { inner }
2773        }
2774        pub fn with_interceptor<F>(
2775            inner: T,
2776            interceptor: F,
2777        ) -> AuditServiceClient<InterceptedService<T, F>>
2778        where
2779            F: tonic::service::Interceptor,
2780            T::ResponseBody: Default,
2781            T: tonic::codegen::Service<
2782                http::Request<tonic::body::Body>,
2783                Response = http::Response<
2784                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
2785                >,
2786            >,
2787            <T as tonic::codegen::Service<
2788                http::Request<tonic::body::Body>,
2789            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
2790        {
2791            AuditServiceClient::new(InterceptedService::new(inner, interceptor))
2792        }
2793        /// Compress requests with the given encoding.
2794        ///
2795        /// This requires the server to support it otherwise it might respond with an
2796        /// error.
2797        #[must_use]
2798        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2799            self.inner = self.inner.send_compressed(encoding);
2800            self
2801        }
2802        /// Enable decompressing responses.
2803        #[must_use]
2804        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2805            self.inner = self.inner.accept_compressed(encoding);
2806            self
2807        }
2808        /// Limits the maximum size of a decoded message.
2809        ///
2810        /// Default: `4MB`
2811        #[must_use]
2812        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2813            self.inner = self.inner.max_decoding_message_size(limit);
2814            self
2815        }
2816        /// Limits the maximum size of an encoded message.
2817        ///
2818        /// Default: `usize::MAX`
2819        #[must_use]
2820        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2821            self.inner = self.inner.max_encoding_message_size(limit);
2822            self
2823        }
2824        /** List audit events with optional filtering by event type, actor, and date range.
2825 Results are ordered by created_at descending (newest first).
2826 Auth: Requires JWT. Admin only.
2827*/
2828        pub async fn list_audit_events(
2829            &mut self,
2830            request: impl tonic::IntoRequest<super::ListAuditEventsRequest>,
2831        ) -> std::result::Result<
2832            tonic::Response<super::ListAuditEventsResponse>,
2833            tonic::Status,
2834        > {
2835            self.inner
2836                .ready()
2837                .await
2838                .map_err(|e| {
2839                    tonic::Status::unknown(
2840                        format!("Service was not ready: {}", e.into()),
2841                    )
2842                })?;
2843            let codec = tonic_prost::ProstCodec::default();
2844            let path = http::uri::PathAndQuery::from_static(
2845                "/pidgr.v1.AuditService/ListAuditEvents",
2846            );
2847            let mut req = request.into_request();
2848            req.extensions_mut()
2849                .insert(GrpcMethod::new("pidgr.v1.AuditService", "ListAuditEvents"));
2850            self.inner.unary(req, path, codec).await
2851        }
2852        /** Export the audit trail to S3 in CSV, JSON, or Parquet format.
2853 Creates a persistent record and starts an async Temporal workflow.
2854 Auth: Requires JWT. Admin only.
2855*/
2856        pub async fn export_audit_trail(
2857            &mut self,
2858            request: impl tonic::IntoRequest<super::ExportAuditTrailRequest>,
2859        ) -> std::result::Result<
2860            tonic::Response<super::ExportAuditTrailResponse>,
2861            tonic::Status,
2862        > {
2863            self.inner
2864                .ready()
2865                .await
2866                .map_err(|e| {
2867                    tonic::Status::unknown(
2868                        format!("Service was not ready: {}", e.into()),
2869                    )
2870                })?;
2871            let codec = tonic_prost::ProstCodec::default();
2872            let path = http::uri::PathAndQuery::from_static(
2873                "/pidgr.v1.AuditService/ExportAuditTrail",
2874            );
2875            let mut req = request.into_request();
2876            req.extensions_mut()
2877                .insert(GrpcMethod::new("pidgr.v1.AuditService", "ExportAuditTrail"));
2878            self.inner.unary(req, path, codec).await
2879        }
2880        /** List audit export history for the organization.
2881 Auth: Requires JWT. Admin only.
2882*/
2883        pub async fn list_audit_exports(
2884            &mut self,
2885            request: impl tonic::IntoRequest<super::ListAuditExportsRequest>,
2886        ) -> std::result::Result<
2887            tonic::Response<super::ListAuditExportsResponse>,
2888            tonic::Status,
2889        > {
2890            self.inner
2891                .ready()
2892                .await
2893                .map_err(|e| {
2894                    tonic::Status::unknown(
2895                        format!("Service was not ready: {}", e.into()),
2896                    )
2897                })?;
2898            let codec = tonic_prost::ProstCodec::default();
2899            let path = http::uri::PathAndQuery::from_static(
2900                "/pidgr.v1.AuditService/ListAuditExports",
2901            );
2902            let mut req = request.into_request();
2903            req.extensions_mut()
2904                .insert(GrpcMethod::new("pidgr.v1.AuditService", "ListAuditExports"));
2905            self.inner.unary(req, path, codec).await
2906        }
2907        /** Append one audit event to the trail. Used by sibling services
2908 (pidgr-integrations, future internal services) to record GDPR-relevant
2909 events that originate outside pidgr-api.
2910
2911 Auth: INTERNAL-mTLS ONLY. The server MUST reject any caller that
2912 presents only a JWT. The server MUST allowlist callers by their mTLS
2913 client-certificate subject DN.
2914*/
2915        pub async fn append(
2916            &mut self,
2917            request: impl tonic::IntoRequest<super::AppendRequest>,
2918        ) -> std::result::Result<tonic::Response<super::AppendResponse>, tonic::Status> {
2919            self.inner
2920                .ready()
2921                .await
2922                .map_err(|e| {
2923                    tonic::Status::unknown(
2924                        format!("Service was not ready: {}", e.into()),
2925                    )
2926                })?;
2927            let codec = tonic_prost::ProstCodec::default();
2928            let path = http::uri::PathAndQuery::from_static(
2929                "/pidgr.v1.AuditService/Append",
2930            );
2931            let mut req = request.into_request();
2932            req.extensions_mut()
2933                .insert(GrpcMethod::new("pidgr.v1.AuditService", "Append"));
2934            self.inner.unary(req, path, codec).await
2935        }
2936    }
2937}
2938/// Generated server implementations.
2939pub mod audit_service_server {
2940    #![allow(
2941        unused_variables,
2942        dead_code,
2943        missing_docs,
2944        clippy::wildcard_imports,
2945        clippy::let_unit_value,
2946    )]
2947    use tonic::codegen::*;
2948    /// Generated trait containing gRPC methods that should be implemented for use with AuditServiceServer.
2949    #[async_trait]
2950    pub trait AuditService: std::marker::Send + std::marker::Sync + 'static {
2951        /** List audit events with optional filtering by event type, actor, and date range.
2952 Results are ordered by created_at descending (newest first).
2953 Auth: Requires JWT. Admin only.
2954*/
2955        async fn list_audit_events(
2956            &self,
2957            request: tonic::Request<super::ListAuditEventsRequest>,
2958        ) -> std::result::Result<
2959            tonic::Response<super::ListAuditEventsResponse>,
2960            tonic::Status,
2961        >;
2962        /** Export the audit trail to S3 in CSV, JSON, or Parquet format.
2963 Creates a persistent record and starts an async Temporal workflow.
2964 Auth: Requires JWT. Admin only.
2965*/
2966        async fn export_audit_trail(
2967            &self,
2968            request: tonic::Request<super::ExportAuditTrailRequest>,
2969        ) -> std::result::Result<
2970            tonic::Response<super::ExportAuditTrailResponse>,
2971            tonic::Status,
2972        >;
2973        /** List audit export history for the organization.
2974 Auth: Requires JWT. Admin only.
2975*/
2976        async fn list_audit_exports(
2977            &self,
2978            request: tonic::Request<super::ListAuditExportsRequest>,
2979        ) -> std::result::Result<
2980            tonic::Response<super::ListAuditExportsResponse>,
2981            tonic::Status,
2982        >;
2983        /** Append one audit event to the trail. Used by sibling services
2984 (pidgr-integrations, future internal services) to record GDPR-relevant
2985 events that originate outside pidgr-api.
2986
2987 Auth: INTERNAL-mTLS ONLY. The server MUST reject any caller that
2988 presents only a JWT. The server MUST allowlist callers by their mTLS
2989 client-certificate subject DN.
2990*/
2991        async fn append(
2992            &self,
2993            request: tonic::Request<super::AppendRequest>,
2994        ) -> std::result::Result<tonic::Response<super::AppendResponse>, tonic::Status>;
2995    }
2996    /** AuditService provides read access to the append-only audit trail, plus an
2997 internal-mTLS-only Append RPC for sibling services that need to record
2998 their own audit events into the shared trail.
2999
3000 All read RPCs extract org_id from the JWT — it is never in request
3001 messages. The Append RPC carries org_id explicitly because it is
3002 invoked over the internal mTLS mesh, not by a JWT-authenticated user.
3003*/
3004    #[derive(Debug)]
3005    pub struct AuditServiceServer<T> {
3006        inner: Arc<T>,
3007        accept_compression_encodings: EnabledCompressionEncodings,
3008        send_compression_encodings: EnabledCompressionEncodings,
3009        max_decoding_message_size: Option<usize>,
3010        max_encoding_message_size: Option<usize>,
3011    }
3012    impl<T> AuditServiceServer<T> {
3013        pub fn new(inner: T) -> Self {
3014            Self::from_arc(Arc::new(inner))
3015        }
3016        pub fn from_arc(inner: Arc<T>) -> Self {
3017            Self {
3018                inner,
3019                accept_compression_encodings: Default::default(),
3020                send_compression_encodings: Default::default(),
3021                max_decoding_message_size: None,
3022                max_encoding_message_size: None,
3023            }
3024        }
3025        pub fn with_interceptor<F>(
3026            inner: T,
3027            interceptor: F,
3028        ) -> InterceptedService<Self, F>
3029        where
3030            F: tonic::service::Interceptor,
3031        {
3032            InterceptedService::new(Self::new(inner), interceptor)
3033        }
3034        /// Enable decompressing requests with the given encoding.
3035        #[must_use]
3036        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3037            self.accept_compression_encodings.enable(encoding);
3038            self
3039        }
3040        /// Compress responses with the given encoding, if the client supports it.
3041        #[must_use]
3042        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3043            self.send_compression_encodings.enable(encoding);
3044            self
3045        }
3046        /// Limits the maximum size of a decoded message.
3047        ///
3048        /// Default: `4MB`
3049        #[must_use]
3050        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3051            self.max_decoding_message_size = Some(limit);
3052            self
3053        }
3054        /// Limits the maximum size of an encoded message.
3055        ///
3056        /// Default: `usize::MAX`
3057        #[must_use]
3058        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3059            self.max_encoding_message_size = Some(limit);
3060            self
3061        }
3062    }
3063    impl<T, B> tonic::codegen::Service<http::Request<B>> for AuditServiceServer<T>
3064    where
3065        T: AuditService,
3066        B: Body + std::marker::Send + 'static,
3067        B::Error: Into<StdError> + std::marker::Send + 'static,
3068    {
3069        type Response = http::Response<tonic::body::Body>;
3070        type Error = std::convert::Infallible;
3071        type Future = BoxFuture<Self::Response, Self::Error>;
3072        fn poll_ready(
3073            &mut self,
3074            _cx: &mut Context<'_>,
3075        ) -> Poll<std::result::Result<(), Self::Error>> {
3076            Poll::Ready(Ok(()))
3077        }
3078        fn call(&mut self, req: http::Request<B>) -> Self::Future {
3079            match req.uri().path() {
3080                "/pidgr.v1.AuditService/ListAuditEvents" => {
3081                    #[allow(non_camel_case_types)]
3082                    struct ListAuditEventsSvc<T: AuditService>(pub Arc<T>);
3083                    impl<
3084                        T: AuditService,
3085                    > tonic::server::UnaryService<super::ListAuditEventsRequest>
3086                    for ListAuditEventsSvc<T> {
3087                        type Response = super::ListAuditEventsResponse;
3088                        type Future = BoxFuture<
3089                            tonic::Response<Self::Response>,
3090                            tonic::Status,
3091                        >;
3092                        fn call(
3093                            &mut self,
3094                            request: tonic::Request<super::ListAuditEventsRequest>,
3095                        ) -> Self::Future {
3096                            let inner = Arc::clone(&self.0);
3097                            let fut = async move {
3098                                <T as AuditService>::list_audit_events(&inner, request)
3099                                    .await
3100                            };
3101                            Box::pin(fut)
3102                        }
3103                    }
3104                    let accept_compression_encodings = self.accept_compression_encodings;
3105                    let send_compression_encodings = self.send_compression_encodings;
3106                    let max_decoding_message_size = self.max_decoding_message_size;
3107                    let max_encoding_message_size = self.max_encoding_message_size;
3108                    let inner = self.inner.clone();
3109                    let fut = async move {
3110                        let method = ListAuditEventsSvc(inner);
3111                        let codec = tonic_prost::ProstCodec::default();
3112                        let mut grpc = tonic::server::Grpc::new(codec)
3113                            .apply_compression_config(
3114                                accept_compression_encodings,
3115                                send_compression_encodings,
3116                            )
3117                            .apply_max_message_size_config(
3118                                max_decoding_message_size,
3119                                max_encoding_message_size,
3120                            );
3121                        let res = grpc.unary(method, req).await;
3122                        Ok(res)
3123                    };
3124                    Box::pin(fut)
3125                }
3126                "/pidgr.v1.AuditService/ExportAuditTrail" => {
3127                    #[allow(non_camel_case_types)]
3128                    struct ExportAuditTrailSvc<T: AuditService>(pub Arc<T>);
3129                    impl<
3130                        T: AuditService,
3131                    > tonic::server::UnaryService<super::ExportAuditTrailRequest>
3132                    for ExportAuditTrailSvc<T> {
3133                        type Response = super::ExportAuditTrailResponse;
3134                        type Future = BoxFuture<
3135                            tonic::Response<Self::Response>,
3136                            tonic::Status,
3137                        >;
3138                        fn call(
3139                            &mut self,
3140                            request: tonic::Request<super::ExportAuditTrailRequest>,
3141                        ) -> Self::Future {
3142                            let inner = Arc::clone(&self.0);
3143                            let fut = async move {
3144                                <T as AuditService>::export_audit_trail(&inner, request)
3145                                    .await
3146                            };
3147                            Box::pin(fut)
3148                        }
3149                    }
3150                    let accept_compression_encodings = self.accept_compression_encodings;
3151                    let send_compression_encodings = self.send_compression_encodings;
3152                    let max_decoding_message_size = self.max_decoding_message_size;
3153                    let max_encoding_message_size = self.max_encoding_message_size;
3154                    let inner = self.inner.clone();
3155                    let fut = async move {
3156                        let method = ExportAuditTrailSvc(inner);
3157                        let codec = tonic_prost::ProstCodec::default();
3158                        let mut grpc = tonic::server::Grpc::new(codec)
3159                            .apply_compression_config(
3160                                accept_compression_encodings,
3161                                send_compression_encodings,
3162                            )
3163                            .apply_max_message_size_config(
3164                                max_decoding_message_size,
3165                                max_encoding_message_size,
3166                            );
3167                        let res = grpc.unary(method, req).await;
3168                        Ok(res)
3169                    };
3170                    Box::pin(fut)
3171                }
3172                "/pidgr.v1.AuditService/ListAuditExports" => {
3173                    #[allow(non_camel_case_types)]
3174                    struct ListAuditExportsSvc<T: AuditService>(pub Arc<T>);
3175                    impl<
3176                        T: AuditService,
3177                    > tonic::server::UnaryService<super::ListAuditExportsRequest>
3178                    for ListAuditExportsSvc<T> {
3179                        type Response = super::ListAuditExportsResponse;
3180                        type Future = BoxFuture<
3181                            tonic::Response<Self::Response>,
3182                            tonic::Status,
3183                        >;
3184                        fn call(
3185                            &mut self,
3186                            request: tonic::Request<super::ListAuditExportsRequest>,
3187                        ) -> Self::Future {
3188                            let inner = Arc::clone(&self.0);
3189                            let fut = async move {
3190                                <T as AuditService>::list_audit_exports(&inner, request)
3191                                    .await
3192                            };
3193                            Box::pin(fut)
3194                        }
3195                    }
3196                    let accept_compression_encodings = self.accept_compression_encodings;
3197                    let send_compression_encodings = self.send_compression_encodings;
3198                    let max_decoding_message_size = self.max_decoding_message_size;
3199                    let max_encoding_message_size = self.max_encoding_message_size;
3200                    let inner = self.inner.clone();
3201                    let fut = async move {
3202                        let method = ListAuditExportsSvc(inner);
3203                        let codec = tonic_prost::ProstCodec::default();
3204                        let mut grpc = tonic::server::Grpc::new(codec)
3205                            .apply_compression_config(
3206                                accept_compression_encodings,
3207                                send_compression_encodings,
3208                            )
3209                            .apply_max_message_size_config(
3210                                max_decoding_message_size,
3211                                max_encoding_message_size,
3212                            );
3213                        let res = grpc.unary(method, req).await;
3214                        Ok(res)
3215                    };
3216                    Box::pin(fut)
3217                }
3218                "/pidgr.v1.AuditService/Append" => {
3219                    #[allow(non_camel_case_types)]
3220                    struct AppendSvc<T: AuditService>(pub Arc<T>);
3221                    impl<
3222                        T: AuditService,
3223                    > tonic::server::UnaryService<super::AppendRequest>
3224                    for AppendSvc<T> {
3225                        type Response = super::AppendResponse;
3226                        type Future = BoxFuture<
3227                            tonic::Response<Self::Response>,
3228                            tonic::Status,
3229                        >;
3230                        fn call(
3231                            &mut self,
3232                            request: tonic::Request<super::AppendRequest>,
3233                        ) -> Self::Future {
3234                            let inner = Arc::clone(&self.0);
3235                            let fut = async move {
3236                                <T as AuditService>::append(&inner, request).await
3237                            };
3238                            Box::pin(fut)
3239                        }
3240                    }
3241                    let accept_compression_encodings = self.accept_compression_encodings;
3242                    let send_compression_encodings = self.send_compression_encodings;
3243                    let max_decoding_message_size = self.max_decoding_message_size;
3244                    let max_encoding_message_size = self.max_encoding_message_size;
3245                    let inner = self.inner.clone();
3246                    let fut = async move {
3247                        let method = AppendSvc(inner);
3248                        let codec = tonic_prost::ProstCodec::default();
3249                        let mut grpc = tonic::server::Grpc::new(codec)
3250                            .apply_compression_config(
3251                                accept_compression_encodings,
3252                                send_compression_encodings,
3253                            )
3254                            .apply_max_message_size_config(
3255                                max_decoding_message_size,
3256                                max_encoding_message_size,
3257                            );
3258                        let res = grpc.unary(method, req).await;
3259                        Ok(res)
3260                    };
3261                    Box::pin(fut)
3262                }
3263                _ => {
3264                    Box::pin(async move {
3265                        let mut response = http::Response::new(
3266                            tonic::body::Body::default(),
3267                        );
3268                        let headers = response.headers_mut();
3269                        headers
3270                            .insert(
3271                                tonic::Status::GRPC_STATUS,
3272                                (tonic::Code::Unimplemented as i32).into(),
3273                            );
3274                        headers
3275                            .insert(
3276                                http::header::CONTENT_TYPE,
3277                                tonic::metadata::GRPC_CONTENT_TYPE,
3278                            );
3279                        Ok(response)
3280                    })
3281                }
3282            }
3283        }
3284    }
3285    impl<T> Clone for AuditServiceServer<T> {
3286        fn clone(&self) -> Self {
3287            let inner = self.inner.clone();
3288            Self {
3289                inner,
3290                accept_compression_encodings: self.accept_compression_encodings,
3291                send_compression_encodings: self.send_compression_encodings,
3292                max_decoding_message_size: self.max_decoding_message_size,
3293                max_encoding_message_size: self.max_encoding_message_size,
3294            }
3295        }
3296    }
3297    /// Generated gRPC service name
3298    pub const SERVICE_NAME: &str = "pidgr.v1.AuditService";
3299    impl<T> tonic::server::NamedService for AuditServiceServer<T> {
3300        const NAME: &'static str = SERVICE_NAME;
3301    }
3302}
3303/// Generated client implementations.
3304pub mod campaign_service_client {
3305    #![allow(
3306        unused_variables,
3307        dead_code,
3308        missing_docs,
3309        clippy::wildcard_imports,
3310        clippy::let_unit_value,
3311    )]
3312    use tonic::codegen::*;
3313    use tonic::codegen::http::Uri;
3314    /** Manages the full lifecycle of communication campaigns — creation,
3315 execution, monitoring, and cancellation.
3316*/
3317    #[derive(Debug, Clone)]
3318    pub struct CampaignServiceClient<T> {
3319        inner: tonic::client::Grpc<T>,
3320    }
3321    impl CampaignServiceClient<tonic::transport::Channel> {
3322        /// Attempt to create a new client by connecting to a given endpoint.
3323        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
3324        where
3325            D: TryInto<tonic::transport::Endpoint>,
3326            D::Error: Into<StdError>,
3327        {
3328            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
3329            Ok(Self::new(conn))
3330        }
3331    }
3332    impl<T> CampaignServiceClient<T>
3333    where
3334        T: tonic::client::GrpcService<tonic::body::Body>,
3335        T::Error: Into<StdError>,
3336        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
3337        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
3338    {
3339        pub fn new(inner: T) -> Self {
3340            let inner = tonic::client::Grpc::new(inner);
3341            Self { inner }
3342        }
3343        pub fn with_origin(inner: T, origin: Uri) -> Self {
3344            let inner = tonic::client::Grpc::with_origin(inner, origin);
3345            Self { inner }
3346        }
3347        pub fn with_interceptor<F>(
3348            inner: T,
3349            interceptor: F,
3350        ) -> CampaignServiceClient<InterceptedService<T, F>>
3351        where
3352            F: tonic::service::Interceptor,
3353            T::ResponseBody: Default,
3354            T: tonic::codegen::Service<
3355                http::Request<tonic::body::Body>,
3356                Response = http::Response<
3357                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
3358                >,
3359            >,
3360            <T as tonic::codegen::Service<
3361                http::Request<tonic::body::Body>,
3362            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
3363        {
3364            CampaignServiceClient::new(InterceptedService::new(inner, interceptor))
3365        }
3366        /// Compress requests with the given encoding.
3367        ///
3368        /// This requires the server to support it otherwise it might respond with an
3369        /// error.
3370        #[must_use]
3371        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3372            self.inner = self.inner.send_compressed(encoding);
3373            self
3374        }
3375        /// Enable decompressing responses.
3376        #[must_use]
3377        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3378            self.inner = self.inner.accept_compressed(encoding);
3379            self
3380        }
3381        /// Limits the maximum size of a decoded message.
3382        ///
3383        /// Default: `4MB`
3384        #[must_use]
3385        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3386            self.inner = self.inner.max_decoding_message_size(limit);
3387            self
3388        }
3389        /// Limits the maximum size of an encoded message.
3390        ///
3391        /// Default: `usize::MAX`
3392        #[must_use]
3393        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3394            self.inner = self.inner.max_encoding_message_size(limit);
3395            self
3396        }
3397        /** Create a new campaign with a template, audience, and workflow.
3398 Authorization: Requires MANAGER+ role.
3399*/
3400        pub async fn create_campaign(
3401            &mut self,
3402            request: impl tonic::IntoRequest<super::CreateCampaignRequest>,
3403        ) -> std::result::Result<
3404            tonic::Response<super::CreateCampaignResponse>,
3405            tonic::Status,
3406        > {
3407            self.inner
3408                .ready()
3409                .await
3410                .map_err(|e| {
3411                    tonic::Status::unknown(
3412                        format!("Service was not ready: {}", e.into()),
3413                    )
3414                })?;
3415            let codec = tonic_prost::ProstCodec::default();
3416            let path = http::uri::PathAndQuery::from_static(
3417                "/pidgr.v1.CampaignService/CreateCampaign",
3418            );
3419            let mut req = request.into_request();
3420            req.extensions_mut()
3421                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "CreateCampaign"));
3422            self.inner.unary(req, path, codec).await
3423        }
3424        /** Start a created campaign, triggering its workflow execution via the orchestration engine.
3425 Authorization: Requires MANAGER+ role.
3426*/
3427        pub async fn start_campaign(
3428            &mut self,
3429            request: impl tonic::IntoRequest<super::StartCampaignRequest>,
3430        ) -> std::result::Result<
3431            tonic::Response<super::StartCampaignResponse>,
3432            tonic::Status,
3433        > {
3434            self.inner
3435                .ready()
3436                .await
3437                .map_err(|e| {
3438                    tonic::Status::unknown(
3439                        format!("Service was not ready: {}", e.into()),
3440                    )
3441                })?;
3442            let codec = tonic_prost::ProstCodec::default();
3443            let path = http::uri::PathAndQuery::from_static(
3444                "/pidgr.v1.CampaignService/StartCampaign",
3445            );
3446            let mut req = request.into_request();
3447            req.extensions_mut()
3448                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "StartCampaign"));
3449            self.inner.unary(req, path, codec).await
3450        }
3451        /** Retrieve a single campaign by ID.
3452 Authorization: Authenticated user within the organization.
3453*/
3454        pub async fn get_campaign(
3455            &mut self,
3456            request: impl tonic::IntoRequest<super::GetCampaignRequest>,
3457        ) -> std::result::Result<
3458            tonic::Response<super::GetCampaignResponse>,
3459            tonic::Status,
3460        > {
3461            self.inner
3462                .ready()
3463                .await
3464                .map_err(|e| {
3465                    tonic::Status::unknown(
3466                        format!("Service was not ready: {}", e.into()),
3467                    )
3468                })?;
3469            let codec = tonic_prost::ProstCodec::default();
3470            let path = http::uri::PathAndQuery::from_static(
3471                "/pidgr.v1.CampaignService/GetCampaign",
3472            );
3473            let mut req = request.into_request();
3474            req.extensions_mut()
3475                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "GetCampaign"));
3476            self.inner.unary(req, path, codec).await
3477        }
3478        /** List campaigns for the organization with pagination.
3479 Authorization: Authenticated user within the organization.
3480*/
3481        pub async fn list_campaigns(
3482            &mut self,
3483            request: impl tonic::IntoRequest<super::ListCampaignsRequest>,
3484        ) -> std::result::Result<
3485            tonic::Response<super::ListCampaignsResponse>,
3486            tonic::Status,
3487        > {
3488            self.inner
3489                .ready()
3490                .await
3491                .map_err(|e| {
3492                    tonic::Status::unknown(
3493                        format!("Service was not ready: {}", e.into()),
3494                    )
3495                })?;
3496            let codec = tonic_prost::ProstCodec::default();
3497            let path = http::uri::PathAndQuery::from_static(
3498                "/pidgr.v1.CampaignService/ListCampaigns",
3499            );
3500            let mut req = request.into_request();
3501            req.extensions_mut()
3502                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "ListCampaigns"));
3503            self.inner.unary(req, path, codec).await
3504        }
3505        /** Update a draft campaign (CREATED status only). Non-empty fields overwrite existing values.
3506 Authorization: Requires MANAGER+ role.
3507*/
3508        pub async fn update_campaign(
3509            &mut self,
3510            request: impl tonic::IntoRequest<super::UpdateCampaignRequest>,
3511        ) -> std::result::Result<
3512            tonic::Response<super::UpdateCampaignResponse>,
3513            tonic::Status,
3514        > {
3515            self.inner
3516                .ready()
3517                .await
3518                .map_err(|e| {
3519                    tonic::Status::unknown(
3520                        format!("Service was not ready: {}", e.into()),
3521                    )
3522                })?;
3523            let codec = tonic_prost::ProstCodec::default();
3524            let path = http::uri::PathAndQuery::from_static(
3525                "/pidgr.v1.CampaignService/UpdateCampaign",
3526            );
3527            let mut req = request.into_request();
3528            req.extensions_mut()
3529                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "UpdateCampaign"));
3530            self.inner.unary(req, path, codec).await
3531        }
3532        /** Cancel a running campaign, stopping further deliveries and reminders.
3533 Authorization: Requires MANAGER+ role.
3534*/
3535        pub async fn cancel_campaign(
3536            &mut self,
3537            request: impl tonic::IntoRequest<super::CancelCampaignRequest>,
3538        ) -> std::result::Result<
3539            tonic::Response<super::CancelCampaignResponse>,
3540            tonic::Status,
3541        > {
3542            self.inner
3543                .ready()
3544                .await
3545                .map_err(|e| {
3546                    tonic::Status::unknown(
3547                        format!("Service was not ready: {}", e.into()),
3548                    )
3549                })?;
3550            let codec = tonic_prost::ProstCodec::default();
3551            let path = http::uri::PathAndQuery::from_static(
3552                "/pidgr.v1.CampaignService/CancelCampaign",
3553            );
3554            let mut req = request.into_request();
3555            req.extensions_mut()
3556                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "CancelCampaign"));
3557            self.inner.unary(req, path, codec).await
3558        }
3559        /** List delivery records for a campaign, optionally filtered by status.
3560 Authorization: Authenticated user within the organization.
3561*/
3562        pub async fn list_deliveries(
3563            &mut self,
3564            request: impl tonic::IntoRequest<super::ListDeliveriesRequest>,
3565        ) -> std::result::Result<
3566            tonic::Response<super::ListDeliveriesResponse>,
3567            tonic::Status,
3568        > {
3569            self.inner
3570                .ready()
3571                .await
3572                .map_err(|e| {
3573                    tonic::Status::unknown(
3574                        format!("Service was not ready: {}", e.into()),
3575                    )
3576                })?;
3577            let codec = tonic_prost::ProstCodec::default();
3578            let path = http::uri::PathAndQuery::from_static(
3579                "/pidgr.v1.CampaignService/ListDeliveries",
3580            );
3581            let mut req = request.into_request();
3582            req.extensions_mut()
3583                .insert(GrpcMethod::new("pidgr.v1.CampaignService", "ListDeliveries"));
3584            self.inner.unary(req, path, codec).await
3585        }
3586        /** Break down a campaign's recipients by current archetype membership
3587 and return ack-rate per bucket, with k-anonymity gate applied.
3588 Only valid for campaigns whose originating_archetype is set.
3589 Authorization: Authenticated user within the organization.
3590*/
3591        pub async fn get_campaign_archetype_breakdown(
3592            &mut self,
3593            request: impl tonic::IntoRequest<super::GetCampaignArchetypeBreakdownRequest>,
3594        ) -> std::result::Result<
3595            tonic::Response<super::GetCampaignArchetypeBreakdownResponse>,
3596            tonic::Status,
3597        > {
3598            self.inner
3599                .ready()
3600                .await
3601                .map_err(|e| {
3602                    tonic::Status::unknown(
3603                        format!("Service was not ready: {}", e.into()),
3604                    )
3605                })?;
3606            let codec = tonic_prost::ProstCodec::default();
3607            let path = http::uri::PathAndQuery::from_static(
3608                "/pidgr.v1.CampaignService/GetCampaignArchetypeBreakdown",
3609            );
3610            let mut req = request.into_request();
3611            req.extensions_mut()
3612                .insert(
3613                    GrpcMethod::new(
3614                        "pidgr.v1.CampaignService",
3615                        "GetCampaignArchetypeBreakdown",
3616                    ),
3617                );
3618            self.inner.unary(req, path, codec).await
3619        }
3620        /** Resolve a campaign's 8-character base62 short-code, lazily
3621 generating one on the first call. Stable for the campaign's
3622 lifetime; the same campaign always returns the same code.
3623 Authorization: Internal-service callers only (mTLS-gated). The
3624 dispatch layer calls this when assembling a third-party-channel
3625 deeplink.
3626*/
3627        pub async fn resolve_or_create_short_code(
3628            &mut self,
3629            request: impl tonic::IntoRequest<super::ResolveOrCreateShortCodeRequest>,
3630        ) -> std::result::Result<
3631            tonic::Response<super::ResolveOrCreateShortCodeResponse>,
3632            tonic::Status,
3633        > {
3634            self.inner
3635                .ready()
3636                .await
3637                .map_err(|e| {
3638                    tonic::Status::unknown(
3639                        format!("Service was not ready: {}", e.into()),
3640                    )
3641                })?;
3642            let codec = tonic_prost::ProstCodec::default();
3643            let path = http::uri::PathAndQuery::from_static(
3644                "/pidgr.v1.CampaignService/ResolveOrCreateShortCode",
3645            );
3646            let mut req = request.into_request();
3647            req.extensions_mut()
3648                .insert(
3649                    GrpcMethod::new(
3650                        "pidgr.v1.CampaignService",
3651                        "ResolveOrCreateShortCode",
3652                    ),
3653                );
3654            self.inner.unary(req, path, codec).await
3655        }
3656        /** Look up a campaign by its short-code. Returns minimal, non-PII
3657 metadata sufficient for the native app to route a tapped
3658 third-party-channel deeplink to the correct campaign card and
3659 show org branding before the auth gate.
3660 Authorization: Unauthenticated. The short-code IS the lookup key;
3661 returned fields are already visible to the recipient via their
3662 inbox or the org's public profile.
3663*/
3664        pub async fn get_campaign_by_short_code(
3665            &mut self,
3666            request: impl tonic::IntoRequest<super::GetCampaignByShortCodeRequest>,
3667        ) -> std::result::Result<
3668            tonic::Response<super::GetCampaignByShortCodeResponse>,
3669            tonic::Status,
3670        > {
3671            self.inner
3672                .ready()
3673                .await
3674                .map_err(|e| {
3675                    tonic::Status::unknown(
3676                        format!("Service was not ready: {}", e.into()),
3677                    )
3678                })?;
3679            let codec = tonic_prost::ProstCodec::default();
3680            let path = http::uri::PathAndQuery::from_static(
3681                "/pidgr.v1.CampaignService/GetCampaignByShortCode",
3682            );
3683            let mut req = request.into_request();
3684            req.extensions_mut()
3685                .insert(
3686                    GrpcMethod::new("pidgr.v1.CampaignService", "GetCampaignByShortCode"),
3687                );
3688            self.inner.unary(req, path, codec).await
3689        }
3690    }
3691}
3692/// Generated server implementations.
3693pub mod campaign_service_server {
3694    #![allow(
3695        unused_variables,
3696        dead_code,
3697        missing_docs,
3698        clippy::wildcard_imports,
3699        clippy::let_unit_value,
3700    )]
3701    use tonic::codegen::*;
3702    /// Generated trait containing gRPC methods that should be implemented for use with CampaignServiceServer.
3703    #[async_trait]
3704    pub trait CampaignService: std::marker::Send + std::marker::Sync + 'static {
3705        /** Create a new campaign with a template, audience, and workflow.
3706 Authorization: Requires MANAGER+ role.
3707*/
3708        async fn create_campaign(
3709            &self,
3710            request: tonic::Request<super::CreateCampaignRequest>,
3711        ) -> std::result::Result<
3712            tonic::Response<super::CreateCampaignResponse>,
3713            tonic::Status,
3714        >;
3715        /** Start a created campaign, triggering its workflow execution via the orchestration engine.
3716 Authorization: Requires MANAGER+ role.
3717*/
3718        async fn start_campaign(
3719            &self,
3720            request: tonic::Request<super::StartCampaignRequest>,
3721        ) -> std::result::Result<
3722            tonic::Response<super::StartCampaignResponse>,
3723            tonic::Status,
3724        >;
3725        /** Retrieve a single campaign by ID.
3726 Authorization: Authenticated user within the organization.
3727*/
3728        async fn get_campaign(
3729            &self,
3730            request: tonic::Request<super::GetCampaignRequest>,
3731        ) -> std::result::Result<
3732            tonic::Response<super::GetCampaignResponse>,
3733            tonic::Status,
3734        >;
3735        /** List campaigns for the organization with pagination.
3736 Authorization: Authenticated user within the organization.
3737*/
3738        async fn list_campaigns(
3739            &self,
3740            request: tonic::Request<super::ListCampaignsRequest>,
3741        ) -> std::result::Result<
3742            tonic::Response<super::ListCampaignsResponse>,
3743            tonic::Status,
3744        >;
3745        /** Update a draft campaign (CREATED status only). Non-empty fields overwrite existing values.
3746 Authorization: Requires MANAGER+ role.
3747*/
3748        async fn update_campaign(
3749            &self,
3750            request: tonic::Request<super::UpdateCampaignRequest>,
3751        ) -> std::result::Result<
3752            tonic::Response<super::UpdateCampaignResponse>,
3753            tonic::Status,
3754        >;
3755        /** Cancel a running campaign, stopping further deliveries and reminders.
3756 Authorization: Requires MANAGER+ role.
3757*/
3758        async fn cancel_campaign(
3759            &self,
3760            request: tonic::Request<super::CancelCampaignRequest>,
3761        ) -> std::result::Result<
3762            tonic::Response<super::CancelCampaignResponse>,
3763            tonic::Status,
3764        >;
3765        /** List delivery records for a campaign, optionally filtered by status.
3766 Authorization: Authenticated user within the organization.
3767*/
3768        async fn list_deliveries(
3769            &self,
3770            request: tonic::Request<super::ListDeliveriesRequest>,
3771        ) -> std::result::Result<
3772            tonic::Response<super::ListDeliveriesResponse>,
3773            tonic::Status,
3774        >;
3775        /** Break down a campaign's recipients by current archetype membership
3776 and return ack-rate per bucket, with k-anonymity gate applied.
3777 Only valid for campaigns whose originating_archetype is set.
3778 Authorization: Authenticated user within the organization.
3779*/
3780        async fn get_campaign_archetype_breakdown(
3781            &self,
3782            request: tonic::Request<super::GetCampaignArchetypeBreakdownRequest>,
3783        ) -> std::result::Result<
3784            tonic::Response<super::GetCampaignArchetypeBreakdownResponse>,
3785            tonic::Status,
3786        >;
3787        /** Resolve a campaign's 8-character base62 short-code, lazily
3788 generating one on the first call. Stable for the campaign's
3789 lifetime; the same campaign always returns the same code.
3790 Authorization: Internal-service callers only (mTLS-gated). The
3791 dispatch layer calls this when assembling a third-party-channel
3792 deeplink.
3793*/
3794        async fn resolve_or_create_short_code(
3795            &self,
3796            request: tonic::Request<super::ResolveOrCreateShortCodeRequest>,
3797        ) -> std::result::Result<
3798            tonic::Response<super::ResolveOrCreateShortCodeResponse>,
3799            tonic::Status,
3800        >;
3801        /** Look up a campaign by its short-code. Returns minimal, non-PII
3802 metadata sufficient for the native app to route a tapped
3803 third-party-channel deeplink to the correct campaign card and
3804 show org branding before the auth gate.
3805 Authorization: Unauthenticated. The short-code IS the lookup key;
3806 returned fields are already visible to the recipient via their
3807 inbox or the org's public profile.
3808*/
3809        async fn get_campaign_by_short_code(
3810            &self,
3811            request: tonic::Request<super::GetCampaignByShortCodeRequest>,
3812        ) -> std::result::Result<
3813            tonic::Response<super::GetCampaignByShortCodeResponse>,
3814            tonic::Status,
3815        >;
3816    }
3817    /** Manages the full lifecycle of communication campaigns — creation,
3818 execution, monitoring, and cancellation.
3819*/
3820    #[derive(Debug)]
3821    pub struct CampaignServiceServer<T> {
3822        inner: Arc<T>,
3823        accept_compression_encodings: EnabledCompressionEncodings,
3824        send_compression_encodings: EnabledCompressionEncodings,
3825        max_decoding_message_size: Option<usize>,
3826        max_encoding_message_size: Option<usize>,
3827    }
3828    impl<T> CampaignServiceServer<T> {
3829        pub fn new(inner: T) -> Self {
3830            Self::from_arc(Arc::new(inner))
3831        }
3832        pub fn from_arc(inner: Arc<T>) -> Self {
3833            Self {
3834                inner,
3835                accept_compression_encodings: Default::default(),
3836                send_compression_encodings: Default::default(),
3837                max_decoding_message_size: None,
3838                max_encoding_message_size: None,
3839            }
3840        }
3841        pub fn with_interceptor<F>(
3842            inner: T,
3843            interceptor: F,
3844        ) -> InterceptedService<Self, F>
3845        where
3846            F: tonic::service::Interceptor,
3847        {
3848            InterceptedService::new(Self::new(inner), interceptor)
3849        }
3850        /// Enable decompressing requests with the given encoding.
3851        #[must_use]
3852        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3853            self.accept_compression_encodings.enable(encoding);
3854            self
3855        }
3856        /// Compress responses with the given encoding, if the client supports it.
3857        #[must_use]
3858        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3859            self.send_compression_encodings.enable(encoding);
3860            self
3861        }
3862        /// Limits the maximum size of a decoded message.
3863        ///
3864        /// Default: `4MB`
3865        #[must_use]
3866        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3867            self.max_decoding_message_size = Some(limit);
3868            self
3869        }
3870        /// Limits the maximum size of an encoded message.
3871        ///
3872        /// Default: `usize::MAX`
3873        #[must_use]
3874        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3875            self.max_encoding_message_size = Some(limit);
3876            self
3877        }
3878    }
3879    impl<T, B> tonic::codegen::Service<http::Request<B>> for CampaignServiceServer<T>
3880    where
3881        T: CampaignService,
3882        B: Body + std::marker::Send + 'static,
3883        B::Error: Into<StdError> + std::marker::Send + 'static,
3884    {
3885        type Response = http::Response<tonic::body::Body>;
3886        type Error = std::convert::Infallible;
3887        type Future = BoxFuture<Self::Response, Self::Error>;
3888        fn poll_ready(
3889            &mut self,
3890            _cx: &mut Context<'_>,
3891        ) -> Poll<std::result::Result<(), Self::Error>> {
3892            Poll::Ready(Ok(()))
3893        }
3894        fn call(&mut self, req: http::Request<B>) -> Self::Future {
3895            match req.uri().path() {
3896                "/pidgr.v1.CampaignService/CreateCampaign" => {
3897                    #[allow(non_camel_case_types)]
3898                    struct CreateCampaignSvc<T: CampaignService>(pub Arc<T>);
3899                    impl<
3900                        T: CampaignService,
3901                    > tonic::server::UnaryService<super::CreateCampaignRequest>
3902                    for CreateCampaignSvc<T> {
3903                        type Response = super::CreateCampaignResponse;
3904                        type Future = BoxFuture<
3905                            tonic::Response<Self::Response>,
3906                            tonic::Status,
3907                        >;
3908                        fn call(
3909                            &mut self,
3910                            request: tonic::Request<super::CreateCampaignRequest>,
3911                        ) -> Self::Future {
3912                            let inner = Arc::clone(&self.0);
3913                            let fut = async move {
3914                                <T as CampaignService>::create_campaign(&inner, request)
3915                                    .await
3916                            };
3917                            Box::pin(fut)
3918                        }
3919                    }
3920                    let accept_compression_encodings = self.accept_compression_encodings;
3921                    let send_compression_encodings = self.send_compression_encodings;
3922                    let max_decoding_message_size = self.max_decoding_message_size;
3923                    let max_encoding_message_size = self.max_encoding_message_size;
3924                    let inner = self.inner.clone();
3925                    let fut = async move {
3926                        let method = CreateCampaignSvc(inner);
3927                        let codec = tonic_prost::ProstCodec::default();
3928                        let mut grpc = tonic::server::Grpc::new(codec)
3929                            .apply_compression_config(
3930                                accept_compression_encodings,
3931                                send_compression_encodings,
3932                            )
3933                            .apply_max_message_size_config(
3934                                max_decoding_message_size,
3935                                max_encoding_message_size,
3936                            );
3937                        let res = grpc.unary(method, req).await;
3938                        Ok(res)
3939                    };
3940                    Box::pin(fut)
3941                }
3942                "/pidgr.v1.CampaignService/StartCampaign" => {
3943                    #[allow(non_camel_case_types)]
3944                    struct StartCampaignSvc<T: CampaignService>(pub Arc<T>);
3945                    impl<
3946                        T: CampaignService,
3947                    > tonic::server::UnaryService<super::StartCampaignRequest>
3948                    for StartCampaignSvc<T> {
3949                        type Response = super::StartCampaignResponse;
3950                        type Future = BoxFuture<
3951                            tonic::Response<Self::Response>,
3952                            tonic::Status,
3953                        >;
3954                        fn call(
3955                            &mut self,
3956                            request: tonic::Request<super::StartCampaignRequest>,
3957                        ) -> Self::Future {
3958                            let inner = Arc::clone(&self.0);
3959                            let fut = async move {
3960                                <T as CampaignService>::start_campaign(&inner, request)
3961                                    .await
3962                            };
3963                            Box::pin(fut)
3964                        }
3965                    }
3966                    let accept_compression_encodings = self.accept_compression_encodings;
3967                    let send_compression_encodings = self.send_compression_encodings;
3968                    let max_decoding_message_size = self.max_decoding_message_size;
3969                    let max_encoding_message_size = self.max_encoding_message_size;
3970                    let inner = self.inner.clone();
3971                    let fut = async move {
3972                        let method = StartCampaignSvc(inner);
3973                        let codec = tonic_prost::ProstCodec::default();
3974                        let mut grpc = tonic::server::Grpc::new(codec)
3975                            .apply_compression_config(
3976                                accept_compression_encodings,
3977                                send_compression_encodings,
3978                            )
3979                            .apply_max_message_size_config(
3980                                max_decoding_message_size,
3981                                max_encoding_message_size,
3982                            );
3983                        let res = grpc.unary(method, req).await;
3984                        Ok(res)
3985                    };
3986                    Box::pin(fut)
3987                }
3988                "/pidgr.v1.CampaignService/GetCampaign" => {
3989                    #[allow(non_camel_case_types)]
3990                    struct GetCampaignSvc<T: CampaignService>(pub Arc<T>);
3991                    impl<
3992                        T: CampaignService,
3993                    > tonic::server::UnaryService<super::GetCampaignRequest>
3994                    for GetCampaignSvc<T> {
3995                        type Response = super::GetCampaignResponse;
3996                        type Future = BoxFuture<
3997                            tonic::Response<Self::Response>,
3998                            tonic::Status,
3999                        >;
4000                        fn call(
4001                            &mut self,
4002                            request: tonic::Request<super::GetCampaignRequest>,
4003                        ) -> Self::Future {
4004                            let inner = Arc::clone(&self.0);
4005                            let fut = async move {
4006                                <T as CampaignService>::get_campaign(&inner, request).await
4007                            };
4008                            Box::pin(fut)
4009                        }
4010                    }
4011                    let accept_compression_encodings = self.accept_compression_encodings;
4012                    let send_compression_encodings = self.send_compression_encodings;
4013                    let max_decoding_message_size = self.max_decoding_message_size;
4014                    let max_encoding_message_size = self.max_encoding_message_size;
4015                    let inner = self.inner.clone();
4016                    let fut = async move {
4017                        let method = GetCampaignSvc(inner);
4018                        let codec = tonic_prost::ProstCodec::default();
4019                        let mut grpc = tonic::server::Grpc::new(codec)
4020                            .apply_compression_config(
4021                                accept_compression_encodings,
4022                                send_compression_encodings,
4023                            )
4024                            .apply_max_message_size_config(
4025                                max_decoding_message_size,
4026                                max_encoding_message_size,
4027                            );
4028                        let res = grpc.unary(method, req).await;
4029                        Ok(res)
4030                    };
4031                    Box::pin(fut)
4032                }
4033                "/pidgr.v1.CampaignService/ListCampaigns" => {
4034                    #[allow(non_camel_case_types)]
4035                    struct ListCampaignsSvc<T: CampaignService>(pub Arc<T>);
4036                    impl<
4037                        T: CampaignService,
4038                    > tonic::server::UnaryService<super::ListCampaignsRequest>
4039                    for ListCampaignsSvc<T> {
4040                        type Response = super::ListCampaignsResponse;
4041                        type Future = BoxFuture<
4042                            tonic::Response<Self::Response>,
4043                            tonic::Status,
4044                        >;
4045                        fn call(
4046                            &mut self,
4047                            request: tonic::Request<super::ListCampaignsRequest>,
4048                        ) -> Self::Future {
4049                            let inner = Arc::clone(&self.0);
4050                            let fut = async move {
4051                                <T as CampaignService>::list_campaigns(&inner, request)
4052                                    .await
4053                            };
4054                            Box::pin(fut)
4055                        }
4056                    }
4057                    let accept_compression_encodings = self.accept_compression_encodings;
4058                    let send_compression_encodings = self.send_compression_encodings;
4059                    let max_decoding_message_size = self.max_decoding_message_size;
4060                    let max_encoding_message_size = self.max_encoding_message_size;
4061                    let inner = self.inner.clone();
4062                    let fut = async move {
4063                        let method = ListCampaignsSvc(inner);
4064                        let codec = tonic_prost::ProstCodec::default();
4065                        let mut grpc = tonic::server::Grpc::new(codec)
4066                            .apply_compression_config(
4067                                accept_compression_encodings,
4068                                send_compression_encodings,
4069                            )
4070                            .apply_max_message_size_config(
4071                                max_decoding_message_size,
4072                                max_encoding_message_size,
4073                            );
4074                        let res = grpc.unary(method, req).await;
4075                        Ok(res)
4076                    };
4077                    Box::pin(fut)
4078                }
4079                "/pidgr.v1.CampaignService/UpdateCampaign" => {
4080                    #[allow(non_camel_case_types)]
4081                    struct UpdateCampaignSvc<T: CampaignService>(pub Arc<T>);
4082                    impl<
4083                        T: CampaignService,
4084                    > tonic::server::UnaryService<super::UpdateCampaignRequest>
4085                    for UpdateCampaignSvc<T> {
4086                        type Response = super::UpdateCampaignResponse;
4087                        type Future = BoxFuture<
4088                            tonic::Response<Self::Response>,
4089                            tonic::Status,
4090                        >;
4091                        fn call(
4092                            &mut self,
4093                            request: tonic::Request<super::UpdateCampaignRequest>,
4094                        ) -> Self::Future {
4095                            let inner = Arc::clone(&self.0);
4096                            let fut = async move {
4097                                <T as CampaignService>::update_campaign(&inner, request)
4098                                    .await
4099                            };
4100                            Box::pin(fut)
4101                        }
4102                    }
4103                    let accept_compression_encodings = self.accept_compression_encodings;
4104                    let send_compression_encodings = self.send_compression_encodings;
4105                    let max_decoding_message_size = self.max_decoding_message_size;
4106                    let max_encoding_message_size = self.max_encoding_message_size;
4107                    let inner = self.inner.clone();
4108                    let fut = async move {
4109                        let method = UpdateCampaignSvc(inner);
4110                        let codec = tonic_prost::ProstCodec::default();
4111                        let mut grpc = tonic::server::Grpc::new(codec)
4112                            .apply_compression_config(
4113                                accept_compression_encodings,
4114                                send_compression_encodings,
4115                            )
4116                            .apply_max_message_size_config(
4117                                max_decoding_message_size,
4118                                max_encoding_message_size,
4119                            );
4120                        let res = grpc.unary(method, req).await;
4121                        Ok(res)
4122                    };
4123                    Box::pin(fut)
4124                }
4125                "/pidgr.v1.CampaignService/CancelCampaign" => {
4126                    #[allow(non_camel_case_types)]
4127                    struct CancelCampaignSvc<T: CampaignService>(pub Arc<T>);
4128                    impl<
4129                        T: CampaignService,
4130                    > tonic::server::UnaryService<super::CancelCampaignRequest>
4131                    for CancelCampaignSvc<T> {
4132                        type Response = super::CancelCampaignResponse;
4133                        type Future = BoxFuture<
4134                            tonic::Response<Self::Response>,
4135                            tonic::Status,
4136                        >;
4137                        fn call(
4138                            &mut self,
4139                            request: tonic::Request<super::CancelCampaignRequest>,
4140                        ) -> Self::Future {
4141                            let inner = Arc::clone(&self.0);
4142                            let fut = async move {
4143                                <T as CampaignService>::cancel_campaign(&inner, request)
4144                                    .await
4145                            };
4146                            Box::pin(fut)
4147                        }
4148                    }
4149                    let accept_compression_encodings = self.accept_compression_encodings;
4150                    let send_compression_encodings = self.send_compression_encodings;
4151                    let max_decoding_message_size = self.max_decoding_message_size;
4152                    let max_encoding_message_size = self.max_encoding_message_size;
4153                    let inner = self.inner.clone();
4154                    let fut = async move {
4155                        let method = CancelCampaignSvc(inner);
4156                        let codec = tonic_prost::ProstCodec::default();
4157                        let mut grpc = tonic::server::Grpc::new(codec)
4158                            .apply_compression_config(
4159                                accept_compression_encodings,
4160                                send_compression_encodings,
4161                            )
4162                            .apply_max_message_size_config(
4163                                max_decoding_message_size,
4164                                max_encoding_message_size,
4165                            );
4166                        let res = grpc.unary(method, req).await;
4167                        Ok(res)
4168                    };
4169                    Box::pin(fut)
4170                }
4171                "/pidgr.v1.CampaignService/ListDeliveries" => {
4172                    #[allow(non_camel_case_types)]
4173                    struct ListDeliveriesSvc<T: CampaignService>(pub Arc<T>);
4174                    impl<
4175                        T: CampaignService,
4176                    > tonic::server::UnaryService<super::ListDeliveriesRequest>
4177                    for ListDeliveriesSvc<T> {
4178                        type Response = super::ListDeliveriesResponse;
4179                        type Future = BoxFuture<
4180                            tonic::Response<Self::Response>,
4181                            tonic::Status,
4182                        >;
4183                        fn call(
4184                            &mut self,
4185                            request: tonic::Request<super::ListDeliveriesRequest>,
4186                        ) -> Self::Future {
4187                            let inner = Arc::clone(&self.0);
4188                            let fut = async move {
4189                                <T as CampaignService>::list_deliveries(&inner, request)
4190                                    .await
4191                            };
4192                            Box::pin(fut)
4193                        }
4194                    }
4195                    let accept_compression_encodings = self.accept_compression_encodings;
4196                    let send_compression_encodings = self.send_compression_encodings;
4197                    let max_decoding_message_size = self.max_decoding_message_size;
4198                    let max_encoding_message_size = self.max_encoding_message_size;
4199                    let inner = self.inner.clone();
4200                    let fut = async move {
4201                        let method = ListDeliveriesSvc(inner);
4202                        let codec = tonic_prost::ProstCodec::default();
4203                        let mut grpc = tonic::server::Grpc::new(codec)
4204                            .apply_compression_config(
4205                                accept_compression_encodings,
4206                                send_compression_encodings,
4207                            )
4208                            .apply_max_message_size_config(
4209                                max_decoding_message_size,
4210                                max_encoding_message_size,
4211                            );
4212                        let res = grpc.unary(method, req).await;
4213                        Ok(res)
4214                    };
4215                    Box::pin(fut)
4216                }
4217                "/pidgr.v1.CampaignService/GetCampaignArchetypeBreakdown" => {
4218                    #[allow(non_camel_case_types)]
4219                    struct GetCampaignArchetypeBreakdownSvc<T: CampaignService>(
4220                        pub Arc<T>,
4221                    );
4222                    impl<
4223                        T: CampaignService,
4224                    > tonic::server::UnaryService<
4225                        super::GetCampaignArchetypeBreakdownRequest,
4226                    > for GetCampaignArchetypeBreakdownSvc<T> {
4227                        type Response = super::GetCampaignArchetypeBreakdownResponse;
4228                        type Future = BoxFuture<
4229                            tonic::Response<Self::Response>,
4230                            tonic::Status,
4231                        >;
4232                        fn call(
4233                            &mut self,
4234                            request: tonic::Request<
4235                                super::GetCampaignArchetypeBreakdownRequest,
4236                            >,
4237                        ) -> Self::Future {
4238                            let inner = Arc::clone(&self.0);
4239                            let fut = async move {
4240                                <T as CampaignService>::get_campaign_archetype_breakdown(
4241                                        &inner,
4242                                        request,
4243                                    )
4244                                    .await
4245                            };
4246                            Box::pin(fut)
4247                        }
4248                    }
4249                    let accept_compression_encodings = self.accept_compression_encodings;
4250                    let send_compression_encodings = self.send_compression_encodings;
4251                    let max_decoding_message_size = self.max_decoding_message_size;
4252                    let max_encoding_message_size = self.max_encoding_message_size;
4253                    let inner = self.inner.clone();
4254                    let fut = async move {
4255                        let method = GetCampaignArchetypeBreakdownSvc(inner);
4256                        let codec = tonic_prost::ProstCodec::default();
4257                        let mut grpc = tonic::server::Grpc::new(codec)
4258                            .apply_compression_config(
4259                                accept_compression_encodings,
4260                                send_compression_encodings,
4261                            )
4262                            .apply_max_message_size_config(
4263                                max_decoding_message_size,
4264                                max_encoding_message_size,
4265                            );
4266                        let res = grpc.unary(method, req).await;
4267                        Ok(res)
4268                    };
4269                    Box::pin(fut)
4270                }
4271                "/pidgr.v1.CampaignService/ResolveOrCreateShortCode" => {
4272                    #[allow(non_camel_case_types)]
4273                    struct ResolveOrCreateShortCodeSvc<T: CampaignService>(pub Arc<T>);
4274                    impl<
4275                        T: CampaignService,
4276                    > tonic::server::UnaryService<super::ResolveOrCreateShortCodeRequest>
4277                    for ResolveOrCreateShortCodeSvc<T> {
4278                        type Response = super::ResolveOrCreateShortCodeResponse;
4279                        type Future = BoxFuture<
4280                            tonic::Response<Self::Response>,
4281                            tonic::Status,
4282                        >;
4283                        fn call(
4284                            &mut self,
4285                            request: tonic::Request<
4286                                super::ResolveOrCreateShortCodeRequest,
4287                            >,
4288                        ) -> Self::Future {
4289                            let inner = Arc::clone(&self.0);
4290                            let fut = async move {
4291                                <T as CampaignService>::resolve_or_create_short_code(
4292                                        &inner,
4293                                        request,
4294                                    )
4295                                    .await
4296                            };
4297                            Box::pin(fut)
4298                        }
4299                    }
4300                    let accept_compression_encodings = self.accept_compression_encodings;
4301                    let send_compression_encodings = self.send_compression_encodings;
4302                    let max_decoding_message_size = self.max_decoding_message_size;
4303                    let max_encoding_message_size = self.max_encoding_message_size;
4304                    let inner = self.inner.clone();
4305                    let fut = async move {
4306                        let method = ResolveOrCreateShortCodeSvc(inner);
4307                        let codec = tonic_prost::ProstCodec::default();
4308                        let mut grpc = tonic::server::Grpc::new(codec)
4309                            .apply_compression_config(
4310                                accept_compression_encodings,
4311                                send_compression_encodings,
4312                            )
4313                            .apply_max_message_size_config(
4314                                max_decoding_message_size,
4315                                max_encoding_message_size,
4316                            );
4317                        let res = grpc.unary(method, req).await;
4318                        Ok(res)
4319                    };
4320                    Box::pin(fut)
4321                }
4322                "/pidgr.v1.CampaignService/GetCampaignByShortCode" => {
4323                    #[allow(non_camel_case_types)]
4324                    struct GetCampaignByShortCodeSvc<T: CampaignService>(pub Arc<T>);
4325                    impl<
4326                        T: CampaignService,
4327                    > tonic::server::UnaryService<super::GetCampaignByShortCodeRequest>
4328                    for GetCampaignByShortCodeSvc<T> {
4329                        type Response = super::GetCampaignByShortCodeResponse;
4330                        type Future = BoxFuture<
4331                            tonic::Response<Self::Response>,
4332                            tonic::Status,
4333                        >;
4334                        fn call(
4335                            &mut self,
4336                            request: tonic::Request<super::GetCampaignByShortCodeRequest>,
4337                        ) -> Self::Future {
4338                            let inner = Arc::clone(&self.0);
4339                            let fut = async move {
4340                                <T as CampaignService>::get_campaign_by_short_code(
4341                                        &inner,
4342                                        request,
4343                                    )
4344                                    .await
4345                            };
4346                            Box::pin(fut)
4347                        }
4348                    }
4349                    let accept_compression_encodings = self.accept_compression_encodings;
4350                    let send_compression_encodings = self.send_compression_encodings;
4351                    let max_decoding_message_size = self.max_decoding_message_size;
4352                    let max_encoding_message_size = self.max_encoding_message_size;
4353                    let inner = self.inner.clone();
4354                    let fut = async move {
4355                        let method = GetCampaignByShortCodeSvc(inner);
4356                        let codec = tonic_prost::ProstCodec::default();
4357                        let mut grpc = tonic::server::Grpc::new(codec)
4358                            .apply_compression_config(
4359                                accept_compression_encodings,
4360                                send_compression_encodings,
4361                            )
4362                            .apply_max_message_size_config(
4363                                max_decoding_message_size,
4364                                max_encoding_message_size,
4365                            );
4366                        let res = grpc.unary(method, req).await;
4367                        Ok(res)
4368                    };
4369                    Box::pin(fut)
4370                }
4371                _ => {
4372                    Box::pin(async move {
4373                        let mut response = http::Response::new(
4374                            tonic::body::Body::default(),
4375                        );
4376                        let headers = response.headers_mut();
4377                        headers
4378                            .insert(
4379                                tonic::Status::GRPC_STATUS,
4380                                (tonic::Code::Unimplemented as i32).into(),
4381                            );
4382                        headers
4383                            .insert(
4384                                http::header::CONTENT_TYPE,
4385                                tonic::metadata::GRPC_CONTENT_TYPE,
4386                            );
4387                        Ok(response)
4388                    })
4389                }
4390            }
4391        }
4392    }
4393    impl<T> Clone for CampaignServiceServer<T> {
4394        fn clone(&self) -> Self {
4395            let inner = self.inner.clone();
4396            Self {
4397                inner,
4398                accept_compression_encodings: self.accept_compression_encodings,
4399                send_compression_encodings: self.send_compression_encodings,
4400                max_decoding_message_size: self.max_decoding_message_size,
4401                max_encoding_message_size: self.max_encoding_message_size,
4402            }
4403        }
4404    }
4405    /// Generated gRPC service name
4406    pub const SERVICE_NAME: &str = "pidgr.v1.CampaignService";
4407    impl<T> tonic::server::NamedService for CampaignServiceServer<T> {
4408        const NAME: &'static str = SERVICE_NAME;
4409    }
4410}
4411/// Generated client implementations.
4412pub mod device_service_client {
4413    #![allow(
4414        unused_variables,
4415        dead_code,
4416        missing_docs,
4417        clippy::wildcard_imports,
4418        clippy::let_unit_value,
4419    )]
4420    use tonic::codegen::*;
4421    use tonic::codegen::http::Uri;
4422    /** Manages push notification device registration.
4423 Used by the mobile app to register push tokens and manage device lifecycle.
4424*/
4425    #[derive(Debug, Clone)]
4426    pub struct DeviceServiceClient<T> {
4427        inner: tonic::client::Grpc<T>,
4428    }
4429    impl DeviceServiceClient<tonic::transport::Channel> {
4430        /// Attempt to create a new client by connecting to a given endpoint.
4431        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4432        where
4433            D: TryInto<tonic::transport::Endpoint>,
4434            D::Error: Into<StdError>,
4435        {
4436            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4437            Ok(Self::new(conn))
4438        }
4439    }
4440    impl<T> DeviceServiceClient<T>
4441    where
4442        T: tonic::client::GrpcService<tonic::body::Body>,
4443        T::Error: Into<StdError>,
4444        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4445        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4446    {
4447        pub fn new(inner: T) -> Self {
4448            let inner = tonic::client::Grpc::new(inner);
4449            Self { inner }
4450        }
4451        pub fn with_origin(inner: T, origin: Uri) -> Self {
4452            let inner = tonic::client::Grpc::with_origin(inner, origin);
4453            Self { inner }
4454        }
4455        pub fn with_interceptor<F>(
4456            inner: T,
4457            interceptor: F,
4458        ) -> DeviceServiceClient<InterceptedService<T, F>>
4459        where
4460            F: tonic::service::Interceptor,
4461            T::ResponseBody: Default,
4462            T: tonic::codegen::Service<
4463                http::Request<tonic::body::Body>,
4464                Response = http::Response<
4465                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4466                >,
4467            >,
4468            <T as tonic::codegen::Service<
4469                http::Request<tonic::body::Body>,
4470            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4471        {
4472            DeviceServiceClient::new(InterceptedService::new(inner, interceptor))
4473        }
4474        /// Compress requests with the given encoding.
4475        ///
4476        /// This requires the server to support it otherwise it might respond with an
4477        /// error.
4478        #[must_use]
4479        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4480            self.inner = self.inner.send_compressed(encoding);
4481            self
4482        }
4483        /// Enable decompressing responses.
4484        #[must_use]
4485        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4486            self.inner = self.inner.accept_compressed(encoding);
4487            self
4488        }
4489        /// Limits the maximum size of a decoded message.
4490        ///
4491        /// Default: `4MB`
4492        #[must_use]
4493        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4494            self.inner = self.inner.max_decoding_message_size(limit);
4495            self
4496        }
4497        /// Limits the maximum size of an encoded message.
4498        ///
4499        /// Default: `usize::MAX`
4500        #[must_use]
4501        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4502            self.inner = self.inner.max_encoding_message_size(limit);
4503            self
4504        }
4505        /** Register a device with its push token for receiving notifications.
4506 Authorization: Authenticated user (own devices only).
4507*/
4508        pub async fn register(
4509            &mut self,
4510            request: impl tonic::IntoRequest<super::RegisterRequest>,
4511        ) -> std::result::Result<
4512            tonic::Response<super::RegisterResponse>,
4513            tonic::Status,
4514        > {
4515            self.inner
4516                .ready()
4517                .await
4518                .map_err(|e| {
4519                    tonic::Status::unknown(
4520                        format!("Service was not ready: {}", e.into()),
4521                    )
4522                })?;
4523            let codec = tonic_prost::ProstCodec::default();
4524            let path = http::uri::PathAndQuery::from_static(
4525                "/pidgr.v1.DeviceService/Register",
4526            );
4527            let mut req = request.into_request();
4528            req.extensions_mut()
4529                .insert(GrpcMethod::new("pidgr.v1.DeviceService", "Register"));
4530            self.inner.unary(req, path, codec).await
4531        }
4532        /** Deactivate a device, preventing further push notifications.
4533 Authorization: Authenticated user (own devices only).
4534*/
4535        pub async fn deactivate(
4536            &mut self,
4537            request: impl tonic::IntoRequest<super::DeactivateRequest>,
4538        ) -> std::result::Result<
4539            tonic::Response<super::DeactivateResponse>,
4540            tonic::Status,
4541        > {
4542            self.inner
4543                .ready()
4544                .await
4545                .map_err(|e| {
4546                    tonic::Status::unknown(
4547                        format!("Service was not ready: {}", e.into()),
4548                    )
4549                })?;
4550            let codec = tonic_prost::ProstCodec::default();
4551            let path = http::uri::PathAndQuery::from_static(
4552                "/pidgr.v1.DeviceService/Deactivate",
4553            );
4554            let mut req = request.into_request();
4555            req.extensions_mut()
4556                .insert(GrpcMethod::new("pidgr.v1.DeviceService", "Deactivate"));
4557            self.inner.unary(req, path, codec).await
4558        }
4559        /** List all devices registered to the authenticated user.
4560 Authorization: Authenticated user (own devices only).
4561*/
4562        pub async fn list_devices(
4563            &mut self,
4564            request: impl tonic::IntoRequest<super::ListDevicesRequest>,
4565        ) -> std::result::Result<
4566            tonic::Response<super::ListDevicesResponse>,
4567            tonic::Status,
4568        > {
4569            self.inner
4570                .ready()
4571                .await
4572                .map_err(|e| {
4573                    tonic::Status::unknown(
4574                        format!("Service was not ready: {}", e.into()),
4575                    )
4576                })?;
4577            let codec = tonic_prost::ProstCodec::default();
4578            let path = http::uri::PathAndQuery::from_static(
4579                "/pidgr.v1.DeviceService/ListDevices",
4580            );
4581            let mut req = request.into_request();
4582            req.extensions_mut()
4583                .insert(GrpcMethod::new("pidgr.v1.DeviceService", "ListDevices"));
4584            self.inner.unary(req, path, codec).await
4585        }
4586        /** List all devices for a specific organization member.
4587 Authorization: Requires MEMBERS_READ permission.
4588*/
4589        pub async fn list_member_devices(
4590            &mut self,
4591            request: impl tonic::IntoRequest<super::ListMemberDevicesRequest>,
4592        ) -> std::result::Result<
4593            tonic::Response<super::ListMemberDevicesResponse>,
4594            tonic::Status,
4595        > {
4596            self.inner
4597                .ready()
4598                .await
4599                .map_err(|e| {
4600                    tonic::Status::unknown(
4601                        format!("Service was not ready: {}", e.into()),
4602                    )
4603                })?;
4604            let codec = tonic_prost::ProstCodec::default();
4605            let path = http::uri::PathAndQuery::from_static(
4606                "/pidgr.v1.DeviceService/ListMemberDevices",
4607            );
4608            let mut req = request.into_request();
4609            req.extensions_mut()
4610                .insert(GrpcMethod::new("pidgr.v1.DeviceService", "ListMemberDevices"));
4611            self.inner.unary(req, path, codec).await
4612        }
4613    }
4614}
4615/// Generated server implementations.
4616pub mod device_service_server {
4617    #![allow(
4618        unused_variables,
4619        dead_code,
4620        missing_docs,
4621        clippy::wildcard_imports,
4622        clippy::let_unit_value,
4623    )]
4624    use tonic::codegen::*;
4625    /// Generated trait containing gRPC methods that should be implemented for use with DeviceServiceServer.
4626    #[async_trait]
4627    pub trait DeviceService: std::marker::Send + std::marker::Sync + 'static {
4628        /** Register a device with its push token for receiving notifications.
4629 Authorization: Authenticated user (own devices only).
4630*/
4631        async fn register(
4632            &self,
4633            request: tonic::Request<super::RegisterRequest>,
4634        ) -> std::result::Result<
4635            tonic::Response<super::RegisterResponse>,
4636            tonic::Status,
4637        >;
4638        /** Deactivate a device, preventing further push notifications.
4639 Authorization: Authenticated user (own devices only).
4640*/
4641        async fn deactivate(
4642            &self,
4643            request: tonic::Request<super::DeactivateRequest>,
4644        ) -> std::result::Result<
4645            tonic::Response<super::DeactivateResponse>,
4646            tonic::Status,
4647        >;
4648        /** List all devices registered to the authenticated user.
4649 Authorization: Authenticated user (own devices only).
4650*/
4651        async fn list_devices(
4652            &self,
4653            request: tonic::Request<super::ListDevicesRequest>,
4654        ) -> std::result::Result<
4655            tonic::Response<super::ListDevicesResponse>,
4656            tonic::Status,
4657        >;
4658        /** List all devices for a specific organization member.
4659 Authorization: Requires MEMBERS_READ permission.
4660*/
4661        async fn list_member_devices(
4662            &self,
4663            request: tonic::Request<super::ListMemberDevicesRequest>,
4664        ) -> std::result::Result<
4665            tonic::Response<super::ListMemberDevicesResponse>,
4666            tonic::Status,
4667        >;
4668    }
4669    /** Manages push notification device registration.
4670 Used by the mobile app to register push tokens and manage device lifecycle.
4671*/
4672    #[derive(Debug)]
4673    pub struct DeviceServiceServer<T> {
4674        inner: Arc<T>,
4675        accept_compression_encodings: EnabledCompressionEncodings,
4676        send_compression_encodings: EnabledCompressionEncodings,
4677        max_decoding_message_size: Option<usize>,
4678        max_encoding_message_size: Option<usize>,
4679    }
4680    impl<T> DeviceServiceServer<T> {
4681        pub fn new(inner: T) -> Self {
4682            Self::from_arc(Arc::new(inner))
4683        }
4684        pub fn from_arc(inner: Arc<T>) -> Self {
4685            Self {
4686                inner,
4687                accept_compression_encodings: Default::default(),
4688                send_compression_encodings: Default::default(),
4689                max_decoding_message_size: None,
4690                max_encoding_message_size: None,
4691            }
4692        }
4693        pub fn with_interceptor<F>(
4694            inner: T,
4695            interceptor: F,
4696        ) -> InterceptedService<Self, F>
4697        where
4698            F: tonic::service::Interceptor,
4699        {
4700            InterceptedService::new(Self::new(inner), interceptor)
4701        }
4702        /// Enable decompressing requests with the given encoding.
4703        #[must_use]
4704        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4705            self.accept_compression_encodings.enable(encoding);
4706            self
4707        }
4708        /// Compress responses with the given encoding, if the client supports it.
4709        #[must_use]
4710        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4711            self.send_compression_encodings.enable(encoding);
4712            self
4713        }
4714        /// Limits the maximum size of a decoded message.
4715        ///
4716        /// Default: `4MB`
4717        #[must_use]
4718        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4719            self.max_decoding_message_size = Some(limit);
4720            self
4721        }
4722        /// Limits the maximum size of an encoded message.
4723        ///
4724        /// Default: `usize::MAX`
4725        #[must_use]
4726        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4727            self.max_encoding_message_size = Some(limit);
4728            self
4729        }
4730    }
4731    impl<T, B> tonic::codegen::Service<http::Request<B>> for DeviceServiceServer<T>
4732    where
4733        T: DeviceService,
4734        B: Body + std::marker::Send + 'static,
4735        B::Error: Into<StdError> + std::marker::Send + 'static,
4736    {
4737        type Response = http::Response<tonic::body::Body>;
4738        type Error = std::convert::Infallible;
4739        type Future = BoxFuture<Self::Response, Self::Error>;
4740        fn poll_ready(
4741            &mut self,
4742            _cx: &mut Context<'_>,
4743        ) -> Poll<std::result::Result<(), Self::Error>> {
4744            Poll::Ready(Ok(()))
4745        }
4746        fn call(&mut self, req: http::Request<B>) -> Self::Future {
4747            match req.uri().path() {
4748                "/pidgr.v1.DeviceService/Register" => {
4749                    #[allow(non_camel_case_types)]
4750                    struct RegisterSvc<T: DeviceService>(pub Arc<T>);
4751                    impl<
4752                        T: DeviceService,
4753                    > tonic::server::UnaryService<super::RegisterRequest>
4754                    for RegisterSvc<T> {
4755                        type Response = super::RegisterResponse;
4756                        type Future = BoxFuture<
4757                            tonic::Response<Self::Response>,
4758                            tonic::Status,
4759                        >;
4760                        fn call(
4761                            &mut self,
4762                            request: tonic::Request<super::RegisterRequest>,
4763                        ) -> Self::Future {
4764                            let inner = Arc::clone(&self.0);
4765                            let fut = async move {
4766                                <T as DeviceService>::register(&inner, request).await
4767                            };
4768                            Box::pin(fut)
4769                        }
4770                    }
4771                    let accept_compression_encodings = self.accept_compression_encodings;
4772                    let send_compression_encodings = self.send_compression_encodings;
4773                    let max_decoding_message_size = self.max_decoding_message_size;
4774                    let max_encoding_message_size = self.max_encoding_message_size;
4775                    let inner = self.inner.clone();
4776                    let fut = async move {
4777                        let method = RegisterSvc(inner);
4778                        let codec = tonic_prost::ProstCodec::default();
4779                        let mut grpc = tonic::server::Grpc::new(codec)
4780                            .apply_compression_config(
4781                                accept_compression_encodings,
4782                                send_compression_encodings,
4783                            )
4784                            .apply_max_message_size_config(
4785                                max_decoding_message_size,
4786                                max_encoding_message_size,
4787                            );
4788                        let res = grpc.unary(method, req).await;
4789                        Ok(res)
4790                    };
4791                    Box::pin(fut)
4792                }
4793                "/pidgr.v1.DeviceService/Deactivate" => {
4794                    #[allow(non_camel_case_types)]
4795                    struct DeactivateSvc<T: DeviceService>(pub Arc<T>);
4796                    impl<
4797                        T: DeviceService,
4798                    > tonic::server::UnaryService<super::DeactivateRequest>
4799                    for DeactivateSvc<T> {
4800                        type Response = super::DeactivateResponse;
4801                        type Future = BoxFuture<
4802                            tonic::Response<Self::Response>,
4803                            tonic::Status,
4804                        >;
4805                        fn call(
4806                            &mut self,
4807                            request: tonic::Request<super::DeactivateRequest>,
4808                        ) -> Self::Future {
4809                            let inner = Arc::clone(&self.0);
4810                            let fut = async move {
4811                                <T as DeviceService>::deactivate(&inner, request).await
4812                            };
4813                            Box::pin(fut)
4814                        }
4815                    }
4816                    let accept_compression_encodings = self.accept_compression_encodings;
4817                    let send_compression_encodings = self.send_compression_encodings;
4818                    let max_decoding_message_size = self.max_decoding_message_size;
4819                    let max_encoding_message_size = self.max_encoding_message_size;
4820                    let inner = self.inner.clone();
4821                    let fut = async move {
4822                        let method = DeactivateSvc(inner);
4823                        let codec = tonic_prost::ProstCodec::default();
4824                        let mut grpc = tonic::server::Grpc::new(codec)
4825                            .apply_compression_config(
4826                                accept_compression_encodings,
4827                                send_compression_encodings,
4828                            )
4829                            .apply_max_message_size_config(
4830                                max_decoding_message_size,
4831                                max_encoding_message_size,
4832                            );
4833                        let res = grpc.unary(method, req).await;
4834                        Ok(res)
4835                    };
4836                    Box::pin(fut)
4837                }
4838                "/pidgr.v1.DeviceService/ListDevices" => {
4839                    #[allow(non_camel_case_types)]
4840                    struct ListDevicesSvc<T: DeviceService>(pub Arc<T>);
4841                    impl<
4842                        T: DeviceService,
4843                    > tonic::server::UnaryService<super::ListDevicesRequest>
4844                    for ListDevicesSvc<T> {
4845                        type Response = super::ListDevicesResponse;
4846                        type Future = BoxFuture<
4847                            tonic::Response<Self::Response>,
4848                            tonic::Status,
4849                        >;
4850                        fn call(
4851                            &mut self,
4852                            request: tonic::Request<super::ListDevicesRequest>,
4853                        ) -> Self::Future {
4854                            let inner = Arc::clone(&self.0);
4855                            let fut = async move {
4856                                <T as DeviceService>::list_devices(&inner, request).await
4857                            };
4858                            Box::pin(fut)
4859                        }
4860                    }
4861                    let accept_compression_encodings = self.accept_compression_encodings;
4862                    let send_compression_encodings = self.send_compression_encodings;
4863                    let max_decoding_message_size = self.max_decoding_message_size;
4864                    let max_encoding_message_size = self.max_encoding_message_size;
4865                    let inner = self.inner.clone();
4866                    let fut = async move {
4867                        let method = ListDevicesSvc(inner);
4868                        let codec = tonic_prost::ProstCodec::default();
4869                        let mut grpc = tonic::server::Grpc::new(codec)
4870                            .apply_compression_config(
4871                                accept_compression_encodings,
4872                                send_compression_encodings,
4873                            )
4874                            .apply_max_message_size_config(
4875                                max_decoding_message_size,
4876                                max_encoding_message_size,
4877                            );
4878                        let res = grpc.unary(method, req).await;
4879                        Ok(res)
4880                    };
4881                    Box::pin(fut)
4882                }
4883                "/pidgr.v1.DeviceService/ListMemberDevices" => {
4884                    #[allow(non_camel_case_types)]
4885                    struct ListMemberDevicesSvc<T: DeviceService>(pub Arc<T>);
4886                    impl<
4887                        T: DeviceService,
4888                    > tonic::server::UnaryService<super::ListMemberDevicesRequest>
4889                    for ListMemberDevicesSvc<T> {
4890                        type Response = super::ListMemberDevicesResponse;
4891                        type Future = BoxFuture<
4892                            tonic::Response<Self::Response>,
4893                            tonic::Status,
4894                        >;
4895                        fn call(
4896                            &mut self,
4897                            request: tonic::Request<super::ListMemberDevicesRequest>,
4898                        ) -> Self::Future {
4899                            let inner = Arc::clone(&self.0);
4900                            let fut = async move {
4901                                <T as DeviceService>::list_member_devices(&inner, request)
4902                                    .await
4903                            };
4904                            Box::pin(fut)
4905                        }
4906                    }
4907                    let accept_compression_encodings = self.accept_compression_encodings;
4908                    let send_compression_encodings = self.send_compression_encodings;
4909                    let max_decoding_message_size = self.max_decoding_message_size;
4910                    let max_encoding_message_size = self.max_encoding_message_size;
4911                    let inner = self.inner.clone();
4912                    let fut = async move {
4913                        let method = ListMemberDevicesSvc(inner);
4914                        let codec = tonic_prost::ProstCodec::default();
4915                        let mut grpc = tonic::server::Grpc::new(codec)
4916                            .apply_compression_config(
4917                                accept_compression_encodings,
4918                                send_compression_encodings,
4919                            )
4920                            .apply_max_message_size_config(
4921                                max_decoding_message_size,
4922                                max_encoding_message_size,
4923                            );
4924                        let res = grpc.unary(method, req).await;
4925                        Ok(res)
4926                    };
4927                    Box::pin(fut)
4928                }
4929                _ => {
4930                    Box::pin(async move {
4931                        let mut response = http::Response::new(
4932                            tonic::body::Body::default(),
4933                        );
4934                        let headers = response.headers_mut();
4935                        headers
4936                            .insert(
4937                                tonic::Status::GRPC_STATUS,
4938                                (tonic::Code::Unimplemented as i32).into(),
4939                            );
4940                        headers
4941                            .insert(
4942                                http::header::CONTENT_TYPE,
4943                                tonic::metadata::GRPC_CONTENT_TYPE,
4944                            );
4945                        Ok(response)
4946                    })
4947                }
4948            }
4949        }
4950    }
4951    impl<T> Clone for DeviceServiceServer<T> {
4952        fn clone(&self) -> Self {
4953            let inner = self.inner.clone();
4954            Self {
4955                inner,
4956                accept_compression_encodings: self.accept_compression_encodings,
4957                send_compression_encodings: self.send_compression_encodings,
4958                max_decoding_message_size: self.max_decoding_message_size,
4959                max_encoding_message_size: self.max_encoding_message_size,
4960            }
4961        }
4962    }
4963    /// Generated gRPC service name
4964    pub const SERVICE_NAME: &str = "pidgr.v1.DeviceService";
4965    impl<T> tonic::server::NamedService for DeviceServiceServer<T> {
4966        const NAME: &'static str = SERVICE_NAME;
4967    }
4968}
4969/// Generated client implementations.
4970pub mod group_service_client {
4971    #![allow(
4972        unused_variables,
4973        dead_code,
4974        missing_docs,
4975        clippy::wildcard_imports,
4976        clippy::let_unit_value,
4977    )]
4978    use tonic::codegen::*;
4979    use tonic::codegen::http::Uri;
4980    /** Manages groups and group membership within an organization.
4981 Groups are recipient collections used for campaign audience targeting.
4982 All RPCs operate within the caller's org (extracted from JWT).
4983*/
4984    #[derive(Debug, Clone)]
4985    pub struct GroupServiceClient<T> {
4986        inner: tonic::client::Grpc<T>,
4987    }
4988    impl GroupServiceClient<tonic::transport::Channel> {
4989        /// Attempt to create a new client by connecting to a given endpoint.
4990        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4991        where
4992            D: TryInto<tonic::transport::Endpoint>,
4993            D::Error: Into<StdError>,
4994        {
4995            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4996            Ok(Self::new(conn))
4997        }
4998    }
4999    impl<T> GroupServiceClient<T>
5000    where
5001        T: tonic::client::GrpcService<tonic::body::Body>,
5002        T::Error: Into<StdError>,
5003        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5004        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5005    {
5006        pub fn new(inner: T) -> Self {
5007            let inner = tonic::client::Grpc::new(inner);
5008            Self { inner }
5009        }
5010        pub fn with_origin(inner: T, origin: Uri) -> Self {
5011            let inner = tonic::client::Grpc::with_origin(inner, origin);
5012            Self { inner }
5013        }
5014        pub fn with_interceptor<F>(
5015            inner: T,
5016            interceptor: F,
5017        ) -> GroupServiceClient<InterceptedService<T, F>>
5018        where
5019            F: tonic::service::Interceptor,
5020            T::ResponseBody: Default,
5021            T: tonic::codegen::Service<
5022                http::Request<tonic::body::Body>,
5023                Response = http::Response<
5024                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
5025                >,
5026            >,
5027            <T as tonic::codegen::Service<
5028                http::Request<tonic::body::Body>,
5029            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
5030        {
5031            GroupServiceClient::new(InterceptedService::new(inner, interceptor))
5032        }
5033        /// Compress requests with the given encoding.
5034        ///
5035        /// This requires the server to support it otherwise it might respond with an
5036        /// error.
5037        #[must_use]
5038        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5039            self.inner = self.inner.send_compressed(encoding);
5040            self
5041        }
5042        /// Enable decompressing responses.
5043        #[must_use]
5044        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5045            self.inner = self.inner.accept_compressed(encoding);
5046            self
5047        }
5048        /// Limits the maximum size of a decoded message.
5049        ///
5050        /// Default: `4MB`
5051        #[must_use]
5052        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5053            self.inner = self.inner.max_decoding_message_size(limit);
5054            self
5055        }
5056        /// Limits the maximum size of an encoded message.
5057        ///
5058        /// Default: `usize::MAX`
5059        #[must_use]
5060        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5061            self.inner = self.inner.max_encoding_message_size(limit);
5062            self
5063        }
5064        /** Create a new group in the organization.
5065 Authorization: Requires PERMISSION_GROUPS_WRITE or PERMISSION_GROUPS_ALL_WRITE.
5066*/
5067        pub async fn create_group(
5068            &mut self,
5069            request: impl tonic::IntoRequest<super::CreateGroupRequest>,
5070        ) -> std::result::Result<
5071            tonic::Response<super::CreateGroupResponse>,
5072            tonic::Status,
5073        > {
5074            self.inner
5075                .ready()
5076                .await
5077                .map_err(|e| {
5078                    tonic::Status::unknown(
5079                        format!("Service was not ready: {}", e.into()),
5080                    )
5081                })?;
5082            let codec = tonic_prost::ProstCodec::default();
5083            let path = http::uri::PathAndQuery::from_static(
5084                "/pidgr.v1.GroupService/CreateGroup",
5085            );
5086            let mut req = request.into_request();
5087            req.extensions_mut()
5088                .insert(GrpcMethod::new("pidgr.v1.GroupService", "CreateGroup"));
5089            self.inner.unary(req, path, codec).await
5090        }
5091        /** Retrieve a group by ID.
5092 Authorization: Caller must be a member of the group, or have
5093 PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
5094*/
5095        pub async fn get_group(
5096            &mut self,
5097            request: impl tonic::IntoRequest<super::GetGroupRequest>,
5098        ) -> std::result::Result<
5099            tonic::Response<super::GetGroupResponse>,
5100            tonic::Status,
5101        > {
5102            self.inner
5103                .ready()
5104                .await
5105                .map_err(|e| {
5106                    tonic::Status::unknown(
5107                        format!("Service was not ready: {}", e.into()),
5108                    )
5109                })?;
5110            let codec = tonic_prost::ProstCodec::default();
5111            let path = http::uri::PathAndQuery::from_static(
5112                "/pidgr.v1.GroupService/GetGroup",
5113            );
5114            let mut req = request.into_request();
5115            req.extensions_mut()
5116                .insert(GrpcMethod::new("pidgr.v1.GroupService", "GetGroup"));
5117            self.inner.unary(req, path, codec).await
5118        }
5119        /** List groups in the organization with pagination.
5120 Without PERMISSION_GROUPS_ALL_READ/ALL_WRITE, returns only groups the caller belongs to.
5121*/
5122        pub async fn list_groups(
5123            &mut self,
5124            request: impl tonic::IntoRequest<super::ListGroupsRequest>,
5125        ) -> std::result::Result<
5126            tonic::Response<super::ListGroupsResponse>,
5127            tonic::Status,
5128        > {
5129            self.inner
5130                .ready()
5131                .await
5132                .map_err(|e| {
5133                    tonic::Status::unknown(
5134                        format!("Service was not ready: {}", e.into()),
5135                    )
5136                })?;
5137            let codec = tonic_prost::ProstCodec::default();
5138            let path = http::uri::PathAndQuery::from_static(
5139                "/pidgr.v1.GroupService/ListGroups",
5140            );
5141            let mut req = request.into_request();
5142            req.extensions_mut()
5143                .insert(GrpcMethod::new("pidgr.v1.GroupService", "ListGroups"));
5144            self.inner.unary(req, path, codec).await
5145        }
5146        /** Update a group's name and/or description.
5147 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
5148*/
5149        pub async fn update_group(
5150            &mut self,
5151            request: impl tonic::IntoRequest<super::UpdateGroupRequest>,
5152        ) -> std::result::Result<
5153            tonic::Response<super::UpdateGroupResponse>,
5154            tonic::Status,
5155        > {
5156            self.inner
5157                .ready()
5158                .await
5159                .map_err(|e| {
5160                    tonic::Status::unknown(
5161                        format!("Service was not ready: {}", e.into()),
5162                    )
5163                })?;
5164            let codec = tonic_prost::ProstCodec::default();
5165            let path = http::uri::PathAndQuery::from_static(
5166                "/pidgr.v1.GroupService/UpdateGroup",
5167            );
5168            let mut req = request.into_request();
5169            req.extensions_mut()
5170                .insert(GrpcMethod::new("pidgr.v1.GroupService", "UpdateGroup"));
5171            self.inner.unary(req, path, codec).await
5172        }
5173        /** Delete a group and all its membership records. Default groups cannot be deleted.
5174 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
5175*/
5176        pub async fn delete_group(
5177            &mut self,
5178            request: impl tonic::IntoRequest<super::DeleteGroupRequest>,
5179        ) -> std::result::Result<
5180            tonic::Response<super::DeleteGroupResponse>,
5181            tonic::Status,
5182        > {
5183            self.inner
5184                .ready()
5185                .await
5186                .map_err(|e| {
5187                    tonic::Status::unknown(
5188                        format!("Service was not ready: {}", e.into()),
5189                    )
5190                })?;
5191            let codec = tonic_prost::ProstCodec::default();
5192            let path = http::uri::PathAndQuery::from_static(
5193                "/pidgr.v1.GroupService/DeleteGroup",
5194            );
5195            let mut req = request.into_request();
5196            req.extensions_mut()
5197                .insert(GrpcMethod::new("pidgr.v1.GroupService", "DeleteGroup"));
5198            self.inner.unary(req, path, codec).await
5199        }
5200        /** Add one or more users to a group (idempotent).
5201 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
5202*/
5203        pub async fn add_group_members(
5204            &mut self,
5205            request: impl tonic::IntoRequest<super::AddGroupMembersRequest>,
5206        ) -> std::result::Result<
5207            tonic::Response<super::AddGroupMembersResponse>,
5208            tonic::Status,
5209        > {
5210            self.inner
5211                .ready()
5212                .await
5213                .map_err(|e| {
5214                    tonic::Status::unknown(
5215                        format!("Service was not ready: {}", e.into()),
5216                    )
5217                })?;
5218            let codec = tonic_prost::ProstCodec::default();
5219            let path = http::uri::PathAndQuery::from_static(
5220                "/pidgr.v1.GroupService/AddGroupMembers",
5221            );
5222            let mut req = request.into_request();
5223            req.extensions_mut()
5224                .insert(GrpcMethod::new("pidgr.v1.GroupService", "AddGroupMembers"));
5225            self.inner.unary(req, path, codec).await
5226        }
5227        /** Remove one or more users from a group (idempotent).
5228 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
5229*/
5230        pub async fn remove_group_members(
5231            &mut self,
5232            request: impl tonic::IntoRequest<super::RemoveGroupMembersRequest>,
5233        ) -> std::result::Result<
5234            tonic::Response<super::RemoveGroupMembersResponse>,
5235            tonic::Status,
5236        > {
5237            self.inner
5238                .ready()
5239                .await
5240                .map_err(|e| {
5241                    tonic::Status::unknown(
5242                        format!("Service was not ready: {}", e.into()),
5243                    )
5244                })?;
5245            let codec = tonic_prost::ProstCodec::default();
5246            let path = http::uri::PathAndQuery::from_static(
5247                "/pidgr.v1.GroupService/RemoveGroupMembers",
5248            );
5249            let mut req = request.into_request();
5250            req.extensions_mut()
5251                .insert(GrpcMethod::new("pidgr.v1.GroupService", "RemoveGroupMembers"));
5252            self.inner.unary(req, path, codec).await
5253        }
5254        /** List members of a group with pagination.
5255 Authorization: Caller must be a member of the group, or have
5256 PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
5257*/
5258        pub async fn list_group_members(
5259            &mut self,
5260            request: impl tonic::IntoRequest<super::ListGroupMembersRequest>,
5261        ) -> std::result::Result<
5262            tonic::Response<super::ListGroupMembersResponse>,
5263            tonic::Status,
5264        > {
5265            self.inner
5266                .ready()
5267                .await
5268                .map_err(|e| {
5269                    tonic::Status::unknown(
5270                        format!("Service was not ready: {}", e.into()),
5271                    )
5272                })?;
5273            let codec = tonic_prost::ProstCodec::default();
5274            let path = http::uri::PathAndQuery::from_static(
5275                "/pidgr.v1.GroupService/ListGroupMembers",
5276            );
5277            let mut req = request.into_request();
5278            req.extensions_mut()
5279                .insert(GrpcMethod::new("pidgr.v1.GroupService", "ListGroupMembers"));
5280            self.inner.unary(req, path, codec).await
5281        }
5282        /** Get group memberships for a batch of users.
5283 Used by campaign audience to show group badges.
5284 Authorization: Requires PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
5285*/
5286        pub async fn get_user_group_memberships(
5287            &mut self,
5288            request: impl tonic::IntoRequest<super::GetUserGroupMembershipsRequest>,
5289        ) -> std::result::Result<
5290            tonic::Response<super::GetUserGroupMembershipsResponse>,
5291            tonic::Status,
5292        > {
5293            self.inner
5294                .ready()
5295                .await
5296                .map_err(|e| {
5297                    tonic::Status::unknown(
5298                        format!("Service was not ready: {}", e.into()),
5299                    )
5300                })?;
5301            let codec = tonic_prost::ProstCodec::default();
5302            let path = http::uri::PathAndQuery::from_static(
5303                "/pidgr.v1.GroupService/GetUserGroupMemberships",
5304            );
5305            let mut req = request.into_request();
5306            req.extensions_mut()
5307                .insert(
5308                    GrpcMethod::new("pidgr.v1.GroupService", "GetUserGroupMemberships"),
5309                );
5310            self.inner.unary(req, path, codec).await
5311        }
5312    }
5313}
5314/// Generated server implementations.
5315pub mod group_service_server {
5316    #![allow(
5317        unused_variables,
5318        dead_code,
5319        missing_docs,
5320        clippy::wildcard_imports,
5321        clippy::let_unit_value,
5322    )]
5323    use tonic::codegen::*;
5324    /// Generated trait containing gRPC methods that should be implemented for use with GroupServiceServer.
5325    #[async_trait]
5326    pub trait GroupService: std::marker::Send + std::marker::Sync + 'static {
5327        /** Create a new group in the organization.
5328 Authorization: Requires PERMISSION_GROUPS_WRITE or PERMISSION_GROUPS_ALL_WRITE.
5329*/
5330        async fn create_group(
5331            &self,
5332            request: tonic::Request<super::CreateGroupRequest>,
5333        ) -> std::result::Result<
5334            tonic::Response<super::CreateGroupResponse>,
5335            tonic::Status,
5336        >;
5337        /** Retrieve a group by ID.
5338 Authorization: Caller must be a member of the group, or have
5339 PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
5340*/
5341        async fn get_group(
5342            &self,
5343            request: tonic::Request<super::GetGroupRequest>,
5344        ) -> std::result::Result<
5345            tonic::Response<super::GetGroupResponse>,
5346            tonic::Status,
5347        >;
5348        /** List groups in the organization with pagination.
5349 Without PERMISSION_GROUPS_ALL_READ/ALL_WRITE, returns only groups the caller belongs to.
5350*/
5351        async fn list_groups(
5352            &self,
5353            request: tonic::Request<super::ListGroupsRequest>,
5354        ) -> std::result::Result<
5355            tonic::Response<super::ListGroupsResponse>,
5356            tonic::Status,
5357        >;
5358        /** Update a group's name and/or description.
5359 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
5360*/
5361        async fn update_group(
5362            &self,
5363            request: tonic::Request<super::UpdateGroupRequest>,
5364        ) -> std::result::Result<
5365            tonic::Response<super::UpdateGroupResponse>,
5366            tonic::Status,
5367        >;
5368        /** Delete a group and all its membership records. Default groups cannot be deleted.
5369 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
5370*/
5371        async fn delete_group(
5372            &self,
5373            request: tonic::Request<super::DeleteGroupRequest>,
5374        ) -> std::result::Result<
5375            tonic::Response<super::DeleteGroupResponse>,
5376            tonic::Status,
5377        >;
5378        /** Add one or more users to a group (idempotent).
5379 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
5380*/
5381        async fn add_group_members(
5382            &self,
5383            request: tonic::Request<super::AddGroupMembersRequest>,
5384        ) -> std::result::Result<
5385            tonic::Response<super::AddGroupMembersResponse>,
5386            tonic::Status,
5387        >;
5388        /** Remove one or more users from a group (idempotent).
5389 Authorization: Requires PERMISSION_GROUPS_WRITE (own groups) or PERMISSION_GROUPS_ALL_WRITE (any).
5390*/
5391        async fn remove_group_members(
5392            &self,
5393            request: tonic::Request<super::RemoveGroupMembersRequest>,
5394        ) -> std::result::Result<
5395            tonic::Response<super::RemoveGroupMembersResponse>,
5396            tonic::Status,
5397        >;
5398        /** List members of a group with pagination.
5399 Authorization: Caller must be a member of the group, or have
5400 PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
5401*/
5402        async fn list_group_members(
5403            &self,
5404            request: tonic::Request<super::ListGroupMembersRequest>,
5405        ) -> std::result::Result<
5406            tonic::Response<super::ListGroupMembersResponse>,
5407            tonic::Status,
5408        >;
5409        /** Get group memberships for a batch of users.
5410 Used by campaign audience to show group badges.
5411 Authorization: Requires PERMISSION_GROUPS_ALL_READ or PERMISSION_GROUPS_ALL_WRITE.
5412*/
5413        async fn get_user_group_memberships(
5414            &self,
5415            request: tonic::Request<super::GetUserGroupMembershipsRequest>,
5416        ) -> std::result::Result<
5417            tonic::Response<super::GetUserGroupMembershipsResponse>,
5418            tonic::Status,
5419        >;
5420    }
5421    /** Manages groups and group membership within an organization.
5422 Groups are recipient collections used for campaign audience targeting.
5423 All RPCs operate within the caller's org (extracted from JWT).
5424*/
5425    #[derive(Debug)]
5426    pub struct GroupServiceServer<T> {
5427        inner: Arc<T>,
5428        accept_compression_encodings: EnabledCompressionEncodings,
5429        send_compression_encodings: EnabledCompressionEncodings,
5430        max_decoding_message_size: Option<usize>,
5431        max_encoding_message_size: Option<usize>,
5432    }
5433    impl<T> GroupServiceServer<T> {
5434        pub fn new(inner: T) -> Self {
5435            Self::from_arc(Arc::new(inner))
5436        }
5437        pub fn from_arc(inner: Arc<T>) -> Self {
5438            Self {
5439                inner,
5440                accept_compression_encodings: Default::default(),
5441                send_compression_encodings: Default::default(),
5442                max_decoding_message_size: None,
5443                max_encoding_message_size: None,
5444            }
5445        }
5446        pub fn with_interceptor<F>(
5447            inner: T,
5448            interceptor: F,
5449        ) -> InterceptedService<Self, F>
5450        where
5451            F: tonic::service::Interceptor,
5452        {
5453            InterceptedService::new(Self::new(inner), interceptor)
5454        }
5455        /// Enable decompressing requests with the given encoding.
5456        #[must_use]
5457        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5458            self.accept_compression_encodings.enable(encoding);
5459            self
5460        }
5461        /// Compress responses with the given encoding, if the client supports it.
5462        #[must_use]
5463        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5464            self.send_compression_encodings.enable(encoding);
5465            self
5466        }
5467        /// Limits the maximum size of a decoded message.
5468        ///
5469        /// Default: `4MB`
5470        #[must_use]
5471        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5472            self.max_decoding_message_size = Some(limit);
5473            self
5474        }
5475        /// Limits the maximum size of an encoded message.
5476        ///
5477        /// Default: `usize::MAX`
5478        #[must_use]
5479        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5480            self.max_encoding_message_size = Some(limit);
5481            self
5482        }
5483    }
5484    impl<T, B> tonic::codegen::Service<http::Request<B>> for GroupServiceServer<T>
5485    where
5486        T: GroupService,
5487        B: Body + std::marker::Send + 'static,
5488        B::Error: Into<StdError> + std::marker::Send + 'static,
5489    {
5490        type Response = http::Response<tonic::body::Body>;
5491        type Error = std::convert::Infallible;
5492        type Future = BoxFuture<Self::Response, Self::Error>;
5493        fn poll_ready(
5494            &mut self,
5495            _cx: &mut Context<'_>,
5496        ) -> Poll<std::result::Result<(), Self::Error>> {
5497            Poll::Ready(Ok(()))
5498        }
5499        fn call(&mut self, req: http::Request<B>) -> Self::Future {
5500            match req.uri().path() {
5501                "/pidgr.v1.GroupService/CreateGroup" => {
5502                    #[allow(non_camel_case_types)]
5503                    struct CreateGroupSvc<T: GroupService>(pub Arc<T>);
5504                    impl<
5505                        T: GroupService,
5506                    > tonic::server::UnaryService<super::CreateGroupRequest>
5507                    for CreateGroupSvc<T> {
5508                        type Response = super::CreateGroupResponse;
5509                        type Future = BoxFuture<
5510                            tonic::Response<Self::Response>,
5511                            tonic::Status,
5512                        >;
5513                        fn call(
5514                            &mut self,
5515                            request: tonic::Request<super::CreateGroupRequest>,
5516                        ) -> Self::Future {
5517                            let inner = Arc::clone(&self.0);
5518                            let fut = async move {
5519                                <T as GroupService>::create_group(&inner, request).await
5520                            };
5521                            Box::pin(fut)
5522                        }
5523                    }
5524                    let accept_compression_encodings = self.accept_compression_encodings;
5525                    let send_compression_encodings = self.send_compression_encodings;
5526                    let max_decoding_message_size = self.max_decoding_message_size;
5527                    let max_encoding_message_size = self.max_encoding_message_size;
5528                    let inner = self.inner.clone();
5529                    let fut = async move {
5530                        let method = CreateGroupSvc(inner);
5531                        let codec = tonic_prost::ProstCodec::default();
5532                        let mut grpc = tonic::server::Grpc::new(codec)
5533                            .apply_compression_config(
5534                                accept_compression_encodings,
5535                                send_compression_encodings,
5536                            )
5537                            .apply_max_message_size_config(
5538                                max_decoding_message_size,
5539                                max_encoding_message_size,
5540                            );
5541                        let res = grpc.unary(method, req).await;
5542                        Ok(res)
5543                    };
5544                    Box::pin(fut)
5545                }
5546                "/pidgr.v1.GroupService/GetGroup" => {
5547                    #[allow(non_camel_case_types)]
5548                    struct GetGroupSvc<T: GroupService>(pub Arc<T>);
5549                    impl<
5550                        T: GroupService,
5551                    > tonic::server::UnaryService<super::GetGroupRequest>
5552                    for GetGroupSvc<T> {
5553                        type Response = super::GetGroupResponse;
5554                        type Future = BoxFuture<
5555                            tonic::Response<Self::Response>,
5556                            tonic::Status,
5557                        >;
5558                        fn call(
5559                            &mut self,
5560                            request: tonic::Request<super::GetGroupRequest>,
5561                        ) -> Self::Future {
5562                            let inner = Arc::clone(&self.0);
5563                            let fut = async move {
5564                                <T as GroupService>::get_group(&inner, request).await
5565                            };
5566                            Box::pin(fut)
5567                        }
5568                    }
5569                    let accept_compression_encodings = self.accept_compression_encodings;
5570                    let send_compression_encodings = self.send_compression_encodings;
5571                    let max_decoding_message_size = self.max_decoding_message_size;
5572                    let max_encoding_message_size = self.max_encoding_message_size;
5573                    let inner = self.inner.clone();
5574                    let fut = async move {
5575                        let method = GetGroupSvc(inner);
5576                        let codec = tonic_prost::ProstCodec::default();
5577                        let mut grpc = tonic::server::Grpc::new(codec)
5578                            .apply_compression_config(
5579                                accept_compression_encodings,
5580                                send_compression_encodings,
5581                            )
5582                            .apply_max_message_size_config(
5583                                max_decoding_message_size,
5584                                max_encoding_message_size,
5585                            );
5586                        let res = grpc.unary(method, req).await;
5587                        Ok(res)
5588                    };
5589                    Box::pin(fut)
5590                }
5591                "/pidgr.v1.GroupService/ListGroups" => {
5592                    #[allow(non_camel_case_types)]
5593                    struct ListGroupsSvc<T: GroupService>(pub Arc<T>);
5594                    impl<
5595                        T: GroupService,
5596                    > tonic::server::UnaryService<super::ListGroupsRequest>
5597                    for ListGroupsSvc<T> {
5598                        type Response = super::ListGroupsResponse;
5599                        type Future = BoxFuture<
5600                            tonic::Response<Self::Response>,
5601                            tonic::Status,
5602                        >;
5603                        fn call(
5604                            &mut self,
5605                            request: tonic::Request<super::ListGroupsRequest>,
5606                        ) -> Self::Future {
5607                            let inner = Arc::clone(&self.0);
5608                            let fut = async move {
5609                                <T as GroupService>::list_groups(&inner, request).await
5610                            };
5611                            Box::pin(fut)
5612                        }
5613                    }
5614                    let accept_compression_encodings = self.accept_compression_encodings;
5615                    let send_compression_encodings = self.send_compression_encodings;
5616                    let max_decoding_message_size = self.max_decoding_message_size;
5617                    let max_encoding_message_size = self.max_encoding_message_size;
5618                    let inner = self.inner.clone();
5619                    let fut = async move {
5620                        let method = ListGroupsSvc(inner);
5621                        let codec = tonic_prost::ProstCodec::default();
5622                        let mut grpc = tonic::server::Grpc::new(codec)
5623                            .apply_compression_config(
5624                                accept_compression_encodings,
5625                                send_compression_encodings,
5626                            )
5627                            .apply_max_message_size_config(
5628                                max_decoding_message_size,
5629                                max_encoding_message_size,
5630                            );
5631                        let res = grpc.unary(method, req).await;
5632                        Ok(res)
5633                    };
5634                    Box::pin(fut)
5635                }
5636                "/pidgr.v1.GroupService/UpdateGroup" => {
5637                    #[allow(non_camel_case_types)]
5638                    struct UpdateGroupSvc<T: GroupService>(pub Arc<T>);
5639                    impl<
5640                        T: GroupService,
5641                    > tonic::server::UnaryService<super::UpdateGroupRequest>
5642                    for UpdateGroupSvc<T> {
5643                        type Response = super::UpdateGroupResponse;
5644                        type Future = BoxFuture<
5645                            tonic::Response<Self::Response>,
5646                            tonic::Status,
5647                        >;
5648                        fn call(
5649                            &mut self,
5650                            request: tonic::Request<super::UpdateGroupRequest>,
5651                        ) -> Self::Future {
5652                            let inner = Arc::clone(&self.0);
5653                            let fut = async move {
5654                                <T as GroupService>::update_group(&inner, request).await
5655                            };
5656                            Box::pin(fut)
5657                        }
5658                    }
5659                    let accept_compression_encodings = self.accept_compression_encodings;
5660                    let send_compression_encodings = self.send_compression_encodings;
5661                    let max_decoding_message_size = self.max_decoding_message_size;
5662                    let max_encoding_message_size = self.max_encoding_message_size;
5663                    let inner = self.inner.clone();
5664                    let fut = async move {
5665                        let method = UpdateGroupSvc(inner);
5666                        let codec = tonic_prost::ProstCodec::default();
5667                        let mut grpc = tonic::server::Grpc::new(codec)
5668                            .apply_compression_config(
5669                                accept_compression_encodings,
5670                                send_compression_encodings,
5671                            )
5672                            .apply_max_message_size_config(
5673                                max_decoding_message_size,
5674                                max_encoding_message_size,
5675                            );
5676                        let res = grpc.unary(method, req).await;
5677                        Ok(res)
5678                    };
5679                    Box::pin(fut)
5680                }
5681                "/pidgr.v1.GroupService/DeleteGroup" => {
5682                    #[allow(non_camel_case_types)]
5683                    struct DeleteGroupSvc<T: GroupService>(pub Arc<T>);
5684                    impl<
5685                        T: GroupService,
5686                    > tonic::server::UnaryService<super::DeleteGroupRequest>
5687                    for DeleteGroupSvc<T> {
5688                        type Response = super::DeleteGroupResponse;
5689                        type Future = BoxFuture<
5690                            tonic::Response<Self::Response>,
5691                            tonic::Status,
5692                        >;
5693                        fn call(
5694                            &mut self,
5695                            request: tonic::Request<super::DeleteGroupRequest>,
5696                        ) -> Self::Future {
5697                            let inner = Arc::clone(&self.0);
5698                            let fut = async move {
5699                                <T as GroupService>::delete_group(&inner, request).await
5700                            };
5701                            Box::pin(fut)
5702                        }
5703                    }
5704                    let accept_compression_encodings = self.accept_compression_encodings;
5705                    let send_compression_encodings = self.send_compression_encodings;
5706                    let max_decoding_message_size = self.max_decoding_message_size;
5707                    let max_encoding_message_size = self.max_encoding_message_size;
5708                    let inner = self.inner.clone();
5709                    let fut = async move {
5710                        let method = DeleteGroupSvc(inner);
5711                        let codec = tonic_prost::ProstCodec::default();
5712                        let mut grpc = tonic::server::Grpc::new(codec)
5713                            .apply_compression_config(
5714                                accept_compression_encodings,
5715                                send_compression_encodings,
5716                            )
5717                            .apply_max_message_size_config(
5718                                max_decoding_message_size,
5719                                max_encoding_message_size,
5720                            );
5721                        let res = grpc.unary(method, req).await;
5722                        Ok(res)
5723                    };
5724                    Box::pin(fut)
5725                }
5726                "/pidgr.v1.GroupService/AddGroupMembers" => {
5727                    #[allow(non_camel_case_types)]
5728                    struct AddGroupMembersSvc<T: GroupService>(pub Arc<T>);
5729                    impl<
5730                        T: GroupService,
5731                    > tonic::server::UnaryService<super::AddGroupMembersRequest>
5732                    for AddGroupMembersSvc<T> {
5733                        type Response = super::AddGroupMembersResponse;
5734                        type Future = BoxFuture<
5735                            tonic::Response<Self::Response>,
5736                            tonic::Status,
5737                        >;
5738                        fn call(
5739                            &mut self,
5740                            request: tonic::Request<super::AddGroupMembersRequest>,
5741                        ) -> Self::Future {
5742                            let inner = Arc::clone(&self.0);
5743                            let fut = async move {
5744                                <T as GroupService>::add_group_members(&inner, request)
5745                                    .await
5746                            };
5747                            Box::pin(fut)
5748                        }
5749                    }
5750                    let accept_compression_encodings = self.accept_compression_encodings;
5751                    let send_compression_encodings = self.send_compression_encodings;
5752                    let max_decoding_message_size = self.max_decoding_message_size;
5753                    let max_encoding_message_size = self.max_encoding_message_size;
5754                    let inner = self.inner.clone();
5755                    let fut = async move {
5756                        let method = AddGroupMembersSvc(inner);
5757                        let codec = tonic_prost::ProstCodec::default();
5758                        let mut grpc = tonic::server::Grpc::new(codec)
5759                            .apply_compression_config(
5760                                accept_compression_encodings,
5761                                send_compression_encodings,
5762                            )
5763                            .apply_max_message_size_config(
5764                                max_decoding_message_size,
5765                                max_encoding_message_size,
5766                            );
5767                        let res = grpc.unary(method, req).await;
5768                        Ok(res)
5769                    };
5770                    Box::pin(fut)
5771                }
5772                "/pidgr.v1.GroupService/RemoveGroupMembers" => {
5773                    #[allow(non_camel_case_types)]
5774                    struct RemoveGroupMembersSvc<T: GroupService>(pub Arc<T>);
5775                    impl<
5776                        T: GroupService,
5777                    > tonic::server::UnaryService<super::RemoveGroupMembersRequest>
5778                    for RemoveGroupMembersSvc<T> {
5779                        type Response = super::RemoveGroupMembersResponse;
5780                        type Future = BoxFuture<
5781                            tonic::Response<Self::Response>,
5782                            tonic::Status,
5783                        >;
5784                        fn call(
5785                            &mut self,
5786                            request: tonic::Request<super::RemoveGroupMembersRequest>,
5787                        ) -> Self::Future {
5788                            let inner = Arc::clone(&self.0);
5789                            let fut = async move {
5790                                <T as GroupService>::remove_group_members(&inner, request)
5791                                    .await
5792                            };
5793                            Box::pin(fut)
5794                        }
5795                    }
5796                    let accept_compression_encodings = self.accept_compression_encodings;
5797                    let send_compression_encodings = self.send_compression_encodings;
5798                    let max_decoding_message_size = self.max_decoding_message_size;
5799                    let max_encoding_message_size = self.max_encoding_message_size;
5800                    let inner = self.inner.clone();
5801                    let fut = async move {
5802                        let method = RemoveGroupMembersSvc(inner);
5803                        let codec = tonic_prost::ProstCodec::default();
5804                        let mut grpc = tonic::server::Grpc::new(codec)
5805                            .apply_compression_config(
5806                                accept_compression_encodings,
5807                                send_compression_encodings,
5808                            )
5809                            .apply_max_message_size_config(
5810                                max_decoding_message_size,
5811                                max_encoding_message_size,
5812                            );
5813                        let res = grpc.unary(method, req).await;
5814                        Ok(res)
5815                    };
5816                    Box::pin(fut)
5817                }
5818                "/pidgr.v1.GroupService/ListGroupMembers" => {
5819                    #[allow(non_camel_case_types)]
5820                    struct ListGroupMembersSvc<T: GroupService>(pub Arc<T>);
5821                    impl<
5822                        T: GroupService,
5823                    > tonic::server::UnaryService<super::ListGroupMembersRequest>
5824                    for ListGroupMembersSvc<T> {
5825                        type Response = super::ListGroupMembersResponse;
5826                        type Future = BoxFuture<
5827                            tonic::Response<Self::Response>,
5828                            tonic::Status,
5829                        >;
5830                        fn call(
5831                            &mut self,
5832                            request: tonic::Request<super::ListGroupMembersRequest>,
5833                        ) -> Self::Future {
5834                            let inner = Arc::clone(&self.0);
5835                            let fut = async move {
5836                                <T as GroupService>::list_group_members(&inner, request)
5837                                    .await
5838                            };
5839                            Box::pin(fut)
5840                        }
5841                    }
5842                    let accept_compression_encodings = self.accept_compression_encodings;
5843                    let send_compression_encodings = self.send_compression_encodings;
5844                    let max_decoding_message_size = self.max_decoding_message_size;
5845                    let max_encoding_message_size = self.max_encoding_message_size;
5846                    let inner = self.inner.clone();
5847                    let fut = async move {
5848                        let method = ListGroupMembersSvc(inner);
5849                        let codec = tonic_prost::ProstCodec::default();
5850                        let mut grpc = tonic::server::Grpc::new(codec)
5851                            .apply_compression_config(
5852                                accept_compression_encodings,
5853                                send_compression_encodings,
5854                            )
5855                            .apply_max_message_size_config(
5856                                max_decoding_message_size,
5857                                max_encoding_message_size,
5858                            );
5859                        let res = grpc.unary(method, req).await;
5860                        Ok(res)
5861                    };
5862                    Box::pin(fut)
5863                }
5864                "/pidgr.v1.GroupService/GetUserGroupMemberships" => {
5865                    #[allow(non_camel_case_types)]
5866                    struct GetUserGroupMembershipsSvc<T: GroupService>(pub Arc<T>);
5867                    impl<
5868                        T: GroupService,
5869                    > tonic::server::UnaryService<super::GetUserGroupMembershipsRequest>
5870                    for GetUserGroupMembershipsSvc<T> {
5871                        type Response = super::GetUserGroupMembershipsResponse;
5872                        type Future = BoxFuture<
5873                            tonic::Response<Self::Response>,
5874                            tonic::Status,
5875                        >;
5876                        fn call(
5877                            &mut self,
5878                            request: tonic::Request<
5879                                super::GetUserGroupMembershipsRequest,
5880                            >,
5881                        ) -> Self::Future {
5882                            let inner = Arc::clone(&self.0);
5883                            let fut = async move {
5884                                <T as GroupService>::get_user_group_memberships(
5885                                        &inner,
5886                                        request,
5887                                    )
5888                                    .await
5889                            };
5890                            Box::pin(fut)
5891                        }
5892                    }
5893                    let accept_compression_encodings = self.accept_compression_encodings;
5894                    let send_compression_encodings = self.send_compression_encodings;
5895                    let max_decoding_message_size = self.max_decoding_message_size;
5896                    let max_encoding_message_size = self.max_encoding_message_size;
5897                    let inner = self.inner.clone();
5898                    let fut = async move {
5899                        let method = GetUserGroupMembershipsSvc(inner);
5900                        let codec = tonic_prost::ProstCodec::default();
5901                        let mut grpc = tonic::server::Grpc::new(codec)
5902                            .apply_compression_config(
5903                                accept_compression_encodings,
5904                                send_compression_encodings,
5905                            )
5906                            .apply_max_message_size_config(
5907                                max_decoding_message_size,
5908                                max_encoding_message_size,
5909                            );
5910                        let res = grpc.unary(method, req).await;
5911                        Ok(res)
5912                    };
5913                    Box::pin(fut)
5914                }
5915                _ => {
5916                    Box::pin(async move {
5917                        let mut response = http::Response::new(
5918                            tonic::body::Body::default(),
5919                        );
5920                        let headers = response.headers_mut();
5921                        headers
5922                            .insert(
5923                                tonic::Status::GRPC_STATUS,
5924                                (tonic::Code::Unimplemented as i32).into(),
5925                            );
5926                        headers
5927                            .insert(
5928                                http::header::CONTENT_TYPE,
5929                                tonic::metadata::GRPC_CONTENT_TYPE,
5930                            );
5931                        Ok(response)
5932                    })
5933                }
5934            }
5935        }
5936    }
5937    impl<T> Clone for GroupServiceServer<T> {
5938        fn clone(&self) -> Self {
5939            let inner = self.inner.clone();
5940            Self {
5941                inner,
5942                accept_compression_encodings: self.accept_compression_encodings,
5943                send_compression_encodings: self.send_compression_encodings,
5944                max_decoding_message_size: self.max_decoding_message_size,
5945                max_encoding_message_size: self.max_encoding_message_size,
5946            }
5947        }
5948    }
5949    /// Generated gRPC service name
5950    pub const SERVICE_NAME: &str = "pidgr.v1.GroupService";
5951    impl<T> tonic::server::NamedService for GroupServiceServer<T> {
5952        const NAME: &'static str = SERVICE_NAME;
5953    }
5954}
5955/// Generated client implementations.
5956pub mod heatmap_service_client {
5957    #![allow(
5958        unused_variables,
5959        dead_code,
5960        missing_docs,
5961        clippy::wildcard_imports,
5962        clippy::let_unit_value,
5963    )]
5964    use tonic::codegen::*;
5965    use tonic::codegen::http::Uri;
5966    /** Manages touch event ingestion, heatmap data aggregation, and screen screenshots
5967 for mobile app interaction analytics.
5968*/
5969    #[derive(Debug, Clone)]
5970    pub struct HeatmapServiceClient<T> {
5971        inner: tonic::client::Grpc<T>,
5972    }
5973    impl HeatmapServiceClient<tonic::transport::Channel> {
5974        /// Attempt to create a new client by connecting to a given endpoint.
5975        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5976        where
5977            D: TryInto<tonic::transport::Endpoint>,
5978            D::Error: Into<StdError>,
5979        {
5980            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5981            Ok(Self::new(conn))
5982        }
5983    }
5984    impl<T> HeatmapServiceClient<T>
5985    where
5986        T: tonic::client::GrpcService<tonic::body::Body>,
5987        T::Error: Into<StdError>,
5988        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5989        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5990    {
5991        pub fn new(inner: T) -> Self {
5992            let inner = tonic::client::Grpc::new(inner);
5993            Self { inner }
5994        }
5995        pub fn with_origin(inner: T, origin: Uri) -> Self {
5996            let inner = tonic::client::Grpc::with_origin(inner, origin);
5997            Self { inner }
5998        }
5999        pub fn with_interceptor<F>(
6000            inner: T,
6001            interceptor: F,
6002        ) -> HeatmapServiceClient<InterceptedService<T, F>>
6003        where
6004            F: tonic::service::Interceptor,
6005            T::ResponseBody: Default,
6006            T: tonic::codegen::Service<
6007                http::Request<tonic::body::Body>,
6008                Response = http::Response<
6009                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6010                >,
6011            >,
6012            <T as tonic::codegen::Service<
6013                http::Request<tonic::body::Body>,
6014            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6015        {
6016            HeatmapServiceClient::new(InterceptedService::new(inner, interceptor))
6017        }
6018        /// Compress requests with the given encoding.
6019        ///
6020        /// This requires the server to support it otherwise it might respond with an
6021        /// error.
6022        #[must_use]
6023        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6024            self.inner = self.inner.send_compressed(encoding);
6025            self
6026        }
6027        /// Enable decompressing responses.
6028        #[must_use]
6029        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6030            self.inner = self.inner.accept_compressed(encoding);
6031            self
6032        }
6033        /// Limits the maximum size of a decoded message.
6034        ///
6035        /// Default: `4MB`
6036        #[must_use]
6037        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6038            self.inner = self.inner.max_decoding_message_size(limit);
6039            self
6040        }
6041        /// Limits the maximum size of an encoded message.
6042        ///
6043        /// Default: `usize::MAX`
6044        #[must_use]
6045        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6046            self.inner = self.inner.max_encoding_message_size(limit);
6047            self
6048        }
6049        /** Ingest a batch of touch events from the mobile app.
6050 Authorization: Authenticated mobile user.
6051*/
6052        pub async fn ingest_touch_events(
6053            &mut self,
6054            request: impl tonic::IntoRequest<super::IngestTouchEventsRequest>,
6055        ) -> std::result::Result<
6056            tonic::Response<super::IngestTouchEventsResponse>,
6057            tonic::Status,
6058        > {
6059            self.inner
6060                .ready()
6061                .await
6062                .map_err(|e| {
6063                    tonic::Status::unknown(
6064                        format!("Service was not ready: {}", e.into()),
6065                    )
6066                })?;
6067            let codec = tonic_prost::ProstCodec::default();
6068            let path = http::uri::PathAndQuery::from_static(
6069                "/pidgr.v1.HeatmapService/IngestTouchEvents",
6070            );
6071            let mut req = request.into_request();
6072            req.extensions_mut()
6073                .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "IngestTouchEvents"));
6074            self.inner.unary(req, path, codec).await
6075        }
6076        /** Query aggregated touch data for heatmap rendering.
6077 Authorization: Requires CAMPAIGNS_READ permission.
6078*/
6079        pub async fn query_heatmap_data(
6080            &mut self,
6081            request: impl tonic::IntoRequest<super::QueryHeatmapDataRequest>,
6082        ) -> std::result::Result<
6083            tonic::Response<super::QueryHeatmapDataResponse>,
6084            tonic::Status,
6085        > {
6086            self.inner
6087                .ready()
6088                .await
6089                .map_err(|e| {
6090                    tonic::Status::unknown(
6091                        format!("Service was not ready: {}", e.into()),
6092                    )
6093                })?;
6094            let codec = tonic_prost::ProstCodec::default();
6095            let path = http::uri::PathAndQuery::from_static(
6096                "/pidgr.v1.HeatmapService/QueryHeatmapData",
6097            );
6098            let mut req = request.into_request();
6099            req.extensions_mut()
6100                .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "QueryHeatmapData"));
6101            self.inner.unary(req, path, codec).await
6102        }
6103        /** List available screen screenshots for heatmap backgrounds.
6104 Authorization: Requires CAMPAIGNS_READ permission.
6105*/
6106        pub async fn list_screenshots(
6107            &mut self,
6108            request: impl tonic::IntoRequest<super::ListScreenshotsRequest>,
6109        ) -> std::result::Result<
6110            tonic::Response<super::ListScreenshotsResponse>,
6111            tonic::Status,
6112        > {
6113            self.inner
6114                .ready()
6115                .await
6116                .map_err(|e| {
6117                    tonic::Status::unknown(
6118                        format!("Service was not ready: {}", e.into()),
6119                    )
6120                })?;
6121            let codec = tonic_prost::ProstCodec::default();
6122            let path = http::uri::PathAndQuery::from_static(
6123                "/pidgr.v1.HeatmapService/ListScreenshots",
6124            );
6125            let mut req = request.into_request();
6126            req.extensions_mut()
6127                .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "ListScreenshots"));
6128            self.inner.unary(req, path, codec).await
6129        }
6130        /** Upload a screenshot captured from the mobile app for heatmap backdrops.
6131 Authorization: Authenticated mobile user.
6132*/
6133        pub async fn upload_screenshot(
6134            &mut self,
6135            request: impl tonic::IntoRequest<super::UploadScreenshotRequest>,
6136        ) -> std::result::Result<
6137            tonic::Response<super::UploadScreenshotResponse>,
6138            tonic::Status,
6139        > {
6140            self.inner
6141                .ready()
6142                .await
6143                .map_err(|e| {
6144                    tonic::Status::unknown(
6145                        format!("Service was not ready: {}", e.into()),
6146                    )
6147                })?;
6148            let codec = tonic_prost::ProstCodec::default();
6149            let path = http::uri::PathAndQuery::from_static(
6150                "/pidgr.v1.HeatmapService/UploadScreenshot",
6151            );
6152            let mut req = request.into_request();
6153            req.extensions_mut()
6154                .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "UploadScreenshot"));
6155            self.inner.unary(req, path, codec).await
6156        }
6157    }
6158}
6159/// Generated server implementations.
6160pub mod heatmap_service_server {
6161    #![allow(
6162        unused_variables,
6163        dead_code,
6164        missing_docs,
6165        clippy::wildcard_imports,
6166        clippy::let_unit_value,
6167    )]
6168    use tonic::codegen::*;
6169    /// Generated trait containing gRPC methods that should be implemented for use with HeatmapServiceServer.
6170    #[async_trait]
6171    pub trait HeatmapService: std::marker::Send + std::marker::Sync + 'static {
6172        /** Ingest a batch of touch events from the mobile app.
6173 Authorization: Authenticated mobile user.
6174*/
6175        async fn ingest_touch_events(
6176            &self,
6177            request: tonic::Request<super::IngestTouchEventsRequest>,
6178        ) -> std::result::Result<
6179            tonic::Response<super::IngestTouchEventsResponse>,
6180            tonic::Status,
6181        >;
6182        /** Query aggregated touch data for heatmap rendering.
6183 Authorization: Requires CAMPAIGNS_READ permission.
6184*/
6185        async fn query_heatmap_data(
6186            &self,
6187            request: tonic::Request<super::QueryHeatmapDataRequest>,
6188        ) -> std::result::Result<
6189            tonic::Response<super::QueryHeatmapDataResponse>,
6190            tonic::Status,
6191        >;
6192        /** List available screen screenshots for heatmap backgrounds.
6193 Authorization: Requires CAMPAIGNS_READ permission.
6194*/
6195        async fn list_screenshots(
6196            &self,
6197            request: tonic::Request<super::ListScreenshotsRequest>,
6198        ) -> std::result::Result<
6199            tonic::Response<super::ListScreenshotsResponse>,
6200            tonic::Status,
6201        >;
6202        /** Upload a screenshot captured from the mobile app for heatmap backdrops.
6203 Authorization: Authenticated mobile user.
6204*/
6205        async fn upload_screenshot(
6206            &self,
6207            request: tonic::Request<super::UploadScreenshotRequest>,
6208        ) -> std::result::Result<
6209            tonic::Response<super::UploadScreenshotResponse>,
6210            tonic::Status,
6211        >;
6212    }
6213    /** Manages touch event ingestion, heatmap data aggregation, and screen screenshots
6214 for mobile app interaction analytics.
6215*/
6216    #[derive(Debug)]
6217    pub struct HeatmapServiceServer<T> {
6218        inner: Arc<T>,
6219        accept_compression_encodings: EnabledCompressionEncodings,
6220        send_compression_encodings: EnabledCompressionEncodings,
6221        max_decoding_message_size: Option<usize>,
6222        max_encoding_message_size: Option<usize>,
6223    }
6224    impl<T> HeatmapServiceServer<T> {
6225        pub fn new(inner: T) -> Self {
6226            Self::from_arc(Arc::new(inner))
6227        }
6228        pub fn from_arc(inner: Arc<T>) -> Self {
6229            Self {
6230                inner,
6231                accept_compression_encodings: Default::default(),
6232                send_compression_encodings: Default::default(),
6233                max_decoding_message_size: None,
6234                max_encoding_message_size: None,
6235            }
6236        }
6237        pub fn with_interceptor<F>(
6238            inner: T,
6239            interceptor: F,
6240        ) -> InterceptedService<Self, F>
6241        where
6242            F: tonic::service::Interceptor,
6243        {
6244            InterceptedService::new(Self::new(inner), interceptor)
6245        }
6246        /// Enable decompressing requests with the given encoding.
6247        #[must_use]
6248        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6249            self.accept_compression_encodings.enable(encoding);
6250            self
6251        }
6252        /// Compress responses with the given encoding, if the client supports it.
6253        #[must_use]
6254        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6255            self.send_compression_encodings.enable(encoding);
6256            self
6257        }
6258        /// Limits the maximum size of a decoded message.
6259        ///
6260        /// Default: `4MB`
6261        #[must_use]
6262        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6263            self.max_decoding_message_size = Some(limit);
6264            self
6265        }
6266        /// Limits the maximum size of an encoded message.
6267        ///
6268        /// Default: `usize::MAX`
6269        #[must_use]
6270        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6271            self.max_encoding_message_size = Some(limit);
6272            self
6273        }
6274    }
6275    impl<T, B> tonic::codegen::Service<http::Request<B>> for HeatmapServiceServer<T>
6276    where
6277        T: HeatmapService,
6278        B: Body + std::marker::Send + 'static,
6279        B::Error: Into<StdError> + std::marker::Send + 'static,
6280    {
6281        type Response = http::Response<tonic::body::Body>;
6282        type Error = std::convert::Infallible;
6283        type Future = BoxFuture<Self::Response, Self::Error>;
6284        fn poll_ready(
6285            &mut self,
6286            _cx: &mut Context<'_>,
6287        ) -> Poll<std::result::Result<(), Self::Error>> {
6288            Poll::Ready(Ok(()))
6289        }
6290        fn call(&mut self, req: http::Request<B>) -> Self::Future {
6291            match req.uri().path() {
6292                "/pidgr.v1.HeatmapService/IngestTouchEvents" => {
6293                    #[allow(non_camel_case_types)]
6294                    struct IngestTouchEventsSvc<T: HeatmapService>(pub Arc<T>);
6295                    impl<
6296                        T: HeatmapService,
6297                    > tonic::server::UnaryService<super::IngestTouchEventsRequest>
6298                    for IngestTouchEventsSvc<T> {
6299                        type Response = super::IngestTouchEventsResponse;
6300                        type Future = BoxFuture<
6301                            tonic::Response<Self::Response>,
6302                            tonic::Status,
6303                        >;
6304                        fn call(
6305                            &mut self,
6306                            request: tonic::Request<super::IngestTouchEventsRequest>,
6307                        ) -> Self::Future {
6308                            let inner = Arc::clone(&self.0);
6309                            let fut = async move {
6310                                <T as HeatmapService>::ingest_touch_events(&inner, request)
6311                                    .await
6312                            };
6313                            Box::pin(fut)
6314                        }
6315                    }
6316                    let accept_compression_encodings = self.accept_compression_encodings;
6317                    let send_compression_encodings = self.send_compression_encodings;
6318                    let max_decoding_message_size = self.max_decoding_message_size;
6319                    let max_encoding_message_size = self.max_encoding_message_size;
6320                    let inner = self.inner.clone();
6321                    let fut = async move {
6322                        let method = IngestTouchEventsSvc(inner);
6323                        let codec = tonic_prost::ProstCodec::default();
6324                        let mut grpc = tonic::server::Grpc::new(codec)
6325                            .apply_compression_config(
6326                                accept_compression_encodings,
6327                                send_compression_encodings,
6328                            )
6329                            .apply_max_message_size_config(
6330                                max_decoding_message_size,
6331                                max_encoding_message_size,
6332                            );
6333                        let res = grpc.unary(method, req).await;
6334                        Ok(res)
6335                    };
6336                    Box::pin(fut)
6337                }
6338                "/pidgr.v1.HeatmapService/QueryHeatmapData" => {
6339                    #[allow(non_camel_case_types)]
6340                    struct QueryHeatmapDataSvc<T: HeatmapService>(pub Arc<T>);
6341                    impl<
6342                        T: HeatmapService,
6343                    > tonic::server::UnaryService<super::QueryHeatmapDataRequest>
6344                    for QueryHeatmapDataSvc<T> {
6345                        type Response = super::QueryHeatmapDataResponse;
6346                        type Future = BoxFuture<
6347                            tonic::Response<Self::Response>,
6348                            tonic::Status,
6349                        >;
6350                        fn call(
6351                            &mut self,
6352                            request: tonic::Request<super::QueryHeatmapDataRequest>,
6353                        ) -> Self::Future {
6354                            let inner = Arc::clone(&self.0);
6355                            let fut = async move {
6356                                <T as HeatmapService>::query_heatmap_data(&inner, request)
6357                                    .await
6358                            };
6359                            Box::pin(fut)
6360                        }
6361                    }
6362                    let accept_compression_encodings = self.accept_compression_encodings;
6363                    let send_compression_encodings = self.send_compression_encodings;
6364                    let max_decoding_message_size = self.max_decoding_message_size;
6365                    let max_encoding_message_size = self.max_encoding_message_size;
6366                    let inner = self.inner.clone();
6367                    let fut = async move {
6368                        let method = QueryHeatmapDataSvc(inner);
6369                        let codec = tonic_prost::ProstCodec::default();
6370                        let mut grpc = tonic::server::Grpc::new(codec)
6371                            .apply_compression_config(
6372                                accept_compression_encodings,
6373                                send_compression_encodings,
6374                            )
6375                            .apply_max_message_size_config(
6376                                max_decoding_message_size,
6377                                max_encoding_message_size,
6378                            );
6379                        let res = grpc.unary(method, req).await;
6380                        Ok(res)
6381                    };
6382                    Box::pin(fut)
6383                }
6384                "/pidgr.v1.HeatmapService/ListScreenshots" => {
6385                    #[allow(non_camel_case_types)]
6386                    struct ListScreenshotsSvc<T: HeatmapService>(pub Arc<T>);
6387                    impl<
6388                        T: HeatmapService,
6389                    > tonic::server::UnaryService<super::ListScreenshotsRequest>
6390                    for ListScreenshotsSvc<T> {
6391                        type Response = super::ListScreenshotsResponse;
6392                        type Future = BoxFuture<
6393                            tonic::Response<Self::Response>,
6394                            tonic::Status,
6395                        >;
6396                        fn call(
6397                            &mut self,
6398                            request: tonic::Request<super::ListScreenshotsRequest>,
6399                        ) -> Self::Future {
6400                            let inner = Arc::clone(&self.0);
6401                            let fut = async move {
6402                                <T as HeatmapService>::list_screenshots(&inner, request)
6403                                    .await
6404                            };
6405                            Box::pin(fut)
6406                        }
6407                    }
6408                    let accept_compression_encodings = self.accept_compression_encodings;
6409                    let send_compression_encodings = self.send_compression_encodings;
6410                    let max_decoding_message_size = self.max_decoding_message_size;
6411                    let max_encoding_message_size = self.max_encoding_message_size;
6412                    let inner = self.inner.clone();
6413                    let fut = async move {
6414                        let method = ListScreenshotsSvc(inner);
6415                        let codec = tonic_prost::ProstCodec::default();
6416                        let mut grpc = tonic::server::Grpc::new(codec)
6417                            .apply_compression_config(
6418                                accept_compression_encodings,
6419                                send_compression_encodings,
6420                            )
6421                            .apply_max_message_size_config(
6422                                max_decoding_message_size,
6423                                max_encoding_message_size,
6424                            );
6425                        let res = grpc.unary(method, req).await;
6426                        Ok(res)
6427                    };
6428                    Box::pin(fut)
6429                }
6430                "/pidgr.v1.HeatmapService/UploadScreenshot" => {
6431                    #[allow(non_camel_case_types)]
6432                    struct UploadScreenshotSvc<T: HeatmapService>(pub Arc<T>);
6433                    impl<
6434                        T: HeatmapService,
6435                    > tonic::server::UnaryService<super::UploadScreenshotRequest>
6436                    for UploadScreenshotSvc<T> {
6437                        type Response = super::UploadScreenshotResponse;
6438                        type Future = BoxFuture<
6439                            tonic::Response<Self::Response>,
6440                            tonic::Status,
6441                        >;
6442                        fn call(
6443                            &mut self,
6444                            request: tonic::Request<super::UploadScreenshotRequest>,
6445                        ) -> Self::Future {
6446                            let inner = Arc::clone(&self.0);
6447                            let fut = async move {
6448                                <T as HeatmapService>::upload_screenshot(&inner, request)
6449                                    .await
6450                            };
6451                            Box::pin(fut)
6452                        }
6453                    }
6454                    let accept_compression_encodings = self.accept_compression_encodings;
6455                    let send_compression_encodings = self.send_compression_encodings;
6456                    let max_decoding_message_size = self.max_decoding_message_size;
6457                    let max_encoding_message_size = self.max_encoding_message_size;
6458                    let inner = self.inner.clone();
6459                    let fut = async move {
6460                        let method = UploadScreenshotSvc(inner);
6461                        let codec = tonic_prost::ProstCodec::default();
6462                        let mut grpc = tonic::server::Grpc::new(codec)
6463                            .apply_compression_config(
6464                                accept_compression_encodings,
6465                                send_compression_encodings,
6466                            )
6467                            .apply_max_message_size_config(
6468                                max_decoding_message_size,
6469                                max_encoding_message_size,
6470                            );
6471                        let res = grpc.unary(method, req).await;
6472                        Ok(res)
6473                    };
6474                    Box::pin(fut)
6475                }
6476                _ => {
6477                    Box::pin(async move {
6478                        let mut response = http::Response::new(
6479                            tonic::body::Body::default(),
6480                        );
6481                        let headers = response.headers_mut();
6482                        headers
6483                            .insert(
6484                                tonic::Status::GRPC_STATUS,
6485                                (tonic::Code::Unimplemented as i32).into(),
6486                            );
6487                        headers
6488                            .insert(
6489                                http::header::CONTENT_TYPE,
6490                                tonic::metadata::GRPC_CONTENT_TYPE,
6491                            );
6492                        Ok(response)
6493                    })
6494                }
6495            }
6496        }
6497    }
6498    impl<T> Clone for HeatmapServiceServer<T> {
6499        fn clone(&self) -> Self {
6500            let inner = self.inner.clone();
6501            Self {
6502                inner,
6503                accept_compression_encodings: self.accept_compression_encodings,
6504                send_compression_encodings: self.send_compression_encodings,
6505                max_decoding_message_size: self.max_decoding_message_size,
6506                max_encoding_message_size: self.max_encoding_message_size,
6507            }
6508        }
6509    }
6510    /// Generated gRPC service name
6511    pub const SERVICE_NAME: &str = "pidgr.v1.HeatmapService";
6512    impl<T> tonic::server::NamedService for HeatmapServiceServer<T> {
6513        const NAME: &'static str = SERVICE_NAME;
6514    }
6515}
6516/// Generated client implementations.
6517pub mod inbox_service_client {
6518    #![allow(
6519        unused_variables,
6520        dead_code,
6521        missing_docs,
6522        clippy::wildcard_imports,
6523        clippy::let_unit_value,
6524    )]
6525    use tonic::codegen::*;
6526    use tonic::codegen::http::Uri;
6527    /** Provides the mobile app's inbox experience — syncing messages,
6528 tracking read status, and retrieving individual entries.
6529*/
6530    #[derive(Debug, Clone)]
6531    pub struct InboxServiceClient<T> {
6532        inner: tonic::client::Grpc<T>,
6533    }
6534    impl InboxServiceClient<tonic::transport::Channel> {
6535        /// Attempt to create a new client by connecting to a given endpoint.
6536        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6537        where
6538            D: TryInto<tonic::transport::Endpoint>,
6539            D::Error: Into<StdError>,
6540        {
6541            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6542            Ok(Self::new(conn))
6543        }
6544    }
6545    impl<T> InboxServiceClient<T>
6546    where
6547        T: tonic::client::GrpcService<tonic::body::Body>,
6548        T::Error: Into<StdError>,
6549        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6550        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6551    {
6552        pub fn new(inner: T) -> Self {
6553            let inner = tonic::client::Grpc::new(inner);
6554            Self { inner }
6555        }
6556        pub fn with_origin(inner: T, origin: Uri) -> Self {
6557            let inner = tonic::client::Grpc::with_origin(inner, origin);
6558            Self { inner }
6559        }
6560        pub fn with_interceptor<F>(
6561            inner: T,
6562            interceptor: F,
6563        ) -> InboxServiceClient<InterceptedService<T, F>>
6564        where
6565            F: tonic::service::Interceptor,
6566            T::ResponseBody: Default,
6567            T: tonic::codegen::Service<
6568                http::Request<tonic::body::Body>,
6569                Response = http::Response<
6570                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6571                >,
6572            >,
6573            <T as tonic::codegen::Service<
6574                http::Request<tonic::body::Body>,
6575            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6576        {
6577            InboxServiceClient::new(InterceptedService::new(inner, interceptor))
6578        }
6579        /// Compress requests with the given encoding.
6580        ///
6581        /// This requires the server to support it otherwise it might respond with an
6582        /// error.
6583        #[must_use]
6584        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6585            self.inner = self.inner.send_compressed(encoding);
6586            self
6587        }
6588        /// Enable decompressing responses.
6589        #[must_use]
6590        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6591            self.inner = self.inner.accept_compressed(encoding);
6592            self
6593        }
6594        /// Limits the maximum size of a decoded message.
6595        ///
6596        /// Default: `4MB`
6597        #[must_use]
6598        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6599            self.inner = self.inner.max_decoding_message_size(limit);
6600            self
6601        }
6602        /// Limits the maximum size of an encoded message.
6603        ///
6604        /// Default: `usize::MAX`
6605        #[must_use]
6606        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6607            self.inner = self.inner.max_encoding_message_size(limit);
6608            self
6609        }
6610        /** Sync inbox entries since a given timestamp for incremental updates.
6611 Authorization: Authenticated user (own inbox only).
6612*/
6613        pub async fn sync(
6614            &mut self,
6615            request: impl tonic::IntoRequest<super::SyncRequest>,
6616        ) -> std::result::Result<tonic::Response<super::SyncResponse>, tonic::Status> {
6617            self.inner
6618                .ready()
6619                .await
6620                .map_err(|e| {
6621                    tonic::Status::unknown(
6622                        format!("Service was not ready: {}", e.into()),
6623                    )
6624                })?;
6625            let codec = tonic_prost::ProstCodec::default();
6626            let path = http::uri::PathAndQuery::from_static(
6627                "/pidgr.v1.InboxService/Sync",
6628            );
6629            let mut req = request.into_request();
6630            req.extensions_mut()
6631                .insert(GrpcMethod::new("pidgr.v1.InboxService", "Sync"));
6632            self.inner.unary(req, path, codec).await
6633        }
6634        /** Mark a delivered message as read (analytics-only, does not affect workflow).
6635 Authorization: Authenticated user (own inbox only).
6636*/
6637        pub async fn mark_read(
6638            &mut self,
6639            request: impl tonic::IntoRequest<super::MarkReadRequest>,
6640        ) -> std::result::Result<
6641            tonic::Response<super::MarkReadResponse>,
6642            tonic::Status,
6643        > {
6644            self.inner
6645                .ready()
6646                .await
6647                .map_err(|e| {
6648                    tonic::Status::unknown(
6649                        format!("Service was not ready: {}", e.into()),
6650                    )
6651                })?;
6652            let codec = tonic_prost::ProstCodec::default();
6653            let path = http::uri::PathAndQuery::from_static(
6654                "/pidgr.v1.InboxService/MarkRead",
6655            );
6656            let mut req = request.into_request();
6657            req.extensions_mut()
6658                .insert(GrpcMethod::new("pidgr.v1.InboxService", "MarkRead"));
6659            self.inner.unary(req, path, codec).await
6660        }
6661        /** Retrieve a single inbox entry by delivery ID.
6662 Authorization: Authenticated user (own inbox only).
6663*/
6664        pub async fn get_message(
6665            &mut self,
6666            request: impl tonic::IntoRequest<super::GetMessageRequest>,
6667        ) -> std::result::Result<
6668            tonic::Response<super::GetMessageResponse>,
6669            tonic::Status,
6670        > {
6671            self.inner
6672                .ready()
6673                .await
6674                .map_err(|e| {
6675                    tonic::Status::unknown(
6676                        format!("Service was not ready: {}", e.into()),
6677                    )
6678                })?;
6679            let codec = tonic_prost::ProstCodec::default();
6680            let path = http::uri::PathAndQuery::from_static(
6681                "/pidgr.v1.InboxService/GetMessage",
6682            );
6683            let mut req = request.into_request();
6684            req.extensions_mut()
6685                .insert(GrpcMethod::new("pidgr.v1.InboxService", "GetMessage"));
6686            self.inner.unary(req, path, codec).await
6687        }
6688    }
6689}
6690/// Generated server implementations.
6691pub mod inbox_service_server {
6692    #![allow(
6693        unused_variables,
6694        dead_code,
6695        missing_docs,
6696        clippy::wildcard_imports,
6697        clippy::let_unit_value,
6698    )]
6699    use tonic::codegen::*;
6700    /// Generated trait containing gRPC methods that should be implemented for use with InboxServiceServer.
6701    #[async_trait]
6702    pub trait InboxService: std::marker::Send + std::marker::Sync + 'static {
6703        /** Sync inbox entries since a given timestamp for incremental updates.
6704 Authorization: Authenticated user (own inbox only).
6705*/
6706        async fn sync(
6707            &self,
6708            request: tonic::Request<super::SyncRequest>,
6709        ) -> std::result::Result<tonic::Response<super::SyncResponse>, tonic::Status>;
6710        /** Mark a delivered message as read (analytics-only, does not affect workflow).
6711 Authorization: Authenticated user (own inbox only).
6712*/
6713        async fn mark_read(
6714            &self,
6715            request: tonic::Request<super::MarkReadRequest>,
6716        ) -> std::result::Result<
6717            tonic::Response<super::MarkReadResponse>,
6718            tonic::Status,
6719        >;
6720        /** Retrieve a single inbox entry by delivery ID.
6721 Authorization: Authenticated user (own inbox only).
6722*/
6723        async fn get_message(
6724            &self,
6725            request: tonic::Request<super::GetMessageRequest>,
6726        ) -> std::result::Result<
6727            tonic::Response<super::GetMessageResponse>,
6728            tonic::Status,
6729        >;
6730    }
6731    /** Provides the mobile app's inbox experience — syncing messages,
6732 tracking read status, and retrieving individual entries.
6733*/
6734    #[derive(Debug)]
6735    pub struct InboxServiceServer<T> {
6736        inner: Arc<T>,
6737        accept_compression_encodings: EnabledCompressionEncodings,
6738        send_compression_encodings: EnabledCompressionEncodings,
6739        max_decoding_message_size: Option<usize>,
6740        max_encoding_message_size: Option<usize>,
6741    }
6742    impl<T> InboxServiceServer<T> {
6743        pub fn new(inner: T) -> Self {
6744            Self::from_arc(Arc::new(inner))
6745        }
6746        pub fn from_arc(inner: Arc<T>) -> Self {
6747            Self {
6748                inner,
6749                accept_compression_encodings: Default::default(),
6750                send_compression_encodings: Default::default(),
6751                max_decoding_message_size: None,
6752                max_encoding_message_size: None,
6753            }
6754        }
6755        pub fn with_interceptor<F>(
6756            inner: T,
6757            interceptor: F,
6758        ) -> InterceptedService<Self, F>
6759        where
6760            F: tonic::service::Interceptor,
6761        {
6762            InterceptedService::new(Self::new(inner), interceptor)
6763        }
6764        /// Enable decompressing requests with the given encoding.
6765        #[must_use]
6766        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6767            self.accept_compression_encodings.enable(encoding);
6768            self
6769        }
6770        /// Compress responses with the given encoding, if the client supports it.
6771        #[must_use]
6772        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6773            self.send_compression_encodings.enable(encoding);
6774            self
6775        }
6776        /// Limits the maximum size of a decoded message.
6777        ///
6778        /// Default: `4MB`
6779        #[must_use]
6780        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6781            self.max_decoding_message_size = Some(limit);
6782            self
6783        }
6784        /// Limits the maximum size of an encoded message.
6785        ///
6786        /// Default: `usize::MAX`
6787        #[must_use]
6788        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6789            self.max_encoding_message_size = Some(limit);
6790            self
6791        }
6792    }
6793    impl<T, B> tonic::codegen::Service<http::Request<B>> for InboxServiceServer<T>
6794    where
6795        T: InboxService,
6796        B: Body + std::marker::Send + 'static,
6797        B::Error: Into<StdError> + std::marker::Send + 'static,
6798    {
6799        type Response = http::Response<tonic::body::Body>;
6800        type Error = std::convert::Infallible;
6801        type Future = BoxFuture<Self::Response, Self::Error>;
6802        fn poll_ready(
6803            &mut self,
6804            _cx: &mut Context<'_>,
6805        ) -> Poll<std::result::Result<(), Self::Error>> {
6806            Poll::Ready(Ok(()))
6807        }
6808        fn call(&mut self, req: http::Request<B>) -> Self::Future {
6809            match req.uri().path() {
6810                "/pidgr.v1.InboxService/Sync" => {
6811                    #[allow(non_camel_case_types)]
6812                    struct SyncSvc<T: InboxService>(pub Arc<T>);
6813                    impl<T: InboxService> tonic::server::UnaryService<super::SyncRequest>
6814                    for SyncSvc<T> {
6815                        type Response = super::SyncResponse;
6816                        type Future = BoxFuture<
6817                            tonic::Response<Self::Response>,
6818                            tonic::Status,
6819                        >;
6820                        fn call(
6821                            &mut self,
6822                            request: tonic::Request<super::SyncRequest>,
6823                        ) -> Self::Future {
6824                            let inner = Arc::clone(&self.0);
6825                            let fut = async move {
6826                                <T as InboxService>::sync(&inner, request).await
6827                            };
6828                            Box::pin(fut)
6829                        }
6830                    }
6831                    let accept_compression_encodings = self.accept_compression_encodings;
6832                    let send_compression_encodings = self.send_compression_encodings;
6833                    let max_decoding_message_size = self.max_decoding_message_size;
6834                    let max_encoding_message_size = self.max_encoding_message_size;
6835                    let inner = self.inner.clone();
6836                    let fut = async move {
6837                        let method = SyncSvc(inner);
6838                        let codec = tonic_prost::ProstCodec::default();
6839                        let mut grpc = tonic::server::Grpc::new(codec)
6840                            .apply_compression_config(
6841                                accept_compression_encodings,
6842                                send_compression_encodings,
6843                            )
6844                            .apply_max_message_size_config(
6845                                max_decoding_message_size,
6846                                max_encoding_message_size,
6847                            );
6848                        let res = grpc.unary(method, req).await;
6849                        Ok(res)
6850                    };
6851                    Box::pin(fut)
6852                }
6853                "/pidgr.v1.InboxService/MarkRead" => {
6854                    #[allow(non_camel_case_types)]
6855                    struct MarkReadSvc<T: InboxService>(pub Arc<T>);
6856                    impl<
6857                        T: InboxService,
6858                    > tonic::server::UnaryService<super::MarkReadRequest>
6859                    for MarkReadSvc<T> {
6860                        type Response = super::MarkReadResponse;
6861                        type Future = BoxFuture<
6862                            tonic::Response<Self::Response>,
6863                            tonic::Status,
6864                        >;
6865                        fn call(
6866                            &mut self,
6867                            request: tonic::Request<super::MarkReadRequest>,
6868                        ) -> Self::Future {
6869                            let inner = Arc::clone(&self.0);
6870                            let fut = async move {
6871                                <T as InboxService>::mark_read(&inner, request).await
6872                            };
6873                            Box::pin(fut)
6874                        }
6875                    }
6876                    let accept_compression_encodings = self.accept_compression_encodings;
6877                    let send_compression_encodings = self.send_compression_encodings;
6878                    let max_decoding_message_size = self.max_decoding_message_size;
6879                    let max_encoding_message_size = self.max_encoding_message_size;
6880                    let inner = self.inner.clone();
6881                    let fut = async move {
6882                        let method = MarkReadSvc(inner);
6883                        let codec = tonic_prost::ProstCodec::default();
6884                        let mut grpc = tonic::server::Grpc::new(codec)
6885                            .apply_compression_config(
6886                                accept_compression_encodings,
6887                                send_compression_encodings,
6888                            )
6889                            .apply_max_message_size_config(
6890                                max_decoding_message_size,
6891                                max_encoding_message_size,
6892                            );
6893                        let res = grpc.unary(method, req).await;
6894                        Ok(res)
6895                    };
6896                    Box::pin(fut)
6897                }
6898                "/pidgr.v1.InboxService/GetMessage" => {
6899                    #[allow(non_camel_case_types)]
6900                    struct GetMessageSvc<T: InboxService>(pub Arc<T>);
6901                    impl<
6902                        T: InboxService,
6903                    > tonic::server::UnaryService<super::GetMessageRequest>
6904                    for GetMessageSvc<T> {
6905                        type Response = super::GetMessageResponse;
6906                        type Future = BoxFuture<
6907                            tonic::Response<Self::Response>,
6908                            tonic::Status,
6909                        >;
6910                        fn call(
6911                            &mut self,
6912                            request: tonic::Request<super::GetMessageRequest>,
6913                        ) -> Self::Future {
6914                            let inner = Arc::clone(&self.0);
6915                            let fut = async move {
6916                                <T as InboxService>::get_message(&inner, request).await
6917                            };
6918                            Box::pin(fut)
6919                        }
6920                    }
6921                    let accept_compression_encodings = self.accept_compression_encodings;
6922                    let send_compression_encodings = self.send_compression_encodings;
6923                    let max_decoding_message_size = self.max_decoding_message_size;
6924                    let max_encoding_message_size = self.max_encoding_message_size;
6925                    let inner = self.inner.clone();
6926                    let fut = async move {
6927                        let method = GetMessageSvc(inner);
6928                        let codec = tonic_prost::ProstCodec::default();
6929                        let mut grpc = tonic::server::Grpc::new(codec)
6930                            .apply_compression_config(
6931                                accept_compression_encodings,
6932                                send_compression_encodings,
6933                            )
6934                            .apply_max_message_size_config(
6935                                max_decoding_message_size,
6936                                max_encoding_message_size,
6937                            );
6938                        let res = grpc.unary(method, req).await;
6939                        Ok(res)
6940                    };
6941                    Box::pin(fut)
6942                }
6943                _ => {
6944                    Box::pin(async move {
6945                        let mut response = http::Response::new(
6946                            tonic::body::Body::default(),
6947                        );
6948                        let headers = response.headers_mut();
6949                        headers
6950                            .insert(
6951                                tonic::Status::GRPC_STATUS,
6952                                (tonic::Code::Unimplemented as i32).into(),
6953                            );
6954                        headers
6955                            .insert(
6956                                http::header::CONTENT_TYPE,
6957                                tonic::metadata::GRPC_CONTENT_TYPE,
6958                            );
6959                        Ok(response)
6960                    })
6961                }
6962            }
6963        }
6964    }
6965    impl<T> Clone for InboxServiceServer<T> {
6966        fn clone(&self) -> Self {
6967            let inner = self.inner.clone();
6968            Self {
6969                inner,
6970                accept_compression_encodings: self.accept_compression_encodings,
6971                send_compression_encodings: self.send_compression_encodings,
6972                max_decoding_message_size: self.max_decoding_message_size,
6973                max_encoding_message_size: self.max_encoding_message_size,
6974            }
6975        }
6976    }
6977    /// Generated gRPC service name
6978    pub const SERVICE_NAME: &str = "pidgr.v1.InboxService";
6979    impl<T> tonic::server::NamedService for InboxServiceServer<T> {
6980        const NAME: &'static str = SERVICE_NAME;
6981    }
6982}
6983/// Generated client implementations.
6984pub mod insights_service_client {
6985    #![allow(
6986        unused_variables,
6987        dead_code,
6988        missing_docs,
6989        clippy::wildcard_imports,
6990        clippy::let_unit_value,
6991    )]
6992    use tonic::codegen::*;
6993    use tonic::codegen::http::Uri;
6994    /** Provides cohort-level AI insights for campaign planning and optimization.
6995 All predictions are aggregate — no individual-level profiling.
6996 Data is derived from k-anonymized, differential-privacy-noised behavioral features.
6997 All RPCs operate within the caller's org (extracted from JWT).
6998*/
6999    #[derive(Debug, Clone)]
7000    pub struct InsightsServiceClient<T> {
7001        inner: tonic::client::Grpc<T>,
7002    }
7003    impl InsightsServiceClient<tonic::transport::Channel> {
7004        /// Attempt to create a new client by connecting to a given endpoint.
7005        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
7006        where
7007            D: TryInto<tonic::transport::Endpoint>,
7008            D::Error: Into<StdError>,
7009        {
7010            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
7011            Ok(Self::new(conn))
7012        }
7013    }
7014    impl<T> InsightsServiceClient<T>
7015    where
7016        T: tonic::client::GrpcService<tonic::body::Body>,
7017        T::Error: Into<StdError>,
7018        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
7019        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
7020    {
7021        pub fn new(inner: T) -> Self {
7022            let inner = tonic::client::Grpc::new(inner);
7023            Self { inner }
7024        }
7025        pub fn with_origin(inner: T, origin: Uri) -> Self {
7026            let inner = tonic::client::Grpc::with_origin(inner, origin);
7027            Self { inner }
7028        }
7029        pub fn with_interceptor<F>(
7030            inner: T,
7031            interceptor: F,
7032        ) -> InsightsServiceClient<InterceptedService<T, F>>
7033        where
7034            F: tonic::service::Interceptor,
7035            T::ResponseBody: Default,
7036            T: tonic::codegen::Service<
7037                http::Request<tonic::body::Body>,
7038                Response = http::Response<
7039                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
7040                >,
7041            >,
7042            <T as tonic::codegen::Service<
7043                http::Request<tonic::body::Body>,
7044            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
7045        {
7046            InsightsServiceClient::new(InterceptedService::new(inner, interceptor))
7047        }
7048        /// Compress requests with the given encoding.
7049        ///
7050        /// This requires the server to support it otherwise it might respond with an
7051        /// error.
7052        #[must_use]
7053        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7054            self.inner = self.inner.send_compressed(encoding);
7055            self
7056        }
7057        /// Enable decompressing responses.
7058        #[must_use]
7059        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7060            self.inner = self.inner.accept_compressed(encoding);
7061            self
7062        }
7063        /// Limits the maximum size of a decoded message.
7064        ///
7065        /// Default: `4MB`
7066        #[must_use]
7067        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7068            self.inner = self.inner.max_decoding_message_size(limit);
7069            self
7070        }
7071        /// Limits the maximum size of an encoded message.
7072        ///
7073        /// Default: `usize::MAX`
7074        #[must_use]
7075        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7076            self.inner = self.inner.max_encoding_message_size(limit);
7077            self
7078        }
7079        /** Retrieve behavioral archetypes for a group based on anonymous feature vectors.
7080 Returns empty archetypes if insufficient data (cold start).
7081 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7082*/
7083        pub async fn get_group_archetypes(
7084            &mut self,
7085            request: impl tonic::IntoRequest<super::GetGroupArchetypesRequest>,
7086        ) -> std::result::Result<
7087            tonic::Response<super::GetGroupArchetypesResponse>,
7088            tonic::Status,
7089        > {
7090            self.inner
7091                .ready()
7092                .await
7093                .map_err(|e| {
7094                    tonic::Status::unknown(
7095                        format!("Service was not ready: {}", e.into()),
7096                    )
7097                })?;
7098            let codec = tonic_prost::ProstCodec::default();
7099            let path = http::uri::PathAndQuery::from_static(
7100                "/pidgr.v1.InsightsService/GetGroupArchetypes",
7101            );
7102            let mut req = request.into_request();
7103            req.extensions_mut()
7104                .insert(
7105                    GrpcMethod::new("pidgr.v1.InsightsService", "GetGroupArchetypes"),
7106                );
7107            self.inner.unary(req, path, codec).await
7108        }
7109        /** Predict cohort-level ACK rate for a campaign targeting a specific group.
7110 Returns a confidence interval that narrows as more campaign data accumulates.
7111 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7112*/
7113        pub async fn predict_campaign_ack(
7114            &mut self,
7115            request: impl tonic::IntoRequest<super::PredictCampaignAckRequest>,
7116        ) -> std::result::Result<
7117            tonic::Response<super::PredictCampaignAckResponse>,
7118            tonic::Status,
7119        > {
7120            self.inner
7121                .ready()
7122                .await
7123                .map_err(|e| {
7124                    tonic::Status::unknown(
7125                        format!("Service was not ready: {}", e.into()),
7126                    )
7127                })?;
7128            let codec = tonic_prost::ProstCodec::default();
7129            let path = http::uri::PathAndQuery::from_static(
7130                "/pidgr.v1.InsightsService/PredictCampaignACK",
7131            );
7132            let mut req = request.into_request();
7133            req.extensions_mut()
7134                .insert(
7135                    GrpcMethod::new("pidgr.v1.InsightsService", "PredictCampaignACK"),
7136                );
7137            self.inner.unary(req, path, codec).await
7138        }
7139        /** Get campaign configuration advisory (prediction + suggested escalation + archetypes).
7140 Advisory is informational only — never drives automated decisions.
7141 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7142*/
7143        pub async fn get_campaign_advisory(
7144            &mut self,
7145            request: impl tonic::IntoRequest<super::GetCampaignAdvisoryRequest>,
7146        ) -> std::result::Result<
7147            tonic::Response<super::GetCampaignAdvisoryResponse>,
7148            tonic::Status,
7149        > {
7150            self.inner
7151                .ready()
7152                .await
7153                .map_err(|e| {
7154                    tonic::Status::unknown(
7155                        format!("Service was not ready: {}", e.into()),
7156                    )
7157                })?;
7158            let codec = tonic_prost::ProstCodec::default();
7159            let path = http::uri::PathAndQuery::from_static(
7160                "/pidgr.v1.InsightsService/GetCampaignAdvisory",
7161            );
7162            let mut req = request.into_request();
7163            req.extensions_mut()
7164                .insert(
7165                    GrpcMethod::new("pidgr.v1.InsightsService", "GetCampaignAdvisory"),
7166                );
7167            self.inner.unary(req, path, codec).await
7168        }
7169        /** Generate an AI-powered narrative summary of a group's insights.
7170 Combines archetype, prediction, and campaign data into human-readable analysis.
7171 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7172*/
7173        pub async fn get_insight_narrative(
7174            &mut self,
7175            request: impl tonic::IntoRequest<super::GetInsightNarrativeRequest>,
7176        ) -> std::result::Result<
7177            tonic::Response<super::GetInsightNarrativeResponse>,
7178            tonic::Status,
7179        > {
7180            self.inner
7181                .ready()
7182                .await
7183                .map_err(|e| {
7184                    tonic::Status::unknown(
7185                        format!("Service was not ready: {}", e.into()),
7186                    )
7187                })?;
7188            let codec = tonic_prost::ProstCodec::default();
7189            let path = http::uri::PathAndQuery::from_static(
7190                "/pidgr.v1.InsightsService/GetInsightNarrative",
7191            );
7192            let mut req = request.into_request();
7193            req.extensions_mut()
7194                .insert(
7195                    GrpcMethod::new("pidgr.v1.InsightsService", "GetInsightNarrative"),
7196                );
7197            self.inner.unary(req, path, codec).await
7198        }
7199        /** Manually trigger the ML training pipeline for the caller's organization.
7200 Rate-limited by ml_manual_limit_monthly (default 3 per month, auto-resets).
7201 Authorization: Requires PERMISSION_ORGANIZATION_WRITE.
7202*/
7203        pub async fn trigger_ml_pipeline(
7204            &mut self,
7205            request: impl tonic::IntoRequest<super::TriggerMlPipelineRequest>,
7206        ) -> std::result::Result<
7207            tonic::Response<super::TriggerMlPipelineResponse>,
7208            tonic::Status,
7209        > {
7210            self.inner
7211                .ready()
7212                .await
7213                .map_err(|e| {
7214                    tonic::Status::unknown(
7215                        format!("Service was not ready: {}", e.into()),
7216                    )
7217                })?;
7218            let codec = tonic_prost::ProstCodec::default();
7219            let path = http::uri::PathAndQuery::from_static(
7220                "/pidgr.v1.InsightsService/TriggerMLPipeline",
7221            );
7222            let mut req = request.into_request();
7223            req.extensions_mut()
7224                .insert(
7225                    GrpcMethod::new("pidgr.v1.InsightsService", "TriggerMLPipeline"),
7226                );
7227            self.inner.unary(req, path, codec).await
7228        }
7229        /** Manually retrigger archetype clustering for a single group, reusing
7230 the already-deployed SageMaker clustering model. Cheaper than a
7231 full TriggerMLPipeline run because no training happens. Shares the
7232 same ml_manual_limit_monthly quota as TriggerMLPipeline — callers
7233 get N manual retrains per month across both RPCs.
7234 Authorization: Requires PERMISSION_ORGANIZATION_WRITE.
7235*/
7236        pub async fn trigger_archetype_clustering(
7237            &mut self,
7238            request: impl tonic::IntoRequest<super::TriggerArchetypeClusteringRequest>,
7239        ) -> std::result::Result<
7240            tonic::Response<super::TriggerArchetypeClusteringResponse>,
7241            tonic::Status,
7242        > {
7243            self.inner
7244                .ready()
7245                .await
7246                .map_err(|e| {
7247                    tonic::Status::unknown(
7248                        format!("Service was not ready: {}", e.into()),
7249                    )
7250                })?;
7251            let codec = tonic_prost::ProstCodec::default();
7252            let path = http::uri::PathAndQuery::from_static(
7253                "/pidgr.v1.InsightsService/TriggerArchetypeClustering",
7254            );
7255            let mut req = request.into_request();
7256            req.extensions_mut()
7257                .insert(
7258                    GrpcMethod::new(
7259                        "pidgr.v1.InsightsService",
7260                        "TriggerArchetypeClustering",
7261                    ),
7262                );
7263            self.inner.unary(req, path, codec).await
7264        }
7265        /** Draft a campaign body for the given archetype using Bedrock with the
7266 campaign-for-archetype prompt template. Used by the Compass
7267 "Target this archetype" CTA to pre-fill the wizard's body field.
7268 Cross-org group_id returns PERMISSION_DENIED, unknown archetype_label
7269 returns NOT_FOUND.
7270 Authorization: Requires PERMISSION_CAMPAIGNS_WRITE.
7271*/
7272        pub async fn generate_campaign_body_draft(
7273            &mut self,
7274            request: impl tonic::IntoRequest<super::GenerateCampaignBodyDraftRequest>,
7275        ) -> std::result::Result<
7276            tonic::Response<super::GenerateCampaignBodyDraftResponse>,
7277            tonic::Status,
7278        > {
7279            self.inner
7280                .ready()
7281                .await
7282                .map_err(|e| {
7283                    tonic::Status::unknown(
7284                        format!("Service was not ready: {}", e.into()),
7285                    )
7286                })?;
7287            let codec = tonic_prost::ProstCodec::default();
7288            let path = http::uri::PathAndQuery::from_static(
7289                "/pidgr.v1.InsightsService/GenerateCampaignBodyDraft",
7290            );
7291            let mut req = request.into_request();
7292            req.extensions_mut()
7293                .insert(
7294                    GrpcMethod::new(
7295                        "pidgr.v1.InsightsService",
7296                        "GenerateCampaignBodyDraft",
7297                    ),
7298                );
7299            self.inner.unary(req, path, codec).await
7300        }
7301    }
7302}
7303/// Generated server implementations.
7304pub mod insights_service_server {
7305    #![allow(
7306        unused_variables,
7307        dead_code,
7308        missing_docs,
7309        clippy::wildcard_imports,
7310        clippy::let_unit_value,
7311    )]
7312    use tonic::codegen::*;
7313    /// Generated trait containing gRPC methods that should be implemented for use with InsightsServiceServer.
7314    #[async_trait]
7315    pub trait InsightsService: std::marker::Send + std::marker::Sync + 'static {
7316        /** Retrieve behavioral archetypes for a group based on anonymous feature vectors.
7317 Returns empty archetypes if insufficient data (cold start).
7318 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7319*/
7320        async fn get_group_archetypes(
7321            &self,
7322            request: tonic::Request<super::GetGroupArchetypesRequest>,
7323        ) -> std::result::Result<
7324            tonic::Response<super::GetGroupArchetypesResponse>,
7325            tonic::Status,
7326        >;
7327        /** Predict cohort-level ACK rate for a campaign targeting a specific group.
7328 Returns a confidence interval that narrows as more campaign data accumulates.
7329 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7330*/
7331        async fn predict_campaign_ack(
7332            &self,
7333            request: tonic::Request<super::PredictCampaignAckRequest>,
7334        ) -> std::result::Result<
7335            tonic::Response<super::PredictCampaignAckResponse>,
7336            tonic::Status,
7337        >;
7338        /** Get campaign configuration advisory (prediction + suggested escalation + archetypes).
7339 Advisory is informational only — never drives automated decisions.
7340 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7341*/
7342        async fn get_campaign_advisory(
7343            &self,
7344            request: tonic::Request<super::GetCampaignAdvisoryRequest>,
7345        ) -> std::result::Result<
7346            tonic::Response<super::GetCampaignAdvisoryResponse>,
7347            tonic::Status,
7348        >;
7349        /** Generate an AI-powered narrative summary of a group's insights.
7350 Combines archetype, prediction, and campaign data into human-readable analysis.
7351 Authorization: Requires PERMISSION_CAMPAIGNS_READ.
7352*/
7353        async fn get_insight_narrative(
7354            &self,
7355            request: tonic::Request<super::GetInsightNarrativeRequest>,
7356        ) -> std::result::Result<
7357            tonic::Response<super::GetInsightNarrativeResponse>,
7358            tonic::Status,
7359        >;
7360        /** Manually trigger the ML training pipeline for the caller's organization.
7361 Rate-limited by ml_manual_limit_monthly (default 3 per month, auto-resets).
7362 Authorization: Requires PERMISSION_ORGANIZATION_WRITE.
7363*/
7364        async fn trigger_ml_pipeline(
7365            &self,
7366            request: tonic::Request<super::TriggerMlPipelineRequest>,
7367        ) -> std::result::Result<
7368            tonic::Response<super::TriggerMlPipelineResponse>,
7369            tonic::Status,
7370        >;
7371        /** Manually retrigger archetype clustering for a single group, reusing
7372 the already-deployed SageMaker clustering model. Cheaper than a
7373 full TriggerMLPipeline run because no training happens. Shares the
7374 same ml_manual_limit_monthly quota as TriggerMLPipeline — callers
7375 get N manual retrains per month across both RPCs.
7376 Authorization: Requires PERMISSION_ORGANIZATION_WRITE.
7377*/
7378        async fn trigger_archetype_clustering(
7379            &self,
7380            request: tonic::Request<super::TriggerArchetypeClusteringRequest>,
7381        ) -> std::result::Result<
7382            tonic::Response<super::TriggerArchetypeClusteringResponse>,
7383            tonic::Status,
7384        >;
7385        /** Draft a campaign body for the given archetype using Bedrock with the
7386 campaign-for-archetype prompt template. Used by the Compass
7387 "Target this archetype" CTA to pre-fill the wizard's body field.
7388 Cross-org group_id returns PERMISSION_DENIED, unknown archetype_label
7389 returns NOT_FOUND.
7390 Authorization: Requires PERMISSION_CAMPAIGNS_WRITE.
7391*/
7392        async fn generate_campaign_body_draft(
7393            &self,
7394            request: tonic::Request<super::GenerateCampaignBodyDraftRequest>,
7395        ) -> std::result::Result<
7396            tonic::Response<super::GenerateCampaignBodyDraftResponse>,
7397            tonic::Status,
7398        >;
7399    }
7400    /** Provides cohort-level AI insights for campaign planning and optimization.
7401 All predictions are aggregate — no individual-level profiling.
7402 Data is derived from k-anonymized, differential-privacy-noised behavioral features.
7403 All RPCs operate within the caller's org (extracted from JWT).
7404*/
7405    #[derive(Debug)]
7406    pub struct InsightsServiceServer<T> {
7407        inner: Arc<T>,
7408        accept_compression_encodings: EnabledCompressionEncodings,
7409        send_compression_encodings: EnabledCompressionEncodings,
7410        max_decoding_message_size: Option<usize>,
7411        max_encoding_message_size: Option<usize>,
7412    }
7413    impl<T> InsightsServiceServer<T> {
7414        pub fn new(inner: T) -> Self {
7415            Self::from_arc(Arc::new(inner))
7416        }
7417        pub fn from_arc(inner: Arc<T>) -> Self {
7418            Self {
7419                inner,
7420                accept_compression_encodings: Default::default(),
7421                send_compression_encodings: Default::default(),
7422                max_decoding_message_size: None,
7423                max_encoding_message_size: None,
7424            }
7425        }
7426        pub fn with_interceptor<F>(
7427            inner: T,
7428            interceptor: F,
7429        ) -> InterceptedService<Self, F>
7430        where
7431            F: tonic::service::Interceptor,
7432        {
7433            InterceptedService::new(Self::new(inner), interceptor)
7434        }
7435        /// Enable decompressing requests with the given encoding.
7436        #[must_use]
7437        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7438            self.accept_compression_encodings.enable(encoding);
7439            self
7440        }
7441        /// Compress responses with the given encoding, if the client supports it.
7442        #[must_use]
7443        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7444            self.send_compression_encodings.enable(encoding);
7445            self
7446        }
7447        /// Limits the maximum size of a decoded message.
7448        ///
7449        /// Default: `4MB`
7450        #[must_use]
7451        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7452            self.max_decoding_message_size = Some(limit);
7453            self
7454        }
7455        /// Limits the maximum size of an encoded message.
7456        ///
7457        /// Default: `usize::MAX`
7458        #[must_use]
7459        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7460            self.max_encoding_message_size = Some(limit);
7461            self
7462        }
7463    }
7464    impl<T, B> tonic::codegen::Service<http::Request<B>> for InsightsServiceServer<T>
7465    where
7466        T: InsightsService,
7467        B: Body + std::marker::Send + 'static,
7468        B::Error: Into<StdError> + std::marker::Send + 'static,
7469    {
7470        type Response = http::Response<tonic::body::Body>;
7471        type Error = std::convert::Infallible;
7472        type Future = BoxFuture<Self::Response, Self::Error>;
7473        fn poll_ready(
7474            &mut self,
7475            _cx: &mut Context<'_>,
7476        ) -> Poll<std::result::Result<(), Self::Error>> {
7477            Poll::Ready(Ok(()))
7478        }
7479        fn call(&mut self, req: http::Request<B>) -> Self::Future {
7480            match req.uri().path() {
7481                "/pidgr.v1.InsightsService/GetGroupArchetypes" => {
7482                    #[allow(non_camel_case_types)]
7483                    struct GetGroupArchetypesSvc<T: InsightsService>(pub Arc<T>);
7484                    impl<
7485                        T: InsightsService,
7486                    > tonic::server::UnaryService<super::GetGroupArchetypesRequest>
7487                    for GetGroupArchetypesSvc<T> {
7488                        type Response = super::GetGroupArchetypesResponse;
7489                        type Future = BoxFuture<
7490                            tonic::Response<Self::Response>,
7491                            tonic::Status,
7492                        >;
7493                        fn call(
7494                            &mut self,
7495                            request: tonic::Request<super::GetGroupArchetypesRequest>,
7496                        ) -> Self::Future {
7497                            let inner = Arc::clone(&self.0);
7498                            let fut = async move {
7499                                <T as InsightsService>::get_group_archetypes(
7500                                        &inner,
7501                                        request,
7502                                    )
7503                                    .await
7504                            };
7505                            Box::pin(fut)
7506                        }
7507                    }
7508                    let accept_compression_encodings = self.accept_compression_encodings;
7509                    let send_compression_encodings = self.send_compression_encodings;
7510                    let max_decoding_message_size = self.max_decoding_message_size;
7511                    let max_encoding_message_size = self.max_encoding_message_size;
7512                    let inner = self.inner.clone();
7513                    let fut = async move {
7514                        let method = GetGroupArchetypesSvc(inner);
7515                        let codec = tonic_prost::ProstCodec::default();
7516                        let mut grpc = tonic::server::Grpc::new(codec)
7517                            .apply_compression_config(
7518                                accept_compression_encodings,
7519                                send_compression_encodings,
7520                            )
7521                            .apply_max_message_size_config(
7522                                max_decoding_message_size,
7523                                max_encoding_message_size,
7524                            );
7525                        let res = grpc.unary(method, req).await;
7526                        Ok(res)
7527                    };
7528                    Box::pin(fut)
7529                }
7530                "/pidgr.v1.InsightsService/PredictCampaignACK" => {
7531                    #[allow(non_camel_case_types)]
7532                    struct PredictCampaignACKSvc<T: InsightsService>(pub Arc<T>);
7533                    impl<
7534                        T: InsightsService,
7535                    > tonic::server::UnaryService<super::PredictCampaignAckRequest>
7536                    for PredictCampaignACKSvc<T> {
7537                        type Response = super::PredictCampaignAckResponse;
7538                        type Future = BoxFuture<
7539                            tonic::Response<Self::Response>,
7540                            tonic::Status,
7541                        >;
7542                        fn call(
7543                            &mut self,
7544                            request: tonic::Request<super::PredictCampaignAckRequest>,
7545                        ) -> Self::Future {
7546                            let inner = Arc::clone(&self.0);
7547                            let fut = async move {
7548                                <T as InsightsService>::predict_campaign_ack(
7549                                        &inner,
7550                                        request,
7551                                    )
7552                                    .await
7553                            };
7554                            Box::pin(fut)
7555                        }
7556                    }
7557                    let accept_compression_encodings = self.accept_compression_encodings;
7558                    let send_compression_encodings = self.send_compression_encodings;
7559                    let max_decoding_message_size = self.max_decoding_message_size;
7560                    let max_encoding_message_size = self.max_encoding_message_size;
7561                    let inner = self.inner.clone();
7562                    let fut = async move {
7563                        let method = PredictCampaignACKSvc(inner);
7564                        let codec = tonic_prost::ProstCodec::default();
7565                        let mut grpc = tonic::server::Grpc::new(codec)
7566                            .apply_compression_config(
7567                                accept_compression_encodings,
7568                                send_compression_encodings,
7569                            )
7570                            .apply_max_message_size_config(
7571                                max_decoding_message_size,
7572                                max_encoding_message_size,
7573                            );
7574                        let res = grpc.unary(method, req).await;
7575                        Ok(res)
7576                    };
7577                    Box::pin(fut)
7578                }
7579                "/pidgr.v1.InsightsService/GetCampaignAdvisory" => {
7580                    #[allow(non_camel_case_types)]
7581                    struct GetCampaignAdvisorySvc<T: InsightsService>(pub Arc<T>);
7582                    impl<
7583                        T: InsightsService,
7584                    > tonic::server::UnaryService<super::GetCampaignAdvisoryRequest>
7585                    for GetCampaignAdvisorySvc<T> {
7586                        type Response = super::GetCampaignAdvisoryResponse;
7587                        type Future = BoxFuture<
7588                            tonic::Response<Self::Response>,
7589                            tonic::Status,
7590                        >;
7591                        fn call(
7592                            &mut self,
7593                            request: tonic::Request<super::GetCampaignAdvisoryRequest>,
7594                        ) -> Self::Future {
7595                            let inner = Arc::clone(&self.0);
7596                            let fut = async move {
7597                                <T as InsightsService>::get_campaign_advisory(
7598                                        &inner,
7599                                        request,
7600                                    )
7601                                    .await
7602                            };
7603                            Box::pin(fut)
7604                        }
7605                    }
7606                    let accept_compression_encodings = self.accept_compression_encodings;
7607                    let send_compression_encodings = self.send_compression_encodings;
7608                    let max_decoding_message_size = self.max_decoding_message_size;
7609                    let max_encoding_message_size = self.max_encoding_message_size;
7610                    let inner = self.inner.clone();
7611                    let fut = async move {
7612                        let method = GetCampaignAdvisorySvc(inner);
7613                        let codec = tonic_prost::ProstCodec::default();
7614                        let mut grpc = tonic::server::Grpc::new(codec)
7615                            .apply_compression_config(
7616                                accept_compression_encodings,
7617                                send_compression_encodings,
7618                            )
7619                            .apply_max_message_size_config(
7620                                max_decoding_message_size,
7621                                max_encoding_message_size,
7622                            );
7623                        let res = grpc.unary(method, req).await;
7624                        Ok(res)
7625                    };
7626                    Box::pin(fut)
7627                }
7628                "/pidgr.v1.InsightsService/GetInsightNarrative" => {
7629                    #[allow(non_camel_case_types)]
7630                    struct GetInsightNarrativeSvc<T: InsightsService>(pub Arc<T>);
7631                    impl<
7632                        T: InsightsService,
7633                    > tonic::server::UnaryService<super::GetInsightNarrativeRequest>
7634                    for GetInsightNarrativeSvc<T> {
7635                        type Response = super::GetInsightNarrativeResponse;
7636                        type Future = BoxFuture<
7637                            tonic::Response<Self::Response>,
7638                            tonic::Status,
7639                        >;
7640                        fn call(
7641                            &mut self,
7642                            request: tonic::Request<super::GetInsightNarrativeRequest>,
7643                        ) -> Self::Future {
7644                            let inner = Arc::clone(&self.0);
7645                            let fut = async move {
7646                                <T as InsightsService>::get_insight_narrative(
7647                                        &inner,
7648                                        request,
7649                                    )
7650                                    .await
7651                            };
7652                            Box::pin(fut)
7653                        }
7654                    }
7655                    let accept_compression_encodings = self.accept_compression_encodings;
7656                    let send_compression_encodings = self.send_compression_encodings;
7657                    let max_decoding_message_size = self.max_decoding_message_size;
7658                    let max_encoding_message_size = self.max_encoding_message_size;
7659                    let inner = self.inner.clone();
7660                    let fut = async move {
7661                        let method = GetInsightNarrativeSvc(inner);
7662                        let codec = tonic_prost::ProstCodec::default();
7663                        let mut grpc = tonic::server::Grpc::new(codec)
7664                            .apply_compression_config(
7665                                accept_compression_encodings,
7666                                send_compression_encodings,
7667                            )
7668                            .apply_max_message_size_config(
7669                                max_decoding_message_size,
7670                                max_encoding_message_size,
7671                            );
7672                        let res = grpc.unary(method, req).await;
7673                        Ok(res)
7674                    };
7675                    Box::pin(fut)
7676                }
7677                "/pidgr.v1.InsightsService/TriggerMLPipeline" => {
7678                    #[allow(non_camel_case_types)]
7679                    struct TriggerMLPipelineSvc<T: InsightsService>(pub Arc<T>);
7680                    impl<
7681                        T: InsightsService,
7682                    > tonic::server::UnaryService<super::TriggerMlPipelineRequest>
7683                    for TriggerMLPipelineSvc<T> {
7684                        type Response = super::TriggerMlPipelineResponse;
7685                        type Future = BoxFuture<
7686                            tonic::Response<Self::Response>,
7687                            tonic::Status,
7688                        >;
7689                        fn call(
7690                            &mut self,
7691                            request: tonic::Request<super::TriggerMlPipelineRequest>,
7692                        ) -> Self::Future {
7693                            let inner = Arc::clone(&self.0);
7694                            let fut = async move {
7695                                <T as InsightsService>::trigger_ml_pipeline(&inner, request)
7696                                    .await
7697                            };
7698                            Box::pin(fut)
7699                        }
7700                    }
7701                    let accept_compression_encodings = self.accept_compression_encodings;
7702                    let send_compression_encodings = self.send_compression_encodings;
7703                    let max_decoding_message_size = self.max_decoding_message_size;
7704                    let max_encoding_message_size = self.max_encoding_message_size;
7705                    let inner = self.inner.clone();
7706                    let fut = async move {
7707                        let method = TriggerMLPipelineSvc(inner);
7708                        let codec = tonic_prost::ProstCodec::default();
7709                        let mut grpc = tonic::server::Grpc::new(codec)
7710                            .apply_compression_config(
7711                                accept_compression_encodings,
7712                                send_compression_encodings,
7713                            )
7714                            .apply_max_message_size_config(
7715                                max_decoding_message_size,
7716                                max_encoding_message_size,
7717                            );
7718                        let res = grpc.unary(method, req).await;
7719                        Ok(res)
7720                    };
7721                    Box::pin(fut)
7722                }
7723                "/pidgr.v1.InsightsService/TriggerArchetypeClustering" => {
7724                    #[allow(non_camel_case_types)]
7725                    struct TriggerArchetypeClusteringSvc<T: InsightsService>(pub Arc<T>);
7726                    impl<
7727                        T: InsightsService,
7728                    > tonic::server::UnaryService<
7729                        super::TriggerArchetypeClusteringRequest,
7730                    > for TriggerArchetypeClusteringSvc<T> {
7731                        type Response = super::TriggerArchetypeClusteringResponse;
7732                        type Future = BoxFuture<
7733                            tonic::Response<Self::Response>,
7734                            tonic::Status,
7735                        >;
7736                        fn call(
7737                            &mut self,
7738                            request: tonic::Request<
7739                                super::TriggerArchetypeClusteringRequest,
7740                            >,
7741                        ) -> Self::Future {
7742                            let inner = Arc::clone(&self.0);
7743                            let fut = async move {
7744                                <T as InsightsService>::trigger_archetype_clustering(
7745                                        &inner,
7746                                        request,
7747                                    )
7748                                    .await
7749                            };
7750                            Box::pin(fut)
7751                        }
7752                    }
7753                    let accept_compression_encodings = self.accept_compression_encodings;
7754                    let send_compression_encodings = self.send_compression_encodings;
7755                    let max_decoding_message_size = self.max_decoding_message_size;
7756                    let max_encoding_message_size = self.max_encoding_message_size;
7757                    let inner = self.inner.clone();
7758                    let fut = async move {
7759                        let method = TriggerArchetypeClusteringSvc(inner);
7760                        let codec = tonic_prost::ProstCodec::default();
7761                        let mut grpc = tonic::server::Grpc::new(codec)
7762                            .apply_compression_config(
7763                                accept_compression_encodings,
7764                                send_compression_encodings,
7765                            )
7766                            .apply_max_message_size_config(
7767                                max_decoding_message_size,
7768                                max_encoding_message_size,
7769                            );
7770                        let res = grpc.unary(method, req).await;
7771                        Ok(res)
7772                    };
7773                    Box::pin(fut)
7774                }
7775                "/pidgr.v1.InsightsService/GenerateCampaignBodyDraft" => {
7776                    #[allow(non_camel_case_types)]
7777                    struct GenerateCampaignBodyDraftSvc<T: InsightsService>(pub Arc<T>);
7778                    impl<
7779                        T: InsightsService,
7780                    > tonic::server::UnaryService<
7781                        super::GenerateCampaignBodyDraftRequest,
7782                    > for GenerateCampaignBodyDraftSvc<T> {
7783                        type Response = super::GenerateCampaignBodyDraftResponse;
7784                        type Future = BoxFuture<
7785                            tonic::Response<Self::Response>,
7786                            tonic::Status,
7787                        >;
7788                        fn call(
7789                            &mut self,
7790                            request: tonic::Request<
7791                                super::GenerateCampaignBodyDraftRequest,
7792                            >,
7793                        ) -> Self::Future {
7794                            let inner = Arc::clone(&self.0);
7795                            let fut = async move {
7796                                <T as InsightsService>::generate_campaign_body_draft(
7797                                        &inner,
7798                                        request,
7799                                    )
7800                                    .await
7801                            };
7802                            Box::pin(fut)
7803                        }
7804                    }
7805                    let accept_compression_encodings = self.accept_compression_encodings;
7806                    let send_compression_encodings = self.send_compression_encodings;
7807                    let max_decoding_message_size = self.max_decoding_message_size;
7808                    let max_encoding_message_size = self.max_encoding_message_size;
7809                    let inner = self.inner.clone();
7810                    let fut = async move {
7811                        let method = GenerateCampaignBodyDraftSvc(inner);
7812                        let codec = tonic_prost::ProstCodec::default();
7813                        let mut grpc = tonic::server::Grpc::new(codec)
7814                            .apply_compression_config(
7815                                accept_compression_encodings,
7816                                send_compression_encodings,
7817                            )
7818                            .apply_max_message_size_config(
7819                                max_decoding_message_size,
7820                                max_encoding_message_size,
7821                            );
7822                        let res = grpc.unary(method, req).await;
7823                        Ok(res)
7824                    };
7825                    Box::pin(fut)
7826                }
7827                _ => {
7828                    Box::pin(async move {
7829                        let mut response = http::Response::new(
7830                            tonic::body::Body::default(),
7831                        );
7832                        let headers = response.headers_mut();
7833                        headers
7834                            .insert(
7835                                tonic::Status::GRPC_STATUS,
7836                                (tonic::Code::Unimplemented as i32).into(),
7837                            );
7838                        headers
7839                            .insert(
7840                                http::header::CONTENT_TYPE,
7841                                tonic::metadata::GRPC_CONTENT_TYPE,
7842                            );
7843                        Ok(response)
7844                    })
7845                }
7846            }
7847        }
7848    }
7849    impl<T> Clone for InsightsServiceServer<T> {
7850        fn clone(&self) -> Self {
7851            let inner = self.inner.clone();
7852            Self {
7853                inner,
7854                accept_compression_encodings: self.accept_compression_encodings,
7855                send_compression_encodings: self.send_compression_encodings,
7856                max_decoding_message_size: self.max_decoding_message_size,
7857                max_encoding_message_size: self.max_encoding_message_size,
7858            }
7859        }
7860    }
7861    /// Generated gRPC service name
7862    pub const SERVICE_NAME: &str = "pidgr.v1.InsightsService";
7863    impl<T> tonic::server::NamedService for InsightsServiceServer<T> {
7864        const NAME: &'static str = SERVICE_NAME;
7865    }
7866}
7867/// Generated client implementations.
7868pub mod integrations_service_client {
7869    #![allow(
7870        unused_variables,
7871        dead_code,
7872        missing_docs,
7873        clippy::wildcard_imports,
7874        clippy::let_unit_value,
7875    )]
7876    use tonic::codegen::*;
7877    use tonic::codegen::http::Uri;
7878    /** IntegrationsService is the gRPC surface of the pidgr-integrations service.
7879
7880 Auth model:
7881   - DispatchToChannel: internal-mTLS only. Called by the Temporal worker
7882     on behalf of pidgr-api dispatch activities. Never exposed publicly.
7883   - UpsertReachability / RemoveReachability / GetReachability /
7884     ListReachabilityForUser: Cognito JWT (admin RPCs, org-scoped on the
7885     caller's `custom:org_id` claim).
7886   - GetRegionPolicy / SetRegionPolicy / GetCostCapPolicy /
7887     SetCostCapPolicy: Cognito JWT (admin only, org-scoped).
7888
7889 Cross-org access is denied with `permission_denied`.
7890*/
7891    #[derive(Debug, Clone)]
7892    pub struct IntegrationsServiceClient<T> {
7893        inner: tonic::client::Grpc<T>,
7894    }
7895    impl IntegrationsServiceClient<tonic::transport::Channel> {
7896        /// Attempt to create a new client by connecting to a given endpoint.
7897        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
7898        where
7899            D: TryInto<tonic::transport::Endpoint>,
7900            D::Error: Into<StdError>,
7901        {
7902            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
7903            Ok(Self::new(conn))
7904        }
7905    }
7906    impl<T> IntegrationsServiceClient<T>
7907    where
7908        T: tonic::client::GrpcService<tonic::body::Body>,
7909        T::Error: Into<StdError>,
7910        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
7911        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
7912    {
7913        pub fn new(inner: T) -> Self {
7914            let inner = tonic::client::Grpc::new(inner);
7915            Self { inner }
7916        }
7917        pub fn with_origin(inner: T, origin: Uri) -> Self {
7918            let inner = tonic::client::Grpc::with_origin(inner, origin);
7919            Self { inner }
7920        }
7921        pub fn with_interceptor<F>(
7922            inner: T,
7923            interceptor: F,
7924        ) -> IntegrationsServiceClient<InterceptedService<T, F>>
7925        where
7926            F: tonic::service::Interceptor,
7927            T::ResponseBody: Default,
7928            T: tonic::codegen::Service<
7929                http::Request<tonic::body::Body>,
7930                Response = http::Response<
7931                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
7932                >,
7933            >,
7934            <T as tonic::codegen::Service<
7935                http::Request<tonic::body::Body>,
7936            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
7937        {
7938            IntegrationsServiceClient::new(InterceptedService::new(inner, interceptor))
7939        }
7940        /// Compress requests with the given encoding.
7941        ///
7942        /// This requires the server to support it otherwise it might respond with an
7943        /// error.
7944        #[must_use]
7945        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7946            self.inner = self.inner.send_compressed(encoding);
7947            self
7948        }
7949        /// Enable decompressing responses.
7950        #[must_use]
7951        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7952            self.inner = self.inner.accept_compressed(encoding);
7953            self
7954        }
7955        /// Limits the maximum size of a decoded message.
7956        ///
7957        /// Default: `4MB`
7958        #[must_use]
7959        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7960            self.inner = self.inner.max_decoding_message_size(limit);
7961            self
7962        }
7963        /// Limits the maximum size of an encoded message.
7964        ///
7965        /// Default: `usize::MAX`
7966        #[must_use]
7967        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7968            self.inner = self.inner.max_encoding_message_size(limit);
7969            self
7970        }
7971        /** Dispatch a single rendered message to one channel. Idempotent on
7972 `dispatch_id`. Internal-mTLS only.
7973*/
7974        pub async fn dispatch_to_channel(
7975            &mut self,
7976            request: impl tonic::IntoRequest<super::DispatchToChannelRequest>,
7977        ) -> std::result::Result<
7978            tonic::Response<super::DispatchToChannelResponse>,
7979            tonic::Status,
7980        > {
7981            self.inner
7982                .ready()
7983                .await
7984                .map_err(|e| {
7985                    tonic::Status::unknown(
7986                        format!("Service was not ready: {}", e.into()),
7987                    )
7988                })?;
7989            let codec = tonic_prost::ProstCodec::default();
7990            let path = http::uri::PathAndQuery::from_static(
7991                "/pidgr.v1.IntegrationsService/DispatchToChannel",
7992            );
7993            let mut req = request.into_request();
7994            req.extensions_mut()
7995                .insert(
7996                    GrpcMethod::new("pidgr.v1.IntegrationsService", "DispatchToChannel"),
7997                );
7998            self.inner.unary(req, path, codec).await
7999        }
8000        /** Upsert a reachability identifier for a (user, channel) tuple. Encrypts
8001 and HMAC-hashes server-side before insert; emits a `REACHABILITY_UPSERT`
8002 audit row BEFORE the registry commit.
8003*/
8004        pub async fn upsert_reachability(
8005            &mut self,
8006            request: impl tonic::IntoRequest<super::UpsertReachabilityRequest>,
8007        ) -> std::result::Result<
8008            tonic::Response<super::UpsertReachabilityResponse>,
8009            tonic::Status,
8010        > {
8011            self.inner
8012                .ready()
8013                .await
8014                .map_err(|e| {
8015                    tonic::Status::unknown(
8016                        format!("Service was not ready: {}", e.into()),
8017                    )
8018                })?;
8019            let codec = tonic_prost::ProstCodec::default();
8020            let path = http::uri::PathAndQuery::from_static(
8021                "/pidgr.v1.IntegrationsService/UpsertReachability",
8022            );
8023            let mut req = request.into_request();
8024            req.extensions_mut()
8025                .insert(
8026                    GrpcMethod::new("pidgr.v1.IntegrationsService", "UpsertReachability"),
8027                );
8028            self.inner.unary(req, path, codec).await
8029        }
8030        /** Remove a reachability identifier. Idempotent. Emits a
8031 `REACHABILITY_REMOVE` audit row BEFORE the registry delete.
8032*/
8033        pub async fn remove_reachability(
8034            &mut self,
8035            request: impl tonic::IntoRequest<super::RemoveReachabilityRequest>,
8036        ) -> std::result::Result<
8037            tonic::Response<super::RemoveReachabilityResponse>,
8038            tonic::Status,
8039        > {
8040            self.inner
8041                .ready()
8042                .await
8043                .map_err(|e| {
8044                    tonic::Status::unknown(
8045                        format!("Service was not ready: {}", e.into()),
8046                    )
8047                })?;
8048            let codec = tonic_prost::ProstCodec::default();
8049            let path = http::uri::PathAndQuery::from_static(
8050                "/pidgr.v1.IntegrationsService/RemoveReachability",
8051            );
8052            let mut req = request.into_request();
8053            req.extensions_mut()
8054                .insert(
8055                    GrpcMethod::new("pidgr.v1.IntegrationsService", "RemoveReachability"),
8056                );
8057            self.inner.unary(req, path, codec).await
8058        }
8059        /** Read a single reachability row's metadata. Returns NOT_FOUND if missing.
8060 Does not return plaintext or envelope ciphertext.
8061*/
8062        pub async fn get_reachability(
8063            &mut self,
8064            request: impl tonic::IntoRequest<super::GetReachabilityRequest>,
8065        ) -> std::result::Result<
8066            tonic::Response<super::GetReachabilityResponse>,
8067            tonic::Status,
8068        > {
8069            self.inner
8070                .ready()
8071                .await
8072                .map_err(|e| {
8073                    tonic::Status::unknown(
8074                        format!("Service was not ready: {}", e.into()),
8075                    )
8076                })?;
8077            let codec = tonic_prost::ProstCodec::default();
8078            let path = http::uri::PathAndQuery::from_static(
8079                "/pidgr.v1.IntegrationsService/GetReachability",
8080            );
8081            let mut req = request.into_request();
8082            req.extensions_mut()
8083                .insert(
8084                    GrpcMethod::new("pidgr.v1.IntegrationsService", "GetReachability"),
8085                );
8086            self.inner.unary(req, path, codec).await
8087        }
8088        /** List per-channel reachability metadata for a single user. Used by the
8089 admin per-user matrix view. Does not return plaintext or ciphertext.
8090*/
8091        pub async fn list_reachability_for_user(
8092            &mut self,
8093            request: impl tonic::IntoRequest<super::ListReachabilityForUserRequest>,
8094        ) -> std::result::Result<
8095            tonic::Response<super::ListReachabilityForUserResponse>,
8096            tonic::Status,
8097        > {
8098            self.inner
8099                .ready()
8100                .await
8101                .map_err(|e| {
8102                    tonic::Status::unknown(
8103                        format!("Service was not ready: {}", e.into()),
8104                    )
8105                })?;
8106            let codec = tonic_prost::ProstCodec::default();
8107            let path = http::uri::PathAndQuery::from_static(
8108                "/pidgr.v1.IntegrationsService/ListReachabilityForUser",
8109            );
8110            let mut req = request.into_request();
8111            req.extensions_mut()
8112                .insert(
8113                    GrpcMethod::new(
8114                        "pidgr.v1.IntegrationsService",
8115                        "ListReachabilityForUser",
8116                    ),
8117                );
8118            self.inner.unary(req, path, codec).await
8119        }
8120        /** Read the per-(org, channel) region allowlist. Returns an empty list when
8121 no policy is configured — NOT a NOT_FOUND.
8122*/
8123        pub async fn get_region_policy(
8124            &mut self,
8125            request: impl tonic::IntoRequest<super::GetRegionPolicyRequest>,
8126        ) -> std::result::Result<
8127            tonic::Response<super::GetRegionPolicyResponse>,
8128            tonic::Status,
8129        > {
8130            self.inner
8131                .ready()
8132                .await
8133                .map_err(|e| {
8134                    tonic::Status::unknown(
8135                        format!("Service was not ready: {}", e.into()),
8136                    )
8137                })?;
8138            let codec = tonic_prost::ProstCodec::default();
8139            let path = http::uri::PathAndQuery::from_static(
8140                "/pidgr.v1.IntegrationsService/GetRegionPolicy",
8141            );
8142            let mut req = request.into_request();
8143            req.extensions_mut()
8144                .insert(
8145                    GrpcMethod::new("pidgr.v1.IntegrationsService", "GetRegionPolicy"),
8146                );
8147            self.inner.unary(req, path, codec).await
8148        }
8149        /** Admin-only upsert of the per-(org, channel) region allowlist.
8150*/
8151        pub async fn set_region_policy(
8152            &mut self,
8153            request: impl tonic::IntoRequest<super::SetRegionPolicyRequest>,
8154        ) -> std::result::Result<
8155            tonic::Response<super::SetRegionPolicyResponse>,
8156            tonic::Status,
8157        > {
8158            self.inner
8159                .ready()
8160                .await
8161                .map_err(|e| {
8162                    tonic::Status::unknown(
8163                        format!("Service was not ready: {}", e.into()),
8164                    )
8165                })?;
8166            let codec = tonic_prost::ProstCodec::default();
8167            let path = http::uri::PathAndQuery::from_static(
8168                "/pidgr.v1.IntegrationsService/SetRegionPolicy",
8169            );
8170            let mut req = request.into_request();
8171            req.extensions_mut()
8172                .insert(
8173                    GrpcMethod::new("pidgr.v1.IntegrationsService", "SetRegionPolicy"),
8174                );
8175            self.inner.unary(req, path, codec).await
8176        }
8177        /** Read the current calendar-month cost-cap state. Returns the channel
8178 default cap when no row exists; never NOT_FOUND.
8179*/
8180        pub async fn get_cost_cap_policy(
8181            &mut self,
8182            request: impl tonic::IntoRequest<super::GetCostCapPolicyRequest>,
8183        ) -> std::result::Result<
8184            tonic::Response<super::GetCostCapPolicyResponse>,
8185            tonic::Status,
8186        > {
8187            self.inner
8188                .ready()
8189                .await
8190                .map_err(|e| {
8191                    tonic::Status::unknown(
8192                        format!("Service was not ready: {}", e.into()),
8193                    )
8194                })?;
8195            let codec = tonic_prost::ProstCodec::default();
8196            let path = http::uri::PathAndQuery::from_static(
8197                "/pidgr.v1.IntegrationsService/GetCostCapPolicy",
8198            );
8199            let mut req = request.into_request();
8200            req.extensions_mut()
8201                .insert(
8202                    GrpcMethod::new("pidgr.v1.IntegrationsService", "GetCostCapPolicy"),
8203                );
8204            self.inner.unary(req, path, codec).await
8205        }
8206        /** Admin-only upsert of the current calendar-month cost cap.
8207*/
8208        pub async fn set_cost_cap_policy(
8209            &mut self,
8210            request: impl tonic::IntoRequest<super::SetCostCapPolicyRequest>,
8211        ) -> std::result::Result<
8212            tonic::Response<super::SetCostCapPolicyResponse>,
8213            tonic::Status,
8214        > {
8215            self.inner
8216                .ready()
8217                .await
8218                .map_err(|e| {
8219                    tonic::Status::unknown(
8220                        format!("Service was not ready: {}", e.into()),
8221                    )
8222                })?;
8223            let codec = tonic_prost::ProstCodec::default();
8224            let path = http::uri::PathAndQuery::from_static(
8225                "/pidgr.v1.IntegrationsService/SetCostCapPolicy",
8226            );
8227            let mut req = request.into_request();
8228            req.extensions_mut()
8229                .insert(
8230                    GrpcMethod::new("pidgr.v1.IntegrationsService", "SetCostCapPolicy"),
8231                );
8232            self.inner.unary(req, path, codec).await
8233        }
8234    }
8235}
8236/// Generated server implementations.
8237pub mod integrations_service_server {
8238    #![allow(
8239        unused_variables,
8240        dead_code,
8241        missing_docs,
8242        clippy::wildcard_imports,
8243        clippy::let_unit_value,
8244    )]
8245    use tonic::codegen::*;
8246    /// Generated trait containing gRPC methods that should be implemented for use with IntegrationsServiceServer.
8247    #[async_trait]
8248    pub trait IntegrationsService: std::marker::Send + std::marker::Sync + 'static {
8249        /** Dispatch a single rendered message to one channel. Idempotent on
8250 `dispatch_id`. Internal-mTLS only.
8251*/
8252        async fn dispatch_to_channel(
8253            &self,
8254            request: tonic::Request<super::DispatchToChannelRequest>,
8255        ) -> std::result::Result<
8256            tonic::Response<super::DispatchToChannelResponse>,
8257            tonic::Status,
8258        >;
8259        /** Upsert a reachability identifier for a (user, channel) tuple. Encrypts
8260 and HMAC-hashes server-side before insert; emits a `REACHABILITY_UPSERT`
8261 audit row BEFORE the registry commit.
8262*/
8263        async fn upsert_reachability(
8264            &self,
8265            request: tonic::Request<super::UpsertReachabilityRequest>,
8266        ) -> std::result::Result<
8267            tonic::Response<super::UpsertReachabilityResponse>,
8268            tonic::Status,
8269        >;
8270        /** Remove a reachability identifier. Idempotent. Emits a
8271 `REACHABILITY_REMOVE` audit row BEFORE the registry delete.
8272*/
8273        async fn remove_reachability(
8274            &self,
8275            request: tonic::Request<super::RemoveReachabilityRequest>,
8276        ) -> std::result::Result<
8277            tonic::Response<super::RemoveReachabilityResponse>,
8278            tonic::Status,
8279        >;
8280        /** Read a single reachability row's metadata. Returns NOT_FOUND if missing.
8281 Does not return plaintext or envelope ciphertext.
8282*/
8283        async fn get_reachability(
8284            &self,
8285            request: tonic::Request<super::GetReachabilityRequest>,
8286        ) -> std::result::Result<
8287            tonic::Response<super::GetReachabilityResponse>,
8288            tonic::Status,
8289        >;
8290        /** List per-channel reachability metadata for a single user. Used by the
8291 admin per-user matrix view. Does not return plaintext or ciphertext.
8292*/
8293        async fn list_reachability_for_user(
8294            &self,
8295            request: tonic::Request<super::ListReachabilityForUserRequest>,
8296        ) -> std::result::Result<
8297            tonic::Response<super::ListReachabilityForUserResponse>,
8298            tonic::Status,
8299        >;
8300        /** Read the per-(org, channel) region allowlist. Returns an empty list when
8301 no policy is configured — NOT a NOT_FOUND.
8302*/
8303        async fn get_region_policy(
8304            &self,
8305            request: tonic::Request<super::GetRegionPolicyRequest>,
8306        ) -> std::result::Result<
8307            tonic::Response<super::GetRegionPolicyResponse>,
8308            tonic::Status,
8309        >;
8310        /** Admin-only upsert of the per-(org, channel) region allowlist.
8311*/
8312        async fn set_region_policy(
8313            &self,
8314            request: tonic::Request<super::SetRegionPolicyRequest>,
8315        ) -> std::result::Result<
8316            tonic::Response<super::SetRegionPolicyResponse>,
8317            tonic::Status,
8318        >;
8319        /** Read the current calendar-month cost-cap state. Returns the channel
8320 default cap when no row exists; never NOT_FOUND.
8321*/
8322        async fn get_cost_cap_policy(
8323            &self,
8324            request: tonic::Request<super::GetCostCapPolicyRequest>,
8325        ) -> std::result::Result<
8326            tonic::Response<super::GetCostCapPolicyResponse>,
8327            tonic::Status,
8328        >;
8329        /** Admin-only upsert of the current calendar-month cost cap.
8330*/
8331        async fn set_cost_cap_policy(
8332            &self,
8333            request: tonic::Request<super::SetCostCapPolicyRequest>,
8334        ) -> std::result::Result<
8335            tonic::Response<super::SetCostCapPolicyResponse>,
8336            tonic::Status,
8337        >;
8338    }
8339    /** IntegrationsService is the gRPC surface of the pidgr-integrations service.
8340
8341 Auth model:
8342   - DispatchToChannel: internal-mTLS only. Called by the Temporal worker
8343     on behalf of pidgr-api dispatch activities. Never exposed publicly.
8344   - UpsertReachability / RemoveReachability / GetReachability /
8345     ListReachabilityForUser: Cognito JWT (admin RPCs, org-scoped on the
8346     caller's `custom:org_id` claim).
8347   - GetRegionPolicy / SetRegionPolicy / GetCostCapPolicy /
8348     SetCostCapPolicy: Cognito JWT (admin only, org-scoped).
8349
8350 Cross-org access is denied with `permission_denied`.
8351*/
8352    #[derive(Debug)]
8353    pub struct IntegrationsServiceServer<T> {
8354        inner: Arc<T>,
8355        accept_compression_encodings: EnabledCompressionEncodings,
8356        send_compression_encodings: EnabledCompressionEncodings,
8357        max_decoding_message_size: Option<usize>,
8358        max_encoding_message_size: Option<usize>,
8359    }
8360    impl<T> IntegrationsServiceServer<T> {
8361        pub fn new(inner: T) -> Self {
8362            Self::from_arc(Arc::new(inner))
8363        }
8364        pub fn from_arc(inner: Arc<T>) -> Self {
8365            Self {
8366                inner,
8367                accept_compression_encodings: Default::default(),
8368                send_compression_encodings: Default::default(),
8369                max_decoding_message_size: None,
8370                max_encoding_message_size: None,
8371            }
8372        }
8373        pub fn with_interceptor<F>(
8374            inner: T,
8375            interceptor: F,
8376        ) -> InterceptedService<Self, F>
8377        where
8378            F: tonic::service::Interceptor,
8379        {
8380            InterceptedService::new(Self::new(inner), interceptor)
8381        }
8382        /// Enable decompressing requests with the given encoding.
8383        #[must_use]
8384        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8385            self.accept_compression_encodings.enable(encoding);
8386            self
8387        }
8388        /// Compress responses with the given encoding, if the client supports it.
8389        #[must_use]
8390        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8391            self.send_compression_encodings.enable(encoding);
8392            self
8393        }
8394        /// Limits the maximum size of a decoded message.
8395        ///
8396        /// Default: `4MB`
8397        #[must_use]
8398        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8399            self.max_decoding_message_size = Some(limit);
8400            self
8401        }
8402        /// Limits the maximum size of an encoded message.
8403        ///
8404        /// Default: `usize::MAX`
8405        #[must_use]
8406        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8407            self.max_encoding_message_size = Some(limit);
8408            self
8409        }
8410    }
8411    impl<T, B> tonic::codegen::Service<http::Request<B>> for IntegrationsServiceServer<T>
8412    where
8413        T: IntegrationsService,
8414        B: Body + std::marker::Send + 'static,
8415        B::Error: Into<StdError> + std::marker::Send + 'static,
8416    {
8417        type Response = http::Response<tonic::body::Body>;
8418        type Error = std::convert::Infallible;
8419        type Future = BoxFuture<Self::Response, Self::Error>;
8420        fn poll_ready(
8421            &mut self,
8422            _cx: &mut Context<'_>,
8423        ) -> Poll<std::result::Result<(), Self::Error>> {
8424            Poll::Ready(Ok(()))
8425        }
8426        fn call(&mut self, req: http::Request<B>) -> Self::Future {
8427            match req.uri().path() {
8428                "/pidgr.v1.IntegrationsService/DispatchToChannel" => {
8429                    #[allow(non_camel_case_types)]
8430                    struct DispatchToChannelSvc<T: IntegrationsService>(pub Arc<T>);
8431                    impl<
8432                        T: IntegrationsService,
8433                    > tonic::server::UnaryService<super::DispatchToChannelRequest>
8434                    for DispatchToChannelSvc<T> {
8435                        type Response = super::DispatchToChannelResponse;
8436                        type Future = BoxFuture<
8437                            tonic::Response<Self::Response>,
8438                            tonic::Status,
8439                        >;
8440                        fn call(
8441                            &mut self,
8442                            request: tonic::Request<super::DispatchToChannelRequest>,
8443                        ) -> Self::Future {
8444                            let inner = Arc::clone(&self.0);
8445                            let fut = async move {
8446                                <T as IntegrationsService>::dispatch_to_channel(
8447                                        &inner,
8448                                        request,
8449                                    )
8450                                    .await
8451                            };
8452                            Box::pin(fut)
8453                        }
8454                    }
8455                    let accept_compression_encodings = self.accept_compression_encodings;
8456                    let send_compression_encodings = self.send_compression_encodings;
8457                    let max_decoding_message_size = self.max_decoding_message_size;
8458                    let max_encoding_message_size = self.max_encoding_message_size;
8459                    let inner = self.inner.clone();
8460                    let fut = async move {
8461                        let method = DispatchToChannelSvc(inner);
8462                        let codec = tonic_prost::ProstCodec::default();
8463                        let mut grpc = tonic::server::Grpc::new(codec)
8464                            .apply_compression_config(
8465                                accept_compression_encodings,
8466                                send_compression_encodings,
8467                            )
8468                            .apply_max_message_size_config(
8469                                max_decoding_message_size,
8470                                max_encoding_message_size,
8471                            );
8472                        let res = grpc.unary(method, req).await;
8473                        Ok(res)
8474                    };
8475                    Box::pin(fut)
8476                }
8477                "/pidgr.v1.IntegrationsService/UpsertReachability" => {
8478                    #[allow(non_camel_case_types)]
8479                    struct UpsertReachabilitySvc<T: IntegrationsService>(pub Arc<T>);
8480                    impl<
8481                        T: IntegrationsService,
8482                    > tonic::server::UnaryService<super::UpsertReachabilityRequest>
8483                    for UpsertReachabilitySvc<T> {
8484                        type Response = super::UpsertReachabilityResponse;
8485                        type Future = BoxFuture<
8486                            tonic::Response<Self::Response>,
8487                            tonic::Status,
8488                        >;
8489                        fn call(
8490                            &mut self,
8491                            request: tonic::Request<super::UpsertReachabilityRequest>,
8492                        ) -> Self::Future {
8493                            let inner = Arc::clone(&self.0);
8494                            let fut = async move {
8495                                <T as IntegrationsService>::upsert_reachability(
8496                                        &inner,
8497                                        request,
8498                                    )
8499                                    .await
8500                            };
8501                            Box::pin(fut)
8502                        }
8503                    }
8504                    let accept_compression_encodings = self.accept_compression_encodings;
8505                    let send_compression_encodings = self.send_compression_encodings;
8506                    let max_decoding_message_size = self.max_decoding_message_size;
8507                    let max_encoding_message_size = self.max_encoding_message_size;
8508                    let inner = self.inner.clone();
8509                    let fut = async move {
8510                        let method = UpsertReachabilitySvc(inner);
8511                        let codec = tonic_prost::ProstCodec::default();
8512                        let mut grpc = tonic::server::Grpc::new(codec)
8513                            .apply_compression_config(
8514                                accept_compression_encodings,
8515                                send_compression_encodings,
8516                            )
8517                            .apply_max_message_size_config(
8518                                max_decoding_message_size,
8519                                max_encoding_message_size,
8520                            );
8521                        let res = grpc.unary(method, req).await;
8522                        Ok(res)
8523                    };
8524                    Box::pin(fut)
8525                }
8526                "/pidgr.v1.IntegrationsService/RemoveReachability" => {
8527                    #[allow(non_camel_case_types)]
8528                    struct RemoveReachabilitySvc<T: IntegrationsService>(pub Arc<T>);
8529                    impl<
8530                        T: IntegrationsService,
8531                    > tonic::server::UnaryService<super::RemoveReachabilityRequest>
8532                    for RemoveReachabilitySvc<T> {
8533                        type Response = super::RemoveReachabilityResponse;
8534                        type Future = BoxFuture<
8535                            tonic::Response<Self::Response>,
8536                            tonic::Status,
8537                        >;
8538                        fn call(
8539                            &mut self,
8540                            request: tonic::Request<super::RemoveReachabilityRequest>,
8541                        ) -> Self::Future {
8542                            let inner = Arc::clone(&self.0);
8543                            let fut = async move {
8544                                <T as IntegrationsService>::remove_reachability(
8545                                        &inner,
8546                                        request,
8547                                    )
8548                                    .await
8549                            };
8550                            Box::pin(fut)
8551                        }
8552                    }
8553                    let accept_compression_encodings = self.accept_compression_encodings;
8554                    let send_compression_encodings = self.send_compression_encodings;
8555                    let max_decoding_message_size = self.max_decoding_message_size;
8556                    let max_encoding_message_size = self.max_encoding_message_size;
8557                    let inner = self.inner.clone();
8558                    let fut = async move {
8559                        let method = RemoveReachabilitySvc(inner);
8560                        let codec = tonic_prost::ProstCodec::default();
8561                        let mut grpc = tonic::server::Grpc::new(codec)
8562                            .apply_compression_config(
8563                                accept_compression_encodings,
8564                                send_compression_encodings,
8565                            )
8566                            .apply_max_message_size_config(
8567                                max_decoding_message_size,
8568                                max_encoding_message_size,
8569                            );
8570                        let res = grpc.unary(method, req).await;
8571                        Ok(res)
8572                    };
8573                    Box::pin(fut)
8574                }
8575                "/pidgr.v1.IntegrationsService/GetReachability" => {
8576                    #[allow(non_camel_case_types)]
8577                    struct GetReachabilitySvc<T: IntegrationsService>(pub Arc<T>);
8578                    impl<
8579                        T: IntegrationsService,
8580                    > tonic::server::UnaryService<super::GetReachabilityRequest>
8581                    for GetReachabilitySvc<T> {
8582                        type Response = super::GetReachabilityResponse;
8583                        type Future = BoxFuture<
8584                            tonic::Response<Self::Response>,
8585                            tonic::Status,
8586                        >;
8587                        fn call(
8588                            &mut self,
8589                            request: tonic::Request<super::GetReachabilityRequest>,
8590                        ) -> Self::Future {
8591                            let inner = Arc::clone(&self.0);
8592                            let fut = async move {
8593                                <T as IntegrationsService>::get_reachability(
8594                                        &inner,
8595                                        request,
8596                                    )
8597                                    .await
8598                            };
8599                            Box::pin(fut)
8600                        }
8601                    }
8602                    let accept_compression_encodings = self.accept_compression_encodings;
8603                    let send_compression_encodings = self.send_compression_encodings;
8604                    let max_decoding_message_size = self.max_decoding_message_size;
8605                    let max_encoding_message_size = self.max_encoding_message_size;
8606                    let inner = self.inner.clone();
8607                    let fut = async move {
8608                        let method = GetReachabilitySvc(inner);
8609                        let codec = tonic_prost::ProstCodec::default();
8610                        let mut grpc = tonic::server::Grpc::new(codec)
8611                            .apply_compression_config(
8612                                accept_compression_encodings,
8613                                send_compression_encodings,
8614                            )
8615                            .apply_max_message_size_config(
8616                                max_decoding_message_size,
8617                                max_encoding_message_size,
8618                            );
8619                        let res = grpc.unary(method, req).await;
8620                        Ok(res)
8621                    };
8622                    Box::pin(fut)
8623                }
8624                "/pidgr.v1.IntegrationsService/ListReachabilityForUser" => {
8625                    #[allow(non_camel_case_types)]
8626                    struct ListReachabilityForUserSvc<T: IntegrationsService>(
8627                        pub Arc<T>,
8628                    );
8629                    impl<
8630                        T: IntegrationsService,
8631                    > tonic::server::UnaryService<super::ListReachabilityForUserRequest>
8632                    for ListReachabilityForUserSvc<T> {
8633                        type Response = super::ListReachabilityForUserResponse;
8634                        type Future = BoxFuture<
8635                            tonic::Response<Self::Response>,
8636                            tonic::Status,
8637                        >;
8638                        fn call(
8639                            &mut self,
8640                            request: tonic::Request<
8641                                super::ListReachabilityForUserRequest,
8642                            >,
8643                        ) -> Self::Future {
8644                            let inner = Arc::clone(&self.0);
8645                            let fut = async move {
8646                                <T as IntegrationsService>::list_reachability_for_user(
8647                                        &inner,
8648                                        request,
8649                                    )
8650                                    .await
8651                            };
8652                            Box::pin(fut)
8653                        }
8654                    }
8655                    let accept_compression_encodings = self.accept_compression_encodings;
8656                    let send_compression_encodings = self.send_compression_encodings;
8657                    let max_decoding_message_size = self.max_decoding_message_size;
8658                    let max_encoding_message_size = self.max_encoding_message_size;
8659                    let inner = self.inner.clone();
8660                    let fut = async move {
8661                        let method = ListReachabilityForUserSvc(inner);
8662                        let codec = tonic_prost::ProstCodec::default();
8663                        let mut grpc = tonic::server::Grpc::new(codec)
8664                            .apply_compression_config(
8665                                accept_compression_encodings,
8666                                send_compression_encodings,
8667                            )
8668                            .apply_max_message_size_config(
8669                                max_decoding_message_size,
8670                                max_encoding_message_size,
8671                            );
8672                        let res = grpc.unary(method, req).await;
8673                        Ok(res)
8674                    };
8675                    Box::pin(fut)
8676                }
8677                "/pidgr.v1.IntegrationsService/GetRegionPolicy" => {
8678                    #[allow(non_camel_case_types)]
8679                    struct GetRegionPolicySvc<T: IntegrationsService>(pub Arc<T>);
8680                    impl<
8681                        T: IntegrationsService,
8682                    > tonic::server::UnaryService<super::GetRegionPolicyRequest>
8683                    for GetRegionPolicySvc<T> {
8684                        type Response = super::GetRegionPolicyResponse;
8685                        type Future = BoxFuture<
8686                            tonic::Response<Self::Response>,
8687                            tonic::Status,
8688                        >;
8689                        fn call(
8690                            &mut self,
8691                            request: tonic::Request<super::GetRegionPolicyRequest>,
8692                        ) -> Self::Future {
8693                            let inner = Arc::clone(&self.0);
8694                            let fut = async move {
8695                                <T as IntegrationsService>::get_region_policy(
8696                                        &inner,
8697                                        request,
8698                                    )
8699                                    .await
8700                            };
8701                            Box::pin(fut)
8702                        }
8703                    }
8704                    let accept_compression_encodings = self.accept_compression_encodings;
8705                    let send_compression_encodings = self.send_compression_encodings;
8706                    let max_decoding_message_size = self.max_decoding_message_size;
8707                    let max_encoding_message_size = self.max_encoding_message_size;
8708                    let inner = self.inner.clone();
8709                    let fut = async move {
8710                        let method = GetRegionPolicySvc(inner);
8711                        let codec = tonic_prost::ProstCodec::default();
8712                        let mut grpc = tonic::server::Grpc::new(codec)
8713                            .apply_compression_config(
8714                                accept_compression_encodings,
8715                                send_compression_encodings,
8716                            )
8717                            .apply_max_message_size_config(
8718                                max_decoding_message_size,
8719                                max_encoding_message_size,
8720                            );
8721                        let res = grpc.unary(method, req).await;
8722                        Ok(res)
8723                    };
8724                    Box::pin(fut)
8725                }
8726                "/pidgr.v1.IntegrationsService/SetRegionPolicy" => {
8727                    #[allow(non_camel_case_types)]
8728                    struct SetRegionPolicySvc<T: IntegrationsService>(pub Arc<T>);
8729                    impl<
8730                        T: IntegrationsService,
8731                    > tonic::server::UnaryService<super::SetRegionPolicyRequest>
8732                    for SetRegionPolicySvc<T> {
8733                        type Response = super::SetRegionPolicyResponse;
8734                        type Future = BoxFuture<
8735                            tonic::Response<Self::Response>,
8736                            tonic::Status,
8737                        >;
8738                        fn call(
8739                            &mut self,
8740                            request: tonic::Request<super::SetRegionPolicyRequest>,
8741                        ) -> Self::Future {
8742                            let inner = Arc::clone(&self.0);
8743                            let fut = async move {
8744                                <T as IntegrationsService>::set_region_policy(
8745                                        &inner,
8746                                        request,
8747                                    )
8748                                    .await
8749                            };
8750                            Box::pin(fut)
8751                        }
8752                    }
8753                    let accept_compression_encodings = self.accept_compression_encodings;
8754                    let send_compression_encodings = self.send_compression_encodings;
8755                    let max_decoding_message_size = self.max_decoding_message_size;
8756                    let max_encoding_message_size = self.max_encoding_message_size;
8757                    let inner = self.inner.clone();
8758                    let fut = async move {
8759                        let method = SetRegionPolicySvc(inner);
8760                        let codec = tonic_prost::ProstCodec::default();
8761                        let mut grpc = tonic::server::Grpc::new(codec)
8762                            .apply_compression_config(
8763                                accept_compression_encodings,
8764                                send_compression_encodings,
8765                            )
8766                            .apply_max_message_size_config(
8767                                max_decoding_message_size,
8768                                max_encoding_message_size,
8769                            );
8770                        let res = grpc.unary(method, req).await;
8771                        Ok(res)
8772                    };
8773                    Box::pin(fut)
8774                }
8775                "/pidgr.v1.IntegrationsService/GetCostCapPolicy" => {
8776                    #[allow(non_camel_case_types)]
8777                    struct GetCostCapPolicySvc<T: IntegrationsService>(pub Arc<T>);
8778                    impl<
8779                        T: IntegrationsService,
8780                    > tonic::server::UnaryService<super::GetCostCapPolicyRequest>
8781                    for GetCostCapPolicySvc<T> {
8782                        type Response = super::GetCostCapPolicyResponse;
8783                        type Future = BoxFuture<
8784                            tonic::Response<Self::Response>,
8785                            tonic::Status,
8786                        >;
8787                        fn call(
8788                            &mut self,
8789                            request: tonic::Request<super::GetCostCapPolicyRequest>,
8790                        ) -> Self::Future {
8791                            let inner = Arc::clone(&self.0);
8792                            let fut = async move {
8793                                <T as IntegrationsService>::get_cost_cap_policy(
8794                                        &inner,
8795                                        request,
8796                                    )
8797                                    .await
8798                            };
8799                            Box::pin(fut)
8800                        }
8801                    }
8802                    let accept_compression_encodings = self.accept_compression_encodings;
8803                    let send_compression_encodings = self.send_compression_encodings;
8804                    let max_decoding_message_size = self.max_decoding_message_size;
8805                    let max_encoding_message_size = self.max_encoding_message_size;
8806                    let inner = self.inner.clone();
8807                    let fut = async move {
8808                        let method = GetCostCapPolicySvc(inner);
8809                        let codec = tonic_prost::ProstCodec::default();
8810                        let mut grpc = tonic::server::Grpc::new(codec)
8811                            .apply_compression_config(
8812                                accept_compression_encodings,
8813                                send_compression_encodings,
8814                            )
8815                            .apply_max_message_size_config(
8816                                max_decoding_message_size,
8817                                max_encoding_message_size,
8818                            );
8819                        let res = grpc.unary(method, req).await;
8820                        Ok(res)
8821                    };
8822                    Box::pin(fut)
8823                }
8824                "/pidgr.v1.IntegrationsService/SetCostCapPolicy" => {
8825                    #[allow(non_camel_case_types)]
8826                    struct SetCostCapPolicySvc<T: IntegrationsService>(pub Arc<T>);
8827                    impl<
8828                        T: IntegrationsService,
8829                    > tonic::server::UnaryService<super::SetCostCapPolicyRequest>
8830                    for SetCostCapPolicySvc<T> {
8831                        type Response = super::SetCostCapPolicyResponse;
8832                        type Future = BoxFuture<
8833                            tonic::Response<Self::Response>,
8834                            tonic::Status,
8835                        >;
8836                        fn call(
8837                            &mut self,
8838                            request: tonic::Request<super::SetCostCapPolicyRequest>,
8839                        ) -> Self::Future {
8840                            let inner = Arc::clone(&self.0);
8841                            let fut = async move {
8842                                <T as IntegrationsService>::set_cost_cap_policy(
8843                                        &inner,
8844                                        request,
8845                                    )
8846                                    .await
8847                            };
8848                            Box::pin(fut)
8849                        }
8850                    }
8851                    let accept_compression_encodings = self.accept_compression_encodings;
8852                    let send_compression_encodings = self.send_compression_encodings;
8853                    let max_decoding_message_size = self.max_decoding_message_size;
8854                    let max_encoding_message_size = self.max_encoding_message_size;
8855                    let inner = self.inner.clone();
8856                    let fut = async move {
8857                        let method = SetCostCapPolicySvc(inner);
8858                        let codec = tonic_prost::ProstCodec::default();
8859                        let mut grpc = tonic::server::Grpc::new(codec)
8860                            .apply_compression_config(
8861                                accept_compression_encodings,
8862                                send_compression_encodings,
8863                            )
8864                            .apply_max_message_size_config(
8865                                max_decoding_message_size,
8866                                max_encoding_message_size,
8867                            );
8868                        let res = grpc.unary(method, req).await;
8869                        Ok(res)
8870                    };
8871                    Box::pin(fut)
8872                }
8873                _ => {
8874                    Box::pin(async move {
8875                        let mut response = http::Response::new(
8876                            tonic::body::Body::default(),
8877                        );
8878                        let headers = response.headers_mut();
8879                        headers
8880                            .insert(
8881                                tonic::Status::GRPC_STATUS,
8882                                (tonic::Code::Unimplemented as i32).into(),
8883                            );
8884                        headers
8885                            .insert(
8886                                http::header::CONTENT_TYPE,
8887                                tonic::metadata::GRPC_CONTENT_TYPE,
8888                            );
8889                        Ok(response)
8890                    })
8891                }
8892            }
8893        }
8894    }
8895    impl<T> Clone for IntegrationsServiceServer<T> {
8896        fn clone(&self) -> Self {
8897            let inner = self.inner.clone();
8898            Self {
8899                inner,
8900                accept_compression_encodings: self.accept_compression_encodings,
8901                send_compression_encodings: self.send_compression_encodings,
8902                max_decoding_message_size: self.max_decoding_message_size,
8903                max_encoding_message_size: self.max_encoding_message_size,
8904            }
8905        }
8906    }
8907    /// Generated gRPC service name
8908    pub const SERVICE_NAME: &str = "pidgr.v1.IntegrationsService";
8909    impl<T> tonic::server::NamedService for IntegrationsServiceServer<T> {
8910        const NAME: &'static str = SERVICE_NAME;
8911    }
8912}
8913/// Generated client implementations.
8914pub mod invite_link_service_client {
8915    #![allow(
8916        unused_variables,
8917        dead_code,
8918        missing_docs,
8919        clippy::wildcard_imports,
8920        clippy::let_unit_value,
8921    )]
8922    use tonic::codegen::*;
8923    use tonic::codegen::http::Uri;
8924    /** Manages shareable invite links for organization self-join.
8925 Create, List, and Revoke require JWT + PERMISSION_MEMBERS_INVITE.
8926 ValidateInviteLink is unauthenticated — the token IS the authorization.
8927 RedeemInviteLink requires a valid JWT.
8928*/
8929    #[derive(Debug, Clone)]
8930    pub struct InviteLinkServiceClient<T> {
8931        inner: tonic::client::Grpc<T>,
8932    }
8933    impl InviteLinkServiceClient<tonic::transport::Channel> {
8934        /// Attempt to create a new client by connecting to a given endpoint.
8935        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
8936        where
8937            D: TryInto<tonic::transport::Endpoint>,
8938            D::Error: Into<StdError>,
8939        {
8940            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
8941            Ok(Self::new(conn))
8942        }
8943    }
8944    impl<T> InviteLinkServiceClient<T>
8945    where
8946        T: tonic::client::GrpcService<tonic::body::Body>,
8947        T::Error: Into<StdError>,
8948        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
8949        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
8950    {
8951        pub fn new(inner: T) -> Self {
8952            let inner = tonic::client::Grpc::new(inner);
8953            Self { inner }
8954        }
8955        pub fn with_origin(inner: T, origin: Uri) -> Self {
8956            let inner = tonic::client::Grpc::with_origin(inner, origin);
8957            Self { inner }
8958        }
8959        pub fn with_interceptor<F>(
8960            inner: T,
8961            interceptor: F,
8962        ) -> InviteLinkServiceClient<InterceptedService<T, F>>
8963        where
8964            F: tonic::service::Interceptor,
8965            T::ResponseBody: Default,
8966            T: tonic::codegen::Service<
8967                http::Request<tonic::body::Body>,
8968                Response = http::Response<
8969                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
8970                >,
8971            >,
8972            <T as tonic::codegen::Service<
8973                http::Request<tonic::body::Body>,
8974            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
8975        {
8976            InviteLinkServiceClient::new(InterceptedService::new(inner, interceptor))
8977        }
8978        /// Compress requests with the given encoding.
8979        ///
8980        /// This requires the server to support it otherwise it might respond with an
8981        /// error.
8982        #[must_use]
8983        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8984            self.inner = self.inner.send_compressed(encoding);
8985            self
8986        }
8987        /// Enable decompressing responses.
8988        #[must_use]
8989        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8990            self.inner = self.inner.accept_compressed(encoding);
8991            self
8992        }
8993        /// Limits the maximum size of a decoded message.
8994        ///
8995        /// Default: `4MB`
8996        #[must_use]
8997        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8998            self.inner = self.inner.max_decoding_message_size(limit);
8999            self
9000        }
9001        /// Limits the maximum size of an encoded message.
9002        ///
9003        /// Default: `usize::MAX`
9004        #[must_use]
9005        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9006            self.inner = self.inner.max_encoding_message_size(limit);
9007            self
9008        }
9009        /** Create a new shareable invite link for the organization.
9010 Authorization: Requires PERMISSION_MEMBERS_INVITE.
9011*/
9012        pub async fn create_invite_link(
9013            &mut self,
9014            request: impl tonic::IntoRequest<super::CreateInviteLinkRequest>,
9015        ) -> std::result::Result<
9016            tonic::Response<super::CreateInviteLinkResponse>,
9017            tonic::Status,
9018        > {
9019            self.inner
9020                .ready()
9021                .await
9022                .map_err(|e| {
9023                    tonic::Status::unknown(
9024                        format!("Service was not ready: {}", e.into()),
9025                    )
9026                })?;
9027            let codec = tonic_prost::ProstCodec::default();
9028            let path = http::uri::PathAndQuery::from_static(
9029                "/pidgr.v1.InviteLinkService/CreateInviteLink",
9030            );
9031            let mut req = request.into_request();
9032            req.extensions_mut()
9033                .insert(
9034                    GrpcMethod::new("pidgr.v1.InviteLinkService", "CreateInviteLink"),
9035                );
9036            self.inner.unary(req, path, codec).await
9037        }
9038        /** List all invite links for the organization.
9039 Authorization: Requires PERMISSION_MEMBERS_INVITE.
9040*/
9041        pub async fn list_invite_links(
9042            &mut self,
9043            request: impl tonic::IntoRequest<super::ListInviteLinksRequest>,
9044        ) -> std::result::Result<
9045            tonic::Response<super::ListInviteLinksResponse>,
9046            tonic::Status,
9047        > {
9048            self.inner
9049                .ready()
9050                .await
9051                .map_err(|e| {
9052                    tonic::Status::unknown(
9053                        format!("Service was not ready: {}", e.into()),
9054                    )
9055                })?;
9056            let codec = tonic_prost::ProstCodec::default();
9057            let path = http::uri::PathAndQuery::from_static(
9058                "/pidgr.v1.InviteLinkService/ListInviteLinks",
9059            );
9060            let mut req = request.into_request();
9061            req.extensions_mut()
9062                .insert(
9063                    GrpcMethod::new("pidgr.v1.InviteLinkService", "ListInviteLinks"),
9064                );
9065            self.inner.unary(req, path, codec).await
9066        }
9067        /** Revoke an invite link, making it immediately unusable. Idempotent.
9068 Authorization: Requires PERMISSION_MEMBERS_INVITE.
9069*/
9070        pub async fn revoke_invite_link(
9071            &mut self,
9072            request: impl tonic::IntoRequest<super::RevokeInviteLinkRequest>,
9073        ) -> std::result::Result<
9074            tonic::Response<super::RevokeInviteLinkResponse>,
9075            tonic::Status,
9076        > {
9077            self.inner
9078                .ready()
9079                .await
9080                .map_err(|e| {
9081                    tonic::Status::unknown(
9082                        format!("Service was not ready: {}", e.into()),
9083                    )
9084                })?;
9085            let codec = tonic_prost::ProstCodec::default();
9086            let path = http::uri::PathAndQuery::from_static(
9087                "/pidgr.v1.InviteLinkService/RevokeInviteLink",
9088            );
9089            let mut req = request.into_request();
9090            req.extensions_mut()
9091                .insert(
9092                    GrpcMethod::new("pidgr.v1.InviteLinkService", "RevokeInviteLink"),
9093                );
9094            self.inner.unary(req, path, codec).await
9095        }
9096        /** Validate an invite link and provision a user account if needed.
9097 This is a pre-authentication endpoint — no JWT required.
9098 Rate limited to 10 requests per minute per IP.
9099 Authorization: None (token-based).
9100*/
9101        pub async fn validate_invite_link(
9102            &mut self,
9103            request: impl tonic::IntoRequest<super::ValidateInviteLinkRequest>,
9104        ) -> std::result::Result<
9105            tonic::Response<super::ValidateInviteLinkResponse>,
9106            tonic::Status,
9107        > {
9108            self.inner
9109                .ready()
9110                .await
9111                .map_err(|e| {
9112                    tonic::Status::unknown(
9113                        format!("Service was not ready: {}", e.into()),
9114                    )
9115                })?;
9116            let codec = tonic_prost::ProstCodec::default();
9117            let path = http::uri::PathAndQuery::from_static(
9118                "/pidgr.v1.InviteLinkService/ValidateInviteLink",
9119            );
9120            let mut req = request.into_request();
9121            req.extensions_mut()
9122                .insert(
9123                    GrpcMethod::new("pidgr.v1.InviteLinkService", "ValidateInviteLink"),
9124                );
9125            self.inner.unary(req, path, codec).await
9126        }
9127        /** Redeem an invite link to join an organization.
9128 Requires a valid JWT — the email is extracted from the token.
9129 Authorization: JWT required.
9130*/
9131        pub async fn redeem_invite_link(
9132            &mut self,
9133            request: impl tonic::IntoRequest<super::RedeemInviteLinkRequest>,
9134        ) -> std::result::Result<
9135            tonic::Response<super::RedeemInviteLinkResponse>,
9136            tonic::Status,
9137        > {
9138            self.inner
9139                .ready()
9140                .await
9141                .map_err(|e| {
9142                    tonic::Status::unknown(
9143                        format!("Service was not ready: {}", e.into()),
9144                    )
9145                })?;
9146            let codec = tonic_prost::ProstCodec::default();
9147            let path = http::uri::PathAndQuery::from_static(
9148                "/pidgr.v1.InviteLinkService/RedeemInviteLink",
9149            );
9150            let mut req = request.into_request();
9151            req.extensions_mut()
9152                .insert(
9153                    GrpcMethod::new("pidgr.v1.InviteLinkService", "RedeemInviteLink"),
9154                );
9155            self.inner.unary(req, path, codec).await
9156        }
9157    }
9158}
9159/// Generated server implementations.
9160pub mod invite_link_service_server {
9161    #![allow(
9162        unused_variables,
9163        dead_code,
9164        missing_docs,
9165        clippy::wildcard_imports,
9166        clippy::let_unit_value,
9167    )]
9168    use tonic::codegen::*;
9169    /// Generated trait containing gRPC methods that should be implemented for use with InviteLinkServiceServer.
9170    #[async_trait]
9171    pub trait InviteLinkService: std::marker::Send + std::marker::Sync + 'static {
9172        /** Create a new shareable invite link for the organization.
9173 Authorization: Requires PERMISSION_MEMBERS_INVITE.
9174*/
9175        async fn create_invite_link(
9176            &self,
9177            request: tonic::Request<super::CreateInviteLinkRequest>,
9178        ) -> std::result::Result<
9179            tonic::Response<super::CreateInviteLinkResponse>,
9180            tonic::Status,
9181        >;
9182        /** List all invite links for the organization.
9183 Authorization: Requires PERMISSION_MEMBERS_INVITE.
9184*/
9185        async fn list_invite_links(
9186            &self,
9187            request: tonic::Request<super::ListInviteLinksRequest>,
9188        ) -> std::result::Result<
9189            tonic::Response<super::ListInviteLinksResponse>,
9190            tonic::Status,
9191        >;
9192        /** Revoke an invite link, making it immediately unusable. Idempotent.
9193 Authorization: Requires PERMISSION_MEMBERS_INVITE.
9194*/
9195        async fn revoke_invite_link(
9196            &self,
9197            request: tonic::Request<super::RevokeInviteLinkRequest>,
9198        ) -> std::result::Result<
9199            tonic::Response<super::RevokeInviteLinkResponse>,
9200            tonic::Status,
9201        >;
9202        /** Validate an invite link and provision a user account if needed.
9203 This is a pre-authentication endpoint — no JWT required.
9204 Rate limited to 10 requests per minute per IP.
9205 Authorization: None (token-based).
9206*/
9207        async fn validate_invite_link(
9208            &self,
9209            request: tonic::Request<super::ValidateInviteLinkRequest>,
9210        ) -> std::result::Result<
9211            tonic::Response<super::ValidateInviteLinkResponse>,
9212            tonic::Status,
9213        >;
9214        /** Redeem an invite link to join an organization.
9215 Requires a valid JWT — the email is extracted from the token.
9216 Authorization: JWT required.
9217*/
9218        async fn redeem_invite_link(
9219            &self,
9220            request: tonic::Request<super::RedeemInviteLinkRequest>,
9221        ) -> std::result::Result<
9222            tonic::Response<super::RedeemInviteLinkResponse>,
9223            tonic::Status,
9224        >;
9225    }
9226    /** Manages shareable invite links for organization self-join.
9227 Create, List, and Revoke require JWT + PERMISSION_MEMBERS_INVITE.
9228 ValidateInviteLink is unauthenticated — the token IS the authorization.
9229 RedeemInviteLink requires a valid JWT.
9230*/
9231    #[derive(Debug)]
9232    pub struct InviteLinkServiceServer<T> {
9233        inner: Arc<T>,
9234        accept_compression_encodings: EnabledCompressionEncodings,
9235        send_compression_encodings: EnabledCompressionEncodings,
9236        max_decoding_message_size: Option<usize>,
9237        max_encoding_message_size: Option<usize>,
9238    }
9239    impl<T> InviteLinkServiceServer<T> {
9240        pub fn new(inner: T) -> Self {
9241            Self::from_arc(Arc::new(inner))
9242        }
9243        pub fn from_arc(inner: Arc<T>) -> Self {
9244            Self {
9245                inner,
9246                accept_compression_encodings: Default::default(),
9247                send_compression_encodings: Default::default(),
9248                max_decoding_message_size: None,
9249                max_encoding_message_size: None,
9250            }
9251        }
9252        pub fn with_interceptor<F>(
9253            inner: T,
9254            interceptor: F,
9255        ) -> InterceptedService<Self, F>
9256        where
9257            F: tonic::service::Interceptor,
9258        {
9259            InterceptedService::new(Self::new(inner), interceptor)
9260        }
9261        /// Enable decompressing requests with the given encoding.
9262        #[must_use]
9263        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9264            self.accept_compression_encodings.enable(encoding);
9265            self
9266        }
9267        /// Compress responses with the given encoding, if the client supports it.
9268        #[must_use]
9269        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9270            self.send_compression_encodings.enable(encoding);
9271            self
9272        }
9273        /// Limits the maximum size of a decoded message.
9274        ///
9275        /// Default: `4MB`
9276        #[must_use]
9277        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9278            self.max_decoding_message_size = Some(limit);
9279            self
9280        }
9281        /// Limits the maximum size of an encoded message.
9282        ///
9283        /// Default: `usize::MAX`
9284        #[must_use]
9285        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9286            self.max_encoding_message_size = Some(limit);
9287            self
9288        }
9289    }
9290    impl<T, B> tonic::codegen::Service<http::Request<B>> for InviteLinkServiceServer<T>
9291    where
9292        T: InviteLinkService,
9293        B: Body + std::marker::Send + 'static,
9294        B::Error: Into<StdError> + std::marker::Send + 'static,
9295    {
9296        type Response = http::Response<tonic::body::Body>;
9297        type Error = std::convert::Infallible;
9298        type Future = BoxFuture<Self::Response, Self::Error>;
9299        fn poll_ready(
9300            &mut self,
9301            _cx: &mut Context<'_>,
9302        ) -> Poll<std::result::Result<(), Self::Error>> {
9303            Poll::Ready(Ok(()))
9304        }
9305        fn call(&mut self, req: http::Request<B>) -> Self::Future {
9306            match req.uri().path() {
9307                "/pidgr.v1.InviteLinkService/CreateInviteLink" => {
9308                    #[allow(non_camel_case_types)]
9309                    struct CreateInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
9310                    impl<
9311                        T: InviteLinkService,
9312                    > tonic::server::UnaryService<super::CreateInviteLinkRequest>
9313                    for CreateInviteLinkSvc<T> {
9314                        type Response = super::CreateInviteLinkResponse;
9315                        type Future = BoxFuture<
9316                            tonic::Response<Self::Response>,
9317                            tonic::Status,
9318                        >;
9319                        fn call(
9320                            &mut self,
9321                            request: tonic::Request<super::CreateInviteLinkRequest>,
9322                        ) -> Self::Future {
9323                            let inner = Arc::clone(&self.0);
9324                            let fut = async move {
9325                                <T as InviteLinkService>::create_invite_link(
9326                                        &inner,
9327                                        request,
9328                                    )
9329                                    .await
9330                            };
9331                            Box::pin(fut)
9332                        }
9333                    }
9334                    let accept_compression_encodings = self.accept_compression_encodings;
9335                    let send_compression_encodings = self.send_compression_encodings;
9336                    let max_decoding_message_size = self.max_decoding_message_size;
9337                    let max_encoding_message_size = self.max_encoding_message_size;
9338                    let inner = self.inner.clone();
9339                    let fut = async move {
9340                        let method = CreateInviteLinkSvc(inner);
9341                        let codec = tonic_prost::ProstCodec::default();
9342                        let mut grpc = tonic::server::Grpc::new(codec)
9343                            .apply_compression_config(
9344                                accept_compression_encodings,
9345                                send_compression_encodings,
9346                            )
9347                            .apply_max_message_size_config(
9348                                max_decoding_message_size,
9349                                max_encoding_message_size,
9350                            );
9351                        let res = grpc.unary(method, req).await;
9352                        Ok(res)
9353                    };
9354                    Box::pin(fut)
9355                }
9356                "/pidgr.v1.InviteLinkService/ListInviteLinks" => {
9357                    #[allow(non_camel_case_types)]
9358                    struct ListInviteLinksSvc<T: InviteLinkService>(pub Arc<T>);
9359                    impl<
9360                        T: InviteLinkService,
9361                    > tonic::server::UnaryService<super::ListInviteLinksRequest>
9362                    for ListInviteLinksSvc<T> {
9363                        type Response = super::ListInviteLinksResponse;
9364                        type Future = BoxFuture<
9365                            tonic::Response<Self::Response>,
9366                            tonic::Status,
9367                        >;
9368                        fn call(
9369                            &mut self,
9370                            request: tonic::Request<super::ListInviteLinksRequest>,
9371                        ) -> Self::Future {
9372                            let inner = Arc::clone(&self.0);
9373                            let fut = async move {
9374                                <T as InviteLinkService>::list_invite_links(&inner, request)
9375                                    .await
9376                            };
9377                            Box::pin(fut)
9378                        }
9379                    }
9380                    let accept_compression_encodings = self.accept_compression_encodings;
9381                    let send_compression_encodings = self.send_compression_encodings;
9382                    let max_decoding_message_size = self.max_decoding_message_size;
9383                    let max_encoding_message_size = self.max_encoding_message_size;
9384                    let inner = self.inner.clone();
9385                    let fut = async move {
9386                        let method = ListInviteLinksSvc(inner);
9387                        let codec = tonic_prost::ProstCodec::default();
9388                        let mut grpc = tonic::server::Grpc::new(codec)
9389                            .apply_compression_config(
9390                                accept_compression_encodings,
9391                                send_compression_encodings,
9392                            )
9393                            .apply_max_message_size_config(
9394                                max_decoding_message_size,
9395                                max_encoding_message_size,
9396                            );
9397                        let res = grpc.unary(method, req).await;
9398                        Ok(res)
9399                    };
9400                    Box::pin(fut)
9401                }
9402                "/pidgr.v1.InviteLinkService/RevokeInviteLink" => {
9403                    #[allow(non_camel_case_types)]
9404                    struct RevokeInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
9405                    impl<
9406                        T: InviteLinkService,
9407                    > tonic::server::UnaryService<super::RevokeInviteLinkRequest>
9408                    for RevokeInviteLinkSvc<T> {
9409                        type Response = super::RevokeInviteLinkResponse;
9410                        type Future = BoxFuture<
9411                            tonic::Response<Self::Response>,
9412                            tonic::Status,
9413                        >;
9414                        fn call(
9415                            &mut self,
9416                            request: tonic::Request<super::RevokeInviteLinkRequest>,
9417                        ) -> Self::Future {
9418                            let inner = Arc::clone(&self.0);
9419                            let fut = async move {
9420                                <T as InviteLinkService>::revoke_invite_link(
9421                                        &inner,
9422                                        request,
9423                                    )
9424                                    .await
9425                            };
9426                            Box::pin(fut)
9427                        }
9428                    }
9429                    let accept_compression_encodings = self.accept_compression_encodings;
9430                    let send_compression_encodings = self.send_compression_encodings;
9431                    let max_decoding_message_size = self.max_decoding_message_size;
9432                    let max_encoding_message_size = self.max_encoding_message_size;
9433                    let inner = self.inner.clone();
9434                    let fut = async move {
9435                        let method = RevokeInviteLinkSvc(inner);
9436                        let codec = tonic_prost::ProstCodec::default();
9437                        let mut grpc = tonic::server::Grpc::new(codec)
9438                            .apply_compression_config(
9439                                accept_compression_encodings,
9440                                send_compression_encodings,
9441                            )
9442                            .apply_max_message_size_config(
9443                                max_decoding_message_size,
9444                                max_encoding_message_size,
9445                            );
9446                        let res = grpc.unary(method, req).await;
9447                        Ok(res)
9448                    };
9449                    Box::pin(fut)
9450                }
9451                "/pidgr.v1.InviteLinkService/ValidateInviteLink" => {
9452                    #[allow(non_camel_case_types)]
9453                    struct ValidateInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
9454                    impl<
9455                        T: InviteLinkService,
9456                    > tonic::server::UnaryService<super::ValidateInviteLinkRequest>
9457                    for ValidateInviteLinkSvc<T> {
9458                        type Response = super::ValidateInviteLinkResponse;
9459                        type Future = BoxFuture<
9460                            tonic::Response<Self::Response>,
9461                            tonic::Status,
9462                        >;
9463                        fn call(
9464                            &mut self,
9465                            request: tonic::Request<super::ValidateInviteLinkRequest>,
9466                        ) -> Self::Future {
9467                            let inner = Arc::clone(&self.0);
9468                            let fut = async move {
9469                                <T as InviteLinkService>::validate_invite_link(
9470                                        &inner,
9471                                        request,
9472                                    )
9473                                    .await
9474                            };
9475                            Box::pin(fut)
9476                        }
9477                    }
9478                    let accept_compression_encodings = self.accept_compression_encodings;
9479                    let send_compression_encodings = self.send_compression_encodings;
9480                    let max_decoding_message_size = self.max_decoding_message_size;
9481                    let max_encoding_message_size = self.max_encoding_message_size;
9482                    let inner = self.inner.clone();
9483                    let fut = async move {
9484                        let method = ValidateInviteLinkSvc(inner);
9485                        let codec = tonic_prost::ProstCodec::default();
9486                        let mut grpc = tonic::server::Grpc::new(codec)
9487                            .apply_compression_config(
9488                                accept_compression_encodings,
9489                                send_compression_encodings,
9490                            )
9491                            .apply_max_message_size_config(
9492                                max_decoding_message_size,
9493                                max_encoding_message_size,
9494                            );
9495                        let res = grpc.unary(method, req).await;
9496                        Ok(res)
9497                    };
9498                    Box::pin(fut)
9499                }
9500                "/pidgr.v1.InviteLinkService/RedeemInviteLink" => {
9501                    #[allow(non_camel_case_types)]
9502                    struct RedeemInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
9503                    impl<
9504                        T: InviteLinkService,
9505                    > tonic::server::UnaryService<super::RedeemInviteLinkRequest>
9506                    for RedeemInviteLinkSvc<T> {
9507                        type Response = super::RedeemInviteLinkResponse;
9508                        type Future = BoxFuture<
9509                            tonic::Response<Self::Response>,
9510                            tonic::Status,
9511                        >;
9512                        fn call(
9513                            &mut self,
9514                            request: tonic::Request<super::RedeemInviteLinkRequest>,
9515                        ) -> Self::Future {
9516                            let inner = Arc::clone(&self.0);
9517                            let fut = async move {
9518                                <T as InviteLinkService>::redeem_invite_link(
9519                                        &inner,
9520                                        request,
9521                                    )
9522                                    .await
9523                            };
9524                            Box::pin(fut)
9525                        }
9526                    }
9527                    let accept_compression_encodings = self.accept_compression_encodings;
9528                    let send_compression_encodings = self.send_compression_encodings;
9529                    let max_decoding_message_size = self.max_decoding_message_size;
9530                    let max_encoding_message_size = self.max_encoding_message_size;
9531                    let inner = self.inner.clone();
9532                    let fut = async move {
9533                        let method = RedeemInviteLinkSvc(inner);
9534                        let codec = tonic_prost::ProstCodec::default();
9535                        let mut grpc = tonic::server::Grpc::new(codec)
9536                            .apply_compression_config(
9537                                accept_compression_encodings,
9538                                send_compression_encodings,
9539                            )
9540                            .apply_max_message_size_config(
9541                                max_decoding_message_size,
9542                                max_encoding_message_size,
9543                            );
9544                        let res = grpc.unary(method, req).await;
9545                        Ok(res)
9546                    };
9547                    Box::pin(fut)
9548                }
9549                _ => {
9550                    Box::pin(async move {
9551                        let mut response = http::Response::new(
9552                            tonic::body::Body::default(),
9553                        );
9554                        let headers = response.headers_mut();
9555                        headers
9556                            .insert(
9557                                tonic::Status::GRPC_STATUS,
9558                                (tonic::Code::Unimplemented as i32).into(),
9559                            );
9560                        headers
9561                            .insert(
9562                                http::header::CONTENT_TYPE,
9563                                tonic::metadata::GRPC_CONTENT_TYPE,
9564                            );
9565                        Ok(response)
9566                    })
9567                }
9568            }
9569        }
9570    }
9571    impl<T> Clone for InviteLinkServiceServer<T> {
9572        fn clone(&self) -> Self {
9573            let inner = self.inner.clone();
9574            Self {
9575                inner,
9576                accept_compression_encodings: self.accept_compression_encodings,
9577                send_compression_encodings: self.send_compression_encodings,
9578                max_decoding_message_size: self.max_decoding_message_size,
9579                max_encoding_message_size: self.max_encoding_message_size,
9580            }
9581        }
9582    }
9583    /// Generated gRPC service name
9584    pub const SERVICE_NAME: &str = "pidgr.v1.InviteLinkService";
9585    impl<T> tonic::server::NamedService for InviteLinkServiceServer<T> {
9586        const NAME: &'static str = SERVICE_NAME;
9587    }
9588}
9589/// Generated client implementations.
9590pub mod member_service_client {
9591    #![allow(
9592        unused_variables,
9593        dead_code,
9594        missing_docs,
9595        clippy::wildcard_imports,
9596        clippy::let_unit_value,
9597    )]
9598    use tonic::codegen::*;
9599    use tonic::codegen::http::Uri;
9600    /** Manages members (users) within an organization.
9601 All RPCs operate within the caller's org (extracted from JWT).
9602*/
9603    #[derive(Debug, Clone)]
9604    pub struct MemberServiceClient<T> {
9605        inner: tonic::client::Grpc<T>,
9606    }
9607    impl MemberServiceClient<tonic::transport::Channel> {
9608        /// Attempt to create a new client by connecting to a given endpoint.
9609        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
9610        where
9611            D: TryInto<tonic::transport::Endpoint>,
9612            D::Error: Into<StdError>,
9613        {
9614            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
9615            Ok(Self::new(conn))
9616        }
9617    }
9618    impl<T> MemberServiceClient<T>
9619    where
9620        T: tonic::client::GrpcService<tonic::body::Body>,
9621        T::Error: Into<StdError>,
9622        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
9623        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
9624    {
9625        pub fn new(inner: T) -> Self {
9626            let inner = tonic::client::Grpc::new(inner);
9627            Self { inner }
9628        }
9629        pub fn with_origin(inner: T, origin: Uri) -> Self {
9630            let inner = tonic::client::Grpc::with_origin(inner, origin);
9631            Self { inner }
9632        }
9633        pub fn with_interceptor<F>(
9634            inner: T,
9635            interceptor: F,
9636        ) -> MemberServiceClient<InterceptedService<T, F>>
9637        where
9638            F: tonic::service::Interceptor,
9639            T::ResponseBody: Default,
9640            T: tonic::codegen::Service<
9641                http::Request<tonic::body::Body>,
9642                Response = http::Response<
9643                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
9644                >,
9645            >,
9646            <T as tonic::codegen::Service<
9647                http::Request<tonic::body::Body>,
9648            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
9649        {
9650            MemberServiceClient::new(InterceptedService::new(inner, interceptor))
9651        }
9652        /// Compress requests with the given encoding.
9653        ///
9654        /// This requires the server to support it otherwise it might respond with an
9655        /// error.
9656        #[must_use]
9657        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9658            self.inner = self.inner.send_compressed(encoding);
9659            self
9660        }
9661        /// Enable decompressing responses.
9662        #[must_use]
9663        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9664            self.inner = self.inner.accept_compressed(encoding);
9665            self
9666        }
9667        /// Limits the maximum size of a decoded message.
9668        ///
9669        /// Default: `4MB`
9670        #[must_use]
9671        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9672            self.inner = self.inner.max_decoding_message_size(limit);
9673            self
9674        }
9675        /// Limits the maximum size of an encoded message.
9676        ///
9677        /// Default: `usize::MAX`
9678        #[must_use]
9679        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9680            self.inner = self.inner.max_encoding_message_size(limit);
9681            self
9682        }
9683        /** Invite a new user to the organization via email.
9684 Authorization: Requires PERMISSION_MEMBERS_INVITE.
9685*/
9686        pub async fn invite_user(
9687            &mut self,
9688            request: impl tonic::IntoRequest<super::InviteUserRequest>,
9689        ) -> std::result::Result<
9690            tonic::Response<super::InviteUserResponse>,
9691            tonic::Status,
9692        > {
9693            self.inner
9694                .ready()
9695                .await
9696                .map_err(|e| {
9697                    tonic::Status::unknown(
9698                        format!("Service was not ready: {}", e.into()),
9699                    )
9700                })?;
9701            let codec = tonic_prost::ProstCodec::default();
9702            let path = http::uri::PathAndQuery::from_static(
9703                "/pidgr.v1.MemberService/InviteUser",
9704            );
9705            let mut req = request.into_request();
9706            req.extensions_mut()
9707                .insert(GrpcMethod::new("pidgr.v1.MemberService", "InviteUser"));
9708            self.inner.unary(req, path, codec).await
9709        }
9710        /** Retrieve a user by ID within the organization.
9711 Self-lookup (empty user_id) is allowed for any authenticated user.
9712 Authorization: Requires PERMISSION_MEMBERS_READ for other users.
9713*/
9714        pub async fn get_user(
9715            &mut self,
9716            request: impl tonic::IntoRequest<super::GetUserRequest>,
9717        ) -> std::result::Result<
9718            tonic::Response<super::GetUserResponse>,
9719            tonic::Status,
9720        > {
9721            self.inner
9722                .ready()
9723                .await
9724                .map_err(|e| {
9725                    tonic::Status::unknown(
9726                        format!("Service was not ready: {}", e.into()),
9727                    )
9728                })?;
9729            let codec = tonic_prost::ProstCodec::default();
9730            let path = http::uri::PathAndQuery::from_static(
9731                "/pidgr.v1.MemberService/GetUser",
9732            );
9733            let mut req = request.into_request();
9734            req.extensions_mut()
9735                .insert(GrpcMethod::new("pidgr.v1.MemberService", "GetUser"));
9736            self.inner.unary(req, path, codec).await
9737        }
9738        /** List all users in the organization with pagination.
9739 Authorization: Requires PERMISSION_MEMBERS_READ.
9740*/
9741        pub async fn list_users(
9742            &mut self,
9743            request: impl tonic::IntoRequest<super::ListUsersRequest>,
9744        ) -> std::result::Result<
9745            tonic::Response<super::ListUsersResponse>,
9746            tonic::Status,
9747        > {
9748            self.inner
9749                .ready()
9750                .await
9751                .map_err(|e| {
9752                    tonic::Status::unknown(
9753                        format!("Service was not ready: {}", e.into()),
9754                    )
9755                })?;
9756            let codec = tonic_prost::ProstCodec::default();
9757            let path = http::uri::PathAndQuery::from_static(
9758                "/pidgr.v1.MemberService/ListUsers",
9759            );
9760            let mut req = request.into_request();
9761            req.extensions_mut()
9762                .insert(GrpcMethod::new("pidgr.v1.MemberService", "ListUsers"));
9763            self.inner.unary(req, path, codec).await
9764        }
9765        /** Change a user's role within the organization.
9766 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
9767*/
9768        pub async fn update_user_role(
9769            &mut self,
9770            request: impl tonic::IntoRequest<super::UpdateUserRoleRequest>,
9771        ) -> std::result::Result<
9772            tonic::Response<super::UpdateUserRoleResponse>,
9773            tonic::Status,
9774        > {
9775            self.inner
9776                .ready()
9777                .await
9778                .map_err(|e| {
9779                    tonic::Status::unknown(
9780                        format!("Service was not ready: {}", e.into()),
9781                    )
9782                })?;
9783            let codec = tonic_prost::ProstCodec::default();
9784            let path = http::uri::PathAndQuery::from_static(
9785                "/pidgr.v1.MemberService/UpdateUserRole",
9786            );
9787            let mut req = request.into_request();
9788            req.extensions_mut()
9789                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserRole"));
9790            self.inner.unary(req, path, codec).await
9791        }
9792        /** Deactivate a user within the organization.
9793 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
9794*/
9795        pub async fn deactivate_user(
9796            &mut self,
9797            request: impl tonic::IntoRequest<super::DeactivateUserRequest>,
9798        ) -> std::result::Result<
9799            tonic::Response<super::DeactivateUserResponse>,
9800            tonic::Status,
9801        > {
9802            self.inner
9803                .ready()
9804                .await
9805                .map_err(|e| {
9806                    tonic::Status::unknown(
9807                        format!("Service was not ready: {}", e.into()),
9808                    )
9809                })?;
9810            let codec = tonic_prost::ProstCodec::default();
9811            let path = http::uri::PathAndQuery::from_static(
9812                "/pidgr.v1.MemberService/DeactivateUser",
9813            );
9814            let mut req = request.into_request();
9815            req.extensions_mut()
9816                .insert(GrpcMethod::new("pidgr.v1.MemberService", "DeactivateUser"));
9817            self.inner.unary(req, path, codec).await
9818        }
9819        /** Reactivate a deactivated user, restoring their status to INVITED.
9820 The user must complete the invite link flow again to become ACTIVE.
9821 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
9822*/
9823        pub async fn reactivate_user(
9824            &mut self,
9825            request: impl tonic::IntoRequest<super::ReactivateUserRequest>,
9826        ) -> std::result::Result<
9827            tonic::Response<super::ReactivateUserResponse>,
9828            tonic::Status,
9829        > {
9830            self.inner
9831                .ready()
9832                .await
9833                .map_err(|e| {
9834                    tonic::Status::unknown(
9835                        format!("Service was not ready: {}", e.into()),
9836                    )
9837                })?;
9838            let codec = tonic_prost::ProstCodec::default();
9839            let path = http::uri::PathAndQuery::from_static(
9840                "/pidgr.v1.MemberService/ReactivateUser",
9841            );
9842            let mut req = request.into_request();
9843            req.extensions_mut()
9844                .insert(GrpcMethod::new("pidgr.v1.MemberService", "ReactivateUser"));
9845            self.inner.unary(req, path, codec).await
9846        }
9847        /** Revoke an invitation for a user who has not yet completed registration.
9848 Hard-deletes the user record (INVITED users have no data to preserve).
9849 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
9850*/
9851        pub async fn revoke_invite(
9852            &mut self,
9853            request: impl tonic::IntoRequest<super::RevokeInviteRequest>,
9854        ) -> std::result::Result<
9855            tonic::Response<super::RevokeInviteResponse>,
9856            tonic::Status,
9857        > {
9858            self.inner
9859                .ready()
9860                .await
9861                .map_err(|e| {
9862                    tonic::Status::unknown(
9863                        format!("Service was not ready: {}", e.into()),
9864                    )
9865                })?;
9866            let codec = tonic_prost::ProstCodec::default();
9867            let path = http::uri::PathAndQuery::from_static(
9868                "/pidgr.v1.MemberService/RevokeInvite",
9869            );
9870            let mut req = request.into_request();
9871            req.extensions_mut()
9872                .insert(GrpcMethod::new("pidgr.v1.MemberService", "RevokeInvite"));
9873            self.inner.unary(req, path, codec).await
9874        }
9875        /** Update a user's profile attributes (department, title, etc.).
9876 Self-update (empty user_id or matching JWT sub) requires no special permission.
9877 Updating another user requires PERMISSION_MEMBERS_MANAGE.
9878*/
9879        pub async fn update_user_profile(
9880            &mut self,
9881            request: impl tonic::IntoRequest<super::UpdateUserProfileRequest>,
9882        ) -> std::result::Result<
9883            tonic::Response<super::UpdateUserProfileResponse>,
9884            tonic::Status,
9885        > {
9886            self.inner
9887                .ready()
9888                .await
9889                .map_err(|e| {
9890                    tonic::Status::unknown(
9891                        format!("Service was not ready: {}", e.into()),
9892                    )
9893                })?;
9894            let codec = tonic_prost::ProstCodec::default();
9895            let path = http::uri::PathAndQuery::from_static(
9896                "/pidgr.v1.MemberService/UpdateUserProfile",
9897            );
9898            let mut req = request.into_request();
9899            req.extensions_mut()
9900                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserProfile"));
9901            self.inner.unary(req, path, codec).await
9902        }
9903        /** Retrieve the caller's platform settings (theme, etc.).
9904 Authorization: Any authenticated user (self-only).
9905*/
9906        pub async fn get_user_settings(
9907            &mut self,
9908            request: impl tonic::IntoRequest<super::GetUserSettingsRequest>,
9909        ) -> std::result::Result<
9910            tonic::Response<super::GetUserSettingsResponse>,
9911            tonic::Status,
9912        > {
9913            self.inner
9914                .ready()
9915                .await
9916                .map_err(|e| {
9917                    tonic::Status::unknown(
9918                        format!("Service was not ready: {}", e.into()),
9919                    )
9920                })?;
9921            let codec = tonic_prost::ProstCodec::default();
9922            let path = http::uri::PathAndQuery::from_static(
9923                "/pidgr.v1.MemberService/GetUserSettings",
9924            );
9925            let mut req = request.into_request();
9926            req.extensions_mut()
9927                .insert(GrpcMethod::new("pidgr.v1.MemberService", "GetUserSettings"));
9928            self.inner.unary(req, path, codec).await
9929        }
9930        /** Update the caller's platform settings.
9931 Only fields with non-default values are applied; others are left unchanged.
9932 Authorization: Any authenticated user (self-only).
9933*/
9934        pub async fn update_user_settings(
9935            &mut self,
9936            request: impl tonic::IntoRequest<super::UpdateUserSettingsRequest>,
9937        ) -> std::result::Result<
9938            tonic::Response<super::UpdateUserSettingsResponse>,
9939            tonic::Status,
9940        > {
9941            self.inner
9942                .ready()
9943                .await
9944                .map_err(|e| {
9945                    tonic::Status::unknown(
9946                        format!("Service was not ready: {}", e.into()),
9947                    )
9948                })?;
9949            let codec = tonic_prost::ProstCodec::default();
9950            let path = http::uri::PathAndQuery::from_static(
9951                "/pidgr.v1.MemberService/UpdateUserSettings",
9952            );
9953            let mut req = request.into_request();
9954            req.extensions_mut()
9955                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserSettings"));
9956            self.inner.unary(req, path, codec).await
9957        }
9958        /** Invite multiple users to the organization in a single call.
9959 Emails are deduplicated. Each email is processed independently — individual
9960 failures do not abort the batch. Identity provider calls are parallelized (bounded concurrency).
9961 Authorization: Requires PERMISSION_MEMBERS_INVITE.
9962*/
9963        pub async fn bulk_invite_users(
9964            &mut self,
9965            request: impl tonic::IntoRequest<super::BulkInviteUsersRequest>,
9966        ) -> std::result::Result<
9967            tonic::Response<super::BulkInviteUsersResponse>,
9968            tonic::Status,
9969        > {
9970            self.inner
9971                .ready()
9972                .await
9973                .map_err(|e| {
9974                    tonic::Status::unknown(
9975                        format!("Service was not ready: {}", e.into()),
9976                    )
9977                })?;
9978            let codec = tonic_prost::ProstCodec::default();
9979            let path = http::uri::PathAndQuery::from_static(
9980                "/pidgr.v1.MemberService/BulkInviteUsers",
9981            );
9982            let mut req = request.into_request();
9983            req.extensions_mut()
9984                .insert(GrpcMethod::new("pidgr.v1.MemberService", "BulkInviteUsers"));
9985            self.inner.unary(req, path, codec).await
9986        }
9987        /** Confirm passkey enrollment after client-side WebAuthn registration.
9988 Verifies the caller has at least one registered credential server-side,
9989 then marks the user as passkey-enrolled in the identity provider.
9990 Authorization: Any authenticated user (self-only, no permission required).
9991*/
9992        pub async fn confirm_passkey_enrollment(
9993            &mut self,
9994            request: impl tonic::IntoRequest<super::ConfirmPasskeyEnrollmentRequest>,
9995        ) -> std::result::Result<
9996            tonic::Response<super::ConfirmPasskeyEnrollmentResponse>,
9997            tonic::Status,
9998        > {
9999            self.inner
10000                .ready()
10001                .await
10002                .map_err(|e| {
10003                    tonic::Status::unknown(
10004                        format!("Service was not ready: {}", e.into()),
10005                    )
10006                })?;
10007            let codec = tonic_prost::ProstCodec::default();
10008            let path = http::uri::PathAndQuery::from_static(
10009                "/pidgr.v1.MemberService/ConfirmPasskeyEnrollment",
10010            );
10011            let mut req = request.into_request();
10012            req.extensions_mut()
10013                .insert(
10014                    GrpcMethod::new("pidgr.v1.MemberService", "ConfirmPasskeyEnrollment"),
10015                );
10016            self.inner.unary(req, path, codec).await
10017        }
10018        /** Update the data governance region for a user. Triggers a data migration
10019 workflow if the region changed. Admin-only operation.
10020 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10021*/
10022        pub async fn update_user_region(
10023            &mut self,
10024            request: impl tonic::IntoRequest<super::UpdateUserRegionRequest>,
10025        ) -> std::result::Result<
10026            tonic::Response<super::UpdateUserRegionResponse>,
10027            tonic::Status,
10028        > {
10029            self.inner
10030                .ready()
10031                .await
10032                .map_err(|e| {
10033                    tonic::Status::unknown(
10034                        format!("Service was not ready: {}", e.into()),
10035                    )
10036                })?;
10037            let codec = tonic_prost::ProstCodec::default();
10038            let path = http::uri::PathAndQuery::from_static(
10039                "/pidgr.v1.MemberService/UpdateUserRegion",
10040            );
10041            let mut req = request.into_request();
10042            req.extensions_mut()
10043                .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserRegion"));
10044            self.inner.unary(req, path, codec).await
10045        }
10046    }
10047}
10048/// Generated server implementations.
10049pub mod member_service_server {
10050    #![allow(
10051        unused_variables,
10052        dead_code,
10053        missing_docs,
10054        clippy::wildcard_imports,
10055        clippy::let_unit_value,
10056    )]
10057    use tonic::codegen::*;
10058    /// Generated trait containing gRPC methods that should be implemented for use with MemberServiceServer.
10059    #[async_trait]
10060    pub trait MemberService: std::marker::Send + std::marker::Sync + 'static {
10061        /** Invite a new user to the organization via email.
10062 Authorization: Requires PERMISSION_MEMBERS_INVITE.
10063*/
10064        async fn invite_user(
10065            &self,
10066            request: tonic::Request<super::InviteUserRequest>,
10067        ) -> std::result::Result<
10068            tonic::Response<super::InviteUserResponse>,
10069            tonic::Status,
10070        >;
10071        /** Retrieve a user by ID within the organization.
10072 Self-lookup (empty user_id) is allowed for any authenticated user.
10073 Authorization: Requires PERMISSION_MEMBERS_READ for other users.
10074*/
10075        async fn get_user(
10076            &self,
10077            request: tonic::Request<super::GetUserRequest>,
10078        ) -> std::result::Result<tonic::Response<super::GetUserResponse>, tonic::Status>;
10079        /** List all users in the organization with pagination.
10080 Authorization: Requires PERMISSION_MEMBERS_READ.
10081*/
10082        async fn list_users(
10083            &self,
10084            request: tonic::Request<super::ListUsersRequest>,
10085        ) -> std::result::Result<
10086            tonic::Response<super::ListUsersResponse>,
10087            tonic::Status,
10088        >;
10089        /** Change a user's role within the organization.
10090 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10091*/
10092        async fn update_user_role(
10093            &self,
10094            request: tonic::Request<super::UpdateUserRoleRequest>,
10095        ) -> std::result::Result<
10096            tonic::Response<super::UpdateUserRoleResponse>,
10097            tonic::Status,
10098        >;
10099        /** Deactivate a user within the organization.
10100 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10101*/
10102        async fn deactivate_user(
10103            &self,
10104            request: tonic::Request<super::DeactivateUserRequest>,
10105        ) -> std::result::Result<
10106            tonic::Response<super::DeactivateUserResponse>,
10107            tonic::Status,
10108        >;
10109        /** Reactivate a deactivated user, restoring their status to INVITED.
10110 The user must complete the invite link flow again to become ACTIVE.
10111 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10112*/
10113        async fn reactivate_user(
10114            &self,
10115            request: tonic::Request<super::ReactivateUserRequest>,
10116        ) -> std::result::Result<
10117            tonic::Response<super::ReactivateUserResponse>,
10118            tonic::Status,
10119        >;
10120        /** Revoke an invitation for a user who has not yet completed registration.
10121 Hard-deletes the user record (INVITED users have no data to preserve).
10122 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10123*/
10124        async fn revoke_invite(
10125            &self,
10126            request: tonic::Request<super::RevokeInviteRequest>,
10127        ) -> std::result::Result<
10128            tonic::Response<super::RevokeInviteResponse>,
10129            tonic::Status,
10130        >;
10131        /** Update a user's profile attributes (department, title, etc.).
10132 Self-update (empty user_id or matching JWT sub) requires no special permission.
10133 Updating another user requires PERMISSION_MEMBERS_MANAGE.
10134*/
10135        async fn update_user_profile(
10136            &self,
10137            request: tonic::Request<super::UpdateUserProfileRequest>,
10138        ) -> std::result::Result<
10139            tonic::Response<super::UpdateUserProfileResponse>,
10140            tonic::Status,
10141        >;
10142        /** Retrieve the caller's platform settings (theme, etc.).
10143 Authorization: Any authenticated user (self-only).
10144*/
10145        async fn get_user_settings(
10146            &self,
10147            request: tonic::Request<super::GetUserSettingsRequest>,
10148        ) -> std::result::Result<
10149            tonic::Response<super::GetUserSettingsResponse>,
10150            tonic::Status,
10151        >;
10152        /** Update the caller's platform settings.
10153 Only fields with non-default values are applied; others are left unchanged.
10154 Authorization: Any authenticated user (self-only).
10155*/
10156        async fn update_user_settings(
10157            &self,
10158            request: tonic::Request<super::UpdateUserSettingsRequest>,
10159        ) -> std::result::Result<
10160            tonic::Response<super::UpdateUserSettingsResponse>,
10161            tonic::Status,
10162        >;
10163        /** Invite multiple users to the organization in a single call.
10164 Emails are deduplicated. Each email is processed independently — individual
10165 failures do not abort the batch. Identity provider calls are parallelized (bounded concurrency).
10166 Authorization: Requires PERMISSION_MEMBERS_INVITE.
10167*/
10168        async fn bulk_invite_users(
10169            &self,
10170            request: tonic::Request<super::BulkInviteUsersRequest>,
10171        ) -> std::result::Result<
10172            tonic::Response<super::BulkInviteUsersResponse>,
10173            tonic::Status,
10174        >;
10175        /** Confirm passkey enrollment after client-side WebAuthn registration.
10176 Verifies the caller has at least one registered credential server-side,
10177 then marks the user as passkey-enrolled in the identity provider.
10178 Authorization: Any authenticated user (self-only, no permission required).
10179*/
10180        async fn confirm_passkey_enrollment(
10181            &self,
10182            request: tonic::Request<super::ConfirmPasskeyEnrollmentRequest>,
10183        ) -> std::result::Result<
10184            tonic::Response<super::ConfirmPasskeyEnrollmentResponse>,
10185            tonic::Status,
10186        >;
10187        /** Update the data governance region for a user. Triggers a data migration
10188 workflow if the region changed. Admin-only operation.
10189 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
10190*/
10191        async fn update_user_region(
10192            &self,
10193            request: tonic::Request<super::UpdateUserRegionRequest>,
10194        ) -> std::result::Result<
10195            tonic::Response<super::UpdateUserRegionResponse>,
10196            tonic::Status,
10197        >;
10198    }
10199    /** Manages members (users) within an organization.
10200 All RPCs operate within the caller's org (extracted from JWT).
10201*/
10202    #[derive(Debug)]
10203    pub struct MemberServiceServer<T> {
10204        inner: Arc<T>,
10205        accept_compression_encodings: EnabledCompressionEncodings,
10206        send_compression_encodings: EnabledCompressionEncodings,
10207        max_decoding_message_size: Option<usize>,
10208        max_encoding_message_size: Option<usize>,
10209    }
10210    impl<T> MemberServiceServer<T> {
10211        pub fn new(inner: T) -> Self {
10212            Self::from_arc(Arc::new(inner))
10213        }
10214        pub fn from_arc(inner: Arc<T>) -> Self {
10215            Self {
10216                inner,
10217                accept_compression_encodings: Default::default(),
10218                send_compression_encodings: Default::default(),
10219                max_decoding_message_size: None,
10220                max_encoding_message_size: None,
10221            }
10222        }
10223        pub fn with_interceptor<F>(
10224            inner: T,
10225            interceptor: F,
10226        ) -> InterceptedService<Self, F>
10227        where
10228            F: tonic::service::Interceptor,
10229        {
10230            InterceptedService::new(Self::new(inner), interceptor)
10231        }
10232        /// Enable decompressing requests with the given encoding.
10233        #[must_use]
10234        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10235            self.accept_compression_encodings.enable(encoding);
10236            self
10237        }
10238        /// Compress responses with the given encoding, if the client supports it.
10239        #[must_use]
10240        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10241            self.send_compression_encodings.enable(encoding);
10242            self
10243        }
10244        /// Limits the maximum size of a decoded message.
10245        ///
10246        /// Default: `4MB`
10247        #[must_use]
10248        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10249            self.max_decoding_message_size = Some(limit);
10250            self
10251        }
10252        /// Limits the maximum size of an encoded message.
10253        ///
10254        /// Default: `usize::MAX`
10255        #[must_use]
10256        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10257            self.max_encoding_message_size = Some(limit);
10258            self
10259        }
10260    }
10261    impl<T, B> tonic::codegen::Service<http::Request<B>> for MemberServiceServer<T>
10262    where
10263        T: MemberService,
10264        B: Body + std::marker::Send + 'static,
10265        B::Error: Into<StdError> + std::marker::Send + 'static,
10266    {
10267        type Response = http::Response<tonic::body::Body>;
10268        type Error = std::convert::Infallible;
10269        type Future = BoxFuture<Self::Response, Self::Error>;
10270        fn poll_ready(
10271            &mut self,
10272            _cx: &mut Context<'_>,
10273        ) -> Poll<std::result::Result<(), Self::Error>> {
10274            Poll::Ready(Ok(()))
10275        }
10276        fn call(&mut self, req: http::Request<B>) -> Self::Future {
10277            match req.uri().path() {
10278                "/pidgr.v1.MemberService/InviteUser" => {
10279                    #[allow(non_camel_case_types)]
10280                    struct InviteUserSvc<T: MemberService>(pub Arc<T>);
10281                    impl<
10282                        T: MemberService,
10283                    > tonic::server::UnaryService<super::InviteUserRequest>
10284                    for InviteUserSvc<T> {
10285                        type Response = super::InviteUserResponse;
10286                        type Future = BoxFuture<
10287                            tonic::Response<Self::Response>,
10288                            tonic::Status,
10289                        >;
10290                        fn call(
10291                            &mut self,
10292                            request: tonic::Request<super::InviteUserRequest>,
10293                        ) -> Self::Future {
10294                            let inner = Arc::clone(&self.0);
10295                            let fut = async move {
10296                                <T as MemberService>::invite_user(&inner, request).await
10297                            };
10298                            Box::pin(fut)
10299                        }
10300                    }
10301                    let accept_compression_encodings = self.accept_compression_encodings;
10302                    let send_compression_encodings = self.send_compression_encodings;
10303                    let max_decoding_message_size = self.max_decoding_message_size;
10304                    let max_encoding_message_size = self.max_encoding_message_size;
10305                    let inner = self.inner.clone();
10306                    let fut = async move {
10307                        let method = InviteUserSvc(inner);
10308                        let codec = tonic_prost::ProstCodec::default();
10309                        let mut grpc = tonic::server::Grpc::new(codec)
10310                            .apply_compression_config(
10311                                accept_compression_encodings,
10312                                send_compression_encodings,
10313                            )
10314                            .apply_max_message_size_config(
10315                                max_decoding_message_size,
10316                                max_encoding_message_size,
10317                            );
10318                        let res = grpc.unary(method, req).await;
10319                        Ok(res)
10320                    };
10321                    Box::pin(fut)
10322                }
10323                "/pidgr.v1.MemberService/GetUser" => {
10324                    #[allow(non_camel_case_types)]
10325                    struct GetUserSvc<T: MemberService>(pub Arc<T>);
10326                    impl<
10327                        T: MemberService,
10328                    > tonic::server::UnaryService<super::GetUserRequest>
10329                    for GetUserSvc<T> {
10330                        type Response = super::GetUserResponse;
10331                        type Future = BoxFuture<
10332                            tonic::Response<Self::Response>,
10333                            tonic::Status,
10334                        >;
10335                        fn call(
10336                            &mut self,
10337                            request: tonic::Request<super::GetUserRequest>,
10338                        ) -> Self::Future {
10339                            let inner = Arc::clone(&self.0);
10340                            let fut = async move {
10341                                <T as MemberService>::get_user(&inner, request).await
10342                            };
10343                            Box::pin(fut)
10344                        }
10345                    }
10346                    let accept_compression_encodings = self.accept_compression_encodings;
10347                    let send_compression_encodings = self.send_compression_encodings;
10348                    let max_decoding_message_size = self.max_decoding_message_size;
10349                    let max_encoding_message_size = self.max_encoding_message_size;
10350                    let inner = self.inner.clone();
10351                    let fut = async move {
10352                        let method = GetUserSvc(inner);
10353                        let codec = tonic_prost::ProstCodec::default();
10354                        let mut grpc = tonic::server::Grpc::new(codec)
10355                            .apply_compression_config(
10356                                accept_compression_encodings,
10357                                send_compression_encodings,
10358                            )
10359                            .apply_max_message_size_config(
10360                                max_decoding_message_size,
10361                                max_encoding_message_size,
10362                            );
10363                        let res = grpc.unary(method, req).await;
10364                        Ok(res)
10365                    };
10366                    Box::pin(fut)
10367                }
10368                "/pidgr.v1.MemberService/ListUsers" => {
10369                    #[allow(non_camel_case_types)]
10370                    struct ListUsersSvc<T: MemberService>(pub Arc<T>);
10371                    impl<
10372                        T: MemberService,
10373                    > tonic::server::UnaryService<super::ListUsersRequest>
10374                    for ListUsersSvc<T> {
10375                        type Response = super::ListUsersResponse;
10376                        type Future = BoxFuture<
10377                            tonic::Response<Self::Response>,
10378                            tonic::Status,
10379                        >;
10380                        fn call(
10381                            &mut self,
10382                            request: tonic::Request<super::ListUsersRequest>,
10383                        ) -> Self::Future {
10384                            let inner = Arc::clone(&self.0);
10385                            let fut = async move {
10386                                <T as MemberService>::list_users(&inner, request).await
10387                            };
10388                            Box::pin(fut)
10389                        }
10390                    }
10391                    let accept_compression_encodings = self.accept_compression_encodings;
10392                    let send_compression_encodings = self.send_compression_encodings;
10393                    let max_decoding_message_size = self.max_decoding_message_size;
10394                    let max_encoding_message_size = self.max_encoding_message_size;
10395                    let inner = self.inner.clone();
10396                    let fut = async move {
10397                        let method = ListUsersSvc(inner);
10398                        let codec = tonic_prost::ProstCodec::default();
10399                        let mut grpc = tonic::server::Grpc::new(codec)
10400                            .apply_compression_config(
10401                                accept_compression_encodings,
10402                                send_compression_encodings,
10403                            )
10404                            .apply_max_message_size_config(
10405                                max_decoding_message_size,
10406                                max_encoding_message_size,
10407                            );
10408                        let res = grpc.unary(method, req).await;
10409                        Ok(res)
10410                    };
10411                    Box::pin(fut)
10412                }
10413                "/pidgr.v1.MemberService/UpdateUserRole" => {
10414                    #[allow(non_camel_case_types)]
10415                    struct UpdateUserRoleSvc<T: MemberService>(pub Arc<T>);
10416                    impl<
10417                        T: MemberService,
10418                    > tonic::server::UnaryService<super::UpdateUserRoleRequest>
10419                    for UpdateUserRoleSvc<T> {
10420                        type Response = super::UpdateUserRoleResponse;
10421                        type Future = BoxFuture<
10422                            tonic::Response<Self::Response>,
10423                            tonic::Status,
10424                        >;
10425                        fn call(
10426                            &mut self,
10427                            request: tonic::Request<super::UpdateUserRoleRequest>,
10428                        ) -> Self::Future {
10429                            let inner = Arc::clone(&self.0);
10430                            let fut = async move {
10431                                <T as MemberService>::update_user_role(&inner, request)
10432                                    .await
10433                            };
10434                            Box::pin(fut)
10435                        }
10436                    }
10437                    let accept_compression_encodings = self.accept_compression_encodings;
10438                    let send_compression_encodings = self.send_compression_encodings;
10439                    let max_decoding_message_size = self.max_decoding_message_size;
10440                    let max_encoding_message_size = self.max_encoding_message_size;
10441                    let inner = self.inner.clone();
10442                    let fut = async move {
10443                        let method = UpdateUserRoleSvc(inner);
10444                        let codec = tonic_prost::ProstCodec::default();
10445                        let mut grpc = tonic::server::Grpc::new(codec)
10446                            .apply_compression_config(
10447                                accept_compression_encodings,
10448                                send_compression_encodings,
10449                            )
10450                            .apply_max_message_size_config(
10451                                max_decoding_message_size,
10452                                max_encoding_message_size,
10453                            );
10454                        let res = grpc.unary(method, req).await;
10455                        Ok(res)
10456                    };
10457                    Box::pin(fut)
10458                }
10459                "/pidgr.v1.MemberService/DeactivateUser" => {
10460                    #[allow(non_camel_case_types)]
10461                    struct DeactivateUserSvc<T: MemberService>(pub Arc<T>);
10462                    impl<
10463                        T: MemberService,
10464                    > tonic::server::UnaryService<super::DeactivateUserRequest>
10465                    for DeactivateUserSvc<T> {
10466                        type Response = super::DeactivateUserResponse;
10467                        type Future = BoxFuture<
10468                            tonic::Response<Self::Response>,
10469                            tonic::Status,
10470                        >;
10471                        fn call(
10472                            &mut self,
10473                            request: tonic::Request<super::DeactivateUserRequest>,
10474                        ) -> Self::Future {
10475                            let inner = Arc::clone(&self.0);
10476                            let fut = async move {
10477                                <T as MemberService>::deactivate_user(&inner, request).await
10478                            };
10479                            Box::pin(fut)
10480                        }
10481                    }
10482                    let accept_compression_encodings = self.accept_compression_encodings;
10483                    let send_compression_encodings = self.send_compression_encodings;
10484                    let max_decoding_message_size = self.max_decoding_message_size;
10485                    let max_encoding_message_size = self.max_encoding_message_size;
10486                    let inner = self.inner.clone();
10487                    let fut = async move {
10488                        let method = DeactivateUserSvc(inner);
10489                        let codec = tonic_prost::ProstCodec::default();
10490                        let mut grpc = tonic::server::Grpc::new(codec)
10491                            .apply_compression_config(
10492                                accept_compression_encodings,
10493                                send_compression_encodings,
10494                            )
10495                            .apply_max_message_size_config(
10496                                max_decoding_message_size,
10497                                max_encoding_message_size,
10498                            );
10499                        let res = grpc.unary(method, req).await;
10500                        Ok(res)
10501                    };
10502                    Box::pin(fut)
10503                }
10504                "/pidgr.v1.MemberService/ReactivateUser" => {
10505                    #[allow(non_camel_case_types)]
10506                    struct ReactivateUserSvc<T: MemberService>(pub Arc<T>);
10507                    impl<
10508                        T: MemberService,
10509                    > tonic::server::UnaryService<super::ReactivateUserRequest>
10510                    for ReactivateUserSvc<T> {
10511                        type Response = super::ReactivateUserResponse;
10512                        type Future = BoxFuture<
10513                            tonic::Response<Self::Response>,
10514                            tonic::Status,
10515                        >;
10516                        fn call(
10517                            &mut self,
10518                            request: tonic::Request<super::ReactivateUserRequest>,
10519                        ) -> Self::Future {
10520                            let inner = Arc::clone(&self.0);
10521                            let fut = async move {
10522                                <T as MemberService>::reactivate_user(&inner, request).await
10523                            };
10524                            Box::pin(fut)
10525                        }
10526                    }
10527                    let accept_compression_encodings = self.accept_compression_encodings;
10528                    let send_compression_encodings = self.send_compression_encodings;
10529                    let max_decoding_message_size = self.max_decoding_message_size;
10530                    let max_encoding_message_size = self.max_encoding_message_size;
10531                    let inner = self.inner.clone();
10532                    let fut = async move {
10533                        let method = ReactivateUserSvc(inner);
10534                        let codec = tonic_prost::ProstCodec::default();
10535                        let mut grpc = tonic::server::Grpc::new(codec)
10536                            .apply_compression_config(
10537                                accept_compression_encodings,
10538                                send_compression_encodings,
10539                            )
10540                            .apply_max_message_size_config(
10541                                max_decoding_message_size,
10542                                max_encoding_message_size,
10543                            );
10544                        let res = grpc.unary(method, req).await;
10545                        Ok(res)
10546                    };
10547                    Box::pin(fut)
10548                }
10549                "/pidgr.v1.MemberService/RevokeInvite" => {
10550                    #[allow(non_camel_case_types)]
10551                    struct RevokeInviteSvc<T: MemberService>(pub Arc<T>);
10552                    impl<
10553                        T: MemberService,
10554                    > tonic::server::UnaryService<super::RevokeInviteRequest>
10555                    for RevokeInviteSvc<T> {
10556                        type Response = super::RevokeInviteResponse;
10557                        type Future = BoxFuture<
10558                            tonic::Response<Self::Response>,
10559                            tonic::Status,
10560                        >;
10561                        fn call(
10562                            &mut self,
10563                            request: tonic::Request<super::RevokeInviteRequest>,
10564                        ) -> Self::Future {
10565                            let inner = Arc::clone(&self.0);
10566                            let fut = async move {
10567                                <T as MemberService>::revoke_invite(&inner, request).await
10568                            };
10569                            Box::pin(fut)
10570                        }
10571                    }
10572                    let accept_compression_encodings = self.accept_compression_encodings;
10573                    let send_compression_encodings = self.send_compression_encodings;
10574                    let max_decoding_message_size = self.max_decoding_message_size;
10575                    let max_encoding_message_size = self.max_encoding_message_size;
10576                    let inner = self.inner.clone();
10577                    let fut = async move {
10578                        let method = RevokeInviteSvc(inner);
10579                        let codec = tonic_prost::ProstCodec::default();
10580                        let mut grpc = tonic::server::Grpc::new(codec)
10581                            .apply_compression_config(
10582                                accept_compression_encodings,
10583                                send_compression_encodings,
10584                            )
10585                            .apply_max_message_size_config(
10586                                max_decoding_message_size,
10587                                max_encoding_message_size,
10588                            );
10589                        let res = grpc.unary(method, req).await;
10590                        Ok(res)
10591                    };
10592                    Box::pin(fut)
10593                }
10594                "/pidgr.v1.MemberService/UpdateUserProfile" => {
10595                    #[allow(non_camel_case_types)]
10596                    struct UpdateUserProfileSvc<T: MemberService>(pub Arc<T>);
10597                    impl<
10598                        T: MemberService,
10599                    > tonic::server::UnaryService<super::UpdateUserProfileRequest>
10600                    for UpdateUserProfileSvc<T> {
10601                        type Response = super::UpdateUserProfileResponse;
10602                        type Future = BoxFuture<
10603                            tonic::Response<Self::Response>,
10604                            tonic::Status,
10605                        >;
10606                        fn call(
10607                            &mut self,
10608                            request: tonic::Request<super::UpdateUserProfileRequest>,
10609                        ) -> Self::Future {
10610                            let inner = Arc::clone(&self.0);
10611                            let fut = async move {
10612                                <T as MemberService>::update_user_profile(&inner, request)
10613                                    .await
10614                            };
10615                            Box::pin(fut)
10616                        }
10617                    }
10618                    let accept_compression_encodings = self.accept_compression_encodings;
10619                    let send_compression_encodings = self.send_compression_encodings;
10620                    let max_decoding_message_size = self.max_decoding_message_size;
10621                    let max_encoding_message_size = self.max_encoding_message_size;
10622                    let inner = self.inner.clone();
10623                    let fut = async move {
10624                        let method = UpdateUserProfileSvc(inner);
10625                        let codec = tonic_prost::ProstCodec::default();
10626                        let mut grpc = tonic::server::Grpc::new(codec)
10627                            .apply_compression_config(
10628                                accept_compression_encodings,
10629                                send_compression_encodings,
10630                            )
10631                            .apply_max_message_size_config(
10632                                max_decoding_message_size,
10633                                max_encoding_message_size,
10634                            );
10635                        let res = grpc.unary(method, req).await;
10636                        Ok(res)
10637                    };
10638                    Box::pin(fut)
10639                }
10640                "/pidgr.v1.MemberService/GetUserSettings" => {
10641                    #[allow(non_camel_case_types)]
10642                    struct GetUserSettingsSvc<T: MemberService>(pub Arc<T>);
10643                    impl<
10644                        T: MemberService,
10645                    > tonic::server::UnaryService<super::GetUserSettingsRequest>
10646                    for GetUserSettingsSvc<T> {
10647                        type Response = super::GetUserSettingsResponse;
10648                        type Future = BoxFuture<
10649                            tonic::Response<Self::Response>,
10650                            tonic::Status,
10651                        >;
10652                        fn call(
10653                            &mut self,
10654                            request: tonic::Request<super::GetUserSettingsRequest>,
10655                        ) -> Self::Future {
10656                            let inner = Arc::clone(&self.0);
10657                            let fut = async move {
10658                                <T as MemberService>::get_user_settings(&inner, request)
10659                                    .await
10660                            };
10661                            Box::pin(fut)
10662                        }
10663                    }
10664                    let accept_compression_encodings = self.accept_compression_encodings;
10665                    let send_compression_encodings = self.send_compression_encodings;
10666                    let max_decoding_message_size = self.max_decoding_message_size;
10667                    let max_encoding_message_size = self.max_encoding_message_size;
10668                    let inner = self.inner.clone();
10669                    let fut = async move {
10670                        let method = GetUserSettingsSvc(inner);
10671                        let codec = tonic_prost::ProstCodec::default();
10672                        let mut grpc = tonic::server::Grpc::new(codec)
10673                            .apply_compression_config(
10674                                accept_compression_encodings,
10675                                send_compression_encodings,
10676                            )
10677                            .apply_max_message_size_config(
10678                                max_decoding_message_size,
10679                                max_encoding_message_size,
10680                            );
10681                        let res = grpc.unary(method, req).await;
10682                        Ok(res)
10683                    };
10684                    Box::pin(fut)
10685                }
10686                "/pidgr.v1.MemberService/UpdateUserSettings" => {
10687                    #[allow(non_camel_case_types)]
10688                    struct UpdateUserSettingsSvc<T: MemberService>(pub Arc<T>);
10689                    impl<
10690                        T: MemberService,
10691                    > tonic::server::UnaryService<super::UpdateUserSettingsRequest>
10692                    for UpdateUserSettingsSvc<T> {
10693                        type Response = super::UpdateUserSettingsResponse;
10694                        type Future = BoxFuture<
10695                            tonic::Response<Self::Response>,
10696                            tonic::Status,
10697                        >;
10698                        fn call(
10699                            &mut self,
10700                            request: tonic::Request<super::UpdateUserSettingsRequest>,
10701                        ) -> Self::Future {
10702                            let inner = Arc::clone(&self.0);
10703                            let fut = async move {
10704                                <T as MemberService>::update_user_settings(&inner, request)
10705                                    .await
10706                            };
10707                            Box::pin(fut)
10708                        }
10709                    }
10710                    let accept_compression_encodings = self.accept_compression_encodings;
10711                    let send_compression_encodings = self.send_compression_encodings;
10712                    let max_decoding_message_size = self.max_decoding_message_size;
10713                    let max_encoding_message_size = self.max_encoding_message_size;
10714                    let inner = self.inner.clone();
10715                    let fut = async move {
10716                        let method = UpdateUserSettingsSvc(inner);
10717                        let codec = tonic_prost::ProstCodec::default();
10718                        let mut grpc = tonic::server::Grpc::new(codec)
10719                            .apply_compression_config(
10720                                accept_compression_encodings,
10721                                send_compression_encodings,
10722                            )
10723                            .apply_max_message_size_config(
10724                                max_decoding_message_size,
10725                                max_encoding_message_size,
10726                            );
10727                        let res = grpc.unary(method, req).await;
10728                        Ok(res)
10729                    };
10730                    Box::pin(fut)
10731                }
10732                "/pidgr.v1.MemberService/BulkInviteUsers" => {
10733                    #[allow(non_camel_case_types)]
10734                    struct BulkInviteUsersSvc<T: MemberService>(pub Arc<T>);
10735                    impl<
10736                        T: MemberService,
10737                    > tonic::server::UnaryService<super::BulkInviteUsersRequest>
10738                    for BulkInviteUsersSvc<T> {
10739                        type Response = super::BulkInviteUsersResponse;
10740                        type Future = BoxFuture<
10741                            tonic::Response<Self::Response>,
10742                            tonic::Status,
10743                        >;
10744                        fn call(
10745                            &mut self,
10746                            request: tonic::Request<super::BulkInviteUsersRequest>,
10747                        ) -> Self::Future {
10748                            let inner = Arc::clone(&self.0);
10749                            let fut = async move {
10750                                <T as MemberService>::bulk_invite_users(&inner, request)
10751                                    .await
10752                            };
10753                            Box::pin(fut)
10754                        }
10755                    }
10756                    let accept_compression_encodings = self.accept_compression_encodings;
10757                    let send_compression_encodings = self.send_compression_encodings;
10758                    let max_decoding_message_size = self.max_decoding_message_size;
10759                    let max_encoding_message_size = self.max_encoding_message_size;
10760                    let inner = self.inner.clone();
10761                    let fut = async move {
10762                        let method = BulkInviteUsersSvc(inner);
10763                        let codec = tonic_prost::ProstCodec::default();
10764                        let mut grpc = tonic::server::Grpc::new(codec)
10765                            .apply_compression_config(
10766                                accept_compression_encodings,
10767                                send_compression_encodings,
10768                            )
10769                            .apply_max_message_size_config(
10770                                max_decoding_message_size,
10771                                max_encoding_message_size,
10772                            );
10773                        let res = grpc.unary(method, req).await;
10774                        Ok(res)
10775                    };
10776                    Box::pin(fut)
10777                }
10778                "/pidgr.v1.MemberService/ConfirmPasskeyEnrollment" => {
10779                    #[allow(non_camel_case_types)]
10780                    struct ConfirmPasskeyEnrollmentSvc<T: MemberService>(pub Arc<T>);
10781                    impl<
10782                        T: MemberService,
10783                    > tonic::server::UnaryService<super::ConfirmPasskeyEnrollmentRequest>
10784                    for ConfirmPasskeyEnrollmentSvc<T> {
10785                        type Response = super::ConfirmPasskeyEnrollmentResponse;
10786                        type Future = BoxFuture<
10787                            tonic::Response<Self::Response>,
10788                            tonic::Status,
10789                        >;
10790                        fn call(
10791                            &mut self,
10792                            request: tonic::Request<
10793                                super::ConfirmPasskeyEnrollmentRequest,
10794                            >,
10795                        ) -> Self::Future {
10796                            let inner = Arc::clone(&self.0);
10797                            let fut = async move {
10798                                <T as MemberService>::confirm_passkey_enrollment(
10799                                        &inner,
10800                                        request,
10801                                    )
10802                                    .await
10803                            };
10804                            Box::pin(fut)
10805                        }
10806                    }
10807                    let accept_compression_encodings = self.accept_compression_encodings;
10808                    let send_compression_encodings = self.send_compression_encodings;
10809                    let max_decoding_message_size = self.max_decoding_message_size;
10810                    let max_encoding_message_size = self.max_encoding_message_size;
10811                    let inner = self.inner.clone();
10812                    let fut = async move {
10813                        let method = ConfirmPasskeyEnrollmentSvc(inner);
10814                        let codec = tonic_prost::ProstCodec::default();
10815                        let mut grpc = tonic::server::Grpc::new(codec)
10816                            .apply_compression_config(
10817                                accept_compression_encodings,
10818                                send_compression_encodings,
10819                            )
10820                            .apply_max_message_size_config(
10821                                max_decoding_message_size,
10822                                max_encoding_message_size,
10823                            );
10824                        let res = grpc.unary(method, req).await;
10825                        Ok(res)
10826                    };
10827                    Box::pin(fut)
10828                }
10829                "/pidgr.v1.MemberService/UpdateUserRegion" => {
10830                    #[allow(non_camel_case_types)]
10831                    struct UpdateUserRegionSvc<T: MemberService>(pub Arc<T>);
10832                    impl<
10833                        T: MemberService,
10834                    > tonic::server::UnaryService<super::UpdateUserRegionRequest>
10835                    for UpdateUserRegionSvc<T> {
10836                        type Response = super::UpdateUserRegionResponse;
10837                        type Future = BoxFuture<
10838                            tonic::Response<Self::Response>,
10839                            tonic::Status,
10840                        >;
10841                        fn call(
10842                            &mut self,
10843                            request: tonic::Request<super::UpdateUserRegionRequest>,
10844                        ) -> Self::Future {
10845                            let inner = Arc::clone(&self.0);
10846                            let fut = async move {
10847                                <T as MemberService>::update_user_region(&inner, request)
10848                                    .await
10849                            };
10850                            Box::pin(fut)
10851                        }
10852                    }
10853                    let accept_compression_encodings = self.accept_compression_encodings;
10854                    let send_compression_encodings = self.send_compression_encodings;
10855                    let max_decoding_message_size = self.max_decoding_message_size;
10856                    let max_encoding_message_size = self.max_encoding_message_size;
10857                    let inner = self.inner.clone();
10858                    let fut = async move {
10859                        let method = UpdateUserRegionSvc(inner);
10860                        let codec = tonic_prost::ProstCodec::default();
10861                        let mut grpc = tonic::server::Grpc::new(codec)
10862                            .apply_compression_config(
10863                                accept_compression_encodings,
10864                                send_compression_encodings,
10865                            )
10866                            .apply_max_message_size_config(
10867                                max_decoding_message_size,
10868                                max_encoding_message_size,
10869                            );
10870                        let res = grpc.unary(method, req).await;
10871                        Ok(res)
10872                    };
10873                    Box::pin(fut)
10874                }
10875                _ => {
10876                    Box::pin(async move {
10877                        let mut response = http::Response::new(
10878                            tonic::body::Body::default(),
10879                        );
10880                        let headers = response.headers_mut();
10881                        headers
10882                            .insert(
10883                                tonic::Status::GRPC_STATUS,
10884                                (tonic::Code::Unimplemented as i32).into(),
10885                            );
10886                        headers
10887                            .insert(
10888                                http::header::CONTENT_TYPE,
10889                                tonic::metadata::GRPC_CONTENT_TYPE,
10890                            );
10891                        Ok(response)
10892                    })
10893                }
10894            }
10895        }
10896    }
10897    impl<T> Clone for MemberServiceServer<T> {
10898        fn clone(&self) -> Self {
10899            let inner = self.inner.clone();
10900            Self {
10901                inner,
10902                accept_compression_encodings: self.accept_compression_encodings,
10903                send_compression_encodings: self.send_compression_encodings,
10904                max_decoding_message_size: self.max_decoding_message_size,
10905                max_encoding_message_size: self.max_encoding_message_size,
10906            }
10907        }
10908    }
10909    /// Generated gRPC service name
10910    pub const SERVICE_NAME: &str = "pidgr.v1.MemberService";
10911    impl<T> tonic::server::NamedService for MemberServiceServer<T> {
10912        const NAME: &'static str = SERVICE_NAME;
10913    }
10914}
10915/// Generated client implementations.
10916pub mod org_security_keys_service_client {
10917    #![allow(
10918        unused_variables,
10919        dead_code,
10920        missing_docs,
10921        clippy::wildcard_imports,
10922        clippy::let_unit_value,
10923    )]
10924    use tonic::codegen::*;
10925    use tonic::codegen::http::Uri;
10926    /** OrgSecurityKeysService exposes per-org secret key material to internal
10927 services that need it for HMAC computation, signature verification, or
10928 envelope-key derivation.
10929
10930 AUTH: INTERNAL-mTLS ONLY. Every RPC on this service returns raw key
10931 material. The server MUST require a client certificate from a known
10932 internal service (allowlisted by subject DN) and MUST reject any request
10933 presenting only a JWT. The service MUST NOT be exposed on the public ALB.
10934
10935 Callers (today: pidgr-integrations) cache returned peppers in-process
10936 keyed on (org_id, purpose, version) with a short TTL (≤ 5 minutes) to
10937 keep dispatch hot-path latency bounded.
10938*/
10939    #[derive(Debug, Clone)]
10940    pub struct OrgSecurityKeysServiceClient<T> {
10941        inner: tonic::client::Grpc<T>,
10942    }
10943    impl OrgSecurityKeysServiceClient<tonic::transport::Channel> {
10944        /// Attempt to create a new client by connecting to a given endpoint.
10945        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
10946        where
10947            D: TryInto<tonic::transport::Endpoint>,
10948            D::Error: Into<StdError>,
10949        {
10950            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
10951            Ok(Self::new(conn))
10952        }
10953    }
10954    impl<T> OrgSecurityKeysServiceClient<T>
10955    where
10956        T: tonic::client::GrpcService<tonic::body::Body>,
10957        T::Error: Into<StdError>,
10958        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
10959        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
10960    {
10961        pub fn new(inner: T) -> Self {
10962            let inner = tonic::client::Grpc::new(inner);
10963            Self { inner }
10964        }
10965        pub fn with_origin(inner: T, origin: Uri) -> Self {
10966            let inner = tonic::client::Grpc::with_origin(inner, origin);
10967            Self { inner }
10968        }
10969        pub fn with_interceptor<F>(
10970            inner: T,
10971            interceptor: F,
10972        ) -> OrgSecurityKeysServiceClient<InterceptedService<T, F>>
10973        where
10974            F: tonic::service::Interceptor,
10975            T::ResponseBody: Default,
10976            T: tonic::codegen::Service<
10977                http::Request<tonic::body::Body>,
10978                Response = http::Response<
10979                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
10980                >,
10981            >,
10982            <T as tonic::codegen::Service<
10983                http::Request<tonic::body::Body>,
10984            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
10985        {
10986            OrgSecurityKeysServiceClient::new(
10987                InterceptedService::new(inner, interceptor),
10988            )
10989        }
10990        /// Compress requests with the given encoding.
10991        ///
10992        /// This requires the server to support it otherwise it might respond with an
10993        /// error.
10994        #[must_use]
10995        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10996            self.inner = self.inner.send_compressed(encoding);
10997            self
10998        }
10999        /// Enable decompressing responses.
11000        #[must_use]
11001        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11002            self.inner = self.inner.accept_compressed(encoding);
11003            self
11004        }
11005        /// Limits the maximum size of a decoded message.
11006        ///
11007        /// Default: `4MB`
11008        #[must_use]
11009        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11010            self.inner = self.inner.max_decoding_message_size(limit);
11011            self
11012        }
11013        /// Limits the maximum size of an encoded message.
11014        ///
11015        /// Default: `usize::MAX`
11016        #[must_use]
11017        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11018            self.inner = self.inner.max_encoding_message_size(limit);
11019            self
11020        }
11021        /** Return all non-retired pepper versions for one (org_id, purpose). Used
11022 by pidgr-integrations to compute `identifier_lookup_hash_v1` /
11023 `identifier_lookup_hash_v2` during pepper-rotation overlap windows.
11024*/
11025        pub async fn get_peppers(
11026            &mut self,
11027            request: impl tonic::IntoRequest<super::GetPeppersRequest>,
11028        ) -> std::result::Result<
11029            tonic::Response<super::GetPeppersResponse>,
11030            tonic::Status,
11031        > {
11032            self.inner
11033                .ready()
11034                .await
11035                .map_err(|e| {
11036                    tonic::Status::unknown(
11037                        format!("Service was not ready: {}", e.into()),
11038                    )
11039                })?;
11040            let codec = tonic_prost::ProstCodec::default();
11041            let path = http::uri::PathAndQuery::from_static(
11042                "/pidgr.v1.OrgSecurityKeysService/GetPeppers",
11043            );
11044            let mut req = request.into_request();
11045            req.extensions_mut()
11046                .insert(
11047                    GrpcMethod::new("pidgr.v1.OrgSecurityKeysService", "GetPeppers"),
11048                );
11049            self.inner.unary(req, path, codec).await
11050        }
11051    }
11052}
11053/// Generated server implementations.
11054pub mod org_security_keys_service_server {
11055    #![allow(
11056        unused_variables,
11057        dead_code,
11058        missing_docs,
11059        clippy::wildcard_imports,
11060        clippy::let_unit_value,
11061    )]
11062    use tonic::codegen::*;
11063    /// Generated trait containing gRPC methods that should be implemented for use with OrgSecurityKeysServiceServer.
11064    #[async_trait]
11065    pub trait OrgSecurityKeysService: std::marker::Send + std::marker::Sync + 'static {
11066        /** Return all non-retired pepper versions for one (org_id, purpose). Used
11067 by pidgr-integrations to compute `identifier_lookup_hash_v1` /
11068 `identifier_lookup_hash_v2` during pepper-rotation overlap windows.
11069*/
11070        async fn get_peppers(
11071            &self,
11072            request: tonic::Request<super::GetPeppersRequest>,
11073        ) -> std::result::Result<
11074            tonic::Response<super::GetPeppersResponse>,
11075            tonic::Status,
11076        >;
11077    }
11078    /** OrgSecurityKeysService exposes per-org secret key material to internal
11079 services that need it for HMAC computation, signature verification, or
11080 envelope-key derivation.
11081
11082 AUTH: INTERNAL-mTLS ONLY. Every RPC on this service returns raw key
11083 material. The server MUST require a client certificate from a known
11084 internal service (allowlisted by subject DN) and MUST reject any request
11085 presenting only a JWT. The service MUST NOT be exposed on the public ALB.
11086
11087 Callers (today: pidgr-integrations) cache returned peppers in-process
11088 keyed on (org_id, purpose, version) with a short TTL (≤ 5 minutes) to
11089 keep dispatch hot-path latency bounded.
11090*/
11091    #[derive(Debug)]
11092    pub struct OrgSecurityKeysServiceServer<T> {
11093        inner: Arc<T>,
11094        accept_compression_encodings: EnabledCompressionEncodings,
11095        send_compression_encodings: EnabledCompressionEncodings,
11096        max_decoding_message_size: Option<usize>,
11097        max_encoding_message_size: Option<usize>,
11098    }
11099    impl<T> OrgSecurityKeysServiceServer<T> {
11100        pub fn new(inner: T) -> Self {
11101            Self::from_arc(Arc::new(inner))
11102        }
11103        pub fn from_arc(inner: Arc<T>) -> Self {
11104            Self {
11105                inner,
11106                accept_compression_encodings: Default::default(),
11107                send_compression_encodings: Default::default(),
11108                max_decoding_message_size: None,
11109                max_encoding_message_size: None,
11110            }
11111        }
11112        pub fn with_interceptor<F>(
11113            inner: T,
11114            interceptor: F,
11115        ) -> InterceptedService<Self, F>
11116        where
11117            F: tonic::service::Interceptor,
11118        {
11119            InterceptedService::new(Self::new(inner), interceptor)
11120        }
11121        /// Enable decompressing requests with the given encoding.
11122        #[must_use]
11123        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11124            self.accept_compression_encodings.enable(encoding);
11125            self
11126        }
11127        /// Compress responses with the given encoding, if the client supports it.
11128        #[must_use]
11129        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11130            self.send_compression_encodings.enable(encoding);
11131            self
11132        }
11133        /// Limits the maximum size of a decoded message.
11134        ///
11135        /// Default: `4MB`
11136        #[must_use]
11137        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11138            self.max_decoding_message_size = Some(limit);
11139            self
11140        }
11141        /// Limits the maximum size of an encoded message.
11142        ///
11143        /// Default: `usize::MAX`
11144        #[must_use]
11145        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11146            self.max_encoding_message_size = Some(limit);
11147            self
11148        }
11149    }
11150    impl<T, B> tonic::codegen::Service<http::Request<B>>
11151    for OrgSecurityKeysServiceServer<T>
11152    where
11153        T: OrgSecurityKeysService,
11154        B: Body + std::marker::Send + 'static,
11155        B::Error: Into<StdError> + std::marker::Send + 'static,
11156    {
11157        type Response = http::Response<tonic::body::Body>;
11158        type Error = std::convert::Infallible;
11159        type Future = BoxFuture<Self::Response, Self::Error>;
11160        fn poll_ready(
11161            &mut self,
11162            _cx: &mut Context<'_>,
11163        ) -> Poll<std::result::Result<(), Self::Error>> {
11164            Poll::Ready(Ok(()))
11165        }
11166        fn call(&mut self, req: http::Request<B>) -> Self::Future {
11167            match req.uri().path() {
11168                "/pidgr.v1.OrgSecurityKeysService/GetPeppers" => {
11169                    #[allow(non_camel_case_types)]
11170                    struct GetPeppersSvc<T: OrgSecurityKeysService>(pub Arc<T>);
11171                    impl<
11172                        T: OrgSecurityKeysService,
11173                    > tonic::server::UnaryService<super::GetPeppersRequest>
11174                    for GetPeppersSvc<T> {
11175                        type Response = super::GetPeppersResponse;
11176                        type Future = BoxFuture<
11177                            tonic::Response<Self::Response>,
11178                            tonic::Status,
11179                        >;
11180                        fn call(
11181                            &mut self,
11182                            request: tonic::Request<super::GetPeppersRequest>,
11183                        ) -> Self::Future {
11184                            let inner = Arc::clone(&self.0);
11185                            let fut = async move {
11186                                <T as OrgSecurityKeysService>::get_peppers(&inner, request)
11187                                    .await
11188                            };
11189                            Box::pin(fut)
11190                        }
11191                    }
11192                    let accept_compression_encodings = self.accept_compression_encodings;
11193                    let send_compression_encodings = self.send_compression_encodings;
11194                    let max_decoding_message_size = self.max_decoding_message_size;
11195                    let max_encoding_message_size = self.max_encoding_message_size;
11196                    let inner = self.inner.clone();
11197                    let fut = async move {
11198                        let method = GetPeppersSvc(inner);
11199                        let codec = tonic_prost::ProstCodec::default();
11200                        let mut grpc = tonic::server::Grpc::new(codec)
11201                            .apply_compression_config(
11202                                accept_compression_encodings,
11203                                send_compression_encodings,
11204                            )
11205                            .apply_max_message_size_config(
11206                                max_decoding_message_size,
11207                                max_encoding_message_size,
11208                            );
11209                        let res = grpc.unary(method, req).await;
11210                        Ok(res)
11211                    };
11212                    Box::pin(fut)
11213                }
11214                _ => {
11215                    Box::pin(async move {
11216                        let mut response = http::Response::new(
11217                            tonic::body::Body::default(),
11218                        );
11219                        let headers = response.headers_mut();
11220                        headers
11221                            .insert(
11222                                tonic::Status::GRPC_STATUS,
11223                                (tonic::Code::Unimplemented as i32).into(),
11224                            );
11225                        headers
11226                            .insert(
11227                                http::header::CONTENT_TYPE,
11228                                tonic::metadata::GRPC_CONTENT_TYPE,
11229                            );
11230                        Ok(response)
11231                    })
11232                }
11233            }
11234        }
11235    }
11236    impl<T> Clone for OrgSecurityKeysServiceServer<T> {
11237        fn clone(&self) -> Self {
11238            let inner = self.inner.clone();
11239            Self {
11240                inner,
11241                accept_compression_encodings: self.accept_compression_encodings,
11242                send_compression_encodings: self.send_compression_encodings,
11243                max_decoding_message_size: self.max_decoding_message_size,
11244                max_encoding_message_size: self.max_encoding_message_size,
11245            }
11246        }
11247    }
11248    /// Generated gRPC service name
11249    pub const SERVICE_NAME: &str = "pidgr.v1.OrgSecurityKeysService";
11250    impl<T> tonic::server::NamedService for OrgSecurityKeysServiceServer<T> {
11251        const NAME: &'static str = SERVICE_NAME;
11252    }
11253}
11254/// Generated client implementations.
11255pub mod organization_service_client {
11256    #![allow(
11257        unused_variables,
11258        dead_code,
11259        missing_docs,
11260        clippy::wildcard_imports,
11261        clippy::let_unit_value,
11262    )]
11263    use tonic::codegen::*;
11264    use tonic::codegen::http::Uri;
11265    /** Manages organizations (tenants) in the Pidgr platform.
11266 Most RPCs operate within the caller's org (extracted from JWT).
11267 CreateOrganization supports API key auth or JWT auth (self-service onboarding).
11268*/
11269    #[derive(Debug, Clone)]
11270    pub struct OrganizationServiceClient<T> {
11271        inner: tonic::client::Grpc<T>,
11272    }
11273    impl OrganizationServiceClient<tonic::transport::Channel> {
11274        /// Attempt to create a new client by connecting to a given endpoint.
11275        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
11276        where
11277            D: TryInto<tonic::transport::Endpoint>,
11278            D::Error: Into<StdError>,
11279        {
11280            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
11281            Ok(Self::new(conn))
11282        }
11283    }
11284    impl<T> OrganizationServiceClient<T>
11285    where
11286        T: tonic::client::GrpcService<tonic::body::Body>,
11287        T::Error: Into<StdError>,
11288        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
11289        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
11290    {
11291        pub fn new(inner: T) -> Self {
11292            let inner = tonic::client::Grpc::new(inner);
11293            Self { inner }
11294        }
11295        pub fn with_origin(inner: T, origin: Uri) -> Self {
11296            let inner = tonic::client::Grpc::with_origin(inner, origin);
11297            Self { inner }
11298        }
11299        pub fn with_interceptor<F>(
11300            inner: T,
11301            interceptor: F,
11302        ) -> OrganizationServiceClient<InterceptedService<T, F>>
11303        where
11304            F: tonic::service::Interceptor,
11305            T::ResponseBody: Default,
11306            T: tonic::codegen::Service<
11307                http::Request<tonic::body::Body>,
11308                Response = http::Response<
11309                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
11310                >,
11311            >,
11312            <T as tonic::codegen::Service<
11313                http::Request<tonic::body::Body>,
11314            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
11315        {
11316            OrganizationServiceClient::new(InterceptedService::new(inner, interceptor))
11317        }
11318        /// Compress requests with the given encoding.
11319        ///
11320        /// This requires the server to support it otherwise it might respond with an
11321        /// error.
11322        #[must_use]
11323        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11324            self.inner = self.inner.send_compressed(encoding);
11325            self
11326        }
11327        /// Enable decompressing responses.
11328        #[must_use]
11329        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11330            self.inner = self.inner.accept_compressed(encoding);
11331            self
11332        }
11333        /// Limits the maximum size of a decoded message.
11334        ///
11335        /// Default: `4MB`
11336        #[must_use]
11337        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11338            self.inner = self.inner.max_decoding_message_size(limit);
11339            self
11340        }
11341        /// Limits the maximum size of an encoded message.
11342        ///
11343        /// Default: `usize::MAX`
11344        #[must_use]
11345        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11346            self.inner = self.inner.max_encoding_message_size(limit);
11347            self
11348        }
11349        /** Create a new organization. JWT auth only — the caller becomes the initial
11350 admin. Add further admins via CreateInviteLink.
11351 Authorization: Authenticated user (no specific permission required).
11352*/
11353        pub async fn create_organization(
11354            &mut self,
11355            request: impl tonic::IntoRequest<super::CreateOrganizationRequest>,
11356        ) -> std::result::Result<
11357            tonic::Response<super::CreateOrganizationResponse>,
11358            tonic::Status,
11359        > {
11360            self.inner
11361                .ready()
11362                .await
11363                .map_err(|e| {
11364                    tonic::Status::unknown(
11365                        format!("Service was not ready: {}", e.into()),
11366                    )
11367                })?;
11368            let codec = tonic_prost::ProstCodec::default();
11369            let path = http::uri::PathAndQuery::from_static(
11370                "/pidgr.v1.OrganizationService/CreateOrganization",
11371            );
11372            let mut req = request.into_request();
11373            req.extensions_mut()
11374                .insert(
11375                    GrpcMethod::new("pidgr.v1.OrganizationService", "CreateOrganization"),
11376                );
11377            self.inner.unary(req, path, codec).await
11378        }
11379        /** Retrieve the organization for the authenticated user.
11380 Authorization: Requires PERMISSION_ORG_READ.
11381*/
11382        pub async fn get_organization(
11383            &mut self,
11384            request: impl tonic::IntoRequest<super::GetOrganizationRequest>,
11385        ) -> std::result::Result<
11386            tonic::Response<super::GetOrganizationResponse>,
11387            tonic::Status,
11388        > {
11389            self.inner
11390                .ready()
11391                .await
11392                .map_err(|e| {
11393                    tonic::Status::unknown(
11394                        format!("Service was not ready: {}", e.into()),
11395                    )
11396                })?;
11397            let codec = tonic_prost::ProstCodec::default();
11398            let path = http::uri::PathAndQuery::from_static(
11399                "/pidgr.v1.OrganizationService/GetOrganization",
11400            );
11401            let mut req = request.into_request();
11402            req.extensions_mut()
11403                .insert(
11404                    GrpcMethod::new("pidgr.v1.OrganizationService", "GetOrganization"),
11405                );
11406            self.inner.unary(req, path, codec).await
11407        }
11408        /** Update organization settings (name, default workflow, industry, company size).
11409 Authorization: Requires PERMISSION_ORG_WRITE.
11410*/
11411        pub async fn update_organization(
11412            &mut self,
11413            request: impl tonic::IntoRequest<super::UpdateOrganizationRequest>,
11414        ) -> std::result::Result<
11415            tonic::Response<super::UpdateOrganizationResponse>,
11416            tonic::Status,
11417        > {
11418            self.inner
11419                .ready()
11420                .await
11421                .map_err(|e| {
11422                    tonic::Status::unknown(
11423                        format!("Service was not ready: {}", e.into()),
11424                    )
11425                })?;
11426            let codec = tonic_prost::ProstCodec::default();
11427            let path = http::uri::PathAndQuery::from_static(
11428                "/pidgr.v1.OrganizationService/UpdateOrganization",
11429            );
11430            let mut req = request.into_request();
11431            req.extensions_mut()
11432                .insert(
11433                    GrpcMethod::new("pidgr.v1.OrganizationService", "UpdateOrganization"),
11434                );
11435            self.inner.unary(req, path, codec).await
11436        }
11437        /** Replace all SSO attribute mappings for the organization.
11438 Authorization: Requires PERMISSION_ORG_WRITE.
11439*/
11440        pub async fn update_sso_attribute_mappings(
11441            &mut self,
11442            request: impl tonic::IntoRequest<super::UpdateSsoAttributeMappingsRequest>,
11443        ) -> std::result::Result<
11444            tonic::Response<super::UpdateSsoAttributeMappingsResponse>,
11445            tonic::Status,
11446        > {
11447            self.inner
11448                .ready()
11449                .await
11450                .map_err(|e| {
11451                    tonic::Status::unknown(
11452                        format!("Service was not ready: {}", e.into()),
11453                    )
11454                })?;
11455            let codec = tonic_prost::ProstCodec::default();
11456            let path = http::uri::PathAndQuery::from_static(
11457                "/pidgr.v1.OrganizationService/UpdateSsoAttributeMappings",
11458            );
11459            let mut req = request.into_request();
11460            req.extensions_mut()
11461                .insert(
11462                    GrpcMethod::new(
11463                        "pidgr.v1.OrganizationService",
11464                        "UpdateSsoAttributeMappings",
11465                    ),
11466                );
11467            self.inner.unary(req, path, codec).await
11468        }
11469        /** Rotate the analytics salt and optionally increase the bucket count for k-anonymization.
11470 Authorization: Requires PERMISSION_PRIVACY_WRITE.
11471*/
11472        pub async fn rotate_analytics_salt(
11473            &mut self,
11474            request: impl tonic::IntoRequest<super::RotateAnalyticsSaltRequest>,
11475        ) -> std::result::Result<
11476            tonic::Response<super::RotateAnalyticsSaltResponse>,
11477            tonic::Status,
11478        > {
11479            self.inner
11480                .ready()
11481                .await
11482                .map_err(|e| {
11483                    tonic::Status::unknown(
11484                        format!("Service was not ready: {}", e.into()),
11485                    )
11486                })?;
11487            let codec = tonic_prost::ProstCodec::default();
11488            let path = http::uri::PathAndQuery::from_static(
11489                "/pidgr.v1.OrganizationService/RotateAnalyticsSalt",
11490            );
11491            let mut req = request.into_request();
11492            req.extensions_mut()
11493                .insert(
11494                    GrpcMethod::new(
11495                        "pidgr.v1.OrganizationService",
11496                        "RotateAnalyticsSalt",
11497                    ),
11498                );
11499            self.inner.unary(req, path, codec).await
11500        }
11501        /** Update the differential privacy epsilon parameter.
11502 Authorization: Requires PERMISSION_PRIVACY_WRITE.
11503*/
11504        pub async fn update_analytics_epsilon(
11505            &mut self,
11506            request: impl tonic::IntoRequest<super::UpdateAnalyticsEpsilonRequest>,
11507        ) -> std::result::Result<
11508            tonic::Response<super::UpdateAnalyticsEpsilonResponse>,
11509            tonic::Status,
11510        > {
11511            self.inner
11512                .ready()
11513                .await
11514                .map_err(|e| {
11515                    tonic::Status::unknown(
11516                        format!("Service was not ready: {}", e.into()),
11517                    )
11518                })?;
11519            let codec = tonic_prost::ProstCodec::default();
11520            let path = http::uri::PathAndQuery::from_static(
11521                "/pidgr.v1.OrganizationService/UpdateAnalyticsEpsilon",
11522            );
11523            let mut req = request.into_request();
11524            req.extensions_mut()
11525                .insert(
11526                    GrpcMethod::new(
11527                        "pidgr.v1.OrganizationService",
11528                        "UpdateAnalyticsEpsilon",
11529                    ),
11530                );
11531            self.inner.unary(req, path, codec).await
11532        }
11533        /** Create a sandbox organization for testing configurations.
11534 Sandbox orgs auto-delete after expires_at. The caller becomes super admin.
11535 Authorization: Any authenticated user. Limited to 3 concurrent sandboxes
11536 per user to prevent abuse.
11537*/
11538        pub async fn create_sandbox_organization(
11539            &mut self,
11540            request: impl tonic::IntoRequest<super::CreateSandboxOrganizationRequest>,
11541        ) -> std::result::Result<
11542            tonic::Response<super::CreateSandboxOrganizationResponse>,
11543            tonic::Status,
11544        > {
11545            self.inner
11546                .ready()
11547                .await
11548                .map_err(|e| {
11549                    tonic::Status::unknown(
11550                        format!("Service was not ready: {}", e.into()),
11551                    )
11552                })?;
11553            let codec = tonic_prost::ProstCodec::default();
11554            let path = http::uri::PathAndQuery::from_static(
11555                "/pidgr.v1.OrganizationService/CreateSandboxOrganization",
11556            );
11557            let mut req = request.into_request();
11558            req.extensions_mut()
11559                .insert(
11560                    GrpcMethod::new(
11561                        "pidgr.v1.OrganizationService",
11562                        "CreateSandboxOrganization",
11563                    ),
11564                );
11565            self.inner.unary(req, path, codec).await
11566        }
11567        /** Delete a sandbox organization immediately. Starts the DeleteOrgWorkflow
11568 which handles cleanup across DB, Cognito, S3, Temporal, and regional
11569 content stores.
11570 Authorization: Super admin of the target sandbox OR its creator.
11571*/
11572        pub async fn delete_sandbox_organization(
11573            &mut self,
11574            request: impl tonic::IntoRequest<super::DeleteSandboxOrganizationRequest>,
11575        ) -> std::result::Result<
11576            tonic::Response<super::DeleteSandboxOrganizationResponse>,
11577            tonic::Status,
11578        > {
11579            self.inner
11580                .ready()
11581                .await
11582                .map_err(|e| {
11583                    tonic::Status::unknown(
11584                        format!("Service was not ready: {}", e.into()),
11585                    )
11586                })?;
11587            let codec = tonic_prost::ProstCodec::default();
11588            let path = http::uri::PathAndQuery::from_static(
11589                "/pidgr.v1.OrganizationService/DeleteSandboxOrganization",
11590            );
11591            let mut req = request.into_request();
11592            req.extensions_mut()
11593                .insert(
11594                    GrpcMethod::new(
11595                        "pidgr.v1.OrganizationService",
11596                        "DeleteSandboxOrganization",
11597                    ),
11598                );
11599            self.inner.unary(req, path, codec).await
11600        }
11601        /** List sandbox fixtures available for seeding new sandbox orgs. The catalog
11602 is backend-owned; admin UI populates the "fill with sample data" checkbox
11603 or dropdown from this response.
11604 Authorization: Any authenticated user.
11605*/
11606        pub async fn list_sandbox_fixtures(
11607            &mut self,
11608            request: impl tonic::IntoRequest<super::ListSandboxFixturesRequest>,
11609        ) -> std::result::Result<
11610            tonic::Response<super::ListSandboxFixturesResponse>,
11611            tonic::Status,
11612        > {
11613            self.inner
11614                .ready()
11615                .await
11616                .map_err(|e| {
11617                    tonic::Status::unknown(
11618                        format!("Service was not ready: {}", e.into()),
11619                    )
11620                })?;
11621            let codec = tonic_prost::ProstCodec::default();
11622            let path = http::uri::PathAndQuery::from_static(
11623                "/pidgr.v1.OrganizationService/ListSandboxFixtures",
11624            );
11625            let mut req = request.into_request();
11626            req.extensions_mut()
11627                .insert(
11628                    GrpcMethod::new(
11629                        "pidgr.v1.OrganizationService",
11630                        "ListSandboxFixtures",
11631                    ),
11632                );
11633            self.inner.unary(req, path, codec).await
11634        }
11635        /** List all organizations the authenticated user belongs to.
11636 Org-exempt: callable without org context (only requires valid JWT).
11637 Used by the admin org switcher to discover available orgs.
11638 Excludes expired sandbox organizations.
11639 Authorization: Authenticated user (no specific permission required).
11640*/
11641        pub async fn list_user_organizations(
11642            &mut self,
11643            request: impl tonic::IntoRequest<super::ListUserOrganizationsRequest>,
11644        ) -> std::result::Result<
11645            tonic::Response<super::ListUserOrganizationsResponse>,
11646            tonic::Status,
11647        > {
11648            self.inner
11649                .ready()
11650                .await
11651                .map_err(|e| {
11652                    tonic::Status::unknown(
11653                        format!("Service was not ready: {}", e.into()),
11654                    )
11655                })?;
11656            let codec = tonic_prost::ProstCodec::default();
11657            let path = http::uri::PathAndQuery::from_static(
11658                "/pidgr.v1.OrganizationService/ListUserOrganizations",
11659            );
11660            let mut req = request.into_request();
11661            req.extensions_mut()
11662                .insert(
11663                    GrpcMethod::new(
11664                        "pidgr.v1.OrganizationService",
11665                        "ListUserOrganizations",
11666                    ),
11667                );
11668            self.inner.unary(req, path, codec).await
11669        }
11670        /** List only the sandbox organizations the authenticated user belongs to.
11671 Org-exempt: callable without org context. The admin UI's /sandboxes
11672 management page is the primary consumer — it's a user-level surface
11673 rather than org-scoped, so this RPC is user-scoped too.
11674 Excludes already-expired sandboxes (pending cleanup).
11675 Authorization: Authenticated user (no specific permission required).
11676*/
11677        pub async fn list_user_sandboxes(
11678            &mut self,
11679            request: impl tonic::IntoRequest<super::ListUserSandboxesRequest>,
11680        ) -> std::result::Result<
11681            tonic::Response<super::ListUserSandboxesResponse>,
11682            tonic::Status,
11683        > {
11684            self.inner
11685                .ready()
11686                .await
11687                .map_err(|e| {
11688                    tonic::Status::unknown(
11689                        format!("Service was not ready: {}", e.into()),
11690                    )
11691                })?;
11692            let codec = tonic_prost::ProstCodec::default();
11693            let path = http::uri::PathAndQuery::from_static(
11694                "/pidgr.v1.OrganizationService/ListUserSandboxes",
11695            );
11696            let mut req = request.into_request();
11697            req.extensions_mut()
11698                .insert(
11699                    GrpcMethod::new("pidgr.v1.OrganizationService", "ListUserSandboxes"),
11700                );
11701            self.inner.unary(req, path, codec).await
11702        }
11703    }
11704}
11705/// Generated server implementations.
11706pub mod organization_service_server {
11707    #![allow(
11708        unused_variables,
11709        dead_code,
11710        missing_docs,
11711        clippy::wildcard_imports,
11712        clippy::let_unit_value,
11713    )]
11714    use tonic::codegen::*;
11715    /// Generated trait containing gRPC methods that should be implemented for use with OrganizationServiceServer.
11716    #[async_trait]
11717    pub trait OrganizationService: std::marker::Send + std::marker::Sync + 'static {
11718        /** Create a new organization. JWT auth only — the caller becomes the initial
11719 admin. Add further admins via CreateInviteLink.
11720 Authorization: Authenticated user (no specific permission required).
11721*/
11722        async fn create_organization(
11723            &self,
11724            request: tonic::Request<super::CreateOrganizationRequest>,
11725        ) -> std::result::Result<
11726            tonic::Response<super::CreateOrganizationResponse>,
11727            tonic::Status,
11728        >;
11729        /** Retrieve the organization for the authenticated user.
11730 Authorization: Requires PERMISSION_ORG_READ.
11731*/
11732        async fn get_organization(
11733            &self,
11734            request: tonic::Request<super::GetOrganizationRequest>,
11735        ) -> std::result::Result<
11736            tonic::Response<super::GetOrganizationResponse>,
11737            tonic::Status,
11738        >;
11739        /** Update organization settings (name, default workflow, industry, company size).
11740 Authorization: Requires PERMISSION_ORG_WRITE.
11741*/
11742        async fn update_organization(
11743            &self,
11744            request: tonic::Request<super::UpdateOrganizationRequest>,
11745        ) -> std::result::Result<
11746            tonic::Response<super::UpdateOrganizationResponse>,
11747            tonic::Status,
11748        >;
11749        /** Replace all SSO attribute mappings for the organization.
11750 Authorization: Requires PERMISSION_ORG_WRITE.
11751*/
11752        async fn update_sso_attribute_mappings(
11753            &self,
11754            request: tonic::Request<super::UpdateSsoAttributeMappingsRequest>,
11755        ) -> std::result::Result<
11756            tonic::Response<super::UpdateSsoAttributeMappingsResponse>,
11757            tonic::Status,
11758        >;
11759        /** Rotate the analytics salt and optionally increase the bucket count for k-anonymization.
11760 Authorization: Requires PERMISSION_PRIVACY_WRITE.
11761*/
11762        async fn rotate_analytics_salt(
11763            &self,
11764            request: tonic::Request<super::RotateAnalyticsSaltRequest>,
11765        ) -> std::result::Result<
11766            tonic::Response<super::RotateAnalyticsSaltResponse>,
11767            tonic::Status,
11768        >;
11769        /** Update the differential privacy epsilon parameter.
11770 Authorization: Requires PERMISSION_PRIVACY_WRITE.
11771*/
11772        async fn update_analytics_epsilon(
11773            &self,
11774            request: tonic::Request<super::UpdateAnalyticsEpsilonRequest>,
11775        ) -> std::result::Result<
11776            tonic::Response<super::UpdateAnalyticsEpsilonResponse>,
11777            tonic::Status,
11778        >;
11779        /** Create a sandbox organization for testing configurations.
11780 Sandbox orgs auto-delete after expires_at. The caller becomes super admin.
11781 Authorization: Any authenticated user. Limited to 3 concurrent sandboxes
11782 per user to prevent abuse.
11783*/
11784        async fn create_sandbox_organization(
11785            &self,
11786            request: tonic::Request<super::CreateSandboxOrganizationRequest>,
11787        ) -> std::result::Result<
11788            tonic::Response<super::CreateSandboxOrganizationResponse>,
11789            tonic::Status,
11790        >;
11791        /** Delete a sandbox organization immediately. Starts the DeleteOrgWorkflow
11792 which handles cleanup across DB, Cognito, S3, Temporal, and regional
11793 content stores.
11794 Authorization: Super admin of the target sandbox OR its creator.
11795*/
11796        async fn delete_sandbox_organization(
11797            &self,
11798            request: tonic::Request<super::DeleteSandboxOrganizationRequest>,
11799        ) -> std::result::Result<
11800            tonic::Response<super::DeleteSandboxOrganizationResponse>,
11801            tonic::Status,
11802        >;
11803        /** List sandbox fixtures available for seeding new sandbox orgs. The catalog
11804 is backend-owned; admin UI populates the "fill with sample data" checkbox
11805 or dropdown from this response.
11806 Authorization: Any authenticated user.
11807*/
11808        async fn list_sandbox_fixtures(
11809            &self,
11810            request: tonic::Request<super::ListSandboxFixturesRequest>,
11811        ) -> std::result::Result<
11812            tonic::Response<super::ListSandboxFixturesResponse>,
11813            tonic::Status,
11814        >;
11815        /** List all organizations the authenticated user belongs to.
11816 Org-exempt: callable without org context (only requires valid JWT).
11817 Used by the admin org switcher to discover available orgs.
11818 Excludes expired sandbox organizations.
11819 Authorization: Authenticated user (no specific permission required).
11820*/
11821        async fn list_user_organizations(
11822            &self,
11823            request: tonic::Request<super::ListUserOrganizationsRequest>,
11824        ) -> std::result::Result<
11825            tonic::Response<super::ListUserOrganizationsResponse>,
11826            tonic::Status,
11827        >;
11828        /** List only the sandbox organizations the authenticated user belongs to.
11829 Org-exempt: callable without org context. The admin UI's /sandboxes
11830 management page is the primary consumer — it's a user-level surface
11831 rather than org-scoped, so this RPC is user-scoped too.
11832 Excludes already-expired sandboxes (pending cleanup).
11833 Authorization: Authenticated user (no specific permission required).
11834*/
11835        async fn list_user_sandboxes(
11836            &self,
11837            request: tonic::Request<super::ListUserSandboxesRequest>,
11838        ) -> std::result::Result<
11839            tonic::Response<super::ListUserSandboxesResponse>,
11840            tonic::Status,
11841        >;
11842    }
11843    /** Manages organizations (tenants) in the Pidgr platform.
11844 Most RPCs operate within the caller's org (extracted from JWT).
11845 CreateOrganization supports API key auth or JWT auth (self-service onboarding).
11846*/
11847    #[derive(Debug)]
11848    pub struct OrganizationServiceServer<T> {
11849        inner: Arc<T>,
11850        accept_compression_encodings: EnabledCompressionEncodings,
11851        send_compression_encodings: EnabledCompressionEncodings,
11852        max_decoding_message_size: Option<usize>,
11853        max_encoding_message_size: Option<usize>,
11854    }
11855    impl<T> OrganizationServiceServer<T> {
11856        pub fn new(inner: T) -> Self {
11857            Self::from_arc(Arc::new(inner))
11858        }
11859        pub fn from_arc(inner: Arc<T>) -> Self {
11860            Self {
11861                inner,
11862                accept_compression_encodings: Default::default(),
11863                send_compression_encodings: Default::default(),
11864                max_decoding_message_size: None,
11865                max_encoding_message_size: None,
11866            }
11867        }
11868        pub fn with_interceptor<F>(
11869            inner: T,
11870            interceptor: F,
11871        ) -> InterceptedService<Self, F>
11872        where
11873            F: tonic::service::Interceptor,
11874        {
11875            InterceptedService::new(Self::new(inner), interceptor)
11876        }
11877        /// Enable decompressing requests with the given encoding.
11878        #[must_use]
11879        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11880            self.accept_compression_encodings.enable(encoding);
11881            self
11882        }
11883        /// Compress responses with the given encoding, if the client supports it.
11884        #[must_use]
11885        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11886            self.send_compression_encodings.enable(encoding);
11887            self
11888        }
11889        /// Limits the maximum size of a decoded message.
11890        ///
11891        /// Default: `4MB`
11892        #[must_use]
11893        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11894            self.max_decoding_message_size = Some(limit);
11895            self
11896        }
11897        /// Limits the maximum size of an encoded message.
11898        ///
11899        /// Default: `usize::MAX`
11900        #[must_use]
11901        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11902            self.max_encoding_message_size = Some(limit);
11903            self
11904        }
11905    }
11906    impl<T, B> tonic::codegen::Service<http::Request<B>> for OrganizationServiceServer<T>
11907    where
11908        T: OrganizationService,
11909        B: Body + std::marker::Send + 'static,
11910        B::Error: Into<StdError> + std::marker::Send + 'static,
11911    {
11912        type Response = http::Response<tonic::body::Body>;
11913        type Error = std::convert::Infallible;
11914        type Future = BoxFuture<Self::Response, Self::Error>;
11915        fn poll_ready(
11916            &mut self,
11917            _cx: &mut Context<'_>,
11918        ) -> Poll<std::result::Result<(), Self::Error>> {
11919            Poll::Ready(Ok(()))
11920        }
11921        fn call(&mut self, req: http::Request<B>) -> Self::Future {
11922            match req.uri().path() {
11923                "/pidgr.v1.OrganizationService/CreateOrganization" => {
11924                    #[allow(non_camel_case_types)]
11925                    struct CreateOrganizationSvc<T: OrganizationService>(pub Arc<T>);
11926                    impl<
11927                        T: OrganizationService,
11928                    > tonic::server::UnaryService<super::CreateOrganizationRequest>
11929                    for CreateOrganizationSvc<T> {
11930                        type Response = super::CreateOrganizationResponse;
11931                        type Future = BoxFuture<
11932                            tonic::Response<Self::Response>,
11933                            tonic::Status,
11934                        >;
11935                        fn call(
11936                            &mut self,
11937                            request: tonic::Request<super::CreateOrganizationRequest>,
11938                        ) -> Self::Future {
11939                            let inner = Arc::clone(&self.0);
11940                            let fut = async move {
11941                                <T as OrganizationService>::create_organization(
11942                                        &inner,
11943                                        request,
11944                                    )
11945                                    .await
11946                            };
11947                            Box::pin(fut)
11948                        }
11949                    }
11950                    let accept_compression_encodings = self.accept_compression_encodings;
11951                    let send_compression_encodings = self.send_compression_encodings;
11952                    let max_decoding_message_size = self.max_decoding_message_size;
11953                    let max_encoding_message_size = self.max_encoding_message_size;
11954                    let inner = self.inner.clone();
11955                    let fut = async move {
11956                        let method = CreateOrganizationSvc(inner);
11957                        let codec = tonic_prost::ProstCodec::default();
11958                        let mut grpc = tonic::server::Grpc::new(codec)
11959                            .apply_compression_config(
11960                                accept_compression_encodings,
11961                                send_compression_encodings,
11962                            )
11963                            .apply_max_message_size_config(
11964                                max_decoding_message_size,
11965                                max_encoding_message_size,
11966                            );
11967                        let res = grpc.unary(method, req).await;
11968                        Ok(res)
11969                    };
11970                    Box::pin(fut)
11971                }
11972                "/pidgr.v1.OrganizationService/GetOrganization" => {
11973                    #[allow(non_camel_case_types)]
11974                    struct GetOrganizationSvc<T: OrganizationService>(pub Arc<T>);
11975                    impl<
11976                        T: OrganizationService,
11977                    > tonic::server::UnaryService<super::GetOrganizationRequest>
11978                    for GetOrganizationSvc<T> {
11979                        type Response = super::GetOrganizationResponse;
11980                        type Future = BoxFuture<
11981                            tonic::Response<Self::Response>,
11982                            tonic::Status,
11983                        >;
11984                        fn call(
11985                            &mut self,
11986                            request: tonic::Request<super::GetOrganizationRequest>,
11987                        ) -> Self::Future {
11988                            let inner = Arc::clone(&self.0);
11989                            let fut = async move {
11990                                <T as OrganizationService>::get_organization(
11991                                        &inner,
11992                                        request,
11993                                    )
11994                                    .await
11995                            };
11996                            Box::pin(fut)
11997                        }
11998                    }
11999                    let accept_compression_encodings = self.accept_compression_encodings;
12000                    let send_compression_encodings = self.send_compression_encodings;
12001                    let max_decoding_message_size = self.max_decoding_message_size;
12002                    let max_encoding_message_size = self.max_encoding_message_size;
12003                    let inner = self.inner.clone();
12004                    let fut = async move {
12005                        let method = GetOrganizationSvc(inner);
12006                        let codec = tonic_prost::ProstCodec::default();
12007                        let mut grpc = tonic::server::Grpc::new(codec)
12008                            .apply_compression_config(
12009                                accept_compression_encodings,
12010                                send_compression_encodings,
12011                            )
12012                            .apply_max_message_size_config(
12013                                max_decoding_message_size,
12014                                max_encoding_message_size,
12015                            );
12016                        let res = grpc.unary(method, req).await;
12017                        Ok(res)
12018                    };
12019                    Box::pin(fut)
12020                }
12021                "/pidgr.v1.OrganizationService/UpdateOrganization" => {
12022                    #[allow(non_camel_case_types)]
12023                    struct UpdateOrganizationSvc<T: OrganizationService>(pub Arc<T>);
12024                    impl<
12025                        T: OrganizationService,
12026                    > tonic::server::UnaryService<super::UpdateOrganizationRequest>
12027                    for UpdateOrganizationSvc<T> {
12028                        type Response = super::UpdateOrganizationResponse;
12029                        type Future = BoxFuture<
12030                            tonic::Response<Self::Response>,
12031                            tonic::Status,
12032                        >;
12033                        fn call(
12034                            &mut self,
12035                            request: tonic::Request<super::UpdateOrganizationRequest>,
12036                        ) -> Self::Future {
12037                            let inner = Arc::clone(&self.0);
12038                            let fut = async move {
12039                                <T as OrganizationService>::update_organization(
12040                                        &inner,
12041                                        request,
12042                                    )
12043                                    .await
12044                            };
12045                            Box::pin(fut)
12046                        }
12047                    }
12048                    let accept_compression_encodings = self.accept_compression_encodings;
12049                    let send_compression_encodings = self.send_compression_encodings;
12050                    let max_decoding_message_size = self.max_decoding_message_size;
12051                    let max_encoding_message_size = self.max_encoding_message_size;
12052                    let inner = self.inner.clone();
12053                    let fut = async move {
12054                        let method = UpdateOrganizationSvc(inner);
12055                        let codec = tonic_prost::ProstCodec::default();
12056                        let mut grpc = tonic::server::Grpc::new(codec)
12057                            .apply_compression_config(
12058                                accept_compression_encodings,
12059                                send_compression_encodings,
12060                            )
12061                            .apply_max_message_size_config(
12062                                max_decoding_message_size,
12063                                max_encoding_message_size,
12064                            );
12065                        let res = grpc.unary(method, req).await;
12066                        Ok(res)
12067                    };
12068                    Box::pin(fut)
12069                }
12070                "/pidgr.v1.OrganizationService/UpdateSsoAttributeMappings" => {
12071                    #[allow(non_camel_case_types)]
12072                    struct UpdateSsoAttributeMappingsSvc<T: OrganizationService>(
12073                        pub Arc<T>,
12074                    );
12075                    impl<
12076                        T: OrganizationService,
12077                    > tonic::server::UnaryService<
12078                        super::UpdateSsoAttributeMappingsRequest,
12079                    > for UpdateSsoAttributeMappingsSvc<T> {
12080                        type Response = super::UpdateSsoAttributeMappingsResponse;
12081                        type Future = BoxFuture<
12082                            tonic::Response<Self::Response>,
12083                            tonic::Status,
12084                        >;
12085                        fn call(
12086                            &mut self,
12087                            request: tonic::Request<
12088                                super::UpdateSsoAttributeMappingsRequest,
12089                            >,
12090                        ) -> Self::Future {
12091                            let inner = Arc::clone(&self.0);
12092                            let fut = async move {
12093                                <T as OrganizationService>::update_sso_attribute_mappings(
12094                                        &inner,
12095                                        request,
12096                                    )
12097                                    .await
12098                            };
12099                            Box::pin(fut)
12100                        }
12101                    }
12102                    let accept_compression_encodings = self.accept_compression_encodings;
12103                    let send_compression_encodings = self.send_compression_encodings;
12104                    let max_decoding_message_size = self.max_decoding_message_size;
12105                    let max_encoding_message_size = self.max_encoding_message_size;
12106                    let inner = self.inner.clone();
12107                    let fut = async move {
12108                        let method = UpdateSsoAttributeMappingsSvc(inner);
12109                        let codec = tonic_prost::ProstCodec::default();
12110                        let mut grpc = tonic::server::Grpc::new(codec)
12111                            .apply_compression_config(
12112                                accept_compression_encodings,
12113                                send_compression_encodings,
12114                            )
12115                            .apply_max_message_size_config(
12116                                max_decoding_message_size,
12117                                max_encoding_message_size,
12118                            );
12119                        let res = grpc.unary(method, req).await;
12120                        Ok(res)
12121                    };
12122                    Box::pin(fut)
12123                }
12124                "/pidgr.v1.OrganizationService/RotateAnalyticsSalt" => {
12125                    #[allow(non_camel_case_types)]
12126                    struct RotateAnalyticsSaltSvc<T: OrganizationService>(pub Arc<T>);
12127                    impl<
12128                        T: OrganizationService,
12129                    > tonic::server::UnaryService<super::RotateAnalyticsSaltRequest>
12130                    for RotateAnalyticsSaltSvc<T> {
12131                        type Response = super::RotateAnalyticsSaltResponse;
12132                        type Future = BoxFuture<
12133                            tonic::Response<Self::Response>,
12134                            tonic::Status,
12135                        >;
12136                        fn call(
12137                            &mut self,
12138                            request: tonic::Request<super::RotateAnalyticsSaltRequest>,
12139                        ) -> Self::Future {
12140                            let inner = Arc::clone(&self.0);
12141                            let fut = async move {
12142                                <T as OrganizationService>::rotate_analytics_salt(
12143                                        &inner,
12144                                        request,
12145                                    )
12146                                    .await
12147                            };
12148                            Box::pin(fut)
12149                        }
12150                    }
12151                    let accept_compression_encodings = self.accept_compression_encodings;
12152                    let send_compression_encodings = self.send_compression_encodings;
12153                    let max_decoding_message_size = self.max_decoding_message_size;
12154                    let max_encoding_message_size = self.max_encoding_message_size;
12155                    let inner = self.inner.clone();
12156                    let fut = async move {
12157                        let method = RotateAnalyticsSaltSvc(inner);
12158                        let codec = tonic_prost::ProstCodec::default();
12159                        let mut grpc = tonic::server::Grpc::new(codec)
12160                            .apply_compression_config(
12161                                accept_compression_encodings,
12162                                send_compression_encodings,
12163                            )
12164                            .apply_max_message_size_config(
12165                                max_decoding_message_size,
12166                                max_encoding_message_size,
12167                            );
12168                        let res = grpc.unary(method, req).await;
12169                        Ok(res)
12170                    };
12171                    Box::pin(fut)
12172                }
12173                "/pidgr.v1.OrganizationService/UpdateAnalyticsEpsilon" => {
12174                    #[allow(non_camel_case_types)]
12175                    struct UpdateAnalyticsEpsilonSvc<T: OrganizationService>(pub Arc<T>);
12176                    impl<
12177                        T: OrganizationService,
12178                    > tonic::server::UnaryService<super::UpdateAnalyticsEpsilonRequest>
12179                    for UpdateAnalyticsEpsilonSvc<T> {
12180                        type Response = super::UpdateAnalyticsEpsilonResponse;
12181                        type Future = BoxFuture<
12182                            tonic::Response<Self::Response>,
12183                            tonic::Status,
12184                        >;
12185                        fn call(
12186                            &mut self,
12187                            request: tonic::Request<super::UpdateAnalyticsEpsilonRequest>,
12188                        ) -> Self::Future {
12189                            let inner = Arc::clone(&self.0);
12190                            let fut = async move {
12191                                <T as OrganizationService>::update_analytics_epsilon(
12192                                        &inner,
12193                                        request,
12194                                    )
12195                                    .await
12196                            };
12197                            Box::pin(fut)
12198                        }
12199                    }
12200                    let accept_compression_encodings = self.accept_compression_encodings;
12201                    let send_compression_encodings = self.send_compression_encodings;
12202                    let max_decoding_message_size = self.max_decoding_message_size;
12203                    let max_encoding_message_size = self.max_encoding_message_size;
12204                    let inner = self.inner.clone();
12205                    let fut = async move {
12206                        let method = UpdateAnalyticsEpsilonSvc(inner);
12207                        let codec = tonic_prost::ProstCodec::default();
12208                        let mut grpc = tonic::server::Grpc::new(codec)
12209                            .apply_compression_config(
12210                                accept_compression_encodings,
12211                                send_compression_encodings,
12212                            )
12213                            .apply_max_message_size_config(
12214                                max_decoding_message_size,
12215                                max_encoding_message_size,
12216                            );
12217                        let res = grpc.unary(method, req).await;
12218                        Ok(res)
12219                    };
12220                    Box::pin(fut)
12221                }
12222                "/pidgr.v1.OrganizationService/CreateSandboxOrganization" => {
12223                    #[allow(non_camel_case_types)]
12224                    struct CreateSandboxOrganizationSvc<T: OrganizationService>(
12225                        pub Arc<T>,
12226                    );
12227                    impl<
12228                        T: OrganizationService,
12229                    > tonic::server::UnaryService<
12230                        super::CreateSandboxOrganizationRequest,
12231                    > for CreateSandboxOrganizationSvc<T> {
12232                        type Response = super::CreateSandboxOrganizationResponse;
12233                        type Future = BoxFuture<
12234                            tonic::Response<Self::Response>,
12235                            tonic::Status,
12236                        >;
12237                        fn call(
12238                            &mut self,
12239                            request: tonic::Request<
12240                                super::CreateSandboxOrganizationRequest,
12241                            >,
12242                        ) -> Self::Future {
12243                            let inner = Arc::clone(&self.0);
12244                            let fut = async move {
12245                                <T as OrganizationService>::create_sandbox_organization(
12246                                        &inner,
12247                                        request,
12248                                    )
12249                                    .await
12250                            };
12251                            Box::pin(fut)
12252                        }
12253                    }
12254                    let accept_compression_encodings = self.accept_compression_encodings;
12255                    let send_compression_encodings = self.send_compression_encodings;
12256                    let max_decoding_message_size = self.max_decoding_message_size;
12257                    let max_encoding_message_size = self.max_encoding_message_size;
12258                    let inner = self.inner.clone();
12259                    let fut = async move {
12260                        let method = CreateSandboxOrganizationSvc(inner);
12261                        let codec = tonic_prost::ProstCodec::default();
12262                        let mut grpc = tonic::server::Grpc::new(codec)
12263                            .apply_compression_config(
12264                                accept_compression_encodings,
12265                                send_compression_encodings,
12266                            )
12267                            .apply_max_message_size_config(
12268                                max_decoding_message_size,
12269                                max_encoding_message_size,
12270                            );
12271                        let res = grpc.unary(method, req).await;
12272                        Ok(res)
12273                    };
12274                    Box::pin(fut)
12275                }
12276                "/pidgr.v1.OrganizationService/DeleteSandboxOrganization" => {
12277                    #[allow(non_camel_case_types)]
12278                    struct DeleteSandboxOrganizationSvc<T: OrganizationService>(
12279                        pub Arc<T>,
12280                    );
12281                    impl<
12282                        T: OrganizationService,
12283                    > tonic::server::UnaryService<
12284                        super::DeleteSandboxOrganizationRequest,
12285                    > for DeleteSandboxOrganizationSvc<T> {
12286                        type Response = super::DeleteSandboxOrganizationResponse;
12287                        type Future = BoxFuture<
12288                            tonic::Response<Self::Response>,
12289                            tonic::Status,
12290                        >;
12291                        fn call(
12292                            &mut self,
12293                            request: tonic::Request<
12294                                super::DeleteSandboxOrganizationRequest,
12295                            >,
12296                        ) -> Self::Future {
12297                            let inner = Arc::clone(&self.0);
12298                            let fut = async move {
12299                                <T as OrganizationService>::delete_sandbox_organization(
12300                                        &inner,
12301                                        request,
12302                                    )
12303                                    .await
12304                            };
12305                            Box::pin(fut)
12306                        }
12307                    }
12308                    let accept_compression_encodings = self.accept_compression_encodings;
12309                    let send_compression_encodings = self.send_compression_encodings;
12310                    let max_decoding_message_size = self.max_decoding_message_size;
12311                    let max_encoding_message_size = self.max_encoding_message_size;
12312                    let inner = self.inner.clone();
12313                    let fut = async move {
12314                        let method = DeleteSandboxOrganizationSvc(inner);
12315                        let codec = tonic_prost::ProstCodec::default();
12316                        let mut grpc = tonic::server::Grpc::new(codec)
12317                            .apply_compression_config(
12318                                accept_compression_encodings,
12319                                send_compression_encodings,
12320                            )
12321                            .apply_max_message_size_config(
12322                                max_decoding_message_size,
12323                                max_encoding_message_size,
12324                            );
12325                        let res = grpc.unary(method, req).await;
12326                        Ok(res)
12327                    };
12328                    Box::pin(fut)
12329                }
12330                "/pidgr.v1.OrganizationService/ListSandboxFixtures" => {
12331                    #[allow(non_camel_case_types)]
12332                    struct ListSandboxFixturesSvc<T: OrganizationService>(pub Arc<T>);
12333                    impl<
12334                        T: OrganizationService,
12335                    > tonic::server::UnaryService<super::ListSandboxFixturesRequest>
12336                    for ListSandboxFixturesSvc<T> {
12337                        type Response = super::ListSandboxFixturesResponse;
12338                        type Future = BoxFuture<
12339                            tonic::Response<Self::Response>,
12340                            tonic::Status,
12341                        >;
12342                        fn call(
12343                            &mut self,
12344                            request: tonic::Request<super::ListSandboxFixturesRequest>,
12345                        ) -> Self::Future {
12346                            let inner = Arc::clone(&self.0);
12347                            let fut = async move {
12348                                <T as OrganizationService>::list_sandbox_fixtures(
12349                                        &inner,
12350                                        request,
12351                                    )
12352                                    .await
12353                            };
12354                            Box::pin(fut)
12355                        }
12356                    }
12357                    let accept_compression_encodings = self.accept_compression_encodings;
12358                    let send_compression_encodings = self.send_compression_encodings;
12359                    let max_decoding_message_size = self.max_decoding_message_size;
12360                    let max_encoding_message_size = self.max_encoding_message_size;
12361                    let inner = self.inner.clone();
12362                    let fut = async move {
12363                        let method = ListSandboxFixturesSvc(inner);
12364                        let codec = tonic_prost::ProstCodec::default();
12365                        let mut grpc = tonic::server::Grpc::new(codec)
12366                            .apply_compression_config(
12367                                accept_compression_encodings,
12368                                send_compression_encodings,
12369                            )
12370                            .apply_max_message_size_config(
12371                                max_decoding_message_size,
12372                                max_encoding_message_size,
12373                            );
12374                        let res = grpc.unary(method, req).await;
12375                        Ok(res)
12376                    };
12377                    Box::pin(fut)
12378                }
12379                "/pidgr.v1.OrganizationService/ListUserOrganizations" => {
12380                    #[allow(non_camel_case_types)]
12381                    struct ListUserOrganizationsSvc<T: OrganizationService>(pub Arc<T>);
12382                    impl<
12383                        T: OrganizationService,
12384                    > tonic::server::UnaryService<super::ListUserOrganizationsRequest>
12385                    for ListUserOrganizationsSvc<T> {
12386                        type Response = super::ListUserOrganizationsResponse;
12387                        type Future = BoxFuture<
12388                            tonic::Response<Self::Response>,
12389                            tonic::Status,
12390                        >;
12391                        fn call(
12392                            &mut self,
12393                            request: tonic::Request<super::ListUserOrganizationsRequest>,
12394                        ) -> Self::Future {
12395                            let inner = Arc::clone(&self.0);
12396                            let fut = async move {
12397                                <T as OrganizationService>::list_user_organizations(
12398                                        &inner,
12399                                        request,
12400                                    )
12401                                    .await
12402                            };
12403                            Box::pin(fut)
12404                        }
12405                    }
12406                    let accept_compression_encodings = self.accept_compression_encodings;
12407                    let send_compression_encodings = self.send_compression_encodings;
12408                    let max_decoding_message_size = self.max_decoding_message_size;
12409                    let max_encoding_message_size = self.max_encoding_message_size;
12410                    let inner = self.inner.clone();
12411                    let fut = async move {
12412                        let method = ListUserOrganizationsSvc(inner);
12413                        let codec = tonic_prost::ProstCodec::default();
12414                        let mut grpc = tonic::server::Grpc::new(codec)
12415                            .apply_compression_config(
12416                                accept_compression_encodings,
12417                                send_compression_encodings,
12418                            )
12419                            .apply_max_message_size_config(
12420                                max_decoding_message_size,
12421                                max_encoding_message_size,
12422                            );
12423                        let res = grpc.unary(method, req).await;
12424                        Ok(res)
12425                    };
12426                    Box::pin(fut)
12427                }
12428                "/pidgr.v1.OrganizationService/ListUserSandboxes" => {
12429                    #[allow(non_camel_case_types)]
12430                    struct ListUserSandboxesSvc<T: OrganizationService>(pub Arc<T>);
12431                    impl<
12432                        T: OrganizationService,
12433                    > tonic::server::UnaryService<super::ListUserSandboxesRequest>
12434                    for ListUserSandboxesSvc<T> {
12435                        type Response = super::ListUserSandboxesResponse;
12436                        type Future = BoxFuture<
12437                            tonic::Response<Self::Response>,
12438                            tonic::Status,
12439                        >;
12440                        fn call(
12441                            &mut self,
12442                            request: tonic::Request<super::ListUserSandboxesRequest>,
12443                        ) -> Self::Future {
12444                            let inner = Arc::clone(&self.0);
12445                            let fut = async move {
12446                                <T as OrganizationService>::list_user_sandboxes(
12447                                        &inner,
12448                                        request,
12449                                    )
12450                                    .await
12451                            };
12452                            Box::pin(fut)
12453                        }
12454                    }
12455                    let accept_compression_encodings = self.accept_compression_encodings;
12456                    let send_compression_encodings = self.send_compression_encodings;
12457                    let max_decoding_message_size = self.max_decoding_message_size;
12458                    let max_encoding_message_size = self.max_encoding_message_size;
12459                    let inner = self.inner.clone();
12460                    let fut = async move {
12461                        let method = ListUserSandboxesSvc(inner);
12462                        let codec = tonic_prost::ProstCodec::default();
12463                        let mut grpc = tonic::server::Grpc::new(codec)
12464                            .apply_compression_config(
12465                                accept_compression_encodings,
12466                                send_compression_encodings,
12467                            )
12468                            .apply_max_message_size_config(
12469                                max_decoding_message_size,
12470                                max_encoding_message_size,
12471                            );
12472                        let res = grpc.unary(method, req).await;
12473                        Ok(res)
12474                    };
12475                    Box::pin(fut)
12476                }
12477                _ => {
12478                    Box::pin(async move {
12479                        let mut response = http::Response::new(
12480                            tonic::body::Body::default(),
12481                        );
12482                        let headers = response.headers_mut();
12483                        headers
12484                            .insert(
12485                                tonic::Status::GRPC_STATUS,
12486                                (tonic::Code::Unimplemented as i32).into(),
12487                            );
12488                        headers
12489                            .insert(
12490                                http::header::CONTENT_TYPE,
12491                                tonic::metadata::GRPC_CONTENT_TYPE,
12492                            );
12493                        Ok(response)
12494                    })
12495                }
12496            }
12497        }
12498    }
12499    impl<T> Clone for OrganizationServiceServer<T> {
12500        fn clone(&self) -> Self {
12501            let inner = self.inner.clone();
12502            Self {
12503                inner,
12504                accept_compression_encodings: self.accept_compression_encodings,
12505                send_compression_encodings: self.send_compression_encodings,
12506                max_decoding_message_size: self.max_decoding_message_size,
12507                max_encoding_message_size: self.max_encoding_message_size,
12508            }
12509        }
12510    }
12511    /// Generated gRPC service name
12512    pub const SERVICE_NAME: &str = "pidgr.v1.OrganizationService";
12513    impl<T> tonic::server::NamedService for OrganizationServiceServer<T> {
12514        const NAME: &'static str = SERVICE_NAME;
12515    }
12516}
12517/// Generated client implementations.
12518pub mod render_service_client {
12519    #![allow(
12520        unused_variables,
12521        dead_code,
12522        missing_docs,
12523        clippy::wildcard_imports,
12524        clippy::let_unit_value,
12525    )]
12526    use tonic::codegen::*;
12527    use tonic::codegen::http::Uri;
12528    /** Internal service for batch template rendering.
12529*/
12530    #[derive(Debug, Clone)]
12531    pub struct RenderServiceClient<T> {
12532        inner: tonic::client::Grpc<T>,
12533    }
12534    impl RenderServiceClient<tonic::transport::Channel> {
12535        /// Attempt to create a new client by connecting to a given endpoint.
12536        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
12537        where
12538            D: TryInto<tonic::transport::Endpoint>,
12539            D::Error: Into<StdError>,
12540        {
12541            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
12542            Ok(Self::new(conn))
12543        }
12544    }
12545    impl<T> RenderServiceClient<T>
12546    where
12547        T: tonic::client::GrpcService<tonic::body::Body>,
12548        T::Error: Into<StdError>,
12549        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
12550        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
12551    {
12552        pub fn new(inner: T) -> Self {
12553            let inner = tonic::client::Grpc::new(inner);
12554            Self { inner }
12555        }
12556        pub fn with_origin(inner: T, origin: Uri) -> Self {
12557            let inner = tonic::client::Grpc::with_origin(inner, origin);
12558            Self { inner }
12559        }
12560        pub fn with_interceptor<F>(
12561            inner: T,
12562            interceptor: F,
12563        ) -> RenderServiceClient<InterceptedService<T, F>>
12564        where
12565            F: tonic::service::Interceptor,
12566            T::ResponseBody: Default,
12567            T: tonic::codegen::Service<
12568                http::Request<tonic::body::Body>,
12569                Response = http::Response<
12570                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
12571                >,
12572            >,
12573            <T as tonic::codegen::Service<
12574                http::Request<tonic::body::Body>,
12575            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
12576        {
12577            RenderServiceClient::new(InterceptedService::new(inner, interceptor))
12578        }
12579        /// Compress requests with the given encoding.
12580        ///
12581        /// This requires the server to support it otherwise it might respond with an
12582        /// error.
12583        #[must_use]
12584        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
12585            self.inner = self.inner.send_compressed(encoding);
12586            self
12587        }
12588        /// Enable decompressing responses.
12589        #[must_use]
12590        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
12591            self.inner = self.inner.accept_compressed(encoding);
12592            self
12593        }
12594        /// Limits the maximum size of a decoded message.
12595        ///
12596        /// Default: `4MB`
12597        #[must_use]
12598        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
12599            self.inner = self.inner.max_decoding_message_size(limit);
12600            self
12601        }
12602        /// Limits the maximum size of an encoded message.
12603        ///
12604        /// Default: `usize::MAX`
12605        #[must_use]
12606        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
12607            self.inner = self.inner.max_encoding_message_size(limit);
12608            self
12609        }
12610        /** Render a template for multiple users, streaming results as each completes.
12611 Authorization: Internal server-to-server only. Not exposed to external clients.
12612*/
12613        pub async fn render_batch(
12614            &mut self,
12615            request: impl tonic::IntoRequest<super::RenderBatchRequest>,
12616        ) -> std::result::Result<
12617            tonic::Response<tonic::codec::Streaming<super::RenderBatchResponse>>,
12618            tonic::Status,
12619        > {
12620            self.inner
12621                .ready()
12622                .await
12623                .map_err(|e| {
12624                    tonic::Status::unknown(
12625                        format!("Service was not ready: {}", e.into()),
12626                    )
12627                })?;
12628            let codec = tonic_prost::ProstCodec::default();
12629            let path = http::uri::PathAndQuery::from_static(
12630                "/pidgr.v1.RenderService/RenderBatch",
12631            );
12632            let mut req = request.into_request();
12633            req.extensions_mut()
12634                .insert(GrpcMethod::new("pidgr.v1.RenderService", "RenderBatch"));
12635            self.inner.server_streaming(req, path, codec).await
12636        }
12637    }
12638}
12639/// Generated server implementations.
12640pub mod render_service_server {
12641    #![allow(
12642        unused_variables,
12643        dead_code,
12644        missing_docs,
12645        clippy::wildcard_imports,
12646        clippy::let_unit_value,
12647    )]
12648    use tonic::codegen::*;
12649    /// Generated trait containing gRPC methods that should be implemented for use with RenderServiceServer.
12650    #[async_trait]
12651    pub trait RenderService: std::marker::Send + std::marker::Sync + 'static {
12652        /// Server streaming response type for the RenderBatch method.
12653        type RenderBatchStream: tonic::codegen::tokio_stream::Stream<
12654                Item = std::result::Result<super::RenderBatchResponse, tonic::Status>,
12655            >
12656            + std::marker::Send
12657            + 'static;
12658        /** Render a template for multiple users, streaming results as each completes.
12659 Authorization: Internal server-to-server only. Not exposed to external clients.
12660*/
12661        async fn render_batch(
12662            &self,
12663            request: tonic::Request<super::RenderBatchRequest>,
12664        ) -> std::result::Result<
12665            tonic::Response<Self::RenderBatchStream>,
12666            tonic::Status,
12667        >;
12668    }
12669    /** Internal service for batch template rendering.
12670*/
12671    #[derive(Debug)]
12672    pub struct RenderServiceServer<T> {
12673        inner: Arc<T>,
12674        accept_compression_encodings: EnabledCompressionEncodings,
12675        send_compression_encodings: EnabledCompressionEncodings,
12676        max_decoding_message_size: Option<usize>,
12677        max_encoding_message_size: Option<usize>,
12678    }
12679    impl<T> RenderServiceServer<T> {
12680        pub fn new(inner: T) -> Self {
12681            Self::from_arc(Arc::new(inner))
12682        }
12683        pub fn from_arc(inner: Arc<T>) -> Self {
12684            Self {
12685                inner,
12686                accept_compression_encodings: Default::default(),
12687                send_compression_encodings: Default::default(),
12688                max_decoding_message_size: None,
12689                max_encoding_message_size: None,
12690            }
12691        }
12692        pub fn with_interceptor<F>(
12693            inner: T,
12694            interceptor: F,
12695        ) -> InterceptedService<Self, F>
12696        where
12697            F: tonic::service::Interceptor,
12698        {
12699            InterceptedService::new(Self::new(inner), interceptor)
12700        }
12701        /// Enable decompressing requests with the given encoding.
12702        #[must_use]
12703        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
12704            self.accept_compression_encodings.enable(encoding);
12705            self
12706        }
12707        /// Compress responses with the given encoding, if the client supports it.
12708        #[must_use]
12709        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
12710            self.send_compression_encodings.enable(encoding);
12711            self
12712        }
12713        /// Limits the maximum size of a decoded message.
12714        ///
12715        /// Default: `4MB`
12716        #[must_use]
12717        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
12718            self.max_decoding_message_size = Some(limit);
12719            self
12720        }
12721        /// Limits the maximum size of an encoded message.
12722        ///
12723        /// Default: `usize::MAX`
12724        #[must_use]
12725        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
12726            self.max_encoding_message_size = Some(limit);
12727            self
12728        }
12729    }
12730    impl<T, B> tonic::codegen::Service<http::Request<B>> for RenderServiceServer<T>
12731    where
12732        T: RenderService,
12733        B: Body + std::marker::Send + 'static,
12734        B::Error: Into<StdError> + std::marker::Send + 'static,
12735    {
12736        type Response = http::Response<tonic::body::Body>;
12737        type Error = std::convert::Infallible;
12738        type Future = BoxFuture<Self::Response, Self::Error>;
12739        fn poll_ready(
12740            &mut self,
12741            _cx: &mut Context<'_>,
12742        ) -> Poll<std::result::Result<(), Self::Error>> {
12743            Poll::Ready(Ok(()))
12744        }
12745        fn call(&mut self, req: http::Request<B>) -> Self::Future {
12746            match req.uri().path() {
12747                "/pidgr.v1.RenderService/RenderBatch" => {
12748                    #[allow(non_camel_case_types)]
12749                    struct RenderBatchSvc<T: RenderService>(pub Arc<T>);
12750                    impl<
12751                        T: RenderService,
12752                    > tonic::server::ServerStreamingService<super::RenderBatchRequest>
12753                    for RenderBatchSvc<T> {
12754                        type Response = super::RenderBatchResponse;
12755                        type ResponseStream = T::RenderBatchStream;
12756                        type Future = BoxFuture<
12757                            tonic::Response<Self::ResponseStream>,
12758                            tonic::Status,
12759                        >;
12760                        fn call(
12761                            &mut self,
12762                            request: tonic::Request<super::RenderBatchRequest>,
12763                        ) -> Self::Future {
12764                            let inner = Arc::clone(&self.0);
12765                            let fut = async move {
12766                                <T as RenderService>::render_batch(&inner, request).await
12767                            };
12768                            Box::pin(fut)
12769                        }
12770                    }
12771                    let accept_compression_encodings = self.accept_compression_encodings;
12772                    let send_compression_encodings = self.send_compression_encodings;
12773                    let max_decoding_message_size = self.max_decoding_message_size;
12774                    let max_encoding_message_size = self.max_encoding_message_size;
12775                    let inner = self.inner.clone();
12776                    let fut = async move {
12777                        let method = RenderBatchSvc(inner);
12778                        let codec = tonic_prost::ProstCodec::default();
12779                        let mut grpc = tonic::server::Grpc::new(codec)
12780                            .apply_compression_config(
12781                                accept_compression_encodings,
12782                                send_compression_encodings,
12783                            )
12784                            .apply_max_message_size_config(
12785                                max_decoding_message_size,
12786                                max_encoding_message_size,
12787                            );
12788                        let res = grpc.server_streaming(method, req).await;
12789                        Ok(res)
12790                    };
12791                    Box::pin(fut)
12792                }
12793                _ => {
12794                    Box::pin(async move {
12795                        let mut response = http::Response::new(
12796                            tonic::body::Body::default(),
12797                        );
12798                        let headers = response.headers_mut();
12799                        headers
12800                            .insert(
12801                                tonic::Status::GRPC_STATUS,
12802                                (tonic::Code::Unimplemented as i32).into(),
12803                            );
12804                        headers
12805                            .insert(
12806                                http::header::CONTENT_TYPE,
12807                                tonic::metadata::GRPC_CONTENT_TYPE,
12808                            );
12809                        Ok(response)
12810                    })
12811                }
12812            }
12813        }
12814    }
12815    impl<T> Clone for RenderServiceServer<T> {
12816        fn clone(&self) -> Self {
12817            let inner = self.inner.clone();
12818            Self {
12819                inner,
12820                accept_compression_encodings: self.accept_compression_encodings,
12821                send_compression_encodings: self.send_compression_encodings,
12822                max_decoding_message_size: self.max_decoding_message_size,
12823                max_encoding_message_size: self.max_encoding_message_size,
12824            }
12825        }
12826    }
12827    /// Generated gRPC service name
12828    pub const SERVICE_NAME: &str = "pidgr.v1.RenderService";
12829    impl<T> tonic::server::NamedService for RenderServiceServer<T> {
12830        const NAME: &'static str = SERVICE_NAME;
12831    }
12832}
12833/// Generated client implementations.
12834pub mod replay_service_client {
12835    #![allow(
12836        unused_variables,
12837        dead_code,
12838        missing_docs,
12839        clippy::wildcard_imports,
12840        clippy::let_unit_value,
12841    )]
12842    use tonic::codegen::*;
12843    use tonic::codegen::http::Uri;
12844    /** Proxies the analytics provider's session recording API, keeping credentials server-side.
12845 All data is fetched from the analytics provider on demand; no recording data is stored in pidgr.
12846*/
12847    #[derive(Debug, Clone)]
12848    pub struct ReplayServiceClient<T> {
12849        inner: tonic::client::Grpc<T>,
12850    }
12851    impl ReplayServiceClient<tonic::transport::Channel> {
12852        /// Attempt to create a new client by connecting to a given endpoint.
12853        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
12854        where
12855            D: TryInto<tonic::transport::Endpoint>,
12856            D::Error: Into<StdError>,
12857        {
12858            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
12859            Ok(Self::new(conn))
12860        }
12861    }
12862    impl<T> ReplayServiceClient<T>
12863    where
12864        T: tonic::client::GrpcService<tonic::body::Body>,
12865        T::Error: Into<StdError>,
12866        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
12867        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
12868    {
12869        pub fn new(inner: T) -> Self {
12870            let inner = tonic::client::Grpc::new(inner);
12871            Self { inner }
12872        }
12873        pub fn with_origin(inner: T, origin: Uri) -> Self {
12874            let inner = tonic::client::Grpc::with_origin(inner, origin);
12875            Self { inner }
12876        }
12877        pub fn with_interceptor<F>(
12878            inner: T,
12879            interceptor: F,
12880        ) -> ReplayServiceClient<InterceptedService<T, F>>
12881        where
12882            F: tonic::service::Interceptor,
12883            T::ResponseBody: Default,
12884            T: tonic::codegen::Service<
12885                http::Request<tonic::body::Body>,
12886                Response = http::Response<
12887                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
12888                >,
12889            >,
12890            <T as tonic::codegen::Service<
12891                http::Request<tonic::body::Body>,
12892            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
12893        {
12894            ReplayServiceClient::new(InterceptedService::new(inner, interceptor))
12895        }
12896        /// Compress requests with the given encoding.
12897        ///
12898        /// This requires the server to support it otherwise it might respond with an
12899        /// error.
12900        #[must_use]
12901        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
12902            self.inner = self.inner.send_compressed(encoding);
12903            self
12904        }
12905        /// Enable decompressing responses.
12906        #[must_use]
12907        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
12908            self.inner = self.inner.accept_compressed(encoding);
12909            self
12910        }
12911        /// Limits the maximum size of a decoded message.
12912        ///
12913        /// Default: `4MB`
12914        #[must_use]
12915        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
12916            self.inner = self.inner.max_decoding_message_size(limit);
12917            self
12918        }
12919        /// Limits the maximum size of an encoded message.
12920        ///
12921        /// Default: `usize::MAX`
12922        #[must_use]
12923        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
12924            self.inner = self.inner.max_encoding_message_size(limit);
12925            self
12926        }
12927        /** List recent session recordings with optional campaign and time range filters.
12928 Authorization: Requires CAMPAIGNS_READ permission.
12929*/
12930        pub async fn list_session_recordings(
12931            &mut self,
12932            request: impl tonic::IntoRequest<super::ListSessionRecordingsRequest>,
12933        ) -> std::result::Result<
12934            tonic::Response<super::ListSessionRecordingsResponse>,
12935            tonic::Status,
12936        > {
12937            self.inner
12938                .ready()
12939                .await
12940                .map_err(|e| {
12941                    tonic::Status::unknown(
12942                        format!("Service was not ready: {}", e.into()),
12943                    )
12944                })?;
12945            let codec = tonic_prost::ProstCodec::default();
12946            let path = http::uri::PathAndQuery::from_static(
12947                "/pidgr.v1.ReplayService/ListSessionRecordings",
12948            );
12949            let mut req = request.into_request();
12950            req.extensions_mut()
12951                .insert(
12952                    GrpcMethod::new("pidgr.v1.ReplayService", "ListSessionRecordings"),
12953                );
12954            self.inner.unary(req, path, codec).await
12955        }
12956        /** Fetch the full rrweb snapshot data for a single recording.
12957 Authorization: Requires CAMPAIGNS_READ permission.
12958*/
12959        pub async fn get_session_snapshots(
12960            &mut self,
12961            request: impl tonic::IntoRequest<super::GetSessionSnapshotsRequest>,
12962        ) -> std::result::Result<
12963            tonic::Response<super::GetSessionSnapshotsResponse>,
12964            tonic::Status,
12965        > {
12966            self.inner
12967                .ready()
12968                .await
12969                .map_err(|e| {
12970                    tonic::Status::unknown(
12971                        format!("Service was not ready: {}", e.into()),
12972                    )
12973                })?;
12974            let codec = tonic_prost::ProstCodec::default();
12975            let path = http::uri::PathAndQuery::from_static(
12976                "/pidgr.v1.ReplayService/GetSessionSnapshots",
12977            );
12978            let mut req = request.into_request();
12979            req.extensions_mut()
12980                .insert(
12981                    GrpcMethod::new("pidgr.v1.ReplayService", "GetSessionSnapshots"),
12982                );
12983            self.inner.unary(req, path, codec).await
12984        }
12985    }
12986}
12987/// Generated server implementations.
12988pub mod replay_service_server {
12989    #![allow(
12990        unused_variables,
12991        dead_code,
12992        missing_docs,
12993        clippy::wildcard_imports,
12994        clippy::let_unit_value,
12995    )]
12996    use tonic::codegen::*;
12997    /// Generated trait containing gRPC methods that should be implemented for use with ReplayServiceServer.
12998    #[async_trait]
12999    pub trait ReplayService: std::marker::Send + std::marker::Sync + 'static {
13000        /** List recent session recordings with optional campaign and time range filters.
13001 Authorization: Requires CAMPAIGNS_READ permission.
13002*/
13003        async fn list_session_recordings(
13004            &self,
13005            request: tonic::Request<super::ListSessionRecordingsRequest>,
13006        ) -> std::result::Result<
13007            tonic::Response<super::ListSessionRecordingsResponse>,
13008            tonic::Status,
13009        >;
13010        /** Fetch the full rrweb snapshot data for a single recording.
13011 Authorization: Requires CAMPAIGNS_READ permission.
13012*/
13013        async fn get_session_snapshots(
13014            &self,
13015            request: tonic::Request<super::GetSessionSnapshotsRequest>,
13016        ) -> std::result::Result<
13017            tonic::Response<super::GetSessionSnapshotsResponse>,
13018            tonic::Status,
13019        >;
13020    }
13021    /** Proxies the analytics provider's session recording API, keeping credentials server-side.
13022 All data is fetched from the analytics provider on demand; no recording data is stored in pidgr.
13023*/
13024    #[derive(Debug)]
13025    pub struct ReplayServiceServer<T> {
13026        inner: Arc<T>,
13027        accept_compression_encodings: EnabledCompressionEncodings,
13028        send_compression_encodings: EnabledCompressionEncodings,
13029        max_decoding_message_size: Option<usize>,
13030        max_encoding_message_size: Option<usize>,
13031    }
13032    impl<T> ReplayServiceServer<T> {
13033        pub fn new(inner: T) -> Self {
13034            Self::from_arc(Arc::new(inner))
13035        }
13036        pub fn from_arc(inner: Arc<T>) -> Self {
13037            Self {
13038                inner,
13039                accept_compression_encodings: Default::default(),
13040                send_compression_encodings: Default::default(),
13041                max_decoding_message_size: None,
13042                max_encoding_message_size: None,
13043            }
13044        }
13045        pub fn with_interceptor<F>(
13046            inner: T,
13047            interceptor: F,
13048        ) -> InterceptedService<Self, F>
13049        where
13050            F: tonic::service::Interceptor,
13051        {
13052            InterceptedService::new(Self::new(inner), interceptor)
13053        }
13054        /// Enable decompressing requests with the given encoding.
13055        #[must_use]
13056        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13057            self.accept_compression_encodings.enable(encoding);
13058            self
13059        }
13060        /// Compress responses with the given encoding, if the client supports it.
13061        #[must_use]
13062        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13063            self.send_compression_encodings.enable(encoding);
13064            self
13065        }
13066        /// Limits the maximum size of a decoded message.
13067        ///
13068        /// Default: `4MB`
13069        #[must_use]
13070        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13071            self.max_decoding_message_size = Some(limit);
13072            self
13073        }
13074        /// Limits the maximum size of an encoded message.
13075        ///
13076        /// Default: `usize::MAX`
13077        #[must_use]
13078        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13079            self.max_encoding_message_size = Some(limit);
13080            self
13081        }
13082    }
13083    impl<T, B> tonic::codegen::Service<http::Request<B>> for ReplayServiceServer<T>
13084    where
13085        T: ReplayService,
13086        B: Body + std::marker::Send + 'static,
13087        B::Error: Into<StdError> + std::marker::Send + 'static,
13088    {
13089        type Response = http::Response<tonic::body::Body>;
13090        type Error = std::convert::Infallible;
13091        type Future = BoxFuture<Self::Response, Self::Error>;
13092        fn poll_ready(
13093            &mut self,
13094            _cx: &mut Context<'_>,
13095        ) -> Poll<std::result::Result<(), Self::Error>> {
13096            Poll::Ready(Ok(()))
13097        }
13098        fn call(&mut self, req: http::Request<B>) -> Self::Future {
13099            match req.uri().path() {
13100                "/pidgr.v1.ReplayService/ListSessionRecordings" => {
13101                    #[allow(non_camel_case_types)]
13102                    struct ListSessionRecordingsSvc<T: ReplayService>(pub Arc<T>);
13103                    impl<
13104                        T: ReplayService,
13105                    > tonic::server::UnaryService<super::ListSessionRecordingsRequest>
13106                    for ListSessionRecordingsSvc<T> {
13107                        type Response = super::ListSessionRecordingsResponse;
13108                        type Future = BoxFuture<
13109                            tonic::Response<Self::Response>,
13110                            tonic::Status,
13111                        >;
13112                        fn call(
13113                            &mut self,
13114                            request: tonic::Request<super::ListSessionRecordingsRequest>,
13115                        ) -> Self::Future {
13116                            let inner = Arc::clone(&self.0);
13117                            let fut = async move {
13118                                <T as ReplayService>::list_session_recordings(
13119                                        &inner,
13120                                        request,
13121                                    )
13122                                    .await
13123                            };
13124                            Box::pin(fut)
13125                        }
13126                    }
13127                    let accept_compression_encodings = self.accept_compression_encodings;
13128                    let send_compression_encodings = self.send_compression_encodings;
13129                    let max_decoding_message_size = self.max_decoding_message_size;
13130                    let max_encoding_message_size = self.max_encoding_message_size;
13131                    let inner = self.inner.clone();
13132                    let fut = async move {
13133                        let method = ListSessionRecordingsSvc(inner);
13134                        let codec = tonic_prost::ProstCodec::default();
13135                        let mut grpc = tonic::server::Grpc::new(codec)
13136                            .apply_compression_config(
13137                                accept_compression_encodings,
13138                                send_compression_encodings,
13139                            )
13140                            .apply_max_message_size_config(
13141                                max_decoding_message_size,
13142                                max_encoding_message_size,
13143                            );
13144                        let res = grpc.unary(method, req).await;
13145                        Ok(res)
13146                    };
13147                    Box::pin(fut)
13148                }
13149                "/pidgr.v1.ReplayService/GetSessionSnapshots" => {
13150                    #[allow(non_camel_case_types)]
13151                    struct GetSessionSnapshotsSvc<T: ReplayService>(pub Arc<T>);
13152                    impl<
13153                        T: ReplayService,
13154                    > tonic::server::UnaryService<super::GetSessionSnapshotsRequest>
13155                    for GetSessionSnapshotsSvc<T> {
13156                        type Response = super::GetSessionSnapshotsResponse;
13157                        type Future = BoxFuture<
13158                            tonic::Response<Self::Response>,
13159                            tonic::Status,
13160                        >;
13161                        fn call(
13162                            &mut self,
13163                            request: tonic::Request<super::GetSessionSnapshotsRequest>,
13164                        ) -> Self::Future {
13165                            let inner = Arc::clone(&self.0);
13166                            let fut = async move {
13167                                <T as ReplayService>::get_session_snapshots(&inner, request)
13168                                    .await
13169                            };
13170                            Box::pin(fut)
13171                        }
13172                    }
13173                    let accept_compression_encodings = self.accept_compression_encodings;
13174                    let send_compression_encodings = self.send_compression_encodings;
13175                    let max_decoding_message_size = self.max_decoding_message_size;
13176                    let max_encoding_message_size = self.max_encoding_message_size;
13177                    let inner = self.inner.clone();
13178                    let fut = async move {
13179                        let method = GetSessionSnapshotsSvc(inner);
13180                        let codec = tonic_prost::ProstCodec::default();
13181                        let mut grpc = tonic::server::Grpc::new(codec)
13182                            .apply_compression_config(
13183                                accept_compression_encodings,
13184                                send_compression_encodings,
13185                            )
13186                            .apply_max_message_size_config(
13187                                max_decoding_message_size,
13188                                max_encoding_message_size,
13189                            );
13190                        let res = grpc.unary(method, req).await;
13191                        Ok(res)
13192                    };
13193                    Box::pin(fut)
13194                }
13195                _ => {
13196                    Box::pin(async move {
13197                        let mut response = http::Response::new(
13198                            tonic::body::Body::default(),
13199                        );
13200                        let headers = response.headers_mut();
13201                        headers
13202                            .insert(
13203                                tonic::Status::GRPC_STATUS,
13204                                (tonic::Code::Unimplemented as i32).into(),
13205                            );
13206                        headers
13207                            .insert(
13208                                http::header::CONTENT_TYPE,
13209                                tonic::metadata::GRPC_CONTENT_TYPE,
13210                            );
13211                        Ok(response)
13212                    })
13213                }
13214            }
13215        }
13216    }
13217    impl<T> Clone for ReplayServiceServer<T> {
13218        fn clone(&self) -> Self {
13219            let inner = self.inner.clone();
13220            Self {
13221                inner,
13222                accept_compression_encodings: self.accept_compression_encodings,
13223                send_compression_encodings: self.send_compression_encodings,
13224                max_decoding_message_size: self.max_decoding_message_size,
13225                max_encoding_message_size: self.max_encoding_message_size,
13226            }
13227        }
13228    }
13229    /// Generated gRPC service name
13230    pub const SERVICE_NAME: &str = "pidgr.v1.ReplayService";
13231    impl<T> tonic::server::NamedService for ReplayServiceServer<T> {
13232        const NAME: &'static str = SERVICE_NAME;
13233    }
13234}
13235/// Generated client implementations.
13236pub mod role_service_client {
13237    #![allow(
13238        unused_variables,
13239        dead_code,
13240        missing_docs,
13241        clippy::wildcard_imports,
13242        clippy::let_unit_value,
13243    )]
13244    use tonic::codegen::*;
13245    use tonic::codegen::http::Uri;
13246    /** Manages roles and their permissions within an organization.
13247 All RPCs operate within the caller's org (extracted from JWT).
13248*/
13249    #[derive(Debug, Clone)]
13250    pub struct RoleServiceClient<T> {
13251        inner: tonic::client::Grpc<T>,
13252    }
13253    impl RoleServiceClient<tonic::transport::Channel> {
13254        /// Attempt to create a new client by connecting to a given endpoint.
13255        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
13256        where
13257            D: TryInto<tonic::transport::Endpoint>,
13258            D::Error: Into<StdError>,
13259        {
13260            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
13261            Ok(Self::new(conn))
13262        }
13263    }
13264    impl<T> RoleServiceClient<T>
13265    where
13266        T: tonic::client::GrpcService<tonic::body::Body>,
13267        T::Error: Into<StdError>,
13268        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
13269        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
13270    {
13271        pub fn new(inner: T) -> Self {
13272            let inner = tonic::client::Grpc::new(inner);
13273            Self { inner }
13274        }
13275        pub fn with_origin(inner: T, origin: Uri) -> Self {
13276            let inner = tonic::client::Grpc::with_origin(inner, origin);
13277            Self { inner }
13278        }
13279        pub fn with_interceptor<F>(
13280            inner: T,
13281            interceptor: F,
13282        ) -> RoleServiceClient<InterceptedService<T, F>>
13283        where
13284            F: tonic::service::Interceptor,
13285            T::ResponseBody: Default,
13286            T: tonic::codegen::Service<
13287                http::Request<tonic::body::Body>,
13288                Response = http::Response<
13289                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
13290                >,
13291            >,
13292            <T as tonic::codegen::Service<
13293                http::Request<tonic::body::Body>,
13294            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
13295        {
13296            RoleServiceClient::new(InterceptedService::new(inner, interceptor))
13297        }
13298        /// Compress requests with the given encoding.
13299        ///
13300        /// This requires the server to support it otherwise it might respond with an
13301        /// error.
13302        #[must_use]
13303        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13304            self.inner = self.inner.send_compressed(encoding);
13305            self
13306        }
13307        /// Enable decompressing responses.
13308        #[must_use]
13309        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13310            self.inner = self.inner.accept_compressed(encoding);
13311            self
13312        }
13313        /// Limits the maximum size of a decoded message.
13314        ///
13315        /// Default: `4MB`
13316        #[must_use]
13317        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13318            self.inner = self.inner.max_decoding_message_size(limit);
13319            self
13320        }
13321        /// Limits the maximum size of an encoded message.
13322        ///
13323        /// Default: `usize::MAX`
13324        #[must_use]
13325        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13326            self.inner = self.inner.max_encoding_message_size(limit);
13327            self
13328        }
13329        /** List all roles in the organization with their permission sets.
13330 Authorization: Requires PERMISSION_ORG_READ.
13331*/
13332        pub async fn list_roles(
13333            &mut self,
13334            request: impl tonic::IntoRequest<super::ListRolesRequest>,
13335        ) -> std::result::Result<
13336            tonic::Response<super::ListRolesResponse>,
13337            tonic::Status,
13338        > {
13339            self.inner
13340                .ready()
13341                .await
13342                .map_err(|e| {
13343                    tonic::Status::unknown(
13344                        format!("Service was not ready: {}", e.into()),
13345                    )
13346                })?;
13347            let codec = tonic_prost::ProstCodec::default();
13348            let path = http::uri::PathAndQuery::from_static(
13349                "/pidgr.v1.RoleService/ListRoles",
13350            );
13351            let mut req = request.into_request();
13352            req.extensions_mut()
13353                .insert(GrpcMethod::new("pidgr.v1.RoleService", "ListRoles"));
13354            self.inner.unary(req, path, codec).await
13355        }
13356        /** Create a new custom role with a name and initial permissions.
13357 Slug is auto-generated from the name and immutable after creation.
13358 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
13359*/
13360        pub async fn create_role(
13361            &mut self,
13362            request: impl tonic::IntoRequest<super::CreateRoleRequest>,
13363        ) -> std::result::Result<
13364            tonic::Response<super::CreateRoleResponse>,
13365            tonic::Status,
13366        > {
13367            self.inner
13368                .ready()
13369                .await
13370                .map_err(|e| {
13371                    tonic::Status::unknown(
13372                        format!("Service was not ready: {}", e.into()),
13373                    )
13374                })?;
13375            let codec = tonic_prost::ProstCodec::default();
13376            let path = http::uri::PathAndQuery::from_static(
13377                "/pidgr.v1.RoleService/CreateRole",
13378            );
13379            let mut req = request.into_request();
13380            req.extensions_mut()
13381                .insert(GrpcMethod::new("pidgr.v1.RoleService", "CreateRole"));
13382            self.inner.unary(req, path, codec).await
13383        }
13384        /** Update a role's name and/or permissions.
13385 System roles (is_system=true) cannot be updated.
13386 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
13387*/
13388        pub async fn update_role(
13389            &mut self,
13390            request: impl tonic::IntoRequest<super::UpdateRoleRequest>,
13391        ) -> std::result::Result<
13392            tonic::Response<super::UpdateRoleResponse>,
13393            tonic::Status,
13394        > {
13395            self.inner
13396                .ready()
13397                .await
13398                .map_err(|e| {
13399                    tonic::Status::unknown(
13400                        format!("Service was not ready: {}", e.into()),
13401                    )
13402                })?;
13403            let codec = tonic_prost::ProstCodec::default();
13404            let path = http::uri::PathAndQuery::from_static(
13405                "/pidgr.v1.RoleService/UpdateRole",
13406            );
13407            let mut req = request.into_request();
13408            req.extensions_mut()
13409                .insert(GrpcMethod::new("pidgr.v1.RoleService", "UpdateRole"));
13410            self.inner.unary(req, path, codec).await
13411        }
13412        /** Delete a role. Fails if any users are assigned to it.
13413 System roles (is_system=true) cannot be deleted.
13414 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
13415*/
13416        pub async fn delete_role(
13417            &mut self,
13418            request: impl tonic::IntoRequest<super::DeleteRoleRequest>,
13419        ) -> std::result::Result<
13420            tonic::Response<super::DeleteRoleResponse>,
13421            tonic::Status,
13422        > {
13423            self.inner
13424                .ready()
13425                .await
13426                .map_err(|e| {
13427                    tonic::Status::unknown(
13428                        format!("Service was not ready: {}", e.into()),
13429                    )
13430                })?;
13431            let codec = tonic_prost::ProstCodec::default();
13432            let path = http::uri::PathAndQuery::from_static(
13433                "/pidgr.v1.RoleService/DeleteRole",
13434            );
13435            let mut req = request.into_request();
13436            req.extensions_mut()
13437                .insert(GrpcMethod::new("pidgr.v1.RoleService", "DeleteRole"));
13438            self.inner.unary(req, path, codec).await
13439        }
13440    }
13441}
13442/// Generated server implementations.
13443pub mod role_service_server {
13444    #![allow(
13445        unused_variables,
13446        dead_code,
13447        missing_docs,
13448        clippy::wildcard_imports,
13449        clippy::let_unit_value,
13450    )]
13451    use tonic::codegen::*;
13452    /// Generated trait containing gRPC methods that should be implemented for use with RoleServiceServer.
13453    #[async_trait]
13454    pub trait RoleService: std::marker::Send + std::marker::Sync + 'static {
13455        /** List all roles in the organization with their permission sets.
13456 Authorization: Requires PERMISSION_ORG_READ.
13457*/
13458        async fn list_roles(
13459            &self,
13460            request: tonic::Request<super::ListRolesRequest>,
13461        ) -> std::result::Result<
13462            tonic::Response<super::ListRolesResponse>,
13463            tonic::Status,
13464        >;
13465        /** Create a new custom role with a name and initial permissions.
13466 Slug is auto-generated from the name and immutable after creation.
13467 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
13468*/
13469        async fn create_role(
13470            &self,
13471            request: tonic::Request<super::CreateRoleRequest>,
13472        ) -> std::result::Result<
13473            tonic::Response<super::CreateRoleResponse>,
13474            tonic::Status,
13475        >;
13476        /** Update a role's name and/or permissions.
13477 System roles (is_system=true) cannot be updated.
13478 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
13479*/
13480        async fn update_role(
13481            &self,
13482            request: tonic::Request<super::UpdateRoleRequest>,
13483        ) -> std::result::Result<
13484            tonic::Response<super::UpdateRoleResponse>,
13485            tonic::Status,
13486        >;
13487        /** Delete a role. Fails if any users are assigned to it.
13488 System roles (is_system=true) cannot be deleted.
13489 Authorization: Requires PERMISSION_MEMBERS_MANAGE.
13490*/
13491        async fn delete_role(
13492            &self,
13493            request: tonic::Request<super::DeleteRoleRequest>,
13494        ) -> std::result::Result<
13495            tonic::Response<super::DeleteRoleResponse>,
13496            tonic::Status,
13497        >;
13498    }
13499    /** Manages roles and their permissions within an organization.
13500 All RPCs operate within the caller's org (extracted from JWT).
13501*/
13502    #[derive(Debug)]
13503    pub struct RoleServiceServer<T> {
13504        inner: Arc<T>,
13505        accept_compression_encodings: EnabledCompressionEncodings,
13506        send_compression_encodings: EnabledCompressionEncodings,
13507        max_decoding_message_size: Option<usize>,
13508        max_encoding_message_size: Option<usize>,
13509    }
13510    impl<T> RoleServiceServer<T> {
13511        pub fn new(inner: T) -> Self {
13512            Self::from_arc(Arc::new(inner))
13513        }
13514        pub fn from_arc(inner: Arc<T>) -> Self {
13515            Self {
13516                inner,
13517                accept_compression_encodings: Default::default(),
13518                send_compression_encodings: Default::default(),
13519                max_decoding_message_size: None,
13520                max_encoding_message_size: None,
13521            }
13522        }
13523        pub fn with_interceptor<F>(
13524            inner: T,
13525            interceptor: F,
13526        ) -> InterceptedService<Self, F>
13527        where
13528            F: tonic::service::Interceptor,
13529        {
13530            InterceptedService::new(Self::new(inner), interceptor)
13531        }
13532        /// Enable decompressing requests with the given encoding.
13533        #[must_use]
13534        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13535            self.accept_compression_encodings.enable(encoding);
13536            self
13537        }
13538        /// Compress responses with the given encoding, if the client supports it.
13539        #[must_use]
13540        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13541            self.send_compression_encodings.enable(encoding);
13542            self
13543        }
13544        /// Limits the maximum size of a decoded message.
13545        ///
13546        /// Default: `4MB`
13547        #[must_use]
13548        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13549            self.max_decoding_message_size = Some(limit);
13550            self
13551        }
13552        /// Limits the maximum size of an encoded message.
13553        ///
13554        /// Default: `usize::MAX`
13555        #[must_use]
13556        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13557            self.max_encoding_message_size = Some(limit);
13558            self
13559        }
13560    }
13561    impl<T, B> tonic::codegen::Service<http::Request<B>> for RoleServiceServer<T>
13562    where
13563        T: RoleService,
13564        B: Body + std::marker::Send + 'static,
13565        B::Error: Into<StdError> + std::marker::Send + 'static,
13566    {
13567        type Response = http::Response<tonic::body::Body>;
13568        type Error = std::convert::Infallible;
13569        type Future = BoxFuture<Self::Response, Self::Error>;
13570        fn poll_ready(
13571            &mut self,
13572            _cx: &mut Context<'_>,
13573        ) -> Poll<std::result::Result<(), Self::Error>> {
13574            Poll::Ready(Ok(()))
13575        }
13576        fn call(&mut self, req: http::Request<B>) -> Self::Future {
13577            match req.uri().path() {
13578                "/pidgr.v1.RoleService/ListRoles" => {
13579                    #[allow(non_camel_case_types)]
13580                    struct ListRolesSvc<T: RoleService>(pub Arc<T>);
13581                    impl<
13582                        T: RoleService,
13583                    > tonic::server::UnaryService<super::ListRolesRequest>
13584                    for ListRolesSvc<T> {
13585                        type Response = super::ListRolesResponse;
13586                        type Future = BoxFuture<
13587                            tonic::Response<Self::Response>,
13588                            tonic::Status,
13589                        >;
13590                        fn call(
13591                            &mut self,
13592                            request: tonic::Request<super::ListRolesRequest>,
13593                        ) -> Self::Future {
13594                            let inner = Arc::clone(&self.0);
13595                            let fut = async move {
13596                                <T as RoleService>::list_roles(&inner, request).await
13597                            };
13598                            Box::pin(fut)
13599                        }
13600                    }
13601                    let accept_compression_encodings = self.accept_compression_encodings;
13602                    let send_compression_encodings = self.send_compression_encodings;
13603                    let max_decoding_message_size = self.max_decoding_message_size;
13604                    let max_encoding_message_size = self.max_encoding_message_size;
13605                    let inner = self.inner.clone();
13606                    let fut = async move {
13607                        let method = ListRolesSvc(inner);
13608                        let codec = tonic_prost::ProstCodec::default();
13609                        let mut grpc = tonic::server::Grpc::new(codec)
13610                            .apply_compression_config(
13611                                accept_compression_encodings,
13612                                send_compression_encodings,
13613                            )
13614                            .apply_max_message_size_config(
13615                                max_decoding_message_size,
13616                                max_encoding_message_size,
13617                            );
13618                        let res = grpc.unary(method, req).await;
13619                        Ok(res)
13620                    };
13621                    Box::pin(fut)
13622                }
13623                "/pidgr.v1.RoleService/CreateRole" => {
13624                    #[allow(non_camel_case_types)]
13625                    struct CreateRoleSvc<T: RoleService>(pub Arc<T>);
13626                    impl<
13627                        T: RoleService,
13628                    > tonic::server::UnaryService<super::CreateRoleRequest>
13629                    for CreateRoleSvc<T> {
13630                        type Response = super::CreateRoleResponse;
13631                        type Future = BoxFuture<
13632                            tonic::Response<Self::Response>,
13633                            tonic::Status,
13634                        >;
13635                        fn call(
13636                            &mut self,
13637                            request: tonic::Request<super::CreateRoleRequest>,
13638                        ) -> Self::Future {
13639                            let inner = Arc::clone(&self.0);
13640                            let fut = async move {
13641                                <T as RoleService>::create_role(&inner, request).await
13642                            };
13643                            Box::pin(fut)
13644                        }
13645                    }
13646                    let accept_compression_encodings = self.accept_compression_encodings;
13647                    let send_compression_encodings = self.send_compression_encodings;
13648                    let max_decoding_message_size = self.max_decoding_message_size;
13649                    let max_encoding_message_size = self.max_encoding_message_size;
13650                    let inner = self.inner.clone();
13651                    let fut = async move {
13652                        let method = CreateRoleSvc(inner);
13653                        let codec = tonic_prost::ProstCodec::default();
13654                        let mut grpc = tonic::server::Grpc::new(codec)
13655                            .apply_compression_config(
13656                                accept_compression_encodings,
13657                                send_compression_encodings,
13658                            )
13659                            .apply_max_message_size_config(
13660                                max_decoding_message_size,
13661                                max_encoding_message_size,
13662                            );
13663                        let res = grpc.unary(method, req).await;
13664                        Ok(res)
13665                    };
13666                    Box::pin(fut)
13667                }
13668                "/pidgr.v1.RoleService/UpdateRole" => {
13669                    #[allow(non_camel_case_types)]
13670                    struct UpdateRoleSvc<T: RoleService>(pub Arc<T>);
13671                    impl<
13672                        T: RoleService,
13673                    > tonic::server::UnaryService<super::UpdateRoleRequest>
13674                    for UpdateRoleSvc<T> {
13675                        type Response = super::UpdateRoleResponse;
13676                        type Future = BoxFuture<
13677                            tonic::Response<Self::Response>,
13678                            tonic::Status,
13679                        >;
13680                        fn call(
13681                            &mut self,
13682                            request: tonic::Request<super::UpdateRoleRequest>,
13683                        ) -> Self::Future {
13684                            let inner = Arc::clone(&self.0);
13685                            let fut = async move {
13686                                <T as RoleService>::update_role(&inner, request).await
13687                            };
13688                            Box::pin(fut)
13689                        }
13690                    }
13691                    let accept_compression_encodings = self.accept_compression_encodings;
13692                    let send_compression_encodings = self.send_compression_encodings;
13693                    let max_decoding_message_size = self.max_decoding_message_size;
13694                    let max_encoding_message_size = self.max_encoding_message_size;
13695                    let inner = self.inner.clone();
13696                    let fut = async move {
13697                        let method = UpdateRoleSvc(inner);
13698                        let codec = tonic_prost::ProstCodec::default();
13699                        let mut grpc = tonic::server::Grpc::new(codec)
13700                            .apply_compression_config(
13701                                accept_compression_encodings,
13702                                send_compression_encodings,
13703                            )
13704                            .apply_max_message_size_config(
13705                                max_decoding_message_size,
13706                                max_encoding_message_size,
13707                            );
13708                        let res = grpc.unary(method, req).await;
13709                        Ok(res)
13710                    };
13711                    Box::pin(fut)
13712                }
13713                "/pidgr.v1.RoleService/DeleteRole" => {
13714                    #[allow(non_camel_case_types)]
13715                    struct DeleteRoleSvc<T: RoleService>(pub Arc<T>);
13716                    impl<
13717                        T: RoleService,
13718                    > tonic::server::UnaryService<super::DeleteRoleRequest>
13719                    for DeleteRoleSvc<T> {
13720                        type Response = super::DeleteRoleResponse;
13721                        type Future = BoxFuture<
13722                            tonic::Response<Self::Response>,
13723                            tonic::Status,
13724                        >;
13725                        fn call(
13726                            &mut self,
13727                            request: tonic::Request<super::DeleteRoleRequest>,
13728                        ) -> Self::Future {
13729                            let inner = Arc::clone(&self.0);
13730                            let fut = async move {
13731                                <T as RoleService>::delete_role(&inner, request).await
13732                            };
13733                            Box::pin(fut)
13734                        }
13735                    }
13736                    let accept_compression_encodings = self.accept_compression_encodings;
13737                    let send_compression_encodings = self.send_compression_encodings;
13738                    let max_decoding_message_size = self.max_decoding_message_size;
13739                    let max_encoding_message_size = self.max_encoding_message_size;
13740                    let inner = self.inner.clone();
13741                    let fut = async move {
13742                        let method = DeleteRoleSvc(inner);
13743                        let codec = tonic_prost::ProstCodec::default();
13744                        let mut grpc = tonic::server::Grpc::new(codec)
13745                            .apply_compression_config(
13746                                accept_compression_encodings,
13747                                send_compression_encodings,
13748                            )
13749                            .apply_max_message_size_config(
13750                                max_decoding_message_size,
13751                                max_encoding_message_size,
13752                            );
13753                        let res = grpc.unary(method, req).await;
13754                        Ok(res)
13755                    };
13756                    Box::pin(fut)
13757                }
13758                _ => {
13759                    Box::pin(async move {
13760                        let mut response = http::Response::new(
13761                            tonic::body::Body::default(),
13762                        );
13763                        let headers = response.headers_mut();
13764                        headers
13765                            .insert(
13766                                tonic::Status::GRPC_STATUS,
13767                                (tonic::Code::Unimplemented as i32).into(),
13768                            );
13769                        headers
13770                            .insert(
13771                                http::header::CONTENT_TYPE,
13772                                tonic::metadata::GRPC_CONTENT_TYPE,
13773                            );
13774                        Ok(response)
13775                    })
13776                }
13777            }
13778        }
13779    }
13780    impl<T> Clone for RoleServiceServer<T> {
13781        fn clone(&self) -> Self {
13782            let inner = self.inner.clone();
13783            Self {
13784                inner,
13785                accept_compression_encodings: self.accept_compression_encodings,
13786                send_compression_encodings: self.send_compression_encodings,
13787                max_decoding_message_size: self.max_decoding_message_size,
13788                max_encoding_message_size: self.max_encoding_message_size,
13789            }
13790        }
13791    }
13792    /// Generated gRPC service name
13793    pub const SERVICE_NAME: &str = "pidgr.v1.RoleService";
13794    impl<T> tonic::server::NamedService for RoleServiceServer<T> {
13795        const NAME: &'static str = SERVICE_NAME;
13796    }
13797}
13798/// Generated client implementations.
13799pub mod sso_service_client {
13800    #![allow(
13801        unused_variables,
13802        dead_code,
13803        missing_docs,
13804        clippy::wildcard_imports,
13805        clippy::let_unit_value,
13806    )]
13807    use tonic::codegen::*;
13808    use tonic::codegen::http::Uri;
13809    /** Manages SSO identity provider configuration for organizations.
13810*/
13811    #[derive(Debug, Clone)]
13812    pub struct SsoServiceClient<T> {
13813        inner: tonic::client::Grpc<T>,
13814    }
13815    impl SsoServiceClient<tonic::transport::Channel> {
13816        /// Attempt to create a new client by connecting to a given endpoint.
13817        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
13818        where
13819            D: TryInto<tonic::transport::Endpoint>,
13820            D::Error: Into<StdError>,
13821        {
13822            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
13823            Ok(Self::new(conn))
13824        }
13825    }
13826    impl<T> SsoServiceClient<T>
13827    where
13828        T: tonic::client::GrpcService<tonic::body::Body>,
13829        T::Error: Into<StdError>,
13830        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
13831        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
13832    {
13833        pub fn new(inner: T) -> Self {
13834            let inner = tonic::client::Grpc::new(inner);
13835            Self { inner }
13836        }
13837        pub fn with_origin(inner: T, origin: Uri) -> Self {
13838            let inner = tonic::client::Grpc::with_origin(inner, origin);
13839            Self { inner }
13840        }
13841        pub fn with_interceptor<F>(
13842            inner: T,
13843            interceptor: F,
13844        ) -> SsoServiceClient<InterceptedService<T, F>>
13845        where
13846            F: tonic::service::Interceptor,
13847            T::ResponseBody: Default,
13848            T: tonic::codegen::Service<
13849                http::Request<tonic::body::Body>,
13850                Response = http::Response<
13851                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
13852                >,
13853            >,
13854            <T as tonic::codegen::Service<
13855                http::Request<tonic::body::Body>,
13856            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
13857        {
13858            SsoServiceClient::new(InterceptedService::new(inner, interceptor))
13859        }
13860        /// Compress requests with the given encoding.
13861        ///
13862        /// This requires the server to support it otherwise it might respond with an
13863        /// error.
13864        #[must_use]
13865        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13866            self.inner = self.inner.send_compressed(encoding);
13867            self
13868        }
13869        /// Enable decompressing responses.
13870        #[must_use]
13871        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13872            self.inner = self.inner.accept_compressed(encoding);
13873            self
13874        }
13875        /// Limits the maximum size of a decoded message.
13876        ///
13877        /// Default: `4MB`
13878        #[must_use]
13879        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13880            self.inner = self.inner.max_decoding_message_size(limit);
13881            self
13882        }
13883        /// Limits the maximum size of an encoded message.
13884        ///
13885        /// Default: `usize::MAX`
13886        #[must_use]
13887        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13888            self.inner = self.inner.max_encoding_message_size(limit);
13889            self
13890        }
13891        /** Check if an email domain has SSO configured.
13892 This is a pre-authentication endpoint — no JWT required.
13893 Authorization: None (public).
13894*/
13895        pub async fn check_sso_by_domain(
13896            &mut self,
13897            request: impl tonic::IntoRequest<super::CheckSsoByDomainRequest>,
13898        ) -> std::result::Result<
13899            tonic::Response<super::CheckSsoByDomainResponse>,
13900            tonic::Status,
13901        > {
13902            self.inner
13903                .ready()
13904                .await
13905                .map_err(|e| {
13906                    tonic::Status::unknown(
13907                        format!("Service was not ready: {}", e.into()),
13908                    )
13909                })?;
13910            let codec = tonic_prost::ProstCodec::default();
13911            let path = http::uri::PathAndQuery::from_static(
13912                "/pidgr.v1.SSOService/CheckSSOByDomain",
13913            );
13914            let mut req = request.into_request();
13915            req.extensions_mut()
13916                .insert(GrpcMethod::new("pidgr.v1.SSOService", "CheckSSOByDomain"));
13917            self.inner.unary(req, path, codec).await
13918        }
13919        /** Create an SSO provider for the organization.
13920 Validates the metadata URL before saving.
13921 Creates the corresponding identity provider in the auth service.
13922 Authorization: Requires PERMISSION_ORG_WRITE.
13923*/
13924        pub async fn create_sso_provider(
13925            &mut self,
13926            request: impl tonic::IntoRequest<super::CreateSsoProviderRequest>,
13927        ) -> std::result::Result<
13928            tonic::Response<super::CreateSsoProviderResponse>,
13929            tonic::Status,
13930        > {
13931            self.inner
13932                .ready()
13933                .await
13934                .map_err(|e| {
13935                    tonic::Status::unknown(
13936                        format!("Service was not ready: {}", e.into()),
13937                    )
13938                })?;
13939            let codec = tonic_prost::ProstCodec::default();
13940            let path = http::uri::PathAndQuery::from_static(
13941                "/pidgr.v1.SSOService/CreateSSOProvider",
13942            );
13943            let mut req = request.into_request();
13944            req.extensions_mut()
13945                .insert(GrpcMethod::new("pidgr.v1.SSOService", "CreateSSOProvider"));
13946            self.inner.unary(req, path, codec).await
13947        }
13948        /** Get the organization's SSO provider configuration.
13949 Authorization: Requires PERMISSION_ORG_READ.
13950*/
13951        pub async fn get_sso_provider(
13952            &mut self,
13953            request: impl tonic::IntoRequest<super::GetSsoProviderRequest>,
13954        ) -> std::result::Result<
13955            tonic::Response<super::GetSsoProviderResponse>,
13956            tonic::Status,
13957        > {
13958            self.inner
13959                .ready()
13960                .await
13961                .map_err(|e| {
13962                    tonic::Status::unknown(
13963                        format!("Service was not ready: {}", e.into()),
13964                    )
13965                })?;
13966            let codec = tonic_prost::ProstCodec::default();
13967            let path = http::uri::PathAndQuery::from_static(
13968                "/pidgr.v1.SSOService/GetSSOProvider",
13969            );
13970            let mut req = request.into_request();
13971            req.extensions_mut()
13972                .insert(GrpcMethod::new("pidgr.v1.SSOService", "GetSSOProvider"));
13973            self.inner.unary(req, path, codec).await
13974        }
13975        /** Delete the organization's SSO provider.
13976 Deletes the corresponding identity provider from the auth service.
13977 Users with that domain fall back to passkey/OTP.
13978 Authorization: Requires PERMISSION_ORG_WRITE.
13979*/
13980        pub async fn delete_sso_provider(
13981            &mut self,
13982            request: impl tonic::IntoRequest<super::DeleteSsoProviderRequest>,
13983        ) -> std::result::Result<
13984            tonic::Response<super::DeleteSsoProviderResponse>,
13985            tonic::Status,
13986        > {
13987            self.inner
13988                .ready()
13989                .await
13990                .map_err(|e| {
13991                    tonic::Status::unknown(
13992                        format!("Service was not ready: {}", e.into()),
13993                    )
13994                })?;
13995            let codec = tonic_prost::ProstCodec::default();
13996            let path = http::uri::PathAndQuery::from_static(
13997                "/pidgr.v1.SSOService/DeleteSSOProvider",
13998            );
13999            let mut req = request.into_request();
14000            req.extensions_mut()
14001                .insert(GrpcMethod::new("pidgr.v1.SSOService", "DeleteSSOProvider"));
14002            self.inner.unary(req, path, codec).await
14003        }
14004    }
14005}
14006/// Generated server implementations.
14007pub mod sso_service_server {
14008    #![allow(
14009        unused_variables,
14010        dead_code,
14011        missing_docs,
14012        clippy::wildcard_imports,
14013        clippy::let_unit_value,
14014    )]
14015    use tonic::codegen::*;
14016    /// Generated trait containing gRPC methods that should be implemented for use with SsoServiceServer.
14017    #[async_trait]
14018    pub trait SsoService: std::marker::Send + std::marker::Sync + 'static {
14019        /** Check if an email domain has SSO configured.
14020 This is a pre-authentication endpoint — no JWT required.
14021 Authorization: None (public).
14022*/
14023        async fn check_sso_by_domain(
14024            &self,
14025            request: tonic::Request<super::CheckSsoByDomainRequest>,
14026        ) -> std::result::Result<
14027            tonic::Response<super::CheckSsoByDomainResponse>,
14028            tonic::Status,
14029        >;
14030        /** Create an SSO provider for the organization.
14031 Validates the metadata URL before saving.
14032 Creates the corresponding identity provider in the auth service.
14033 Authorization: Requires PERMISSION_ORG_WRITE.
14034*/
14035        async fn create_sso_provider(
14036            &self,
14037            request: tonic::Request<super::CreateSsoProviderRequest>,
14038        ) -> std::result::Result<
14039            tonic::Response<super::CreateSsoProviderResponse>,
14040            tonic::Status,
14041        >;
14042        /** Get the organization's SSO provider configuration.
14043 Authorization: Requires PERMISSION_ORG_READ.
14044*/
14045        async fn get_sso_provider(
14046            &self,
14047            request: tonic::Request<super::GetSsoProviderRequest>,
14048        ) -> std::result::Result<
14049            tonic::Response<super::GetSsoProviderResponse>,
14050            tonic::Status,
14051        >;
14052        /** Delete the organization's SSO provider.
14053 Deletes the corresponding identity provider from the auth service.
14054 Users with that domain fall back to passkey/OTP.
14055 Authorization: Requires PERMISSION_ORG_WRITE.
14056*/
14057        async fn delete_sso_provider(
14058            &self,
14059            request: tonic::Request<super::DeleteSsoProviderRequest>,
14060        ) -> std::result::Result<
14061            tonic::Response<super::DeleteSsoProviderResponse>,
14062            tonic::Status,
14063        >;
14064    }
14065    /** Manages SSO identity provider configuration for organizations.
14066*/
14067    #[derive(Debug)]
14068    pub struct SsoServiceServer<T> {
14069        inner: Arc<T>,
14070        accept_compression_encodings: EnabledCompressionEncodings,
14071        send_compression_encodings: EnabledCompressionEncodings,
14072        max_decoding_message_size: Option<usize>,
14073        max_encoding_message_size: Option<usize>,
14074    }
14075    impl<T> SsoServiceServer<T> {
14076        pub fn new(inner: T) -> Self {
14077            Self::from_arc(Arc::new(inner))
14078        }
14079        pub fn from_arc(inner: Arc<T>) -> Self {
14080            Self {
14081                inner,
14082                accept_compression_encodings: Default::default(),
14083                send_compression_encodings: Default::default(),
14084                max_decoding_message_size: None,
14085                max_encoding_message_size: None,
14086            }
14087        }
14088        pub fn with_interceptor<F>(
14089            inner: T,
14090            interceptor: F,
14091        ) -> InterceptedService<Self, F>
14092        where
14093            F: tonic::service::Interceptor,
14094        {
14095            InterceptedService::new(Self::new(inner), interceptor)
14096        }
14097        /// Enable decompressing requests with the given encoding.
14098        #[must_use]
14099        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
14100            self.accept_compression_encodings.enable(encoding);
14101            self
14102        }
14103        /// Compress responses with the given encoding, if the client supports it.
14104        #[must_use]
14105        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
14106            self.send_compression_encodings.enable(encoding);
14107            self
14108        }
14109        /// Limits the maximum size of a decoded message.
14110        ///
14111        /// Default: `4MB`
14112        #[must_use]
14113        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
14114            self.max_decoding_message_size = Some(limit);
14115            self
14116        }
14117        /// Limits the maximum size of an encoded message.
14118        ///
14119        /// Default: `usize::MAX`
14120        #[must_use]
14121        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
14122            self.max_encoding_message_size = Some(limit);
14123            self
14124        }
14125    }
14126    impl<T, B> tonic::codegen::Service<http::Request<B>> for SsoServiceServer<T>
14127    where
14128        T: SsoService,
14129        B: Body + std::marker::Send + 'static,
14130        B::Error: Into<StdError> + std::marker::Send + 'static,
14131    {
14132        type Response = http::Response<tonic::body::Body>;
14133        type Error = std::convert::Infallible;
14134        type Future = BoxFuture<Self::Response, Self::Error>;
14135        fn poll_ready(
14136            &mut self,
14137            _cx: &mut Context<'_>,
14138        ) -> Poll<std::result::Result<(), Self::Error>> {
14139            Poll::Ready(Ok(()))
14140        }
14141        fn call(&mut self, req: http::Request<B>) -> Self::Future {
14142            match req.uri().path() {
14143                "/pidgr.v1.SSOService/CheckSSOByDomain" => {
14144                    #[allow(non_camel_case_types)]
14145                    struct CheckSSOByDomainSvc<T: SsoService>(pub Arc<T>);
14146                    impl<
14147                        T: SsoService,
14148                    > tonic::server::UnaryService<super::CheckSsoByDomainRequest>
14149                    for CheckSSOByDomainSvc<T> {
14150                        type Response = super::CheckSsoByDomainResponse;
14151                        type Future = BoxFuture<
14152                            tonic::Response<Self::Response>,
14153                            tonic::Status,
14154                        >;
14155                        fn call(
14156                            &mut self,
14157                            request: tonic::Request<super::CheckSsoByDomainRequest>,
14158                        ) -> Self::Future {
14159                            let inner = Arc::clone(&self.0);
14160                            let fut = async move {
14161                                <T as SsoService>::check_sso_by_domain(&inner, request)
14162                                    .await
14163                            };
14164                            Box::pin(fut)
14165                        }
14166                    }
14167                    let accept_compression_encodings = self.accept_compression_encodings;
14168                    let send_compression_encodings = self.send_compression_encodings;
14169                    let max_decoding_message_size = self.max_decoding_message_size;
14170                    let max_encoding_message_size = self.max_encoding_message_size;
14171                    let inner = self.inner.clone();
14172                    let fut = async move {
14173                        let method = CheckSSOByDomainSvc(inner);
14174                        let codec = tonic_prost::ProstCodec::default();
14175                        let mut grpc = tonic::server::Grpc::new(codec)
14176                            .apply_compression_config(
14177                                accept_compression_encodings,
14178                                send_compression_encodings,
14179                            )
14180                            .apply_max_message_size_config(
14181                                max_decoding_message_size,
14182                                max_encoding_message_size,
14183                            );
14184                        let res = grpc.unary(method, req).await;
14185                        Ok(res)
14186                    };
14187                    Box::pin(fut)
14188                }
14189                "/pidgr.v1.SSOService/CreateSSOProvider" => {
14190                    #[allow(non_camel_case_types)]
14191                    struct CreateSSOProviderSvc<T: SsoService>(pub Arc<T>);
14192                    impl<
14193                        T: SsoService,
14194                    > tonic::server::UnaryService<super::CreateSsoProviderRequest>
14195                    for CreateSSOProviderSvc<T> {
14196                        type Response = super::CreateSsoProviderResponse;
14197                        type Future = BoxFuture<
14198                            tonic::Response<Self::Response>,
14199                            tonic::Status,
14200                        >;
14201                        fn call(
14202                            &mut self,
14203                            request: tonic::Request<super::CreateSsoProviderRequest>,
14204                        ) -> Self::Future {
14205                            let inner = Arc::clone(&self.0);
14206                            let fut = async move {
14207                                <T as SsoService>::create_sso_provider(&inner, request)
14208                                    .await
14209                            };
14210                            Box::pin(fut)
14211                        }
14212                    }
14213                    let accept_compression_encodings = self.accept_compression_encodings;
14214                    let send_compression_encodings = self.send_compression_encodings;
14215                    let max_decoding_message_size = self.max_decoding_message_size;
14216                    let max_encoding_message_size = self.max_encoding_message_size;
14217                    let inner = self.inner.clone();
14218                    let fut = async move {
14219                        let method = CreateSSOProviderSvc(inner);
14220                        let codec = tonic_prost::ProstCodec::default();
14221                        let mut grpc = tonic::server::Grpc::new(codec)
14222                            .apply_compression_config(
14223                                accept_compression_encodings,
14224                                send_compression_encodings,
14225                            )
14226                            .apply_max_message_size_config(
14227                                max_decoding_message_size,
14228                                max_encoding_message_size,
14229                            );
14230                        let res = grpc.unary(method, req).await;
14231                        Ok(res)
14232                    };
14233                    Box::pin(fut)
14234                }
14235                "/pidgr.v1.SSOService/GetSSOProvider" => {
14236                    #[allow(non_camel_case_types)]
14237                    struct GetSSOProviderSvc<T: SsoService>(pub Arc<T>);
14238                    impl<
14239                        T: SsoService,
14240                    > tonic::server::UnaryService<super::GetSsoProviderRequest>
14241                    for GetSSOProviderSvc<T> {
14242                        type Response = super::GetSsoProviderResponse;
14243                        type Future = BoxFuture<
14244                            tonic::Response<Self::Response>,
14245                            tonic::Status,
14246                        >;
14247                        fn call(
14248                            &mut self,
14249                            request: tonic::Request<super::GetSsoProviderRequest>,
14250                        ) -> Self::Future {
14251                            let inner = Arc::clone(&self.0);
14252                            let fut = async move {
14253                                <T as SsoService>::get_sso_provider(&inner, request).await
14254                            };
14255                            Box::pin(fut)
14256                        }
14257                    }
14258                    let accept_compression_encodings = self.accept_compression_encodings;
14259                    let send_compression_encodings = self.send_compression_encodings;
14260                    let max_decoding_message_size = self.max_decoding_message_size;
14261                    let max_encoding_message_size = self.max_encoding_message_size;
14262                    let inner = self.inner.clone();
14263                    let fut = async move {
14264                        let method = GetSSOProviderSvc(inner);
14265                        let codec = tonic_prost::ProstCodec::default();
14266                        let mut grpc = tonic::server::Grpc::new(codec)
14267                            .apply_compression_config(
14268                                accept_compression_encodings,
14269                                send_compression_encodings,
14270                            )
14271                            .apply_max_message_size_config(
14272                                max_decoding_message_size,
14273                                max_encoding_message_size,
14274                            );
14275                        let res = grpc.unary(method, req).await;
14276                        Ok(res)
14277                    };
14278                    Box::pin(fut)
14279                }
14280                "/pidgr.v1.SSOService/DeleteSSOProvider" => {
14281                    #[allow(non_camel_case_types)]
14282                    struct DeleteSSOProviderSvc<T: SsoService>(pub Arc<T>);
14283                    impl<
14284                        T: SsoService,
14285                    > tonic::server::UnaryService<super::DeleteSsoProviderRequest>
14286                    for DeleteSSOProviderSvc<T> {
14287                        type Response = super::DeleteSsoProviderResponse;
14288                        type Future = BoxFuture<
14289                            tonic::Response<Self::Response>,
14290                            tonic::Status,
14291                        >;
14292                        fn call(
14293                            &mut self,
14294                            request: tonic::Request<super::DeleteSsoProviderRequest>,
14295                        ) -> Self::Future {
14296                            let inner = Arc::clone(&self.0);
14297                            let fut = async move {
14298                                <T as SsoService>::delete_sso_provider(&inner, request)
14299                                    .await
14300                            };
14301                            Box::pin(fut)
14302                        }
14303                    }
14304                    let accept_compression_encodings = self.accept_compression_encodings;
14305                    let send_compression_encodings = self.send_compression_encodings;
14306                    let max_decoding_message_size = self.max_decoding_message_size;
14307                    let max_encoding_message_size = self.max_encoding_message_size;
14308                    let inner = self.inner.clone();
14309                    let fut = async move {
14310                        let method = DeleteSSOProviderSvc(inner);
14311                        let codec = tonic_prost::ProstCodec::default();
14312                        let mut grpc = tonic::server::Grpc::new(codec)
14313                            .apply_compression_config(
14314                                accept_compression_encodings,
14315                                send_compression_encodings,
14316                            )
14317                            .apply_max_message_size_config(
14318                                max_decoding_message_size,
14319                                max_encoding_message_size,
14320                            );
14321                        let res = grpc.unary(method, req).await;
14322                        Ok(res)
14323                    };
14324                    Box::pin(fut)
14325                }
14326                _ => {
14327                    Box::pin(async move {
14328                        let mut response = http::Response::new(
14329                            tonic::body::Body::default(),
14330                        );
14331                        let headers = response.headers_mut();
14332                        headers
14333                            .insert(
14334                                tonic::Status::GRPC_STATUS,
14335                                (tonic::Code::Unimplemented as i32).into(),
14336                            );
14337                        headers
14338                            .insert(
14339                                http::header::CONTENT_TYPE,
14340                                tonic::metadata::GRPC_CONTENT_TYPE,
14341                            );
14342                        Ok(response)
14343                    })
14344                }
14345            }
14346        }
14347    }
14348    impl<T> Clone for SsoServiceServer<T> {
14349        fn clone(&self) -> Self {
14350            let inner = self.inner.clone();
14351            Self {
14352                inner,
14353                accept_compression_encodings: self.accept_compression_encodings,
14354                send_compression_encodings: self.send_compression_encodings,
14355                max_decoding_message_size: self.max_decoding_message_size,
14356                max_encoding_message_size: self.max_encoding_message_size,
14357            }
14358        }
14359    }
14360    /// Generated gRPC service name
14361    pub const SERVICE_NAME: &str = "pidgr.v1.SSOService";
14362    impl<T> tonic::server::NamedService for SsoServiceServer<T> {
14363        const NAME: &'static str = SERVICE_NAME;
14364    }
14365}
14366/// Generated client implementations.
14367pub mod team_service_client {
14368    #![allow(
14369        unused_variables,
14370        dead_code,
14371        missing_docs,
14372        clippy::wildcard_imports,
14373        clippy::let_unit_value,
14374    )]
14375    use tonic::codegen::*;
14376    use tonic::codegen::http::Uri;
14377    /** Manages organizational teams (departments, divisions) within an organization.
14378 Teams represent the organizational structure and can serve as sender identity.
14379 All RPCs operate within the caller's org (extracted from JWT).
14380*/
14381    #[derive(Debug, Clone)]
14382    pub struct TeamServiceClient<T> {
14383        inner: tonic::client::Grpc<T>,
14384    }
14385    impl TeamServiceClient<tonic::transport::Channel> {
14386        /// Attempt to create a new client by connecting to a given endpoint.
14387        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
14388        where
14389            D: TryInto<tonic::transport::Endpoint>,
14390            D::Error: Into<StdError>,
14391        {
14392            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
14393            Ok(Self::new(conn))
14394        }
14395    }
14396    impl<T> TeamServiceClient<T>
14397    where
14398        T: tonic::client::GrpcService<tonic::body::Body>,
14399        T::Error: Into<StdError>,
14400        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
14401        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
14402    {
14403        pub fn new(inner: T) -> Self {
14404            let inner = tonic::client::Grpc::new(inner);
14405            Self { inner }
14406        }
14407        pub fn with_origin(inner: T, origin: Uri) -> Self {
14408            let inner = tonic::client::Grpc::with_origin(inner, origin);
14409            Self { inner }
14410        }
14411        pub fn with_interceptor<F>(
14412            inner: T,
14413            interceptor: F,
14414        ) -> TeamServiceClient<InterceptedService<T, F>>
14415        where
14416            F: tonic::service::Interceptor,
14417            T::ResponseBody: Default,
14418            T: tonic::codegen::Service<
14419                http::Request<tonic::body::Body>,
14420                Response = http::Response<
14421                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
14422                >,
14423            >,
14424            <T as tonic::codegen::Service<
14425                http::Request<tonic::body::Body>,
14426            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
14427        {
14428            TeamServiceClient::new(InterceptedService::new(inner, interceptor))
14429        }
14430        /// Compress requests with the given encoding.
14431        ///
14432        /// This requires the server to support it otherwise it might respond with an
14433        /// error.
14434        #[must_use]
14435        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
14436            self.inner = self.inner.send_compressed(encoding);
14437            self
14438        }
14439        /// Enable decompressing responses.
14440        #[must_use]
14441        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
14442            self.inner = self.inner.accept_compressed(encoding);
14443            self
14444        }
14445        /// Limits the maximum size of a decoded message.
14446        ///
14447        /// Default: `4MB`
14448        #[must_use]
14449        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
14450            self.inner = self.inner.max_decoding_message_size(limit);
14451            self
14452        }
14453        /// Limits the maximum size of an encoded message.
14454        ///
14455        /// Default: `usize::MAX`
14456        #[must_use]
14457        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
14458            self.inner = self.inner.max_encoding_message_size(limit);
14459            self
14460        }
14461        /** Create a new team in the organization.
14462 Authorization: Requires PERMISSION_TEAMS_WRITE or PERMISSION_TEAMS_ALL_WRITE.
14463*/
14464        pub async fn create_team(
14465            &mut self,
14466            request: impl tonic::IntoRequest<super::CreateTeamRequest>,
14467        ) -> std::result::Result<
14468            tonic::Response<super::CreateTeamResponse>,
14469            tonic::Status,
14470        > {
14471            self.inner
14472                .ready()
14473                .await
14474                .map_err(|e| {
14475                    tonic::Status::unknown(
14476                        format!("Service was not ready: {}", e.into()),
14477                    )
14478                })?;
14479            let codec = tonic_prost::ProstCodec::default();
14480            let path = http::uri::PathAndQuery::from_static(
14481                "/pidgr.v1.TeamService/CreateTeam",
14482            );
14483            let mut req = request.into_request();
14484            req.extensions_mut()
14485                .insert(GrpcMethod::new("pidgr.v1.TeamService", "CreateTeam"));
14486            self.inner.unary(req, path, codec).await
14487        }
14488        /** Retrieve a team by ID.
14489 Authorization: Caller must be a member of the team, or have
14490 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
14491*/
14492        pub async fn get_team(
14493            &mut self,
14494            request: impl tonic::IntoRequest<super::GetTeamRequest>,
14495        ) -> std::result::Result<
14496            tonic::Response<super::GetTeamResponse>,
14497            tonic::Status,
14498        > {
14499            self.inner
14500                .ready()
14501                .await
14502                .map_err(|e| {
14503                    tonic::Status::unknown(
14504                        format!("Service was not ready: {}", e.into()),
14505                    )
14506                })?;
14507            let codec = tonic_prost::ProstCodec::default();
14508            let path = http::uri::PathAndQuery::from_static(
14509                "/pidgr.v1.TeamService/GetTeam",
14510            );
14511            let mut req = request.into_request();
14512            req.extensions_mut()
14513                .insert(GrpcMethod::new("pidgr.v1.TeamService", "GetTeam"));
14514            self.inner.unary(req, path, codec).await
14515        }
14516        /** List teams in the organization with pagination.
14517 Without PERMISSION_TEAMS_ALL_READ/ALL_WRITE, returns only teams the caller belongs to.
14518*/
14519        pub async fn list_teams(
14520            &mut self,
14521            request: impl tonic::IntoRequest<super::ListTeamsRequest>,
14522        ) -> std::result::Result<
14523            tonic::Response<super::ListTeamsResponse>,
14524            tonic::Status,
14525        > {
14526            self.inner
14527                .ready()
14528                .await
14529                .map_err(|e| {
14530                    tonic::Status::unknown(
14531                        format!("Service was not ready: {}", e.into()),
14532                    )
14533                })?;
14534            let codec = tonic_prost::ProstCodec::default();
14535            let path = http::uri::PathAndQuery::from_static(
14536                "/pidgr.v1.TeamService/ListTeams",
14537            );
14538            let mut req = request.into_request();
14539            req.extensions_mut()
14540                .insert(GrpcMethod::new("pidgr.v1.TeamService", "ListTeams"));
14541            self.inner.unary(req, path, codec).await
14542        }
14543        /** Update a team's name and/or description.
14544 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
14545*/
14546        pub async fn update_team(
14547            &mut self,
14548            request: impl tonic::IntoRequest<super::UpdateTeamRequest>,
14549        ) -> std::result::Result<
14550            tonic::Response<super::UpdateTeamResponse>,
14551            tonic::Status,
14552        > {
14553            self.inner
14554                .ready()
14555                .await
14556                .map_err(|e| {
14557                    tonic::Status::unknown(
14558                        format!("Service was not ready: {}", e.into()),
14559                    )
14560                })?;
14561            let codec = tonic_prost::ProstCodec::default();
14562            let path = http::uri::PathAndQuery::from_static(
14563                "/pidgr.v1.TeamService/UpdateTeam",
14564            );
14565            let mut req = request.into_request();
14566            req.extensions_mut()
14567                .insert(GrpcMethod::new("pidgr.v1.TeamService", "UpdateTeam"));
14568            self.inner.unary(req, path, codec).await
14569        }
14570        /** Delete a team and all its membership records. Default teams cannot be deleted.
14571 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
14572*/
14573        pub async fn delete_team(
14574            &mut self,
14575            request: impl tonic::IntoRequest<super::DeleteTeamRequest>,
14576        ) -> std::result::Result<
14577            tonic::Response<super::DeleteTeamResponse>,
14578            tonic::Status,
14579        > {
14580            self.inner
14581                .ready()
14582                .await
14583                .map_err(|e| {
14584                    tonic::Status::unknown(
14585                        format!("Service was not ready: {}", e.into()),
14586                    )
14587                })?;
14588            let codec = tonic_prost::ProstCodec::default();
14589            let path = http::uri::PathAndQuery::from_static(
14590                "/pidgr.v1.TeamService/DeleteTeam",
14591            );
14592            let mut req = request.into_request();
14593            req.extensions_mut()
14594                .insert(GrpcMethod::new("pidgr.v1.TeamService", "DeleteTeam"));
14595            self.inner.unary(req, path, codec).await
14596        }
14597        /** Add one or more users to a team (idempotent).
14598 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
14599*/
14600        pub async fn add_team_members(
14601            &mut self,
14602            request: impl tonic::IntoRequest<super::AddTeamMembersRequest>,
14603        ) -> std::result::Result<
14604            tonic::Response<super::AddTeamMembersResponse>,
14605            tonic::Status,
14606        > {
14607            self.inner
14608                .ready()
14609                .await
14610                .map_err(|e| {
14611                    tonic::Status::unknown(
14612                        format!("Service was not ready: {}", e.into()),
14613                    )
14614                })?;
14615            let codec = tonic_prost::ProstCodec::default();
14616            let path = http::uri::PathAndQuery::from_static(
14617                "/pidgr.v1.TeamService/AddTeamMembers",
14618            );
14619            let mut req = request.into_request();
14620            req.extensions_mut()
14621                .insert(GrpcMethod::new("pidgr.v1.TeamService", "AddTeamMembers"));
14622            self.inner.unary(req, path, codec).await
14623        }
14624        /** Remove one or more users from a team (idempotent).
14625 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
14626*/
14627        pub async fn remove_team_members(
14628            &mut self,
14629            request: impl tonic::IntoRequest<super::RemoveTeamMembersRequest>,
14630        ) -> std::result::Result<
14631            tonic::Response<super::RemoveTeamMembersResponse>,
14632            tonic::Status,
14633        > {
14634            self.inner
14635                .ready()
14636                .await
14637                .map_err(|e| {
14638                    tonic::Status::unknown(
14639                        format!("Service was not ready: {}", e.into()),
14640                    )
14641                })?;
14642            let codec = tonic_prost::ProstCodec::default();
14643            let path = http::uri::PathAndQuery::from_static(
14644                "/pidgr.v1.TeamService/RemoveTeamMembers",
14645            );
14646            let mut req = request.into_request();
14647            req.extensions_mut()
14648                .insert(GrpcMethod::new("pidgr.v1.TeamService", "RemoveTeamMembers"));
14649            self.inner.unary(req, path, codec).await
14650        }
14651        /** List members of a team with pagination.
14652 Authorization: Caller must be a member of the team, or have
14653 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
14654*/
14655        pub async fn list_team_members(
14656            &mut self,
14657            request: impl tonic::IntoRequest<super::ListTeamMembersRequest>,
14658        ) -> std::result::Result<
14659            tonic::Response<super::ListTeamMembersResponse>,
14660            tonic::Status,
14661        > {
14662            self.inner
14663                .ready()
14664                .await
14665                .map_err(|e| {
14666                    tonic::Status::unknown(
14667                        format!("Service was not ready: {}", e.into()),
14668                    )
14669                })?;
14670            let codec = tonic_prost::ProstCodec::default();
14671            let path = http::uri::PathAndQuery::from_static(
14672                "/pidgr.v1.TeamService/ListTeamMembers",
14673            );
14674            let mut req = request.into_request();
14675            req.extensions_mut()
14676                .insert(GrpcMethod::new("pidgr.v1.TeamService", "ListTeamMembers"));
14677            self.inner.unary(req, path, codec).await
14678        }
14679    }
14680}
14681/// Generated server implementations.
14682pub mod team_service_server {
14683    #![allow(
14684        unused_variables,
14685        dead_code,
14686        missing_docs,
14687        clippy::wildcard_imports,
14688        clippy::let_unit_value,
14689    )]
14690    use tonic::codegen::*;
14691    /// Generated trait containing gRPC methods that should be implemented for use with TeamServiceServer.
14692    #[async_trait]
14693    pub trait TeamService: std::marker::Send + std::marker::Sync + 'static {
14694        /** Create a new team in the organization.
14695 Authorization: Requires PERMISSION_TEAMS_WRITE or PERMISSION_TEAMS_ALL_WRITE.
14696*/
14697        async fn create_team(
14698            &self,
14699            request: tonic::Request<super::CreateTeamRequest>,
14700        ) -> std::result::Result<
14701            tonic::Response<super::CreateTeamResponse>,
14702            tonic::Status,
14703        >;
14704        /** Retrieve a team by ID.
14705 Authorization: Caller must be a member of the team, or have
14706 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
14707*/
14708        async fn get_team(
14709            &self,
14710            request: tonic::Request<super::GetTeamRequest>,
14711        ) -> std::result::Result<tonic::Response<super::GetTeamResponse>, tonic::Status>;
14712        /** List teams in the organization with pagination.
14713 Without PERMISSION_TEAMS_ALL_READ/ALL_WRITE, returns only teams the caller belongs to.
14714*/
14715        async fn list_teams(
14716            &self,
14717            request: tonic::Request<super::ListTeamsRequest>,
14718        ) -> std::result::Result<
14719            tonic::Response<super::ListTeamsResponse>,
14720            tonic::Status,
14721        >;
14722        /** Update a team's name and/or description.
14723 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
14724*/
14725        async fn update_team(
14726            &self,
14727            request: tonic::Request<super::UpdateTeamRequest>,
14728        ) -> std::result::Result<
14729            tonic::Response<super::UpdateTeamResponse>,
14730            tonic::Status,
14731        >;
14732        /** Delete a team and all its membership records. Default teams cannot be deleted.
14733 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
14734*/
14735        async fn delete_team(
14736            &self,
14737            request: tonic::Request<super::DeleteTeamRequest>,
14738        ) -> std::result::Result<
14739            tonic::Response<super::DeleteTeamResponse>,
14740            tonic::Status,
14741        >;
14742        /** Add one or more users to a team (idempotent).
14743 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
14744*/
14745        async fn add_team_members(
14746            &self,
14747            request: tonic::Request<super::AddTeamMembersRequest>,
14748        ) -> std::result::Result<
14749            tonic::Response<super::AddTeamMembersResponse>,
14750            tonic::Status,
14751        >;
14752        /** Remove one or more users from a team (idempotent).
14753 Authorization: Requires PERMISSION_TEAMS_WRITE (own teams) or PERMISSION_TEAMS_ALL_WRITE (any).
14754*/
14755        async fn remove_team_members(
14756            &self,
14757            request: tonic::Request<super::RemoveTeamMembersRequest>,
14758        ) -> std::result::Result<
14759            tonic::Response<super::RemoveTeamMembersResponse>,
14760            tonic::Status,
14761        >;
14762        /** List members of a team with pagination.
14763 Authorization: Caller must be a member of the team, or have
14764 PERMISSION_TEAMS_ALL_READ or PERMISSION_TEAMS_ALL_WRITE.
14765*/
14766        async fn list_team_members(
14767            &self,
14768            request: tonic::Request<super::ListTeamMembersRequest>,
14769        ) -> std::result::Result<
14770            tonic::Response<super::ListTeamMembersResponse>,
14771            tonic::Status,
14772        >;
14773    }
14774    /** Manages organizational teams (departments, divisions) within an organization.
14775 Teams represent the organizational structure and can serve as sender identity.
14776 All RPCs operate within the caller's org (extracted from JWT).
14777*/
14778    #[derive(Debug)]
14779    pub struct TeamServiceServer<T> {
14780        inner: Arc<T>,
14781        accept_compression_encodings: EnabledCompressionEncodings,
14782        send_compression_encodings: EnabledCompressionEncodings,
14783        max_decoding_message_size: Option<usize>,
14784        max_encoding_message_size: Option<usize>,
14785    }
14786    impl<T> TeamServiceServer<T> {
14787        pub fn new(inner: T) -> Self {
14788            Self::from_arc(Arc::new(inner))
14789        }
14790        pub fn from_arc(inner: Arc<T>) -> Self {
14791            Self {
14792                inner,
14793                accept_compression_encodings: Default::default(),
14794                send_compression_encodings: Default::default(),
14795                max_decoding_message_size: None,
14796                max_encoding_message_size: None,
14797            }
14798        }
14799        pub fn with_interceptor<F>(
14800            inner: T,
14801            interceptor: F,
14802        ) -> InterceptedService<Self, F>
14803        where
14804            F: tonic::service::Interceptor,
14805        {
14806            InterceptedService::new(Self::new(inner), interceptor)
14807        }
14808        /// Enable decompressing requests with the given encoding.
14809        #[must_use]
14810        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
14811            self.accept_compression_encodings.enable(encoding);
14812            self
14813        }
14814        /// Compress responses with the given encoding, if the client supports it.
14815        #[must_use]
14816        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
14817            self.send_compression_encodings.enable(encoding);
14818            self
14819        }
14820        /// Limits the maximum size of a decoded message.
14821        ///
14822        /// Default: `4MB`
14823        #[must_use]
14824        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
14825            self.max_decoding_message_size = Some(limit);
14826            self
14827        }
14828        /// Limits the maximum size of an encoded message.
14829        ///
14830        /// Default: `usize::MAX`
14831        #[must_use]
14832        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
14833            self.max_encoding_message_size = Some(limit);
14834            self
14835        }
14836    }
14837    impl<T, B> tonic::codegen::Service<http::Request<B>> for TeamServiceServer<T>
14838    where
14839        T: TeamService,
14840        B: Body + std::marker::Send + 'static,
14841        B::Error: Into<StdError> + std::marker::Send + 'static,
14842    {
14843        type Response = http::Response<tonic::body::Body>;
14844        type Error = std::convert::Infallible;
14845        type Future = BoxFuture<Self::Response, Self::Error>;
14846        fn poll_ready(
14847            &mut self,
14848            _cx: &mut Context<'_>,
14849        ) -> Poll<std::result::Result<(), Self::Error>> {
14850            Poll::Ready(Ok(()))
14851        }
14852        fn call(&mut self, req: http::Request<B>) -> Self::Future {
14853            match req.uri().path() {
14854                "/pidgr.v1.TeamService/CreateTeam" => {
14855                    #[allow(non_camel_case_types)]
14856                    struct CreateTeamSvc<T: TeamService>(pub Arc<T>);
14857                    impl<
14858                        T: TeamService,
14859                    > tonic::server::UnaryService<super::CreateTeamRequest>
14860                    for CreateTeamSvc<T> {
14861                        type Response = super::CreateTeamResponse;
14862                        type Future = BoxFuture<
14863                            tonic::Response<Self::Response>,
14864                            tonic::Status,
14865                        >;
14866                        fn call(
14867                            &mut self,
14868                            request: tonic::Request<super::CreateTeamRequest>,
14869                        ) -> Self::Future {
14870                            let inner = Arc::clone(&self.0);
14871                            let fut = async move {
14872                                <T as TeamService>::create_team(&inner, request).await
14873                            };
14874                            Box::pin(fut)
14875                        }
14876                    }
14877                    let accept_compression_encodings = self.accept_compression_encodings;
14878                    let send_compression_encodings = self.send_compression_encodings;
14879                    let max_decoding_message_size = self.max_decoding_message_size;
14880                    let max_encoding_message_size = self.max_encoding_message_size;
14881                    let inner = self.inner.clone();
14882                    let fut = async move {
14883                        let method = CreateTeamSvc(inner);
14884                        let codec = tonic_prost::ProstCodec::default();
14885                        let mut grpc = tonic::server::Grpc::new(codec)
14886                            .apply_compression_config(
14887                                accept_compression_encodings,
14888                                send_compression_encodings,
14889                            )
14890                            .apply_max_message_size_config(
14891                                max_decoding_message_size,
14892                                max_encoding_message_size,
14893                            );
14894                        let res = grpc.unary(method, req).await;
14895                        Ok(res)
14896                    };
14897                    Box::pin(fut)
14898                }
14899                "/pidgr.v1.TeamService/GetTeam" => {
14900                    #[allow(non_camel_case_types)]
14901                    struct GetTeamSvc<T: TeamService>(pub Arc<T>);
14902                    impl<
14903                        T: TeamService,
14904                    > tonic::server::UnaryService<super::GetTeamRequest>
14905                    for GetTeamSvc<T> {
14906                        type Response = super::GetTeamResponse;
14907                        type Future = BoxFuture<
14908                            tonic::Response<Self::Response>,
14909                            tonic::Status,
14910                        >;
14911                        fn call(
14912                            &mut self,
14913                            request: tonic::Request<super::GetTeamRequest>,
14914                        ) -> Self::Future {
14915                            let inner = Arc::clone(&self.0);
14916                            let fut = async move {
14917                                <T as TeamService>::get_team(&inner, request).await
14918                            };
14919                            Box::pin(fut)
14920                        }
14921                    }
14922                    let accept_compression_encodings = self.accept_compression_encodings;
14923                    let send_compression_encodings = self.send_compression_encodings;
14924                    let max_decoding_message_size = self.max_decoding_message_size;
14925                    let max_encoding_message_size = self.max_encoding_message_size;
14926                    let inner = self.inner.clone();
14927                    let fut = async move {
14928                        let method = GetTeamSvc(inner);
14929                        let codec = tonic_prost::ProstCodec::default();
14930                        let mut grpc = tonic::server::Grpc::new(codec)
14931                            .apply_compression_config(
14932                                accept_compression_encodings,
14933                                send_compression_encodings,
14934                            )
14935                            .apply_max_message_size_config(
14936                                max_decoding_message_size,
14937                                max_encoding_message_size,
14938                            );
14939                        let res = grpc.unary(method, req).await;
14940                        Ok(res)
14941                    };
14942                    Box::pin(fut)
14943                }
14944                "/pidgr.v1.TeamService/ListTeams" => {
14945                    #[allow(non_camel_case_types)]
14946                    struct ListTeamsSvc<T: TeamService>(pub Arc<T>);
14947                    impl<
14948                        T: TeamService,
14949                    > tonic::server::UnaryService<super::ListTeamsRequest>
14950                    for ListTeamsSvc<T> {
14951                        type Response = super::ListTeamsResponse;
14952                        type Future = BoxFuture<
14953                            tonic::Response<Self::Response>,
14954                            tonic::Status,
14955                        >;
14956                        fn call(
14957                            &mut self,
14958                            request: tonic::Request<super::ListTeamsRequest>,
14959                        ) -> Self::Future {
14960                            let inner = Arc::clone(&self.0);
14961                            let fut = async move {
14962                                <T as TeamService>::list_teams(&inner, request).await
14963                            };
14964                            Box::pin(fut)
14965                        }
14966                    }
14967                    let accept_compression_encodings = self.accept_compression_encodings;
14968                    let send_compression_encodings = self.send_compression_encodings;
14969                    let max_decoding_message_size = self.max_decoding_message_size;
14970                    let max_encoding_message_size = self.max_encoding_message_size;
14971                    let inner = self.inner.clone();
14972                    let fut = async move {
14973                        let method = ListTeamsSvc(inner);
14974                        let codec = tonic_prost::ProstCodec::default();
14975                        let mut grpc = tonic::server::Grpc::new(codec)
14976                            .apply_compression_config(
14977                                accept_compression_encodings,
14978                                send_compression_encodings,
14979                            )
14980                            .apply_max_message_size_config(
14981                                max_decoding_message_size,
14982                                max_encoding_message_size,
14983                            );
14984                        let res = grpc.unary(method, req).await;
14985                        Ok(res)
14986                    };
14987                    Box::pin(fut)
14988                }
14989                "/pidgr.v1.TeamService/UpdateTeam" => {
14990                    #[allow(non_camel_case_types)]
14991                    struct UpdateTeamSvc<T: TeamService>(pub Arc<T>);
14992                    impl<
14993                        T: TeamService,
14994                    > tonic::server::UnaryService<super::UpdateTeamRequest>
14995                    for UpdateTeamSvc<T> {
14996                        type Response = super::UpdateTeamResponse;
14997                        type Future = BoxFuture<
14998                            tonic::Response<Self::Response>,
14999                            tonic::Status,
15000                        >;
15001                        fn call(
15002                            &mut self,
15003                            request: tonic::Request<super::UpdateTeamRequest>,
15004                        ) -> Self::Future {
15005                            let inner = Arc::clone(&self.0);
15006                            let fut = async move {
15007                                <T as TeamService>::update_team(&inner, request).await
15008                            };
15009                            Box::pin(fut)
15010                        }
15011                    }
15012                    let accept_compression_encodings = self.accept_compression_encodings;
15013                    let send_compression_encodings = self.send_compression_encodings;
15014                    let max_decoding_message_size = self.max_decoding_message_size;
15015                    let max_encoding_message_size = self.max_encoding_message_size;
15016                    let inner = self.inner.clone();
15017                    let fut = async move {
15018                        let method = UpdateTeamSvc(inner);
15019                        let codec = tonic_prost::ProstCodec::default();
15020                        let mut grpc = tonic::server::Grpc::new(codec)
15021                            .apply_compression_config(
15022                                accept_compression_encodings,
15023                                send_compression_encodings,
15024                            )
15025                            .apply_max_message_size_config(
15026                                max_decoding_message_size,
15027                                max_encoding_message_size,
15028                            );
15029                        let res = grpc.unary(method, req).await;
15030                        Ok(res)
15031                    };
15032                    Box::pin(fut)
15033                }
15034                "/pidgr.v1.TeamService/DeleteTeam" => {
15035                    #[allow(non_camel_case_types)]
15036                    struct DeleteTeamSvc<T: TeamService>(pub Arc<T>);
15037                    impl<
15038                        T: TeamService,
15039                    > tonic::server::UnaryService<super::DeleteTeamRequest>
15040                    for DeleteTeamSvc<T> {
15041                        type Response = super::DeleteTeamResponse;
15042                        type Future = BoxFuture<
15043                            tonic::Response<Self::Response>,
15044                            tonic::Status,
15045                        >;
15046                        fn call(
15047                            &mut self,
15048                            request: tonic::Request<super::DeleteTeamRequest>,
15049                        ) -> Self::Future {
15050                            let inner = Arc::clone(&self.0);
15051                            let fut = async move {
15052                                <T as TeamService>::delete_team(&inner, request).await
15053                            };
15054                            Box::pin(fut)
15055                        }
15056                    }
15057                    let accept_compression_encodings = self.accept_compression_encodings;
15058                    let send_compression_encodings = self.send_compression_encodings;
15059                    let max_decoding_message_size = self.max_decoding_message_size;
15060                    let max_encoding_message_size = self.max_encoding_message_size;
15061                    let inner = self.inner.clone();
15062                    let fut = async move {
15063                        let method = DeleteTeamSvc(inner);
15064                        let codec = tonic_prost::ProstCodec::default();
15065                        let mut grpc = tonic::server::Grpc::new(codec)
15066                            .apply_compression_config(
15067                                accept_compression_encodings,
15068                                send_compression_encodings,
15069                            )
15070                            .apply_max_message_size_config(
15071                                max_decoding_message_size,
15072                                max_encoding_message_size,
15073                            );
15074                        let res = grpc.unary(method, req).await;
15075                        Ok(res)
15076                    };
15077                    Box::pin(fut)
15078                }
15079                "/pidgr.v1.TeamService/AddTeamMembers" => {
15080                    #[allow(non_camel_case_types)]
15081                    struct AddTeamMembersSvc<T: TeamService>(pub Arc<T>);
15082                    impl<
15083                        T: TeamService,
15084                    > tonic::server::UnaryService<super::AddTeamMembersRequest>
15085                    for AddTeamMembersSvc<T> {
15086                        type Response = super::AddTeamMembersResponse;
15087                        type Future = BoxFuture<
15088                            tonic::Response<Self::Response>,
15089                            tonic::Status,
15090                        >;
15091                        fn call(
15092                            &mut self,
15093                            request: tonic::Request<super::AddTeamMembersRequest>,
15094                        ) -> Self::Future {
15095                            let inner = Arc::clone(&self.0);
15096                            let fut = async move {
15097                                <T as TeamService>::add_team_members(&inner, request).await
15098                            };
15099                            Box::pin(fut)
15100                        }
15101                    }
15102                    let accept_compression_encodings = self.accept_compression_encodings;
15103                    let send_compression_encodings = self.send_compression_encodings;
15104                    let max_decoding_message_size = self.max_decoding_message_size;
15105                    let max_encoding_message_size = self.max_encoding_message_size;
15106                    let inner = self.inner.clone();
15107                    let fut = async move {
15108                        let method = AddTeamMembersSvc(inner);
15109                        let codec = tonic_prost::ProstCodec::default();
15110                        let mut grpc = tonic::server::Grpc::new(codec)
15111                            .apply_compression_config(
15112                                accept_compression_encodings,
15113                                send_compression_encodings,
15114                            )
15115                            .apply_max_message_size_config(
15116                                max_decoding_message_size,
15117                                max_encoding_message_size,
15118                            );
15119                        let res = grpc.unary(method, req).await;
15120                        Ok(res)
15121                    };
15122                    Box::pin(fut)
15123                }
15124                "/pidgr.v1.TeamService/RemoveTeamMembers" => {
15125                    #[allow(non_camel_case_types)]
15126                    struct RemoveTeamMembersSvc<T: TeamService>(pub Arc<T>);
15127                    impl<
15128                        T: TeamService,
15129                    > tonic::server::UnaryService<super::RemoveTeamMembersRequest>
15130                    for RemoveTeamMembersSvc<T> {
15131                        type Response = super::RemoveTeamMembersResponse;
15132                        type Future = BoxFuture<
15133                            tonic::Response<Self::Response>,
15134                            tonic::Status,
15135                        >;
15136                        fn call(
15137                            &mut self,
15138                            request: tonic::Request<super::RemoveTeamMembersRequest>,
15139                        ) -> Self::Future {
15140                            let inner = Arc::clone(&self.0);
15141                            let fut = async move {
15142                                <T as TeamService>::remove_team_members(&inner, request)
15143                                    .await
15144                            };
15145                            Box::pin(fut)
15146                        }
15147                    }
15148                    let accept_compression_encodings = self.accept_compression_encodings;
15149                    let send_compression_encodings = self.send_compression_encodings;
15150                    let max_decoding_message_size = self.max_decoding_message_size;
15151                    let max_encoding_message_size = self.max_encoding_message_size;
15152                    let inner = self.inner.clone();
15153                    let fut = async move {
15154                        let method = RemoveTeamMembersSvc(inner);
15155                        let codec = tonic_prost::ProstCodec::default();
15156                        let mut grpc = tonic::server::Grpc::new(codec)
15157                            .apply_compression_config(
15158                                accept_compression_encodings,
15159                                send_compression_encodings,
15160                            )
15161                            .apply_max_message_size_config(
15162                                max_decoding_message_size,
15163                                max_encoding_message_size,
15164                            );
15165                        let res = grpc.unary(method, req).await;
15166                        Ok(res)
15167                    };
15168                    Box::pin(fut)
15169                }
15170                "/pidgr.v1.TeamService/ListTeamMembers" => {
15171                    #[allow(non_camel_case_types)]
15172                    struct ListTeamMembersSvc<T: TeamService>(pub Arc<T>);
15173                    impl<
15174                        T: TeamService,
15175                    > tonic::server::UnaryService<super::ListTeamMembersRequest>
15176                    for ListTeamMembersSvc<T> {
15177                        type Response = super::ListTeamMembersResponse;
15178                        type Future = BoxFuture<
15179                            tonic::Response<Self::Response>,
15180                            tonic::Status,
15181                        >;
15182                        fn call(
15183                            &mut self,
15184                            request: tonic::Request<super::ListTeamMembersRequest>,
15185                        ) -> Self::Future {
15186                            let inner = Arc::clone(&self.0);
15187                            let fut = async move {
15188                                <T as TeamService>::list_team_members(&inner, request).await
15189                            };
15190                            Box::pin(fut)
15191                        }
15192                    }
15193                    let accept_compression_encodings = self.accept_compression_encodings;
15194                    let send_compression_encodings = self.send_compression_encodings;
15195                    let max_decoding_message_size = self.max_decoding_message_size;
15196                    let max_encoding_message_size = self.max_encoding_message_size;
15197                    let inner = self.inner.clone();
15198                    let fut = async move {
15199                        let method = ListTeamMembersSvc(inner);
15200                        let codec = tonic_prost::ProstCodec::default();
15201                        let mut grpc = tonic::server::Grpc::new(codec)
15202                            .apply_compression_config(
15203                                accept_compression_encodings,
15204                                send_compression_encodings,
15205                            )
15206                            .apply_max_message_size_config(
15207                                max_decoding_message_size,
15208                                max_encoding_message_size,
15209                            );
15210                        let res = grpc.unary(method, req).await;
15211                        Ok(res)
15212                    };
15213                    Box::pin(fut)
15214                }
15215                _ => {
15216                    Box::pin(async move {
15217                        let mut response = http::Response::new(
15218                            tonic::body::Body::default(),
15219                        );
15220                        let headers = response.headers_mut();
15221                        headers
15222                            .insert(
15223                                tonic::Status::GRPC_STATUS,
15224                                (tonic::Code::Unimplemented as i32).into(),
15225                            );
15226                        headers
15227                            .insert(
15228                                http::header::CONTENT_TYPE,
15229                                tonic::metadata::GRPC_CONTENT_TYPE,
15230                            );
15231                        Ok(response)
15232                    })
15233                }
15234            }
15235        }
15236    }
15237    impl<T> Clone for TeamServiceServer<T> {
15238        fn clone(&self) -> Self {
15239            let inner = self.inner.clone();
15240            Self {
15241                inner,
15242                accept_compression_encodings: self.accept_compression_encodings,
15243                send_compression_encodings: self.send_compression_encodings,
15244                max_decoding_message_size: self.max_decoding_message_size,
15245                max_encoding_message_size: self.max_encoding_message_size,
15246            }
15247        }
15248    }
15249    /// Generated gRPC service name
15250    pub const SERVICE_NAME: &str = "pidgr.v1.TeamService";
15251    impl<T> tonic::server::NamedService for TeamServiceServer<T> {
15252        const NAME: &'static str = SERVICE_NAME;
15253    }
15254}
15255/// Generated client implementations.
15256pub mod template_service_client {
15257    #![allow(
15258        unused_variables,
15259        dead_code,
15260        missing_docs,
15261        clippy::wildcard_imports,
15262        clippy::let_unit_value,
15263    )]
15264    use tonic::codegen::*;
15265    use tonic::codegen::http::Uri;
15266    /** Manages versioned message templates used by campaigns.
15267 Templates are append-only — updates create new versions while preserving history.
15268*/
15269    #[derive(Debug, Clone)]
15270    pub struct TemplateServiceClient<T> {
15271        inner: tonic::client::Grpc<T>,
15272    }
15273    impl TemplateServiceClient<tonic::transport::Channel> {
15274        /// Attempt to create a new client by connecting to a given endpoint.
15275        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
15276        where
15277            D: TryInto<tonic::transport::Endpoint>,
15278            D::Error: Into<StdError>,
15279        {
15280            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
15281            Ok(Self::new(conn))
15282        }
15283    }
15284    impl<T> TemplateServiceClient<T>
15285    where
15286        T: tonic::client::GrpcService<tonic::body::Body>,
15287        T::Error: Into<StdError>,
15288        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
15289        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
15290    {
15291        pub fn new(inner: T) -> Self {
15292            let inner = tonic::client::Grpc::new(inner);
15293            Self { inner }
15294        }
15295        pub fn with_origin(inner: T, origin: Uri) -> Self {
15296            let inner = tonic::client::Grpc::with_origin(inner, origin);
15297            Self { inner }
15298        }
15299        pub fn with_interceptor<F>(
15300            inner: T,
15301            interceptor: F,
15302        ) -> TemplateServiceClient<InterceptedService<T, F>>
15303        where
15304            F: tonic::service::Interceptor,
15305            T::ResponseBody: Default,
15306            T: tonic::codegen::Service<
15307                http::Request<tonic::body::Body>,
15308                Response = http::Response<
15309                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
15310                >,
15311            >,
15312            <T as tonic::codegen::Service<
15313                http::Request<tonic::body::Body>,
15314            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
15315        {
15316            TemplateServiceClient::new(InterceptedService::new(inner, interceptor))
15317        }
15318        /// Compress requests with the given encoding.
15319        ///
15320        /// This requires the server to support it otherwise it might respond with an
15321        /// error.
15322        #[must_use]
15323        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
15324            self.inner = self.inner.send_compressed(encoding);
15325            self
15326        }
15327        /// Enable decompressing responses.
15328        #[must_use]
15329        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
15330            self.inner = self.inner.accept_compressed(encoding);
15331            self
15332        }
15333        /// Limits the maximum size of a decoded message.
15334        ///
15335        /// Default: `4MB`
15336        #[must_use]
15337        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
15338            self.inner = self.inner.max_decoding_message_size(limit);
15339            self
15340        }
15341        /// Limits the maximum size of an encoded message.
15342        ///
15343        /// Default: `usize::MAX`
15344        #[must_use]
15345        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
15346            self.inner = self.inner.max_encoding_message_size(limit);
15347            self
15348        }
15349        /** Create a new template with a body and variable definitions.
15350 Authorization: Requires MANAGER+ role.
15351*/
15352        pub async fn create_template(
15353            &mut self,
15354            request: impl tonic::IntoRequest<super::CreateTemplateRequest>,
15355        ) -> std::result::Result<
15356            tonic::Response<super::CreateTemplateResponse>,
15357            tonic::Status,
15358        > {
15359            self.inner
15360                .ready()
15361                .await
15362                .map_err(|e| {
15363                    tonic::Status::unknown(
15364                        format!("Service was not ready: {}", e.into()),
15365                    )
15366                })?;
15367            let codec = tonic_prost::ProstCodec::default();
15368            let path = http::uri::PathAndQuery::from_static(
15369                "/pidgr.v1.TemplateService/CreateTemplate",
15370            );
15371            let mut req = request.into_request();
15372            req.extensions_mut()
15373                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "CreateTemplate"));
15374            self.inner.unary(req, path, codec).await
15375        }
15376        /** Update an existing template, creating a new version.
15377 Authorization: Requires MANAGER+ role.
15378*/
15379        pub async fn update_template(
15380            &mut self,
15381            request: impl tonic::IntoRequest<super::UpdateTemplateRequest>,
15382        ) -> std::result::Result<
15383            tonic::Response<super::UpdateTemplateResponse>,
15384            tonic::Status,
15385        > {
15386            self.inner
15387                .ready()
15388                .await
15389                .map_err(|e| {
15390                    tonic::Status::unknown(
15391                        format!("Service was not ready: {}", e.into()),
15392                    )
15393                })?;
15394            let codec = tonic_prost::ProstCodec::default();
15395            let path = http::uri::PathAndQuery::from_static(
15396                "/pidgr.v1.TemplateService/UpdateTemplate",
15397            );
15398            let mut req = request.into_request();
15399            req.extensions_mut()
15400                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "UpdateTemplate"));
15401            self.inner.unary(req, path, codec).await
15402        }
15403        /** Retrieve a specific template by ID and optional version.
15404 Authorization: Authenticated user within the organization.
15405*/
15406        pub async fn get_template(
15407            &mut self,
15408            request: impl tonic::IntoRequest<super::GetTemplateRequest>,
15409        ) -> std::result::Result<
15410            tonic::Response<super::GetTemplateResponse>,
15411            tonic::Status,
15412        > {
15413            self.inner
15414                .ready()
15415                .await
15416                .map_err(|e| {
15417                    tonic::Status::unknown(
15418                        format!("Service was not ready: {}", e.into()),
15419                    )
15420                })?;
15421            let codec = tonic_prost::ProstCodec::default();
15422            let path = http::uri::PathAndQuery::from_static(
15423                "/pidgr.v1.TemplateService/GetTemplate",
15424            );
15425            let mut req = request.into_request();
15426            req.extensions_mut()
15427                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "GetTemplate"));
15428            self.inner.unary(req, path, codec).await
15429        }
15430        /** List all templates for the organization with pagination.
15431 Authorization: Authenticated user within the organization.
15432*/
15433        pub async fn list_templates(
15434            &mut self,
15435            request: impl tonic::IntoRequest<super::ListTemplatesRequest>,
15436        ) -> std::result::Result<
15437            tonic::Response<super::ListTemplatesResponse>,
15438            tonic::Status,
15439        > {
15440            self.inner
15441                .ready()
15442                .await
15443                .map_err(|e| {
15444                    tonic::Status::unknown(
15445                        format!("Service was not ready: {}", e.into()),
15446                    )
15447                })?;
15448            let codec = tonic_prost::ProstCodec::default();
15449            let path = http::uri::PathAndQuery::from_static(
15450                "/pidgr.v1.TemplateService/ListTemplates",
15451            );
15452            let mut req = request.into_request();
15453            req.extensions_mut()
15454                .insert(GrpcMethod::new("pidgr.v1.TemplateService", "ListTemplates"));
15455            self.inner.unary(req, path, codec).await
15456        }
15457        /** Create a locale-specific translation of a template.
15458 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
15459*/
15460        pub async fn create_template_translation(
15461            &mut self,
15462            request: impl tonic::IntoRequest<super::CreateTemplateTranslationRequest>,
15463        ) -> std::result::Result<
15464            tonic::Response<super::CreateTemplateTranslationResponse>,
15465            tonic::Status,
15466        > {
15467            self.inner
15468                .ready()
15469                .await
15470                .map_err(|e| {
15471                    tonic::Status::unknown(
15472                        format!("Service was not ready: {}", e.into()),
15473                    )
15474                })?;
15475            let codec = tonic_prost::ProstCodec::default();
15476            let path = http::uri::PathAndQuery::from_static(
15477                "/pidgr.v1.TemplateService/CreateTemplateTranslation",
15478            );
15479            let mut req = request.into_request();
15480            req.extensions_mut()
15481                .insert(
15482                    GrpcMethod::new(
15483                        "pidgr.v1.TemplateService",
15484                        "CreateTemplateTranslation",
15485                    ),
15486                );
15487            self.inner.unary(req, path, codec).await
15488        }
15489        /** Update an existing template translation.
15490 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
15491*/
15492        pub async fn update_template_translation(
15493            &mut self,
15494            request: impl tonic::IntoRequest<super::UpdateTemplateTranslationRequest>,
15495        ) -> std::result::Result<
15496            tonic::Response<super::UpdateTemplateTranslationResponse>,
15497            tonic::Status,
15498        > {
15499            self.inner
15500                .ready()
15501                .await
15502                .map_err(|e| {
15503                    tonic::Status::unknown(
15504                        format!("Service was not ready: {}", e.into()),
15505                    )
15506                })?;
15507            let codec = tonic_prost::ProstCodec::default();
15508            let path = http::uri::PathAndQuery::from_static(
15509                "/pidgr.v1.TemplateService/UpdateTemplateTranslation",
15510            );
15511            let mut req = request.into_request();
15512            req.extensions_mut()
15513                .insert(
15514                    GrpcMethod::new(
15515                        "pidgr.v1.TemplateService",
15516                        "UpdateTemplateTranslation",
15517                    ),
15518                );
15519            self.inner.unary(req, path, codec).await
15520        }
15521        /** List all translations for a template version.
15522 Authorization: Requires PERMISSION_TEMPLATES_READ.
15523*/
15524        pub async fn list_template_translations(
15525            &mut self,
15526            request: impl tonic::IntoRequest<super::ListTemplateTranslationsRequest>,
15527        ) -> std::result::Result<
15528            tonic::Response<super::ListTemplateTranslationsResponse>,
15529            tonic::Status,
15530        > {
15531            self.inner
15532                .ready()
15533                .await
15534                .map_err(|e| {
15535                    tonic::Status::unknown(
15536                        format!("Service was not ready: {}", e.into()),
15537                    )
15538                })?;
15539            let codec = tonic_prost::ProstCodec::default();
15540            let path = http::uri::PathAndQuery::from_static(
15541                "/pidgr.v1.TemplateService/ListTemplateTranslations",
15542            );
15543            let mut req = request.into_request();
15544            req.extensions_mut()
15545                .insert(
15546                    GrpcMethod::new(
15547                        "pidgr.v1.TemplateService",
15548                        "ListTemplateTranslations",
15549                    ),
15550                );
15551            self.inner.unary(req, path, codec).await
15552        }
15553        /** Approve a template translation for use in campaigns.
15554 Authorization: Requires PERMISSION_TEMPLATES_REVIEW.
15555*/
15556        pub async fn approve_template_translation(
15557            &mut self,
15558            request: impl tonic::IntoRequest<super::ApproveTemplateTranslationRequest>,
15559        ) -> std::result::Result<
15560            tonic::Response<super::ApproveTemplateTranslationResponse>,
15561            tonic::Status,
15562        > {
15563            self.inner
15564                .ready()
15565                .await
15566                .map_err(|e| {
15567                    tonic::Status::unknown(
15568                        format!("Service was not ready: {}", e.into()),
15569                    )
15570                })?;
15571            let codec = tonic_prost::ProstCodec::default();
15572            let path = http::uri::PathAndQuery::from_static(
15573                "/pidgr.v1.TemplateService/ApproveTemplateTranslation",
15574            );
15575            let mut req = request.into_request();
15576            req.extensions_mut()
15577                .insert(
15578                    GrpcMethod::new(
15579                        "pidgr.v1.TemplateService",
15580                        "ApproveTemplateTranslation",
15581                    ),
15582                );
15583            self.inner.unary(req, path, codec).await
15584        }
15585    }
15586}
15587/// Generated server implementations.
15588pub mod template_service_server {
15589    #![allow(
15590        unused_variables,
15591        dead_code,
15592        missing_docs,
15593        clippy::wildcard_imports,
15594        clippy::let_unit_value,
15595    )]
15596    use tonic::codegen::*;
15597    /// Generated trait containing gRPC methods that should be implemented for use with TemplateServiceServer.
15598    #[async_trait]
15599    pub trait TemplateService: std::marker::Send + std::marker::Sync + 'static {
15600        /** Create a new template with a body and variable definitions.
15601 Authorization: Requires MANAGER+ role.
15602*/
15603        async fn create_template(
15604            &self,
15605            request: tonic::Request<super::CreateTemplateRequest>,
15606        ) -> std::result::Result<
15607            tonic::Response<super::CreateTemplateResponse>,
15608            tonic::Status,
15609        >;
15610        /** Update an existing template, creating a new version.
15611 Authorization: Requires MANAGER+ role.
15612*/
15613        async fn update_template(
15614            &self,
15615            request: tonic::Request<super::UpdateTemplateRequest>,
15616        ) -> std::result::Result<
15617            tonic::Response<super::UpdateTemplateResponse>,
15618            tonic::Status,
15619        >;
15620        /** Retrieve a specific template by ID and optional version.
15621 Authorization: Authenticated user within the organization.
15622*/
15623        async fn get_template(
15624            &self,
15625            request: tonic::Request<super::GetTemplateRequest>,
15626        ) -> std::result::Result<
15627            tonic::Response<super::GetTemplateResponse>,
15628            tonic::Status,
15629        >;
15630        /** List all templates for the organization with pagination.
15631 Authorization: Authenticated user within the organization.
15632*/
15633        async fn list_templates(
15634            &self,
15635            request: tonic::Request<super::ListTemplatesRequest>,
15636        ) -> std::result::Result<
15637            tonic::Response<super::ListTemplatesResponse>,
15638            tonic::Status,
15639        >;
15640        /** Create a locale-specific translation of a template.
15641 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
15642*/
15643        async fn create_template_translation(
15644            &self,
15645            request: tonic::Request<super::CreateTemplateTranslationRequest>,
15646        ) -> std::result::Result<
15647            tonic::Response<super::CreateTemplateTranslationResponse>,
15648            tonic::Status,
15649        >;
15650        /** Update an existing template translation.
15651 Authorization: Requires PERMISSION_TEMPLATES_WRITE.
15652*/
15653        async fn update_template_translation(
15654            &self,
15655            request: tonic::Request<super::UpdateTemplateTranslationRequest>,
15656        ) -> std::result::Result<
15657            tonic::Response<super::UpdateTemplateTranslationResponse>,
15658            tonic::Status,
15659        >;
15660        /** List all translations for a template version.
15661 Authorization: Requires PERMISSION_TEMPLATES_READ.
15662*/
15663        async fn list_template_translations(
15664            &self,
15665            request: tonic::Request<super::ListTemplateTranslationsRequest>,
15666        ) -> std::result::Result<
15667            tonic::Response<super::ListTemplateTranslationsResponse>,
15668            tonic::Status,
15669        >;
15670        /** Approve a template translation for use in campaigns.
15671 Authorization: Requires PERMISSION_TEMPLATES_REVIEW.
15672*/
15673        async fn approve_template_translation(
15674            &self,
15675            request: tonic::Request<super::ApproveTemplateTranslationRequest>,
15676        ) -> std::result::Result<
15677            tonic::Response<super::ApproveTemplateTranslationResponse>,
15678            tonic::Status,
15679        >;
15680    }
15681    /** Manages versioned message templates used by campaigns.
15682 Templates are append-only — updates create new versions while preserving history.
15683*/
15684    #[derive(Debug)]
15685    pub struct TemplateServiceServer<T> {
15686        inner: Arc<T>,
15687        accept_compression_encodings: EnabledCompressionEncodings,
15688        send_compression_encodings: EnabledCompressionEncodings,
15689        max_decoding_message_size: Option<usize>,
15690        max_encoding_message_size: Option<usize>,
15691    }
15692    impl<T> TemplateServiceServer<T> {
15693        pub fn new(inner: T) -> Self {
15694            Self::from_arc(Arc::new(inner))
15695        }
15696        pub fn from_arc(inner: Arc<T>) -> Self {
15697            Self {
15698                inner,
15699                accept_compression_encodings: Default::default(),
15700                send_compression_encodings: Default::default(),
15701                max_decoding_message_size: None,
15702                max_encoding_message_size: None,
15703            }
15704        }
15705        pub fn with_interceptor<F>(
15706            inner: T,
15707            interceptor: F,
15708        ) -> InterceptedService<Self, F>
15709        where
15710            F: tonic::service::Interceptor,
15711        {
15712            InterceptedService::new(Self::new(inner), interceptor)
15713        }
15714        /// Enable decompressing requests with the given encoding.
15715        #[must_use]
15716        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
15717            self.accept_compression_encodings.enable(encoding);
15718            self
15719        }
15720        /// Compress responses with the given encoding, if the client supports it.
15721        #[must_use]
15722        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
15723            self.send_compression_encodings.enable(encoding);
15724            self
15725        }
15726        /// Limits the maximum size of a decoded message.
15727        ///
15728        /// Default: `4MB`
15729        #[must_use]
15730        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
15731            self.max_decoding_message_size = Some(limit);
15732            self
15733        }
15734        /// Limits the maximum size of an encoded message.
15735        ///
15736        /// Default: `usize::MAX`
15737        #[must_use]
15738        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
15739            self.max_encoding_message_size = Some(limit);
15740            self
15741        }
15742    }
15743    impl<T, B> tonic::codegen::Service<http::Request<B>> for TemplateServiceServer<T>
15744    where
15745        T: TemplateService,
15746        B: Body + std::marker::Send + 'static,
15747        B::Error: Into<StdError> + std::marker::Send + 'static,
15748    {
15749        type Response = http::Response<tonic::body::Body>;
15750        type Error = std::convert::Infallible;
15751        type Future = BoxFuture<Self::Response, Self::Error>;
15752        fn poll_ready(
15753            &mut self,
15754            _cx: &mut Context<'_>,
15755        ) -> Poll<std::result::Result<(), Self::Error>> {
15756            Poll::Ready(Ok(()))
15757        }
15758        fn call(&mut self, req: http::Request<B>) -> Self::Future {
15759            match req.uri().path() {
15760                "/pidgr.v1.TemplateService/CreateTemplate" => {
15761                    #[allow(non_camel_case_types)]
15762                    struct CreateTemplateSvc<T: TemplateService>(pub Arc<T>);
15763                    impl<
15764                        T: TemplateService,
15765                    > tonic::server::UnaryService<super::CreateTemplateRequest>
15766                    for CreateTemplateSvc<T> {
15767                        type Response = super::CreateTemplateResponse;
15768                        type Future = BoxFuture<
15769                            tonic::Response<Self::Response>,
15770                            tonic::Status,
15771                        >;
15772                        fn call(
15773                            &mut self,
15774                            request: tonic::Request<super::CreateTemplateRequest>,
15775                        ) -> Self::Future {
15776                            let inner = Arc::clone(&self.0);
15777                            let fut = async move {
15778                                <T as TemplateService>::create_template(&inner, request)
15779                                    .await
15780                            };
15781                            Box::pin(fut)
15782                        }
15783                    }
15784                    let accept_compression_encodings = self.accept_compression_encodings;
15785                    let send_compression_encodings = self.send_compression_encodings;
15786                    let max_decoding_message_size = self.max_decoding_message_size;
15787                    let max_encoding_message_size = self.max_encoding_message_size;
15788                    let inner = self.inner.clone();
15789                    let fut = async move {
15790                        let method = CreateTemplateSvc(inner);
15791                        let codec = tonic_prost::ProstCodec::default();
15792                        let mut grpc = tonic::server::Grpc::new(codec)
15793                            .apply_compression_config(
15794                                accept_compression_encodings,
15795                                send_compression_encodings,
15796                            )
15797                            .apply_max_message_size_config(
15798                                max_decoding_message_size,
15799                                max_encoding_message_size,
15800                            );
15801                        let res = grpc.unary(method, req).await;
15802                        Ok(res)
15803                    };
15804                    Box::pin(fut)
15805                }
15806                "/pidgr.v1.TemplateService/UpdateTemplate" => {
15807                    #[allow(non_camel_case_types)]
15808                    struct UpdateTemplateSvc<T: TemplateService>(pub Arc<T>);
15809                    impl<
15810                        T: TemplateService,
15811                    > tonic::server::UnaryService<super::UpdateTemplateRequest>
15812                    for UpdateTemplateSvc<T> {
15813                        type Response = super::UpdateTemplateResponse;
15814                        type Future = BoxFuture<
15815                            tonic::Response<Self::Response>,
15816                            tonic::Status,
15817                        >;
15818                        fn call(
15819                            &mut self,
15820                            request: tonic::Request<super::UpdateTemplateRequest>,
15821                        ) -> Self::Future {
15822                            let inner = Arc::clone(&self.0);
15823                            let fut = async move {
15824                                <T as TemplateService>::update_template(&inner, request)
15825                                    .await
15826                            };
15827                            Box::pin(fut)
15828                        }
15829                    }
15830                    let accept_compression_encodings = self.accept_compression_encodings;
15831                    let send_compression_encodings = self.send_compression_encodings;
15832                    let max_decoding_message_size = self.max_decoding_message_size;
15833                    let max_encoding_message_size = self.max_encoding_message_size;
15834                    let inner = self.inner.clone();
15835                    let fut = async move {
15836                        let method = UpdateTemplateSvc(inner);
15837                        let codec = tonic_prost::ProstCodec::default();
15838                        let mut grpc = tonic::server::Grpc::new(codec)
15839                            .apply_compression_config(
15840                                accept_compression_encodings,
15841                                send_compression_encodings,
15842                            )
15843                            .apply_max_message_size_config(
15844                                max_decoding_message_size,
15845                                max_encoding_message_size,
15846                            );
15847                        let res = grpc.unary(method, req).await;
15848                        Ok(res)
15849                    };
15850                    Box::pin(fut)
15851                }
15852                "/pidgr.v1.TemplateService/GetTemplate" => {
15853                    #[allow(non_camel_case_types)]
15854                    struct GetTemplateSvc<T: TemplateService>(pub Arc<T>);
15855                    impl<
15856                        T: TemplateService,
15857                    > tonic::server::UnaryService<super::GetTemplateRequest>
15858                    for GetTemplateSvc<T> {
15859                        type Response = super::GetTemplateResponse;
15860                        type Future = BoxFuture<
15861                            tonic::Response<Self::Response>,
15862                            tonic::Status,
15863                        >;
15864                        fn call(
15865                            &mut self,
15866                            request: tonic::Request<super::GetTemplateRequest>,
15867                        ) -> Self::Future {
15868                            let inner = Arc::clone(&self.0);
15869                            let fut = async move {
15870                                <T as TemplateService>::get_template(&inner, request).await
15871                            };
15872                            Box::pin(fut)
15873                        }
15874                    }
15875                    let accept_compression_encodings = self.accept_compression_encodings;
15876                    let send_compression_encodings = self.send_compression_encodings;
15877                    let max_decoding_message_size = self.max_decoding_message_size;
15878                    let max_encoding_message_size = self.max_encoding_message_size;
15879                    let inner = self.inner.clone();
15880                    let fut = async move {
15881                        let method = GetTemplateSvc(inner);
15882                        let codec = tonic_prost::ProstCodec::default();
15883                        let mut grpc = tonic::server::Grpc::new(codec)
15884                            .apply_compression_config(
15885                                accept_compression_encodings,
15886                                send_compression_encodings,
15887                            )
15888                            .apply_max_message_size_config(
15889                                max_decoding_message_size,
15890                                max_encoding_message_size,
15891                            );
15892                        let res = grpc.unary(method, req).await;
15893                        Ok(res)
15894                    };
15895                    Box::pin(fut)
15896                }
15897                "/pidgr.v1.TemplateService/ListTemplates" => {
15898                    #[allow(non_camel_case_types)]
15899                    struct ListTemplatesSvc<T: TemplateService>(pub Arc<T>);
15900                    impl<
15901                        T: TemplateService,
15902                    > tonic::server::UnaryService<super::ListTemplatesRequest>
15903                    for ListTemplatesSvc<T> {
15904                        type Response = super::ListTemplatesResponse;
15905                        type Future = BoxFuture<
15906                            tonic::Response<Self::Response>,
15907                            tonic::Status,
15908                        >;
15909                        fn call(
15910                            &mut self,
15911                            request: tonic::Request<super::ListTemplatesRequest>,
15912                        ) -> Self::Future {
15913                            let inner = Arc::clone(&self.0);
15914                            let fut = async move {
15915                                <T as TemplateService>::list_templates(&inner, request)
15916                                    .await
15917                            };
15918                            Box::pin(fut)
15919                        }
15920                    }
15921                    let accept_compression_encodings = self.accept_compression_encodings;
15922                    let send_compression_encodings = self.send_compression_encodings;
15923                    let max_decoding_message_size = self.max_decoding_message_size;
15924                    let max_encoding_message_size = self.max_encoding_message_size;
15925                    let inner = self.inner.clone();
15926                    let fut = async move {
15927                        let method = ListTemplatesSvc(inner);
15928                        let codec = tonic_prost::ProstCodec::default();
15929                        let mut grpc = tonic::server::Grpc::new(codec)
15930                            .apply_compression_config(
15931                                accept_compression_encodings,
15932                                send_compression_encodings,
15933                            )
15934                            .apply_max_message_size_config(
15935                                max_decoding_message_size,
15936                                max_encoding_message_size,
15937                            );
15938                        let res = grpc.unary(method, req).await;
15939                        Ok(res)
15940                    };
15941                    Box::pin(fut)
15942                }
15943                "/pidgr.v1.TemplateService/CreateTemplateTranslation" => {
15944                    #[allow(non_camel_case_types)]
15945                    struct CreateTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
15946                    impl<
15947                        T: TemplateService,
15948                    > tonic::server::UnaryService<
15949                        super::CreateTemplateTranslationRequest,
15950                    > for CreateTemplateTranslationSvc<T> {
15951                        type Response = super::CreateTemplateTranslationResponse;
15952                        type Future = BoxFuture<
15953                            tonic::Response<Self::Response>,
15954                            tonic::Status,
15955                        >;
15956                        fn call(
15957                            &mut self,
15958                            request: tonic::Request<
15959                                super::CreateTemplateTranslationRequest,
15960                            >,
15961                        ) -> Self::Future {
15962                            let inner = Arc::clone(&self.0);
15963                            let fut = async move {
15964                                <T as TemplateService>::create_template_translation(
15965                                        &inner,
15966                                        request,
15967                                    )
15968                                    .await
15969                            };
15970                            Box::pin(fut)
15971                        }
15972                    }
15973                    let accept_compression_encodings = self.accept_compression_encodings;
15974                    let send_compression_encodings = self.send_compression_encodings;
15975                    let max_decoding_message_size = self.max_decoding_message_size;
15976                    let max_encoding_message_size = self.max_encoding_message_size;
15977                    let inner = self.inner.clone();
15978                    let fut = async move {
15979                        let method = CreateTemplateTranslationSvc(inner);
15980                        let codec = tonic_prost::ProstCodec::default();
15981                        let mut grpc = tonic::server::Grpc::new(codec)
15982                            .apply_compression_config(
15983                                accept_compression_encodings,
15984                                send_compression_encodings,
15985                            )
15986                            .apply_max_message_size_config(
15987                                max_decoding_message_size,
15988                                max_encoding_message_size,
15989                            );
15990                        let res = grpc.unary(method, req).await;
15991                        Ok(res)
15992                    };
15993                    Box::pin(fut)
15994                }
15995                "/pidgr.v1.TemplateService/UpdateTemplateTranslation" => {
15996                    #[allow(non_camel_case_types)]
15997                    struct UpdateTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
15998                    impl<
15999                        T: TemplateService,
16000                    > tonic::server::UnaryService<
16001                        super::UpdateTemplateTranslationRequest,
16002                    > for UpdateTemplateTranslationSvc<T> {
16003                        type Response = super::UpdateTemplateTranslationResponse;
16004                        type Future = BoxFuture<
16005                            tonic::Response<Self::Response>,
16006                            tonic::Status,
16007                        >;
16008                        fn call(
16009                            &mut self,
16010                            request: tonic::Request<
16011                                super::UpdateTemplateTranslationRequest,
16012                            >,
16013                        ) -> Self::Future {
16014                            let inner = Arc::clone(&self.0);
16015                            let fut = async move {
16016                                <T as TemplateService>::update_template_translation(
16017                                        &inner,
16018                                        request,
16019                                    )
16020                                    .await
16021                            };
16022                            Box::pin(fut)
16023                        }
16024                    }
16025                    let accept_compression_encodings = self.accept_compression_encodings;
16026                    let send_compression_encodings = self.send_compression_encodings;
16027                    let max_decoding_message_size = self.max_decoding_message_size;
16028                    let max_encoding_message_size = self.max_encoding_message_size;
16029                    let inner = self.inner.clone();
16030                    let fut = async move {
16031                        let method = UpdateTemplateTranslationSvc(inner);
16032                        let codec = tonic_prost::ProstCodec::default();
16033                        let mut grpc = tonic::server::Grpc::new(codec)
16034                            .apply_compression_config(
16035                                accept_compression_encodings,
16036                                send_compression_encodings,
16037                            )
16038                            .apply_max_message_size_config(
16039                                max_decoding_message_size,
16040                                max_encoding_message_size,
16041                            );
16042                        let res = grpc.unary(method, req).await;
16043                        Ok(res)
16044                    };
16045                    Box::pin(fut)
16046                }
16047                "/pidgr.v1.TemplateService/ListTemplateTranslations" => {
16048                    #[allow(non_camel_case_types)]
16049                    struct ListTemplateTranslationsSvc<T: TemplateService>(pub Arc<T>);
16050                    impl<
16051                        T: TemplateService,
16052                    > tonic::server::UnaryService<super::ListTemplateTranslationsRequest>
16053                    for ListTemplateTranslationsSvc<T> {
16054                        type Response = super::ListTemplateTranslationsResponse;
16055                        type Future = BoxFuture<
16056                            tonic::Response<Self::Response>,
16057                            tonic::Status,
16058                        >;
16059                        fn call(
16060                            &mut self,
16061                            request: tonic::Request<
16062                                super::ListTemplateTranslationsRequest,
16063                            >,
16064                        ) -> Self::Future {
16065                            let inner = Arc::clone(&self.0);
16066                            let fut = async move {
16067                                <T as TemplateService>::list_template_translations(
16068                                        &inner,
16069                                        request,
16070                                    )
16071                                    .await
16072                            };
16073                            Box::pin(fut)
16074                        }
16075                    }
16076                    let accept_compression_encodings = self.accept_compression_encodings;
16077                    let send_compression_encodings = self.send_compression_encodings;
16078                    let max_decoding_message_size = self.max_decoding_message_size;
16079                    let max_encoding_message_size = self.max_encoding_message_size;
16080                    let inner = self.inner.clone();
16081                    let fut = async move {
16082                        let method = ListTemplateTranslationsSvc(inner);
16083                        let codec = tonic_prost::ProstCodec::default();
16084                        let mut grpc = tonic::server::Grpc::new(codec)
16085                            .apply_compression_config(
16086                                accept_compression_encodings,
16087                                send_compression_encodings,
16088                            )
16089                            .apply_max_message_size_config(
16090                                max_decoding_message_size,
16091                                max_encoding_message_size,
16092                            );
16093                        let res = grpc.unary(method, req).await;
16094                        Ok(res)
16095                    };
16096                    Box::pin(fut)
16097                }
16098                "/pidgr.v1.TemplateService/ApproveTemplateTranslation" => {
16099                    #[allow(non_camel_case_types)]
16100                    struct ApproveTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
16101                    impl<
16102                        T: TemplateService,
16103                    > tonic::server::UnaryService<
16104                        super::ApproveTemplateTranslationRequest,
16105                    > for ApproveTemplateTranslationSvc<T> {
16106                        type Response = super::ApproveTemplateTranslationResponse;
16107                        type Future = BoxFuture<
16108                            tonic::Response<Self::Response>,
16109                            tonic::Status,
16110                        >;
16111                        fn call(
16112                            &mut self,
16113                            request: tonic::Request<
16114                                super::ApproveTemplateTranslationRequest,
16115                            >,
16116                        ) -> Self::Future {
16117                            let inner = Arc::clone(&self.0);
16118                            let fut = async move {
16119                                <T as TemplateService>::approve_template_translation(
16120                                        &inner,
16121                                        request,
16122                                    )
16123                                    .await
16124                            };
16125                            Box::pin(fut)
16126                        }
16127                    }
16128                    let accept_compression_encodings = self.accept_compression_encodings;
16129                    let send_compression_encodings = self.send_compression_encodings;
16130                    let max_decoding_message_size = self.max_decoding_message_size;
16131                    let max_encoding_message_size = self.max_encoding_message_size;
16132                    let inner = self.inner.clone();
16133                    let fut = async move {
16134                        let method = ApproveTemplateTranslationSvc(inner);
16135                        let codec = tonic_prost::ProstCodec::default();
16136                        let mut grpc = tonic::server::Grpc::new(codec)
16137                            .apply_compression_config(
16138                                accept_compression_encodings,
16139                                send_compression_encodings,
16140                            )
16141                            .apply_max_message_size_config(
16142                                max_decoding_message_size,
16143                                max_encoding_message_size,
16144                            );
16145                        let res = grpc.unary(method, req).await;
16146                        Ok(res)
16147                    };
16148                    Box::pin(fut)
16149                }
16150                _ => {
16151                    Box::pin(async move {
16152                        let mut response = http::Response::new(
16153                            tonic::body::Body::default(),
16154                        );
16155                        let headers = response.headers_mut();
16156                        headers
16157                            .insert(
16158                                tonic::Status::GRPC_STATUS,
16159                                (tonic::Code::Unimplemented as i32).into(),
16160                            );
16161                        headers
16162                            .insert(
16163                                http::header::CONTENT_TYPE,
16164                                tonic::metadata::GRPC_CONTENT_TYPE,
16165                            );
16166                        Ok(response)
16167                    })
16168                }
16169            }
16170        }
16171    }
16172    impl<T> Clone for TemplateServiceServer<T> {
16173        fn clone(&self) -> Self {
16174            let inner = self.inner.clone();
16175            Self {
16176                inner,
16177                accept_compression_encodings: self.accept_compression_encodings,
16178                send_compression_encodings: self.send_compression_encodings,
16179                max_decoding_message_size: self.max_decoding_message_size,
16180                max_encoding_message_size: self.max_encoding_message_size,
16181            }
16182        }
16183    }
16184    /// Generated gRPC service name
16185    pub const SERVICE_NAME: &str = "pidgr.v1.TemplateService";
16186    impl<T> tonic::server::NamedService for TemplateServiceServer<T> {
16187        const NAME: &'static str = SERVICE_NAME;
16188    }
16189}
16190/// Generated client implementations.
16191pub mod token_service_client {
16192    #![allow(
16193        unused_variables,
16194        dead_code,
16195        missing_docs,
16196        clippy::wildcard_imports,
16197        clippy::let_unit_value,
16198    )]
16199    use tonic::codegen::*;
16200    use tonic::codegen::http::Uri;
16201    /** HMAC-signed deeplink-token signing and validation.
16202
16203 Deeplink tokens carry the (campaign, recipient, step) tuple that
16204 authorizes a third-party-channel deeplink
16205 (`links.pidgr.com/c/{short_code}?t={token}`). The token is signed by
16206 pidgr-api with a per-org HMAC key managed by the platform's key store;
16207 rotation is automatic with a 7-day overlap window so callers do not
16208 have to coordinate.
16209*/
16210    #[derive(Debug, Clone)]
16211    pub struct TokenServiceClient<T> {
16212        inner: tonic::client::Grpc<T>,
16213    }
16214    impl TokenServiceClient<tonic::transport::Channel> {
16215        /// Attempt to create a new client by connecting to a given endpoint.
16216        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
16217        where
16218            D: TryInto<tonic::transport::Endpoint>,
16219            D::Error: Into<StdError>,
16220        {
16221            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
16222            Ok(Self::new(conn))
16223        }
16224    }
16225    impl<T> TokenServiceClient<T>
16226    where
16227        T: tonic::client::GrpcService<tonic::body::Body>,
16228        T::Error: Into<StdError>,
16229        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
16230        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
16231    {
16232        pub fn new(inner: T) -> Self {
16233            let inner = tonic::client::Grpc::new(inner);
16234            Self { inner }
16235        }
16236        pub fn with_origin(inner: T, origin: Uri) -> Self {
16237            let inner = tonic::client::Grpc::with_origin(inner, origin);
16238            Self { inner }
16239        }
16240        pub fn with_interceptor<F>(
16241            inner: T,
16242            interceptor: F,
16243        ) -> TokenServiceClient<InterceptedService<T, F>>
16244        where
16245            F: tonic::service::Interceptor,
16246            T::ResponseBody: Default,
16247            T: tonic::codegen::Service<
16248                http::Request<tonic::body::Body>,
16249                Response = http::Response<
16250                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
16251                >,
16252            >,
16253            <T as tonic::codegen::Service<
16254                http::Request<tonic::body::Body>,
16255            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
16256        {
16257            TokenServiceClient::new(InterceptedService::new(inner, interceptor))
16258        }
16259        /// Compress requests with the given encoding.
16260        ///
16261        /// This requires the server to support it otherwise it might respond with an
16262        /// error.
16263        #[must_use]
16264        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
16265            self.inner = self.inner.send_compressed(encoding);
16266            self
16267        }
16268        /// Enable decompressing responses.
16269        #[must_use]
16270        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
16271            self.inner = self.inner.accept_compressed(encoding);
16272            self
16273        }
16274        /// Limits the maximum size of a decoded message.
16275        ///
16276        /// Default: `4MB`
16277        #[must_use]
16278        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
16279            self.inner = self.inner.max_decoding_message_size(limit);
16280            self
16281        }
16282        /// Limits the maximum size of an encoded message.
16283        ///
16284        /// Default: `usize::MAX`
16285        #[must_use]
16286        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
16287            self.inner = self.inner.max_encoding_message_size(limit);
16288            self
16289        }
16290        /** Sign a deeplink token. Authorization: internal-mTLS-only (caller is
16291 the dispatch layer assembling a deeplink during message
16292 composition).
16293*/
16294        pub async fn sign_deeplink_token(
16295            &mut self,
16296            request: impl tonic::IntoRequest<super::SignDeeplinkTokenRequest>,
16297        ) -> std::result::Result<
16298            tonic::Response<super::SignDeeplinkTokenResponse>,
16299            tonic::Status,
16300        > {
16301            self.inner
16302                .ready()
16303                .await
16304                .map_err(|e| {
16305                    tonic::Status::unknown(
16306                        format!("Service was not ready: {}", e.into()),
16307                    )
16308                })?;
16309            let codec = tonic_prost::ProstCodec::default();
16310            let path = http::uri::PathAndQuery::from_static(
16311                "/pidgr.v1.TokenService/SignDeeplinkToken",
16312            );
16313            let mut req = request.into_request();
16314            req.extensions_mut()
16315                .insert(GrpcMethod::new("pidgr.v1.TokenService", "SignDeeplinkToken"));
16316            self.inner.unary(req, path, codec).await
16317        }
16318        /** Validate a deeplink token. Authorization: unauthenticated (caller
16319 is the native app validating before showing the auth gate). The
16320 token IS the lookup key; valid responses carry the decoded payload.
16321*/
16322        pub async fn validate_deeplink_token(
16323            &mut self,
16324            request: impl tonic::IntoRequest<super::ValidateDeeplinkTokenRequest>,
16325        ) -> std::result::Result<
16326            tonic::Response<super::ValidateDeeplinkTokenResponse>,
16327            tonic::Status,
16328        > {
16329            self.inner
16330                .ready()
16331                .await
16332                .map_err(|e| {
16333                    tonic::Status::unknown(
16334                        format!("Service was not ready: {}", e.into()),
16335                    )
16336                })?;
16337            let codec = tonic_prost::ProstCodec::default();
16338            let path = http::uri::PathAndQuery::from_static(
16339                "/pidgr.v1.TokenService/ValidateDeeplinkToken",
16340            );
16341            let mut req = request.into_request();
16342            req.extensions_mut()
16343                .insert(
16344                    GrpcMethod::new("pidgr.v1.TokenService", "ValidateDeeplinkToken"),
16345                );
16346            self.inner.unary(req, path, codec).await
16347        }
16348    }
16349}
16350/// Generated server implementations.
16351pub mod token_service_server {
16352    #![allow(
16353        unused_variables,
16354        dead_code,
16355        missing_docs,
16356        clippy::wildcard_imports,
16357        clippy::let_unit_value,
16358    )]
16359    use tonic::codegen::*;
16360    /// Generated trait containing gRPC methods that should be implemented for use with TokenServiceServer.
16361    #[async_trait]
16362    pub trait TokenService: std::marker::Send + std::marker::Sync + 'static {
16363        /** Sign a deeplink token. Authorization: internal-mTLS-only (caller is
16364 the dispatch layer assembling a deeplink during message
16365 composition).
16366*/
16367        async fn sign_deeplink_token(
16368            &self,
16369            request: tonic::Request<super::SignDeeplinkTokenRequest>,
16370        ) -> std::result::Result<
16371            tonic::Response<super::SignDeeplinkTokenResponse>,
16372            tonic::Status,
16373        >;
16374        /** Validate a deeplink token. Authorization: unauthenticated (caller
16375 is the native app validating before showing the auth gate). The
16376 token IS the lookup key; valid responses carry the decoded payload.
16377*/
16378        async fn validate_deeplink_token(
16379            &self,
16380            request: tonic::Request<super::ValidateDeeplinkTokenRequest>,
16381        ) -> std::result::Result<
16382            tonic::Response<super::ValidateDeeplinkTokenResponse>,
16383            tonic::Status,
16384        >;
16385    }
16386    /** HMAC-signed deeplink-token signing and validation.
16387
16388 Deeplink tokens carry the (campaign, recipient, step) tuple that
16389 authorizes a third-party-channel deeplink
16390 (`links.pidgr.com/c/{short_code}?t={token}`). The token is signed by
16391 pidgr-api with a per-org HMAC key managed by the platform's key store;
16392 rotation is automatic with a 7-day overlap window so callers do not
16393 have to coordinate.
16394*/
16395    #[derive(Debug)]
16396    pub struct TokenServiceServer<T> {
16397        inner: Arc<T>,
16398        accept_compression_encodings: EnabledCompressionEncodings,
16399        send_compression_encodings: EnabledCompressionEncodings,
16400        max_decoding_message_size: Option<usize>,
16401        max_encoding_message_size: Option<usize>,
16402    }
16403    impl<T> TokenServiceServer<T> {
16404        pub fn new(inner: T) -> Self {
16405            Self::from_arc(Arc::new(inner))
16406        }
16407        pub fn from_arc(inner: Arc<T>) -> Self {
16408            Self {
16409                inner,
16410                accept_compression_encodings: Default::default(),
16411                send_compression_encodings: Default::default(),
16412                max_decoding_message_size: None,
16413                max_encoding_message_size: None,
16414            }
16415        }
16416        pub fn with_interceptor<F>(
16417            inner: T,
16418            interceptor: F,
16419        ) -> InterceptedService<Self, F>
16420        where
16421            F: tonic::service::Interceptor,
16422        {
16423            InterceptedService::new(Self::new(inner), interceptor)
16424        }
16425        /// Enable decompressing requests with the given encoding.
16426        #[must_use]
16427        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
16428            self.accept_compression_encodings.enable(encoding);
16429            self
16430        }
16431        /// Compress responses with the given encoding, if the client supports it.
16432        #[must_use]
16433        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
16434            self.send_compression_encodings.enable(encoding);
16435            self
16436        }
16437        /// Limits the maximum size of a decoded message.
16438        ///
16439        /// Default: `4MB`
16440        #[must_use]
16441        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
16442            self.max_decoding_message_size = Some(limit);
16443            self
16444        }
16445        /// Limits the maximum size of an encoded message.
16446        ///
16447        /// Default: `usize::MAX`
16448        #[must_use]
16449        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
16450            self.max_encoding_message_size = Some(limit);
16451            self
16452        }
16453    }
16454    impl<T, B> tonic::codegen::Service<http::Request<B>> for TokenServiceServer<T>
16455    where
16456        T: TokenService,
16457        B: Body + std::marker::Send + 'static,
16458        B::Error: Into<StdError> + std::marker::Send + 'static,
16459    {
16460        type Response = http::Response<tonic::body::Body>;
16461        type Error = std::convert::Infallible;
16462        type Future = BoxFuture<Self::Response, Self::Error>;
16463        fn poll_ready(
16464            &mut self,
16465            _cx: &mut Context<'_>,
16466        ) -> Poll<std::result::Result<(), Self::Error>> {
16467            Poll::Ready(Ok(()))
16468        }
16469        fn call(&mut self, req: http::Request<B>) -> Self::Future {
16470            match req.uri().path() {
16471                "/pidgr.v1.TokenService/SignDeeplinkToken" => {
16472                    #[allow(non_camel_case_types)]
16473                    struct SignDeeplinkTokenSvc<T: TokenService>(pub Arc<T>);
16474                    impl<
16475                        T: TokenService,
16476                    > tonic::server::UnaryService<super::SignDeeplinkTokenRequest>
16477                    for SignDeeplinkTokenSvc<T> {
16478                        type Response = super::SignDeeplinkTokenResponse;
16479                        type Future = BoxFuture<
16480                            tonic::Response<Self::Response>,
16481                            tonic::Status,
16482                        >;
16483                        fn call(
16484                            &mut self,
16485                            request: tonic::Request<super::SignDeeplinkTokenRequest>,
16486                        ) -> Self::Future {
16487                            let inner = Arc::clone(&self.0);
16488                            let fut = async move {
16489                                <T as TokenService>::sign_deeplink_token(&inner, request)
16490                                    .await
16491                            };
16492                            Box::pin(fut)
16493                        }
16494                    }
16495                    let accept_compression_encodings = self.accept_compression_encodings;
16496                    let send_compression_encodings = self.send_compression_encodings;
16497                    let max_decoding_message_size = self.max_decoding_message_size;
16498                    let max_encoding_message_size = self.max_encoding_message_size;
16499                    let inner = self.inner.clone();
16500                    let fut = async move {
16501                        let method = SignDeeplinkTokenSvc(inner);
16502                        let codec = tonic_prost::ProstCodec::default();
16503                        let mut grpc = tonic::server::Grpc::new(codec)
16504                            .apply_compression_config(
16505                                accept_compression_encodings,
16506                                send_compression_encodings,
16507                            )
16508                            .apply_max_message_size_config(
16509                                max_decoding_message_size,
16510                                max_encoding_message_size,
16511                            );
16512                        let res = grpc.unary(method, req).await;
16513                        Ok(res)
16514                    };
16515                    Box::pin(fut)
16516                }
16517                "/pidgr.v1.TokenService/ValidateDeeplinkToken" => {
16518                    #[allow(non_camel_case_types)]
16519                    struct ValidateDeeplinkTokenSvc<T: TokenService>(pub Arc<T>);
16520                    impl<
16521                        T: TokenService,
16522                    > tonic::server::UnaryService<super::ValidateDeeplinkTokenRequest>
16523                    for ValidateDeeplinkTokenSvc<T> {
16524                        type Response = super::ValidateDeeplinkTokenResponse;
16525                        type Future = BoxFuture<
16526                            tonic::Response<Self::Response>,
16527                            tonic::Status,
16528                        >;
16529                        fn call(
16530                            &mut self,
16531                            request: tonic::Request<super::ValidateDeeplinkTokenRequest>,
16532                        ) -> Self::Future {
16533                            let inner = Arc::clone(&self.0);
16534                            let fut = async move {
16535                                <T as TokenService>::validate_deeplink_token(
16536                                        &inner,
16537                                        request,
16538                                    )
16539                                    .await
16540                            };
16541                            Box::pin(fut)
16542                        }
16543                    }
16544                    let accept_compression_encodings = self.accept_compression_encodings;
16545                    let send_compression_encodings = self.send_compression_encodings;
16546                    let max_decoding_message_size = self.max_decoding_message_size;
16547                    let max_encoding_message_size = self.max_encoding_message_size;
16548                    let inner = self.inner.clone();
16549                    let fut = async move {
16550                        let method = ValidateDeeplinkTokenSvc(inner);
16551                        let codec = tonic_prost::ProstCodec::default();
16552                        let mut grpc = tonic::server::Grpc::new(codec)
16553                            .apply_compression_config(
16554                                accept_compression_encodings,
16555                                send_compression_encodings,
16556                            )
16557                            .apply_max_message_size_config(
16558                                max_decoding_message_size,
16559                                max_encoding_message_size,
16560                            );
16561                        let res = grpc.unary(method, req).await;
16562                        Ok(res)
16563                    };
16564                    Box::pin(fut)
16565                }
16566                _ => {
16567                    Box::pin(async move {
16568                        let mut response = http::Response::new(
16569                            tonic::body::Body::default(),
16570                        );
16571                        let headers = response.headers_mut();
16572                        headers
16573                            .insert(
16574                                tonic::Status::GRPC_STATUS,
16575                                (tonic::Code::Unimplemented as i32).into(),
16576                            );
16577                        headers
16578                            .insert(
16579                                http::header::CONTENT_TYPE,
16580                                tonic::metadata::GRPC_CONTENT_TYPE,
16581                            );
16582                        Ok(response)
16583                    })
16584                }
16585            }
16586        }
16587    }
16588    impl<T> Clone for TokenServiceServer<T> {
16589        fn clone(&self) -> Self {
16590            let inner = self.inner.clone();
16591            Self {
16592                inner,
16593                accept_compression_encodings: self.accept_compression_encodings,
16594                send_compression_encodings: self.send_compression_encodings,
16595                max_decoding_message_size: self.max_decoding_message_size,
16596                max_encoding_message_size: self.max_encoding_message_size,
16597            }
16598        }
16599    }
16600    /// Generated gRPC service name
16601    pub const SERVICE_NAME: &str = "pidgr.v1.TokenService";
16602    impl<T> tonic::server::NamedService for TokenServiceServer<T> {
16603        const NAME: &'static str = SERVICE_NAME;
16604    }
16605}