1pub mod action_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 #[derive(Debug, Clone)]
17 pub struct ActionServiceClient<T> {
18 inner: tonic::client::Grpc<T>,
19 }
20 impl ActionServiceClient<tonic::transport::Channel> {
21 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> ActionServiceClient<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 ) -> ActionServiceClient<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 ActionServiceClient::new(InterceptedService::new(inner, interceptor))
64 }
65 #[must_use]
70 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
71 self.inner = self.inner.send_compressed(encoding);
72 self
73 }
74 #[must_use]
76 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
77 self.inner = self.inner.accept_compressed(encoding);
78 self
79 }
80 #[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 #[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 pub async fn submit_action(
100 &mut self,
101 request: impl tonic::IntoRequest<super::SubmitActionRequest>,
102 ) -> std::result::Result<
103 tonic::Response<super::SubmitActionResponse>,
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.ActionService/SubmitAction",
117 );
118 let mut req = request.into_request();
119 req.extensions_mut()
120 .insert(GrpcMethod::new("pidgr.v1.ActionService", "SubmitAction"));
121 self.inner.unary(req, path, codec).await
122 }
123 }
124}
125pub mod action_service_server {
127 #![allow(
128 unused_variables,
129 dead_code,
130 missing_docs,
131 clippy::wildcard_imports,
132 clippy::let_unit_value,
133 )]
134 use tonic::codegen::*;
135 #[async_trait]
137 pub trait ActionService: std::marker::Send + std::marker::Sync + 'static {
138 async fn submit_action(
142 &self,
143 request: tonic::Request<super::SubmitActionRequest>,
144 ) -> std::result::Result<
145 tonic::Response<super::SubmitActionResponse>,
146 tonic::Status,
147 >;
148 }
149 #[derive(Debug)]
153 pub struct ActionServiceServer<T> {
154 inner: Arc<T>,
155 accept_compression_encodings: EnabledCompressionEncodings,
156 send_compression_encodings: EnabledCompressionEncodings,
157 max_decoding_message_size: Option<usize>,
158 max_encoding_message_size: Option<usize>,
159 }
160 impl<T> ActionServiceServer<T> {
161 pub fn new(inner: T) -> Self {
162 Self::from_arc(Arc::new(inner))
163 }
164 pub fn from_arc(inner: Arc<T>) -> Self {
165 Self {
166 inner,
167 accept_compression_encodings: Default::default(),
168 send_compression_encodings: Default::default(),
169 max_decoding_message_size: None,
170 max_encoding_message_size: None,
171 }
172 }
173 pub fn with_interceptor<F>(
174 inner: T,
175 interceptor: F,
176 ) -> InterceptedService<Self, F>
177 where
178 F: tonic::service::Interceptor,
179 {
180 InterceptedService::new(Self::new(inner), interceptor)
181 }
182 #[must_use]
184 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
185 self.accept_compression_encodings.enable(encoding);
186 self
187 }
188 #[must_use]
190 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
191 self.send_compression_encodings.enable(encoding);
192 self
193 }
194 #[must_use]
198 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
199 self.max_decoding_message_size = Some(limit);
200 self
201 }
202 #[must_use]
206 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
207 self.max_encoding_message_size = Some(limit);
208 self
209 }
210 }
211 impl<T, B> tonic::codegen::Service<http::Request<B>> for ActionServiceServer<T>
212 where
213 T: ActionService,
214 B: Body + std::marker::Send + 'static,
215 B::Error: Into<StdError> + std::marker::Send + 'static,
216 {
217 type Response = http::Response<tonic::body::Body>;
218 type Error = std::convert::Infallible;
219 type Future = BoxFuture<Self::Response, Self::Error>;
220 fn poll_ready(
221 &mut self,
222 _cx: &mut Context<'_>,
223 ) -> Poll<std::result::Result<(), Self::Error>> {
224 Poll::Ready(Ok(()))
225 }
226 fn call(&mut self, req: http::Request<B>) -> Self::Future {
227 match req.uri().path() {
228 "/pidgr.v1.ActionService/SubmitAction" => {
229 #[allow(non_camel_case_types)]
230 struct SubmitActionSvc<T: ActionService>(pub Arc<T>);
231 impl<
232 T: ActionService,
233 > tonic::server::UnaryService<super::SubmitActionRequest>
234 for SubmitActionSvc<T> {
235 type Response = super::SubmitActionResponse;
236 type Future = BoxFuture<
237 tonic::Response<Self::Response>,
238 tonic::Status,
239 >;
240 fn call(
241 &mut self,
242 request: tonic::Request<super::SubmitActionRequest>,
243 ) -> Self::Future {
244 let inner = Arc::clone(&self.0);
245 let fut = async move {
246 <T as ActionService>::submit_action(&inner, request).await
247 };
248 Box::pin(fut)
249 }
250 }
251 let accept_compression_encodings = self.accept_compression_encodings;
252 let send_compression_encodings = self.send_compression_encodings;
253 let max_decoding_message_size = self.max_decoding_message_size;
254 let max_encoding_message_size = self.max_encoding_message_size;
255 let inner = self.inner.clone();
256 let fut = async move {
257 let method = SubmitActionSvc(inner);
258 let codec = tonic_prost::ProstCodec::default();
259 let mut grpc = tonic::server::Grpc::new(codec)
260 .apply_compression_config(
261 accept_compression_encodings,
262 send_compression_encodings,
263 )
264 .apply_max_message_size_config(
265 max_decoding_message_size,
266 max_encoding_message_size,
267 );
268 let res = grpc.unary(method, req).await;
269 Ok(res)
270 };
271 Box::pin(fut)
272 }
273 _ => {
274 Box::pin(async move {
275 let mut response = http::Response::new(
276 tonic::body::Body::default(),
277 );
278 let headers = response.headers_mut();
279 headers
280 .insert(
281 tonic::Status::GRPC_STATUS,
282 (tonic::Code::Unimplemented as i32).into(),
283 );
284 headers
285 .insert(
286 http::header::CONTENT_TYPE,
287 tonic::metadata::GRPC_CONTENT_TYPE,
288 );
289 Ok(response)
290 })
291 }
292 }
293 }
294 }
295 impl<T> Clone for ActionServiceServer<T> {
296 fn clone(&self) -> Self {
297 let inner = self.inner.clone();
298 Self {
299 inner,
300 accept_compression_encodings: self.accept_compression_encodings,
301 send_compression_encodings: self.send_compression_encodings,
302 max_decoding_message_size: self.max_decoding_message_size,
303 max_encoding_message_size: self.max_encoding_message_size,
304 }
305 }
306 }
307 pub const SERVICE_NAME: &str = "pidgr.v1.ActionService";
309 impl<T> tonic::server::NamedService for ActionServiceServer<T> {
310 const NAME: &'static str = SERVICE_NAME;
311 }
312}
313pub mod channel_events_service_client {
315 #![allow(
316 unused_variables,
317 dead_code,
318 missing_docs,
319 clippy::wildcard_imports,
320 clippy::let_unit_value,
321 )]
322 use tonic::codegen::*;
323 use tonic::codegen::http::Uri;
324 #[derive(Debug, Clone)]
329 pub struct ChannelEventsServiceClient<T> {
330 inner: tonic::client::Grpc<T>,
331 }
332 impl ChannelEventsServiceClient<tonic::transport::Channel> {
333 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
335 where
336 D: TryInto<tonic::transport::Endpoint>,
337 D::Error: Into<StdError>,
338 {
339 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
340 Ok(Self::new(conn))
341 }
342 }
343 impl<T> ChannelEventsServiceClient<T>
344 where
345 T: tonic::client::GrpcService<tonic::body::Body>,
346 T::Error: Into<StdError>,
347 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
348 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
349 {
350 pub fn new(inner: T) -> Self {
351 let inner = tonic::client::Grpc::new(inner);
352 Self { inner }
353 }
354 pub fn with_origin(inner: T, origin: Uri) -> Self {
355 let inner = tonic::client::Grpc::with_origin(inner, origin);
356 Self { inner }
357 }
358 pub fn with_interceptor<F>(
359 inner: T,
360 interceptor: F,
361 ) -> ChannelEventsServiceClient<InterceptedService<T, F>>
362 where
363 F: tonic::service::Interceptor,
364 T::ResponseBody: Default,
365 T: tonic::codegen::Service<
366 http::Request<tonic::body::Body>,
367 Response = http::Response<
368 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
369 >,
370 >,
371 <T as tonic::codegen::Service<
372 http::Request<tonic::body::Body>,
373 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
374 {
375 ChannelEventsServiceClient::new(InterceptedService::new(inner, interceptor))
376 }
377 #[must_use]
382 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
383 self.inner = self.inner.send_compressed(encoding);
384 self
385 }
386 #[must_use]
388 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
389 self.inner = self.inner.accept_compressed(encoding);
390 self
391 }
392 #[must_use]
396 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
397 self.inner = self.inner.max_decoding_message_size(limit);
398 self
399 }
400 #[must_use]
404 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
405 self.inner = self.inner.max_encoding_message_size(limit);
406 self
407 }
408 pub async fn record_channel_event(
413 &mut self,
414 request: impl tonic::IntoRequest<super::RecordChannelEventRequest>,
415 ) -> std::result::Result<
416 tonic::Response<super::RecordChannelEventResponse>,
417 tonic::Status,
418 > {
419 self.inner
420 .ready()
421 .await
422 .map_err(|e| {
423 tonic::Status::unknown(
424 format!("Service was not ready: {}", e.into()),
425 )
426 })?;
427 let codec = tonic_prost::ProstCodec::default();
428 let path = http::uri::PathAndQuery::from_static(
429 "/pidgr.v1.ChannelEventsService/RecordChannelEvent",
430 );
431 let mut req = request.into_request();
432 req.extensions_mut()
433 .insert(
434 GrpcMethod::new(
435 "pidgr.v1.ChannelEventsService",
436 "RecordChannelEvent",
437 ),
438 );
439 self.inner.unary(req, path, codec).await
440 }
441 pub async fn record_channel_event_batch(
446 &mut self,
447 request: impl tonic::IntoRequest<super::RecordChannelEventBatchRequest>,
448 ) -> std::result::Result<
449 tonic::Response<super::RecordChannelEventBatchResponse>,
450 tonic::Status,
451 > {
452 self.inner
453 .ready()
454 .await
455 .map_err(|e| {
456 tonic::Status::unknown(
457 format!("Service was not ready: {}", e.into()),
458 )
459 })?;
460 let codec = tonic_prost::ProstCodec::default();
461 let path = http::uri::PathAndQuery::from_static(
462 "/pidgr.v1.ChannelEventsService/RecordChannelEventBatch",
463 );
464 let mut req = request.into_request();
465 req.extensions_mut()
466 .insert(
467 GrpcMethod::new(
468 "pidgr.v1.ChannelEventsService",
469 "RecordChannelEventBatch",
470 ),
471 );
472 self.inner.unary(req, path, codec).await
473 }
474 }
475}
476pub mod channel_events_service_server {
478 #![allow(
479 unused_variables,
480 dead_code,
481 missing_docs,
482 clippy::wildcard_imports,
483 clippy::let_unit_value,
484 )]
485 use tonic::codegen::*;
486 #[async_trait]
488 pub trait ChannelEventsService: std::marker::Send + std::marker::Sync + 'static {
489 async fn record_channel_event(
494 &self,
495 request: tonic::Request<super::RecordChannelEventRequest>,
496 ) -> std::result::Result<
497 tonic::Response<super::RecordChannelEventResponse>,
498 tonic::Status,
499 >;
500 async fn record_channel_event_batch(
505 &self,
506 request: tonic::Request<super::RecordChannelEventBatchRequest>,
507 ) -> std::result::Result<
508 tonic::Response<super::RecordChannelEventBatchResponse>,
509 tonic::Status,
510 >;
511 }
512 #[derive(Debug)]
517 pub struct ChannelEventsServiceServer<T> {
518 inner: Arc<T>,
519 accept_compression_encodings: EnabledCompressionEncodings,
520 send_compression_encodings: EnabledCompressionEncodings,
521 max_decoding_message_size: Option<usize>,
522 max_encoding_message_size: Option<usize>,
523 }
524 impl<T> ChannelEventsServiceServer<T> {
525 pub fn new(inner: T) -> Self {
526 Self::from_arc(Arc::new(inner))
527 }
528 pub fn from_arc(inner: Arc<T>) -> Self {
529 Self {
530 inner,
531 accept_compression_encodings: Default::default(),
532 send_compression_encodings: Default::default(),
533 max_decoding_message_size: None,
534 max_encoding_message_size: None,
535 }
536 }
537 pub fn with_interceptor<F>(
538 inner: T,
539 interceptor: F,
540 ) -> InterceptedService<Self, F>
541 where
542 F: tonic::service::Interceptor,
543 {
544 InterceptedService::new(Self::new(inner), interceptor)
545 }
546 #[must_use]
548 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
549 self.accept_compression_encodings.enable(encoding);
550 self
551 }
552 #[must_use]
554 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
555 self.send_compression_encodings.enable(encoding);
556 self
557 }
558 #[must_use]
562 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
563 self.max_decoding_message_size = Some(limit);
564 self
565 }
566 #[must_use]
570 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
571 self.max_encoding_message_size = Some(limit);
572 self
573 }
574 }
575 impl<T, B> tonic::codegen::Service<http::Request<B>>
576 for ChannelEventsServiceServer<T>
577 where
578 T: ChannelEventsService,
579 B: Body + std::marker::Send + 'static,
580 B::Error: Into<StdError> + std::marker::Send + 'static,
581 {
582 type Response = http::Response<tonic::body::Body>;
583 type Error = std::convert::Infallible;
584 type Future = BoxFuture<Self::Response, Self::Error>;
585 fn poll_ready(
586 &mut self,
587 _cx: &mut Context<'_>,
588 ) -> Poll<std::result::Result<(), Self::Error>> {
589 Poll::Ready(Ok(()))
590 }
591 fn call(&mut self, req: http::Request<B>) -> Self::Future {
592 match req.uri().path() {
593 "/pidgr.v1.ChannelEventsService/RecordChannelEvent" => {
594 #[allow(non_camel_case_types)]
595 struct RecordChannelEventSvc<T: ChannelEventsService>(pub Arc<T>);
596 impl<
597 T: ChannelEventsService,
598 > tonic::server::UnaryService<super::RecordChannelEventRequest>
599 for RecordChannelEventSvc<T> {
600 type Response = super::RecordChannelEventResponse;
601 type Future = BoxFuture<
602 tonic::Response<Self::Response>,
603 tonic::Status,
604 >;
605 fn call(
606 &mut self,
607 request: tonic::Request<super::RecordChannelEventRequest>,
608 ) -> Self::Future {
609 let inner = Arc::clone(&self.0);
610 let fut = async move {
611 <T as ChannelEventsService>::record_channel_event(
612 &inner,
613 request,
614 )
615 .await
616 };
617 Box::pin(fut)
618 }
619 }
620 let accept_compression_encodings = self.accept_compression_encodings;
621 let send_compression_encodings = self.send_compression_encodings;
622 let max_decoding_message_size = self.max_decoding_message_size;
623 let max_encoding_message_size = self.max_encoding_message_size;
624 let inner = self.inner.clone();
625 let fut = async move {
626 let method = RecordChannelEventSvc(inner);
627 let codec = tonic_prost::ProstCodec::default();
628 let mut grpc = tonic::server::Grpc::new(codec)
629 .apply_compression_config(
630 accept_compression_encodings,
631 send_compression_encodings,
632 )
633 .apply_max_message_size_config(
634 max_decoding_message_size,
635 max_encoding_message_size,
636 );
637 let res = grpc.unary(method, req).await;
638 Ok(res)
639 };
640 Box::pin(fut)
641 }
642 "/pidgr.v1.ChannelEventsService/RecordChannelEventBatch" => {
643 #[allow(non_camel_case_types)]
644 struct RecordChannelEventBatchSvc<T: ChannelEventsService>(
645 pub Arc<T>,
646 );
647 impl<
648 T: ChannelEventsService,
649 > tonic::server::UnaryService<super::RecordChannelEventBatchRequest>
650 for RecordChannelEventBatchSvc<T> {
651 type Response = super::RecordChannelEventBatchResponse;
652 type Future = BoxFuture<
653 tonic::Response<Self::Response>,
654 tonic::Status,
655 >;
656 fn call(
657 &mut self,
658 request: tonic::Request<
659 super::RecordChannelEventBatchRequest,
660 >,
661 ) -> Self::Future {
662 let inner = Arc::clone(&self.0);
663 let fut = async move {
664 <T as ChannelEventsService>::record_channel_event_batch(
665 &inner,
666 request,
667 )
668 .await
669 };
670 Box::pin(fut)
671 }
672 }
673 let accept_compression_encodings = self.accept_compression_encodings;
674 let send_compression_encodings = self.send_compression_encodings;
675 let max_decoding_message_size = self.max_decoding_message_size;
676 let max_encoding_message_size = self.max_encoding_message_size;
677 let inner = self.inner.clone();
678 let fut = async move {
679 let method = RecordChannelEventBatchSvc(inner);
680 let codec = tonic_prost::ProstCodec::default();
681 let mut grpc = tonic::server::Grpc::new(codec)
682 .apply_compression_config(
683 accept_compression_encodings,
684 send_compression_encodings,
685 )
686 .apply_max_message_size_config(
687 max_decoding_message_size,
688 max_encoding_message_size,
689 );
690 let res = grpc.unary(method, req).await;
691 Ok(res)
692 };
693 Box::pin(fut)
694 }
695 _ => {
696 Box::pin(async move {
697 let mut response = http::Response::new(
698 tonic::body::Body::default(),
699 );
700 let headers = response.headers_mut();
701 headers
702 .insert(
703 tonic::Status::GRPC_STATUS,
704 (tonic::Code::Unimplemented as i32).into(),
705 );
706 headers
707 .insert(
708 http::header::CONTENT_TYPE,
709 tonic::metadata::GRPC_CONTENT_TYPE,
710 );
711 Ok(response)
712 })
713 }
714 }
715 }
716 }
717 impl<T> Clone for ChannelEventsServiceServer<T> {
718 fn clone(&self) -> Self {
719 let inner = self.inner.clone();
720 Self {
721 inner,
722 accept_compression_encodings: self.accept_compression_encodings,
723 send_compression_encodings: self.send_compression_encodings,
724 max_decoding_message_size: self.max_decoding_message_size,
725 max_encoding_message_size: self.max_encoding_message_size,
726 }
727 }
728 }
729 pub const SERVICE_NAME: &str = "pidgr.v1.ChannelEventsService";
731 impl<T> tonic::server::NamedService for ChannelEventsServiceServer<T> {
732 const NAME: &'static str = SERVICE_NAME;
733 }
734}
735pub mod api_key_service_client {
737 #![allow(
738 unused_variables,
739 dead_code,
740 missing_docs,
741 clippy::wildcard_imports,
742 clippy::let_unit_value,
743 )]
744 use tonic::codegen::*;
745 use tonic::codegen::http::Uri;
746 #[derive(Debug, Clone)]
750 pub struct ApiKeyServiceClient<T> {
751 inner: tonic::client::Grpc<T>,
752 }
753 impl ApiKeyServiceClient<tonic::transport::Channel> {
754 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
756 where
757 D: TryInto<tonic::transport::Endpoint>,
758 D::Error: Into<StdError>,
759 {
760 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
761 Ok(Self::new(conn))
762 }
763 }
764 impl<T> ApiKeyServiceClient<T>
765 where
766 T: tonic::client::GrpcService<tonic::body::Body>,
767 T::Error: Into<StdError>,
768 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
769 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
770 {
771 pub fn new(inner: T) -> Self {
772 let inner = tonic::client::Grpc::new(inner);
773 Self { inner }
774 }
775 pub fn with_origin(inner: T, origin: Uri) -> Self {
776 let inner = tonic::client::Grpc::with_origin(inner, origin);
777 Self { inner }
778 }
779 pub fn with_interceptor<F>(
780 inner: T,
781 interceptor: F,
782 ) -> ApiKeyServiceClient<InterceptedService<T, F>>
783 where
784 F: tonic::service::Interceptor,
785 T::ResponseBody: Default,
786 T: tonic::codegen::Service<
787 http::Request<tonic::body::Body>,
788 Response = http::Response<
789 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
790 >,
791 >,
792 <T as tonic::codegen::Service<
793 http::Request<tonic::body::Body>,
794 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
795 {
796 ApiKeyServiceClient::new(InterceptedService::new(inner, interceptor))
797 }
798 #[must_use]
803 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
804 self.inner = self.inner.send_compressed(encoding);
805 self
806 }
807 #[must_use]
809 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
810 self.inner = self.inner.accept_compressed(encoding);
811 self
812 }
813 #[must_use]
817 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
818 self.inner = self.inner.max_decoding_message_size(limit);
819 self
820 }
821 #[must_use]
825 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
826 self.inner = self.inner.max_encoding_message_size(limit);
827 self
828 }
829 pub async fn create_api_key(
834 &mut self,
835 request: impl tonic::IntoRequest<super::CreateApiKeyRequest>,
836 ) -> std::result::Result<
837 tonic::Response<super::CreateApiKeyResponse>,
838 tonic::Status,
839 > {
840 self.inner
841 .ready()
842 .await
843 .map_err(|e| {
844 tonic::Status::unknown(
845 format!("Service was not ready: {}", e.into()),
846 )
847 })?;
848 let codec = tonic_prost::ProstCodec::default();
849 let path = http::uri::PathAndQuery::from_static(
850 "/pidgr.v1.ApiKeyService/CreateApiKey",
851 );
852 let mut req = request.into_request();
853 req.extensions_mut()
854 .insert(GrpcMethod::new("pidgr.v1.ApiKeyService", "CreateApiKey"));
855 self.inner.unary(req, path, codec).await
856 }
857 pub async fn list_api_keys(
861 &mut self,
862 request: impl tonic::IntoRequest<super::ListApiKeysRequest>,
863 ) -> std::result::Result<
864 tonic::Response<super::ListApiKeysResponse>,
865 tonic::Status,
866 > {
867 self.inner
868 .ready()
869 .await
870 .map_err(|e| {
871 tonic::Status::unknown(
872 format!("Service was not ready: {}", e.into()),
873 )
874 })?;
875 let codec = tonic_prost::ProstCodec::default();
876 let path = http::uri::PathAndQuery::from_static(
877 "/pidgr.v1.ApiKeyService/ListApiKeys",
878 );
879 let mut req = request.into_request();
880 req.extensions_mut()
881 .insert(GrpcMethod::new("pidgr.v1.ApiKeyService", "ListApiKeys"));
882 self.inner.unary(req, path, codec).await
883 }
884 pub async fn revoke_api_key(
888 &mut self,
889 request: impl tonic::IntoRequest<super::RevokeApiKeyRequest>,
890 ) -> std::result::Result<
891 tonic::Response<super::RevokeApiKeyResponse>,
892 tonic::Status,
893 > {
894 self.inner
895 .ready()
896 .await
897 .map_err(|e| {
898 tonic::Status::unknown(
899 format!("Service was not ready: {}", e.into()),
900 )
901 })?;
902 let codec = tonic_prost::ProstCodec::default();
903 let path = http::uri::PathAndQuery::from_static(
904 "/pidgr.v1.ApiKeyService/RevokeApiKey",
905 );
906 let mut req = request.into_request();
907 req.extensions_mut()
908 .insert(GrpcMethod::new("pidgr.v1.ApiKeyService", "RevokeApiKey"));
909 self.inner.unary(req, path, codec).await
910 }
911 }
912}
913pub mod api_key_service_server {
915 #![allow(
916 unused_variables,
917 dead_code,
918 missing_docs,
919 clippy::wildcard_imports,
920 clippy::let_unit_value,
921 )]
922 use tonic::codegen::*;
923 #[async_trait]
925 pub trait ApiKeyService: std::marker::Send + std::marker::Sync + 'static {
926 async fn create_api_key(
931 &self,
932 request: tonic::Request<super::CreateApiKeyRequest>,
933 ) -> std::result::Result<
934 tonic::Response<super::CreateApiKeyResponse>,
935 tonic::Status,
936 >;
937 async fn list_api_keys(
941 &self,
942 request: tonic::Request<super::ListApiKeysRequest>,
943 ) -> std::result::Result<
944 tonic::Response<super::ListApiKeysResponse>,
945 tonic::Status,
946 >;
947 async fn revoke_api_key(
951 &self,
952 request: tonic::Request<super::RevokeApiKeyRequest>,
953 ) -> std::result::Result<
954 tonic::Response<super::RevokeApiKeyResponse>,
955 tonic::Status,
956 >;
957 }
958 #[derive(Debug)]
962 pub struct ApiKeyServiceServer<T> {
963 inner: Arc<T>,
964 accept_compression_encodings: EnabledCompressionEncodings,
965 send_compression_encodings: EnabledCompressionEncodings,
966 max_decoding_message_size: Option<usize>,
967 max_encoding_message_size: Option<usize>,
968 }
969 impl<T> ApiKeyServiceServer<T> {
970 pub fn new(inner: T) -> Self {
971 Self::from_arc(Arc::new(inner))
972 }
973 pub fn from_arc(inner: Arc<T>) -> Self {
974 Self {
975 inner,
976 accept_compression_encodings: Default::default(),
977 send_compression_encodings: Default::default(),
978 max_decoding_message_size: None,
979 max_encoding_message_size: None,
980 }
981 }
982 pub fn with_interceptor<F>(
983 inner: T,
984 interceptor: F,
985 ) -> InterceptedService<Self, F>
986 where
987 F: tonic::service::Interceptor,
988 {
989 InterceptedService::new(Self::new(inner), interceptor)
990 }
991 #[must_use]
993 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
994 self.accept_compression_encodings.enable(encoding);
995 self
996 }
997 #[must_use]
999 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1000 self.send_compression_encodings.enable(encoding);
1001 self
1002 }
1003 #[must_use]
1007 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1008 self.max_decoding_message_size = Some(limit);
1009 self
1010 }
1011 #[must_use]
1015 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1016 self.max_encoding_message_size = Some(limit);
1017 self
1018 }
1019 }
1020 impl<T, B> tonic::codegen::Service<http::Request<B>> for ApiKeyServiceServer<T>
1021 where
1022 T: ApiKeyService,
1023 B: Body + std::marker::Send + 'static,
1024 B::Error: Into<StdError> + std::marker::Send + 'static,
1025 {
1026 type Response = http::Response<tonic::body::Body>;
1027 type Error = std::convert::Infallible;
1028 type Future = BoxFuture<Self::Response, Self::Error>;
1029 fn poll_ready(
1030 &mut self,
1031 _cx: &mut Context<'_>,
1032 ) -> Poll<std::result::Result<(), Self::Error>> {
1033 Poll::Ready(Ok(()))
1034 }
1035 fn call(&mut self, req: http::Request<B>) -> Self::Future {
1036 match req.uri().path() {
1037 "/pidgr.v1.ApiKeyService/CreateApiKey" => {
1038 #[allow(non_camel_case_types)]
1039 struct CreateApiKeySvc<T: ApiKeyService>(pub Arc<T>);
1040 impl<
1041 T: ApiKeyService,
1042 > tonic::server::UnaryService<super::CreateApiKeyRequest>
1043 for CreateApiKeySvc<T> {
1044 type Response = super::CreateApiKeyResponse;
1045 type Future = BoxFuture<
1046 tonic::Response<Self::Response>,
1047 tonic::Status,
1048 >;
1049 fn call(
1050 &mut self,
1051 request: tonic::Request<super::CreateApiKeyRequest>,
1052 ) -> Self::Future {
1053 let inner = Arc::clone(&self.0);
1054 let fut = async move {
1055 <T as ApiKeyService>::create_api_key(&inner, request).await
1056 };
1057 Box::pin(fut)
1058 }
1059 }
1060 let accept_compression_encodings = self.accept_compression_encodings;
1061 let send_compression_encodings = self.send_compression_encodings;
1062 let max_decoding_message_size = self.max_decoding_message_size;
1063 let max_encoding_message_size = self.max_encoding_message_size;
1064 let inner = self.inner.clone();
1065 let fut = async move {
1066 let method = CreateApiKeySvc(inner);
1067 let codec = tonic_prost::ProstCodec::default();
1068 let mut grpc = tonic::server::Grpc::new(codec)
1069 .apply_compression_config(
1070 accept_compression_encodings,
1071 send_compression_encodings,
1072 )
1073 .apply_max_message_size_config(
1074 max_decoding_message_size,
1075 max_encoding_message_size,
1076 );
1077 let res = grpc.unary(method, req).await;
1078 Ok(res)
1079 };
1080 Box::pin(fut)
1081 }
1082 "/pidgr.v1.ApiKeyService/ListApiKeys" => {
1083 #[allow(non_camel_case_types)]
1084 struct ListApiKeysSvc<T: ApiKeyService>(pub Arc<T>);
1085 impl<
1086 T: ApiKeyService,
1087 > tonic::server::UnaryService<super::ListApiKeysRequest>
1088 for ListApiKeysSvc<T> {
1089 type Response = super::ListApiKeysResponse;
1090 type Future = BoxFuture<
1091 tonic::Response<Self::Response>,
1092 tonic::Status,
1093 >;
1094 fn call(
1095 &mut self,
1096 request: tonic::Request<super::ListApiKeysRequest>,
1097 ) -> Self::Future {
1098 let inner = Arc::clone(&self.0);
1099 let fut = async move {
1100 <T as ApiKeyService>::list_api_keys(&inner, request).await
1101 };
1102 Box::pin(fut)
1103 }
1104 }
1105 let accept_compression_encodings = self.accept_compression_encodings;
1106 let send_compression_encodings = self.send_compression_encodings;
1107 let max_decoding_message_size = self.max_decoding_message_size;
1108 let max_encoding_message_size = self.max_encoding_message_size;
1109 let inner = self.inner.clone();
1110 let fut = async move {
1111 let method = ListApiKeysSvc(inner);
1112 let codec = tonic_prost::ProstCodec::default();
1113 let mut grpc = tonic::server::Grpc::new(codec)
1114 .apply_compression_config(
1115 accept_compression_encodings,
1116 send_compression_encodings,
1117 )
1118 .apply_max_message_size_config(
1119 max_decoding_message_size,
1120 max_encoding_message_size,
1121 );
1122 let res = grpc.unary(method, req).await;
1123 Ok(res)
1124 };
1125 Box::pin(fut)
1126 }
1127 "/pidgr.v1.ApiKeyService/RevokeApiKey" => {
1128 #[allow(non_camel_case_types)]
1129 struct RevokeApiKeySvc<T: ApiKeyService>(pub Arc<T>);
1130 impl<
1131 T: ApiKeyService,
1132 > tonic::server::UnaryService<super::RevokeApiKeyRequest>
1133 for RevokeApiKeySvc<T> {
1134 type Response = super::RevokeApiKeyResponse;
1135 type Future = BoxFuture<
1136 tonic::Response<Self::Response>,
1137 tonic::Status,
1138 >;
1139 fn call(
1140 &mut self,
1141 request: tonic::Request<super::RevokeApiKeyRequest>,
1142 ) -> Self::Future {
1143 let inner = Arc::clone(&self.0);
1144 let fut = async move {
1145 <T as ApiKeyService>::revoke_api_key(&inner, request).await
1146 };
1147 Box::pin(fut)
1148 }
1149 }
1150 let accept_compression_encodings = self.accept_compression_encodings;
1151 let send_compression_encodings = self.send_compression_encodings;
1152 let max_decoding_message_size = self.max_decoding_message_size;
1153 let max_encoding_message_size = self.max_encoding_message_size;
1154 let inner = self.inner.clone();
1155 let fut = async move {
1156 let method = RevokeApiKeySvc(inner);
1157 let codec = tonic_prost::ProstCodec::default();
1158 let mut grpc = tonic::server::Grpc::new(codec)
1159 .apply_compression_config(
1160 accept_compression_encodings,
1161 send_compression_encodings,
1162 )
1163 .apply_max_message_size_config(
1164 max_decoding_message_size,
1165 max_encoding_message_size,
1166 );
1167 let res = grpc.unary(method, req).await;
1168 Ok(res)
1169 };
1170 Box::pin(fut)
1171 }
1172 _ => {
1173 Box::pin(async move {
1174 let mut response = http::Response::new(
1175 tonic::body::Body::default(),
1176 );
1177 let headers = response.headers_mut();
1178 headers
1179 .insert(
1180 tonic::Status::GRPC_STATUS,
1181 (tonic::Code::Unimplemented as i32).into(),
1182 );
1183 headers
1184 .insert(
1185 http::header::CONTENT_TYPE,
1186 tonic::metadata::GRPC_CONTENT_TYPE,
1187 );
1188 Ok(response)
1189 })
1190 }
1191 }
1192 }
1193 }
1194 impl<T> Clone for ApiKeyServiceServer<T> {
1195 fn clone(&self) -> Self {
1196 let inner = self.inner.clone();
1197 Self {
1198 inner,
1199 accept_compression_encodings: self.accept_compression_encodings,
1200 send_compression_encodings: self.send_compression_encodings,
1201 max_decoding_message_size: self.max_decoding_message_size,
1202 max_encoding_message_size: self.max_encoding_message_size,
1203 }
1204 }
1205 }
1206 pub const SERVICE_NAME: &str = "pidgr.v1.ApiKeyService";
1208 impl<T> tonic::server::NamedService for ApiKeyServiceServer<T> {
1209 const NAME: &'static str = SERVICE_NAME;
1210 }
1211}
1212pub mod privacy_service_client {
1214 #![allow(
1215 unused_variables,
1216 dead_code,
1217 missing_docs,
1218 clippy::wildcard_imports,
1219 clippy::let_unit_value,
1220 )]
1221 use tonic::codegen::*;
1222 use tonic::codegen::http::Uri;
1223 #[derive(Debug, Clone)]
1227 pub struct PrivacyServiceClient<T> {
1228 inner: tonic::client::Grpc<T>,
1229 }
1230 impl PrivacyServiceClient<tonic::transport::Channel> {
1231 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1233 where
1234 D: TryInto<tonic::transport::Endpoint>,
1235 D::Error: Into<StdError>,
1236 {
1237 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1238 Ok(Self::new(conn))
1239 }
1240 }
1241 impl<T> PrivacyServiceClient<T>
1242 where
1243 T: tonic::client::GrpcService<tonic::body::Body>,
1244 T::Error: Into<StdError>,
1245 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1246 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1247 {
1248 pub fn new(inner: T) -> Self {
1249 let inner = tonic::client::Grpc::new(inner);
1250 Self { inner }
1251 }
1252 pub fn with_origin(inner: T, origin: Uri) -> Self {
1253 let inner = tonic::client::Grpc::with_origin(inner, origin);
1254 Self { inner }
1255 }
1256 pub fn with_interceptor<F>(
1257 inner: T,
1258 interceptor: F,
1259 ) -> PrivacyServiceClient<InterceptedService<T, F>>
1260 where
1261 F: tonic::service::Interceptor,
1262 T::ResponseBody: Default,
1263 T: tonic::codegen::Service<
1264 http::Request<tonic::body::Body>,
1265 Response = http::Response<
1266 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
1267 >,
1268 >,
1269 <T as tonic::codegen::Service<
1270 http::Request<tonic::body::Body>,
1271 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1272 {
1273 PrivacyServiceClient::new(InterceptedService::new(inner, interceptor))
1274 }
1275 #[must_use]
1280 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1281 self.inner = self.inner.send_compressed(encoding);
1282 self
1283 }
1284 #[must_use]
1286 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1287 self.inner = self.inner.accept_compressed(encoding);
1288 self
1289 }
1290 #[must_use]
1294 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1295 self.inner = self.inner.max_decoding_message_size(limit);
1296 self
1297 }
1298 #[must_use]
1302 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1303 self.inner = self.inner.max_encoding_message_size(limit);
1304 self
1305 }
1306 pub async fn export_user_data(
1312 &mut self,
1313 request: impl tonic::IntoRequest<super::ExportUserDataRequest>,
1314 ) -> std::result::Result<
1315 tonic::Response<super::ExportUserDataResponse>,
1316 tonic::Status,
1317 > {
1318 self.inner
1319 .ready()
1320 .await
1321 .map_err(|e| {
1322 tonic::Status::unknown(
1323 format!("Service was not ready: {}", e.into()),
1324 )
1325 })?;
1326 let codec = tonic_prost::ProstCodec::default();
1327 let path = http::uri::PathAndQuery::from_static(
1328 "/pidgr.v1.PrivacyService/ExportUserData",
1329 );
1330 let mut req = request.into_request();
1331 req.extensions_mut()
1332 .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "ExportUserData"));
1333 self.inner.unary(req, path, codec).await
1334 }
1335 pub async fn export_org_data(
1343 &mut self,
1344 request: impl tonic::IntoRequest<super::ExportOrgDataRequest>,
1345 ) -> std::result::Result<
1346 tonic::Response<super::ExportOrgDataResponse>,
1347 tonic::Status,
1348 > {
1349 self.inner
1350 .ready()
1351 .await
1352 .map_err(|e| {
1353 tonic::Status::unknown(
1354 format!("Service was not ready: {}", e.into()),
1355 )
1356 })?;
1357 let codec = tonic_prost::ProstCodec::default();
1358 let path = http::uri::PathAndQuery::from_static(
1359 "/pidgr.v1.PrivacyService/ExportOrgData",
1360 );
1361 let mut req = request.into_request();
1362 req.extensions_mut()
1363 .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "ExportOrgData"));
1364 self.inner.unary(req, path, codec).await
1365 }
1366 pub async fn delete_user_data(
1372 &mut self,
1373 request: impl tonic::IntoRequest<super::DeleteUserDataRequest>,
1374 ) -> std::result::Result<
1375 tonic::Response<super::DeleteUserDataResponse>,
1376 tonic::Status,
1377 > {
1378 self.inner
1379 .ready()
1380 .await
1381 .map_err(|e| {
1382 tonic::Status::unknown(
1383 format!("Service was not ready: {}", e.into()),
1384 )
1385 })?;
1386 let codec = tonic_prost::ProstCodec::default();
1387 let path = http::uri::PathAndQuery::from_static(
1388 "/pidgr.v1.PrivacyService/DeleteUserData",
1389 );
1390 let mut req = request.into_request();
1391 req.extensions_mut()
1392 .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "DeleteUserData"));
1393 self.inner.unary(req, path, codec).await
1394 }
1395 pub async fn rectify_user_data(
1400 &mut self,
1401 request: impl tonic::IntoRequest<super::RectifyUserDataRequest>,
1402 ) -> std::result::Result<
1403 tonic::Response<super::RectifyUserDataResponse>,
1404 tonic::Status,
1405 > {
1406 self.inner
1407 .ready()
1408 .await
1409 .map_err(|e| {
1410 tonic::Status::unknown(
1411 format!("Service was not ready: {}", e.into()),
1412 )
1413 })?;
1414 let codec = tonic_prost::ProstCodec::default();
1415 let path = http::uri::PathAndQuery::from_static(
1416 "/pidgr.v1.PrivacyService/RectifyUserData",
1417 );
1418 let mut req = request.into_request();
1419 req.extensions_mut()
1420 .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "RectifyUserData"));
1421 self.inner.unary(req, path, codec).await
1422 }
1423 pub async fn restrict_processing(
1428 &mut self,
1429 request: impl tonic::IntoRequest<super::RestrictProcessingRequest>,
1430 ) -> std::result::Result<
1431 tonic::Response<super::RestrictProcessingResponse>,
1432 tonic::Status,
1433 > {
1434 self.inner
1435 .ready()
1436 .await
1437 .map_err(|e| {
1438 tonic::Status::unknown(
1439 format!("Service was not ready: {}", e.into()),
1440 )
1441 })?;
1442 let codec = tonic_prost::ProstCodec::default();
1443 let path = http::uri::PathAndQuery::from_static(
1444 "/pidgr.v1.PrivacyService/RestrictProcessing",
1445 );
1446 let mut req = request.into_request();
1447 req.extensions_mut()
1448 .insert(
1449 GrpcMethod::new("pidgr.v1.PrivacyService", "RestrictProcessing"),
1450 );
1451 self.inner.unary(req, path, codec).await
1452 }
1453 pub async fn get_data_existence_confirmation(
1458 &mut self,
1459 request: impl tonic::IntoRequest<super::GetDataExistenceConfirmationRequest>,
1460 ) -> std::result::Result<
1461 tonic::Response<super::GetDataExistenceConfirmationResponse>,
1462 tonic::Status,
1463 > {
1464 self.inner
1465 .ready()
1466 .await
1467 .map_err(|e| {
1468 tonic::Status::unknown(
1469 format!("Service was not ready: {}", e.into()),
1470 )
1471 })?;
1472 let codec = tonic_prost::ProstCodec::default();
1473 let path = http::uri::PathAndQuery::from_static(
1474 "/pidgr.v1.PrivacyService/GetDataExistenceConfirmation",
1475 );
1476 let mut req = request.into_request();
1477 req.extensions_mut()
1478 .insert(
1479 GrpcMethod::new(
1480 "pidgr.v1.PrivacyService",
1481 "GetDataExistenceConfirmation",
1482 ),
1483 );
1484 self.inner.unary(req, path, codec).await
1485 }
1486 pub async fn list_privacy_requests(
1491 &mut self,
1492 request: impl tonic::IntoRequest<super::ListPrivacyRequestsRequest>,
1493 ) -> std::result::Result<
1494 tonic::Response<super::ListPrivacyRequestsResponse>,
1495 tonic::Status,
1496 > {
1497 self.inner
1498 .ready()
1499 .await
1500 .map_err(|e| {
1501 tonic::Status::unknown(
1502 format!("Service was not ready: {}", e.into()),
1503 )
1504 })?;
1505 let codec = tonic_prost::ProstCodec::default();
1506 let path = http::uri::PathAndQuery::from_static(
1507 "/pidgr.v1.PrivacyService/ListPrivacyRequests",
1508 );
1509 let mut req = request.into_request();
1510 req.extensions_mut()
1511 .insert(
1512 GrpcMethod::new("pidgr.v1.PrivacyService", "ListPrivacyRequests"),
1513 );
1514 self.inner.unary(req, path, codec).await
1515 }
1516 pub async fn cancel_deletion(
1521 &mut self,
1522 request: impl tonic::IntoRequest<super::CancelDeletionRequest>,
1523 ) -> std::result::Result<
1524 tonic::Response<super::CancelDeletionResponse>,
1525 tonic::Status,
1526 > {
1527 self.inner
1528 .ready()
1529 .await
1530 .map_err(|e| {
1531 tonic::Status::unknown(
1532 format!("Service was not ready: {}", e.into()),
1533 )
1534 })?;
1535 let codec = tonic_prost::ProstCodec::default();
1536 let path = http::uri::PathAndQuery::from_static(
1537 "/pidgr.v1.PrivacyService/CancelDeletion",
1538 );
1539 let mut req = request.into_request();
1540 req.extensions_mut()
1541 .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "CancelDeletion"));
1542 self.inner.unary(req, path, codec).await
1543 }
1544 pub async fn immediate_delete(
1549 &mut self,
1550 request: impl tonic::IntoRequest<super::ImmediateDeleteRequest>,
1551 ) -> std::result::Result<
1552 tonic::Response<super::ImmediateDeleteResponse>,
1553 tonic::Status,
1554 > {
1555 self.inner
1556 .ready()
1557 .await
1558 .map_err(|e| {
1559 tonic::Status::unknown(
1560 format!("Service was not ready: {}", e.into()),
1561 )
1562 })?;
1563 let codec = tonic_prost::ProstCodec::default();
1564 let path = http::uri::PathAndQuery::from_static(
1565 "/pidgr.v1.PrivacyService/ImmediateDelete",
1566 );
1567 let mut req = request.into_request();
1568 req.extensions_mut()
1569 .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "ImmediateDelete"));
1570 self.inner.unary(req, path, codec).await
1571 }
1572 pub async fn list_my_privacy_requests(
1577 &mut self,
1578 request: impl tonic::IntoRequest<super::ListMyPrivacyRequestsRequest>,
1579 ) -> std::result::Result<
1580 tonic::Response<super::ListMyPrivacyRequestsResponse>,
1581 tonic::Status,
1582 > {
1583 self.inner
1584 .ready()
1585 .await
1586 .map_err(|e| {
1587 tonic::Status::unknown(
1588 format!("Service was not ready: {}", e.into()),
1589 )
1590 })?;
1591 let codec = tonic_prost::ProstCodec::default();
1592 let path = http::uri::PathAndQuery::from_static(
1593 "/pidgr.v1.PrivacyService/ListMyPrivacyRequests",
1594 );
1595 let mut req = request.into_request();
1596 req.extensions_mut()
1597 .insert(
1598 GrpcMethod::new("pidgr.v1.PrivacyService", "ListMyPrivacyRequests"),
1599 );
1600 self.inner.unary(req, path, codec).await
1601 }
1602 pub async fn list_org_security_incidents(
1608 &mut self,
1609 request: impl tonic::IntoRequest<super::ListOrgSecurityIncidentsRequest>,
1610 ) -> std::result::Result<
1611 tonic::Response<super::ListOrgSecurityIncidentsResponse>,
1612 tonic::Status,
1613 > {
1614 self.inner
1615 .ready()
1616 .await
1617 .map_err(|e| {
1618 tonic::Status::unknown(
1619 format!("Service was not ready: {}", e.into()),
1620 )
1621 })?;
1622 let codec = tonic_prost::ProstCodec::default();
1623 let path = http::uri::PathAndQuery::from_static(
1624 "/pidgr.v1.PrivacyService/ListOrgSecurityIncidents",
1625 );
1626 let mut req = request.into_request();
1627 req.extensions_mut()
1628 .insert(
1629 GrpcMethod::new(
1630 "pidgr.v1.PrivacyService",
1631 "ListOrgSecurityIncidents",
1632 ),
1633 );
1634 self.inner.unary(req, path, codec).await
1635 }
1636 }
1637}
1638pub mod privacy_service_server {
1640 #![allow(
1641 unused_variables,
1642 dead_code,
1643 missing_docs,
1644 clippy::wildcard_imports,
1645 clippy::let_unit_value,
1646 )]
1647 use tonic::codegen::*;
1648 #[async_trait]
1650 pub trait PrivacyService: std::marker::Send + std::marker::Sync + 'static {
1651 async fn export_user_data(
1657 &self,
1658 request: tonic::Request<super::ExportUserDataRequest>,
1659 ) -> std::result::Result<
1660 tonic::Response<super::ExportUserDataResponse>,
1661 tonic::Status,
1662 >;
1663 async fn export_org_data(
1671 &self,
1672 request: tonic::Request<super::ExportOrgDataRequest>,
1673 ) -> std::result::Result<
1674 tonic::Response<super::ExportOrgDataResponse>,
1675 tonic::Status,
1676 >;
1677 async fn delete_user_data(
1683 &self,
1684 request: tonic::Request<super::DeleteUserDataRequest>,
1685 ) -> std::result::Result<
1686 tonic::Response<super::DeleteUserDataResponse>,
1687 tonic::Status,
1688 >;
1689 async fn rectify_user_data(
1694 &self,
1695 request: tonic::Request<super::RectifyUserDataRequest>,
1696 ) -> std::result::Result<
1697 tonic::Response<super::RectifyUserDataResponse>,
1698 tonic::Status,
1699 >;
1700 async fn restrict_processing(
1705 &self,
1706 request: tonic::Request<super::RestrictProcessingRequest>,
1707 ) -> std::result::Result<
1708 tonic::Response<super::RestrictProcessingResponse>,
1709 tonic::Status,
1710 >;
1711 async fn get_data_existence_confirmation(
1716 &self,
1717 request: tonic::Request<super::GetDataExistenceConfirmationRequest>,
1718 ) -> std::result::Result<
1719 tonic::Response<super::GetDataExistenceConfirmationResponse>,
1720 tonic::Status,
1721 >;
1722 async fn list_privacy_requests(
1727 &self,
1728 request: tonic::Request<super::ListPrivacyRequestsRequest>,
1729 ) -> std::result::Result<
1730 tonic::Response<super::ListPrivacyRequestsResponse>,
1731 tonic::Status,
1732 >;
1733 async fn cancel_deletion(
1738 &self,
1739 request: tonic::Request<super::CancelDeletionRequest>,
1740 ) -> std::result::Result<
1741 tonic::Response<super::CancelDeletionResponse>,
1742 tonic::Status,
1743 >;
1744 async fn immediate_delete(
1749 &self,
1750 request: tonic::Request<super::ImmediateDeleteRequest>,
1751 ) -> std::result::Result<
1752 tonic::Response<super::ImmediateDeleteResponse>,
1753 tonic::Status,
1754 >;
1755 async fn list_my_privacy_requests(
1760 &self,
1761 request: tonic::Request<super::ListMyPrivacyRequestsRequest>,
1762 ) -> std::result::Result<
1763 tonic::Response<super::ListMyPrivacyRequestsResponse>,
1764 tonic::Status,
1765 >;
1766 async fn list_org_security_incidents(
1772 &self,
1773 request: tonic::Request<super::ListOrgSecurityIncidentsRequest>,
1774 ) -> std::result::Result<
1775 tonic::Response<super::ListOrgSecurityIncidentsResponse>,
1776 tonic::Status,
1777 >;
1778 }
1779 #[derive(Debug)]
1783 pub struct PrivacyServiceServer<T> {
1784 inner: Arc<T>,
1785 accept_compression_encodings: EnabledCompressionEncodings,
1786 send_compression_encodings: EnabledCompressionEncodings,
1787 max_decoding_message_size: Option<usize>,
1788 max_encoding_message_size: Option<usize>,
1789 }
1790 impl<T> PrivacyServiceServer<T> {
1791 pub fn new(inner: T) -> Self {
1792 Self::from_arc(Arc::new(inner))
1793 }
1794 pub fn from_arc(inner: Arc<T>) -> Self {
1795 Self {
1796 inner,
1797 accept_compression_encodings: Default::default(),
1798 send_compression_encodings: Default::default(),
1799 max_decoding_message_size: None,
1800 max_encoding_message_size: None,
1801 }
1802 }
1803 pub fn with_interceptor<F>(
1804 inner: T,
1805 interceptor: F,
1806 ) -> InterceptedService<Self, F>
1807 where
1808 F: tonic::service::Interceptor,
1809 {
1810 InterceptedService::new(Self::new(inner), interceptor)
1811 }
1812 #[must_use]
1814 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1815 self.accept_compression_encodings.enable(encoding);
1816 self
1817 }
1818 #[must_use]
1820 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1821 self.send_compression_encodings.enable(encoding);
1822 self
1823 }
1824 #[must_use]
1828 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1829 self.max_decoding_message_size = Some(limit);
1830 self
1831 }
1832 #[must_use]
1836 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1837 self.max_encoding_message_size = Some(limit);
1838 self
1839 }
1840 }
1841 impl<T, B> tonic::codegen::Service<http::Request<B>> for PrivacyServiceServer<T>
1842 where
1843 T: PrivacyService,
1844 B: Body + std::marker::Send + 'static,
1845 B::Error: Into<StdError> + std::marker::Send + 'static,
1846 {
1847 type Response = http::Response<tonic::body::Body>;
1848 type Error = std::convert::Infallible;
1849 type Future = BoxFuture<Self::Response, Self::Error>;
1850 fn poll_ready(
1851 &mut self,
1852 _cx: &mut Context<'_>,
1853 ) -> Poll<std::result::Result<(), Self::Error>> {
1854 Poll::Ready(Ok(()))
1855 }
1856 fn call(&mut self, req: http::Request<B>) -> Self::Future {
1857 match req.uri().path() {
1858 "/pidgr.v1.PrivacyService/ExportUserData" => {
1859 #[allow(non_camel_case_types)]
1860 struct ExportUserDataSvc<T: PrivacyService>(pub Arc<T>);
1861 impl<
1862 T: PrivacyService,
1863 > tonic::server::UnaryService<super::ExportUserDataRequest>
1864 for ExportUserDataSvc<T> {
1865 type Response = super::ExportUserDataResponse;
1866 type Future = BoxFuture<
1867 tonic::Response<Self::Response>,
1868 tonic::Status,
1869 >;
1870 fn call(
1871 &mut self,
1872 request: tonic::Request<super::ExportUserDataRequest>,
1873 ) -> Self::Future {
1874 let inner = Arc::clone(&self.0);
1875 let fut = async move {
1876 <T as PrivacyService>::export_user_data(&inner, request)
1877 .await
1878 };
1879 Box::pin(fut)
1880 }
1881 }
1882 let accept_compression_encodings = self.accept_compression_encodings;
1883 let send_compression_encodings = self.send_compression_encodings;
1884 let max_decoding_message_size = self.max_decoding_message_size;
1885 let max_encoding_message_size = self.max_encoding_message_size;
1886 let inner = self.inner.clone();
1887 let fut = async move {
1888 let method = ExportUserDataSvc(inner);
1889 let codec = tonic_prost::ProstCodec::default();
1890 let mut grpc = tonic::server::Grpc::new(codec)
1891 .apply_compression_config(
1892 accept_compression_encodings,
1893 send_compression_encodings,
1894 )
1895 .apply_max_message_size_config(
1896 max_decoding_message_size,
1897 max_encoding_message_size,
1898 );
1899 let res = grpc.unary(method, req).await;
1900 Ok(res)
1901 };
1902 Box::pin(fut)
1903 }
1904 "/pidgr.v1.PrivacyService/ExportOrgData" => {
1905 #[allow(non_camel_case_types)]
1906 struct ExportOrgDataSvc<T: PrivacyService>(pub Arc<T>);
1907 impl<
1908 T: PrivacyService,
1909 > tonic::server::UnaryService<super::ExportOrgDataRequest>
1910 for ExportOrgDataSvc<T> {
1911 type Response = super::ExportOrgDataResponse;
1912 type Future = BoxFuture<
1913 tonic::Response<Self::Response>,
1914 tonic::Status,
1915 >;
1916 fn call(
1917 &mut self,
1918 request: tonic::Request<super::ExportOrgDataRequest>,
1919 ) -> Self::Future {
1920 let inner = Arc::clone(&self.0);
1921 let fut = async move {
1922 <T as PrivacyService>::export_org_data(&inner, request)
1923 .await
1924 };
1925 Box::pin(fut)
1926 }
1927 }
1928 let accept_compression_encodings = self.accept_compression_encodings;
1929 let send_compression_encodings = self.send_compression_encodings;
1930 let max_decoding_message_size = self.max_decoding_message_size;
1931 let max_encoding_message_size = self.max_encoding_message_size;
1932 let inner = self.inner.clone();
1933 let fut = async move {
1934 let method = ExportOrgDataSvc(inner);
1935 let codec = tonic_prost::ProstCodec::default();
1936 let mut grpc = tonic::server::Grpc::new(codec)
1937 .apply_compression_config(
1938 accept_compression_encodings,
1939 send_compression_encodings,
1940 )
1941 .apply_max_message_size_config(
1942 max_decoding_message_size,
1943 max_encoding_message_size,
1944 );
1945 let res = grpc.unary(method, req).await;
1946 Ok(res)
1947 };
1948 Box::pin(fut)
1949 }
1950 "/pidgr.v1.PrivacyService/DeleteUserData" => {
1951 #[allow(non_camel_case_types)]
1952 struct DeleteUserDataSvc<T: PrivacyService>(pub Arc<T>);
1953 impl<
1954 T: PrivacyService,
1955 > tonic::server::UnaryService<super::DeleteUserDataRequest>
1956 for DeleteUserDataSvc<T> {
1957 type Response = super::DeleteUserDataResponse;
1958 type Future = BoxFuture<
1959 tonic::Response<Self::Response>,
1960 tonic::Status,
1961 >;
1962 fn call(
1963 &mut self,
1964 request: tonic::Request<super::DeleteUserDataRequest>,
1965 ) -> Self::Future {
1966 let inner = Arc::clone(&self.0);
1967 let fut = async move {
1968 <T as PrivacyService>::delete_user_data(&inner, request)
1969 .await
1970 };
1971 Box::pin(fut)
1972 }
1973 }
1974 let accept_compression_encodings = self.accept_compression_encodings;
1975 let send_compression_encodings = self.send_compression_encodings;
1976 let max_decoding_message_size = self.max_decoding_message_size;
1977 let max_encoding_message_size = self.max_encoding_message_size;
1978 let inner = self.inner.clone();
1979 let fut = async move {
1980 let method = DeleteUserDataSvc(inner);
1981 let codec = tonic_prost::ProstCodec::default();
1982 let mut grpc = tonic::server::Grpc::new(codec)
1983 .apply_compression_config(
1984 accept_compression_encodings,
1985 send_compression_encodings,
1986 )
1987 .apply_max_message_size_config(
1988 max_decoding_message_size,
1989 max_encoding_message_size,
1990 );
1991 let res = grpc.unary(method, req).await;
1992 Ok(res)
1993 };
1994 Box::pin(fut)
1995 }
1996 "/pidgr.v1.PrivacyService/RectifyUserData" => {
1997 #[allow(non_camel_case_types)]
1998 struct RectifyUserDataSvc<T: PrivacyService>(pub Arc<T>);
1999 impl<
2000 T: PrivacyService,
2001 > tonic::server::UnaryService<super::RectifyUserDataRequest>
2002 for RectifyUserDataSvc<T> {
2003 type Response = super::RectifyUserDataResponse;
2004 type Future = BoxFuture<
2005 tonic::Response<Self::Response>,
2006 tonic::Status,
2007 >;
2008 fn call(
2009 &mut self,
2010 request: tonic::Request<super::RectifyUserDataRequest>,
2011 ) -> Self::Future {
2012 let inner = Arc::clone(&self.0);
2013 let fut = async move {
2014 <T as PrivacyService>::rectify_user_data(&inner, request)
2015 .await
2016 };
2017 Box::pin(fut)
2018 }
2019 }
2020 let accept_compression_encodings = self.accept_compression_encodings;
2021 let send_compression_encodings = self.send_compression_encodings;
2022 let max_decoding_message_size = self.max_decoding_message_size;
2023 let max_encoding_message_size = self.max_encoding_message_size;
2024 let inner = self.inner.clone();
2025 let fut = async move {
2026 let method = RectifyUserDataSvc(inner);
2027 let codec = tonic_prost::ProstCodec::default();
2028 let mut grpc = tonic::server::Grpc::new(codec)
2029 .apply_compression_config(
2030 accept_compression_encodings,
2031 send_compression_encodings,
2032 )
2033 .apply_max_message_size_config(
2034 max_decoding_message_size,
2035 max_encoding_message_size,
2036 );
2037 let res = grpc.unary(method, req).await;
2038 Ok(res)
2039 };
2040 Box::pin(fut)
2041 }
2042 "/pidgr.v1.PrivacyService/RestrictProcessing" => {
2043 #[allow(non_camel_case_types)]
2044 struct RestrictProcessingSvc<T: PrivacyService>(pub Arc<T>);
2045 impl<
2046 T: PrivacyService,
2047 > tonic::server::UnaryService<super::RestrictProcessingRequest>
2048 for RestrictProcessingSvc<T> {
2049 type Response = super::RestrictProcessingResponse;
2050 type Future = BoxFuture<
2051 tonic::Response<Self::Response>,
2052 tonic::Status,
2053 >;
2054 fn call(
2055 &mut self,
2056 request: tonic::Request<super::RestrictProcessingRequest>,
2057 ) -> Self::Future {
2058 let inner = Arc::clone(&self.0);
2059 let fut = async move {
2060 <T as PrivacyService>::restrict_processing(&inner, request)
2061 .await
2062 };
2063 Box::pin(fut)
2064 }
2065 }
2066 let accept_compression_encodings = self.accept_compression_encodings;
2067 let send_compression_encodings = self.send_compression_encodings;
2068 let max_decoding_message_size = self.max_decoding_message_size;
2069 let max_encoding_message_size = self.max_encoding_message_size;
2070 let inner = self.inner.clone();
2071 let fut = async move {
2072 let method = RestrictProcessingSvc(inner);
2073 let codec = tonic_prost::ProstCodec::default();
2074 let mut grpc = tonic::server::Grpc::new(codec)
2075 .apply_compression_config(
2076 accept_compression_encodings,
2077 send_compression_encodings,
2078 )
2079 .apply_max_message_size_config(
2080 max_decoding_message_size,
2081 max_encoding_message_size,
2082 );
2083 let res = grpc.unary(method, req).await;
2084 Ok(res)
2085 };
2086 Box::pin(fut)
2087 }
2088 "/pidgr.v1.PrivacyService/GetDataExistenceConfirmation" => {
2089 #[allow(non_camel_case_types)]
2090 struct GetDataExistenceConfirmationSvc<T: PrivacyService>(
2091 pub Arc<T>,
2092 );
2093 impl<
2094 T: PrivacyService,
2095 > tonic::server::UnaryService<
2096 super::GetDataExistenceConfirmationRequest,
2097 > for GetDataExistenceConfirmationSvc<T> {
2098 type Response = super::GetDataExistenceConfirmationResponse;
2099 type Future = BoxFuture<
2100 tonic::Response<Self::Response>,
2101 tonic::Status,
2102 >;
2103 fn call(
2104 &mut self,
2105 request: tonic::Request<
2106 super::GetDataExistenceConfirmationRequest,
2107 >,
2108 ) -> Self::Future {
2109 let inner = Arc::clone(&self.0);
2110 let fut = async move {
2111 <T as PrivacyService>::get_data_existence_confirmation(
2112 &inner,
2113 request,
2114 )
2115 .await
2116 };
2117 Box::pin(fut)
2118 }
2119 }
2120 let accept_compression_encodings = self.accept_compression_encodings;
2121 let send_compression_encodings = self.send_compression_encodings;
2122 let max_decoding_message_size = self.max_decoding_message_size;
2123 let max_encoding_message_size = self.max_encoding_message_size;
2124 let inner = self.inner.clone();
2125 let fut = async move {
2126 let method = GetDataExistenceConfirmationSvc(inner);
2127 let codec = tonic_prost::ProstCodec::default();
2128 let mut grpc = tonic::server::Grpc::new(codec)
2129 .apply_compression_config(
2130 accept_compression_encodings,
2131 send_compression_encodings,
2132 )
2133 .apply_max_message_size_config(
2134 max_decoding_message_size,
2135 max_encoding_message_size,
2136 );
2137 let res = grpc.unary(method, req).await;
2138 Ok(res)
2139 };
2140 Box::pin(fut)
2141 }
2142 "/pidgr.v1.PrivacyService/ListPrivacyRequests" => {
2143 #[allow(non_camel_case_types)]
2144 struct ListPrivacyRequestsSvc<T: PrivacyService>(pub Arc<T>);
2145 impl<
2146 T: PrivacyService,
2147 > tonic::server::UnaryService<super::ListPrivacyRequestsRequest>
2148 for ListPrivacyRequestsSvc<T> {
2149 type Response = super::ListPrivacyRequestsResponse;
2150 type Future = BoxFuture<
2151 tonic::Response<Self::Response>,
2152 tonic::Status,
2153 >;
2154 fn call(
2155 &mut self,
2156 request: tonic::Request<super::ListPrivacyRequestsRequest>,
2157 ) -> Self::Future {
2158 let inner = Arc::clone(&self.0);
2159 let fut = async move {
2160 <T as PrivacyService>::list_privacy_requests(
2161 &inner,
2162 request,
2163 )
2164 .await
2165 };
2166 Box::pin(fut)
2167 }
2168 }
2169 let accept_compression_encodings = self.accept_compression_encodings;
2170 let send_compression_encodings = self.send_compression_encodings;
2171 let max_decoding_message_size = self.max_decoding_message_size;
2172 let max_encoding_message_size = self.max_encoding_message_size;
2173 let inner = self.inner.clone();
2174 let fut = async move {
2175 let method = ListPrivacyRequestsSvc(inner);
2176 let codec = tonic_prost::ProstCodec::default();
2177 let mut grpc = tonic::server::Grpc::new(codec)
2178 .apply_compression_config(
2179 accept_compression_encodings,
2180 send_compression_encodings,
2181 )
2182 .apply_max_message_size_config(
2183 max_decoding_message_size,
2184 max_encoding_message_size,
2185 );
2186 let res = grpc.unary(method, req).await;
2187 Ok(res)
2188 };
2189 Box::pin(fut)
2190 }
2191 "/pidgr.v1.PrivacyService/CancelDeletion" => {
2192 #[allow(non_camel_case_types)]
2193 struct CancelDeletionSvc<T: PrivacyService>(pub Arc<T>);
2194 impl<
2195 T: PrivacyService,
2196 > tonic::server::UnaryService<super::CancelDeletionRequest>
2197 for CancelDeletionSvc<T> {
2198 type Response = super::CancelDeletionResponse;
2199 type Future = BoxFuture<
2200 tonic::Response<Self::Response>,
2201 tonic::Status,
2202 >;
2203 fn call(
2204 &mut self,
2205 request: tonic::Request<super::CancelDeletionRequest>,
2206 ) -> Self::Future {
2207 let inner = Arc::clone(&self.0);
2208 let fut = async move {
2209 <T as PrivacyService>::cancel_deletion(&inner, request)
2210 .await
2211 };
2212 Box::pin(fut)
2213 }
2214 }
2215 let accept_compression_encodings = self.accept_compression_encodings;
2216 let send_compression_encodings = self.send_compression_encodings;
2217 let max_decoding_message_size = self.max_decoding_message_size;
2218 let max_encoding_message_size = self.max_encoding_message_size;
2219 let inner = self.inner.clone();
2220 let fut = async move {
2221 let method = CancelDeletionSvc(inner);
2222 let codec = tonic_prost::ProstCodec::default();
2223 let mut grpc = tonic::server::Grpc::new(codec)
2224 .apply_compression_config(
2225 accept_compression_encodings,
2226 send_compression_encodings,
2227 )
2228 .apply_max_message_size_config(
2229 max_decoding_message_size,
2230 max_encoding_message_size,
2231 );
2232 let res = grpc.unary(method, req).await;
2233 Ok(res)
2234 };
2235 Box::pin(fut)
2236 }
2237 "/pidgr.v1.PrivacyService/ImmediateDelete" => {
2238 #[allow(non_camel_case_types)]
2239 struct ImmediateDeleteSvc<T: PrivacyService>(pub Arc<T>);
2240 impl<
2241 T: PrivacyService,
2242 > tonic::server::UnaryService<super::ImmediateDeleteRequest>
2243 for ImmediateDeleteSvc<T> {
2244 type Response = super::ImmediateDeleteResponse;
2245 type Future = BoxFuture<
2246 tonic::Response<Self::Response>,
2247 tonic::Status,
2248 >;
2249 fn call(
2250 &mut self,
2251 request: tonic::Request<super::ImmediateDeleteRequest>,
2252 ) -> Self::Future {
2253 let inner = Arc::clone(&self.0);
2254 let fut = async move {
2255 <T as PrivacyService>::immediate_delete(&inner, request)
2256 .await
2257 };
2258 Box::pin(fut)
2259 }
2260 }
2261 let accept_compression_encodings = self.accept_compression_encodings;
2262 let send_compression_encodings = self.send_compression_encodings;
2263 let max_decoding_message_size = self.max_decoding_message_size;
2264 let max_encoding_message_size = self.max_encoding_message_size;
2265 let inner = self.inner.clone();
2266 let fut = async move {
2267 let method = ImmediateDeleteSvc(inner);
2268 let codec = tonic_prost::ProstCodec::default();
2269 let mut grpc = tonic::server::Grpc::new(codec)
2270 .apply_compression_config(
2271 accept_compression_encodings,
2272 send_compression_encodings,
2273 )
2274 .apply_max_message_size_config(
2275 max_decoding_message_size,
2276 max_encoding_message_size,
2277 );
2278 let res = grpc.unary(method, req).await;
2279 Ok(res)
2280 };
2281 Box::pin(fut)
2282 }
2283 "/pidgr.v1.PrivacyService/ListMyPrivacyRequests" => {
2284 #[allow(non_camel_case_types)]
2285 struct ListMyPrivacyRequestsSvc<T: PrivacyService>(pub Arc<T>);
2286 impl<
2287 T: PrivacyService,
2288 > tonic::server::UnaryService<super::ListMyPrivacyRequestsRequest>
2289 for ListMyPrivacyRequestsSvc<T> {
2290 type Response = super::ListMyPrivacyRequestsResponse;
2291 type Future = BoxFuture<
2292 tonic::Response<Self::Response>,
2293 tonic::Status,
2294 >;
2295 fn call(
2296 &mut self,
2297 request: tonic::Request<super::ListMyPrivacyRequestsRequest>,
2298 ) -> Self::Future {
2299 let inner = Arc::clone(&self.0);
2300 let fut = async move {
2301 <T as PrivacyService>::list_my_privacy_requests(
2302 &inner,
2303 request,
2304 )
2305 .await
2306 };
2307 Box::pin(fut)
2308 }
2309 }
2310 let accept_compression_encodings = self.accept_compression_encodings;
2311 let send_compression_encodings = self.send_compression_encodings;
2312 let max_decoding_message_size = self.max_decoding_message_size;
2313 let max_encoding_message_size = self.max_encoding_message_size;
2314 let inner = self.inner.clone();
2315 let fut = async move {
2316 let method = ListMyPrivacyRequestsSvc(inner);
2317 let codec = tonic_prost::ProstCodec::default();
2318 let mut grpc = tonic::server::Grpc::new(codec)
2319 .apply_compression_config(
2320 accept_compression_encodings,
2321 send_compression_encodings,
2322 )
2323 .apply_max_message_size_config(
2324 max_decoding_message_size,
2325 max_encoding_message_size,
2326 );
2327 let res = grpc.unary(method, req).await;
2328 Ok(res)
2329 };
2330 Box::pin(fut)
2331 }
2332 "/pidgr.v1.PrivacyService/ListOrgSecurityIncidents" => {
2333 #[allow(non_camel_case_types)]
2334 struct ListOrgSecurityIncidentsSvc<T: PrivacyService>(pub Arc<T>);
2335 impl<
2336 T: PrivacyService,
2337 > tonic::server::UnaryService<super::ListOrgSecurityIncidentsRequest>
2338 for ListOrgSecurityIncidentsSvc<T> {
2339 type Response = super::ListOrgSecurityIncidentsResponse;
2340 type Future = BoxFuture<
2341 tonic::Response<Self::Response>,
2342 tonic::Status,
2343 >;
2344 fn call(
2345 &mut self,
2346 request: tonic::Request<
2347 super::ListOrgSecurityIncidentsRequest,
2348 >,
2349 ) -> Self::Future {
2350 let inner = Arc::clone(&self.0);
2351 let fut = async move {
2352 <T as PrivacyService>::list_org_security_incidents(
2353 &inner,
2354 request,
2355 )
2356 .await
2357 };
2358 Box::pin(fut)
2359 }
2360 }
2361 let accept_compression_encodings = self.accept_compression_encodings;
2362 let send_compression_encodings = self.send_compression_encodings;
2363 let max_decoding_message_size = self.max_decoding_message_size;
2364 let max_encoding_message_size = self.max_encoding_message_size;
2365 let inner = self.inner.clone();
2366 let fut = async move {
2367 let method = ListOrgSecurityIncidentsSvc(inner);
2368 let codec = tonic_prost::ProstCodec::default();
2369 let mut grpc = tonic::server::Grpc::new(codec)
2370 .apply_compression_config(
2371 accept_compression_encodings,
2372 send_compression_encodings,
2373 )
2374 .apply_max_message_size_config(
2375 max_decoding_message_size,
2376 max_encoding_message_size,
2377 );
2378 let res = grpc.unary(method, req).await;
2379 Ok(res)
2380 };
2381 Box::pin(fut)
2382 }
2383 _ => {
2384 Box::pin(async move {
2385 let mut response = http::Response::new(
2386 tonic::body::Body::default(),
2387 );
2388 let headers = response.headers_mut();
2389 headers
2390 .insert(
2391 tonic::Status::GRPC_STATUS,
2392 (tonic::Code::Unimplemented as i32).into(),
2393 );
2394 headers
2395 .insert(
2396 http::header::CONTENT_TYPE,
2397 tonic::metadata::GRPC_CONTENT_TYPE,
2398 );
2399 Ok(response)
2400 })
2401 }
2402 }
2403 }
2404 }
2405 impl<T> Clone for PrivacyServiceServer<T> {
2406 fn clone(&self) -> Self {
2407 let inner = self.inner.clone();
2408 Self {
2409 inner,
2410 accept_compression_encodings: self.accept_compression_encodings,
2411 send_compression_encodings: self.send_compression_encodings,
2412 max_decoding_message_size: self.max_decoding_message_size,
2413 max_encoding_message_size: self.max_encoding_message_size,
2414 }
2415 }
2416 }
2417 pub const SERVICE_NAME: &str = "pidgr.v1.PrivacyService";
2419 impl<T> tonic::server::NamedService for PrivacyServiceServer<T> {
2420 const NAME: &'static str = SERVICE_NAME;
2421 }
2422}
2423pub mod audit_service_client {
2425 #![allow(
2426 unused_variables,
2427 dead_code,
2428 missing_docs,
2429 clippy::wildcard_imports,
2430 clippy::let_unit_value,
2431 )]
2432 use tonic::codegen::*;
2433 use tonic::codegen::http::Uri;
2434 #[derive(Debug, Clone)]
2443 pub struct AuditServiceClient<T> {
2444 inner: tonic::client::Grpc<T>,
2445 }
2446 impl AuditServiceClient<tonic::transport::Channel> {
2447 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
2449 where
2450 D: TryInto<tonic::transport::Endpoint>,
2451 D::Error: Into<StdError>,
2452 {
2453 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
2454 Ok(Self::new(conn))
2455 }
2456 }
2457 impl<T> AuditServiceClient<T>
2458 where
2459 T: tonic::client::GrpcService<tonic::body::Body>,
2460 T::Error: Into<StdError>,
2461 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
2462 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
2463 {
2464 pub fn new(inner: T) -> Self {
2465 let inner = tonic::client::Grpc::new(inner);
2466 Self { inner }
2467 }
2468 pub fn with_origin(inner: T, origin: Uri) -> Self {
2469 let inner = tonic::client::Grpc::with_origin(inner, origin);
2470 Self { inner }
2471 }
2472 pub fn with_interceptor<F>(
2473 inner: T,
2474 interceptor: F,
2475 ) -> AuditServiceClient<InterceptedService<T, F>>
2476 where
2477 F: tonic::service::Interceptor,
2478 T::ResponseBody: Default,
2479 T: tonic::codegen::Service<
2480 http::Request<tonic::body::Body>,
2481 Response = http::Response<
2482 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
2483 >,
2484 >,
2485 <T as tonic::codegen::Service<
2486 http::Request<tonic::body::Body>,
2487 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
2488 {
2489 AuditServiceClient::new(InterceptedService::new(inner, interceptor))
2490 }
2491 #[must_use]
2496 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2497 self.inner = self.inner.send_compressed(encoding);
2498 self
2499 }
2500 #[must_use]
2502 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2503 self.inner = self.inner.accept_compressed(encoding);
2504 self
2505 }
2506 #[must_use]
2510 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2511 self.inner = self.inner.max_decoding_message_size(limit);
2512 self
2513 }
2514 #[must_use]
2518 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2519 self.inner = self.inner.max_encoding_message_size(limit);
2520 self
2521 }
2522 pub async fn list_audit_events(
2527 &mut self,
2528 request: impl tonic::IntoRequest<super::ListAuditEventsRequest>,
2529 ) -> std::result::Result<
2530 tonic::Response<super::ListAuditEventsResponse>,
2531 tonic::Status,
2532 > {
2533 self.inner
2534 .ready()
2535 .await
2536 .map_err(|e| {
2537 tonic::Status::unknown(
2538 format!("Service was not ready: {}", e.into()),
2539 )
2540 })?;
2541 let codec = tonic_prost::ProstCodec::default();
2542 let path = http::uri::PathAndQuery::from_static(
2543 "/pidgr.v1.AuditService/ListAuditEvents",
2544 );
2545 let mut req = request.into_request();
2546 req.extensions_mut()
2547 .insert(GrpcMethod::new("pidgr.v1.AuditService", "ListAuditEvents"));
2548 self.inner.unary(req, path, codec).await
2549 }
2550 pub async fn export_audit_trail(
2555 &mut self,
2556 request: impl tonic::IntoRequest<super::ExportAuditTrailRequest>,
2557 ) -> std::result::Result<
2558 tonic::Response<super::ExportAuditTrailResponse>,
2559 tonic::Status,
2560 > {
2561 self.inner
2562 .ready()
2563 .await
2564 .map_err(|e| {
2565 tonic::Status::unknown(
2566 format!("Service was not ready: {}", e.into()),
2567 )
2568 })?;
2569 let codec = tonic_prost::ProstCodec::default();
2570 let path = http::uri::PathAndQuery::from_static(
2571 "/pidgr.v1.AuditService/ExportAuditTrail",
2572 );
2573 let mut req = request.into_request();
2574 req.extensions_mut()
2575 .insert(GrpcMethod::new("pidgr.v1.AuditService", "ExportAuditTrail"));
2576 self.inner.unary(req, path, codec).await
2577 }
2578 pub async fn list_audit_exports(
2582 &mut self,
2583 request: impl tonic::IntoRequest<super::ListAuditExportsRequest>,
2584 ) -> std::result::Result<
2585 tonic::Response<super::ListAuditExportsResponse>,
2586 tonic::Status,
2587 > {
2588 self.inner
2589 .ready()
2590 .await
2591 .map_err(|e| {
2592 tonic::Status::unknown(
2593 format!("Service was not ready: {}", e.into()),
2594 )
2595 })?;
2596 let codec = tonic_prost::ProstCodec::default();
2597 let path = http::uri::PathAndQuery::from_static(
2598 "/pidgr.v1.AuditService/ListAuditExports",
2599 );
2600 let mut req = request.into_request();
2601 req.extensions_mut()
2602 .insert(GrpcMethod::new("pidgr.v1.AuditService", "ListAuditExports"));
2603 self.inner.unary(req, path, codec).await
2604 }
2605 pub async fn append(
2614 &mut self,
2615 request: impl tonic::IntoRequest<super::AppendRequest>,
2616 ) -> std::result::Result<tonic::Response<super::AppendResponse>, tonic::Status> {
2617 self.inner
2618 .ready()
2619 .await
2620 .map_err(|e| {
2621 tonic::Status::unknown(
2622 format!("Service was not ready: {}", e.into()),
2623 )
2624 })?;
2625 let codec = tonic_prost::ProstCodec::default();
2626 let path = http::uri::PathAndQuery::from_static(
2627 "/pidgr.v1.AuditService/Append",
2628 );
2629 let mut req = request.into_request();
2630 req.extensions_mut()
2631 .insert(GrpcMethod::new("pidgr.v1.AuditService", "Append"));
2632 self.inner.unary(req, path, codec).await
2633 }
2634 }
2635}
2636pub mod audit_service_server {
2638 #![allow(
2639 unused_variables,
2640 dead_code,
2641 missing_docs,
2642 clippy::wildcard_imports,
2643 clippy::let_unit_value,
2644 )]
2645 use tonic::codegen::*;
2646 #[async_trait]
2648 pub trait AuditService: std::marker::Send + std::marker::Sync + 'static {
2649 async fn list_audit_events(
2654 &self,
2655 request: tonic::Request<super::ListAuditEventsRequest>,
2656 ) -> std::result::Result<
2657 tonic::Response<super::ListAuditEventsResponse>,
2658 tonic::Status,
2659 >;
2660 async fn export_audit_trail(
2665 &self,
2666 request: tonic::Request<super::ExportAuditTrailRequest>,
2667 ) -> std::result::Result<
2668 tonic::Response<super::ExportAuditTrailResponse>,
2669 tonic::Status,
2670 >;
2671 async fn list_audit_exports(
2675 &self,
2676 request: tonic::Request<super::ListAuditExportsRequest>,
2677 ) -> std::result::Result<
2678 tonic::Response<super::ListAuditExportsResponse>,
2679 tonic::Status,
2680 >;
2681 async fn append(
2690 &self,
2691 request: tonic::Request<super::AppendRequest>,
2692 ) -> std::result::Result<tonic::Response<super::AppendResponse>, tonic::Status>;
2693 }
2694 #[derive(Debug)]
2703 pub struct AuditServiceServer<T> {
2704 inner: Arc<T>,
2705 accept_compression_encodings: EnabledCompressionEncodings,
2706 send_compression_encodings: EnabledCompressionEncodings,
2707 max_decoding_message_size: Option<usize>,
2708 max_encoding_message_size: Option<usize>,
2709 }
2710 impl<T> AuditServiceServer<T> {
2711 pub fn new(inner: T) -> Self {
2712 Self::from_arc(Arc::new(inner))
2713 }
2714 pub fn from_arc(inner: Arc<T>) -> Self {
2715 Self {
2716 inner,
2717 accept_compression_encodings: Default::default(),
2718 send_compression_encodings: Default::default(),
2719 max_decoding_message_size: None,
2720 max_encoding_message_size: None,
2721 }
2722 }
2723 pub fn with_interceptor<F>(
2724 inner: T,
2725 interceptor: F,
2726 ) -> InterceptedService<Self, F>
2727 where
2728 F: tonic::service::Interceptor,
2729 {
2730 InterceptedService::new(Self::new(inner), interceptor)
2731 }
2732 #[must_use]
2734 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2735 self.accept_compression_encodings.enable(encoding);
2736 self
2737 }
2738 #[must_use]
2740 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2741 self.send_compression_encodings.enable(encoding);
2742 self
2743 }
2744 #[must_use]
2748 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2749 self.max_decoding_message_size = Some(limit);
2750 self
2751 }
2752 #[must_use]
2756 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2757 self.max_encoding_message_size = Some(limit);
2758 self
2759 }
2760 }
2761 impl<T, B> tonic::codegen::Service<http::Request<B>> for AuditServiceServer<T>
2762 where
2763 T: AuditService,
2764 B: Body + std::marker::Send + 'static,
2765 B::Error: Into<StdError> + std::marker::Send + 'static,
2766 {
2767 type Response = http::Response<tonic::body::Body>;
2768 type Error = std::convert::Infallible;
2769 type Future = BoxFuture<Self::Response, Self::Error>;
2770 fn poll_ready(
2771 &mut self,
2772 _cx: &mut Context<'_>,
2773 ) -> Poll<std::result::Result<(), Self::Error>> {
2774 Poll::Ready(Ok(()))
2775 }
2776 fn call(&mut self, req: http::Request<B>) -> Self::Future {
2777 match req.uri().path() {
2778 "/pidgr.v1.AuditService/ListAuditEvents" => {
2779 #[allow(non_camel_case_types)]
2780 struct ListAuditEventsSvc<T: AuditService>(pub Arc<T>);
2781 impl<
2782 T: AuditService,
2783 > tonic::server::UnaryService<super::ListAuditEventsRequest>
2784 for ListAuditEventsSvc<T> {
2785 type Response = super::ListAuditEventsResponse;
2786 type Future = BoxFuture<
2787 tonic::Response<Self::Response>,
2788 tonic::Status,
2789 >;
2790 fn call(
2791 &mut self,
2792 request: tonic::Request<super::ListAuditEventsRequest>,
2793 ) -> Self::Future {
2794 let inner = Arc::clone(&self.0);
2795 let fut = async move {
2796 <T as AuditService>::list_audit_events(&inner, request)
2797 .await
2798 };
2799 Box::pin(fut)
2800 }
2801 }
2802 let accept_compression_encodings = self.accept_compression_encodings;
2803 let send_compression_encodings = self.send_compression_encodings;
2804 let max_decoding_message_size = self.max_decoding_message_size;
2805 let max_encoding_message_size = self.max_encoding_message_size;
2806 let inner = self.inner.clone();
2807 let fut = async move {
2808 let method = ListAuditEventsSvc(inner);
2809 let codec = tonic_prost::ProstCodec::default();
2810 let mut grpc = tonic::server::Grpc::new(codec)
2811 .apply_compression_config(
2812 accept_compression_encodings,
2813 send_compression_encodings,
2814 )
2815 .apply_max_message_size_config(
2816 max_decoding_message_size,
2817 max_encoding_message_size,
2818 );
2819 let res = grpc.unary(method, req).await;
2820 Ok(res)
2821 };
2822 Box::pin(fut)
2823 }
2824 "/pidgr.v1.AuditService/ExportAuditTrail" => {
2825 #[allow(non_camel_case_types)]
2826 struct ExportAuditTrailSvc<T: AuditService>(pub Arc<T>);
2827 impl<
2828 T: AuditService,
2829 > tonic::server::UnaryService<super::ExportAuditTrailRequest>
2830 for ExportAuditTrailSvc<T> {
2831 type Response = super::ExportAuditTrailResponse;
2832 type Future = BoxFuture<
2833 tonic::Response<Self::Response>,
2834 tonic::Status,
2835 >;
2836 fn call(
2837 &mut self,
2838 request: tonic::Request<super::ExportAuditTrailRequest>,
2839 ) -> Self::Future {
2840 let inner = Arc::clone(&self.0);
2841 let fut = async move {
2842 <T as AuditService>::export_audit_trail(&inner, request)
2843 .await
2844 };
2845 Box::pin(fut)
2846 }
2847 }
2848 let accept_compression_encodings = self.accept_compression_encodings;
2849 let send_compression_encodings = self.send_compression_encodings;
2850 let max_decoding_message_size = self.max_decoding_message_size;
2851 let max_encoding_message_size = self.max_encoding_message_size;
2852 let inner = self.inner.clone();
2853 let fut = async move {
2854 let method = ExportAuditTrailSvc(inner);
2855 let codec = tonic_prost::ProstCodec::default();
2856 let mut grpc = tonic::server::Grpc::new(codec)
2857 .apply_compression_config(
2858 accept_compression_encodings,
2859 send_compression_encodings,
2860 )
2861 .apply_max_message_size_config(
2862 max_decoding_message_size,
2863 max_encoding_message_size,
2864 );
2865 let res = grpc.unary(method, req).await;
2866 Ok(res)
2867 };
2868 Box::pin(fut)
2869 }
2870 "/pidgr.v1.AuditService/ListAuditExports" => {
2871 #[allow(non_camel_case_types)]
2872 struct ListAuditExportsSvc<T: AuditService>(pub Arc<T>);
2873 impl<
2874 T: AuditService,
2875 > tonic::server::UnaryService<super::ListAuditExportsRequest>
2876 for ListAuditExportsSvc<T> {
2877 type Response = super::ListAuditExportsResponse;
2878 type Future = BoxFuture<
2879 tonic::Response<Self::Response>,
2880 tonic::Status,
2881 >;
2882 fn call(
2883 &mut self,
2884 request: tonic::Request<super::ListAuditExportsRequest>,
2885 ) -> Self::Future {
2886 let inner = Arc::clone(&self.0);
2887 let fut = async move {
2888 <T as AuditService>::list_audit_exports(&inner, request)
2889 .await
2890 };
2891 Box::pin(fut)
2892 }
2893 }
2894 let accept_compression_encodings = self.accept_compression_encodings;
2895 let send_compression_encodings = self.send_compression_encodings;
2896 let max_decoding_message_size = self.max_decoding_message_size;
2897 let max_encoding_message_size = self.max_encoding_message_size;
2898 let inner = self.inner.clone();
2899 let fut = async move {
2900 let method = ListAuditExportsSvc(inner);
2901 let codec = tonic_prost::ProstCodec::default();
2902 let mut grpc = tonic::server::Grpc::new(codec)
2903 .apply_compression_config(
2904 accept_compression_encodings,
2905 send_compression_encodings,
2906 )
2907 .apply_max_message_size_config(
2908 max_decoding_message_size,
2909 max_encoding_message_size,
2910 );
2911 let res = grpc.unary(method, req).await;
2912 Ok(res)
2913 };
2914 Box::pin(fut)
2915 }
2916 "/pidgr.v1.AuditService/Append" => {
2917 #[allow(non_camel_case_types)]
2918 struct AppendSvc<T: AuditService>(pub Arc<T>);
2919 impl<
2920 T: AuditService,
2921 > tonic::server::UnaryService<super::AppendRequest>
2922 for AppendSvc<T> {
2923 type Response = super::AppendResponse;
2924 type Future = BoxFuture<
2925 tonic::Response<Self::Response>,
2926 tonic::Status,
2927 >;
2928 fn call(
2929 &mut self,
2930 request: tonic::Request<super::AppendRequest>,
2931 ) -> Self::Future {
2932 let inner = Arc::clone(&self.0);
2933 let fut = async move {
2934 <T as AuditService>::append(&inner, request).await
2935 };
2936 Box::pin(fut)
2937 }
2938 }
2939 let accept_compression_encodings = self.accept_compression_encodings;
2940 let send_compression_encodings = self.send_compression_encodings;
2941 let max_decoding_message_size = self.max_decoding_message_size;
2942 let max_encoding_message_size = self.max_encoding_message_size;
2943 let inner = self.inner.clone();
2944 let fut = async move {
2945 let method = AppendSvc(inner);
2946 let codec = tonic_prost::ProstCodec::default();
2947 let mut grpc = tonic::server::Grpc::new(codec)
2948 .apply_compression_config(
2949 accept_compression_encodings,
2950 send_compression_encodings,
2951 )
2952 .apply_max_message_size_config(
2953 max_decoding_message_size,
2954 max_encoding_message_size,
2955 );
2956 let res = grpc.unary(method, req).await;
2957 Ok(res)
2958 };
2959 Box::pin(fut)
2960 }
2961 _ => {
2962 Box::pin(async move {
2963 let mut response = http::Response::new(
2964 tonic::body::Body::default(),
2965 );
2966 let headers = response.headers_mut();
2967 headers
2968 .insert(
2969 tonic::Status::GRPC_STATUS,
2970 (tonic::Code::Unimplemented as i32).into(),
2971 );
2972 headers
2973 .insert(
2974 http::header::CONTENT_TYPE,
2975 tonic::metadata::GRPC_CONTENT_TYPE,
2976 );
2977 Ok(response)
2978 })
2979 }
2980 }
2981 }
2982 }
2983 impl<T> Clone for AuditServiceServer<T> {
2984 fn clone(&self) -> Self {
2985 let inner = self.inner.clone();
2986 Self {
2987 inner,
2988 accept_compression_encodings: self.accept_compression_encodings,
2989 send_compression_encodings: self.send_compression_encodings,
2990 max_decoding_message_size: self.max_decoding_message_size,
2991 max_encoding_message_size: self.max_encoding_message_size,
2992 }
2993 }
2994 }
2995 pub const SERVICE_NAME: &str = "pidgr.v1.AuditService";
2997 impl<T> tonic::server::NamedService for AuditServiceServer<T> {
2998 const NAME: &'static str = SERVICE_NAME;
2999 }
3000}
3001pub mod campaign_service_client {
3003 #![allow(
3004 unused_variables,
3005 dead_code,
3006 missing_docs,
3007 clippy::wildcard_imports,
3008 clippy::let_unit_value,
3009 )]
3010 use tonic::codegen::*;
3011 use tonic::codegen::http::Uri;
3012 #[derive(Debug, Clone)]
3016 pub struct CampaignServiceClient<T> {
3017 inner: tonic::client::Grpc<T>,
3018 }
3019 impl CampaignServiceClient<tonic::transport::Channel> {
3020 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
3022 where
3023 D: TryInto<tonic::transport::Endpoint>,
3024 D::Error: Into<StdError>,
3025 {
3026 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
3027 Ok(Self::new(conn))
3028 }
3029 }
3030 impl<T> CampaignServiceClient<T>
3031 where
3032 T: tonic::client::GrpcService<tonic::body::Body>,
3033 T::Error: Into<StdError>,
3034 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
3035 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
3036 {
3037 pub fn new(inner: T) -> Self {
3038 let inner = tonic::client::Grpc::new(inner);
3039 Self { inner }
3040 }
3041 pub fn with_origin(inner: T, origin: Uri) -> Self {
3042 let inner = tonic::client::Grpc::with_origin(inner, origin);
3043 Self { inner }
3044 }
3045 pub fn with_interceptor<F>(
3046 inner: T,
3047 interceptor: F,
3048 ) -> CampaignServiceClient<InterceptedService<T, F>>
3049 where
3050 F: tonic::service::Interceptor,
3051 T::ResponseBody: Default,
3052 T: tonic::codegen::Service<
3053 http::Request<tonic::body::Body>,
3054 Response = http::Response<
3055 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
3056 >,
3057 >,
3058 <T as tonic::codegen::Service<
3059 http::Request<tonic::body::Body>,
3060 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
3061 {
3062 CampaignServiceClient::new(InterceptedService::new(inner, interceptor))
3063 }
3064 #[must_use]
3069 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3070 self.inner = self.inner.send_compressed(encoding);
3071 self
3072 }
3073 #[must_use]
3075 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3076 self.inner = self.inner.accept_compressed(encoding);
3077 self
3078 }
3079 #[must_use]
3083 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3084 self.inner = self.inner.max_decoding_message_size(limit);
3085 self
3086 }
3087 #[must_use]
3091 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3092 self.inner = self.inner.max_encoding_message_size(limit);
3093 self
3094 }
3095 pub async fn create_campaign(
3099 &mut self,
3100 request: impl tonic::IntoRequest<super::CreateCampaignRequest>,
3101 ) -> std::result::Result<
3102 tonic::Response<super::CreateCampaignResponse>,
3103 tonic::Status,
3104 > {
3105 self.inner
3106 .ready()
3107 .await
3108 .map_err(|e| {
3109 tonic::Status::unknown(
3110 format!("Service was not ready: {}", e.into()),
3111 )
3112 })?;
3113 let codec = tonic_prost::ProstCodec::default();
3114 let path = http::uri::PathAndQuery::from_static(
3115 "/pidgr.v1.CampaignService/CreateCampaign",
3116 );
3117 let mut req = request.into_request();
3118 req.extensions_mut()
3119 .insert(GrpcMethod::new("pidgr.v1.CampaignService", "CreateCampaign"));
3120 self.inner.unary(req, path, codec).await
3121 }
3122 pub async fn start_campaign(
3126 &mut self,
3127 request: impl tonic::IntoRequest<super::StartCampaignRequest>,
3128 ) -> std::result::Result<
3129 tonic::Response<super::StartCampaignResponse>,
3130 tonic::Status,
3131 > {
3132 self.inner
3133 .ready()
3134 .await
3135 .map_err(|e| {
3136 tonic::Status::unknown(
3137 format!("Service was not ready: {}", e.into()),
3138 )
3139 })?;
3140 let codec = tonic_prost::ProstCodec::default();
3141 let path = http::uri::PathAndQuery::from_static(
3142 "/pidgr.v1.CampaignService/StartCampaign",
3143 );
3144 let mut req = request.into_request();
3145 req.extensions_mut()
3146 .insert(GrpcMethod::new("pidgr.v1.CampaignService", "StartCampaign"));
3147 self.inner.unary(req, path, codec).await
3148 }
3149 pub async fn get_campaign(
3153 &mut self,
3154 request: impl tonic::IntoRequest<super::GetCampaignRequest>,
3155 ) -> std::result::Result<
3156 tonic::Response<super::GetCampaignResponse>,
3157 tonic::Status,
3158 > {
3159 self.inner
3160 .ready()
3161 .await
3162 .map_err(|e| {
3163 tonic::Status::unknown(
3164 format!("Service was not ready: {}", e.into()),
3165 )
3166 })?;
3167 let codec = tonic_prost::ProstCodec::default();
3168 let path = http::uri::PathAndQuery::from_static(
3169 "/pidgr.v1.CampaignService/GetCampaign",
3170 );
3171 let mut req = request.into_request();
3172 req.extensions_mut()
3173 .insert(GrpcMethod::new("pidgr.v1.CampaignService", "GetCampaign"));
3174 self.inner.unary(req, path, codec).await
3175 }
3176 pub async fn list_campaigns(
3180 &mut self,
3181 request: impl tonic::IntoRequest<super::ListCampaignsRequest>,
3182 ) -> std::result::Result<
3183 tonic::Response<super::ListCampaignsResponse>,
3184 tonic::Status,
3185 > {
3186 self.inner
3187 .ready()
3188 .await
3189 .map_err(|e| {
3190 tonic::Status::unknown(
3191 format!("Service was not ready: {}", e.into()),
3192 )
3193 })?;
3194 let codec = tonic_prost::ProstCodec::default();
3195 let path = http::uri::PathAndQuery::from_static(
3196 "/pidgr.v1.CampaignService/ListCampaigns",
3197 );
3198 let mut req = request.into_request();
3199 req.extensions_mut()
3200 .insert(GrpcMethod::new("pidgr.v1.CampaignService", "ListCampaigns"));
3201 self.inner.unary(req, path, codec).await
3202 }
3203 pub async fn update_campaign(
3207 &mut self,
3208 request: impl tonic::IntoRequest<super::UpdateCampaignRequest>,
3209 ) -> std::result::Result<
3210 tonic::Response<super::UpdateCampaignResponse>,
3211 tonic::Status,
3212 > {
3213 self.inner
3214 .ready()
3215 .await
3216 .map_err(|e| {
3217 tonic::Status::unknown(
3218 format!("Service was not ready: {}", e.into()),
3219 )
3220 })?;
3221 let codec = tonic_prost::ProstCodec::default();
3222 let path = http::uri::PathAndQuery::from_static(
3223 "/pidgr.v1.CampaignService/UpdateCampaign",
3224 );
3225 let mut req = request.into_request();
3226 req.extensions_mut()
3227 .insert(GrpcMethod::new("pidgr.v1.CampaignService", "UpdateCampaign"));
3228 self.inner.unary(req, path, codec).await
3229 }
3230 pub async fn cancel_campaign(
3234 &mut self,
3235 request: impl tonic::IntoRequest<super::CancelCampaignRequest>,
3236 ) -> std::result::Result<
3237 tonic::Response<super::CancelCampaignResponse>,
3238 tonic::Status,
3239 > {
3240 self.inner
3241 .ready()
3242 .await
3243 .map_err(|e| {
3244 tonic::Status::unknown(
3245 format!("Service was not ready: {}", e.into()),
3246 )
3247 })?;
3248 let codec = tonic_prost::ProstCodec::default();
3249 let path = http::uri::PathAndQuery::from_static(
3250 "/pidgr.v1.CampaignService/CancelCampaign",
3251 );
3252 let mut req = request.into_request();
3253 req.extensions_mut()
3254 .insert(GrpcMethod::new("pidgr.v1.CampaignService", "CancelCampaign"));
3255 self.inner.unary(req, path, codec).await
3256 }
3257 pub async fn list_deliveries(
3261 &mut self,
3262 request: impl tonic::IntoRequest<super::ListDeliveriesRequest>,
3263 ) -> std::result::Result<
3264 tonic::Response<super::ListDeliveriesResponse>,
3265 tonic::Status,
3266 > {
3267 self.inner
3268 .ready()
3269 .await
3270 .map_err(|e| {
3271 tonic::Status::unknown(
3272 format!("Service was not ready: {}", e.into()),
3273 )
3274 })?;
3275 let codec = tonic_prost::ProstCodec::default();
3276 let path = http::uri::PathAndQuery::from_static(
3277 "/pidgr.v1.CampaignService/ListDeliveries",
3278 );
3279 let mut req = request.into_request();
3280 req.extensions_mut()
3281 .insert(GrpcMethod::new("pidgr.v1.CampaignService", "ListDeliveries"));
3282 self.inner.unary(req, path, codec).await
3283 }
3284 pub async fn get_campaign_archetype_breakdown(
3290 &mut self,
3291 request: impl tonic::IntoRequest<super::GetCampaignArchetypeBreakdownRequest>,
3292 ) -> std::result::Result<
3293 tonic::Response<super::GetCampaignArchetypeBreakdownResponse>,
3294 tonic::Status,
3295 > {
3296 self.inner
3297 .ready()
3298 .await
3299 .map_err(|e| {
3300 tonic::Status::unknown(
3301 format!("Service was not ready: {}", e.into()),
3302 )
3303 })?;
3304 let codec = tonic_prost::ProstCodec::default();
3305 let path = http::uri::PathAndQuery::from_static(
3306 "/pidgr.v1.CampaignService/GetCampaignArchetypeBreakdown",
3307 );
3308 let mut req = request.into_request();
3309 req.extensions_mut()
3310 .insert(
3311 GrpcMethod::new(
3312 "pidgr.v1.CampaignService",
3313 "GetCampaignArchetypeBreakdown",
3314 ),
3315 );
3316 self.inner.unary(req, path, codec).await
3317 }
3318 pub async fn resolve_or_create_short_code(
3326 &mut self,
3327 request: impl tonic::IntoRequest<super::ResolveOrCreateShortCodeRequest>,
3328 ) -> std::result::Result<
3329 tonic::Response<super::ResolveOrCreateShortCodeResponse>,
3330 tonic::Status,
3331 > {
3332 self.inner
3333 .ready()
3334 .await
3335 .map_err(|e| {
3336 tonic::Status::unknown(
3337 format!("Service was not ready: {}", e.into()),
3338 )
3339 })?;
3340 let codec = tonic_prost::ProstCodec::default();
3341 let path = http::uri::PathAndQuery::from_static(
3342 "/pidgr.v1.CampaignService/ResolveOrCreateShortCode",
3343 );
3344 let mut req = request.into_request();
3345 req.extensions_mut()
3346 .insert(
3347 GrpcMethod::new(
3348 "pidgr.v1.CampaignService",
3349 "ResolveOrCreateShortCode",
3350 ),
3351 );
3352 self.inner.unary(req, path, codec).await
3353 }
3354 pub async fn get_campaign_by_short_code(
3363 &mut self,
3364 request: impl tonic::IntoRequest<super::GetCampaignByShortCodeRequest>,
3365 ) -> std::result::Result<
3366 tonic::Response<super::GetCampaignByShortCodeResponse>,
3367 tonic::Status,
3368 > {
3369 self.inner
3370 .ready()
3371 .await
3372 .map_err(|e| {
3373 tonic::Status::unknown(
3374 format!("Service was not ready: {}", e.into()),
3375 )
3376 })?;
3377 let codec = tonic_prost::ProstCodec::default();
3378 let path = http::uri::PathAndQuery::from_static(
3379 "/pidgr.v1.CampaignService/GetCampaignByShortCode",
3380 );
3381 let mut req = request.into_request();
3382 req.extensions_mut()
3383 .insert(
3384 GrpcMethod::new("pidgr.v1.CampaignService", "GetCampaignByShortCode"),
3385 );
3386 self.inner.unary(req, path, codec).await
3387 }
3388 }
3389}
3390pub mod campaign_service_server {
3392 #![allow(
3393 unused_variables,
3394 dead_code,
3395 missing_docs,
3396 clippy::wildcard_imports,
3397 clippy::let_unit_value,
3398 )]
3399 use tonic::codegen::*;
3400 #[async_trait]
3402 pub trait CampaignService: std::marker::Send + std::marker::Sync + 'static {
3403 async fn create_campaign(
3407 &self,
3408 request: tonic::Request<super::CreateCampaignRequest>,
3409 ) -> std::result::Result<
3410 tonic::Response<super::CreateCampaignResponse>,
3411 tonic::Status,
3412 >;
3413 async fn start_campaign(
3417 &self,
3418 request: tonic::Request<super::StartCampaignRequest>,
3419 ) -> std::result::Result<
3420 tonic::Response<super::StartCampaignResponse>,
3421 tonic::Status,
3422 >;
3423 async fn get_campaign(
3427 &self,
3428 request: tonic::Request<super::GetCampaignRequest>,
3429 ) -> std::result::Result<
3430 tonic::Response<super::GetCampaignResponse>,
3431 tonic::Status,
3432 >;
3433 async fn list_campaigns(
3437 &self,
3438 request: tonic::Request<super::ListCampaignsRequest>,
3439 ) -> std::result::Result<
3440 tonic::Response<super::ListCampaignsResponse>,
3441 tonic::Status,
3442 >;
3443 async fn update_campaign(
3447 &self,
3448 request: tonic::Request<super::UpdateCampaignRequest>,
3449 ) -> std::result::Result<
3450 tonic::Response<super::UpdateCampaignResponse>,
3451 tonic::Status,
3452 >;
3453 async fn cancel_campaign(
3457 &self,
3458 request: tonic::Request<super::CancelCampaignRequest>,
3459 ) -> std::result::Result<
3460 tonic::Response<super::CancelCampaignResponse>,
3461 tonic::Status,
3462 >;
3463 async fn list_deliveries(
3467 &self,
3468 request: tonic::Request<super::ListDeliveriesRequest>,
3469 ) -> std::result::Result<
3470 tonic::Response<super::ListDeliveriesResponse>,
3471 tonic::Status,
3472 >;
3473 async fn get_campaign_archetype_breakdown(
3479 &self,
3480 request: tonic::Request<super::GetCampaignArchetypeBreakdownRequest>,
3481 ) -> std::result::Result<
3482 tonic::Response<super::GetCampaignArchetypeBreakdownResponse>,
3483 tonic::Status,
3484 >;
3485 async fn resolve_or_create_short_code(
3493 &self,
3494 request: tonic::Request<super::ResolveOrCreateShortCodeRequest>,
3495 ) -> std::result::Result<
3496 tonic::Response<super::ResolveOrCreateShortCodeResponse>,
3497 tonic::Status,
3498 >;
3499 async fn get_campaign_by_short_code(
3508 &self,
3509 request: tonic::Request<super::GetCampaignByShortCodeRequest>,
3510 ) -> std::result::Result<
3511 tonic::Response<super::GetCampaignByShortCodeResponse>,
3512 tonic::Status,
3513 >;
3514 }
3515 #[derive(Debug)]
3519 pub struct CampaignServiceServer<T> {
3520 inner: Arc<T>,
3521 accept_compression_encodings: EnabledCompressionEncodings,
3522 send_compression_encodings: EnabledCompressionEncodings,
3523 max_decoding_message_size: Option<usize>,
3524 max_encoding_message_size: Option<usize>,
3525 }
3526 impl<T> CampaignServiceServer<T> {
3527 pub fn new(inner: T) -> Self {
3528 Self::from_arc(Arc::new(inner))
3529 }
3530 pub fn from_arc(inner: Arc<T>) -> Self {
3531 Self {
3532 inner,
3533 accept_compression_encodings: Default::default(),
3534 send_compression_encodings: Default::default(),
3535 max_decoding_message_size: None,
3536 max_encoding_message_size: None,
3537 }
3538 }
3539 pub fn with_interceptor<F>(
3540 inner: T,
3541 interceptor: F,
3542 ) -> InterceptedService<Self, F>
3543 where
3544 F: tonic::service::Interceptor,
3545 {
3546 InterceptedService::new(Self::new(inner), interceptor)
3547 }
3548 #[must_use]
3550 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3551 self.accept_compression_encodings.enable(encoding);
3552 self
3553 }
3554 #[must_use]
3556 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3557 self.send_compression_encodings.enable(encoding);
3558 self
3559 }
3560 #[must_use]
3564 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3565 self.max_decoding_message_size = Some(limit);
3566 self
3567 }
3568 #[must_use]
3572 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3573 self.max_encoding_message_size = Some(limit);
3574 self
3575 }
3576 }
3577 impl<T, B> tonic::codegen::Service<http::Request<B>> for CampaignServiceServer<T>
3578 where
3579 T: CampaignService,
3580 B: Body + std::marker::Send + 'static,
3581 B::Error: Into<StdError> + std::marker::Send + 'static,
3582 {
3583 type Response = http::Response<tonic::body::Body>;
3584 type Error = std::convert::Infallible;
3585 type Future = BoxFuture<Self::Response, Self::Error>;
3586 fn poll_ready(
3587 &mut self,
3588 _cx: &mut Context<'_>,
3589 ) -> Poll<std::result::Result<(), Self::Error>> {
3590 Poll::Ready(Ok(()))
3591 }
3592 fn call(&mut self, req: http::Request<B>) -> Self::Future {
3593 match req.uri().path() {
3594 "/pidgr.v1.CampaignService/CreateCampaign" => {
3595 #[allow(non_camel_case_types)]
3596 struct CreateCampaignSvc<T: CampaignService>(pub Arc<T>);
3597 impl<
3598 T: CampaignService,
3599 > tonic::server::UnaryService<super::CreateCampaignRequest>
3600 for CreateCampaignSvc<T> {
3601 type Response = super::CreateCampaignResponse;
3602 type Future = BoxFuture<
3603 tonic::Response<Self::Response>,
3604 tonic::Status,
3605 >;
3606 fn call(
3607 &mut self,
3608 request: tonic::Request<super::CreateCampaignRequest>,
3609 ) -> Self::Future {
3610 let inner = Arc::clone(&self.0);
3611 let fut = async move {
3612 <T as CampaignService>::create_campaign(&inner, request)
3613 .await
3614 };
3615 Box::pin(fut)
3616 }
3617 }
3618 let accept_compression_encodings = self.accept_compression_encodings;
3619 let send_compression_encodings = self.send_compression_encodings;
3620 let max_decoding_message_size = self.max_decoding_message_size;
3621 let max_encoding_message_size = self.max_encoding_message_size;
3622 let inner = self.inner.clone();
3623 let fut = async move {
3624 let method = CreateCampaignSvc(inner);
3625 let codec = tonic_prost::ProstCodec::default();
3626 let mut grpc = tonic::server::Grpc::new(codec)
3627 .apply_compression_config(
3628 accept_compression_encodings,
3629 send_compression_encodings,
3630 )
3631 .apply_max_message_size_config(
3632 max_decoding_message_size,
3633 max_encoding_message_size,
3634 );
3635 let res = grpc.unary(method, req).await;
3636 Ok(res)
3637 };
3638 Box::pin(fut)
3639 }
3640 "/pidgr.v1.CampaignService/StartCampaign" => {
3641 #[allow(non_camel_case_types)]
3642 struct StartCampaignSvc<T: CampaignService>(pub Arc<T>);
3643 impl<
3644 T: CampaignService,
3645 > tonic::server::UnaryService<super::StartCampaignRequest>
3646 for StartCampaignSvc<T> {
3647 type Response = super::StartCampaignResponse;
3648 type Future = BoxFuture<
3649 tonic::Response<Self::Response>,
3650 tonic::Status,
3651 >;
3652 fn call(
3653 &mut self,
3654 request: tonic::Request<super::StartCampaignRequest>,
3655 ) -> Self::Future {
3656 let inner = Arc::clone(&self.0);
3657 let fut = async move {
3658 <T as CampaignService>::start_campaign(&inner, request)
3659 .await
3660 };
3661 Box::pin(fut)
3662 }
3663 }
3664 let accept_compression_encodings = self.accept_compression_encodings;
3665 let send_compression_encodings = self.send_compression_encodings;
3666 let max_decoding_message_size = self.max_decoding_message_size;
3667 let max_encoding_message_size = self.max_encoding_message_size;
3668 let inner = self.inner.clone();
3669 let fut = async move {
3670 let method = StartCampaignSvc(inner);
3671 let codec = tonic_prost::ProstCodec::default();
3672 let mut grpc = tonic::server::Grpc::new(codec)
3673 .apply_compression_config(
3674 accept_compression_encodings,
3675 send_compression_encodings,
3676 )
3677 .apply_max_message_size_config(
3678 max_decoding_message_size,
3679 max_encoding_message_size,
3680 );
3681 let res = grpc.unary(method, req).await;
3682 Ok(res)
3683 };
3684 Box::pin(fut)
3685 }
3686 "/pidgr.v1.CampaignService/GetCampaign" => {
3687 #[allow(non_camel_case_types)]
3688 struct GetCampaignSvc<T: CampaignService>(pub Arc<T>);
3689 impl<
3690 T: CampaignService,
3691 > tonic::server::UnaryService<super::GetCampaignRequest>
3692 for GetCampaignSvc<T> {
3693 type Response = super::GetCampaignResponse;
3694 type Future = BoxFuture<
3695 tonic::Response<Self::Response>,
3696 tonic::Status,
3697 >;
3698 fn call(
3699 &mut self,
3700 request: tonic::Request<super::GetCampaignRequest>,
3701 ) -> Self::Future {
3702 let inner = Arc::clone(&self.0);
3703 let fut = async move {
3704 <T as CampaignService>::get_campaign(&inner, request).await
3705 };
3706 Box::pin(fut)
3707 }
3708 }
3709 let accept_compression_encodings = self.accept_compression_encodings;
3710 let send_compression_encodings = self.send_compression_encodings;
3711 let max_decoding_message_size = self.max_decoding_message_size;
3712 let max_encoding_message_size = self.max_encoding_message_size;
3713 let inner = self.inner.clone();
3714 let fut = async move {
3715 let method = GetCampaignSvc(inner);
3716 let codec = tonic_prost::ProstCodec::default();
3717 let mut grpc = tonic::server::Grpc::new(codec)
3718 .apply_compression_config(
3719 accept_compression_encodings,
3720 send_compression_encodings,
3721 )
3722 .apply_max_message_size_config(
3723 max_decoding_message_size,
3724 max_encoding_message_size,
3725 );
3726 let res = grpc.unary(method, req).await;
3727 Ok(res)
3728 };
3729 Box::pin(fut)
3730 }
3731 "/pidgr.v1.CampaignService/ListCampaigns" => {
3732 #[allow(non_camel_case_types)]
3733 struct ListCampaignsSvc<T: CampaignService>(pub Arc<T>);
3734 impl<
3735 T: CampaignService,
3736 > tonic::server::UnaryService<super::ListCampaignsRequest>
3737 for ListCampaignsSvc<T> {
3738 type Response = super::ListCampaignsResponse;
3739 type Future = BoxFuture<
3740 tonic::Response<Self::Response>,
3741 tonic::Status,
3742 >;
3743 fn call(
3744 &mut self,
3745 request: tonic::Request<super::ListCampaignsRequest>,
3746 ) -> Self::Future {
3747 let inner = Arc::clone(&self.0);
3748 let fut = async move {
3749 <T as CampaignService>::list_campaigns(&inner, request)
3750 .await
3751 };
3752 Box::pin(fut)
3753 }
3754 }
3755 let accept_compression_encodings = self.accept_compression_encodings;
3756 let send_compression_encodings = self.send_compression_encodings;
3757 let max_decoding_message_size = self.max_decoding_message_size;
3758 let max_encoding_message_size = self.max_encoding_message_size;
3759 let inner = self.inner.clone();
3760 let fut = async move {
3761 let method = ListCampaignsSvc(inner);
3762 let codec = tonic_prost::ProstCodec::default();
3763 let mut grpc = tonic::server::Grpc::new(codec)
3764 .apply_compression_config(
3765 accept_compression_encodings,
3766 send_compression_encodings,
3767 )
3768 .apply_max_message_size_config(
3769 max_decoding_message_size,
3770 max_encoding_message_size,
3771 );
3772 let res = grpc.unary(method, req).await;
3773 Ok(res)
3774 };
3775 Box::pin(fut)
3776 }
3777 "/pidgr.v1.CampaignService/UpdateCampaign" => {
3778 #[allow(non_camel_case_types)]
3779 struct UpdateCampaignSvc<T: CampaignService>(pub Arc<T>);
3780 impl<
3781 T: CampaignService,
3782 > tonic::server::UnaryService<super::UpdateCampaignRequest>
3783 for UpdateCampaignSvc<T> {
3784 type Response = super::UpdateCampaignResponse;
3785 type Future = BoxFuture<
3786 tonic::Response<Self::Response>,
3787 tonic::Status,
3788 >;
3789 fn call(
3790 &mut self,
3791 request: tonic::Request<super::UpdateCampaignRequest>,
3792 ) -> Self::Future {
3793 let inner = Arc::clone(&self.0);
3794 let fut = async move {
3795 <T as CampaignService>::update_campaign(&inner, request)
3796 .await
3797 };
3798 Box::pin(fut)
3799 }
3800 }
3801 let accept_compression_encodings = self.accept_compression_encodings;
3802 let send_compression_encodings = self.send_compression_encodings;
3803 let max_decoding_message_size = self.max_decoding_message_size;
3804 let max_encoding_message_size = self.max_encoding_message_size;
3805 let inner = self.inner.clone();
3806 let fut = async move {
3807 let method = UpdateCampaignSvc(inner);
3808 let codec = tonic_prost::ProstCodec::default();
3809 let mut grpc = tonic::server::Grpc::new(codec)
3810 .apply_compression_config(
3811 accept_compression_encodings,
3812 send_compression_encodings,
3813 )
3814 .apply_max_message_size_config(
3815 max_decoding_message_size,
3816 max_encoding_message_size,
3817 );
3818 let res = grpc.unary(method, req).await;
3819 Ok(res)
3820 };
3821 Box::pin(fut)
3822 }
3823 "/pidgr.v1.CampaignService/CancelCampaign" => {
3824 #[allow(non_camel_case_types)]
3825 struct CancelCampaignSvc<T: CampaignService>(pub Arc<T>);
3826 impl<
3827 T: CampaignService,
3828 > tonic::server::UnaryService<super::CancelCampaignRequest>
3829 for CancelCampaignSvc<T> {
3830 type Response = super::CancelCampaignResponse;
3831 type Future = BoxFuture<
3832 tonic::Response<Self::Response>,
3833 tonic::Status,
3834 >;
3835 fn call(
3836 &mut self,
3837 request: tonic::Request<super::CancelCampaignRequest>,
3838 ) -> Self::Future {
3839 let inner = Arc::clone(&self.0);
3840 let fut = async move {
3841 <T as CampaignService>::cancel_campaign(&inner, request)
3842 .await
3843 };
3844 Box::pin(fut)
3845 }
3846 }
3847 let accept_compression_encodings = self.accept_compression_encodings;
3848 let send_compression_encodings = self.send_compression_encodings;
3849 let max_decoding_message_size = self.max_decoding_message_size;
3850 let max_encoding_message_size = self.max_encoding_message_size;
3851 let inner = self.inner.clone();
3852 let fut = async move {
3853 let method = CancelCampaignSvc(inner);
3854 let codec = tonic_prost::ProstCodec::default();
3855 let mut grpc = tonic::server::Grpc::new(codec)
3856 .apply_compression_config(
3857 accept_compression_encodings,
3858 send_compression_encodings,
3859 )
3860 .apply_max_message_size_config(
3861 max_decoding_message_size,
3862 max_encoding_message_size,
3863 );
3864 let res = grpc.unary(method, req).await;
3865 Ok(res)
3866 };
3867 Box::pin(fut)
3868 }
3869 "/pidgr.v1.CampaignService/ListDeliveries" => {
3870 #[allow(non_camel_case_types)]
3871 struct ListDeliveriesSvc<T: CampaignService>(pub Arc<T>);
3872 impl<
3873 T: CampaignService,
3874 > tonic::server::UnaryService<super::ListDeliveriesRequest>
3875 for ListDeliveriesSvc<T> {
3876 type Response = super::ListDeliveriesResponse;
3877 type Future = BoxFuture<
3878 tonic::Response<Self::Response>,
3879 tonic::Status,
3880 >;
3881 fn call(
3882 &mut self,
3883 request: tonic::Request<super::ListDeliveriesRequest>,
3884 ) -> Self::Future {
3885 let inner = Arc::clone(&self.0);
3886 let fut = async move {
3887 <T as CampaignService>::list_deliveries(&inner, request)
3888 .await
3889 };
3890 Box::pin(fut)
3891 }
3892 }
3893 let accept_compression_encodings = self.accept_compression_encodings;
3894 let send_compression_encodings = self.send_compression_encodings;
3895 let max_decoding_message_size = self.max_decoding_message_size;
3896 let max_encoding_message_size = self.max_encoding_message_size;
3897 let inner = self.inner.clone();
3898 let fut = async move {
3899 let method = ListDeliveriesSvc(inner);
3900 let codec = tonic_prost::ProstCodec::default();
3901 let mut grpc = tonic::server::Grpc::new(codec)
3902 .apply_compression_config(
3903 accept_compression_encodings,
3904 send_compression_encodings,
3905 )
3906 .apply_max_message_size_config(
3907 max_decoding_message_size,
3908 max_encoding_message_size,
3909 );
3910 let res = grpc.unary(method, req).await;
3911 Ok(res)
3912 };
3913 Box::pin(fut)
3914 }
3915 "/pidgr.v1.CampaignService/GetCampaignArchetypeBreakdown" => {
3916 #[allow(non_camel_case_types)]
3917 struct GetCampaignArchetypeBreakdownSvc<T: CampaignService>(
3918 pub Arc<T>,
3919 );
3920 impl<
3921 T: CampaignService,
3922 > tonic::server::UnaryService<
3923 super::GetCampaignArchetypeBreakdownRequest,
3924 > for GetCampaignArchetypeBreakdownSvc<T> {
3925 type Response = super::GetCampaignArchetypeBreakdownResponse;
3926 type Future = BoxFuture<
3927 tonic::Response<Self::Response>,
3928 tonic::Status,
3929 >;
3930 fn call(
3931 &mut self,
3932 request: tonic::Request<
3933 super::GetCampaignArchetypeBreakdownRequest,
3934 >,
3935 ) -> Self::Future {
3936 let inner = Arc::clone(&self.0);
3937 let fut = async move {
3938 <T as CampaignService>::get_campaign_archetype_breakdown(
3939 &inner,
3940 request,
3941 )
3942 .await
3943 };
3944 Box::pin(fut)
3945 }
3946 }
3947 let accept_compression_encodings = self.accept_compression_encodings;
3948 let send_compression_encodings = self.send_compression_encodings;
3949 let max_decoding_message_size = self.max_decoding_message_size;
3950 let max_encoding_message_size = self.max_encoding_message_size;
3951 let inner = self.inner.clone();
3952 let fut = async move {
3953 let method = GetCampaignArchetypeBreakdownSvc(inner);
3954 let codec = tonic_prost::ProstCodec::default();
3955 let mut grpc = tonic::server::Grpc::new(codec)
3956 .apply_compression_config(
3957 accept_compression_encodings,
3958 send_compression_encodings,
3959 )
3960 .apply_max_message_size_config(
3961 max_decoding_message_size,
3962 max_encoding_message_size,
3963 );
3964 let res = grpc.unary(method, req).await;
3965 Ok(res)
3966 };
3967 Box::pin(fut)
3968 }
3969 "/pidgr.v1.CampaignService/ResolveOrCreateShortCode" => {
3970 #[allow(non_camel_case_types)]
3971 struct ResolveOrCreateShortCodeSvc<T: CampaignService>(pub Arc<T>);
3972 impl<
3973 T: CampaignService,
3974 > tonic::server::UnaryService<super::ResolveOrCreateShortCodeRequest>
3975 for ResolveOrCreateShortCodeSvc<T> {
3976 type Response = super::ResolveOrCreateShortCodeResponse;
3977 type Future = BoxFuture<
3978 tonic::Response<Self::Response>,
3979 tonic::Status,
3980 >;
3981 fn call(
3982 &mut self,
3983 request: tonic::Request<
3984 super::ResolveOrCreateShortCodeRequest,
3985 >,
3986 ) -> Self::Future {
3987 let inner = Arc::clone(&self.0);
3988 let fut = async move {
3989 <T as CampaignService>::resolve_or_create_short_code(
3990 &inner,
3991 request,
3992 )
3993 .await
3994 };
3995 Box::pin(fut)
3996 }
3997 }
3998 let accept_compression_encodings = self.accept_compression_encodings;
3999 let send_compression_encodings = self.send_compression_encodings;
4000 let max_decoding_message_size = self.max_decoding_message_size;
4001 let max_encoding_message_size = self.max_encoding_message_size;
4002 let inner = self.inner.clone();
4003 let fut = async move {
4004 let method = ResolveOrCreateShortCodeSvc(inner);
4005 let codec = tonic_prost::ProstCodec::default();
4006 let mut grpc = tonic::server::Grpc::new(codec)
4007 .apply_compression_config(
4008 accept_compression_encodings,
4009 send_compression_encodings,
4010 )
4011 .apply_max_message_size_config(
4012 max_decoding_message_size,
4013 max_encoding_message_size,
4014 );
4015 let res = grpc.unary(method, req).await;
4016 Ok(res)
4017 };
4018 Box::pin(fut)
4019 }
4020 "/pidgr.v1.CampaignService/GetCampaignByShortCode" => {
4021 #[allow(non_camel_case_types)]
4022 struct GetCampaignByShortCodeSvc<T: CampaignService>(pub Arc<T>);
4023 impl<
4024 T: CampaignService,
4025 > tonic::server::UnaryService<super::GetCampaignByShortCodeRequest>
4026 for GetCampaignByShortCodeSvc<T> {
4027 type Response = super::GetCampaignByShortCodeResponse;
4028 type Future = BoxFuture<
4029 tonic::Response<Self::Response>,
4030 tonic::Status,
4031 >;
4032 fn call(
4033 &mut self,
4034 request: tonic::Request<super::GetCampaignByShortCodeRequest>,
4035 ) -> Self::Future {
4036 let inner = Arc::clone(&self.0);
4037 let fut = async move {
4038 <T as CampaignService>::get_campaign_by_short_code(
4039 &inner,
4040 request,
4041 )
4042 .await
4043 };
4044 Box::pin(fut)
4045 }
4046 }
4047 let accept_compression_encodings = self.accept_compression_encodings;
4048 let send_compression_encodings = self.send_compression_encodings;
4049 let max_decoding_message_size = self.max_decoding_message_size;
4050 let max_encoding_message_size = self.max_encoding_message_size;
4051 let inner = self.inner.clone();
4052 let fut = async move {
4053 let method = GetCampaignByShortCodeSvc(inner);
4054 let codec = tonic_prost::ProstCodec::default();
4055 let mut grpc = tonic::server::Grpc::new(codec)
4056 .apply_compression_config(
4057 accept_compression_encodings,
4058 send_compression_encodings,
4059 )
4060 .apply_max_message_size_config(
4061 max_decoding_message_size,
4062 max_encoding_message_size,
4063 );
4064 let res = grpc.unary(method, req).await;
4065 Ok(res)
4066 };
4067 Box::pin(fut)
4068 }
4069 _ => {
4070 Box::pin(async move {
4071 let mut response = http::Response::new(
4072 tonic::body::Body::default(),
4073 );
4074 let headers = response.headers_mut();
4075 headers
4076 .insert(
4077 tonic::Status::GRPC_STATUS,
4078 (tonic::Code::Unimplemented as i32).into(),
4079 );
4080 headers
4081 .insert(
4082 http::header::CONTENT_TYPE,
4083 tonic::metadata::GRPC_CONTENT_TYPE,
4084 );
4085 Ok(response)
4086 })
4087 }
4088 }
4089 }
4090 }
4091 impl<T> Clone for CampaignServiceServer<T> {
4092 fn clone(&self) -> Self {
4093 let inner = self.inner.clone();
4094 Self {
4095 inner,
4096 accept_compression_encodings: self.accept_compression_encodings,
4097 send_compression_encodings: self.send_compression_encodings,
4098 max_decoding_message_size: self.max_decoding_message_size,
4099 max_encoding_message_size: self.max_encoding_message_size,
4100 }
4101 }
4102 }
4103 pub const SERVICE_NAME: &str = "pidgr.v1.CampaignService";
4105 impl<T> tonic::server::NamedService for CampaignServiceServer<T> {
4106 const NAME: &'static str = SERVICE_NAME;
4107 }
4108}
4109pub mod device_service_client {
4111 #![allow(
4112 unused_variables,
4113 dead_code,
4114 missing_docs,
4115 clippy::wildcard_imports,
4116 clippy::let_unit_value,
4117 )]
4118 use tonic::codegen::*;
4119 use tonic::codegen::http::Uri;
4120 #[derive(Debug, Clone)]
4124 pub struct DeviceServiceClient<T> {
4125 inner: tonic::client::Grpc<T>,
4126 }
4127 impl DeviceServiceClient<tonic::transport::Channel> {
4128 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4130 where
4131 D: TryInto<tonic::transport::Endpoint>,
4132 D::Error: Into<StdError>,
4133 {
4134 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4135 Ok(Self::new(conn))
4136 }
4137 }
4138 impl<T> DeviceServiceClient<T>
4139 where
4140 T: tonic::client::GrpcService<tonic::body::Body>,
4141 T::Error: Into<StdError>,
4142 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4143 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4144 {
4145 pub fn new(inner: T) -> Self {
4146 let inner = tonic::client::Grpc::new(inner);
4147 Self { inner }
4148 }
4149 pub fn with_origin(inner: T, origin: Uri) -> Self {
4150 let inner = tonic::client::Grpc::with_origin(inner, origin);
4151 Self { inner }
4152 }
4153 pub fn with_interceptor<F>(
4154 inner: T,
4155 interceptor: F,
4156 ) -> DeviceServiceClient<InterceptedService<T, F>>
4157 where
4158 F: tonic::service::Interceptor,
4159 T::ResponseBody: Default,
4160 T: tonic::codegen::Service<
4161 http::Request<tonic::body::Body>,
4162 Response = http::Response<
4163 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4164 >,
4165 >,
4166 <T as tonic::codegen::Service<
4167 http::Request<tonic::body::Body>,
4168 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4169 {
4170 DeviceServiceClient::new(InterceptedService::new(inner, interceptor))
4171 }
4172 #[must_use]
4177 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4178 self.inner = self.inner.send_compressed(encoding);
4179 self
4180 }
4181 #[must_use]
4183 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4184 self.inner = self.inner.accept_compressed(encoding);
4185 self
4186 }
4187 #[must_use]
4191 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4192 self.inner = self.inner.max_decoding_message_size(limit);
4193 self
4194 }
4195 #[must_use]
4199 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4200 self.inner = self.inner.max_encoding_message_size(limit);
4201 self
4202 }
4203 pub async fn register(
4207 &mut self,
4208 request: impl tonic::IntoRequest<super::RegisterRequest>,
4209 ) -> std::result::Result<
4210 tonic::Response<super::RegisterResponse>,
4211 tonic::Status,
4212 > {
4213 self.inner
4214 .ready()
4215 .await
4216 .map_err(|e| {
4217 tonic::Status::unknown(
4218 format!("Service was not ready: {}", e.into()),
4219 )
4220 })?;
4221 let codec = tonic_prost::ProstCodec::default();
4222 let path = http::uri::PathAndQuery::from_static(
4223 "/pidgr.v1.DeviceService/Register",
4224 );
4225 let mut req = request.into_request();
4226 req.extensions_mut()
4227 .insert(GrpcMethod::new("pidgr.v1.DeviceService", "Register"));
4228 self.inner.unary(req, path, codec).await
4229 }
4230 pub async fn deactivate(
4234 &mut self,
4235 request: impl tonic::IntoRequest<super::DeactivateRequest>,
4236 ) -> std::result::Result<
4237 tonic::Response<super::DeactivateResponse>,
4238 tonic::Status,
4239 > {
4240 self.inner
4241 .ready()
4242 .await
4243 .map_err(|e| {
4244 tonic::Status::unknown(
4245 format!("Service was not ready: {}", e.into()),
4246 )
4247 })?;
4248 let codec = tonic_prost::ProstCodec::default();
4249 let path = http::uri::PathAndQuery::from_static(
4250 "/pidgr.v1.DeviceService/Deactivate",
4251 );
4252 let mut req = request.into_request();
4253 req.extensions_mut()
4254 .insert(GrpcMethod::new("pidgr.v1.DeviceService", "Deactivate"));
4255 self.inner.unary(req, path, codec).await
4256 }
4257 pub async fn list_devices(
4261 &mut self,
4262 request: impl tonic::IntoRequest<super::ListDevicesRequest>,
4263 ) -> std::result::Result<
4264 tonic::Response<super::ListDevicesResponse>,
4265 tonic::Status,
4266 > {
4267 self.inner
4268 .ready()
4269 .await
4270 .map_err(|e| {
4271 tonic::Status::unknown(
4272 format!("Service was not ready: {}", e.into()),
4273 )
4274 })?;
4275 let codec = tonic_prost::ProstCodec::default();
4276 let path = http::uri::PathAndQuery::from_static(
4277 "/pidgr.v1.DeviceService/ListDevices",
4278 );
4279 let mut req = request.into_request();
4280 req.extensions_mut()
4281 .insert(GrpcMethod::new("pidgr.v1.DeviceService", "ListDevices"));
4282 self.inner.unary(req, path, codec).await
4283 }
4284 pub async fn list_member_devices(
4288 &mut self,
4289 request: impl tonic::IntoRequest<super::ListMemberDevicesRequest>,
4290 ) -> std::result::Result<
4291 tonic::Response<super::ListMemberDevicesResponse>,
4292 tonic::Status,
4293 > {
4294 self.inner
4295 .ready()
4296 .await
4297 .map_err(|e| {
4298 tonic::Status::unknown(
4299 format!("Service was not ready: {}", e.into()),
4300 )
4301 })?;
4302 let codec = tonic_prost::ProstCodec::default();
4303 let path = http::uri::PathAndQuery::from_static(
4304 "/pidgr.v1.DeviceService/ListMemberDevices",
4305 );
4306 let mut req = request.into_request();
4307 req.extensions_mut()
4308 .insert(GrpcMethod::new("pidgr.v1.DeviceService", "ListMemberDevices"));
4309 self.inner.unary(req, path, codec).await
4310 }
4311 }
4312}
4313pub mod device_service_server {
4315 #![allow(
4316 unused_variables,
4317 dead_code,
4318 missing_docs,
4319 clippy::wildcard_imports,
4320 clippy::let_unit_value,
4321 )]
4322 use tonic::codegen::*;
4323 #[async_trait]
4325 pub trait DeviceService: std::marker::Send + std::marker::Sync + 'static {
4326 async fn register(
4330 &self,
4331 request: tonic::Request<super::RegisterRequest>,
4332 ) -> std::result::Result<
4333 tonic::Response<super::RegisterResponse>,
4334 tonic::Status,
4335 >;
4336 async fn deactivate(
4340 &self,
4341 request: tonic::Request<super::DeactivateRequest>,
4342 ) -> std::result::Result<
4343 tonic::Response<super::DeactivateResponse>,
4344 tonic::Status,
4345 >;
4346 async fn list_devices(
4350 &self,
4351 request: tonic::Request<super::ListDevicesRequest>,
4352 ) -> std::result::Result<
4353 tonic::Response<super::ListDevicesResponse>,
4354 tonic::Status,
4355 >;
4356 async fn list_member_devices(
4360 &self,
4361 request: tonic::Request<super::ListMemberDevicesRequest>,
4362 ) -> std::result::Result<
4363 tonic::Response<super::ListMemberDevicesResponse>,
4364 tonic::Status,
4365 >;
4366 }
4367 #[derive(Debug)]
4371 pub struct DeviceServiceServer<T> {
4372 inner: Arc<T>,
4373 accept_compression_encodings: EnabledCompressionEncodings,
4374 send_compression_encodings: EnabledCompressionEncodings,
4375 max_decoding_message_size: Option<usize>,
4376 max_encoding_message_size: Option<usize>,
4377 }
4378 impl<T> DeviceServiceServer<T> {
4379 pub fn new(inner: T) -> Self {
4380 Self::from_arc(Arc::new(inner))
4381 }
4382 pub fn from_arc(inner: Arc<T>) -> Self {
4383 Self {
4384 inner,
4385 accept_compression_encodings: Default::default(),
4386 send_compression_encodings: Default::default(),
4387 max_decoding_message_size: None,
4388 max_encoding_message_size: None,
4389 }
4390 }
4391 pub fn with_interceptor<F>(
4392 inner: T,
4393 interceptor: F,
4394 ) -> InterceptedService<Self, F>
4395 where
4396 F: tonic::service::Interceptor,
4397 {
4398 InterceptedService::new(Self::new(inner), interceptor)
4399 }
4400 #[must_use]
4402 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4403 self.accept_compression_encodings.enable(encoding);
4404 self
4405 }
4406 #[must_use]
4408 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4409 self.send_compression_encodings.enable(encoding);
4410 self
4411 }
4412 #[must_use]
4416 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4417 self.max_decoding_message_size = Some(limit);
4418 self
4419 }
4420 #[must_use]
4424 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4425 self.max_encoding_message_size = Some(limit);
4426 self
4427 }
4428 }
4429 impl<T, B> tonic::codegen::Service<http::Request<B>> for DeviceServiceServer<T>
4430 where
4431 T: DeviceService,
4432 B: Body + std::marker::Send + 'static,
4433 B::Error: Into<StdError> + std::marker::Send + 'static,
4434 {
4435 type Response = http::Response<tonic::body::Body>;
4436 type Error = std::convert::Infallible;
4437 type Future = BoxFuture<Self::Response, Self::Error>;
4438 fn poll_ready(
4439 &mut self,
4440 _cx: &mut Context<'_>,
4441 ) -> Poll<std::result::Result<(), Self::Error>> {
4442 Poll::Ready(Ok(()))
4443 }
4444 fn call(&mut self, req: http::Request<B>) -> Self::Future {
4445 match req.uri().path() {
4446 "/pidgr.v1.DeviceService/Register" => {
4447 #[allow(non_camel_case_types)]
4448 struct RegisterSvc<T: DeviceService>(pub Arc<T>);
4449 impl<
4450 T: DeviceService,
4451 > tonic::server::UnaryService<super::RegisterRequest>
4452 for RegisterSvc<T> {
4453 type Response = super::RegisterResponse;
4454 type Future = BoxFuture<
4455 tonic::Response<Self::Response>,
4456 tonic::Status,
4457 >;
4458 fn call(
4459 &mut self,
4460 request: tonic::Request<super::RegisterRequest>,
4461 ) -> Self::Future {
4462 let inner = Arc::clone(&self.0);
4463 let fut = async move {
4464 <T as DeviceService>::register(&inner, request).await
4465 };
4466 Box::pin(fut)
4467 }
4468 }
4469 let accept_compression_encodings = self.accept_compression_encodings;
4470 let send_compression_encodings = self.send_compression_encodings;
4471 let max_decoding_message_size = self.max_decoding_message_size;
4472 let max_encoding_message_size = self.max_encoding_message_size;
4473 let inner = self.inner.clone();
4474 let fut = async move {
4475 let method = RegisterSvc(inner);
4476 let codec = tonic_prost::ProstCodec::default();
4477 let mut grpc = tonic::server::Grpc::new(codec)
4478 .apply_compression_config(
4479 accept_compression_encodings,
4480 send_compression_encodings,
4481 )
4482 .apply_max_message_size_config(
4483 max_decoding_message_size,
4484 max_encoding_message_size,
4485 );
4486 let res = grpc.unary(method, req).await;
4487 Ok(res)
4488 };
4489 Box::pin(fut)
4490 }
4491 "/pidgr.v1.DeviceService/Deactivate" => {
4492 #[allow(non_camel_case_types)]
4493 struct DeactivateSvc<T: DeviceService>(pub Arc<T>);
4494 impl<
4495 T: DeviceService,
4496 > tonic::server::UnaryService<super::DeactivateRequest>
4497 for DeactivateSvc<T> {
4498 type Response = super::DeactivateResponse;
4499 type Future = BoxFuture<
4500 tonic::Response<Self::Response>,
4501 tonic::Status,
4502 >;
4503 fn call(
4504 &mut self,
4505 request: tonic::Request<super::DeactivateRequest>,
4506 ) -> Self::Future {
4507 let inner = Arc::clone(&self.0);
4508 let fut = async move {
4509 <T as DeviceService>::deactivate(&inner, request).await
4510 };
4511 Box::pin(fut)
4512 }
4513 }
4514 let accept_compression_encodings = self.accept_compression_encodings;
4515 let send_compression_encodings = self.send_compression_encodings;
4516 let max_decoding_message_size = self.max_decoding_message_size;
4517 let max_encoding_message_size = self.max_encoding_message_size;
4518 let inner = self.inner.clone();
4519 let fut = async move {
4520 let method = DeactivateSvc(inner);
4521 let codec = tonic_prost::ProstCodec::default();
4522 let mut grpc = tonic::server::Grpc::new(codec)
4523 .apply_compression_config(
4524 accept_compression_encodings,
4525 send_compression_encodings,
4526 )
4527 .apply_max_message_size_config(
4528 max_decoding_message_size,
4529 max_encoding_message_size,
4530 );
4531 let res = grpc.unary(method, req).await;
4532 Ok(res)
4533 };
4534 Box::pin(fut)
4535 }
4536 "/pidgr.v1.DeviceService/ListDevices" => {
4537 #[allow(non_camel_case_types)]
4538 struct ListDevicesSvc<T: DeviceService>(pub Arc<T>);
4539 impl<
4540 T: DeviceService,
4541 > tonic::server::UnaryService<super::ListDevicesRequest>
4542 for ListDevicesSvc<T> {
4543 type Response = super::ListDevicesResponse;
4544 type Future = BoxFuture<
4545 tonic::Response<Self::Response>,
4546 tonic::Status,
4547 >;
4548 fn call(
4549 &mut self,
4550 request: tonic::Request<super::ListDevicesRequest>,
4551 ) -> Self::Future {
4552 let inner = Arc::clone(&self.0);
4553 let fut = async move {
4554 <T as DeviceService>::list_devices(&inner, request).await
4555 };
4556 Box::pin(fut)
4557 }
4558 }
4559 let accept_compression_encodings = self.accept_compression_encodings;
4560 let send_compression_encodings = self.send_compression_encodings;
4561 let max_decoding_message_size = self.max_decoding_message_size;
4562 let max_encoding_message_size = self.max_encoding_message_size;
4563 let inner = self.inner.clone();
4564 let fut = async move {
4565 let method = ListDevicesSvc(inner);
4566 let codec = tonic_prost::ProstCodec::default();
4567 let mut grpc = tonic::server::Grpc::new(codec)
4568 .apply_compression_config(
4569 accept_compression_encodings,
4570 send_compression_encodings,
4571 )
4572 .apply_max_message_size_config(
4573 max_decoding_message_size,
4574 max_encoding_message_size,
4575 );
4576 let res = grpc.unary(method, req).await;
4577 Ok(res)
4578 };
4579 Box::pin(fut)
4580 }
4581 "/pidgr.v1.DeviceService/ListMemberDevices" => {
4582 #[allow(non_camel_case_types)]
4583 struct ListMemberDevicesSvc<T: DeviceService>(pub Arc<T>);
4584 impl<
4585 T: DeviceService,
4586 > tonic::server::UnaryService<super::ListMemberDevicesRequest>
4587 for ListMemberDevicesSvc<T> {
4588 type Response = super::ListMemberDevicesResponse;
4589 type Future = BoxFuture<
4590 tonic::Response<Self::Response>,
4591 tonic::Status,
4592 >;
4593 fn call(
4594 &mut self,
4595 request: tonic::Request<super::ListMemberDevicesRequest>,
4596 ) -> Self::Future {
4597 let inner = Arc::clone(&self.0);
4598 let fut = async move {
4599 <T as DeviceService>::list_member_devices(&inner, request)
4600 .await
4601 };
4602 Box::pin(fut)
4603 }
4604 }
4605 let accept_compression_encodings = self.accept_compression_encodings;
4606 let send_compression_encodings = self.send_compression_encodings;
4607 let max_decoding_message_size = self.max_decoding_message_size;
4608 let max_encoding_message_size = self.max_encoding_message_size;
4609 let inner = self.inner.clone();
4610 let fut = async move {
4611 let method = ListMemberDevicesSvc(inner);
4612 let codec = tonic_prost::ProstCodec::default();
4613 let mut grpc = tonic::server::Grpc::new(codec)
4614 .apply_compression_config(
4615 accept_compression_encodings,
4616 send_compression_encodings,
4617 )
4618 .apply_max_message_size_config(
4619 max_decoding_message_size,
4620 max_encoding_message_size,
4621 );
4622 let res = grpc.unary(method, req).await;
4623 Ok(res)
4624 };
4625 Box::pin(fut)
4626 }
4627 _ => {
4628 Box::pin(async move {
4629 let mut response = http::Response::new(
4630 tonic::body::Body::default(),
4631 );
4632 let headers = response.headers_mut();
4633 headers
4634 .insert(
4635 tonic::Status::GRPC_STATUS,
4636 (tonic::Code::Unimplemented as i32).into(),
4637 );
4638 headers
4639 .insert(
4640 http::header::CONTENT_TYPE,
4641 tonic::metadata::GRPC_CONTENT_TYPE,
4642 );
4643 Ok(response)
4644 })
4645 }
4646 }
4647 }
4648 }
4649 impl<T> Clone for DeviceServiceServer<T> {
4650 fn clone(&self) -> Self {
4651 let inner = self.inner.clone();
4652 Self {
4653 inner,
4654 accept_compression_encodings: self.accept_compression_encodings,
4655 send_compression_encodings: self.send_compression_encodings,
4656 max_decoding_message_size: self.max_decoding_message_size,
4657 max_encoding_message_size: self.max_encoding_message_size,
4658 }
4659 }
4660 }
4661 pub const SERVICE_NAME: &str = "pidgr.v1.DeviceService";
4663 impl<T> tonic::server::NamedService for DeviceServiceServer<T> {
4664 const NAME: &'static str = SERVICE_NAME;
4665 }
4666}
4667pub mod group_service_client {
4669 #![allow(
4670 unused_variables,
4671 dead_code,
4672 missing_docs,
4673 clippy::wildcard_imports,
4674 clippy::let_unit_value,
4675 )]
4676 use tonic::codegen::*;
4677 use tonic::codegen::http::Uri;
4678 #[derive(Debug, Clone)]
4683 pub struct GroupServiceClient<T> {
4684 inner: tonic::client::Grpc<T>,
4685 }
4686 impl GroupServiceClient<tonic::transport::Channel> {
4687 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4689 where
4690 D: TryInto<tonic::transport::Endpoint>,
4691 D::Error: Into<StdError>,
4692 {
4693 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4694 Ok(Self::new(conn))
4695 }
4696 }
4697 impl<T> GroupServiceClient<T>
4698 where
4699 T: tonic::client::GrpcService<tonic::body::Body>,
4700 T::Error: Into<StdError>,
4701 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4702 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4703 {
4704 pub fn new(inner: T) -> Self {
4705 let inner = tonic::client::Grpc::new(inner);
4706 Self { inner }
4707 }
4708 pub fn with_origin(inner: T, origin: Uri) -> Self {
4709 let inner = tonic::client::Grpc::with_origin(inner, origin);
4710 Self { inner }
4711 }
4712 pub fn with_interceptor<F>(
4713 inner: T,
4714 interceptor: F,
4715 ) -> GroupServiceClient<InterceptedService<T, F>>
4716 where
4717 F: tonic::service::Interceptor,
4718 T::ResponseBody: Default,
4719 T: tonic::codegen::Service<
4720 http::Request<tonic::body::Body>,
4721 Response = http::Response<
4722 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4723 >,
4724 >,
4725 <T as tonic::codegen::Service<
4726 http::Request<tonic::body::Body>,
4727 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4728 {
4729 GroupServiceClient::new(InterceptedService::new(inner, interceptor))
4730 }
4731 #[must_use]
4736 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4737 self.inner = self.inner.send_compressed(encoding);
4738 self
4739 }
4740 #[must_use]
4742 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4743 self.inner = self.inner.accept_compressed(encoding);
4744 self
4745 }
4746 #[must_use]
4750 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4751 self.inner = self.inner.max_decoding_message_size(limit);
4752 self
4753 }
4754 #[must_use]
4758 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4759 self.inner = self.inner.max_encoding_message_size(limit);
4760 self
4761 }
4762 pub async fn create_group(
4766 &mut self,
4767 request: impl tonic::IntoRequest<super::CreateGroupRequest>,
4768 ) -> std::result::Result<
4769 tonic::Response<super::CreateGroupResponse>,
4770 tonic::Status,
4771 > {
4772 self.inner
4773 .ready()
4774 .await
4775 .map_err(|e| {
4776 tonic::Status::unknown(
4777 format!("Service was not ready: {}", e.into()),
4778 )
4779 })?;
4780 let codec = tonic_prost::ProstCodec::default();
4781 let path = http::uri::PathAndQuery::from_static(
4782 "/pidgr.v1.GroupService/CreateGroup",
4783 );
4784 let mut req = request.into_request();
4785 req.extensions_mut()
4786 .insert(GrpcMethod::new("pidgr.v1.GroupService", "CreateGroup"));
4787 self.inner.unary(req, path, codec).await
4788 }
4789 pub async fn get_group(
4794 &mut self,
4795 request: impl tonic::IntoRequest<super::GetGroupRequest>,
4796 ) -> std::result::Result<
4797 tonic::Response<super::GetGroupResponse>,
4798 tonic::Status,
4799 > {
4800 self.inner
4801 .ready()
4802 .await
4803 .map_err(|e| {
4804 tonic::Status::unknown(
4805 format!("Service was not ready: {}", e.into()),
4806 )
4807 })?;
4808 let codec = tonic_prost::ProstCodec::default();
4809 let path = http::uri::PathAndQuery::from_static(
4810 "/pidgr.v1.GroupService/GetGroup",
4811 );
4812 let mut req = request.into_request();
4813 req.extensions_mut()
4814 .insert(GrpcMethod::new("pidgr.v1.GroupService", "GetGroup"));
4815 self.inner.unary(req, path, codec).await
4816 }
4817 pub async fn list_groups(
4821 &mut self,
4822 request: impl tonic::IntoRequest<super::ListGroupsRequest>,
4823 ) -> std::result::Result<
4824 tonic::Response<super::ListGroupsResponse>,
4825 tonic::Status,
4826 > {
4827 self.inner
4828 .ready()
4829 .await
4830 .map_err(|e| {
4831 tonic::Status::unknown(
4832 format!("Service was not ready: {}", e.into()),
4833 )
4834 })?;
4835 let codec = tonic_prost::ProstCodec::default();
4836 let path = http::uri::PathAndQuery::from_static(
4837 "/pidgr.v1.GroupService/ListGroups",
4838 );
4839 let mut req = request.into_request();
4840 req.extensions_mut()
4841 .insert(GrpcMethod::new("pidgr.v1.GroupService", "ListGroups"));
4842 self.inner.unary(req, path, codec).await
4843 }
4844 pub async fn update_group(
4848 &mut self,
4849 request: impl tonic::IntoRequest<super::UpdateGroupRequest>,
4850 ) -> std::result::Result<
4851 tonic::Response<super::UpdateGroupResponse>,
4852 tonic::Status,
4853 > {
4854 self.inner
4855 .ready()
4856 .await
4857 .map_err(|e| {
4858 tonic::Status::unknown(
4859 format!("Service was not ready: {}", e.into()),
4860 )
4861 })?;
4862 let codec = tonic_prost::ProstCodec::default();
4863 let path = http::uri::PathAndQuery::from_static(
4864 "/pidgr.v1.GroupService/UpdateGroup",
4865 );
4866 let mut req = request.into_request();
4867 req.extensions_mut()
4868 .insert(GrpcMethod::new("pidgr.v1.GroupService", "UpdateGroup"));
4869 self.inner.unary(req, path, codec).await
4870 }
4871 pub async fn delete_group(
4875 &mut self,
4876 request: impl tonic::IntoRequest<super::DeleteGroupRequest>,
4877 ) -> std::result::Result<
4878 tonic::Response<super::DeleteGroupResponse>,
4879 tonic::Status,
4880 > {
4881 self.inner
4882 .ready()
4883 .await
4884 .map_err(|e| {
4885 tonic::Status::unknown(
4886 format!("Service was not ready: {}", e.into()),
4887 )
4888 })?;
4889 let codec = tonic_prost::ProstCodec::default();
4890 let path = http::uri::PathAndQuery::from_static(
4891 "/pidgr.v1.GroupService/DeleteGroup",
4892 );
4893 let mut req = request.into_request();
4894 req.extensions_mut()
4895 .insert(GrpcMethod::new("pidgr.v1.GroupService", "DeleteGroup"));
4896 self.inner.unary(req, path, codec).await
4897 }
4898 pub async fn add_group_members(
4902 &mut self,
4903 request: impl tonic::IntoRequest<super::AddGroupMembersRequest>,
4904 ) -> std::result::Result<
4905 tonic::Response<super::AddGroupMembersResponse>,
4906 tonic::Status,
4907 > {
4908 self.inner
4909 .ready()
4910 .await
4911 .map_err(|e| {
4912 tonic::Status::unknown(
4913 format!("Service was not ready: {}", e.into()),
4914 )
4915 })?;
4916 let codec = tonic_prost::ProstCodec::default();
4917 let path = http::uri::PathAndQuery::from_static(
4918 "/pidgr.v1.GroupService/AddGroupMembers",
4919 );
4920 let mut req = request.into_request();
4921 req.extensions_mut()
4922 .insert(GrpcMethod::new("pidgr.v1.GroupService", "AddGroupMembers"));
4923 self.inner.unary(req, path, codec).await
4924 }
4925 pub async fn remove_group_members(
4929 &mut self,
4930 request: impl tonic::IntoRequest<super::RemoveGroupMembersRequest>,
4931 ) -> std::result::Result<
4932 tonic::Response<super::RemoveGroupMembersResponse>,
4933 tonic::Status,
4934 > {
4935 self.inner
4936 .ready()
4937 .await
4938 .map_err(|e| {
4939 tonic::Status::unknown(
4940 format!("Service was not ready: {}", e.into()),
4941 )
4942 })?;
4943 let codec = tonic_prost::ProstCodec::default();
4944 let path = http::uri::PathAndQuery::from_static(
4945 "/pidgr.v1.GroupService/RemoveGroupMembers",
4946 );
4947 let mut req = request.into_request();
4948 req.extensions_mut()
4949 .insert(GrpcMethod::new("pidgr.v1.GroupService", "RemoveGroupMembers"));
4950 self.inner.unary(req, path, codec).await
4951 }
4952 pub async fn list_group_members(
4957 &mut self,
4958 request: impl tonic::IntoRequest<super::ListGroupMembersRequest>,
4959 ) -> std::result::Result<
4960 tonic::Response<super::ListGroupMembersResponse>,
4961 tonic::Status,
4962 > {
4963 self.inner
4964 .ready()
4965 .await
4966 .map_err(|e| {
4967 tonic::Status::unknown(
4968 format!("Service was not ready: {}", e.into()),
4969 )
4970 })?;
4971 let codec = tonic_prost::ProstCodec::default();
4972 let path = http::uri::PathAndQuery::from_static(
4973 "/pidgr.v1.GroupService/ListGroupMembers",
4974 );
4975 let mut req = request.into_request();
4976 req.extensions_mut()
4977 .insert(GrpcMethod::new("pidgr.v1.GroupService", "ListGroupMembers"));
4978 self.inner.unary(req, path, codec).await
4979 }
4980 pub async fn get_user_group_memberships(
4985 &mut self,
4986 request: impl tonic::IntoRequest<super::GetUserGroupMembershipsRequest>,
4987 ) -> std::result::Result<
4988 tonic::Response<super::GetUserGroupMembershipsResponse>,
4989 tonic::Status,
4990 > {
4991 self.inner
4992 .ready()
4993 .await
4994 .map_err(|e| {
4995 tonic::Status::unknown(
4996 format!("Service was not ready: {}", e.into()),
4997 )
4998 })?;
4999 let codec = tonic_prost::ProstCodec::default();
5000 let path = http::uri::PathAndQuery::from_static(
5001 "/pidgr.v1.GroupService/GetUserGroupMemberships",
5002 );
5003 let mut req = request.into_request();
5004 req.extensions_mut()
5005 .insert(
5006 GrpcMethod::new("pidgr.v1.GroupService", "GetUserGroupMemberships"),
5007 );
5008 self.inner.unary(req, path, codec).await
5009 }
5010 }
5011}
5012pub mod group_service_server {
5014 #![allow(
5015 unused_variables,
5016 dead_code,
5017 missing_docs,
5018 clippy::wildcard_imports,
5019 clippy::let_unit_value,
5020 )]
5021 use tonic::codegen::*;
5022 #[async_trait]
5024 pub trait GroupService: std::marker::Send + std::marker::Sync + 'static {
5025 async fn create_group(
5029 &self,
5030 request: tonic::Request<super::CreateGroupRequest>,
5031 ) -> std::result::Result<
5032 tonic::Response<super::CreateGroupResponse>,
5033 tonic::Status,
5034 >;
5035 async fn get_group(
5040 &self,
5041 request: tonic::Request<super::GetGroupRequest>,
5042 ) -> std::result::Result<
5043 tonic::Response<super::GetGroupResponse>,
5044 tonic::Status,
5045 >;
5046 async fn list_groups(
5050 &self,
5051 request: tonic::Request<super::ListGroupsRequest>,
5052 ) -> std::result::Result<
5053 tonic::Response<super::ListGroupsResponse>,
5054 tonic::Status,
5055 >;
5056 async fn update_group(
5060 &self,
5061 request: tonic::Request<super::UpdateGroupRequest>,
5062 ) -> std::result::Result<
5063 tonic::Response<super::UpdateGroupResponse>,
5064 tonic::Status,
5065 >;
5066 async fn delete_group(
5070 &self,
5071 request: tonic::Request<super::DeleteGroupRequest>,
5072 ) -> std::result::Result<
5073 tonic::Response<super::DeleteGroupResponse>,
5074 tonic::Status,
5075 >;
5076 async fn add_group_members(
5080 &self,
5081 request: tonic::Request<super::AddGroupMembersRequest>,
5082 ) -> std::result::Result<
5083 tonic::Response<super::AddGroupMembersResponse>,
5084 tonic::Status,
5085 >;
5086 async fn remove_group_members(
5090 &self,
5091 request: tonic::Request<super::RemoveGroupMembersRequest>,
5092 ) -> std::result::Result<
5093 tonic::Response<super::RemoveGroupMembersResponse>,
5094 tonic::Status,
5095 >;
5096 async fn list_group_members(
5101 &self,
5102 request: tonic::Request<super::ListGroupMembersRequest>,
5103 ) -> std::result::Result<
5104 tonic::Response<super::ListGroupMembersResponse>,
5105 tonic::Status,
5106 >;
5107 async fn get_user_group_memberships(
5112 &self,
5113 request: tonic::Request<super::GetUserGroupMembershipsRequest>,
5114 ) -> std::result::Result<
5115 tonic::Response<super::GetUserGroupMembershipsResponse>,
5116 tonic::Status,
5117 >;
5118 }
5119 #[derive(Debug)]
5124 pub struct GroupServiceServer<T> {
5125 inner: Arc<T>,
5126 accept_compression_encodings: EnabledCompressionEncodings,
5127 send_compression_encodings: EnabledCompressionEncodings,
5128 max_decoding_message_size: Option<usize>,
5129 max_encoding_message_size: Option<usize>,
5130 }
5131 impl<T> GroupServiceServer<T> {
5132 pub fn new(inner: T) -> Self {
5133 Self::from_arc(Arc::new(inner))
5134 }
5135 pub fn from_arc(inner: Arc<T>) -> Self {
5136 Self {
5137 inner,
5138 accept_compression_encodings: Default::default(),
5139 send_compression_encodings: Default::default(),
5140 max_decoding_message_size: None,
5141 max_encoding_message_size: None,
5142 }
5143 }
5144 pub fn with_interceptor<F>(
5145 inner: T,
5146 interceptor: F,
5147 ) -> InterceptedService<Self, F>
5148 where
5149 F: tonic::service::Interceptor,
5150 {
5151 InterceptedService::new(Self::new(inner), interceptor)
5152 }
5153 #[must_use]
5155 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5156 self.accept_compression_encodings.enable(encoding);
5157 self
5158 }
5159 #[must_use]
5161 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5162 self.send_compression_encodings.enable(encoding);
5163 self
5164 }
5165 #[must_use]
5169 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5170 self.max_decoding_message_size = Some(limit);
5171 self
5172 }
5173 #[must_use]
5177 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5178 self.max_encoding_message_size = Some(limit);
5179 self
5180 }
5181 }
5182 impl<T, B> tonic::codegen::Service<http::Request<B>> for GroupServiceServer<T>
5183 where
5184 T: GroupService,
5185 B: Body + std::marker::Send + 'static,
5186 B::Error: Into<StdError> + std::marker::Send + 'static,
5187 {
5188 type Response = http::Response<tonic::body::Body>;
5189 type Error = std::convert::Infallible;
5190 type Future = BoxFuture<Self::Response, Self::Error>;
5191 fn poll_ready(
5192 &mut self,
5193 _cx: &mut Context<'_>,
5194 ) -> Poll<std::result::Result<(), Self::Error>> {
5195 Poll::Ready(Ok(()))
5196 }
5197 fn call(&mut self, req: http::Request<B>) -> Self::Future {
5198 match req.uri().path() {
5199 "/pidgr.v1.GroupService/CreateGroup" => {
5200 #[allow(non_camel_case_types)]
5201 struct CreateGroupSvc<T: GroupService>(pub Arc<T>);
5202 impl<
5203 T: GroupService,
5204 > tonic::server::UnaryService<super::CreateGroupRequest>
5205 for CreateGroupSvc<T> {
5206 type Response = super::CreateGroupResponse;
5207 type Future = BoxFuture<
5208 tonic::Response<Self::Response>,
5209 tonic::Status,
5210 >;
5211 fn call(
5212 &mut self,
5213 request: tonic::Request<super::CreateGroupRequest>,
5214 ) -> Self::Future {
5215 let inner = Arc::clone(&self.0);
5216 let fut = async move {
5217 <T as GroupService>::create_group(&inner, request).await
5218 };
5219 Box::pin(fut)
5220 }
5221 }
5222 let accept_compression_encodings = self.accept_compression_encodings;
5223 let send_compression_encodings = self.send_compression_encodings;
5224 let max_decoding_message_size = self.max_decoding_message_size;
5225 let max_encoding_message_size = self.max_encoding_message_size;
5226 let inner = self.inner.clone();
5227 let fut = async move {
5228 let method = CreateGroupSvc(inner);
5229 let codec = tonic_prost::ProstCodec::default();
5230 let mut grpc = tonic::server::Grpc::new(codec)
5231 .apply_compression_config(
5232 accept_compression_encodings,
5233 send_compression_encodings,
5234 )
5235 .apply_max_message_size_config(
5236 max_decoding_message_size,
5237 max_encoding_message_size,
5238 );
5239 let res = grpc.unary(method, req).await;
5240 Ok(res)
5241 };
5242 Box::pin(fut)
5243 }
5244 "/pidgr.v1.GroupService/GetGroup" => {
5245 #[allow(non_camel_case_types)]
5246 struct GetGroupSvc<T: GroupService>(pub Arc<T>);
5247 impl<
5248 T: GroupService,
5249 > tonic::server::UnaryService<super::GetGroupRequest>
5250 for GetGroupSvc<T> {
5251 type Response = super::GetGroupResponse;
5252 type Future = BoxFuture<
5253 tonic::Response<Self::Response>,
5254 tonic::Status,
5255 >;
5256 fn call(
5257 &mut self,
5258 request: tonic::Request<super::GetGroupRequest>,
5259 ) -> Self::Future {
5260 let inner = Arc::clone(&self.0);
5261 let fut = async move {
5262 <T as GroupService>::get_group(&inner, request).await
5263 };
5264 Box::pin(fut)
5265 }
5266 }
5267 let accept_compression_encodings = self.accept_compression_encodings;
5268 let send_compression_encodings = self.send_compression_encodings;
5269 let max_decoding_message_size = self.max_decoding_message_size;
5270 let max_encoding_message_size = self.max_encoding_message_size;
5271 let inner = self.inner.clone();
5272 let fut = async move {
5273 let method = GetGroupSvc(inner);
5274 let codec = tonic_prost::ProstCodec::default();
5275 let mut grpc = tonic::server::Grpc::new(codec)
5276 .apply_compression_config(
5277 accept_compression_encodings,
5278 send_compression_encodings,
5279 )
5280 .apply_max_message_size_config(
5281 max_decoding_message_size,
5282 max_encoding_message_size,
5283 );
5284 let res = grpc.unary(method, req).await;
5285 Ok(res)
5286 };
5287 Box::pin(fut)
5288 }
5289 "/pidgr.v1.GroupService/ListGroups" => {
5290 #[allow(non_camel_case_types)]
5291 struct ListGroupsSvc<T: GroupService>(pub Arc<T>);
5292 impl<
5293 T: GroupService,
5294 > tonic::server::UnaryService<super::ListGroupsRequest>
5295 for ListGroupsSvc<T> {
5296 type Response = super::ListGroupsResponse;
5297 type Future = BoxFuture<
5298 tonic::Response<Self::Response>,
5299 tonic::Status,
5300 >;
5301 fn call(
5302 &mut self,
5303 request: tonic::Request<super::ListGroupsRequest>,
5304 ) -> Self::Future {
5305 let inner = Arc::clone(&self.0);
5306 let fut = async move {
5307 <T as GroupService>::list_groups(&inner, request).await
5308 };
5309 Box::pin(fut)
5310 }
5311 }
5312 let accept_compression_encodings = self.accept_compression_encodings;
5313 let send_compression_encodings = self.send_compression_encodings;
5314 let max_decoding_message_size = self.max_decoding_message_size;
5315 let max_encoding_message_size = self.max_encoding_message_size;
5316 let inner = self.inner.clone();
5317 let fut = async move {
5318 let method = ListGroupsSvc(inner);
5319 let codec = tonic_prost::ProstCodec::default();
5320 let mut grpc = tonic::server::Grpc::new(codec)
5321 .apply_compression_config(
5322 accept_compression_encodings,
5323 send_compression_encodings,
5324 )
5325 .apply_max_message_size_config(
5326 max_decoding_message_size,
5327 max_encoding_message_size,
5328 );
5329 let res = grpc.unary(method, req).await;
5330 Ok(res)
5331 };
5332 Box::pin(fut)
5333 }
5334 "/pidgr.v1.GroupService/UpdateGroup" => {
5335 #[allow(non_camel_case_types)]
5336 struct UpdateGroupSvc<T: GroupService>(pub Arc<T>);
5337 impl<
5338 T: GroupService,
5339 > tonic::server::UnaryService<super::UpdateGroupRequest>
5340 for UpdateGroupSvc<T> {
5341 type Response = super::UpdateGroupResponse;
5342 type Future = BoxFuture<
5343 tonic::Response<Self::Response>,
5344 tonic::Status,
5345 >;
5346 fn call(
5347 &mut self,
5348 request: tonic::Request<super::UpdateGroupRequest>,
5349 ) -> Self::Future {
5350 let inner = Arc::clone(&self.0);
5351 let fut = async move {
5352 <T as GroupService>::update_group(&inner, request).await
5353 };
5354 Box::pin(fut)
5355 }
5356 }
5357 let accept_compression_encodings = self.accept_compression_encodings;
5358 let send_compression_encodings = self.send_compression_encodings;
5359 let max_decoding_message_size = self.max_decoding_message_size;
5360 let max_encoding_message_size = self.max_encoding_message_size;
5361 let inner = self.inner.clone();
5362 let fut = async move {
5363 let method = UpdateGroupSvc(inner);
5364 let codec = tonic_prost::ProstCodec::default();
5365 let mut grpc = tonic::server::Grpc::new(codec)
5366 .apply_compression_config(
5367 accept_compression_encodings,
5368 send_compression_encodings,
5369 )
5370 .apply_max_message_size_config(
5371 max_decoding_message_size,
5372 max_encoding_message_size,
5373 );
5374 let res = grpc.unary(method, req).await;
5375 Ok(res)
5376 };
5377 Box::pin(fut)
5378 }
5379 "/pidgr.v1.GroupService/DeleteGroup" => {
5380 #[allow(non_camel_case_types)]
5381 struct DeleteGroupSvc<T: GroupService>(pub Arc<T>);
5382 impl<
5383 T: GroupService,
5384 > tonic::server::UnaryService<super::DeleteGroupRequest>
5385 for DeleteGroupSvc<T> {
5386 type Response = super::DeleteGroupResponse;
5387 type Future = BoxFuture<
5388 tonic::Response<Self::Response>,
5389 tonic::Status,
5390 >;
5391 fn call(
5392 &mut self,
5393 request: tonic::Request<super::DeleteGroupRequest>,
5394 ) -> Self::Future {
5395 let inner = Arc::clone(&self.0);
5396 let fut = async move {
5397 <T as GroupService>::delete_group(&inner, request).await
5398 };
5399 Box::pin(fut)
5400 }
5401 }
5402 let accept_compression_encodings = self.accept_compression_encodings;
5403 let send_compression_encodings = self.send_compression_encodings;
5404 let max_decoding_message_size = self.max_decoding_message_size;
5405 let max_encoding_message_size = self.max_encoding_message_size;
5406 let inner = self.inner.clone();
5407 let fut = async move {
5408 let method = DeleteGroupSvc(inner);
5409 let codec = tonic_prost::ProstCodec::default();
5410 let mut grpc = tonic::server::Grpc::new(codec)
5411 .apply_compression_config(
5412 accept_compression_encodings,
5413 send_compression_encodings,
5414 )
5415 .apply_max_message_size_config(
5416 max_decoding_message_size,
5417 max_encoding_message_size,
5418 );
5419 let res = grpc.unary(method, req).await;
5420 Ok(res)
5421 };
5422 Box::pin(fut)
5423 }
5424 "/pidgr.v1.GroupService/AddGroupMembers" => {
5425 #[allow(non_camel_case_types)]
5426 struct AddGroupMembersSvc<T: GroupService>(pub Arc<T>);
5427 impl<
5428 T: GroupService,
5429 > tonic::server::UnaryService<super::AddGroupMembersRequest>
5430 for AddGroupMembersSvc<T> {
5431 type Response = super::AddGroupMembersResponse;
5432 type Future = BoxFuture<
5433 tonic::Response<Self::Response>,
5434 tonic::Status,
5435 >;
5436 fn call(
5437 &mut self,
5438 request: tonic::Request<super::AddGroupMembersRequest>,
5439 ) -> Self::Future {
5440 let inner = Arc::clone(&self.0);
5441 let fut = async move {
5442 <T as GroupService>::add_group_members(&inner, request)
5443 .await
5444 };
5445 Box::pin(fut)
5446 }
5447 }
5448 let accept_compression_encodings = self.accept_compression_encodings;
5449 let send_compression_encodings = self.send_compression_encodings;
5450 let max_decoding_message_size = self.max_decoding_message_size;
5451 let max_encoding_message_size = self.max_encoding_message_size;
5452 let inner = self.inner.clone();
5453 let fut = async move {
5454 let method = AddGroupMembersSvc(inner);
5455 let codec = tonic_prost::ProstCodec::default();
5456 let mut grpc = tonic::server::Grpc::new(codec)
5457 .apply_compression_config(
5458 accept_compression_encodings,
5459 send_compression_encodings,
5460 )
5461 .apply_max_message_size_config(
5462 max_decoding_message_size,
5463 max_encoding_message_size,
5464 );
5465 let res = grpc.unary(method, req).await;
5466 Ok(res)
5467 };
5468 Box::pin(fut)
5469 }
5470 "/pidgr.v1.GroupService/RemoveGroupMembers" => {
5471 #[allow(non_camel_case_types)]
5472 struct RemoveGroupMembersSvc<T: GroupService>(pub Arc<T>);
5473 impl<
5474 T: GroupService,
5475 > tonic::server::UnaryService<super::RemoveGroupMembersRequest>
5476 for RemoveGroupMembersSvc<T> {
5477 type Response = super::RemoveGroupMembersResponse;
5478 type Future = BoxFuture<
5479 tonic::Response<Self::Response>,
5480 tonic::Status,
5481 >;
5482 fn call(
5483 &mut self,
5484 request: tonic::Request<super::RemoveGroupMembersRequest>,
5485 ) -> Self::Future {
5486 let inner = Arc::clone(&self.0);
5487 let fut = async move {
5488 <T as GroupService>::remove_group_members(&inner, request)
5489 .await
5490 };
5491 Box::pin(fut)
5492 }
5493 }
5494 let accept_compression_encodings = self.accept_compression_encodings;
5495 let send_compression_encodings = self.send_compression_encodings;
5496 let max_decoding_message_size = self.max_decoding_message_size;
5497 let max_encoding_message_size = self.max_encoding_message_size;
5498 let inner = self.inner.clone();
5499 let fut = async move {
5500 let method = RemoveGroupMembersSvc(inner);
5501 let codec = tonic_prost::ProstCodec::default();
5502 let mut grpc = tonic::server::Grpc::new(codec)
5503 .apply_compression_config(
5504 accept_compression_encodings,
5505 send_compression_encodings,
5506 )
5507 .apply_max_message_size_config(
5508 max_decoding_message_size,
5509 max_encoding_message_size,
5510 );
5511 let res = grpc.unary(method, req).await;
5512 Ok(res)
5513 };
5514 Box::pin(fut)
5515 }
5516 "/pidgr.v1.GroupService/ListGroupMembers" => {
5517 #[allow(non_camel_case_types)]
5518 struct ListGroupMembersSvc<T: GroupService>(pub Arc<T>);
5519 impl<
5520 T: GroupService,
5521 > tonic::server::UnaryService<super::ListGroupMembersRequest>
5522 for ListGroupMembersSvc<T> {
5523 type Response = super::ListGroupMembersResponse;
5524 type Future = BoxFuture<
5525 tonic::Response<Self::Response>,
5526 tonic::Status,
5527 >;
5528 fn call(
5529 &mut self,
5530 request: tonic::Request<super::ListGroupMembersRequest>,
5531 ) -> Self::Future {
5532 let inner = Arc::clone(&self.0);
5533 let fut = async move {
5534 <T as GroupService>::list_group_members(&inner, request)
5535 .await
5536 };
5537 Box::pin(fut)
5538 }
5539 }
5540 let accept_compression_encodings = self.accept_compression_encodings;
5541 let send_compression_encodings = self.send_compression_encodings;
5542 let max_decoding_message_size = self.max_decoding_message_size;
5543 let max_encoding_message_size = self.max_encoding_message_size;
5544 let inner = self.inner.clone();
5545 let fut = async move {
5546 let method = ListGroupMembersSvc(inner);
5547 let codec = tonic_prost::ProstCodec::default();
5548 let mut grpc = tonic::server::Grpc::new(codec)
5549 .apply_compression_config(
5550 accept_compression_encodings,
5551 send_compression_encodings,
5552 )
5553 .apply_max_message_size_config(
5554 max_decoding_message_size,
5555 max_encoding_message_size,
5556 );
5557 let res = grpc.unary(method, req).await;
5558 Ok(res)
5559 };
5560 Box::pin(fut)
5561 }
5562 "/pidgr.v1.GroupService/GetUserGroupMemberships" => {
5563 #[allow(non_camel_case_types)]
5564 struct GetUserGroupMembershipsSvc<T: GroupService>(pub Arc<T>);
5565 impl<
5566 T: GroupService,
5567 > tonic::server::UnaryService<super::GetUserGroupMembershipsRequest>
5568 for GetUserGroupMembershipsSvc<T> {
5569 type Response = super::GetUserGroupMembershipsResponse;
5570 type Future = BoxFuture<
5571 tonic::Response<Self::Response>,
5572 tonic::Status,
5573 >;
5574 fn call(
5575 &mut self,
5576 request: tonic::Request<
5577 super::GetUserGroupMembershipsRequest,
5578 >,
5579 ) -> Self::Future {
5580 let inner = Arc::clone(&self.0);
5581 let fut = async move {
5582 <T as GroupService>::get_user_group_memberships(
5583 &inner,
5584 request,
5585 )
5586 .await
5587 };
5588 Box::pin(fut)
5589 }
5590 }
5591 let accept_compression_encodings = self.accept_compression_encodings;
5592 let send_compression_encodings = self.send_compression_encodings;
5593 let max_decoding_message_size = self.max_decoding_message_size;
5594 let max_encoding_message_size = self.max_encoding_message_size;
5595 let inner = self.inner.clone();
5596 let fut = async move {
5597 let method = GetUserGroupMembershipsSvc(inner);
5598 let codec = tonic_prost::ProstCodec::default();
5599 let mut grpc = tonic::server::Grpc::new(codec)
5600 .apply_compression_config(
5601 accept_compression_encodings,
5602 send_compression_encodings,
5603 )
5604 .apply_max_message_size_config(
5605 max_decoding_message_size,
5606 max_encoding_message_size,
5607 );
5608 let res = grpc.unary(method, req).await;
5609 Ok(res)
5610 };
5611 Box::pin(fut)
5612 }
5613 _ => {
5614 Box::pin(async move {
5615 let mut response = http::Response::new(
5616 tonic::body::Body::default(),
5617 );
5618 let headers = response.headers_mut();
5619 headers
5620 .insert(
5621 tonic::Status::GRPC_STATUS,
5622 (tonic::Code::Unimplemented as i32).into(),
5623 );
5624 headers
5625 .insert(
5626 http::header::CONTENT_TYPE,
5627 tonic::metadata::GRPC_CONTENT_TYPE,
5628 );
5629 Ok(response)
5630 })
5631 }
5632 }
5633 }
5634 }
5635 impl<T> Clone for GroupServiceServer<T> {
5636 fn clone(&self) -> Self {
5637 let inner = self.inner.clone();
5638 Self {
5639 inner,
5640 accept_compression_encodings: self.accept_compression_encodings,
5641 send_compression_encodings: self.send_compression_encodings,
5642 max_decoding_message_size: self.max_decoding_message_size,
5643 max_encoding_message_size: self.max_encoding_message_size,
5644 }
5645 }
5646 }
5647 pub const SERVICE_NAME: &str = "pidgr.v1.GroupService";
5649 impl<T> tonic::server::NamedService for GroupServiceServer<T> {
5650 const NAME: &'static str = SERVICE_NAME;
5651 }
5652}
5653pub mod heatmap_service_client {
5655 #![allow(
5656 unused_variables,
5657 dead_code,
5658 missing_docs,
5659 clippy::wildcard_imports,
5660 clippy::let_unit_value,
5661 )]
5662 use tonic::codegen::*;
5663 use tonic::codegen::http::Uri;
5664 #[derive(Debug, Clone)]
5668 pub struct HeatmapServiceClient<T> {
5669 inner: tonic::client::Grpc<T>,
5670 }
5671 impl HeatmapServiceClient<tonic::transport::Channel> {
5672 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5674 where
5675 D: TryInto<tonic::transport::Endpoint>,
5676 D::Error: Into<StdError>,
5677 {
5678 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5679 Ok(Self::new(conn))
5680 }
5681 }
5682 impl<T> HeatmapServiceClient<T>
5683 where
5684 T: tonic::client::GrpcService<tonic::body::Body>,
5685 T::Error: Into<StdError>,
5686 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5687 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5688 {
5689 pub fn new(inner: T) -> Self {
5690 let inner = tonic::client::Grpc::new(inner);
5691 Self { inner }
5692 }
5693 pub fn with_origin(inner: T, origin: Uri) -> Self {
5694 let inner = tonic::client::Grpc::with_origin(inner, origin);
5695 Self { inner }
5696 }
5697 pub fn with_interceptor<F>(
5698 inner: T,
5699 interceptor: F,
5700 ) -> HeatmapServiceClient<InterceptedService<T, F>>
5701 where
5702 F: tonic::service::Interceptor,
5703 T::ResponseBody: Default,
5704 T: tonic::codegen::Service<
5705 http::Request<tonic::body::Body>,
5706 Response = http::Response<
5707 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
5708 >,
5709 >,
5710 <T as tonic::codegen::Service<
5711 http::Request<tonic::body::Body>,
5712 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
5713 {
5714 HeatmapServiceClient::new(InterceptedService::new(inner, interceptor))
5715 }
5716 #[must_use]
5721 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5722 self.inner = self.inner.send_compressed(encoding);
5723 self
5724 }
5725 #[must_use]
5727 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5728 self.inner = self.inner.accept_compressed(encoding);
5729 self
5730 }
5731 #[must_use]
5735 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5736 self.inner = self.inner.max_decoding_message_size(limit);
5737 self
5738 }
5739 #[must_use]
5743 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5744 self.inner = self.inner.max_encoding_message_size(limit);
5745 self
5746 }
5747 pub async fn ingest_touch_events(
5751 &mut self,
5752 request: impl tonic::IntoRequest<super::IngestTouchEventsRequest>,
5753 ) -> std::result::Result<
5754 tonic::Response<super::IngestTouchEventsResponse>,
5755 tonic::Status,
5756 > {
5757 self.inner
5758 .ready()
5759 .await
5760 .map_err(|e| {
5761 tonic::Status::unknown(
5762 format!("Service was not ready: {}", e.into()),
5763 )
5764 })?;
5765 let codec = tonic_prost::ProstCodec::default();
5766 let path = http::uri::PathAndQuery::from_static(
5767 "/pidgr.v1.HeatmapService/IngestTouchEvents",
5768 );
5769 let mut req = request.into_request();
5770 req.extensions_mut()
5771 .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "IngestTouchEvents"));
5772 self.inner.unary(req, path, codec).await
5773 }
5774 pub async fn query_heatmap_data(
5778 &mut self,
5779 request: impl tonic::IntoRequest<super::QueryHeatmapDataRequest>,
5780 ) -> std::result::Result<
5781 tonic::Response<super::QueryHeatmapDataResponse>,
5782 tonic::Status,
5783 > {
5784 self.inner
5785 .ready()
5786 .await
5787 .map_err(|e| {
5788 tonic::Status::unknown(
5789 format!("Service was not ready: {}", e.into()),
5790 )
5791 })?;
5792 let codec = tonic_prost::ProstCodec::default();
5793 let path = http::uri::PathAndQuery::from_static(
5794 "/pidgr.v1.HeatmapService/QueryHeatmapData",
5795 );
5796 let mut req = request.into_request();
5797 req.extensions_mut()
5798 .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "QueryHeatmapData"));
5799 self.inner.unary(req, path, codec).await
5800 }
5801 pub async fn list_screenshots(
5805 &mut self,
5806 request: impl tonic::IntoRequest<super::ListScreenshotsRequest>,
5807 ) -> std::result::Result<
5808 tonic::Response<super::ListScreenshotsResponse>,
5809 tonic::Status,
5810 > {
5811 self.inner
5812 .ready()
5813 .await
5814 .map_err(|e| {
5815 tonic::Status::unknown(
5816 format!("Service was not ready: {}", e.into()),
5817 )
5818 })?;
5819 let codec = tonic_prost::ProstCodec::default();
5820 let path = http::uri::PathAndQuery::from_static(
5821 "/pidgr.v1.HeatmapService/ListScreenshots",
5822 );
5823 let mut req = request.into_request();
5824 req.extensions_mut()
5825 .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "ListScreenshots"));
5826 self.inner.unary(req, path, codec).await
5827 }
5828 pub async fn upload_screenshot(
5832 &mut self,
5833 request: impl tonic::IntoRequest<super::UploadScreenshotRequest>,
5834 ) -> std::result::Result<
5835 tonic::Response<super::UploadScreenshotResponse>,
5836 tonic::Status,
5837 > {
5838 self.inner
5839 .ready()
5840 .await
5841 .map_err(|e| {
5842 tonic::Status::unknown(
5843 format!("Service was not ready: {}", e.into()),
5844 )
5845 })?;
5846 let codec = tonic_prost::ProstCodec::default();
5847 let path = http::uri::PathAndQuery::from_static(
5848 "/pidgr.v1.HeatmapService/UploadScreenshot",
5849 );
5850 let mut req = request.into_request();
5851 req.extensions_mut()
5852 .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "UploadScreenshot"));
5853 self.inner.unary(req, path, codec).await
5854 }
5855 }
5856}
5857pub mod heatmap_service_server {
5859 #![allow(
5860 unused_variables,
5861 dead_code,
5862 missing_docs,
5863 clippy::wildcard_imports,
5864 clippy::let_unit_value,
5865 )]
5866 use tonic::codegen::*;
5867 #[async_trait]
5869 pub trait HeatmapService: std::marker::Send + std::marker::Sync + 'static {
5870 async fn ingest_touch_events(
5874 &self,
5875 request: tonic::Request<super::IngestTouchEventsRequest>,
5876 ) -> std::result::Result<
5877 tonic::Response<super::IngestTouchEventsResponse>,
5878 tonic::Status,
5879 >;
5880 async fn query_heatmap_data(
5884 &self,
5885 request: tonic::Request<super::QueryHeatmapDataRequest>,
5886 ) -> std::result::Result<
5887 tonic::Response<super::QueryHeatmapDataResponse>,
5888 tonic::Status,
5889 >;
5890 async fn list_screenshots(
5894 &self,
5895 request: tonic::Request<super::ListScreenshotsRequest>,
5896 ) -> std::result::Result<
5897 tonic::Response<super::ListScreenshotsResponse>,
5898 tonic::Status,
5899 >;
5900 async fn upload_screenshot(
5904 &self,
5905 request: tonic::Request<super::UploadScreenshotRequest>,
5906 ) -> std::result::Result<
5907 tonic::Response<super::UploadScreenshotResponse>,
5908 tonic::Status,
5909 >;
5910 }
5911 #[derive(Debug)]
5915 pub struct HeatmapServiceServer<T> {
5916 inner: Arc<T>,
5917 accept_compression_encodings: EnabledCompressionEncodings,
5918 send_compression_encodings: EnabledCompressionEncodings,
5919 max_decoding_message_size: Option<usize>,
5920 max_encoding_message_size: Option<usize>,
5921 }
5922 impl<T> HeatmapServiceServer<T> {
5923 pub fn new(inner: T) -> Self {
5924 Self::from_arc(Arc::new(inner))
5925 }
5926 pub fn from_arc(inner: Arc<T>) -> Self {
5927 Self {
5928 inner,
5929 accept_compression_encodings: Default::default(),
5930 send_compression_encodings: Default::default(),
5931 max_decoding_message_size: None,
5932 max_encoding_message_size: None,
5933 }
5934 }
5935 pub fn with_interceptor<F>(
5936 inner: T,
5937 interceptor: F,
5938 ) -> InterceptedService<Self, F>
5939 where
5940 F: tonic::service::Interceptor,
5941 {
5942 InterceptedService::new(Self::new(inner), interceptor)
5943 }
5944 #[must_use]
5946 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5947 self.accept_compression_encodings.enable(encoding);
5948 self
5949 }
5950 #[must_use]
5952 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5953 self.send_compression_encodings.enable(encoding);
5954 self
5955 }
5956 #[must_use]
5960 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5961 self.max_decoding_message_size = Some(limit);
5962 self
5963 }
5964 #[must_use]
5968 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5969 self.max_encoding_message_size = Some(limit);
5970 self
5971 }
5972 }
5973 impl<T, B> tonic::codegen::Service<http::Request<B>> for HeatmapServiceServer<T>
5974 where
5975 T: HeatmapService,
5976 B: Body + std::marker::Send + 'static,
5977 B::Error: Into<StdError> + std::marker::Send + 'static,
5978 {
5979 type Response = http::Response<tonic::body::Body>;
5980 type Error = std::convert::Infallible;
5981 type Future = BoxFuture<Self::Response, Self::Error>;
5982 fn poll_ready(
5983 &mut self,
5984 _cx: &mut Context<'_>,
5985 ) -> Poll<std::result::Result<(), Self::Error>> {
5986 Poll::Ready(Ok(()))
5987 }
5988 fn call(&mut self, req: http::Request<B>) -> Self::Future {
5989 match req.uri().path() {
5990 "/pidgr.v1.HeatmapService/IngestTouchEvents" => {
5991 #[allow(non_camel_case_types)]
5992 struct IngestTouchEventsSvc<T: HeatmapService>(pub Arc<T>);
5993 impl<
5994 T: HeatmapService,
5995 > tonic::server::UnaryService<super::IngestTouchEventsRequest>
5996 for IngestTouchEventsSvc<T> {
5997 type Response = super::IngestTouchEventsResponse;
5998 type Future = BoxFuture<
5999 tonic::Response<Self::Response>,
6000 tonic::Status,
6001 >;
6002 fn call(
6003 &mut self,
6004 request: tonic::Request<super::IngestTouchEventsRequest>,
6005 ) -> Self::Future {
6006 let inner = Arc::clone(&self.0);
6007 let fut = async move {
6008 <T as HeatmapService>::ingest_touch_events(&inner, request)
6009 .await
6010 };
6011 Box::pin(fut)
6012 }
6013 }
6014 let accept_compression_encodings = self.accept_compression_encodings;
6015 let send_compression_encodings = self.send_compression_encodings;
6016 let max_decoding_message_size = self.max_decoding_message_size;
6017 let max_encoding_message_size = self.max_encoding_message_size;
6018 let inner = self.inner.clone();
6019 let fut = async move {
6020 let method = IngestTouchEventsSvc(inner);
6021 let codec = tonic_prost::ProstCodec::default();
6022 let mut grpc = tonic::server::Grpc::new(codec)
6023 .apply_compression_config(
6024 accept_compression_encodings,
6025 send_compression_encodings,
6026 )
6027 .apply_max_message_size_config(
6028 max_decoding_message_size,
6029 max_encoding_message_size,
6030 );
6031 let res = grpc.unary(method, req).await;
6032 Ok(res)
6033 };
6034 Box::pin(fut)
6035 }
6036 "/pidgr.v1.HeatmapService/QueryHeatmapData" => {
6037 #[allow(non_camel_case_types)]
6038 struct QueryHeatmapDataSvc<T: HeatmapService>(pub Arc<T>);
6039 impl<
6040 T: HeatmapService,
6041 > tonic::server::UnaryService<super::QueryHeatmapDataRequest>
6042 for QueryHeatmapDataSvc<T> {
6043 type Response = super::QueryHeatmapDataResponse;
6044 type Future = BoxFuture<
6045 tonic::Response<Self::Response>,
6046 tonic::Status,
6047 >;
6048 fn call(
6049 &mut self,
6050 request: tonic::Request<super::QueryHeatmapDataRequest>,
6051 ) -> Self::Future {
6052 let inner = Arc::clone(&self.0);
6053 let fut = async move {
6054 <T as HeatmapService>::query_heatmap_data(&inner, request)
6055 .await
6056 };
6057 Box::pin(fut)
6058 }
6059 }
6060 let accept_compression_encodings = self.accept_compression_encodings;
6061 let send_compression_encodings = self.send_compression_encodings;
6062 let max_decoding_message_size = self.max_decoding_message_size;
6063 let max_encoding_message_size = self.max_encoding_message_size;
6064 let inner = self.inner.clone();
6065 let fut = async move {
6066 let method = QueryHeatmapDataSvc(inner);
6067 let codec = tonic_prost::ProstCodec::default();
6068 let mut grpc = tonic::server::Grpc::new(codec)
6069 .apply_compression_config(
6070 accept_compression_encodings,
6071 send_compression_encodings,
6072 )
6073 .apply_max_message_size_config(
6074 max_decoding_message_size,
6075 max_encoding_message_size,
6076 );
6077 let res = grpc.unary(method, req).await;
6078 Ok(res)
6079 };
6080 Box::pin(fut)
6081 }
6082 "/pidgr.v1.HeatmapService/ListScreenshots" => {
6083 #[allow(non_camel_case_types)]
6084 struct ListScreenshotsSvc<T: HeatmapService>(pub Arc<T>);
6085 impl<
6086 T: HeatmapService,
6087 > tonic::server::UnaryService<super::ListScreenshotsRequest>
6088 for ListScreenshotsSvc<T> {
6089 type Response = super::ListScreenshotsResponse;
6090 type Future = BoxFuture<
6091 tonic::Response<Self::Response>,
6092 tonic::Status,
6093 >;
6094 fn call(
6095 &mut self,
6096 request: tonic::Request<super::ListScreenshotsRequest>,
6097 ) -> Self::Future {
6098 let inner = Arc::clone(&self.0);
6099 let fut = async move {
6100 <T as HeatmapService>::list_screenshots(&inner, request)
6101 .await
6102 };
6103 Box::pin(fut)
6104 }
6105 }
6106 let accept_compression_encodings = self.accept_compression_encodings;
6107 let send_compression_encodings = self.send_compression_encodings;
6108 let max_decoding_message_size = self.max_decoding_message_size;
6109 let max_encoding_message_size = self.max_encoding_message_size;
6110 let inner = self.inner.clone();
6111 let fut = async move {
6112 let method = ListScreenshotsSvc(inner);
6113 let codec = tonic_prost::ProstCodec::default();
6114 let mut grpc = tonic::server::Grpc::new(codec)
6115 .apply_compression_config(
6116 accept_compression_encodings,
6117 send_compression_encodings,
6118 )
6119 .apply_max_message_size_config(
6120 max_decoding_message_size,
6121 max_encoding_message_size,
6122 );
6123 let res = grpc.unary(method, req).await;
6124 Ok(res)
6125 };
6126 Box::pin(fut)
6127 }
6128 "/pidgr.v1.HeatmapService/UploadScreenshot" => {
6129 #[allow(non_camel_case_types)]
6130 struct UploadScreenshotSvc<T: HeatmapService>(pub Arc<T>);
6131 impl<
6132 T: HeatmapService,
6133 > tonic::server::UnaryService<super::UploadScreenshotRequest>
6134 for UploadScreenshotSvc<T> {
6135 type Response = super::UploadScreenshotResponse;
6136 type Future = BoxFuture<
6137 tonic::Response<Self::Response>,
6138 tonic::Status,
6139 >;
6140 fn call(
6141 &mut self,
6142 request: tonic::Request<super::UploadScreenshotRequest>,
6143 ) -> Self::Future {
6144 let inner = Arc::clone(&self.0);
6145 let fut = async move {
6146 <T as HeatmapService>::upload_screenshot(&inner, request)
6147 .await
6148 };
6149 Box::pin(fut)
6150 }
6151 }
6152 let accept_compression_encodings = self.accept_compression_encodings;
6153 let send_compression_encodings = self.send_compression_encodings;
6154 let max_decoding_message_size = self.max_decoding_message_size;
6155 let max_encoding_message_size = self.max_encoding_message_size;
6156 let inner = self.inner.clone();
6157 let fut = async move {
6158 let method = UploadScreenshotSvc(inner);
6159 let codec = tonic_prost::ProstCodec::default();
6160 let mut grpc = tonic::server::Grpc::new(codec)
6161 .apply_compression_config(
6162 accept_compression_encodings,
6163 send_compression_encodings,
6164 )
6165 .apply_max_message_size_config(
6166 max_decoding_message_size,
6167 max_encoding_message_size,
6168 );
6169 let res = grpc.unary(method, req).await;
6170 Ok(res)
6171 };
6172 Box::pin(fut)
6173 }
6174 _ => {
6175 Box::pin(async move {
6176 let mut response = http::Response::new(
6177 tonic::body::Body::default(),
6178 );
6179 let headers = response.headers_mut();
6180 headers
6181 .insert(
6182 tonic::Status::GRPC_STATUS,
6183 (tonic::Code::Unimplemented as i32).into(),
6184 );
6185 headers
6186 .insert(
6187 http::header::CONTENT_TYPE,
6188 tonic::metadata::GRPC_CONTENT_TYPE,
6189 );
6190 Ok(response)
6191 })
6192 }
6193 }
6194 }
6195 }
6196 impl<T> Clone for HeatmapServiceServer<T> {
6197 fn clone(&self) -> Self {
6198 let inner = self.inner.clone();
6199 Self {
6200 inner,
6201 accept_compression_encodings: self.accept_compression_encodings,
6202 send_compression_encodings: self.send_compression_encodings,
6203 max_decoding_message_size: self.max_decoding_message_size,
6204 max_encoding_message_size: self.max_encoding_message_size,
6205 }
6206 }
6207 }
6208 pub const SERVICE_NAME: &str = "pidgr.v1.HeatmapService";
6210 impl<T> tonic::server::NamedService for HeatmapServiceServer<T> {
6211 const NAME: &'static str = SERVICE_NAME;
6212 }
6213}
6214pub mod inbox_service_client {
6216 #![allow(
6217 unused_variables,
6218 dead_code,
6219 missing_docs,
6220 clippy::wildcard_imports,
6221 clippy::let_unit_value,
6222 )]
6223 use tonic::codegen::*;
6224 use tonic::codegen::http::Uri;
6225 #[derive(Debug, Clone)]
6229 pub struct InboxServiceClient<T> {
6230 inner: tonic::client::Grpc<T>,
6231 }
6232 impl InboxServiceClient<tonic::transport::Channel> {
6233 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6235 where
6236 D: TryInto<tonic::transport::Endpoint>,
6237 D::Error: Into<StdError>,
6238 {
6239 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6240 Ok(Self::new(conn))
6241 }
6242 }
6243 impl<T> InboxServiceClient<T>
6244 where
6245 T: tonic::client::GrpcService<tonic::body::Body>,
6246 T::Error: Into<StdError>,
6247 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6248 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6249 {
6250 pub fn new(inner: T) -> Self {
6251 let inner = tonic::client::Grpc::new(inner);
6252 Self { inner }
6253 }
6254 pub fn with_origin(inner: T, origin: Uri) -> Self {
6255 let inner = tonic::client::Grpc::with_origin(inner, origin);
6256 Self { inner }
6257 }
6258 pub fn with_interceptor<F>(
6259 inner: T,
6260 interceptor: F,
6261 ) -> InboxServiceClient<InterceptedService<T, F>>
6262 where
6263 F: tonic::service::Interceptor,
6264 T::ResponseBody: Default,
6265 T: tonic::codegen::Service<
6266 http::Request<tonic::body::Body>,
6267 Response = http::Response<
6268 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6269 >,
6270 >,
6271 <T as tonic::codegen::Service<
6272 http::Request<tonic::body::Body>,
6273 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6274 {
6275 InboxServiceClient::new(InterceptedService::new(inner, interceptor))
6276 }
6277 #[must_use]
6282 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6283 self.inner = self.inner.send_compressed(encoding);
6284 self
6285 }
6286 #[must_use]
6288 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6289 self.inner = self.inner.accept_compressed(encoding);
6290 self
6291 }
6292 #[must_use]
6296 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6297 self.inner = self.inner.max_decoding_message_size(limit);
6298 self
6299 }
6300 #[must_use]
6304 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6305 self.inner = self.inner.max_encoding_message_size(limit);
6306 self
6307 }
6308 pub async fn sync(
6312 &mut self,
6313 request: impl tonic::IntoRequest<super::SyncRequest>,
6314 ) -> std::result::Result<tonic::Response<super::SyncResponse>, tonic::Status> {
6315 self.inner
6316 .ready()
6317 .await
6318 .map_err(|e| {
6319 tonic::Status::unknown(
6320 format!("Service was not ready: {}", e.into()),
6321 )
6322 })?;
6323 let codec = tonic_prost::ProstCodec::default();
6324 let path = http::uri::PathAndQuery::from_static(
6325 "/pidgr.v1.InboxService/Sync",
6326 );
6327 let mut req = request.into_request();
6328 req.extensions_mut()
6329 .insert(GrpcMethod::new("pidgr.v1.InboxService", "Sync"));
6330 self.inner.unary(req, path, codec).await
6331 }
6332 pub async fn mark_read(
6336 &mut self,
6337 request: impl tonic::IntoRequest<super::MarkReadRequest>,
6338 ) -> std::result::Result<
6339 tonic::Response<super::MarkReadResponse>,
6340 tonic::Status,
6341 > {
6342 self.inner
6343 .ready()
6344 .await
6345 .map_err(|e| {
6346 tonic::Status::unknown(
6347 format!("Service was not ready: {}", e.into()),
6348 )
6349 })?;
6350 let codec = tonic_prost::ProstCodec::default();
6351 let path = http::uri::PathAndQuery::from_static(
6352 "/pidgr.v1.InboxService/MarkRead",
6353 );
6354 let mut req = request.into_request();
6355 req.extensions_mut()
6356 .insert(GrpcMethod::new("pidgr.v1.InboxService", "MarkRead"));
6357 self.inner.unary(req, path, codec).await
6358 }
6359 pub async fn get_message(
6363 &mut self,
6364 request: impl tonic::IntoRequest<super::GetMessageRequest>,
6365 ) -> std::result::Result<
6366 tonic::Response<super::GetMessageResponse>,
6367 tonic::Status,
6368 > {
6369 self.inner
6370 .ready()
6371 .await
6372 .map_err(|e| {
6373 tonic::Status::unknown(
6374 format!("Service was not ready: {}", e.into()),
6375 )
6376 })?;
6377 let codec = tonic_prost::ProstCodec::default();
6378 let path = http::uri::PathAndQuery::from_static(
6379 "/pidgr.v1.InboxService/GetMessage",
6380 );
6381 let mut req = request.into_request();
6382 req.extensions_mut()
6383 .insert(GrpcMethod::new("pidgr.v1.InboxService", "GetMessage"));
6384 self.inner.unary(req, path, codec).await
6385 }
6386 }
6387}
6388pub mod inbox_service_server {
6390 #![allow(
6391 unused_variables,
6392 dead_code,
6393 missing_docs,
6394 clippy::wildcard_imports,
6395 clippy::let_unit_value,
6396 )]
6397 use tonic::codegen::*;
6398 #[async_trait]
6400 pub trait InboxService: std::marker::Send + std::marker::Sync + 'static {
6401 async fn sync(
6405 &self,
6406 request: tonic::Request<super::SyncRequest>,
6407 ) -> std::result::Result<tonic::Response<super::SyncResponse>, tonic::Status>;
6408 async fn mark_read(
6412 &self,
6413 request: tonic::Request<super::MarkReadRequest>,
6414 ) -> std::result::Result<
6415 tonic::Response<super::MarkReadResponse>,
6416 tonic::Status,
6417 >;
6418 async fn get_message(
6422 &self,
6423 request: tonic::Request<super::GetMessageRequest>,
6424 ) -> std::result::Result<
6425 tonic::Response<super::GetMessageResponse>,
6426 tonic::Status,
6427 >;
6428 }
6429 #[derive(Debug)]
6433 pub struct InboxServiceServer<T> {
6434 inner: Arc<T>,
6435 accept_compression_encodings: EnabledCompressionEncodings,
6436 send_compression_encodings: EnabledCompressionEncodings,
6437 max_decoding_message_size: Option<usize>,
6438 max_encoding_message_size: Option<usize>,
6439 }
6440 impl<T> InboxServiceServer<T> {
6441 pub fn new(inner: T) -> Self {
6442 Self::from_arc(Arc::new(inner))
6443 }
6444 pub fn from_arc(inner: Arc<T>) -> Self {
6445 Self {
6446 inner,
6447 accept_compression_encodings: Default::default(),
6448 send_compression_encodings: Default::default(),
6449 max_decoding_message_size: None,
6450 max_encoding_message_size: None,
6451 }
6452 }
6453 pub fn with_interceptor<F>(
6454 inner: T,
6455 interceptor: F,
6456 ) -> InterceptedService<Self, F>
6457 where
6458 F: tonic::service::Interceptor,
6459 {
6460 InterceptedService::new(Self::new(inner), interceptor)
6461 }
6462 #[must_use]
6464 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6465 self.accept_compression_encodings.enable(encoding);
6466 self
6467 }
6468 #[must_use]
6470 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6471 self.send_compression_encodings.enable(encoding);
6472 self
6473 }
6474 #[must_use]
6478 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6479 self.max_decoding_message_size = Some(limit);
6480 self
6481 }
6482 #[must_use]
6486 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6487 self.max_encoding_message_size = Some(limit);
6488 self
6489 }
6490 }
6491 impl<T, B> tonic::codegen::Service<http::Request<B>> for InboxServiceServer<T>
6492 where
6493 T: InboxService,
6494 B: Body + std::marker::Send + 'static,
6495 B::Error: Into<StdError> + std::marker::Send + 'static,
6496 {
6497 type Response = http::Response<tonic::body::Body>;
6498 type Error = std::convert::Infallible;
6499 type Future = BoxFuture<Self::Response, Self::Error>;
6500 fn poll_ready(
6501 &mut self,
6502 _cx: &mut Context<'_>,
6503 ) -> Poll<std::result::Result<(), Self::Error>> {
6504 Poll::Ready(Ok(()))
6505 }
6506 fn call(&mut self, req: http::Request<B>) -> Self::Future {
6507 match req.uri().path() {
6508 "/pidgr.v1.InboxService/Sync" => {
6509 #[allow(non_camel_case_types)]
6510 struct SyncSvc<T: InboxService>(pub Arc<T>);
6511 impl<T: InboxService> tonic::server::UnaryService<super::SyncRequest>
6512 for SyncSvc<T> {
6513 type Response = super::SyncResponse;
6514 type Future = BoxFuture<
6515 tonic::Response<Self::Response>,
6516 tonic::Status,
6517 >;
6518 fn call(
6519 &mut self,
6520 request: tonic::Request<super::SyncRequest>,
6521 ) -> Self::Future {
6522 let inner = Arc::clone(&self.0);
6523 let fut = async move {
6524 <T as InboxService>::sync(&inner, request).await
6525 };
6526 Box::pin(fut)
6527 }
6528 }
6529 let accept_compression_encodings = self.accept_compression_encodings;
6530 let send_compression_encodings = self.send_compression_encodings;
6531 let max_decoding_message_size = self.max_decoding_message_size;
6532 let max_encoding_message_size = self.max_encoding_message_size;
6533 let inner = self.inner.clone();
6534 let fut = async move {
6535 let method = SyncSvc(inner);
6536 let codec = tonic_prost::ProstCodec::default();
6537 let mut grpc = tonic::server::Grpc::new(codec)
6538 .apply_compression_config(
6539 accept_compression_encodings,
6540 send_compression_encodings,
6541 )
6542 .apply_max_message_size_config(
6543 max_decoding_message_size,
6544 max_encoding_message_size,
6545 );
6546 let res = grpc.unary(method, req).await;
6547 Ok(res)
6548 };
6549 Box::pin(fut)
6550 }
6551 "/pidgr.v1.InboxService/MarkRead" => {
6552 #[allow(non_camel_case_types)]
6553 struct MarkReadSvc<T: InboxService>(pub Arc<T>);
6554 impl<
6555 T: InboxService,
6556 > tonic::server::UnaryService<super::MarkReadRequest>
6557 for MarkReadSvc<T> {
6558 type Response = super::MarkReadResponse;
6559 type Future = BoxFuture<
6560 tonic::Response<Self::Response>,
6561 tonic::Status,
6562 >;
6563 fn call(
6564 &mut self,
6565 request: tonic::Request<super::MarkReadRequest>,
6566 ) -> Self::Future {
6567 let inner = Arc::clone(&self.0);
6568 let fut = async move {
6569 <T as InboxService>::mark_read(&inner, request).await
6570 };
6571 Box::pin(fut)
6572 }
6573 }
6574 let accept_compression_encodings = self.accept_compression_encodings;
6575 let send_compression_encodings = self.send_compression_encodings;
6576 let max_decoding_message_size = self.max_decoding_message_size;
6577 let max_encoding_message_size = self.max_encoding_message_size;
6578 let inner = self.inner.clone();
6579 let fut = async move {
6580 let method = MarkReadSvc(inner);
6581 let codec = tonic_prost::ProstCodec::default();
6582 let mut grpc = tonic::server::Grpc::new(codec)
6583 .apply_compression_config(
6584 accept_compression_encodings,
6585 send_compression_encodings,
6586 )
6587 .apply_max_message_size_config(
6588 max_decoding_message_size,
6589 max_encoding_message_size,
6590 );
6591 let res = grpc.unary(method, req).await;
6592 Ok(res)
6593 };
6594 Box::pin(fut)
6595 }
6596 "/pidgr.v1.InboxService/GetMessage" => {
6597 #[allow(non_camel_case_types)]
6598 struct GetMessageSvc<T: InboxService>(pub Arc<T>);
6599 impl<
6600 T: InboxService,
6601 > tonic::server::UnaryService<super::GetMessageRequest>
6602 for GetMessageSvc<T> {
6603 type Response = super::GetMessageResponse;
6604 type Future = BoxFuture<
6605 tonic::Response<Self::Response>,
6606 tonic::Status,
6607 >;
6608 fn call(
6609 &mut self,
6610 request: tonic::Request<super::GetMessageRequest>,
6611 ) -> Self::Future {
6612 let inner = Arc::clone(&self.0);
6613 let fut = async move {
6614 <T as InboxService>::get_message(&inner, request).await
6615 };
6616 Box::pin(fut)
6617 }
6618 }
6619 let accept_compression_encodings = self.accept_compression_encodings;
6620 let send_compression_encodings = self.send_compression_encodings;
6621 let max_decoding_message_size = self.max_decoding_message_size;
6622 let max_encoding_message_size = self.max_encoding_message_size;
6623 let inner = self.inner.clone();
6624 let fut = async move {
6625 let method = GetMessageSvc(inner);
6626 let codec = tonic_prost::ProstCodec::default();
6627 let mut grpc = tonic::server::Grpc::new(codec)
6628 .apply_compression_config(
6629 accept_compression_encodings,
6630 send_compression_encodings,
6631 )
6632 .apply_max_message_size_config(
6633 max_decoding_message_size,
6634 max_encoding_message_size,
6635 );
6636 let res = grpc.unary(method, req).await;
6637 Ok(res)
6638 };
6639 Box::pin(fut)
6640 }
6641 _ => {
6642 Box::pin(async move {
6643 let mut response = http::Response::new(
6644 tonic::body::Body::default(),
6645 );
6646 let headers = response.headers_mut();
6647 headers
6648 .insert(
6649 tonic::Status::GRPC_STATUS,
6650 (tonic::Code::Unimplemented as i32).into(),
6651 );
6652 headers
6653 .insert(
6654 http::header::CONTENT_TYPE,
6655 tonic::metadata::GRPC_CONTENT_TYPE,
6656 );
6657 Ok(response)
6658 })
6659 }
6660 }
6661 }
6662 }
6663 impl<T> Clone for InboxServiceServer<T> {
6664 fn clone(&self) -> Self {
6665 let inner = self.inner.clone();
6666 Self {
6667 inner,
6668 accept_compression_encodings: self.accept_compression_encodings,
6669 send_compression_encodings: self.send_compression_encodings,
6670 max_decoding_message_size: self.max_decoding_message_size,
6671 max_encoding_message_size: self.max_encoding_message_size,
6672 }
6673 }
6674 }
6675 pub const SERVICE_NAME: &str = "pidgr.v1.InboxService";
6677 impl<T> tonic::server::NamedService for InboxServiceServer<T> {
6678 const NAME: &'static str = SERVICE_NAME;
6679 }
6680}
6681pub mod insights_service_client {
6683 #![allow(
6684 unused_variables,
6685 dead_code,
6686 missing_docs,
6687 clippy::wildcard_imports,
6688 clippy::let_unit_value,
6689 )]
6690 use tonic::codegen::*;
6691 use tonic::codegen::http::Uri;
6692 #[derive(Debug, Clone)]
6698 pub struct InsightsServiceClient<T> {
6699 inner: tonic::client::Grpc<T>,
6700 }
6701 impl InsightsServiceClient<tonic::transport::Channel> {
6702 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6704 where
6705 D: TryInto<tonic::transport::Endpoint>,
6706 D::Error: Into<StdError>,
6707 {
6708 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6709 Ok(Self::new(conn))
6710 }
6711 }
6712 impl<T> InsightsServiceClient<T>
6713 where
6714 T: tonic::client::GrpcService<tonic::body::Body>,
6715 T::Error: Into<StdError>,
6716 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6717 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6718 {
6719 pub fn new(inner: T) -> Self {
6720 let inner = tonic::client::Grpc::new(inner);
6721 Self { inner }
6722 }
6723 pub fn with_origin(inner: T, origin: Uri) -> Self {
6724 let inner = tonic::client::Grpc::with_origin(inner, origin);
6725 Self { inner }
6726 }
6727 pub fn with_interceptor<F>(
6728 inner: T,
6729 interceptor: F,
6730 ) -> InsightsServiceClient<InterceptedService<T, F>>
6731 where
6732 F: tonic::service::Interceptor,
6733 T::ResponseBody: Default,
6734 T: tonic::codegen::Service<
6735 http::Request<tonic::body::Body>,
6736 Response = http::Response<
6737 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6738 >,
6739 >,
6740 <T as tonic::codegen::Service<
6741 http::Request<tonic::body::Body>,
6742 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6743 {
6744 InsightsServiceClient::new(InterceptedService::new(inner, interceptor))
6745 }
6746 #[must_use]
6751 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6752 self.inner = self.inner.send_compressed(encoding);
6753 self
6754 }
6755 #[must_use]
6757 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6758 self.inner = self.inner.accept_compressed(encoding);
6759 self
6760 }
6761 #[must_use]
6765 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6766 self.inner = self.inner.max_decoding_message_size(limit);
6767 self
6768 }
6769 #[must_use]
6773 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6774 self.inner = self.inner.max_encoding_message_size(limit);
6775 self
6776 }
6777 pub async fn get_group_archetypes(
6782 &mut self,
6783 request: impl tonic::IntoRequest<super::GetGroupArchetypesRequest>,
6784 ) -> std::result::Result<
6785 tonic::Response<super::GetGroupArchetypesResponse>,
6786 tonic::Status,
6787 > {
6788 self.inner
6789 .ready()
6790 .await
6791 .map_err(|e| {
6792 tonic::Status::unknown(
6793 format!("Service was not ready: {}", e.into()),
6794 )
6795 })?;
6796 let codec = tonic_prost::ProstCodec::default();
6797 let path = http::uri::PathAndQuery::from_static(
6798 "/pidgr.v1.InsightsService/GetGroupArchetypes",
6799 );
6800 let mut req = request.into_request();
6801 req.extensions_mut()
6802 .insert(
6803 GrpcMethod::new("pidgr.v1.InsightsService", "GetGroupArchetypes"),
6804 );
6805 self.inner.unary(req, path, codec).await
6806 }
6807 pub async fn predict_campaign_ack(
6812 &mut self,
6813 request: impl tonic::IntoRequest<super::PredictCampaignAckRequest>,
6814 ) -> std::result::Result<
6815 tonic::Response<super::PredictCampaignAckResponse>,
6816 tonic::Status,
6817 > {
6818 self.inner
6819 .ready()
6820 .await
6821 .map_err(|e| {
6822 tonic::Status::unknown(
6823 format!("Service was not ready: {}", e.into()),
6824 )
6825 })?;
6826 let codec = tonic_prost::ProstCodec::default();
6827 let path = http::uri::PathAndQuery::from_static(
6828 "/pidgr.v1.InsightsService/PredictCampaignACK",
6829 );
6830 let mut req = request.into_request();
6831 req.extensions_mut()
6832 .insert(
6833 GrpcMethod::new("pidgr.v1.InsightsService", "PredictCampaignACK"),
6834 );
6835 self.inner.unary(req, path, codec).await
6836 }
6837 pub async fn get_campaign_advisory(
6842 &mut self,
6843 request: impl tonic::IntoRequest<super::GetCampaignAdvisoryRequest>,
6844 ) -> std::result::Result<
6845 tonic::Response<super::GetCampaignAdvisoryResponse>,
6846 tonic::Status,
6847 > {
6848 self.inner
6849 .ready()
6850 .await
6851 .map_err(|e| {
6852 tonic::Status::unknown(
6853 format!("Service was not ready: {}", e.into()),
6854 )
6855 })?;
6856 let codec = tonic_prost::ProstCodec::default();
6857 let path = http::uri::PathAndQuery::from_static(
6858 "/pidgr.v1.InsightsService/GetCampaignAdvisory",
6859 );
6860 let mut req = request.into_request();
6861 req.extensions_mut()
6862 .insert(
6863 GrpcMethod::new("pidgr.v1.InsightsService", "GetCampaignAdvisory"),
6864 );
6865 self.inner.unary(req, path, codec).await
6866 }
6867 pub async fn get_insight_narrative(
6872 &mut self,
6873 request: impl tonic::IntoRequest<super::GetInsightNarrativeRequest>,
6874 ) -> std::result::Result<
6875 tonic::Response<super::GetInsightNarrativeResponse>,
6876 tonic::Status,
6877 > {
6878 self.inner
6879 .ready()
6880 .await
6881 .map_err(|e| {
6882 tonic::Status::unknown(
6883 format!("Service was not ready: {}", e.into()),
6884 )
6885 })?;
6886 let codec = tonic_prost::ProstCodec::default();
6887 let path = http::uri::PathAndQuery::from_static(
6888 "/pidgr.v1.InsightsService/GetInsightNarrative",
6889 );
6890 let mut req = request.into_request();
6891 req.extensions_mut()
6892 .insert(
6893 GrpcMethod::new("pidgr.v1.InsightsService", "GetInsightNarrative"),
6894 );
6895 self.inner.unary(req, path, codec).await
6896 }
6897 pub async fn trigger_ml_pipeline(
6902 &mut self,
6903 request: impl tonic::IntoRequest<super::TriggerMlPipelineRequest>,
6904 ) -> std::result::Result<
6905 tonic::Response<super::TriggerMlPipelineResponse>,
6906 tonic::Status,
6907 > {
6908 self.inner
6909 .ready()
6910 .await
6911 .map_err(|e| {
6912 tonic::Status::unknown(
6913 format!("Service was not ready: {}", e.into()),
6914 )
6915 })?;
6916 let codec = tonic_prost::ProstCodec::default();
6917 let path = http::uri::PathAndQuery::from_static(
6918 "/pidgr.v1.InsightsService/TriggerMLPipeline",
6919 );
6920 let mut req = request.into_request();
6921 req.extensions_mut()
6922 .insert(
6923 GrpcMethod::new("pidgr.v1.InsightsService", "TriggerMLPipeline"),
6924 );
6925 self.inner.unary(req, path, codec).await
6926 }
6927 pub async fn trigger_archetype_clustering(
6935 &mut self,
6936 request: impl tonic::IntoRequest<super::TriggerArchetypeClusteringRequest>,
6937 ) -> std::result::Result<
6938 tonic::Response<super::TriggerArchetypeClusteringResponse>,
6939 tonic::Status,
6940 > {
6941 self.inner
6942 .ready()
6943 .await
6944 .map_err(|e| {
6945 tonic::Status::unknown(
6946 format!("Service was not ready: {}", e.into()),
6947 )
6948 })?;
6949 let codec = tonic_prost::ProstCodec::default();
6950 let path = http::uri::PathAndQuery::from_static(
6951 "/pidgr.v1.InsightsService/TriggerArchetypeClustering",
6952 );
6953 let mut req = request.into_request();
6954 req.extensions_mut()
6955 .insert(
6956 GrpcMethod::new(
6957 "pidgr.v1.InsightsService",
6958 "TriggerArchetypeClustering",
6959 ),
6960 );
6961 self.inner.unary(req, path, codec).await
6962 }
6963 pub async fn generate_campaign_body_draft(
6971 &mut self,
6972 request: impl tonic::IntoRequest<super::GenerateCampaignBodyDraftRequest>,
6973 ) -> std::result::Result<
6974 tonic::Response<super::GenerateCampaignBodyDraftResponse>,
6975 tonic::Status,
6976 > {
6977 self.inner
6978 .ready()
6979 .await
6980 .map_err(|e| {
6981 tonic::Status::unknown(
6982 format!("Service was not ready: {}", e.into()),
6983 )
6984 })?;
6985 let codec = tonic_prost::ProstCodec::default();
6986 let path = http::uri::PathAndQuery::from_static(
6987 "/pidgr.v1.InsightsService/GenerateCampaignBodyDraft",
6988 );
6989 let mut req = request.into_request();
6990 req.extensions_mut()
6991 .insert(
6992 GrpcMethod::new(
6993 "pidgr.v1.InsightsService",
6994 "GenerateCampaignBodyDraft",
6995 ),
6996 );
6997 self.inner.unary(req, path, codec).await
6998 }
6999 }
7000}
7001pub mod insights_service_server {
7003 #![allow(
7004 unused_variables,
7005 dead_code,
7006 missing_docs,
7007 clippy::wildcard_imports,
7008 clippy::let_unit_value,
7009 )]
7010 use tonic::codegen::*;
7011 #[async_trait]
7013 pub trait InsightsService: std::marker::Send + std::marker::Sync + 'static {
7014 async fn get_group_archetypes(
7019 &self,
7020 request: tonic::Request<super::GetGroupArchetypesRequest>,
7021 ) -> std::result::Result<
7022 tonic::Response<super::GetGroupArchetypesResponse>,
7023 tonic::Status,
7024 >;
7025 async fn predict_campaign_ack(
7030 &self,
7031 request: tonic::Request<super::PredictCampaignAckRequest>,
7032 ) -> std::result::Result<
7033 tonic::Response<super::PredictCampaignAckResponse>,
7034 tonic::Status,
7035 >;
7036 async fn get_campaign_advisory(
7041 &self,
7042 request: tonic::Request<super::GetCampaignAdvisoryRequest>,
7043 ) -> std::result::Result<
7044 tonic::Response<super::GetCampaignAdvisoryResponse>,
7045 tonic::Status,
7046 >;
7047 async fn get_insight_narrative(
7052 &self,
7053 request: tonic::Request<super::GetInsightNarrativeRequest>,
7054 ) -> std::result::Result<
7055 tonic::Response<super::GetInsightNarrativeResponse>,
7056 tonic::Status,
7057 >;
7058 async fn trigger_ml_pipeline(
7063 &self,
7064 request: tonic::Request<super::TriggerMlPipelineRequest>,
7065 ) -> std::result::Result<
7066 tonic::Response<super::TriggerMlPipelineResponse>,
7067 tonic::Status,
7068 >;
7069 async fn trigger_archetype_clustering(
7077 &self,
7078 request: tonic::Request<super::TriggerArchetypeClusteringRequest>,
7079 ) -> std::result::Result<
7080 tonic::Response<super::TriggerArchetypeClusteringResponse>,
7081 tonic::Status,
7082 >;
7083 async fn generate_campaign_body_draft(
7091 &self,
7092 request: tonic::Request<super::GenerateCampaignBodyDraftRequest>,
7093 ) -> std::result::Result<
7094 tonic::Response<super::GenerateCampaignBodyDraftResponse>,
7095 tonic::Status,
7096 >;
7097 }
7098 #[derive(Debug)]
7104 pub struct InsightsServiceServer<T> {
7105 inner: Arc<T>,
7106 accept_compression_encodings: EnabledCompressionEncodings,
7107 send_compression_encodings: EnabledCompressionEncodings,
7108 max_decoding_message_size: Option<usize>,
7109 max_encoding_message_size: Option<usize>,
7110 }
7111 impl<T> InsightsServiceServer<T> {
7112 pub fn new(inner: T) -> Self {
7113 Self::from_arc(Arc::new(inner))
7114 }
7115 pub fn from_arc(inner: Arc<T>) -> Self {
7116 Self {
7117 inner,
7118 accept_compression_encodings: Default::default(),
7119 send_compression_encodings: Default::default(),
7120 max_decoding_message_size: None,
7121 max_encoding_message_size: None,
7122 }
7123 }
7124 pub fn with_interceptor<F>(
7125 inner: T,
7126 interceptor: F,
7127 ) -> InterceptedService<Self, F>
7128 where
7129 F: tonic::service::Interceptor,
7130 {
7131 InterceptedService::new(Self::new(inner), interceptor)
7132 }
7133 #[must_use]
7135 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7136 self.accept_compression_encodings.enable(encoding);
7137 self
7138 }
7139 #[must_use]
7141 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7142 self.send_compression_encodings.enable(encoding);
7143 self
7144 }
7145 #[must_use]
7149 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7150 self.max_decoding_message_size = Some(limit);
7151 self
7152 }
7153 #[must_use]
7157 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7158 self.max_encoding_message_size = Some(limit);
7159 self
7160 }
7161 }
7162 impl<T, B> tonic::codegen::Service<http::Request<B>> for InsightsServiceServer<T>
7163 where
7164 T: InsightsService,
7165 B: Body + std::marker::Send + 'static,
7166 B::Error: Into<StdError> + std::marker::Send + 'static,
7167 {
7168 type Response = http::Response<tonic::body::Body>;
7169 type Error = std::convert::Infallible;
7170 type Future = BoxFuture<Self::Response, Self::Error>;
7171 fn poll_ready(
7172 &mut self,
7173 _cx: &mut Context<'_>,
7174 ) -> Poll<std::result::Result<(), Self::Error>> {
7175 Poll::Ready(Ok(()))
7176 }
7177 fn call(&mut self, req: http::Request<B>) -> Self::Future {
7178 match req.uri().path() {
7179 "/pidgr.v1.InsightsService/GetGroupArchetypes" => {
7180 #[allow(non_camel_case_types)]
7181 struct GetGroupArchetypesSvc<T: InsightsService>(pub Arc<T>);
7182 impl<
7183 T: InsightsService,
7184 > tonic::server::UnaryService<super::GetGroupArchetypesRequest>
7185 for GetGroupArchetypesSvc<T> {
7186 type Response = super::GetGroupArchetypesResponse;
7187 type Future = BoxFuture<
7188 tonic::Response<Self::Response>,
7189 tonic::Status,
7190 >;
7191 fn call(
7192 &mut self,
7193 request: tonic::Request<super::GetGroupArchetypesRequest>,
7194 ) -> Self::Future {
7195 let inner = Arc::clone(&self.0);
7196 let fut = async move {
7197 <T as InsightsService>::get_group_archetypes(
7198 &inner,
7199 request,
7200 )
7201 .await
7202 };
7203 Box::pin(fut)
7204 }
7205 }
7206 let accept_compression_encodings = self.accept_compression_encodings;
7207 let send_compression_encodings = self.send_compression_encodings;
7208 let max_decoding_message_size = self.max_decoding_message_size;
7209 let max_encoding_message_size = self.max_encoding_message_size;
7210 let inner = self.inner.clone();
7211 let fut = async move {
7212 let method = GetGroupArchetypesSvc(inner);
7213 let codec = tonic_prost::ProstCodec::default();
7214 let mut grpc = tonic::server::Grpc::new(codec)
7215 .apply_compression_config(
7216 accept_compression_encodings,
7217 send_compression_encodings,
7218 )
7219 .apply_max_message_size_config(
7220 max_decoding_message_size,
7221 max_encoding_message_size,
7222 );
7223 let res = grpc.unary(method, req).await;
7224 Ok(res)
7225 };
7226 Box::pin(fut)
7227 }
7228 "/pidgr.v1.InsightsService/PredictCampaignACK" => {
7229 #[allow(non_camel_case_types)]
7230 struct PredictCampaignACKSvc<T: InsightsService>(pub Arc<T>);
7231 impl<
7232 T: InsightsService,
7233 > tonic::server::UnaryService<super::PredictCampaignAckRequest>
7234 for PredictCampaignACKSvc<T> {
7235 type Response = super::PredictCampaignAckResponse;
7236 type Future = BoxFuture<
7237 tonic::Response<Self::Response>,
7238 tonic::Status,
7239 >;
7240 fn call(
7241 &mut self,
7242 request: tonic::Request<super::PredictCampaignAckRequest>,
7243 ) -> Self::Future {
7244 let inner = Arc::clone(&self.0);
7245 let fut = async move {
7246 <T as InsightsService>::predict_campaign_ack(
7247 &inner,
7248 request,
7249 )
7250 .await
7251 };
7252 Box::pin(fut)
7253 }
7254 }
7255 let accept_compression_encodings = self.accept_compression_encodings;
7256 let send_compression_encodings = self.send_compression_encodings;
7257 let max_decoding_message_size = self.max_decoding_message_size;
7258 let max_encoding_message_size = self.max_encoding_message_size;
7259 let inner = self.inner.clone();
7260 let fut = async move {
7261 let method = PredictCampaignACKSvc(inner);
7262 let codec = tonic_prost::ProstCodec::default();
7263 let mut grpc = tonic::server::Grpc::new(codec)
7264 .apply_compression_config(
7265 accept_compression_encodings,
7266 send_compression_encodings,
7267 )
7268 .apply_max_message_size_config(
7269 max_decoding_message_size,
7270 max_encoding_message_size,
7271 );
7272 let res = grpc.unary(method, req).await;
7273 Ok(res)
7274 };
7275 Box::pin(fut)
7276 }
7277 "/pidgr.v1.InsightsService/GetCampaignAdvisory" => {
7278 #[allow(non_camel_case_types)]
7279 struct GetCampaignAdvisorySvc<T: InsightsService>(pub Arc<T>);
7280 impl<
7281 T: InsightsService,
7282 > tonic::server::UnaryService<super::GetCampaignAdvisoryRequest>
7283 for GetCampaignAdvisorySvc<T> {
7284 type Response = super::GetCampaignAdvisoryResponse;
7285 type Future = BoxFuture<
7286 tonic::Response<Self::Response>,
7287 tonic::Status,
7288 >;
7289 fn call(
7290 &mut self,
7291 request: tonic::Request<super::GetCampaignAdvisoryRequest>,
7292 ) -> Self::Future {
7293 let inner = Arc::clone(&self.0);
7294 let fut = async move {
7295 <T as InsightsService>::get_campaign_advisory(
7296 &inner,
7297 request,
7298 )
7299 .await
7300 };
7301 Box::pin(fut)
7302 }
7303 }
7304 let accept_compression_encodings = self.accept_compression_encodings;
7305 let send_compression_encodings = self.send_compression_encodings;
7306 let max_decoding_message_size = self.max_decoding_message_size;
7307 let max_encoding_message_size = self.max_encoding_message_size;
7308 let inner = self.inner.clone();
7309 let fut = async move {
7310 let method = GetCampaignAdvisorySvc(inner);
7311 let codec = tonic_prost::ProstCodec::default();
7312 let mut grpc = tonic::server::Grpc::new(codec)
7313 .apply_compression_config(
7314 accept_compression_encodings,
7315 send_compression_encodings,
7316 )
7317 .apply_max_message_size_config(
7318 max_decoding_message_size,
7319 max_encoding_message_size,
7320 );
7321 let res = grpc.unary(method, req).await;
7322 Ok(res)
7323 };
7324 Box::pin(fut)
7325 }
7326 "/pidgr.v1.InsightsService/GetInsightNarrative" => {
7327 #[allow(non_camel_case_types)]
7328 struct GetInsightNarrativeSvc<T: InsightsService>(pub Arc<T>);
7329 impl<
7330 T: InsightsService,
7331 > tonic::server::UnaryService<super::GetInsightNarrativeRequest>
7332 for GetInsightNarrativeSvc<T> {
7333 type Response = super::GetInsightNarrativeResponse;
7334 type Future = BoxFuture<
7335 tonic::Response<Self::Response>,
7336 tonic::Status,
7337 >;
7338 fn call(
7339 &mut self,
7340 request: tonic::Request<super::GetInsightNarrativeRequest>,
7341 ) -> Self::Future {
7342 let inner = Arc::clone(&self.0);
7343 let fut = async move {
7344 <T as InsightsService>::get_insight_narrative(
7345 &inner,
7346 request,
7347 )
7348 .await
7349 };
7350 Box::pin(fut)
7351 }
7352 }
7353 let accept_compression_encodings = self.accept_compression_encodings;
7354 let send_compression_encodings = self.send_compression_encodings;
7355 let max_decoding_message_size = self.max_decoding_message_size;
7356 let max_encoding_message_size = self.max_encoding_message_size;
7357 let inner = self.inner.clone();
7358 let fut = async move {
7359 let method = GetInsightNarrativeSvc(inner);
7360 let codec = tonic_prost::ProstCodec::default();
7361 let mut grpc = tonic::server::Grpc::new(codec)
7362 .apply_compression_config(
7363 accept_compression_encodings,
7364 send_compression_encodings,
7365 )
7366 .apply_max_message_size_config(
7367 max_decoding_message_size,
7368 max_encoding_message_size,
7369 );
7370 let res = grpc.unary(method, req).await;
7371 Ok(res)
7372 };
7373 Box::pin(fut)
7374 }
7375 "/pidgr.v1.InsightsService/TriggerMLPipeline" => {
7376 #[allow(non_camel_case_types)]
7377 struct TriggerMLPipelineSvc<T: InsightsService>(pub Arc<T>);
7378 impl<
7379 T: InsightsService,
7380 > tonic::server::UnaryService<super::TriggerMlPipelineRequest>
7381 for TriggerMLPipelineSvc<T> {
7382 type Response = super::TriggerMlPipelineResponse;
7383 type Future = BoxFuture<
7384 tonic::Response<Self::Response>,
7385 tonic::Status,
7386 >;
7387 fn call(
7388 &mut self,
7389 request: tonic::Request<super::TriggerMlPipelineRequest>,
7390 ) -> Self::Future {
7391 let inner = Arc::clone(&self.0);
7392 let fut = async move {
7393 <T as InsightsService>::trigger_ml_pipeline(&inner, request)
7394 .await
7395 };
7396 Box::pin(fut)
7397 }
7398 }
7399 let accept_compression_encodings = self.accept_compression_encodings;
7400 let send_compression_encodings = self.send_compression_encodings;
7401 let max_decoding_message_size = self.max_decoding_message_size;
7402 let max_encoding_message_size = self.max_encoding_message_size;
7403 let inner = self.inner.clone();
7404 let fut = async move {
7405 let method = TriggerMLPipelineSvc(inner);
7406 let codec = tonic_prost::ProstCodec::default();
7407 let mut grpc = tonic::server::Grpc::new(codec)
7408 .apply_compression_config(
7409 accept_compression_encodings,
7410 send_compression_encodings,
7411 )
7412 .apply_max_message_size_config(
7413 max_decoding_message_size,
7414 max_encoding_message_size,
7415 );
7416 let res = grpc.unary(method, req).await;
7417 Ok(res)
7418 };
7419 Box::pin(fut)
7420 }
7421 "/pidgr.v1.InsightsService/TriggerArchetypeClustering" => {
7422 #[allow(non_camel_case_types)]
7423 struct TriggerArchetypeClusteringSvc<T: InsightsService>(pub Arc<T>);
7424 impl<
7425 T: InsightsService,
7426 > tonic::server::UnaryService<
7427 super::TriggerArchetypeClusteringRequest,
7428 > for TriggerArchetypeClusteringSvc<T> {
7429 type Response = super::TriggerArchetypeClusteringResponse;
7430 type Future = BoxFuture<
7431 tonic::Response<Self::Response>,
7432 tonic::Status,
7433 >;
7434 fn call(
7435 &mut self,
7436 request: tonic::Request<
7437 super::TriggerArchetypeClusteringRequest,
7438 >,
7439 ) -> Self::Future {
7440 let inner = Arc::clone(&self.0);
7441 let fut = async move {
7442 <T as InsightsService>::trigger_archetype_clustering(
7443 &inner,
7444 request,
7445 )
7446 .await
7447 };
7448 Box::pin(fut)
7449 }
7450 }
7451 let accept_compression_encodings = self.accept_compression_encodings;
7452 let send_compression_encodings = self.send_compression_encodings;
7453 let max_decoding_message_size = self.max_decoding_message_size;
7454 let max_encoding_message_size = self.max_encoding_message_size;
7455 let inner = self.inner.clone();
7456 let fut = async move {
7457 let method = TriggerArchetypeClusteringSvc(inner);
7458 let codec = tonic_prost::ProstCodec::default();
7459 let mut grpc = tonic::server::Grpc::new(codec)
7460 .apply_compression_config(
7461 accept_compression_encodings,
7462 send_compression_encodings,
7463 )
7464 .apply_max_message_size_config(
7465 max_decoding_message_size,
7466 max_encoding_message_size,
7467 );
7468 let res = grpc.unary(method, req).await;
7469 Ok(res)
7470 };
7471 Box::pin(fut)
7472 }
7473 "/pidgr.v1.InsightsService/GenerateCampaignBodyDraft" => {
7474 #[allow(non_camel_case_types)]
7475 struct GenerateCampaignBodyDraftSvc<T: InsightsService>(pub Arc<T>);
7476 impl<
7477 T: InsightsService,
7478 > tonic::server::UnaryService<
7479 super::GenerateCampaignBodyDraftRequest,
7480 > for GenerateCampaignBodyDraftSvc<T> {
7481 type Response = super::GenerateCampaignBodyDraftResponse;
7482 type Future = BoxFuture<
7483 tonic::Response<Self::Response>,
7484 tonic::Status,
7485 >;
7486 fn call(
7487 &mut self,
7488 request: tonic::Request<
7489 super::GenerateCampaignBodyDraftRequest,
7490 >,
7491 ) -> Self::Future {
7492 let inner = Arc::clone(&self.0);
7493 let fut = async move {
7494 <T as InsightsService>::generate_campaign_body_draft(
7495 &inner,
7496 request,
7497 )
7498 .await
7499 };
7500 Box::pin(fut)
7501 }
7502 }
7503 let accept_compression_encodings = self.accept_compression_encodings;
7504 let send_compression_encodings = self.send_compression_encodings;
7505 let max_decoding_message_size = self.max_decoding_message_size;
7506 let max_encoding_message_size = self.max_encoding_message_size;
7507 let inner = self.inner.clone();
7508 let fut = async move {
7509 let method = GenerateCampaignBodyDraftSvc(inner);
7510 let codec = tonic_prost::ProstCodec::default();
7511 let mut grpc = tonic::server::Grpc::new(codec)
7512 .apply_compression_config(
7513 accept_compression_encodings,
7514 send_compression_encodings,
7515 )
7516 .apply_max_message_size_config(
7517 max_decoding_message_size,
7518 max_encoding_message_size,
7519 );
7520 let res = grpc.unary(method, req).await;
7521 Ok(res)
7522 };
7523 Box::pin(fut)
7524 }
7525 _ => {
7526 Box::pin(async move {
7527 let mut response = http::Response::new(
7528 tonic::body::Body::default(),
7529 );
7530 let headers = response.headers_mut();
7531 headers
7532 .insert(
7533 tonic::Status::GRPC_STATUS,
7534 (tonic::Code::Unimplemented as i32).into(),
7535 );
7536 headers
7537 .insert(
7538 http::header::CONTENT_TYPE,
7539 tonic::metadata::GRPC_CONTENT_TYPE,
7540 );
7541 Ok(response)
7542 })
7543 }
7544 }
7545 }
7546 }
7547 impl<T> Clone for InsightsServiceServer<T> {
7548 fn clone(&self) -> Self {
7549 let inner = self.inner.clone();
7550 Self {
7551 inner,
7552 accept_compression_encodings: self.accept_compression_encodings,
7553 send_compression_encodings: self.send_compression_encodings,
7554 max_decoding_message_size: self.max_decoding_message_size,
7555 max_encoding_message_size: self.max_encoding_message_size,
7556 }
7557 }
7558 }
7559 pub const SERVICE_NAME: &str = "pidgr.v1.InsightsService";
7561 impl<T> tonic::server::NamedService for InsightsServiceServer<T> {
7562 const NAME: &'static str = SERVICE_NAME;
7563 }
7564}
7565pub mod integrations_service_client {
7567 #![allow(
7568 unused_variables,
7569 dead_code,
7570 missing_docs,
7571 clippy::wildcard_imports,
7572 clippy::let_unit_value,
7573 )]
7574 use tonic::codegen::*;
7575 use tonic::codegen::http::Uri;
7576 #[derive(Debug, Clone)]
7591 pub struct IntegrationsServiceClient<T> {
7592 inner: tonic::client::Grpc<T>,
7593 }
7594 impl IntegrationsServiceClient<tonic::transport::Channel> {
7595 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
7597 where
7598 D: TryInto<tonic::transport::Endpoint>,
7599 D::Error: Into<StdError>,
7600 {
7601 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
7602 Ok(Self::new(conn))
7603 }
7604 }
7605 impl<T> IntegrationsServiceClient<T>
7606 where
7607 T: tonic::client::GrpcService<tonic::body::Body>,
7608 T::Error: Into<StdError>,
7609 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
7610 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
7611 {
7612 pub fn new(inner: T) -> Self {
7613 let inner = tonic::client::Grpc::new(inner);
7614 Self { inner }
7615 }
7616 pub fn with_origin(inner: T, origin: Uri) -> Self {
7617 let inner = tonic::client::Grpc::with_origin(inner, origin);
7618 Self { inner }
7619 }
7620 pub fn with_interceptor<F>(
7621 inner: T,
7622 interceptor: F,
7623 ) -> IntegrationsServiceClient<InterceptedService<T, F>>
7624 where
7625 F: tonic::service::Interceptor,
7626 T::ResponseBody: Default,
7627 T: tonic::codegen::Service<
7628 http::Request<tonic::body::Body>,
7629 Response = http::Response<
7630 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
7631 >,
7632 >,
7633 <T as tonic::codegen::Service<
7634 http::Request<tonic::body::Body>,
7635 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
7636 {
7637 IntegrationsServiceClient::new(InterceptedService::new(inner, interceptor))
7638 }
7639 #[must_use]
7644 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7645 self.inner = self.inner.send_compressed(encoding);
7646 self
7647 }
7648 #[must_use]
7650 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7651 self.inner = self.inner.accept_compressed(encoding);
7652 self
7653 }
7654 #[must_use]
7658 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7659 self.inner = self.inner.max_decoding_message_size(limit);
7660 self
7661 }
7662 #[must_use]
7666 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7667 self.inner = self.inner.max_encoding_message_size(limit);
7668 self
7669 }
7670 pub async fn dispatch_to_channel(
7674 &mut self,
7675 request: impl tonic::IntoRequest<super::DispatchToChannelRequest>,
7676 ) -> std::result::Result<
7677 tonic::Response<super::DispatchToChannelResponse>,
7678 tonic::Status,
7679 > {
7680 self.inner
7681 .ready()
7682 .await
7683 .map_err(|e| {
7684 tonic::Status::unknown(
7685 format!("Service was not ready: {}", e.into()),
7686 )
7687 })?;
7688 let codec = tonic_prost::ProstCodec::default();
7689 let path = http::uri::PathAndQuery::from_static(
7690 "/pidgr.v1.IntegrationsService/DispatchToChannel",
7691 );
7692 let mut req = request.into_request();
7693 req.extensions_mut()
7694 .insert(
7695 GrpcMethod::new("pidgr.v1.IntegrationsService", "DispatchToChannel"),
7696 );
7697 self.inner.unary(req, path, codec).await
7698 }
7699 pub async fn upsert_reachability(
7704 &mut self,
7705 request: impl tonic::IntoRequest<super::UpsertReachabilityRequest>,
7706 ) -> std::result::Result<
7707 tonic::Response<super::UpsertReachabilityResponse>,
7708 tonic::Status,
7709 > {
7710 self.inner
7711 .ready()
7712 .await
7713 .map_err(|e| {
7714 tonic::Status::unknown(
7715 format!("Service was not ready: {}", e.into()),
7716 )
7717 })?;
7718 let codec = tonic_prost::ProstCodec::default();
7719 let path = http::uri::PathAndQuery::from_static(
7720 "/pidgr.v1.IntegrationsService/UpsertReachability",
7721 );
7722 let mut req = request.into_request();
7723 req.extensions_mut()
7724 .insert(
7725 GrpcMethod::new("pidgr.v1.IntegrationsService", "UpsertReachability"),
7726 );
7727 self.inner.unary(req, path, codec).await
7728 }
7729 pub async fn remove_reachability(
7733 &mut self,
7734 request: impl tonic::IntoRequest<super::RemoveReachabilityRequest>,
7735 ) -> std::result::Result<
7736 tonic::Response<super::RemoveReachabilityResponse>,
7737 tonic::Status,
7738 > {
7739 self.inner
7740 .ready()
7741 .await
7742 .map_err(|e| {
7743 tonic::Status::unknown(
7744 format!("Service was not ready: {}", e.into()),
7745 )
7746 })?;
7747 let codec = tonic_prost::ProstCodec::default();
7748 let path = http::uri::PathAndQuery::from_static(
7749 "/pidgr.v1.IntegrationsService/RemoveReachability",
7750 );
7751 let mut req = request.into_request();
7752 req.extensions_mut()
7753 .insert(
7754 GrpcMethod::new("pidgr.v1.IntegrationsService", "RemoveReachability"),
7755 );
7756 self.inner.unary(req, path, codec).await
7757 }
7758 pub async fn get_reachability(
7762 &mut self,
7763 request: impl tonic::IntoRequest<super::GetReachabilityRequest>,
7764 ) -> std::result::Result<
7765 tonic::Response<super::GetReachabilityResponse>,
7766 tonic::Status,
7767 > {
7768 self.inner
7769 .ready()
7770 .await
7771 .map_err(|e| {
7772 tonic::Status::unknown(
7773 format!("Service was not ready: {}", e.into()),
7774 )
7775 })?;
7776 let codec = tonic_prost::ProstCodec::default();
7777 let path = http::uri::PathAndQuery::from_static(
7778 "/pidgr.v1.IntegrationsService/GetReachability",
7779 );
7780 let mut req = request.into_request();
7781 req.extensions_mut()
7782 .insert(
7783 GrpcMethod::new("pidgr.v1.IntegrationsService", "GetReachability"),
7784 );
7785 self.inner.unary(req, path, codec).await
7786 }
7787 pub async fn list_reachability_for_user(
7791 &mut self,
7792 request: impl tonic::IntoRequest<super::ListReachabilityForUserRequest>,
7793 ) -> std::result::Result<
7794 tonic::Response<super::ListReachabilityForUserResponse>,
7795 tonic::Status,
7796 > {
7797 self.inner
7798 .ready()
7799 .await
7800 .map_err(|e| {
7801 tonic::Status::unknown(
7802 format!("Service was not ready: {}", e.into()),
7803 )
7804 })?;
7805 let codec = tonic_prost::ProstCodec::default();
7806 let path = http::uri::PathAndQuery::from_static(
7807 "/pidgr.v1.IntegrationsService/ListReachabilityForUser",
7808 );
7809 let mut req = request.into_request();
7810 req.extensions_mut()
7811 .insert(
7812 GrpcMethod::new(
7813 "pidgr.v1.IntegrationsService",
7814 "ListReachabilityForUser",
7815 ),
7816 );
7817 self.inner.unary(req, path, codec).await
7818 }
7819 pub async fn get_region_policy(
7823 &mut self,
7824 request: impl tonic::IntoRequest<super::GetRegionPolicyRequest>,
7825 ) -> std::result::Result<
7826 tonic::Response<super::GetRegionPolicyResponse>,
7827 tonic::Status,
7828 > {
7829 self.inner
7830 .ready()
7831 .await
7832 .map_err(|e| {
7833 tonic::Status::unknown(
7834 format!("Service was not ready: {}", e.into()),
7835 )
7836 })?;
7837 let codec = tonic_prost::ProstCodec::default();
7838 let path = http::uri::PathAndQuery::from_static(
7839 "/pidgr.v1.IntegrationsService/GetRegionPolicy",
7840 );
7841 let mut req = request.into_request();
7842 req.extensions_mut()
7843 .insert(
7844 GrpcMethod::new("pidgr.v1.IntegrationsService", "GetRegionPolicy"),
7845 );
7846 self.inner.unary(req, path, codec).await
7847 }
7848 pub async fn set_region_policy(
7851 &mut self,
7852 request: impl tonic::IntoRequest<super::SetRegionPolicyRequest>,
7853 ) -> std::result::Result<
7854 tonic::Response<super::SetRegionPolicyResponse>,
7855 tonic::Status,
7856 > {
7857 self.inner
7858 .ready()
7859 .await
7860 .map_err(|e| {
7861 tonic::Status::unknown(
7862 format!("Service was not ready: {}", e.into()),
7863 )
7864 })?;
7865 let codec = tonic_prost::ProstCodec::default();
7866 let path = http::uri::PathAndQuery::from_static(
7867 "/pidgr.v1.IntegrationsService/SetRegionPolicy",
7868 );
7869 let mut req = request.into_request();
7870 req.extensions_mut()
7871 .insert(
7872 GrpcMethod::new("pidgr.v1.IntegrationsService", "SetRegionPolicy"),
7873 );
7874 self.inner.unary(req, path, codec).await
7875 }
7876 pub async fn get_cost_cap_policy(
7880 &mut self,
7881 request: impl tonic::IntoRequest<super::GetCostCapPolicyRequest>,
7882 ) -> std::result::Result<
7883 tonic::Response<super::GetCostCapPolicyResponse>,
7884 tonic::Status,
7885 > {
7886 self.inner
7887 .ready()
7888 .await
7889 .map_err(|e| {
7890 tonic::Status::unknown(
7891 format!("Service was not ready: {}", e.into()),
7892 )
7893 })?;
7894 let codec = tonic_prost::ProstCodec::default();
7895 let path = http::uri::PathAndQuery::from_static(
7896 "/pidgr.v1.IntegrationsService/GetCostCapPolicy",
7897 );
7898 let mut req = request.into_request();
7899 req.extensions_mut()
7900 .insert(
7901 GrpcMethod::new("pidgr.v1.IntegrationsService", "GetCostCapPolicy"),
7902 );
7903 self.inner.unary(req, path, codec).await
7904 }
7905 pub async fn set_cost_cap_policy(
7908 &mut self,
7909 request: impl tonic::IntoRequest<super::SetCostCapPolicyRequest>,
7910 ) -> std::result::Result<
7911 tonic::Response<super::SetCostCapPolicyResponse>,
7912 tonic::Status,
7913 > {
7914 self.inner
7915 .ready()
7916 .await
7917 .map_err(|e| {
7918 tonic::Status::unknown(
7919 format!("Service was not ready: {}", e.into()),
7920 )
7921 })?;
7922 let codec = tonic_prost::ProstCodec::default();
7923 let path = http::uri::PathAndQuery::from_static(
7924 "/pidgr.v1.IntegrationsService/SetCostCapPolicy",
7925 );
7926 let mut req = request.into_request();
7927 req.extensions_mut()
7928 .insert(
7929 GrpcMethod::new("pidgr.v1.IntegrationsService", "SetCostCapPolicy"),
7930 );
7931 self.inner.unary(req, path, codec).await
7932 }
7933 pub async fn get_org_webhook_config(
7938 &mut self,
7939 request: impl tonic::IntoRequest<super::GetOrgWebhookConfigRequest>,
7940 ) -> std::result::Result<
7941 tonic::Response<super::GetOrgWebhookConfigResponse>,
7942 tonic::Status,
7943 > {
7944 self.inner
7945 .ready()
7946 .await
7947 .map_err(|e| {
7948 tonic::Status::unknown(
7949 format!("Service was not ready: {}", e.into()),
7950 )
7951 })?;
7952 let codec = tonic_prost::ProstCodec::default();
7953 let path = http::uri::PathAndQuery::from_static(
7954 "/pidgr.v1.IntegrationsService/GetOrgWebhookConfig",
7955 );
7956 let mut req = request.into_request();
7957 req.extensions_mut()
7958 .insert(
7959 GrpcMethod::new(
7960 "pidgr.v1.IntegrationsService",
7961 "GetOrgWebhookConfig",
7962 ),
7963 );
7964 self.inner.unary(req, path, codec).await
7965 }
7966 pub async fn set_org_webhook_config(
7971 &mut self,
7972 request: impl tonic::IntoRequest<super::SetOrgWebhookConfigRequest>,
7973 ) -> std::result::Result<
7974 tonic::Response<super::SetOrgWebhookConfigResponse>,
7975 tonic::Status,
7976 > {
7977 self.inner
7978 .ready()
7979 .await
7980 .map_err(|e| {
7981 tonic::Status::unknown(
7982 format!("Service was not ready: {}", e.into()),
7983 )
7984 })?;
7985 let codec = tonic_prost::ProstCodec::default();
7986 let path = http::uri::PathAndQuery::from_static(
7987 "/pidgr.v1.IntegrationsService/SetOrgWebhookConfig",
7988 );
7989 let mut req = request.into_request();
7990 req.extensions_mut()
7991 .insert(
7992 GrpcMethod::new(
7993 "pidgr.v1.IntegrationsService",
7994 "SetOrgWebhookConfig",
7995 ),
7996 );
7997 self.inner.unary(req, path, codec).await
7998 }
7999 pub async fn create_channel_connect_link(
8006 &mut self,
8007 request: impl tonic::IntoRequest<super::CreateChannelConnectLinkRequest>,
8008 ) -> std::result::Result<
8009 tonic::Response<super::CreateChannelConnectLinkResponse>,
8010 tonic::Status,
8011 > {
8012 self.inner
8013 .ready()
8014 .await
8015 .map_err(|e| {
8016 tonic::Status::unknown(
8017 format!("Service was not ready: {}", e.into()),
8018 )
8019 })?;
8020 let codec = tonic_prost::ProstCodec::default();
8021 let path = http::uri::PathAndQuery::from_static(
8022 "/pidgr.v1.IntegrationsService/CreateChannelConnectLink",
8023 );
8024 let mut req = request.into_request();
8025 req.extensions_mut()
8026 .insert(
8027 GrpcMethod::new(
8028 "pidgr.v1.IntegrationsService",
8029 "CreateChannelConnectLink",
8030 ),
8031 );
8032 self.inner.unary(req, path, codec).await
8033 }
8034 }
8035}
8036pub mod integrations_service_server {
8038 #![allow(
8039 unused_variables,
8040 dead_code,
8041 missing_docs,
8042 clippy::wildcard_imports,
8043 clippy::let_unit_value,
8044 )]
8045 use tonic::codegen::*;
8046 #[async_trait]
8048 pub trait IntegrationsService: std::marker::Send + std::marker::Sync + 'static {
8049 async fn dispatch_to_channel(
8053 &self,
8054 request: tonic::Request<super::DispatchToChannelRequest>,
8055 ) -> std::result::Result<
8056 tonic::Response<super::DispatchToChannelResponse>,
8057 tonic::Status,
8058 >;
8059 async fn upsert_reachability(
8064 &self,
8065 request: tonic::Request<super::UpsertReachabilityRequest>,
8066 ) -> std::result::Result<
8067 tonic::Response<super::UpsertReachabilityResponse>,
8068 tonic::Status,
8069 >;
8070 async fn remove_reachability(
8074 &self,
8075 request: tonic::Request<super::RemoveReachabilityRequest>,
8076 ) -> std::result::Result<
8077 tonic::Response<super::RemoveReachabilityResponse>,
8078 tonic::Status,
8079 >;
8080 async fn get_reachability(
8084 &self,
8085 request: tonic::Request<super::GetReachabilityRequest>,
8086 ) -> std::result::Result<
8087 tonic::Response<super::GetReachabilityResponse>,
8088 tonic::Status,
8089 >;
8090 async fn list_reachability_for_user(
8094 &self,
8095 request: tonic::Request<super::ListReachabilityForUserRequest>,
8096 ) -> std::result::Result<
8097 tonic::Response<super::ListReachabilityForUserResponse>,
8098 tonic::Status,
8099 >;
8100 async fn get_region_policy(
8104 &self,
8105 request: tonic::Request<super::GetRegionPolicyRequest>,
8106 ) -> std::result::Result<
8107 tonic::Response<super::GetRegionPolicyResponse>,
8108 tonic::Status,
8109 >;
8110 async fn set_region_policy(
8113 &self,
8114 request: tonic::Request<super::SetRegionPolicyRequest>,
8115 ) -> std::result::Result<
8116 tonic::Response<super::SetRegionPolicyResponse>,
8117 tonic::Status,
8118 >;
8119 async fn get_cost_cap_policy(
8123 &self,
8124 request: tonic::Request<super::GetCostCapPolicyRequest>,
8125 ) -> std::result::Result<
8126 tonic::Response<super::GetCostCapPolicyResponse>,
8127 tonic::Status,
8128 >;
8129 async fn set_cost_cap_policy(
8132 &self,
8133 request: tonic::Request<super::SetCostCapPolicyRequest>,
8134 ) -> std::result::Result<
8135 tonic::Response<super::SetCostCapPolicyResponse>,
8136 tonic::Status,
8137 >;
8138 async fn get_org_webhook_config(
8143 &self,
8144 request: tonic::Request<super::GetOrgWebhookConfigRequest>,
8145 ) -> std::result::Result<
8146 tonic::Response<super::GetOrgWebhookConfigResponse>,
8147 tonic::Status,
8148 >;
8149 async fn set_org_webhook_config(
8154 &self,
8155 request: tonic::Request<super::SetOrgWebhookConfigRequest>,
8156 ) -> std::result::Result<
8157 tonic::Response<super::SetOrgWebhookConfigResponse>,
8158 tonic::Status,
8159 >;
8160 async fn create_channel_connect_link(
8167 &self,
8168 request: tonic::Request<super::CreateChannelConnectLinkRequest>,
8169 ) -> std::result::Result<
8170 tonic::Response<super::CreateChannelConnectLinkResponse>,
8171 tonic::Status,
8172 >;
8173 }
8174 #[derive(Debug)]
8189 pub struct IntegrationsServiceServer<T> {
8190 inner: Arc<T>,
8191 accept_compression_encodings: EnabledCompressionEncodings,
8192 send_compression_encodings: EnabledCompressionEncodings,
8193 max_decoding_message_size: Option<usize>,
8194 max_encoding_message_size: Option<usize>,
8195 }
8196 impl<T> IntegrationsServiceServer<T> {
8197 pub fn new(inner: T) -> Self {
8198 Self::from_arc(Arc::new(inner))
8199 }
8200 pub fn from_arc(inner: Arc<T>) -> Self {
8201 Self {
8202 inner,
8203 accept_compression_encodings: Default::default(),
8204 send_compression_encodings: Default::default(),
8205 max_decoding_message_size: None,
8206 max_encoding_message_size: None,
8207 }
8208 }
8209 pub fn with_interceptor<F>(
8210 inner: T,
8211 interceptor: F,
8212 ) -> InterceptedService<Self, F>
8213 where
8214 F: tonic::service::Interceptor,
8215 {
8216 InterceptedService::new(Self::new(inner), interceptor)
8217 }
8218 #[must_use]
8220 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8221 self.accept_compression_encodings.enable(encoding);
8222 self
8223 }
8224 #[must_use]
8226 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8227 self.send_compression_encodings.enable(encoding);
8228 self
8229 }
8230 #[must_use]
8234 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8235 self.max_decoding_message_size = Some(limit);
8236 self
8237 }
8238 #[must_use]
8242 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8243 self.max_encoding_message_size = Some(limit);
8244 self
8245 }
8246 }
8247 impl<T, B> tonic::codegen::Service<http::Request<B>> for IntegrationsServiceServer<T>
8248 where
8249 T: IntegrationsService,
8250 B: Body + std::marker::Send + 'static,
8251 B::Error: Into<StdError> + std::marker::Send + 'static,
8252 {
8253 type Response = http::Response<tonic::body::Body>;
8254 type Error = std::convert::Infallible;
8255 type Future = BoxFuture<Self::Response, Self::Error>;
8256 fn poll_ready(
8257 &mut self,
8258 _cx: &mut Context<'_>,
8259 ) -> Poll<std::result::Result<(), Self::Error>> {
8260 Poll::Ready(Ok(()))
8261 }
8262 fn call(&mut self, req: http::Request<B>) -> Self::Future {
8263 match req.uri().path() {
8264 "/pidgr.v1.IntegrationsService/DispatchToChannel" => {
8265 #[allow(non_camel_case_types)]
8266 struct DispatchToChannelSvc<T: IntegrationsService>(pub Arc<T>);
8267 impl<
8268 T: IntegrationsService,
8269 > tonic::server::UnaryService<super::DispatchToChannelRequest>
8270 for DispatchToChannelSvc<T> {
8271 type Response = super::DispatchToChannelResponse;
8272 type Future = BoxFuture<
8273 tonic::Response<Self::Response>,
8274 tonic::Status,
8275 >;
8276 fn call(
8277 &mut self,
8278 request: tonic::Request<super::DispatchToChannelRequest>,
8279 ) -> Self::Future {
8280 let inner = Arc::clone(&self.0);
8281 let fut = async move {
8282 <T as IntegrationsService>::dispatch_to_channel(
8283 &inner,
8284 request,
8285 )
8286 .await
8287 };
8288 Box::pin(fut)
8289 }
8290 }
8291 let accept_compression_encodings = self.accept_compression_encodings;
8292 let send_compression_encodings = self.send_compression_encodings;
8293 let max_decoding_message_size = self.max_decoding_message_size;
8294 let max_encoding_message_size = self.max_encoding_message_size;
8295 let inner = self.inner.clone();
8296 let fut = async move {
8297 let method = DispatchToChannelSvc(inner);
8298 let codec = tonic_prost::ProstCodec::default();
8299 let mut grpc = tonic::server::Grpc::new(codec)
8300 .apply_compression_config(
8301 accept_compression_encodings,
8302 send_compression_encodings,
8303 )
8304 .apply_max_message_size_config(
8305 max_decoding_message_size,
8306 max_encoding_message_size,
8307 );
8308 let res = grpc.unary(method, req).await;
8309 Ok(res)
8310 };
8311 Box::pin(fut)
8312 }
8313 "/pidgr.v1.IntegrationsService/UpsertReachability" => {
8314 #[allow(non_camel_case_types)]
8315 struct UpsertReachabilitySvc<T: IntegrationsService>(pub Arc<T>);
8316 impl<
8317 T: IntegrationsService,
8318 > tonic::server::UnaryService<super::UpsertReachabilityRequest>
8319 for UpsertReachabilitySvc<T> {
8320 type Response = super::UpsertReachabilityResponse;
8321 type Future = BoxFuture<
8322 tonic::Response<Self::Response>,
8323 tonic::Status,
8324 >;
8325 fn call(
8326 &mut self,
8327 request: tonic::Request<super::UpsertReachabilityRequest>,
8328 ) -> Self::Future {
8329 let inner = Arc::clone(&self.0);
8330 let fut = async move {
8331 <T as IntegrationsService>::upsert_reachability(
8332 &inner,
8333 request,
8334 )
8335 .await
8336 };
8337 Box::pin(fut)
8338 }
8339 }
8340 let accept_compression_encodings = self.accept_compression_encodings;
8341 let send_compression_encodings = self.send_compression_encodings;
8342 let max_decoding_message_size = self.max_decoding_message_size;
8343 let max_encoding_message_size = self.max_encoding_message_size;
8344 let inner = self.inner.clone();
8345 let fut = async move {
8346 let method = UpsertReachabilitySvc(inner);
8347 let codec = tonic_prost::ProstCodec::default();
8348 let mut grpc = tonic::server::Grpc::new(codec)
8349 .apply_compression_config(
8350 accept_compression_encodings,
8351 send_compression_encodings,
8352 )
8353 .apply_max_message_size_config(
8354 max_decoding_message_size,
8355 max_encoding_message_size,
8356 );
8357 let res = grpc.unary(method, req).await;
8358 Ok(res)
8359 };
8360 Box::pin(fut)
8361 }
8362 "/pidgr.v1.IntegrationsService/RemoveReachability" => {
8363 #[allow(non_camel_case_types)]
8364 struct RemoveReachabilitySvc<T: IntegrationsService>(pub Arc<T>);
8365 impl<
8366 T: IntegrationsService,
8367 > tonic::server::UnaryService<super::RemoveReachabilityRequest>
8368 for RemoveReachabilitySvc<T> {
8369 type Response = super::RemoveReachabilityResponse;
8370 type Future = BoxFuture<
8371 tonic::Response<Self::Response>,
8372 tonic::Status,
8373 >;
8374 fn call(
8375 &mut self,
8376 request: tonic::Request<super::RemoveReachabilityRequest>,
8377 ) -> Self::Future {
8378 let inner = Arc::clone(&self.0);
8379 let fut = async move {
8380 <T as IntegrationsService>::remove_reachability(
8381 &inner,
8382 request,
8383 )
8384 .await
8385 };
8386 Box::pin(fut)
8387 }
8388 }
8389 let accept_compression_encodings = self.accept_compression_encodings;
8390 let send_compression_encodings = self.send_compression_encodings;
8391 let max_decoding_message_size = self.max_decoding_message_size;
8392 let max_encoding_message_size = self.max_encoding_message_size;
8393 let inner = self.inner.clone();
8394 let fut = async move {
8395 let method = RemoveReachabilitySvc(inner);
8396 let codec = tonic_prost::ProstCodec::default();
8397 let mut grpc = tonic::server::Grpc::new(codec)
8398 .apply_compression_config(
8399 accept_compression_encodings,
8400 send_compression_encodings,
8401 )
8402 .apply_max_message_size_config(
8403 max_decoding_message_size,
8404 max_encoding_message_size,
8405 );
8406 let res = grpc.unary(method, req).await;
8407 Ok(res)
8408 };
8409 Box::pin(fut)
8410 }
8411 "/pidgr.v1.IntegrationsService/GetReachability" => {
8412 #[allow(non_camel_case_types)]
8413 struct GetReachabilitySvc<T: IntegrationsService>(pub Arc<T>);
8414 impl<
8415 T: IntegrationsService,
8416 > tonic::server::UnaryService<super::GetReachabilityRequest>
8417 for GetReachabilitySvc<T> {
8418 type Response = super::GetReachabilityResponse;
8419 type Future = BoxFuture<
8420 tonic::Response<Self::Response>,
8421 tonic::Status,
8422 >;
8423 fn call(
8424 &mut self,
8425 request: tonic::Request<super::GetReachabilityRequest>,
8426 ) -> Self::Future {
8427 let inner = Arc::clone(&self.0);
8428 let fut = async move {
8429 <T as IntegrationsService>::get_reachability(
8430 &inner,
8431 request,
8432 )
8433 .await
8434 };
8435 Box::pin(fut)
8436 }
8437 }
8438 let accept_compression_encodings = self.accept_compression_encodings;
8439 let send_compression_encodings = self.send_compression_encodings;
8440 let max_decoding_message_size = self.max_decoding_message_size;
8441 let max_encoding_message_size = self.max_encoding_message_size;
8442 let inner = self.inner.clone();
8443 let fut = async move {
8444 let method = GetReachabilitySvc(inner);
8445 let codec = tonic_prost::ProstCodec::default();
8446 let mut grpc = tonic::server::Grpc::new(codec)
8447 .apply_compression_config(
8448 accept_compression_encodings,
8449 send_compression_encodings,
8450 )
8451 .apply_max_message_size_config(
8452 max_decoding_message_size,
8453 max_encoding_message_size,
8454 );
8455 let res = grpc.unary(method, req).await;
8456 Ok(res)
8457 };
8458 Box::pin(fut)
8459 }
8460 "/pidgr.v1.IntegrationsService/ListReachabilityForUser" => {
8461 #[allow(non_camel_case_types)]
8462 struct ListReachabilityForUserSvc<T: IntegrationsService>(
8463 pub Arc<T>,
8464 );
8465 impl<
8466 T: IntegrationsService,
8467 > tonic::server::UnaryService<super::ListReachabilityForUserRequest>
8468 for ListReachabilityForUserSvc<T> {
8469 type Response = super::ListReachabilityForUserResponse;
8470 type Future = BoxFuture<
8471 tonic::Response<Self::Response>,
8472 tonic::Status,
8473 >;
8474 fn call(
8475 &mut self,
8476 request: tonic::Request<
8477 super::ListReachabilityForUserRequest,
8478 >,
8479 ) -> Self::Future {
8480 let inner = Arc::clone(&self.0);
8481 let fut = async move {
8482 <T as IntegrationsService>::list_reachability_for_user(
8483 &inner,
8484 request,
8485 )
8486 .await
8487 };
8488 Box::pin(fut)
8489 }
8490 }
8491 let accept_compression_encodings = self.accept_compression_encodings;
8492 let send_compression_encodings = self.send_compression_encodings;
8493 let max_decoding_message_size = self.max_decoding_message_size;
8494 let max_encoding_message_size = self.max_encoding_message_size;
8495 let inner = self.inner.clone();
8496 let fut = async move {
8497 let method = ListReachabilityForUserSvc(inner);
8498 let codec = tonic_prost::ProstCodec::default();
8499 let mut grpc = tonic::server::Grpc::new(codec)
8500 .apply_compression_config(
8501 accept_compression_encodings,
8502 send_compression_encodings,
8503 )
8504 .apply_max_message_size_config(
8505 max_decoding_message_size,
8506 max_encoding_message_size,
8507 );
8508 let res = grpc.unary(method, req).await;
8509 Ok(res)
8510 };
8511 Box::pin(fut)
8512 }
8513 "/pidgr.v1.IntegrationsService/GetRegionPolicy" => {
8514 #[allow(non_camel_case_types)]
8515 struct GetRegionPolicySvc<T: IntegrationsService>(pub Arc<T>);
8516 impl<
8517 T: IntegrationsService,
8518 > tonic::server::UnaryService<super::GetRegionPolicyRequest>
8519 for GetRegionPolicySvc<T> {
8520 type Response = super::GetRegionPolicyResponse;
8521 type Future = BoxFuture<
8522 tonic::Response<Self::Response>,
8523 tonic::Status,
8524 >;
8525 fn call(
8526 &mut self,
8527 request: tonic::Request<super::GetRegionPolicyRequest>,
8528 ) -> Self::Future {
8529 let inner = Arc::clone(&self.0);
8530 let fut = async move {
8531 <T as IntegrationsService>::get_region_policy(
8532 &inner,
8533 request,
8534 )
8535 .await
8536 };
8537 Box::pin(fut)
8538 }
8539 }
8540 let accept_compression_encodings = self.accept_compression_encodings;
8541 let send_compression_encodings = self.send_compression_encodings;
8542 let max_decoding_message_size = self.max_decoding_message_size;
8543 let max_encoding_message_size = self.max_encoding_message_size;
8544 let inner = self.inner.clone();
8545 let fut = async move {
8546 let method = GetRegionPolicySvc(inner);
8547 let codec = tonic_prost::ProstCodec::default();
8548 let mut grpc = tonic::server::Grpc::new(codec)
8549 .apply_compression_config(
8550 accept_compression_encodings,
8551 send_compression_encodings,
8552 )
8553 .apply_max_message_size_config(
8554 max_decoding_message_size,
8555 max_encoding_message_size,
8556 );
8557 let res = grpc.unary(method, req).await;
8558 Ok(res)
8559 };
8560 Box::pin(fut)
8561 }
8562 "/pidgr.v1.IntegrationsService/SetRegionPolicy" => {
8563 #[allow(non_camel_case_types)]
8564 struct SetRegionPolicySvc<T: IntegrationsService>(pub Arc<T>);
8565 impl<
8566 T: IntegrationsService,
8567 > tonic::server::UnaryService<super::SetRegionPolicyRequest>
8568 for SetRegionPolicySvc<T> {
8569 type Response = super::SetRegionPolicyResponse;
8570 type Future = BoxFuture<
8571 tonic::Response<Self::Response>,
8572 tonic::Status,
8573 >;
8574 fn call(
8575 &mut self,
8576 request: tonic::Request<super::SetRegionPolicyRequest>,
8577 ) -> Self::Future {
8578 let inner = Arc::clone(&self.0);
8579 let fut = async move {
8580 <T as IntegrationsService>::set_region_policy(
8581 &inner,
8582 request,
8583 )
8584 .await
8585 };
8586 Box::pin(fut)
8587 }
8588 }
8589 let accept_compression_encodings = self.accept_compression_encodings;
8590 let send_compression_encodings = self.send_compression_encodings;
8591 let max_decoding_message_size = self.max_decoding_message_size;
8592 let max_encoding_message_size = self.max_encoding_message_size;
8593 let inner = self.inner.clone();
8594 let fut = async move {
8595 let method = SetRegionPolicySvc(inner);
8596 let codec = tonic_prost::ProstCodec::default();
8597 let mut grpc = tonic::server::Grpc::new(codec)
8598 .apply_compression_config(
8599 accept_compression_encodings,
8600 send_compression_encodings,
8601 )
8602 .apply_max_message_size_config(
8603 max_decoding_message_size,
8604 max_encoding_message_size,
8605 );
8606 let res = grpc.unary(method, req).await;
8607 Ok(res)
8608 };
8609 Box::pin(fut)
8610 }
8611 "/pidgr.v1.IntegrationsService/GetCostCapPolicy" => {
8612 #[allow(non_camel_case_types)]
8613 struct GetCostCapPolicySvc<T: IntegrationsService>(pub Arc<T>);
8614 impl<
8615 T: IntegrationsService,
8616 > tonic::server::UnaryService<super::GetCostCapPolicyRequest>
8617 for GetCostCapPolicySvc<T> {
8618 type Response = super::GetCostCapPolicyResponse;
8619 type Future = BoxFuture<
8620 tonic::Response<Self::Response>,
8621 tonic::Status,
8622 >;
8623 fn call(
8624 &mut self,
8625 request: tonic::Request<super::GetCostCapPolicyRequest>,
8626 ) -> Self::Future {
8627 let inner = Arc::clone(&self.0);
8628 let fut = async move {
8629 <T as IntegrationsService>::get_cost_cap_policy(
8630 &inner,
8631 request,
8632 )
8633 .await
8634 };
8635 Box::pin(fut)
8636 }
8637 }
8638 let accept_compression_encodings = self.accept_compression_encodings;
8639 let send_compression_encodings = self.send_compression_encodings;
8640 let max_decoding_message_size = self.max_decoding_message_size;
8641 let max_encoding_message_size = self.max_encoding_message_size;
8642 let inner = self.inner.clone();
8643 let fut = async move {
8644 let method = GetCostCapPolicySvc(inner);
8645 let codec = tonic_prost::ProstCodec::default();
8646 let mut grpc = tonic::server::Grpc::new(codec)
8647 .apply_compression_config(
8648 accept_compression_encodings,
8649 send_compression_encodings,
8650 )
8651 .apply_max_message_size_config(
8652 max_decoding_message_size,
8653 max_encoding_message_size,
8654 );
8655 let res = grpc.unary(method, req).await;
8656 Ok(res)
8657 };
8658 Box::pin(fut)
8659 }
8660 "/pidgr.v1.IntegrationsService/SetCostCapPolicy" => {
8661 #[allow(non_camel_case_types)]
8662 struct SetCostCapPolicySvc<T: IntegrationsService>(pub Arc<T>);
8663 impl<
8664 T: IntegrationsService,
8665 > tonic::server::UnaryService<super::SetCostCapPolicyRequest>
8666 for SetCostCapPolicySvc<T> {
8667 type Response = super::SetCostCapPolicyResponse;
8668 type Future = BoxFuture<
8669 tonic::Response<Self::Response>,
8670 tonic::Status,
8671 >;
8672 fn call(
8673 &mut self,
8674 request: tonic::Request<super::SetCostCapPolicyRequest>,
8675 ) -> Self::Future {
8676 let inner = Arc::clone(&self.0);
8677 let fut = async move {
8678 <T as IntegrationsService>::set_cost_cap_policy(
8679 &inner,
8680 request,
8681 )
8682 .await
8683 };
8684 Box::pin(fut)
8685 }
8686 }
8687 let accept_compression_encodings = self.accept_compression_encodings;
8688 let send_compression_encodings = self.send_compression_encodings;
8689 let max_decoding_message_size = self.max_decoding_message_size;
8690 let max_encoding_message_size = self.max_encoding_message_size;
8691 let inner = self.inner.clone();
8692 let fut = async move {
8693 let method = SetCostCapPolicySvc(inner);
8694 let codec = tonic_prost::ProstCodec::default();
8695 let mut grpc = tonic::server::Grpc::new(codec)
8696 .apply_compression_config(
8697 accept_compression_encodings,
8698 send_compression_encodings,
8699 )
8700 .apply_max_message_size_config(
8701 max_decoding_message_size,
8702 max_encoding_message_size,
8703 );
8704 let res = grpc.unary(method, req).await;
8705 Ok(res)
8706 };
8707 Box::pin(fut)
8708 }
8709 "/pidgr.v1.IntegrationsService/GetOrgWebhookConfig" => {
8710 #[allow(non_camel_case_types)]
8711 struct GetOrgWebhookConfigSvc<T: IntegrationsService>(pub Arc<T>);
8712 impl<
8713 T: IntegrationsService,
8714 > tonic::server::UnaryService<super::GetOrgWebhookConfigRequest>
8715 for GetOrgWebhookConfigSvc<T> {
8716 type Response = super::GetOrgWebhookConfigResponse;
8717 type Future = BoxFuture<
8718 tonic::Response<Self::Response>,
8719 tonic::Status,
8720 >;
8721 fn call(
8722 &mut self,
8723 request: tonic::Request<super::GetOrgWebhookConfigRequest>,
8724 ) -> Self::Future {
8725 let inner = Arc::clone(&self.0);
8726 let fut = async move {
8727 <T as IntegrationsService>::get_org_webhook_config(
8728 &inner,
8729 request,
8730 )
8731 .await
8732 };
8733 Box::pin(fut)
8734 }
8735 }
8736 let accept_compression_encodings = self.accept_compression_encodings;
8737 let send_compression_encodings = self.send_compression_encodings;
8738 let max_decoding_message_size = self.max_decoding_message_size;
8739 let max_encoding_message_size = self.max_encoding_message_size;
8740 let inner = self.inner.clone();
8741 let fut = async move {
8742 let method = GetOrgWebhookConfigSvc(inner);
8743 let codec = tonic_prost::ProstCodec::default();
8744 let mut grpc = tonic::server::Grpc::new(codec)
8745 .apply_compression_config(
8746 accept_compression_encodings,
8747 send_compression_encodings,
8748 )
8749 .apply_max_message_size_config(
8750 max_decoding_message_size,
8751 max_encoding_message_size,
8752 );
8753 let res = grpc.unary(method, req).await;
8754 Ok(res)
8755 };
8756 Box::pin(fut)
8757 }
8758 "/pidgr.v1.IntegrationsService/SetOrgWebhookConfig" => {
8759 #[allow(non_camel_case_types)]
8760 struct SetOrgWebhookConfigSvc<T: IntegrationsService>(pub Arc<T>);
8761 impl<
8762 T: IntegrationsService,
8763 > tonic::server::UnaryService<super::SetOrgWebhookConfigRequest>
8764 for SetOrgWebhookConfigSvc<T> {
8765 type Response = super::SetOrgWebhookConfigResponse;
8766 type Future = BoxFuture<
8767 tonic::Response<Self::Response>,
8768 tonic::Status,
8769 >;
8770 fn call(
8771 &mut self,
8772 request: tonic::Request<super::SetOrgWebhookConfigRequest>,
8773 ) -> Self::Future {
8774 let inner = Arc::clone(&self.0);
8775 let fut = async move {
8776 <T as IntegrationsService>::set_org_webhook_config(
8777 &inner,
8778 request,
8779 )
8780 .await
8781 };
8782 Box::pin(fut)
8783 }
8784 }
8785 let accept_compression_encodings = self.accept_compression_encodings;
8786 let send_compression_encodings = self.send_compression_encodings;
8787 let max_decoding_message_size = self.max_decoding_message_size;
8788 let max_encoding_message_size = self.max_encoding_message_size;
8789 let inner = self.inner.clone();
8790 let fut = async move {
8791 let method = SetOrgWebhookConfigSvc(inner);
8792 let codec = tonic_prost::ProstCodec::default();
8793 let mut grpc = tonic::server::Grpc::new(codec)
8794 .apply_compression_config(
8795 accept_compression_encodings,
8796 send_compression_encodings,
8797 )
8798 .apply_max_message_size_config(
8799 max_decoding_message_size,
8800 max_encoding_message_size,
8801 );
8802 let res = grpc.unary(method, req).await;
8803 Ok(res)
8804 };
8805 Box::pin(fut)
8806 }
8807 "/pidgr.v1.IntegrationsService/CreateChannelConnectLink" => {
8808 #[allow(non_camel_case_types)]
8809 struct CreateChannelConnectLinkSvc<T: IntegrationsService>(
8810 pub Arc<T>,
8811 );
8812 impl<
8813 T: IntegrationsService,
8814 > tonic::server::UnaryService<super::CreateChannelConnectLinkRequest>
8815 for CreateChannelConnectLinkSvc<T> {
8816 type Response = super::CreateChannelConnectLinkResponse;
8817 type Future = BoxFuture<
8818 tonic::Response<Self::Response>,
8819 tonic::Status,
8820 >;
8821 fn call(
8822 &mut self,
8823 request: tonic::Request<
8824 super::CreateChannelConnectLinkRequest,
8825 >,
8826 ) -> Self::Future {
8827 let inner = Arc::clone(&self.0);
8828 let fut = async move {
8829 <T as IntegrationsService>::create_channel_connect_link(
8830 &inner,
8831 request,
8832 )
8833 .await
8834 };
8835 Box::pin(fut)
8836 }
8837 }
8838 let accept_compression_encodings = self.accept_compression_encodings;
8839 let send_compression_encodings = self.send_compression_encodings;
8840 let max_decoding_message_size = self.max_decoding_message_size;
8841 let max_encoding_message_size = self.max_encoding_message_size;
8842 let inner = self.inner.clone();
8843 let fut = async move {
8844 let method = CreateChannelConnectLinkSvc(inner);
8845 let codec = tonic_prost::ProstCodec::default();
8846 let mut grpc = tonic::server::Grpc::new(codec)
8847 .apply_compression_config(
8848 accept_compression_encodings,
8849 send_compression_encodings,
8850 )
8851 .apply_max_message_size_config(
8852 max_decoding_message_size,
8853 max_encoding_message_size,
8854 );
8855 let res = grpc.unary(method, req).await;
8856 Ok(res)
8857 };
8858 Box::pin(fut)
8859 }
8860 _ => {
8861 Box::pin(async move {
8862 let mut response = http::Response::new(
8863 tonic::body::Body::default(),
8864 );
8865 let headers = response.headers_mut();
8866 headers
8867 .insert(
8868 tonic::Status::GRPC_STATUS,
8869 (tonic::Code::Unimplemented as i32).into(),
8870 );
8871 headers
8872 .insert(
8873 http::header::CONTENT_TYPE,
8874 tonic::metadata::GRPC_CONTENT_TYPE,
8875 );
8876 Ok(response)
8877 })
8878 }
8879 }
8880 }
8881 }
8882 impl<T> Clone for IntegrationsServiceServer<T> {
8883 fn clone(&self) -> Self {
8884 let inner = self.inner.clone();
8885 Self {
8886 inner,
8887 accept_compression_encodings: self.accept_compression_encodings,
8888 send_compression_encodings: self.send_compression_encodings,
8889 max_decoding_message_size: self.max_decoding_message_size,
8890 max_encoding_message_size: self.max_encoding_message_size,
8891 }
8892 }
8893 }
8894 pub const SERVICE_NAME: &str = "pidgr.v1.IntegrationsService";
8896 impl<T> tonic::server::NamedService for IntegrationsServiceServer<T> {
8897 const NAME: &'static str = SERVICE_NAME;
8898 }
8899}
8900pub mod invite_link_service_client {
8902 #![allow(
8903 unused_variables,
8904 dead_code,
8905 missing_docs,
8906 clippy::wildcard_imports,
8907 clippy::let_unit_value,
8908 )]
8909 use tonic::codegen::*;
8910 use tonic::codegen::http::Uri;
8911 #[derive(Debug, Clone)]
8917 pub struct InviteLinkServiceClient<T> {
8918 inner: tonic::client::Grpc<T>,
8919 }
8920 impl InviteLinkServiceClient<tonic::transport::Channel> {
8921 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
8923 where
8924 D: TryInto<tonic::transport::Endpoint>,
8925 D::Error: Into<StdError>,
8926 {
8927 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
8928 Ok(Self::new(conn))
8929 }
8930 }
8931 impl<T> InviteLinkServiceClient<T>
8932 where
8933 T: tonic::client::GrpcService<tonic::body::Body>,
8934 T::Error: Into<StdError>,
8935 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
8936 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
8937 {
8938 pub fn new(inner: T) -> Self {
8939 let inner = tonic::client::Grpc::new(inner);
8940 Self { inner }
8941 }
8942 pub fn with_origin(inner: T, origin: Uri) -> Self {
8943 let inner = tonic::client::Grpc::with_origin(inner, origin);
8944 Self { inner }
8945 }
8946 pub fn with_interceptor<F>(
8947 inner: T,
8948 interceptor: F,
8949 ) -> InviteLinkServiceClient<InterceptedService<T, F>>
8950 where
8951 F: tonic::service::Interceptor,
8952 T::ResponseBody: Default,
8953 T: tonic::codegen::Service<
8954 http::Request<tonic::body::Body>,
8955 Response = http::Response<
8956 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
8957 >,
8958 >,
8959 <T as tonic::codegen::Service<
8960 http::Request<tonic::body::Body>,
8961 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
8962 {
8963 InviteLinkServiceClient::new(InterceptedService::new(inner, interceptor))
8964 }
8965 #[must_use]
8970 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8971 self.inner = self.inner.send_compressed(encoding);
8972 self
8973 }
8974 #[must_use]
8976 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8977 self.inner = self.inner.accept_compressed(encoding);
8978 self
8979 }
8980 #[must_use]
8984 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8985 self.inner = self.inner.max_decoding_message_size(limit);
8986 self
8987 }
8988 #[must_use]
8992 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8993 self.inner = self.inner.max_encoding_message_size(limit);
8994 self
8995 }
8996 pub async fn create_invite_link(
9000 &mut self,
9001 request: impl tonic::IntoRequest<super::CreateInviteLinkRequest>,
9002 ) -> std::result::Result<
9003 tonic::Response<super::CreateInviteLinkResponse>,
9004 tonic::Status,
9005 > {
9006 self.inner
9007 .ready()
9008 .await
9009 .map_err(|e| {
9010 tonic::Status::unknown(
9011 format!("Service was not ready: {}", e.into()),
9012 )
9013 })?;
9014 let codec = tonic_prost::ProstCodec::default();
9015 let path = http::uri::PathAndQuery::from_static(
9016 "/pidgr.v1.InviteLinkService/CreateInviteLink",
9017 );
9018 let mut req = request.into_request();
9019 req.extensions_mut()
9020 .insert(
9021 GrpcMethod::new("pidgr.v1.InviteLinkService", "CreateInviteLink"),
9022 );
9023 self.inner.unary(req, path, codec).await
9024 }
9025 pub async fn list_invite_links(
9029 &mut self,
9030 request: impl tonic::IntoRequest<super::ListInviteLinksRequest>,
9031 ) -> std::result::Result<
9032 tonic::Response<super::ListInviteLinksResponse>,
9033 tonic::Status,
9034 > {
9035 self.inner
9036 .ready()
9037 .await
9038 .map_err(|e| {
9039 tonic::Status::unknown(
9040 format!("Service was not ready: {}", e.into()),
9041 )
9042 })?;
9043 let codec = tonic_prost::ProstCodec::default();
9044 let path = http::uri::PathAndQuery::from_static(
9045 "/pidgr.v1.InviteLinkService/ListInviteLinks",
9046 );
9047 let mut req = request.into_request();
9048 req.extensions_mut()
9049 .insert(
9050 GrpcMethod::new("pidgr.v1.InviteLinkService", "ListInviteLinks"),
9051 );
9052 self.inner.unary(req, path, codec).await
9053 }
9054 pub async fn revoke_invite_link(
9058 &mut self,
9059 request: impl tonic::IntoRequest<super::RevokeInviteLinkRequest>,
9060 ) -> std::result::Result<
9061 tonic::Response<super::RevokeInviteLinkResponse>,
9062 tonic::Status,
9063 > {
9064 self.inner
9065 .ready()
9066 .await
9067 .map_err(|e| {
9068 tonic::Status::unknown(
9069 format!("Service was not ready: {}", e.into()),
9070 )
9071 })?;
9072 let codec = tonic_prost::ProstCodec::default();
9073 let path = http::uri::PathAndQuery::from_static(
9074 "/pidgr.v1.InviteLinkService/RevokeInviteLink",
9075 );
9076 let mut req = request.into_request();
9077 req.extensions_mut()
9078 .insert(
9079 GrpcMethod::new("pidgr.v1.InviteLinkService", "RevokeInviteLink"),
9080 );
9081 self.inner.unary(req, path, codec).await
9082 }
9083 pub async fn validate_invite_link(
9089 &mut self,
9090 request: impl tonic::IntoRequest<super::ValidateInviteLinkRequest>,
9091 ) -> std::result::Result<
9092 tonic::Response<super::ValidateInviteLinkResponse>,
9093 tonic::Status,
9094 > {
9095 self.inner
9096 .ready()
9097 .await
9098 .map_err(|e| {
9099 tonic::Status::unknown(
9100 format!("Service was not ready: {}", e.into()),
9101 )
9102 })?;
9103 let codec = tonic_prost::ProstCodec::default();
9104 let path = http::uri::PathAndQuery::from_static(
9105 "/pidgr.v1.InviteLinkService/ValidateInviteLink",
9106 );
9107 let mut req = request.into_request();
9108 req.extensions_mut()
9109 .insert(
9110 GrpcMethod::new("pidgr.v1.InviteLinkService", "ValidateInviteLink"),
9111 );
9112 self.inner.unary(req, path, codec).await
9113 }
9114 pub async fn redeem_invite_link(
9119 &mut self,
9120 request: impl tonic::IntoRequest<super::RedeemInviteLinkRequest>,
9121 ) -> std::result::Result<
9122 tonic::Response<super::RedeemInviteLinkResponse>,
9123 tonic::Status,
9124 > {
9125 self.inner
9126 .ready()
9127 .await
9128 .map_err(|e| {
9129 tonic::Status::unknown(
9130 format!("Service was not ready: {}", e.into()),
9131 )
9132 })?;
9133 let codec = tonic_prost::ProstCodec::default();
9134 let path = http::uri::PathAndQuery::from_static(
9135 "/pidgr.v1.InviteLinkService/RedeemInviteLink",
9136 );
9137 let mut req = request.into_request();
9138 req.extensions_mut()
9139 .insert(
9140 GrpcMethod::new("pidgr.v1.InviteLinkService", "RedeemInviteLink"),
9141 );
9142 self.inner.unary(req, path, codec).await
9143 }
9144 }
9145}
9146pub mod invite_link_service_server {
9148 #![allow(
9149 unused_variables,
9150 dead_code,
9151 missing_docs,
9152 clippy::wildcard_imports,
9153 clippy::let_unit_value,
9154 )]
9155 use tonic::codegen::*;
9156 #[async_trait]
9158 pub trait InviteLinkService: std::marker::Send + std::marker::Sync + 'static {
9159 async fn create_invite_link(
9163 &self,
9164 request: tonic::Request<super::CreateInviteLinkRequest>,
9165 ) -> std::result::Result<
9166 tonic::Response<super::CreateInviteLinkResponse>,
9167 tonic::Status,
9168 >;
9169 async fn list_invite_links(
9173 &self,
9174 request: tonic::Request<super::ListInviteLinksRequest>,
9175 ) -> std::result::Result<
9176 tonic::Response<super::ListInviteLinksResponse>,
9177 tonic::Status,
9178 >;
9179 async fn revoke_invite_link(
9183 &self,
9184 request: tonic::Request<super::RevokeInviteLinkRequest>,
9185 ) -> std::result::Result<
9186 tonic::Response<super::RevokeInviteLinkResponse>,
9187 tonic::Status,
9188 >;
9189 async fn validate_invite_link(
9195 &self,
9196 request: tonic::Request<super::ValidateInviteLinkRequest>,
9197 ) -> std::result::Result<
9198 tonic::Response<super::ValidateInviteLinkResponse>,
9199 tonic::Status,
9200 >;
9201 async fn redeem_invite_link(
9206 &self,
9207 request: tonic::Request<super::RedeemInviteLinkRequest>,
9208 ) -> std::result::Result<
9209 tonic::Response<super::RedeemInviteLinkResponse>,
9210 tonic::Status,
9211 >;
9212 }
9213 #[derive(Debug)]
9219 pub struct InviteLinkServiceServer<T> {
9220 inner: Arc<T>,
9221 accept_compression_encodings: EnabledCompressionEncodings,
9222 send_compression_encodings: EnabledCompressionEncodings,
9223 max_decoding_message_size: Option<usize>,
9224 max_encoding_message_size: Option<usize>,
9225 }
9226 impl<T> InviteLinkServiceServer<T> {
9227 pub fn new(inner: T) -> Self {
9228 Self::from_arc(Arc::new(inner))
9229 }
9230 pub fn from_arc(inner: Arc<T>) -> Self {
9231 Self {
9232 inner,
9233 accept_compression_encodings: Default::default(),
9234 send_compression_encodings: Default::default(),
9235 max_decoding_message_size: None,
9236 max_encoding_message_size: None,
9237 }
9238 }
9239 pub fn with_interceptor<F>(
9240 inner: T,
9241 interceptor: F,
9242 ) -> InterceptedService<Self, F>
9243 where
9244 F: tonic::service::Interceptor,
9245 {
9246 InterceptedService::new(Self::new(inner), interceptor)
9247 }
9248 #[must_use]
9250 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9251 self.accept_compression_encodings.enable(encoding);
9252 self
9253 }
9254 #[must_use]
9256 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9257 self.send_compression_encodings.enable(encoding);
9258 self
9259 }
9260 #[must_use]
9264 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9265 self.max_decoding_message_size = Some(limit);
9266 self
9267 }
9268 #[must_use]
9272 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9273 self.max_encoding_message_size = Some(limit);
9274 self
9275 }
9276 }
9277 impl<T, B> tonic::codegen::Service<http::Request<B>> for InviteLinkServiceServer<T>
9278 where
9279 T: InviteLinkService,
9280 B: Body + std::marker::Send + 'static,
9281 B::Error: Into<StdError> + std::marker::Send + 'static,
9282 {
9283 type Response = http::Response<tonic::body::Body>;
9284 type Error = std::convert::Infallible;
9285 type Future = BoxFuture<Self::Response, Self::Error>;
9286 fn poll_ready(
9287 &mut self,
9288 _cx: &mut Context<'_>,
9289 ) -> Poll<std::result::Result<(), Self::Error>> {
9290 Poll::Ready(Ok(()))
9291 }
9292 fn call(&mut self, req: http::Request<B>) -> Self::Future {
9293 match req.uri().path() {
9294 "/pidgr.v1.InviteLinkService/CreateInviteLink" => {
9295 #[allow(non_camel_case_types)]
9296 struct CreateInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
9297 impl<
9298 T: InviteLinkService,
9299 > tonic::server::UnaryService<super::CreateInviteLinkRequest>
9300 for CreateInviteLinkSvc<T> {
9301 type Response = super::CreateInviteLinkResponse;
9302 type Future = BoxFuture<
9303 tonic::Response<Self::Response>,
9304 tonic::Status,
9305 >;
9306 fn call(
9307 &mut self,
9308 request: tonic::Request<super::CreateInviteLinkRequest>,
9309 ) -> Self::Future {
9310 let inner = Arc::clone(&self.0);
9311 let fut = async move {
9312 <T as InviteLinkService>::create_invite_link(
9313 &inner,
9314 request,
9315 )
9316 .await
9317 };
9318 Box::pin(fut)
9319 }
9320 }
9321 let accept_compression_encodings = self.accept_compression_encodings;
9322 let send_compression_encodings = self.send_compression_encodings;
9323 let max_decoding_message_size = self.max_decoding_message_size;
9324 let max_encoding_message_size = self.max_encoding_message_size;
9325 let inner = self.inner.clone();
9326 let fut = async move {
9327 let method = CreateInviteLinkSvc(inner);
9328 let codec = tonic_prost::ProstCodec::default();
9329 let mut grpc = tonic::server::Grpc::new(codec)
9330 .apply_compression_config(
9331 accept_compression_encodings,
9332 send_compression_encodings,
9333 )
9334 .apply_max_message_size_config(
9335 max_decoding_message_size,
9336 max_encoding_message_size,
9337 );
9338 let res = grpc.unary(method, req).await;
9339 Ok(res)
9340 };
9341 Box::pin(fut)
9342 }
9343 "/pidgr.v1.InviteLinkService/ListInviteLinks" => {
9344 #[allow(non_camel_case_types)]
9345 struct ListInviteLinksSvc<T: InviteLinkService>(pub Arc<T>);
9346 impl<
9347 T: InviteLinkService,
9348 > tonic::server::UnaryService<super::ListInviteLinksRequest>
9349 for ListInviteLinksSvc<T> {
9350 type Response = super::ListInviteLinksResponse;
9351 type Future = BoxFuture<
9352 tonic::Response<Self::Response>,
9353 tonic::Status,
9354 >;
9355 fn call(
9356 &mut self,
9357 request: tonic::Request<super::ListInviteLinksRequest>,
9358 ) -> Self::Future {
9359 let inner = Arc::clone(&self.0);
9360 let fut = async move {
9361 <T as InviteLinkService>::list_invite_links(&inner, request)
9362 .await
9363 };
9364 Box::pin(fut)
9365 }
9366 }
9367 let accept_compression_encodings = self.accept_compression_encodings;
9368 let send_compression_encodings = self.send_compression_encodings;
9369 let max_decoding_message_size = self.max_decoding_message_size;
9370 let max_encoding_message_size = self.max_encoding_message_size;
9371 let inner = self.inner.clone();
9372 let fut = async move {
9373 let method = ListInviteLinksSvc(inner);
9374 let codec = tonic_prost::ProstCodec::default();
9375 let mut grpc = tonic::server::Grpc::new(codec)
9376 .apply_compression_config(
9377 accept_compression_encodings,
9378 send_compression_encodings,
9379 )
9380 .apply_max_message_size_config(
9381 max_decoding_message_size,
9382 max_encoding_message_size,
9383 );
9384 let res = grpc.unary(method, req).await;
9385 Ok(res)
9386 };
9387 Box::pin(fut)
9388 }
9389 "/pidgr.v1.InviteLinkService/RevokeInviteLink" => {
9390 #[allow(non_camel_case_types)]
9391 struct RevokeInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
9392 impl<
9393 T: InviteLinkService,
9394 > tonic::server::UnaryService<super::RevokeInviteLinkRequest>
9395 for RevokeInviteLinkSvc<T> {
9396 type Response = super::RevokeInviteLinkResponse;
9397 type Future = BoxFuture<
9398 tonic::Response<Self::Response>,
9399 tonic::Status,
9400 >;
9401 fn call(
9402 &mut self,
9403 request: tonic::Request<super::RevokeInviteLinkRequest>,
9404 ) -> Self::Future {
9405 let inner = Arc::clone(&self.0);
9406 let fut = async move {
9407 <T as InviteLinkService>::revoke_invite_link(
9408 &inner,
9409 request,
9410 )
9411 .await
9412 };
9413 Box::pin(fut)
9414 }
9415 }
9416 let accept_compression_encodings = self.accept_compression_encodings;
9417 let send_compression_encodings = self.send_compression_encodings;
9418 let max_decoding_message_size = self.max_decoding_message_size;
9419 let max_encoding_message_size = self.max_encoding_message_size;
9420 let inner = self.inner.clone();
9421 let fut = async move {
9422 let method = RevokeInviteLinkSvc(inner);
9423 let codec = tonic_prost::ProstCodec::default();
9424 let mut grpc = tonic::server::Grpc::new(codec)
9425 .apply_compression_config(
9426 accept_compression_encodings,
9427 send_compression_encodings,
9428 )
9429 .apply_max_message_size_config(
9430 max_decoding_message_size,
9431 max_encoding_message_size,
9432 );
9433 let res = grpc.unary(method, req).await;
9434 Ok(res)
9435 };
9436 Box::pin(fut)
9437 }
9438 "/pidgr.v1.InviteLinkService/ValidateInviteLink" => {
9439 #[allow(non_camel_case_types)]
9440 struct ValidateInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
9441 impl<
9442 T: InviteLinkService,
9443 > tonic::server::UnaryService<super::ValidateInviteLinkRequest>
9444 for ValidateInviteLinkSvc<T> {
9445 type Response = super::ValidateInviteLinkResponse;
9446 type Future = BoxFuture<
9447 tonic::Response<Self::Response>,
9448 tonic::Status,
9449 >;
9450 fn call(
9451 &mut self,
9452 request: tonic::Request<super::ValidateInviteLinkRequest>,
9453 ) -> Self::Future {
9454 let inner = Arc::clone(&self.0);
9455 let fut = async move {
9456 <T as InviteLinkService>::validate_invite_link(
9457 &inner,
9458 request,
9459 )
9460 .await
9461 };
9462 Box::pin(fut)
9463 }
9464 }
9465 let accept_compression_encodings = self.accept_compression_encodings;
9466 let send_compression_encodings = self.send_compression_encodings;
9467 let max_decoding_message_size = self.max_decoding_message_size;
9468 let max_encoding_message_size = self.max_encoding_message_size;
9469 let inner = self.inner.clone();
9470 let fut = async move {
9471 let method = ValidateInviteLinkSvc(inner);
9472 let codec = tonic_prost::ProstCodec::default();
9473 let mut grpc = tonic::server::Grpc::new(codec)
9474 .apply_compression_config(
9475 accept_compression_encodings,
9476 send_compression_encodings,
9477 )
9478 .apply_max_message_size_config(
9479 max_decoding_message_size,
9480 max_encoding_message_size,
9481 );
9482 let res = grpc.unary(method, req).await;
9483 Ok(res)
9484 };
9485 Box::pin(fut)
9486 }
9487 "/pidgr.v1.InviteLinkService/RedeemInviteLink" => {
9488 #[allow(non_camel_case_types)]
9489 struct RedeemInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
9490 impl<
9491 T: InviteLinkService,
9492 > tonic::server::UnaryService<super::RedeemInviteLinkRequest>
9493 for RedeemInviteLinkSvc<T> {
9494 type Response = super::RedeemInviteLinkResponse;
9495 type Future = BoxFuture<
9496 tonic::Response<Self::Response>,
9497 tonic::Status,
9498 >;
9499 fn call(
9500 &mut self,
9501 request: tonic::Request<super::RedeemInviteLinkRequest>,
9502 ) -> Self::Future {
9503 let inner = Arc::clone(&self.0);
9504 let fut = async move {
9505 <T as InviteLinkService>::redeem_invite_link(
9506 &inner,
9507 request,
9508 )
9509 .await
9510 };
9511 Box::pin(fut)
9512 }
9513 }
9514 let accept_compression_encodings = self.accept_compression_encodings;
9515 let send_compression_encodings = self.send_compression_encodings;
9516 let max_decoding_message_size = self.max_decoding_message_size;
9517 let max_encoding_message_size = self.max_encoding_message_size;
9518 let inner = self.inner.clone();
9519 let fut = async move {
9520 let method = RedeemInviteLinkSvc(inner);
9521 let codec = tonic_prost::ProstCodec::default();
9522 let mut grpc = tonic::server::Grpc::new(codec)
9523 .apply_compression_config(
9524 accept_compression_encodings,
9525 send_compression_encodings,
9526 )
9527 .apply_max_message_size_config(
9528 max_decoding_message_size,
9529 max_encoding_message_size,
9530 );
9531 let res = grpc.unary(method, req).await;
9532 Ok(res)
9533 };
9534 Box::pin(fut)
9535 }
9536 _ => {
9537 Box::pin(async move {
9538 let mut response = http::Response::new(
9539 tonic::body::Body::default(),
9540 );
9541 let headers = response.headers_mut();
9542 headers
9543 .insert(
9544 tonic::Status::GRPC_STATUS,
9545 (tonic::Code::Unimplemented as i32).into(),
9546 );
9547 headers
9548 .insert(
9549 http::header::CONTENT_TYPE,
9550 tonic::metadata::GRPC_CONTENT_TYPE,
9551 );
9552 Ok(response)
9553 })
9554 }
9555 }
9556 }
9557 }
9558 impl<T> Clone for InviteLinkServiceServer<T> {
9559 fn clone(&self) -> Self {
9560 let inner = self.inner.clone();
9561 Self {
9562 inner,
9563 accept_compression_encodings: self.accept_compression_encodings,
9564 send_compression_encodings: self.send_compression_encodings,
9565 max_decoding_message_size: self.max_decoding_message_size,
9566 max_encoding_message_size: self.max_encoding_message_size,
9567 }
9568 }
9569 }
9570 pub const SERVICE_NAME: &str = "pidgr.v1.InviteLinkService";
9572 impl<T> tonic::server::NamedService for InviteLinkServiceServer<T> {
9573 const NAME: &'static str = SERVICE_NAME;
9574 }
9575}
9576pub mod member_service_client {
9578 #![allow(
9579 unused_variables,
9580 dead_code,
9581 missing_docs,
9582 clippy::wildcard_imports,
9583 clippy::let_unit_value,
9584 )]
9585 use tonic::codegen::*;
9586 use tonic::codegen::http::Uri;
9587 #[derive(Debug, Clone)]
9591 pub struct MemberServiceClient<T> {
9592 inner: tonic::client::Grpc<T>,
9593 }
9594 impl MemberServiceClient<tonic::transport::Channel> {
9595 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
9597 where
9598 D: TryInto<tonic::transport::Endpoint>,
9599 D::Error: Into<StdError>,
9600 {
9601 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
9602 Ok(Self::new(conn))
9603 }
9604 }
9605 impl<T> MemberServiceClient<T>
9606 where
9607 T: tonic::client::GrpcService<tonic::body::Body>,
9608 T::Error: Into<StdError>,
9609 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
9610 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
9611 {
9612 pub fn new(inner: T) -> Self {
9613 let inner = tonic::client::Grpc::new(inner);
9614 Self { inner }
9615 }
9616 pub fn with_origin(inner: T, origin: Uri) -> Self {
9617 let inner = tonic::client::Grpc::with_origin(inner, origin);
9618 Self { inner }
9619 }
9620 pub fn with_interceptor<F>(
9621 inner: T,
9622 interceptor: F,
9623 ) -> MemberServiceClient<InterceptedService<T, F>>
9624 where
9625 F: tonic::service::Interceptor,
9626 T::ResponseBody: Default,
9627 T: tonic::codegen::Service<
9628 http::Request<tonic::body::Body>,
9629 Response = http::Response<
9630 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
9631 >,
9632 >,
9633 <T as tonic::codegen::Service<
9634 http::Request<tonic::body::Body>,
9635 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
9636 {
9637 MemberServiceClient::new(InterceptedService::new(inner, interceptor))
9638 }
9639 #[must_use]
9644 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9645 self.inner = self.inner.send_compressed(encoding);
9646 self
9647 }
9648 #[must_use]
9650 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9651 self.inner = self.inner.accept_compressed(encoding);
9652 self
9653 }
9654 #[must_use]
9658 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9659 self.inner = self.inner.max_decoding_message_size(limit);
9660 self
9661 }
9662 #[must_use]
9666 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9667 self.inner = self.inner.max_encoding_message_size(limit);
9668 self
9669 }
9670 pub async fn invite_user(
9674 &mut self,
9675 request: impl tonic::IntoRequest<super::InviteUserRequest>,
9676 ) -> std::result::Result<
9677 tonic::Response<super::InviteUserResponse>,
9678 tonic::Status,
9679 > {
9680 self.inner
9681 .ready()
9682 .await
9683 .map_err(|e| {
9684 tonic::Status::unknown(
9685 format!("Service was not ready: {}", e.into()),
9686 )
9687 })?;
9688 let codec = tonic_prost::ProstCodec::default();
9689 let path = http::uri::PathAndQuery::from_static(
9690 "/pidgr.v1.MemberService/InviteUser",
9691 );
9692 let mut req = request.into_request();
9693 req.extensions_mut()
9694 .insert(GrpcMethod::new("pidgr.v1.MemberService", "InviteUser"));
9695 self.inner.unary(req, path, codec).await
9696 }
9697 pub async fn get_user(
9702 &mut self,
9703 request: impl tonic::IntoRequest<super::GetUserRequest>,
9704 ) -> std::result::Result<
9705 tonic::Response<super::GetUserResponse>,
9706 tonic::Status,
9707 > {
9708 self.inner
9709 .ready()
9710 .await
9711 .map_err(|e| {
9712 tonic::Status::unknown(
9713 format!("Service was not ready: {}", e.into()),
9714 )
9715 })?;
9716 let codec = tonic_prost::ProstCodec::default();
9717 let path = http::uri::PathAndQuery::from_static(
9718 "/pidgr.v1.MemberService/GetUser",
9719 );
9720 let mut req = request.into_request();
9721 req.extensions_mut()
9722 .insert(GrpcMethod::new("pidgr.v1.MemberService", "GetUser"));
9723 self.inner.unary(req, path, codec).await
9724 }
9725 pub async fn list_users(
9729 &mut self,
9730 request: impl tonic::IntoRequest<super::ListUsersRequest>,
9731 ) -> std::result::Result<
9732 tonic::Response<super::ListUsersResponse>,
9733 tonic::Status,
9734 > {
9735 self.inner
9736 .ready()
9737 .await
9738 .map_err(|e| {
9739 tonic::Status::unknown(
9740 format!("Service was not ready: {}", e.into()),
9741 )
9742 })?;
9743 let codec = tonic_prost::ProstCodec::default();
9744 let path = http::uri::PathAndQuery::from_static(
9745 "/pidgr.v1.MemberService/ListUsers",
9746 );
9747 let mut req = request.into_request();
9748 req.extensions_mut()
9749 .insert(GrpcMethod::new("pidgr.v1.MemberService", "ListUsers"));
9750 self.inner.unary(req, path, codec).await
9751 }
9752 pub async fn update_user_role(
9756 &mut self,
9757 request: impl tonic::IntoRequest<super::UpdateUserRoleRequest>,
9758 ) -> std::result::Result<
9759 tonic::Response<super::UpdateUserRoleResponse>,
9760 tonic::Status,
9761 > {
9762 self.inner
9763 .ready()
9764 .await
9765 .map_err(|e| {
9766 tonic::Status::unknown(
9767 format!("Service was not ready: {}", e.into()),
9768 )
9769 })?;
9770 let codec = tonic_prost::ProstCodec::default();
9771 let path = http::uri::PathAndQuery::from_static(
9772 "/pidgr.v1.MemberService/UpdateUserRole",
9773 );
9774 let mut req = request.into_request();
9775 req.extensions_mut()
9776 .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserRole"));
9777 self.inner.unary(req, path, codec).await
9778 }
9779 pub async fn deactivate_user(
9783 &mut self,
9784 request: impl tonic::IntoRequest<super::DeactivateUserRequest>,
9785 ) -> std::result::Result<
9786 tonic::Response<super::DeactivateUserResponse>,
9787 tonic::Status,
9788 > {
9789 self.inner
9790 .ready()
9791 .await
9792 .map_err(|e| {
9793 tonic::Status::unknown(
9794 format!("Service was not ready: {}", e.into()),
9795 )
9796 })?;
9797 let codec = tonic_prost::ProstCodec::default();
9798 let path = http::uri::PathAndQuery::from_static(
9799 "/pidgr.v1.MemberService/DeactivateUser",
9800 );
9801 let mut req = request.into_request();
9802 req.extensions_mut()
9803 .insert(GrpcMethod::new("pidgr.v1.MemberService", "DeactivateUser"));
9804 self.inner.unary(req, path, codec).await
9805 }
9806 pub async fn reactivate_user(
9811 &mut self,
9812 request: impl tonic::IntoRequest<super::ReactivateUserRequest>,
9813 ) -> std::result::Result<
9814 tonic::Response<super::ReactivateUserResponse>,
9815 tonic::Status,
9816 > {
9817 self.inner
9818 .ready()
9819 .await
9820 .map_err(|e| {
9821 tonic::Status::unknown(
9822 format!("Service was not ready: {}", e.into()),
9823 )
9824 })?;
9825 let codec = tonic_prost::ProstCodec::default();
9826 let path = http::uri::PathAndQuery::from_static(
9827 "/pidgr.v1.MemberService/ReactivateUser",
9828 );
9829 let mut req = request.into_request();
9830 req.extensions_mut()
9831 .insert(GrpcMethod::new("pidgr.v1.MemberService", "ReactivateUser"));
9832 self.inner.unary(req, path, codec).await
9833 }
9834 pub async fn revoke_invite(
9839 &mut self,
9840 request: impl tonic::IntoRequest<super::RevokeInviteRequest>,
9841 ) -> std::result::Result<
9842 tonic::Response<super::RevokeInviteResponse>,
9843 tonic::Status,
9844 > {
9845 self.inner
9846 .ready()
9847 .await
9848 .map_err(|e| {
9849 tonic::Status::unknown(
9850 format!("Service was not ready: {}", e.into()),
9851 )
9852 })?;
9853 let codec = tonic_prost::ProstCodec::default();
9854 let path = http::uri::PathAndQuery::from_static(
9855 "/pidgr.v1.MemberService/RevokeInvite",
9856 );
9857 let mut req = request.into_request();
9858 req.extensions_mut()
9859 .insert(GrpcMethod::new("pidgr.v1.MemberService", "RevokeInvite"));
9860 self.inner.unary(req, path, codec).await
9861 }
9862 pub async fn update_user_profile(
9867 &mut self,
9868 request: impl tonic::IntoRequest<super::UpdateUserProfileRequest>,
9869 ) -> std::result::Result<
9870 tonic::Response<super::UpdateUserProfileResponse>,
9871 tonic::Status,
9872 > {
9873 self.inner
9874 .ready()
9875 .await
9876 .map_err(|e| {
9877 tonic::Status::unknown(
9878 format!("Service was not ready: {}", e.into()),
9879 )
9880 })?;
9881 let codec = tonic_prost::ProstCodec::default();
9882 let path = http::uri::PathAndQuery::from_static(
9883 "/pidgr.v1.MemberService/UpdateUserProfile",
9884 );
9885 let mut req = request.into_request();
9886 req.extensions_mut()
9887 .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserProfile"));
9888 self.inner.unary(req, path, codec).await
9889 }
9890 pub async fn get_user_settings(
9894 &mut self,
9895 request: impl tonic::IntoRequest<super::GetUserSettingsRequest>,
9896 ) -> std::result::Result<
9897 tonic::Response<super::GetUserSettingsResponse>,
9898 tonic::Status,
9899 > {
9900 self.inner
9901 .ready()
9902 .await
9903 .map_err(|e| {
9904 tonic::Status::unknown(
9905 format!("Service was not ready: {}", e.into()),
9906 )
9907 })?;
9908 let codec = tonic_prost::ProstCodec::default();
9909 let path = http::uri::PathAndQuery::from_static(
9910 "/pidgr.v1.MemberService/GetUserSettings",
9911 );
9912 let mut req = request.into_request();
9913 req.extensions_mut()
9914 .insert(GrpcMethod::new("pidgr.v1.MemberService", "GetUserSettings"));
9915 self.inner.unary(req, path, codec).await
9916 }
9917 pub async fn update_user_settings(
9922 &mut self,
9923 request: impl tonic::IntoRequest<super::UpdateUserSettingsRequest>,
9924 ) -> std::result::Result<
9925 tonic::Response<super::UpdateUserSettingsResponse>,
9926 tonic::Status,
9927 > {
9928 self.inner
9929 .ready()
9930 .await
9931 .map_err(|e| {
9932 tonic::Status::unknown(
9933 format!("Service was not ready: {}", e.into()),
9934 )
9935 })?;
9936 let codec = tonic_prost::ProstCodec::default();
9937 let path = http::uri::PathAndQuery::from_static(
9938 "/pidgr.v1.MemberService/UpdateUserSettings",
9939 );
9940 let mut req = request.into_request();
9941 req.extensions_mut()
9942 .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserSettings"));
9943 self.inner.unary(req, path, codec).await
9944 }
9945 pub async fn bulk_invite_users(
9951 &mut self,
9952 request: impl tonic::IntoRequest<super::BulkInviteUsersRequest>,
9953 ) -> std::result::Result<
9954 tonic::Response<super::BulkInviteUsersResponse>,
9955 tonic::Status,
9956 > {
9957 self.inner
9958 .ready()
9959 .await
9960 .map_err(|e| {
9961 tonic::Status::unknown(
9962 format!("Service was not ready: {}", e.into()),
9963 )
9964 })?;
9965 let codec = tonic_prost::ProstCodec::default();
9966 let path = http::uri::PathAndQuery::from_static(
9967 "/pidgr.v1.MemberService/BulkInviteUsers",
9968 );
9969 let mut req = request.into_request();
9970 req.extensions_mut()
9971 .insert(GrpcMethod::new("pidgr.v1.MemberService", "BulkInviteUsers"));
9972 self.inner.unary(req, path, codec).await
9973 }
9974 pub async fn confirm_passkey_enrollment(
9980 &mut self,
9981 request: impl tonic::IntoRequest<super::ConfirmPasskeyEnrollmentRequest>,
9982 ) -> std::result::Result<
9983 tonic::Response<super::ConfirmPasskeyEnrollmentResponse>,
9984 tonic::Status,
9985 > {
9986 self.inner
9987 .ready()
9988 .await
9989 .map_err(|e| {
9990 tonic::Status::unknown(
9991 format!("Service was not ready: {}", e.into()),
9992 )
9993 })?;
9994 let codec = tonic_prost::ProstCodec::default();
9995 let path = http::uri::PathAndQuery::from_static(
9996 "/pidgr.v1.MemberService/ConfirmPasskeyEnrollment",
9997 );
9998 let mut req = request.into_request();
9999 req.extensions_mut()
10000 .insert(
10001 GrpcMethod::new("pidgr.v1.MemberService", "ConfirmPasskeyEnrollment"),
10002 );
10003 self.inner.unary(req, path, codec).await
10004 }
10005 pub async fn update_user_region(
10010 &mut self,
10011 request: impl tonic::IntoRequest<super::UpdateUserRegionRequest>,
10012 ) -> std::result::Result<
10013 tonic::Response<super::UpdateUserRegionResponse>,
10014 tonic::Status,
10015 > {
10016 self.inner
10017 .ready()
10018 .await
10019 .map_err(|e| {
10020 tonic::Status::unknown(
10021 format!("Service was not ready: {}", e.into()),
10022 )
10023 })?;
10024 let codec = tonic_prost::ProstCodec::default();
10025 let path = http::uri::PathAndQuery::from_static(
10026 "/pidgr.v1.MemberService/UpdateUserRegion",
10027 );
10028 let mut req = request.into_request();
10029 req.extensions_mut()
10030 .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserRegion"));
10031 self.inner.unary(req, path, codec).await
10032 }
10033 }
10034}
10035pub mod member_service_server {
10037 #![allow(
10038 unused_variables,
10039 dead_code,
10040 missing_docs,
10041 clippy::wildcard_imports,
10042 clippy::let_unit_value,
10043 )]
10044 use tonic::codegen::*;
10045 #[async_trait]
10047 pub trait MemberService: std::marker::Send + std::marker::Sync + 'static {
10048 async fn invite_user(
10052 &self,
10053 request: tonic::Request<super::InviteUserRequest>,
10054 ) -> std::result::Result<
10055 tonic::Response<super::InviteUserResponse>,
10056 tonic::Status,
10057 >;
10058 async fn get_user(
10063 &self,
10064 request: tonic::Request<super::GetUserRequest>,
10065 ) -> std::result::Result<tonic::Response<super::GetUserResponse>, tonic::Status>;
10066 async fn list_users(
10070 &self,
10071 request: tonic::Request<super::ListUsersRequest>,
10072 ) -> std::result::Result<
10073 tonic::Response<super::ListUsersResponse>,
10074 tonic::Status,
10075 >;
10076 async fn update_user_role(
10080 &self,
10081 request: tonic::Request<super::UpdateUserRoleRequest>,
10082 ) -> std::result::Result<
10083 tonic::Response<super::UpdateUserRoleResponse>,
10084 tonic::Status,
10085 >;
10086 async fn deactivate_user(
10090 &self,
10091 request: tonic::Request<super::DeactivateUserRequest>,
10092 ) -> std::result::Result<
10093 tonic::Response<super::DeactivateUserResponse>,
10094 tonic::Status,
10095 >;
10096 async fn reactivate_user(
10101 &self,
10102 request: tonic::Request<super::ReactivateUserRequest>,
10103 ) -> std::result::Result<
10104 tonic::Response<super::ReactivateUserResponse>,
10105 tonic::Status,
10106 >;
10107 async fn revoke_invite(
10112 &self,
10113 request: tonic::Request<super::RevokeInviteRequest>,
10114 ) -> std::result::Result<
10115 tonic::Response<super::RevokeInviteResponse>,
10116 tonic::Status,
10117 >;
10118 async fn update_user_profile(
10123 &self,
10124 request: tonic::Request<super::UpdateUserProfileRequest>,
10125 ) -> std::result::Result<
10126 tonic::Response<super::UpdateUserProfileResponse>,
10127 tonic::Status,
10128 >;
10129 async fn get_user_settings(
10133 &self,
10134 request: tonic::Request<super::GetUserSettingsRequest>,
10135 ) -> std::result::Result<
10136 tonic::Response<super::GetUserSettingsResponse>,
10137 tonic::Status,
10138 >;
10139 async fn update_user_settings(
10144 &self,
10145 request: tonic::Request<super::UpdateUserSettingsRequest>,
10146 ) -> std::result::Result<
10147 tonic::Response<super::UpdateUserSettingsResponse>,
10148 tonic::Status,
10149 >;
10150 async fn bulk_invite_users(
10156 &self,
10157 request: tonic::Request<super::BulkInviteUsersRequest>,
10158 ) -> std::result::Result<
10159 tonic::Response<super::BulkInviteUsersResponse>,
10160 tonic::Status,
10161 >;
10162 async fn confirm_passkey_enrollment(
10168 &self,
10169 request: tonic::Request<super::ConfirmPasskeyEnrollmentRequest>,
10170 ) -> std::result::Result<
10171 tonic::Response<super::ConfirmPasskeyEnrollmentResponse>,
10172 tonic::Status,
10173 >;
10174 async fn update_user_region(
10179 &self,
10180 request: tonic::Request<super::UpdateUserRegionRequest>,
10181 ) -> std::result::Result<
10182 tonic::Response<super::UpdateUserRegionResponse>,
10183 tonic::Status,
10184 >;
10185 }
10186 #[derive(Debug)]
10190 pub struct MemberServiceServer<T> {
10191 inner: Arc<T>,
10192 accept_compression_encodings: EnabledCompressionEncodings,
10193 send_compression_encodings: EnabledCompressionEncodings,
10194 max_decoding_message_size: Option<usize>,
10195 max_encoding_message_size: Option<usize>,
10196 }
10197 impl<T> MemberServiceServer<T> {
10198 pub fn new(inner: T) -> Self {
10199 Self::from_arc(Arc::new(inner))
10200 }
10201 pub fn from_arc(inner: Arc<T>) -> Self {
10202 Self {
10203 inner,
10204 accept_compression_encodings: Default::default(),
10205 send_compression_encodings: Default::default(),
10206 max_decoding_message_size: None,
10207 max_encoding_message_size: None,
10208 }
10209 }
10210 pub fn with_interceptor<F>(
10211 inner: T,
10212 interceptor: F,
10213 ) -> InterceptedService<Self, F>
10214 where
10215 F: tonic::service::Interceptor,
10216 {
10217 InterceptedService::new(Self::new(inner), interceptor)
10218 }
10219 #[must_use]
10221 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10222 self.accept_compression_encodings.enable(encoding);
10223 self
10224 }
10225 #[must_use]
10227 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10228 self.send_compression_encodings.enable(encoding);
10229 self
10230 }
10231 #[must_use]
10235 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10236 self.max_decoding_message_size = Some(limit);
10237 self
10238 }
10239 #[must_use]
10243 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10244 self.max_encoding_message_size = Some(limit);
10245 self
10246 }
10247 }
10248 impl<T, B> tonic::codegen::Service<http::Request<B>> for MemberServiceServer<T>
10249 where
10250 T: MemberService,
10251 B: Body + std::marker::Send + 'static,
10252 B::Error: Into<StdError> + std::marker::Send + 'static,
10253 {
10254 type Response = http::Response<tonic::body::Body>;
10255 type Error = std::convert::Infallible;
10256 type Future = BoxFuture<Self::Response, Self::Error>;
10257 fn poll_ready(
10258 &mut self,
10259 _cx: &mut Context<'_>,
10260 ) -> Poll<std::result::Result<(), Self::Error>> {
10261 Poll::Ready(Ok(()))
10262 }
10263 fn call(&mut self, req: http::Request<B>) -> Self::Future {
10264 match req.uri().path() {
10265 "/pidgr.v1.MemberService/InviteUser" => {
10266 #[allow(non_camel_case_types)]
10267 struct InviteUserSvc<T: MemberService>(pub Arc<T>);
10268 impl<
10269 T: MemberService,
10270 > tonic::server::UnaryService<super::InviteUserRequest>
10271 for InviteUserSvc<T> {
10272 type Response = super::InviteUserResponse;
10273 type Future = BoxFuture<
10274 tonic::Response<Self::Response>,
10275 tonic::Status,
10276 >;
10277 fn call(
10278 &mut self,
10279 request: tonic::Request<super::InviteUserRequest>,
10280 ) -> Self::Future {
10281 let inner = Arc::clone(&self.0);
10282 let fut = async move {
10283 <T as MemberService>::invite_user(&inner, request).await
10284 };
10285 Box::pin(fut)
10286 }
10287 }
10288 let accept_compression_encodings = self.accept_compression_encodings;
10289 let send_compression_encodings = self.send_compression_encodings;
10290 let max_decoding_message_size = self.max_decoding_message_size;
10291 let max_encoding_message_size = self.max_encoding_message_size;
10292 let inner = self.inner.clone();
10293 let fut = async move {
10294 let method = InviteUserSvc(inner);
10295 let codec = tonic_prost::ProstCodec::default();
10296 let mut grpc = tonic::server::Grpc::new(codec)
10297 .apply_compression_config(
10298 accept_compression_encodings,
10299 send_compression_encodings,
10300 )
10301 .apply_max_message_size_config(
10302 max_decoding_message_size,
10303 max_encoding_message_size,
10304 );
10305 let res = grpc.unary(method, req).await;
10306 Ok(res)
10307 };
10308 Box::pin(fut)
10309 }
10310 "/pidgr.v1.MemberService/GetUser" => {
10311 #[allow(non_camel_case_types)]
10312 struct GetUserSvc<T: MemberService>(pub Arc<T>);
10313 impl<
10314 T: MemberService,
10315 > tonic::server::UnaryService<super::GetUserRequest>
10316 for GetUserSvc<T> {
10317 type Response = super::GetUserResponse;
10318 type Future = BoxFuture<
10319 tonic::Response<Self::Response>,
10320 tonic::Status,
10321 >;
10322 fn call(
10323 &mut self,
10324 request: tonic::Request<super::GetUserRequest>,
10325 ) -> Self::Future {
10326 let inner = Arc::clone(&self.0);
10327 let fut = async move {
10328 <T as MemberService>::get_user(&inner, request).await
10329 };
10330 Box::pin(fut)
10331 }
10332 }
10333 let accept_compression_encodings = self.accept_compression_encodings;
10334 let send_compression_encodings = self.send_compression_encodings;
10335 let max_decoding_message_size = self.max_decoding_message_size;
10336 let max_encoding_message_size = self.max_encoding_message_size;
10337 let inner = self.inner.clone();
10338 let fut = async move {
10339 let method = GetUserSvc(inner);
10340 let codec = tonic_prost::ProstCodec::default();
10341 let mut grpc = tonic::server::Grpc::new(codec)
10342 .apply_compression_config(
10343 accept_compression_encodings,
10344 send_compression_encodings,
10345 )
10346 .apply_max_message_size_config(
10347 max_decoding_message_size,
10348 max_encoding_message_size,
10349 );
10350 let res = grpc.unary(method, req).await;
10351 Ok(res)
10352 };
10353 Box::pin(fut)
10354 }
10355 "/pidgr.v1.MemberService/ListUsers" => {
10356 #[allow(non_camel_case_types)]
10357 struct ListUsersSvc<T: MemberService>(pub Arc<T>);
10358 impl<
10359 T: MemberService,
10360 > tonic::server::UnaryService<super::ListUsersRequest>
10361 for ListUsersSvc<T> {
10362 type Response = super::ListUsersResponse;
10363 type Future = BoxFuture<
10364 tonic::Response<Self::Response>,
10365 tonic::Status,
10366 >;
10367 fn call(
10368 &mut self,
10369 request: tonic::Request<super::ListUsersRequest>,
10370 ) -> Self::Future {
10371 let inner = Arc::clone(&self.0);
10372 let fut = async move {
10373 <T as MemberService>::list_users(&inner, request).await
10374 };
10375 Box::pin(fut)
10376 }
10377 }
10378 let accept_compression_encodings = self.accept_compression_encodings;
10379 let send_compression_encodings = self.send_compression_encodings;
10380 let max_decoding_message_size = self.max_decoding_message_size;
10381 let max_encoding_message_size = self.max_encoding_message_size;
10382 let inner = self.inner.clone();
10383 let fut = async move {
10384 let method = ListUsersSvc(inner);
10385 let codec = tonic_prost::ProstCodec::default();
10386 let mut grpc = tonic::server::Grpc::new(codec)
10387 .apply_compression_config(
10388 accept_compression_encodings,
10389 send_compression_encodings,
10390 )
10391 .apply_max_message_size_config(
10392 max_decoding_message_size,
10393 max_encoding_message_size,
10394 );
10395 let res = grpc.unary(method, req).await;
10396 Ok(res)
10397 };
10398 Box::pin(fut)
10399 }
10400 "/pidgr.v1.MemberService/UpdateUserRole" => {
10401 #[allow(non_camel_case_types)]
10402 struct UpdateUserRoleSvc<T: MemberService>(pub Arc<T>);
10403 impl<
10404 T: MemberService,
10405 > tonic::server::UnaryService<super::UpdateUserRoleRequest>
10406 for UpdateUserRoleSvc<T> {
10407 type Response = super::UpdateUserRoleResponse;
10408 type Future = BoxFuture<
10409 tonic::Response<Self::Response>,
10410 tonic::Status,
10411 >;
10412 fn call(
10413 &mut self,
10414 request: tonic::Request<super::UpdateUserRoleRequest>,
10415 ) -> Self::Future {
10416 let inner = Arc::clone(&self.0);
10417 let fut = async move {
10418 <T as MemberService>::update_user_role(&inner, request)
10419 .await
10420 };
10421 Box::pin(fut)
10422 }
10423 }
10424 let accept_compression_encodings = self.accept_compression_encodings;
10425 let send_compression_encodings = self.send_compression_encodings;
10426 let max_decoding_message_size = self.max_decoding_message_size;
10427 let max_encoding_message_size = self.max_encoding_message_size;
10428 let inner = self.inner.clone();
10429 let fut = async move {
10430 let method = UpdateUserRoleSvc(inner);
10431 let codec = tonic_prost::ProstCodec::default();
10432 let mut grpc = tonic::server::Grpc::new(codec)
10433 .apply_compression_config(
10434 accept_compression_encodings,
10435 send_compression_encodings,
10436 )
10437 .apply_max_message_size_config(
10438 max_decoding_message_size,
10439 max_encoding_message_size,
10440 );
10441 let res = grpc.unary(method, req).await;
10442 Ok(res)
10443 };
10444 Box::pin(fut)
10445 }
10446 "/pidgr.v1.MemberService/DeactivateUser" => {
10447 #[allow(non_camel_case_types)]
10448 struct DeactivateUserSvc<T: MemberService>(pub Arc<T>);
10449 impl<
10450 T: MemberService,
10451 > tonic::server::UnaryService<super::DeactivateUserRequest>
10452 for DeactivateUserSvc<T> {
10453 type Response = super::DeactivateUserResponse;
10454 type Future = BoxFuture<
10455 tonic::Response<Self::Response>,
10456 tonic::Status,
10457 >;
10458 fn call(
10459 &mut self,
10460 request: tonic::Request<super::DeactivateUserRequest>,
10461 ) -> Self::Future {
10462 let inner = Arc::clone(&self.0);
10463 let fut = async move {
10464 <T as MemberService>::deactivate_user(&inner, request).await
10465 };
10466 Box::pin(fut)
10467 }
10468 }
10469 let accept_compression_encodings = self.accept_compression_encodings;
10470 let send_compression_encodings = self.send_compression_encodings;
10471 let max_decoding_message_size = self.max_decoding_message_size;
10472 let max_encoding_message_size = self.max_encoding_message_size;
10473 let inner = self.inner.clone();
10474 let fut = async move {
10475 let method = DeactivateUserSvc(inner);
10476 let codec = tonic_prost::ProstCodec::default();
10477 let mut grpc = tonic::server::Grpc::new(codec)
10478 .apply_compression_config(
10479 accept_compression_encodings,
10480 send_compression_encodings,
10481 )
10482 .apply_max_message_size_config(
10483 max_decoding_message_size,
10484 max_encoding_message_size,
10485 );
10486 let res = grpc.unary(method, req).await;
10487 Ok(res)
10488 };
10489 Box::pin(fut)
10490 }
10491 "/pidgr.v1.MemberService/ReactivateUser" => {
10492 #[allow(non_camel_case_types)]
10493 struct ReactivateUserSvc<T: MemberService>(pub Arc<T>);
10494 impl<
10495 T: MemberService,
10496 > tonic::server::UnaryService<super::ReactivateUserRequest>
10497 for ReactivateUserSvc<T> {
10498 type Response = super::ReactivateUserResponse;
10499 type Future = BoxFuture<
10500 tonic::Response<Self::Response>,
10501 tonic::Status,
10502 >;
10503 fn call(
10504 &mut self,
10505 request: tonic::Request<super::ReactivateUserRequest>,
10506 ) -> Self::Future {
10507 let inner = Arc::clone(&self.0);
10508 let fut = async move {
10509 <T as MemberService>::reactivate_user(&inner, request).await
10510 };
10511 Box::pin(fut)
10512 }
10513 }
10514 let accept_compression_encodings = self.accept_compression_encodings;
10515 let send_compression_encodings = self.send_compression_encodings;
10516 let max_decoding_message_size = self.max_decoding_message_size;
10517 let max_encoding_message_size = self.max_encoding_message_size;
10518 let inner = self.inner.clone();
10519 let fut = async move {
10520 let method = ReactivateUserSvc(inner);
10521 let codec = tonic_prost::ProstCodec::default();
10522 let mut grpc = tonic::server::Grpc::new(codec)
10523 .apply_compression_config(
10524 accept_compression_encodings,
10525 send_compression_encodings,
10526 )
10527 .apply_max_message_size_config(
10528 max_decoding_message_size,
10529 max_encoding_message_size,
10530 );
10531 let res = grpc.unary(method, req).await;
10532 Ok(res)
10533 };
10534 Box::pin(fut)
10535 }
10536 "/pidgr.v1.MemberService/RevokeInvite" => {
10537 #[allow(non_camel_case_types)]
10538 struct RevokeInviteSvc<T: MemberService>(pub Arc<T>);
10539 impl<
10540 T: MemberService,
10541 > tonic::server::UnaryService<super::RevokeInviteRequest>
10542 for RevokeInviteSvc<T> {
10543 type Response = super::RevokeInviteResponse;
10544 type Future = BoxFuture<
10545 tonic::Response<Self::Response>,
10546 tonic::Status,
10547 >;
10548 fn call(
10549 &mut self,
10550 request: tonic::Request<super::RevokeInviteRequest>,
10551 ) -> Self::Future {
10552 let inner = Arc::clone(&self.0);
10553 let fut = async move {
10554 <T as MemberService>::revoke_invite(&inner, request).await
10555 };
10556 Box::pin(fut)
10557 }
10558 }
10559 let accept_compression_encodings = self.accept_compression_encodings;
10560 let send_compression_encodings = self.send_compression_encodings;
10561 let max_decoding_message_size = self.max_decoding_message_size;
10562 let max_encoding_message_size = self.max_encoding_message_size;
10563 let inner = self.inner.clone();
10564 let fut = async move {
10565 let method = RevokeInviteSvc(inner);
10566 let codec = tonic_prost::ProstCodec::default();
10567 let mut grpc = tonic::server::Grpc::new(codec)
10568 .apply_compression_config(
10569 accept_compression_encodings,
10570 send_compression_encodings,
10571 )
10572 .apply_max_message_size_config(
10573 max_decoding_message_size,
10574 max_encoding_message_size,
10575 );
10576 let res = grpc.unary(method, req).await;
10577 Ok(res)
10578 };
10579 Box::pin(fut)
10580 }
10581 "/pidgr.v1.MemberService/UpdateUserProfile" => {
10582 #[allow(non_camel_case_types)]
10583 struct UpdateUserProfileSvc<T: MemberService>(pub Arc<T>);
10584 impl<
10585 T: MemberService,
10586 > tonic::server::UnaryService<super::UpdateUserProfileRequest>
10587 for UpdateUserProfileSvc<T> {
10588 type Response = super::UpdateUserProfileResponse;
10589 type Future = BoxFuture<
10590 tonic::Response<Self::Response>,
10591 tonic::Status,
10592 >;
10593 fn call(
10594 &mut self,
10595 request: tonic::Request<super::UpdateUserProfileRequest>,
10596 ) -> Self::Future {
10597 let inner = Arc::clone(&self.0);
10598 let fut = async move {
10599 <T as MemberService>::update_user_profile(&inner, request)
10600 .await
10601 };
10602 Box::pin(fut)
10603 }
10604 }
10605 let accept_compression_encodings = self.accept_compression_encodings;
10606 let send_compression_encodings = self.send_compression_encodings;
10607 let max_decoding_message_size = self.max_decoding_message_size;
10608 let max_encoding_message_size = self.max_encoding_message_size;
10609 let inner = self.inner.clone();
10610 let fut = async move {
10611 let method = UpdateUserProfileSvc(inner);
10612 let codec = tonic_prost::ProstCodec::default();
10613 let mut grpc = tonic::server::Grpc::new(codec)
10614 .apply_compression_config(
10615 accept_compression_encodings,
10616 send_compression_encodings,
10617 )
10618 .apply_max_message_size_config(
10619 max_decoding_message_size,
10620 max_encoding_message_size,
10621 );
10622 let res = grpc.unary(method, req).await;
10623 Ok(res)
10624 };
10625 Box::pin(fut)
10626 }
10627 "/pidgr.v1.MemberService/GetUserSettings" => {
10628 #[allow(non_camel_case_types)]
10629 struct GetUserSettingsSvc<T: MemberService>(pub Arc<T>);
10630 impl<
10631 T: MemberService,
10632 > tonic::server::UnaryService<super::GetUserSettingsRequest>
10633 for GetUserSettingsSvc<T> {
10634 type Response = super::GetUserSettingsResponse;
10635 type Future = BoxFuture<
10636 tonic::Response<Self::Response>,
10637 tonic::Status,
10638 >;
10639 fn call(
10640 &mut self,
10641 request: tonic::Request<super::GetUserSettingsRequest>,
10642 ) -> Self::Future {
10643 let inner = Arc::clone(&self.0);
10644 let fut = async move {
10645 <T as MemberService>::get_user_settings(&inner, request)
10646 .await
10647 };
10648 Box::pin(fut)
10649 }
10650 }
10651 let accept_compression_encodings = self.accept_compression_encodings;
10652 let send_compression_encodings = self.send_compression_encodings;
10653 let max_decoding_message_size = self.max_decoding_message_size;
10654 let max_encoding_message_size = self.max_encoding_message_size;
10655 let inner = self.inner.clone();
10656 let fut = async move {
10657 let method = GetUserSettingsSvc(inner);
10658 let codec = tonic_prost::ProstCodec::default();
10659 let mut grpc = tonic::server::Grpc::new(codec)
10660 .apply_compression_config(
10661 accept_compression_encodings,
10662 send_compression_encodings,
10663 )
10664 .apply_max_message_size_config(
10665 max_decoding_message_size,
10666 max_encoding_message_size,
10667 );
10668 let res = grpc.unary(method, req).await;
10669 Ok(res)
10670 };
10671 Box::pin(fut)
10672 }
10673 "/pidgr.v1.MemberService/UpdateUserSettings" => {
10674 #[allow(non_camel_case_types)]
10675 struct UpdateUserSettingsSvc<T: MemberService>(pub Arc<T>);
10676 impl<
10677 T: MemberService,
10678 > tonic::server::UnaryService<super::UpdateUserSettingsRequest>
10679 for UpdateUserSettingsSvc<T> {
10680 type Response = super::UpdateUserSettingsResponse;
10681 type Future = BoxFuture<
10682 tonic::Response<Self::Response>,
10683 tonic::Status,
10684 >;
10685 fn call(
10686 &mut self,
10687 request: tonic::Request<super::UpdateUserSettingsRequest>,
10688 ) -> Self::Future {
10689 let inner = Arc::clone(&self.0);
10690 let fut = async move {
10691 <T as MemberService>::update_user_settings(&inner, request)
10692 .await
10693 };
10694 Box::pin(fut)
10695 }
10696 }
10697 let accept_compression_encodings = self.accept_compression_encodings;
10698 let send_compression_encodings = self.send_compression_encodings;
10699 let max_decoding_message_size = self.max_decoding_message_size;
10700 let max_encoding_message_size = self.max_encoding_message_size;
10701 let inner = self.inner.clone();
10702 let fut = async move {
10703 let method = UpdateUserSettingsSvc(inner);
10704 let codec = tonic_prost::ProstCodec::default();
10705 let mut grpc = tonic::server::Grpc::new(codec)
10706 .apply_compression_config(
10707 accept_compression_encodings,
10708 send_compression_encodings,
10709 )
10710 .apply_max_message_size_config(
10711 max_decoding_message_size,
10712 max_encoding_message_size,
10713 );
10714 let res = grpc.unary(method, req).await;
10715 Ok(res)
10716 };
10717 Box::pin(fut)
10718 }
10719 "/pidgr.v1.MemberService/BulkInviteUsers" => {
10720 #[allow(non_camel_case_types)]
10721 struct BulkInviteUsersSvc<T: MemberService>(pub Arc<T>);
10722 impl<
10723 T: MemberService,
10724 > tonic::server::UnaryService<super::BulkInviteUsersRequest>
10725 for BulkInviteUsersSvc<T> {
10726 type Response = super::BulkInviteUsersResponse;
10727 type Future = BoxFuture<
10728 tonic::Response<Self::Response>,
10729 tonic::Status,
10730 >;
10731 fn call(
10732 &mut self,
10733 request: tonic::Request<super::BulkInviteUsersRequest>,
10734 ) -> Self::Future {
10735 let inner = Arc::clone(&self.0);
10736 let fut = async move {
10737 <T as MemberService>::bulk_invite_users(&inner, request)
10738 .await
10739 };
10740 Box::pin(fut)
10741 }
10742 }
10743 let accept_compression_encodings = self.accept_compression_encodings;
10744 let send_compression_encodings = self.send_compression_encodings;
10745 let max_decoding_message_size = self.max_decoding_message_size;
10746 let max_encoding_message_size = self.max_encoding_message_size;
10747 let inner = self.inner.clone();
10748 let fut = async move {
10749 let method = BulkInviteUsersSvc(inner);
10750 let codec = tonic_prost::ProstCodec::default();
10751 let mut grpc = tonic::server::Grpc::new(codec)
10752 .apply_compression_config(
10753 accept_compression_encodings,
10754 send_compression_encodings,
10755 )
10756 .apply_max_message_size_config(
10757 max_decoding_message_size,
10758 max_encoding_message_size,
10759 );
10760 let res = grpc.unary(method, req).await;
10761 Ok(res)
10762 };
10763 Box::pin(fut)
10764 }
10765 "/pidgr.v1.MemberService/ConfirmPasskeyEnrollment" => {
10766 #[allow(non_camel_case_types)]
10767 struct ConfirmPasskeyEnrollmentSvc<T: MemberService>(pub Arc<T>);
10768 impl<
10769 T: MemberService,
10770 > tonic::server::UnaryService<super::ConfirmPasskeyEnrollmentRequest>
10771 for ConfirmPasskeyEnrollmentSvc<T> {
10772 type Response = super::ConfirmPasskeyEnrollmentResponse;
10773 type Future = BoxFuture<
10774 tonic::Response<Self::Response>,
10775 tonic::Status,
10776 >;
10777 fn call(
10778 &mut self,
10779 request: tonic::Request<
10780 super::ConfirmPasskeyEnrollmentRequest,
10781 >,
10782 ) -> Self::Future {
10783 let inner = Arc::clone(&self.0);
10784 let fut = async move {
10785 <T as MemberService>::confirm_passkey_enrollment(
10786 &inner,
10787 request,
10788 )
10789 .await
10790 };
10791 Box::pin(fut)
10792 }
10793 }
10794 let accept_compression_encodings = self.accept_compression_encodings;
10795 let send_compression_encodings = self.send_compression_encodings;
10796 let max_decoding_message_size = self.max_decoding_message_size;
10797 let max_encoding_message_size = self.max_encoding_message_size;
10798 let inner = self.inner.clone();
10799 let fut = async move {
10800 let method = ConfirmPasskeyEnrollmentSvc(inner);
10801 let codec = tonic_prost::ProstCodec::default();
10802 let mut grpc = tonic::server::Grpc::new(codec)
10803 .apply_compression_config(
10804 accept_compression_encodings,
10805 send_compression_encodings,
10806 )
10807 .apply_max_message_size_config(
10808 max_decoding_message_size,
10809 max_encoding_message_size,
10810 );
10811 let res = grpc.unary(method, req).await;
10812 Ok(res)
10813 };
10814 Box::pin(fut)
10815 }
10816 "/pidgr.v1.MemberService/UpdateUserRegion" => {
10817 #[allow(non_camel_case_types)]
10818 struct UpdateUserRegionSvc<T: MemberService>(pub Arc<T>);
10819 impl<
10820 T: MemberService,
10821 > tonic::server::UnaryService<super::UpdateUserRegionRequest>
10822 for UpdateUserRegionSvc<T> {
10823 type Response = super::UpdateUserRegionResponse;
10824 type Future = BoxFuture<
10825 tonic::Response<Self::Response>,
10826 tonic::Status,
10827 >;
10828 fn call(
10829 &mut self,
10830 request: tonic::Request<super::UpdateUserRegionRequest>,
10831 ) -> Self::Future {
10832 let inner = Arc::clone(&self.0);
10833 let fut = async move {
10834 <T as MemberService>::update_user_region(&inner, request)
10835 .await
10836 };
10837 Box::pin(fut)
10838 }
10839 }
10840 let accept_compression_encodings = self.accept_compression_encodings;
10841 let send_compression_encodings = self.send_compression_encodings;
10842 let max_decoding_message_size = self.max_decoding_message_size;
10843 let max_encoding_message_size = self.max_encoding_message_size;
10844 let inner = self.inner.clone();
10845 let fut = async move {
10846 let method = UpdateUserRegionSvc(inner);
10847 let codec = tonic_prost::ProstCodec::default();
10848 let mut grpc = tonic::server::Grpc::new(codec)
10849 .apply_compression_config(
10850 accept_compression_encodings,
10851 send_compression_encodings,
10852 )
10853 .apply_max_message_size_config(
10854 max_decoding_message_size,
10855 max_encoding_message_size,
10856 );
10857 let res = grpc.unary(method, req).await;
10858 Ok(res)
10859 };
10860 Box::pin(fut)
10861 }
10862 _ => {
10863 Box::pin(async move {
10864 let mut response = http::Response::new(
10865 tonic::body::Body::default(),
10866 );
10867 let headers = response.headers_mut();
10868 headers
10869 .insert(
10870 tonic::Status::GRPC_STATUS,
10871 (tonic::Code::Unimplemented as i32).into(),
10872 );
10873 headers
10874 .insert(
10875 http::header::CONTENT_TYPE,
10876 tonic::metadata::GRPC_CONTENT_TYPE,
10877 );
10878 Ok(response)
10879 })
10880 }
10881 }
10882 }
10883 }
10884 impl<T> Clone for MemberServiceServer<T> {
10885 fn clone(&self) -> Self {
10886 let inner = self.inner.clone();
10887 Self {
10888 inner,
10889 accept_compression_encodings: self.accept_compression_encodings,
10890 send_compression_encodings: self.send_compression_encodings,
10891 max_decoding_message_size: self.max_decoding_message_size,
10892 max_encoding_message_size: self.max_encoding_message_size,
10893 }
10894 }
10895 }
10896 pub const SERVICE_NAME: &str = "pidgr.v1.MemberService";
10898 impl<T> tonic::server::NamedService for MemberServiceServer<T> {
10899 const NAME: &'static str = SERVICE_NAME;
10900 }
10901}
10902pub mod org_security_keys_service_client {
10904 #![allow(
10905 unused_variables,
10906 dead_code,
10907 missing_docs,
10908 clippy::wildcard_imports,
10909 clippy::let_unit_value,
10910 )]
10911 use tonic::codegen::*;
10912 use tonic::codegen::http::Uri;
10913 #[derive(Debug, Clone)]
10927 pub struct OrgSecurityKeysServiceClient<T> {
10928 inner: tonic::client::Grpc<T>,
10929 }
10930 impl OrgSecurityKeysServiceClient<tonic::transport::Channel> {
10931 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
10933 where
10934 D: TryInto<tonic::transport::Endpoint>,
10935 D::Error: Into<StdError>,
10936 {
10937 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
10938 Ok(Self::new(conn))
10939 }
10940 }
10941 impl<T> OrgSecurityKeysServiceClient<T>
10942 where
10943 T: tonic::client::GrpcService<tonic::body::Body>,
10944 T::Error: Into<StdError>,
10945 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
10946 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
10947 {
10948 pub fn new(inner: T) -> Self {
10949 let inner = tonic::client::Grpc::new(inner);
10950 Self { inner }
10951 }
10952 pub fn with_origin(inner: T, origin: Uri) -> Self {
10953 let inner = tonic::client::Grpc::with_origin(inner, origin);
10954 Self { inner }
10955 }
10956 pub fn with_interceptor<F>(
10957 inner: T,
10958 interceptor: F,
10959 ) -> OrgSecurityKeysServiceClient<InterceptedService<T, F>>
10960 where
10961 F: tonic::service::Interceptor,
10962 T::ResponseBody: Default,
10963 T: tonic::codegen::Service<
10964 http::Request<tonic::body::Body>,
10965 Response = http::Response<
10966 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
10967 >,
10968 >,
10969 <T as tonic::codegen::Service<
10970 http::Request<tonic::body::Body>,
10971 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
10972 {
10973 OrgSecurityKeysServiceClient::new(
10974 InterceptedService::new(inner, interceptor),
10975 )
10976 }
10977 #[must_use]
10982 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10983 self.inner = self.inner.send_compressed(encoding);
10984 self
10985 }
10986 #[must_use]
10988 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10989 self.inner = self.inner.accept_compressed(encoding);
10990 self
10991 }
10992 #[must_use]
10996 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10997 self.inner = self.inner.max_decoding_message_size(limit);
10998 self
10999 }
11000 #[must_use]
11004 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11005 self.inner = self.inner.max_encoding_message_size(limit);
11006 self
11007 }
11008 pub async fn get_peppers(
11013 &mut self,
11014 request: impl tonic::IntoRequest<super::GetPeppersRequest>,
11015 ) -> std::result::Result<
11016 tonic::Response<super::GetPeppersResponse>,
11017 tonic::Status,
11018 > {
11019 self.inner
11020 .ready()
11021 .await
11022 .map_err(|e| {
11023 tonic::Status::unknown(
11024 format!("Service was not ready: {}", e.into()),
11025 )
11026 })?;
11027 let codec = tonic_prost::ProstCodec::default();
11028 let path = http::uri::PathAndQuery::from_static(
11029 "/pidgr.v1.OrgSecurityKeysService/GetPeppers",
11030 );
11031 let mut req = request.into_request();
11032 req.extensions_mut()
11033 .insert(
11034 GrpcMethod::new("pidgr.v1.OrgSecurityKeysService", "GetPeppers"),
11035 );
11036 self.inner.unary(req, path, codec).await
11037 }
11038 }
11039}
11040pub mod org_security_keys_service_server {
11042 #![allow(
11043 unused_variables,
11044 dead_code,
11045 missing_docs,
11046 clippy::wildcard_imports,
11047 clippy::let_unit_value,
11048 )]
11049 use tonic::codegen::*;
11050 #[async_trait]
11052 pub trait OrgSecurityKeysService: std::marker::Send + std::marker::Sync + 'static {
11053 async fn get_peppers(
11058 &self,
11059 request: tonic::Request<super::GetPeppersRequest>,
11060 ) -> std::result::Result<
11061 tonic::Response<super::GetPeppersResponse>,
11062 tonic::Status,
11063 >;
11064 }
11065 #[derive(Debug)]
11079 pub struct OrgSecurityKeysServiceServer<T> {
11080 inner: Arc<T>,
11081 accept_compression_encodings: EnabledCompressionEncodings,
11082 send_compression_encodings: EnabledCompressionEncodings,
11083 max_decoding_message_size: Option<usize>,
11084 max_encoding_message_size: Option<usize>,
11085 }
11086 impl<T> OrgSecurityKeysServiceServer<T> {
11087 pub fn new(inner: T) -> Self {
11088 Self::from_arc(Arc::new(inner))
11089 }
11090 pub fn from_arc(inner: Arc<T>) -> Self {
11091 Self {
11092 inner,
11093 accept_compression_encodings: Default::default(),
11094 send_compression_encodings: Default::default(),
11095 max_decoding_message_size: None,
11096 max_encoding_message_size: None,
11097 }
11098 }
11099 pub fn with_interceptor<F>(
11100 inner: T,
11101 interceptor: F,
11102 ) -> InterceptedService<Self, F>
11103 where
11104 F: tonic::service::Interceptor,
11105 {
11106 InterceptedService::new(Self::new(inner), interceptor)
11107 }
11108 #[must_use]
11110 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11111 self.accept_compression_encodings.enable(encoding);
11112 self
11113 }
11114 #[must_use]
11116 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11117 self.send_compression_encodings.enable(encoding);
11118 self
11119 }
11120 #[must_use]
11124 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11125 self.max_decoding_message_size = Some(limit);
11126 self
11127 }
11128 #[must_use]
11132 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11133 self.max_encoding_message_size = Some(limit);
11134 self
11135 }
11136 }
11137 impl<T, B> tonic::codegen::Service<http::Request<B>>
11138 for OrgSecurityKeysServiceServer<T>
11139 where
11140 T: OrgSecurityKeysService,
11141 B: Body + std::marker::Send + 'static,
11142 B::Error: Into<StdError> + std::marker::Send + 'static,
11143 {
11144 type Response = http::Response<tonic::body::Body>;
11145 type Error = std::convert::Infallible;
11146 type Future = BoxFuture<Self::Response, Self::Error>;
11147 fn poll_ready(
11148 &mut self,
11149 _cx: &mut Context<'_>,
11150 ) -> Poll<std::result::Result<(), Self::Error>> {
11151 Poll::Ready(Ok(()))
11152 }
11153 fn call(&mut self, req: http::Request<B>) -> Self::Future {
11154 match req.uri().path() {
11155 "/pidgr.v1.OrgSecurityKeysService/GetPeppers" => {
11156 #[allow(non_camel_case_types)]
11157 struct GetPeppersSvc<T: OrgSecurityKeysService>(pub Arc<T>);
11158 impl<
11159 T: OrgSecurityKeysService,
11160 > tonic::server::UnaryService<super::GetPeppersRequest>
11161 for GetPeppersSvc<T> {
11162 type Response = super::GetPeppersResponse;
11163 type Future = BoxFuture<
11164 tonic::Response<Self::Response>,
11165 tonic::Status,
11166 >;
11167 fn call(
11168 &mut self,
11169 request: tonic::Request<super::GetPeppersRequest>,
11170 ) -> Self::Future {
11171 let inner = Arc::clone(&self.0);
11172 let fut = async move {
11173 <T as OrgSecurityKeysService>::get_peppers(&inner, request)
11174 .await
11175 };
11176 Box::pin(fut)
11177 }
11178 }
11179 let accept_compression_encodings = self.accept_compression_encodings;
11180 let send_compression_encodings = self.send_compression_encodings;
11181 let max_decoding_message_size = self.max_decoding_message_size;
11182 let max_encoding_message_size = self.max_encoding_message_size;
11183 let inner = self.inner.clone();
11184 let fut = async move {
11185 let method = GetPeppersSvc(inner);
11186 let codec = tonic_prost::ProstCodec::default();
11187 let mut grpc = tonic::server::Grpc::new(codec)
11188 .apply_compression_config(
11189 accept_compression_encodings,
11190 send_compression_encodings,
11191 )
11192 .apply_max_message_size_config(
11193 max_decoding_message_size,
11194 max_encoding_message_size,
11195 );
11196 let res = grpc.unary(method, req).await;
11197 Ok(res)
11198 };
11199 Box::pin(fut)
11200 }
11201 _ => {
11202 Box::pin(async move {
11203 let mut response = http::Response::new(
11204 tonic::body::Body::default(),
11205 );
11206 let headers = response.headers_mut();
11207 headers
11208 .insert(
11209 tonic::Status::GRPC_STATUS,
11210 (tonic::Code::Unimplemented as i32).into(),
11211 );
11212 headers
11213 .insert(
11214 http::header::CONTENT_TYPE,
11215 tonic::metadata::GRPC_CONTENT_TYPE,
11216 );
11217 Ok(response)
11218 })
11219 }
11220 }
11221 }
11222 }
11223 impl<T> Clone for OrgSecurityKeysServiceServer<T> {
11224 fn clone(&self) -> Self {
11225 let inner = self.inner.clone();
11226 Self {
11227 inner,
11228 accept_compression_encodings: self.accept_compression_encodings,
11229 send_compression_encodings: self.send_compression_encodings,
11230 max_decoding_message_size: self.max_decoding_message_size,
11231 max_encoding_message_size: self.max_encoding_message_size,
11232 }
11233 }
11234 }
11235 pub const SERVICE_NAME: &str = "pidgr.v1.OrgSecurityKeysService";
11237 impl<T> tonic::server::NamedService for OrgSecurityKeysServiceServer<T> {
11238 const NAME: &'static str = SERVICE_NAME;
11239 }
11240}
11241pub mod organization_service_client {
11243 #![allow(
11244 unused_variables,
11245 dead_code,
11246 missing_docs,
11247 clippy::wildcard_imports,
11248 clippy::let_unit_value,
11249 )]
11250 use tonic::codegen::*;
11251 use tonic::codegen::http::Uri;
11252 #[derive(Debug, Clone)]
11257 pub struct OrganizationServiceClient<T> {
11258 inner: tonic::client::Grpc<T>,
11259 }
11260 impl OrganizationServiceClient<tonic::transport::Channel> {
11261 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
11263 where
11264 D: TryInto<tonic::transport::Endpoint>,
11265 D::Error: Into<StdError>,
11266 {
11267 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
11268 Ok(Self::new(conn))
11269 }
11270 }
11271 impl<T> OrganizationServiceClient<T>
11272 where
11273 T: tonic::client::GrpcService<tonic::body::Body>,
11274 T::Error: Into<StdError>,
11275 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
11276 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
11277 {
11278 pub fn new(inner: T) -> Self {
11279 let inner = tonic::client::Grpc::new(inner);
11280 Self { inner }
11281 }
11282 pub fn with_origin(inner: T, origin: Uri) -> Self {
11283 let inner = tonic::client::Grpc::with_origin(inner, origin);
11284 Self { inner }
11285 }
11286 pub fn with_interceptor<F>(
11287 inner: T,
11288 interceptor: F,
11289 ) -> OrganizationServiceClient<InterceptedService<T, F>>
11290 where
11291 F: tonic::service::Interceptor,
11292 T::ResponseBody: Default,
11293 T: tonic::codegen::Service<
11294 http::Request<tonic::body::Body>,
11295 Response = http::Response<
11296 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
11297 >,
11298 >,
11299 <T as tonic::codegen::Service<
11300 http::Request<tonic::body::Body>,
11301 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
11302 {
11303 OrganizationServiceClient::new(InterceptedService::new(inner, interceptor))
11304 }
11305 #[must_use]
11310 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11311 self.inner = self.inner.send_compressed(encoding);
11312 self
11313 }
11314 #[must_use]
11316 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11317 self.inner = self.inner.accept_compressed(encoding);
11318 self
11319 }
11320 #[must_use]
11324 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11325 self.inner = self.inner.max_decoding_message_size(limit);
11326 self
11327 }
11328 #[must_use]
11332 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11333 self.inner = self.inner.max_encoding_message_size(limit);
11334 self
11335 }
11336 pub async fn create_organization(
11341 &mut self,
11342 request: impl tonic::IntoRequest<super::CreateOrganizationRequest>,
11343 ) -> std::result::Result<
11344 tonic::Response<super::CreateOrganizationResponse>,
11345 tonic::Status,
11346 > {
11347 self.inner
11348 .ready()
11349 .await
11350 .map_err(|e| {
11351 tonic::Status::unknown(
11352 format!("Service was not ready: {}", e.into()),
11353 )
11354 })?;
11355 let codec = tonic_prost::ProstCodec::default();
11356 let path = http::uri::PathAndQuery::from_static(
11357 "/pidgr.v1.OrganizationService/CreateOrganization",
11358 );
11359 let mut req = request.into_request();
11360 req.extensions_mut()
11361 .insert(
11362 GrpcMethod::new("pidgr.v1.OrganizationService", "CreateOrganization"),
11363 );
11364 self.inner.unary(req, path, codec).await
11365 }
11366 pub async fn get_organization(
11370 &mut self,
11371 request: impl tonic::IntoRequest<super::GetOrganizationRequest>,
11372 ) -> std::result::Result<
11373 tonic::Response<super::GetOrganizationResponse>,
11374 tonic::Status,
11375 > {
11376 self.inner
11377 .ready()
11378 .await
11379 .map_err(|e| {
11380 tonic::Status::unknown(
11381 format!("Service was not ready: {}", e.into()),
11382 )
11383 })?;
11384 let codec = tonic_prost::ProstCodec::default();
11385 let path = http::uri::PathAndQuery::from_static(
11386 "/pidgr.v1.OrganizationService/GetOrganization",
11387 );
11388 let mut req = request.into_request();
11389 req.extensions_mut()
11390 .insert(
11391 GrpcMethod::new("pidgr.v1.OrganizationService", "GetOrganization"),
11392 );
11393 self.inner.unary(req, path, codec).await
11394 }
11395 pub async fn update_organization(
11399 &mut self,
11400 request: impl tonic::IntoRequest<super::UpdateOrganizationRequest>,
11401 ) -> std::result::Result<
11402 tonic::Response<super::UpdateOrganizationResponse>,
11403 tonic::Status,
11404 > {
11405 self.inner
11406 .ready()
11407 .await
11408 .map_err(|e| {
11409 tonic::Status::unknown(
11410 format!("Service was not ready: {}", e.into()),
11411 )
11412 })?;
11413 let codec = tonic_prost::ProstCodec::default();
11414 let path = http::uri::PathAndQuery::from_static(
11415 "/pidgr.v1.OrganizationService/UpdateOrganization",
11416 );
11417 let mut req = request.into_request();
11418 req.extensions_mut()
11419 .insert(
11420 GrpcMethod::new("pidgr.v1.OrganizationService", "UpdateOrganization"),
11421 );
11422 self.inner.unary(req, path, codec).await
11423 }
11424 pub async fn update_sso_attribute_mappings(
11428 &mut self,
11429 request: impl tonic::IntoRequest<super::UpdateSsoAttributeMappingsRequest>,
11430 ) -> std::result::Result<
11431 tonic::Response<super::UpdateSsoAttributeMappingsResponse>,
11432 tonic::Status,
11433 > {
11434 self.inner
11435 .ready()
11436 .await
11437 .map_err(|e| {
11438 tonic::Status::unknown(
11439 format!("Service was not ready: {}", e.into()),
11440 )
11441 })?;
11442 let codec = tonic_prost::ProstCodec::default();
11443 let path = http::uri::PathAndQuery::from_static(
11444 "/pidgr.v1.OrganizationService/UpdateSsoAttributeMappings",
11445 );
11446 let mut req = request.into_request();
11447 req.extensions_mut()
11448 .insert(
11449 GrpcMethod::new(
11450 "pidgr.v1.OrganizationService",
11451 "UpdateSsoAttributeMappings",
11452 ),
11453 );
11454 self.inner.unary(req, path, codec).await
11455 }
11456 pub async fn rotate_analytics_salt(
11460 &mut self,
11461 request: impl tonic::IntoRequest<super::RotateAnalyticsSaltRequest>,
11462 ) -> std::result::Result<
11463 tonic::Response<super::RotateAnalyticsSaltResponse>,
11464 tonic::Status,
11465 > {
11466 self.inner
11467 .ready()
11468 .await
11469 .map_err(|e| {
11470 tonic::Status::unknown(
11471 format!("Service was not ready: {}", e.into()),
11472 )
11473 })?;
11474 let codec = tonic_prost::ProstCodec::default();
11475 let path = http::uri::PathAndQuery::from_static(
11476 "/pidgr.v1.OrganizationService/RotateAnalyticsSalt",
11477 );
11478 let mut req = request.into_request();
11479 req.extensions_mut()
11480 .insert(
11481 GrpcMethod::new(
11482 "pidgr.v1.OrganizationService",
11483 "RotateAnalyticsSalt",
11484 ),
11485 );
11486 self.inner.unary(req, path, codec).await
11487 }
11488 pub async fn update_analytics_epsilon(
11492 &mut self,
11493 request: impl tonic::IntoRequest<super::UpdateAnalyticsEpsilonRequest>,
11494 ) -> std::result::Result<
11495 tonic::Response<super::UpdateAnalyticsEpsilonResponse>,
11496 tonic::Status,
11497 > {
11498 self.inner
11499 .ready()
11500 .await
11501 .map_err(|e| {
11502 tonic::Status::unknown(
11503 format!("Service was not ready: {}", e.into()),
11504 )
11505 })?;
11506 let codec = tonic_prost::ProstCodec::default();
11507 let path = http::uri::PathAndQuery::from_static(
11508 "/pidgr.v1.OrganizationService/UpdateAnalyticsEpsilon",
11509 );
11510 let mut req = request.into_request();
11511 req.extensions_mut()
11512 .insert(
11513 GrpcMethod::new(
11514 "pidgr.v1.OrganizationService",
11515 "UpdateAnalyticsEpsilon",
11516 ),
11517 );
11518 self.inner.unary(req, path, codec).await
11519 }
11520 pub async fn get_org_privacy_settings(
11526 &mut self,
11527 request: impl tonic::IntoRequest<super::GetOrgPrivacySettingsRequest>,
11528 ) -> std::result::Result<
11529 tonic::Response<super::GetOrgPrivacySettingsResponse>,
11530 tonic::Status,
11531 > {
11532 self.inner
11533 .ready()
11534 .await
11535 .map_err(|e| {
11536 tonic::Status::unknown(
11537 format!("Service was not ready: {}", e.into()),
11538 )
11539 })?;
11540 let codec = tonic_prost::ProstCodec::default();
11541 let path = http::uri::PathAndQuery::from_static(
11542 "/pidgr.v1.OrganizationService/GetOrgPrivacySettings",
11543 );
11544 let mut req = request.into_request();
11545 req.extensions_mut()
11546 .insert(
11547 GrpcMethod::new(
11548 "pidgr.v1.OrganizationService",
11549 "GetOrgPrivacySettings",
11550 ),
11551 );
11552 self.inner.unary(req, path, codec).await
11553 }
11554 pub async fn update_org_privacy_settings(
11559 &mut self,
11560 request: impl tonic::IntoRequest<super::UpdateOrgPrivacySettingsRequest>,
11561 ) -> std::result::Result<
11562 tonic::Response<super::UpdateOrgPrivacySettingsResponse>,
11563 tonic::Status,
11564 > {
11565 self.inner
11566 .ready()
11567 .await
11568 .map_err(|e| {
11569 tonic::Status::unknown(
11570 format!("Service was not ready: {}", e.into()),
11571 )
11572 })?;
11573 let codec = tonic_prost::ProstCodec::default();
11574 let path = http::uri::PathAndQuery::from_static(
11575 "/pidgr.v1.OrganizationService/UpdateOrgPrivacySettings",
11576 );
11577 let mut req = request.into_request();
11578 req.extensions_mut()
11579 .insert(
11580 GrpcMethod::new(
11581 "pidgr.v1.OrganizationService",
11582 "UpdateOrgPrivacySettings",
11583 ),
11584 );
11585 self.inner.unary(req, path, codec).await
11586 }
11587 pub async fn create_sandbox_organization(
11593 &mut self,
11594 request: impl tonic::IntoRequest<super::CreateSandboxOrganizationRequest>,
11595 ) -> std::result::Result<
11596 tonic::Response<super::CreateSandboxOrganizationResponse>,
11597 tonic::Status,
11598 > {
11599 self.inner
11600 .ready()
11601 .await
11602 .map_err(|e| {
11603 tonic::Status::unknown(
11604 format!("Service was not ready: {}", e.into()),
11605 )
11606 })?;
11607 let codec = tonic_prost::ProstCodec::default();
11608 let path = http::uri::PathAndQuery::from_static(
11609 "/pidgr.v1.OrganizationService/CreateSandboxOrganization",
11610 );
11611 let mut req = request.into_request();
11612 req.extensions_mut()
11613 .insert(
11614 GrpcMethod::new(
11615 "pidgr.v1.OrganizationService",
11616 "CreateSandboxOrganization",
11617 ),
11618 );
11619 self.inner.unary(req, path, codec).await
11620 }
11621 pub async fn delete_sandbox_organization(
11627 &mut self,
11628 request: impl tonic::IntoRequest<super::DeleteSandboxOrganizationRequest>,
11629 ) -> std::result::Result<
11630 tonic::Response<super::DeleteSandboxOrganizationResponse>,
11631 tonic::Status,
11632 > {
11633 self.inner
11634 .ready()
11635 .await
11636 .map_err(|e| {
11637 tonic::Status::unknown(
11638 format!("Service was not ready: {}", e.into()),
11639 )
11640 })?;
11641 let codec = tonic_prost::ProstCodec::default();
11642 let path = http::uri::PathAndQuery::from_static(
11643 "/pidgr.v1.OrganizationService/DeleteSandboxOrganization",
11644 );
11645 let mut req = request.into_request();
11646 req.extensions_mut()
11647 .insert(
11648 GrpcMethod::new(
11649 "pidgr.v1.OrganizationService",
11650 "DeleteSandboxOrganization",
11651 ),
11652 );
11653 self.inner.unary(req, path, codec).await
11654 }
11655 pub async fn list_sandbox_fixtures(
11661 &mut self,
11662 request: impl tonic::IntoRequest<super::ListSandboxFixturesRequest>,
11663 ) -> std::result::Result<
11664 tonic::Response<super::ListSandboxFixturesResponse>,
11665 tonic::Status,
11666 > {
11667 self.inner
11668 .ready()
11669 .await
11670 .map_err(|e| {
11671 tonic::Status::unknown(
11672 format!("Service was not ready: {}", e.into()),
11673 )
11674 })?;
11675 let codec = tonic_prost::ProstCodec::default();
11676 let path = http::uri::PathAndQuery::from_static(
11677 "/pidgr.v1.OrganizationService/ListSandboxFixtures",
11678 );
11679 let mut req = request.into_request();
11680 req.extensions_mut()
11681 .insert(
11682 GrpcMethod::new(
11683 "pidgr.v1.OrganizationService",
11684 "ListSandboxFixtures",
11685 ),
11686 );
11687 self.inner.unary(req, path, codec).await
11688 }
11689 pub async fn list_user_organizations(
11696 &mut self,
11697 request: impl tonic::IntoRequest<super::ListUserOrganizationsRequest>,
11698 ) -> std::result::Result<
11699 tonic::Response<super::ListUserOrganizationsResponse>,
11700 tonic::Status,
11701 > {
11702 self.inner
11703 .ready()
11704 .await
11705 .map_err(|e| {
11706 tonic::Status::unknown(
11707 format!("Service was not ready: {}", e.into()),
11708 )
11709 })?;
11710 let codec = tonic_prost::ProstCodec::default();
11711 let path = http::uri::PathAndQuery::from_static(
11712 "/pidgr.v1.OrganizationService/ListUserOrganizations",
11713 );
11714 let mut req = request.into_request();
11715 req.extensions_mut()
11716 .insert(
11717 GrpcMethod::new(
11718 "pidgr.v1.OrganizationService",
11719 "ListUserOrganizations",
11720 ),
11721 );
11722 self.inner.unary(req, path, codec).await
11723 }
11724 pub async fn list_user_sandboxes(
11732 &mut self,
11733 request: impl tonic::IntoRequest<super::ListUserSandboxesRequest>,
11734 ) -> std::result::Result<
11735 tonic::Response<super::ListUserSandboxesResponse>,
11736 tonic::Status,
11737 > {
11738 self.inner
11739 .ready()
11740 .await
11741 .map_err(|e| {
11742 tonic::Status::unknown(
11743 format!("Service was not ready: {}", e.into()),
11744 )
11745 })?;
11746 let codec = tonic_prost::ProstCodec::default();
11747 let path = http::uri::PathAndQuery::from_static(
11748 "/pidgr.v1.OrganizationService/ListUserSandboxes",
11749 );
11750 let mut req = request.into_request();
11751 req.extensions_mut()
11752 .insert(
11753 GrpcMethod::new("pidgr.v1.OrganizationService", "ListUserSandboxes"),
11754 );
11755 self.inner.unary(req, path, codec).await
11756 }
11757 }
11758}
11759pub mod organization_service_server {
11761 #![allow(
11762 unused_variables,
11763 dead_code,
11764 missing_docs,
11765 clippy::wildcard_imports,
11766 clippy::let_unit_value,
11767 )]
11768 use tonic::codegen::*;
11769 #[async_trait]
11771 pub trait OrganizationService: std::marker::Send + std::marker::Sync + 'static {
11772 async fn create_organization(
11777 &self,
11778 request: tonic::Request<super::CreateOrganizationRequest>,
11779 ) -> std::result::Result<
11780 tonic::Response<super::CreateOrganizationResponse>,
11781 tonic::Status,
11782 >;
11783 async fn get_organization(
11787 &self,
11788 request: tonic::Request<super::GetOrganizationRequest>,
11789 ) -> std::result::Result<
11790 tonic::Response<super::GetOrganizationResponse>,
11791 tonic::Status,
11792 >;
11793 async fn update_organization(
11797 &self,
11798 request: tonic::Request<super::UpdateOrganizationRequest>,
11799 ) -> std::result::Result<
11800 tonic::Response<super::UpdateOrganizationResponse>,
11801 tonic::Status,
11802 >;
11803 async fn update_sso_attribute_mappings(
11807 &self,
11808 request: tonic::Request<super::UpdateSsoAttributeMappingsRequest>,
11809 ) -> std::result::Result<
11810 tonic::Response<super::UpdateSsoAttributeMappingsResponse>,
11811 tonic::Status,
11812 >;
11813 async fn rotate_analytics_salt(
11817 &self,
11818 request: tonic::Request<super::RotateAnalyticsSaltRequest>,
11819 ) -> std::result::Result<
11820 tonic::Response<super::RotateAnalyticsSaltResponse>,
11821 tonic::Status,
11822 >;
11823 async fn update_analytics_epsilon(
11827 &self,
11828 request: tonic::Request<super::UpdateAnalyticsEpsilonRequest>,
11829 ) -> std::result::Result<
11830 tonic::Response<super::UpdateAnalyticsEpsilonResponse>,
11831 tonic::Status,
11832 >;
11833 async fn get_org_privacy_settings(
11839 &self,
11840 request: tonic::Request<super::GetOrgPrivacySettingsRequest>,
11841 ) -> std::result::Result<
11842 tonic::Response<super::GetOrgPrivacySettingsResponse>,
11843 tonic::Status,
11844 >;
11845 async fn update_org_privacy_settings(
11850 &self,
11851 request: tonic::Request<super::UpdateOrgPrivacySettingsRequest>,
11852 ) -> std::result::Result<
11853 tonic::Response<super::UpdateOrgPrivacySettingsResponse>,
11854 tonic::Status,
11855 >;
11856 async fn create_sandbox_organization(
11862 &self,
11863 request: tonic::Request<super::CreateSandboxOrganizationRequest>,
11864 ) -> std::result::Result<
11865 tonic::Response<super::CreateSandboxOrganizationResponse>,
11866 tonic::Status,
11867 >;
11868 async fn delete_sandbox_organization(
11874 &self,
11875 request: tonic::Request<super::DeleteSandboxOrganizationRequest>,
11876 ) -> std::result::Result<
11877 tonic::Response<super::DeleteSandboxOrganizationResponse>,
11878 tonic::Status,
11879 >;
11880 async fn list_sandbox_fixtures(
11886 &self,
11887 request: tonic::Request<super::ListSandboxFixturesRequest>,
11888 ) -> std::result::Result<
11889 tonic::Response<super::ListSandboxFixturesResponse>,
11890 tonic::Status,
11891 >;
11892 async fn list_user_organizations(
11899 &self,
11900 request: tonic::Request<super::ListUserOrganizationsRequest>,
11901 ) -> std::result::Result<
11902 tonic::Response<super::ListUserOrganizationsResponse>,
11903 tonic::Status,
11904 >;
11905 async fn list_user_sandboxes(
11913 &self,
11914 request: tonic::Request<super::ListUserSandboxesRequest>,
11915 ) -> std::result::Result<
11916 tonic::Response<super::ListUserSandboxesResponse>,
11917 tonic::Status,
11918 >;
11919 }
11920 #[derive(Debug)]
11925 pub struct OrganizationServiceServer<T> {
11926 inner: Arc<T>,
11927 accept_compression_encodings: EnabledCompressionEncodings,
11928 send_compression_encodings: EnabledCompressionEncodings,
11929 max_decoding_message_size: Option<usize>,
11930 max_encoding_message_size: Option<usize>,
11931 }
11932 impl<T> OrganizationServiceServer<T> {
11933 pub fn new(inner: T) -> Self {
11934 Self::from_arc(Arc::new(inner))
11935 }
11936 pub fn from_arc(inner: Arc<T>) -> Self {
11937 Self {
11938 inner,
11939 accept_compression_encodings: Default::default(),
11940 send_compression_encodings: Default::default(),
11941 max_decoding_message_size: None,
11942 max_encoding_message_size: None,
11943 }
11944 }
11945 pub fn with_interceptor<F>(
11946 inner: T,
11947 interceptor: F,
11948 ) -> InterceptedService<Self, F>
11949 where
11950 F: tonic::service::Interceptor,
11951 {
11952 InterceptedService::new(Self::new(inner), interceptor)
11953 }
11954 #[must_use]
11956 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11957 self.accept_compression_encodings.enable(encoding);
11958 self
11959 }
11960 #[must_use]
11962 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11963 self.send_compression_encodings.enable(encoding);
11964 self
11965 }
11966 #[must_use]
11970 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11971 self.max_decoding_message_size = Some(limit);
11972 self
11973 }
11974 #[must_use]
11978 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11979 self.max_encoding_message_size = Some(limit);
11980 self
11981 }
11982 }
11983 impl<T, B> tonic::codegen::Service<http::Request<B>> for OrganizationServiceServer<T>
11984 where
11985 T: OrganizationService,
11986 B: Body + std::marker::Send + 'static,
11987 B::Error: Into<StdError> + std::marker::Send + 'static,
11988 {
11989 type Response = http::Response<tonic::body::Body>;
11990 type Error = std::convert::Infallible;
11991 type Future = BoxFuture<Self::Response, Self::Error>;
11992 fn poll_ready(
11993 &mut self,
11994 _cx: &mut Context<'_>,
11995 ) -> Poll<std::result::Result<(), Self::Error>> {
11996 Poll::Ready(Ok(()))
11997 }
11998 fn call(&mut self, req: http::Request<B>) -> Self::Future {
11999 match req.uri().path() {
12000 "/pidgr.v1.OrganizationService/CreateOrganization" => {
12001 #[allow(non_camel_case_types)]
12002 struct CreateOrganizationSvc<T: OrganizationService>(pub Arc<T>);
12003 impl<
12004 T: OrganizationService,
12005 > tonic::server::UnaryService<super::CreateOrganizationRequest>
12006 for CreateOrganizationSvc<T> {
12007 type Response = super::CreateOrganizationResponse;
12008 type Future = BoxFuture<
12009 tonic::Response<Self::Response>,
12010 tonic::Status,
12011 >;
12012 fn call(
12013 &mut self,
12014 request: tonic::Request<super::CreateOrganizationRequest>,
12015 ) -> Self::Future {
12016 let inner = Arc::clone(&self.0);
12017 let fut = async move {
12018 <T as OrganizationService>::create_organization(
12019 &inner,
12020 request,
12021 )
12022 .await
12023 };
12024 Box::pin(fut)
12025 }
12026 }
12027 let accept_compression_encodings = self.accept_compression_encodings;
12028 let send_compression_encodings = self.send_compression_encodings;
12029 let max_decoding_message_size = self.max_decoding_message_size;
12030 let max_encoding_message_size = self.max_encoding_message_size;
12031 let inner = self.inner.clone();
12032 let fut = async move {
12033 let method = CreateOrganizationSvc(inner);
12034 let codec = tonic_prost::ProstCodec::default();
12035 let mut grpc = tonic::server::Grpc::new(codec)
12036 .apply_compression_config(
12037 accept_compression_encodings,
12038 send_compression_encodings,
12039 )
12040 .apply_max_message_size_config(
12041 max_decoding_message_size,
12042 max_encoding_message_size,
12043 );
12044 let res = grpc.unary(method, req).await;
12045 Ok(res)
12046 };
12047 Box::pin(fut)
12048 }
12049 "/pidgr.v1.OrganizationService/GetOrganization" => {
12050 #[allow(non_camel_case_types)]
12051 struct GetOrganizationSvc<T: OrganizationService>(pub Arc<T>);
12052 impl<
12053 T: OrganizationService,
12054 > tonic::server::UnaryService<super::GetOrganizationRequest>
12055 for GetOrganizationSvc<T> {
12056 type Response = super::GetOrganizationResponse;
12057 type Future = BoxFuture<
12058 tonic::Response<Self::Response>,
12059 tonic::Status,
12060 >;
12061 fn call(
12062 &mut self,
12063 request: tonic::Request<super::GetOrganizationRequest>,
12064 ) -> Self::Future {
12065 let inner = Arc::clone(&self.0);
12066 let fut = async move {
12067 <T as OrganizationService>::get_organization(
12068 &inner,
12069 request,
12070 )
12071 .await
12072 };
12073 Box::pin(fut)
12074 }
12075 }
12076 let accept_compression_encodings = self.accept_compression_encodings;
12077 let send_compression_encodings = self.send_compression_encodings;
12078 let max_decoding_message_size = self.max_decoding_message_size;
12079 let max_encoding_message_size = self.max_encoding_message_size;
12080 let inner = self.inner.clone();
12081 let fut = async move {
12082 let method = GetOrganizationSvc(inner);
12083 let codec = tonic_prost::ProstCodec::default();
12084 let mut grpc = tonic::server::Grpc::new(codec)
12085 .apply_compression_config(
12086 accept_compression_encodings,
12087 send_compression_encodings,
12088 )
12089 .apply_max_message_size_config(
12090 max_decoding_message_size,
12091 max_encoding_message_size,
12092 );
12093 let res = grpc.unary(method, req).await;
12094 Ok(res)
12095 };
12096 Box::pin(fut)
12097 }
12098 "/pidgr.v1.OrganizationService/UpdateOrganization" => {
12099 #[allow(non_camel_case_types)]
12100 struct UpdateOrganizationSvc<T: OrganizationService>(pub Arc<T>);
12101 impl<
12102 T: OrganizationService,
12103 > tonic::server::UnaryService<super::UpdateOrganizationRequest>
12104 for UpdateOrganizationSvc<T> {
12105 type Response = super::UpdateOrganizationResponse;
12106 type Future = BoxFuture<
12107 tonic::Response<Self::Response>,
12108 tonic::Status,
12109 >;
12110 fn call(
12111 &mut self,
12112 request: tonic::Request<super::UpdateOrganizationRequest>,
12113 ) -> Self::Future {
12114 let inner = Arc::clone(&self.0);
12115 let fut = async move {
12116 <T as OrganizationService>::update_organization(
12117 &inner,
12118 request,
12119 )
12120 .await
12121 };
12122 Box::pin(fut)
12123 }
12124 }
12125 let accept_compression_encodings = self.accept_compression_encodings;
12126 let send_compression_encodings = self.send_compression_encodings;
12127 let max_decoding_message_size = self.max_decoding_message_size;
12128 let max_encoding_message_size = self.max_encoding_message_size;
12129 let inner = self.inner.clone();
12130 let fut = async move {
12131 let method = UpdateOrganizationSvc(inner);
12132 let codec = tonic_prost::ProstCodec::default();
12133 let mut grpc = tonic::server::Grpc::new(codec)
12134 .apply_compression_config(
12135 accept_compression_encodings,
12136 send_compression_encodings,
12137 )
12138 .apply_max_message_size_config(
12139 max_decoding_message_size,
12140 max_encoding_message_size,
12141 );
12142 let res = grpc.unary(method, req).await;
12143 Ok(res)
12144 };
12145 Box::pin(fut)
12146 }
12147 "/pidgr.v1.OrganizationService/UpdateSsoAttributeMappings" => {
12148 #[allow(non_camel_case_types)]
12149 struct UpdateSsoAttributeMappingsSvc<T: OrganizationService>(
12150 pub Arc<T>,
12151 );
12152 impl<
12153 T: OrganizationService,
12154 > tonic::server::UnaryService<
12155 super::UpdateSsoAttributeMappingsRequest,
12156 > for UpdateSsoAttributeMappingsSvc<T> {
12157 type Response = super::UpdateSsoAttributeMappingsResponse;
12158 type Future = BoxFuture<
12159 tonic::Response<Self::Response>,
12160 tonic::Status,
12161 >;
12162 fn call(
12163 &mut self,
12164 request: tonic::Request<
12165 super::UpdateSsoAttributeMappingsRequest,
12166 >,
12167 ) -> Self::Future {
12168 let inner = Arc::clone(&self.0);
12169 let fut = async move {
12170 <T as OrganizationService>::update_sso_attribute_mappings(
12171 &inner,
12172 request,
12173 )
12174 .await
12175 };
12176 Box::pin(fut)
12177 }
12178 }
12179 let accept_compression_encodings = self.accept_compression_encodings;
12180 let send_compression_encodings = self.send_compression_encodings;
12181 let max_decoding_message_size = self.max_decoding_message_size;
12182 let max_encoding_message_size = self.max_encoding_message_size;
12183 let inner = self.inner.clone();
12184 let fut = async move {
12185 let method = UpdateSsoAttributeMappingsSvc(inner);
12186 let codec = tonic_prost::ProstCodec::default();
12187 let mut grpc = tonic::server::Grpc::new(codec)
12188 .apply_compression_config(
12189 accept_compression_encodings,
12190 send_compression_encodings,
12191 )
12192 .apply_max_message_size_config(
12193 max_decoding_message_size,
12194 max_encoding_message_size,
12195 );
12196 let res = grpc.unary(method, req).await;
12197 Ok(res)
12198 };
12199 Box::pin(fut)
12200 }
12201 "/pidgr.v1.OrganizationService/RotateAnalyticsSalt" => {
12202 #[allow(non_camel_case_types)]
12203 struct RotateAnalyticsSaltSvc<T: OrganizationService>(pub Arc<T>);
12204 impl<
12205 T: OrganizationService,
12206 > tonic::server::UnaryService<super::RotateAnalyticsSaltRequest>
12207 for RotateAnalyticsSaltSvc<T> {
12208 type Response = super::RotateAnalyticsSaltResponse;
12209 type Future = BoxFuture<
12210 tonic::Response<Self::Response>,
12211 tonic::Status,
12212 >;
12213 fn call(
12214 &mut self,
12215 request: tonic::Request<super::RotateAnalyticsSaltRequest>,
12216 ) -> Self::Future {
12217 let inner = Arc::clone(&self.0);
12218 let fut = async move {
12219 <T as OrganizationService>::rotate_analytics_salt(
12220 &inner,
12221 request,
12222 )
12223 .await
12224 };
12225 Box::pin(fut)
12226 }
12227 }
12228 let accept_compression_encodings = self.accept_compression_encodings;
12229 let send_compression_encodings = self.send_compression_encodings;
12230 let max_decoding_message_size = self.max_decoding_message_size;
12231 let max_encoding_message_size = self.max_encoding_message_size;
12232 let inner = self.inner.clone();
12233 let fut = async move {
12234 let method = RotateAnalyticsSaltSvc(inner);
12235 let codec = tonic_prost::ProstCodec::default();
12236 let mut grpc = tonic::server::Grpc::new(codec)
12237 .apply_compression_config(
12238 accept_compression_encodings,
12239 send_compression_encodings,
12240 )
12241 .apply_max_message_size_config(
12242 max_decoding_message_size,
12243 max_encoding_message_size,
12244 );
12245 let res = grpc.unary(method, req).await;
12246 Ok(res)
12247 };
12248 Box::pin(fut)
12249 }
12250 "/pidgr.v1.OrganizationService/UpdateAnalyticsEpsilon" => {
12251 #[allow(non_camel_case_types)]
12252 struct UpdateAnalyticsEpsilonSvc<T: OrganizationService>(pub Arc<T>);
12253 impl<
12254 T: OrganizationService,
12255 > tonic::server::UnaryService<super::UpdateAnalyticsEpsilonRequest>
12256 for UpdateAnalyticsEpsilonSvc<T> {
12257 type Response = super::UpdateAnalyticsEpsilonResponse;
12258 type Future = BoxFuture<
12259 tonic::Response<Self::Response>,
12260 tonic::Status,
12261 >;
12262 fn call(
12263 &mut self,
12264 request: tonic::Request<super::UpdateAnalyticsEpsilonRequest>,
12265 ) -> Self::Future {
12266 let inner = Arc::clone(&self.0);
12267 let fut = async move {
12268 <T as OrganizationService>::update_analytics_epsilon(
12269 &inner,
12270 request,
12271 )
12272 .await
12273 };
12274 Box::pin(fut)
12275 }
12276 }
12277 let accept_compression_encodings = self.accept_compression_encodings;
12278 let send_compression_encodings = self.send_compression_encodings;
12279 let max_decoding_message_size = self.max_decoding_message_size;
12280 let max_encoding_message_size = self.max_encoding_message_size;
12281 let inner = self.inner.clone();
12282 let fut = async move {
12283 let method = UpdateAnalyticsEpsilonSvc(inner);
12284 let codec = tonic_prost::ProstCodec::default();
12285 let mut grpc = tonic::server::Grpc::new(codec)
12286 .apply_compression_config(
12287 accept_compression_encodings,
12288 send_compression_encodings,
12289 )
12290 .apply_max_message_size_config(
12291 max_decoding_message_size,
12292 max_encoding_message_size,
12293 );
12294 let res = grpc.unary(method, req).await;
12295 Ok(res)
12296 };
12297 Box::pin(fut)
12298 }
12299 "/pidgr.v1.OrganizationService/GetOrgPrivacySettings" => {
12300 #[allow(non_camel_case_types)]
12301 struct GetOrgPrivacySettingsSvc<T: OrganizationService>(pub Arc<T>);
12302 impl<
12303 T: OrganizationService,
12304 > tonic::server::UnaryService<super::GetOrgPrivacySettingsRequest>
12305 for GetOrgPrivacySettingsSvc<T> {
12306 type Response = super::GetOrgPrivacySettingsResponse;
12307 type Future = BoxFuture<
12308 tonic::Response<Self::Response>,
12309 tonic::Status,
12310 >;
12311 fn call(
12312 &mut self,
12313 request: tonic::Request<super::GetOrgPrivacySettingsRequest>,
12314 ) -> Self::Future {
12315 let inner = Arc::clone(&self.0);
12316 let fut = async move {
12317 <T as OrganizationService>::get_org_privacy_settings(
12318 &inner,
12319 request,
12320 )
12321 .await
12322 };
12323 Box::pin(fut)
12324 }
12325 }
12326 let accept_compression_encodings = self.accept_compression_encodings;
12327 let send_compression_encodings = self.send_compression_encodings;
12328 let max_decoding_message_size = self.max_decoding_message_size;
12329 let max_encoding_message_size = self.max_encoding_message_size;
12330 let inner = self.inner.clone();
12331 let fut = async move {
12332 let method = GetOrgPrivacySettingsSvc(inner);
12333 let codec = tonic_prost::ProstCodec::default();
12334 let mut grpc = tonic::server::Grpc::new(codec)
12335 .apply_compression_config(
12336 accept_compression_encodings,
12337 send_compression_encodings,
12338 )
12339 .apply_max_message_size_config(
12340 max_decoding_message_size,
12341 max_encoding_message_size,
12342 );
12343 let res = grpc.unary(method, req).await;
12344 Ok(res)
12345 };
12346 Box::pin(fut)
12347 }
12348 "/pidgr.v1.OrganizationService/UpdateOrgPrivacySettings" => {
12349 #[allow(non_camel_case_types)]
12350 struct UpdateOrgPrivacySettingsSvc<T: OrganizationService>(
12351 pub Arc<T>,
12352 );
12353 impl<
12354 T: OrganizationService,
12355 > tonic::server::UnaryService<super::UpdateOrgPrivacySettingsRequest>
12356 for UpdateOrgPrivacySettingsSvc<T> {
12357 type Response = super::UpdateOrgPrivacySettingsResponse;
12358 type Future = BoxFuture<
12359 tonic::Response<Self::Response>,
12360 tonic::Status,
12361 >;
12362 fn call(
12363 &mut self,
12364 request: tonic::Request<
12365 super::UpdateOrgPrivacySettingsRequest,
12366 >,
12367 ) -> Self::Future {
12368 let inner = Arc::clone(&self.0);
12369 let fut = async move {
12370 <T as OrganizationService>::update_org_privacy_settings(
12371 &inner,
12372 request,
12373 )
12374 .await
12375 };
12376 Box::pin(fut)
12377 }
12378 }
12379 let accept_compression_encodings = self.accept_compression_encodings;
12380 let send_compression_encodings = self.send_compression_encodings;
12381 let max_decoding_message_size = self.max_decoding_message_size;
12382 let max_encoding_message_size = self.max_encoding_message_size;
12383 let inner = self.inner.clone();
12384 let fut = async move {
12385 let method = UpdateOrgPrivacySettingsSvc(inner);
12386 let codec = tonic_prost::ProstCodec::default();
12387 let mut grpc = tonic::server::Grpc::new(codec)
12388 .apply_compression_config(
12389 accept_compression_encodings,
12390 send_compression_encodings,
12391 )
12392 .apply_max_message_size_config(
12393 max_decoding_message_size,
12394 max_encoding_message_size,
12395 );
12396 let res = grpc.unary(method, req).await;
12397 Ok(res)
12398 };
12399 Box::pin(fut)
12400 }
12401 "/pidgr.v1.OrganizationService/CreateSandboxOrganization" => {
12402 #[allow(non_camel_case_types)]
12403 struct CreateSandboxOrganizationSvc<T: OrganizationService>(
12404 pub Arc<T>,
12405 );
12406 impl<
12407 T: OrganizationService,
12408 > tonic::server::UnaryService<
12409 super::CreateSandboxOrganizationRequest,
12410 > for CreateSandboxOrganizationSvc<T> {
12411 type Response = super::CreateSandboxOrganizationResponse;
12412 type Future = BoxFuture<
12413 tonic::Response<Self::Response>,
12414 tonic::Status,
12415 >;
12416 fn call(
12417 &mut self,
12418 request: tonic::Request<
12419 super::CreateSandboxOrganizationRequest,
12420 >,
12421 ) -> Self::Future {
12422 let inner = Arc::clone(&self.0);
12423 let fut = async move {
12424 <T as OrganizationService>::create_sandbox_organization(
12425 &inner,
12426 request,
12427 )
12428 .await
12429 };
12430 Box::pin(fut)
12431 }
12432 }
12433 let accept_compression_encodings = self.accept_compression_encodings;
12434 let send_compression_encodings = self.send_compression_encodings;
12435 let max_decoding_message_size = self.max_decoding_message_size;
12436 let max_encoding_message_size = self.max_encoding_message_size;
12437 let inner = self.inner.clone();
12438 let fut = async move {
12439 let method = CreateSandboxOrganizationSvc(inner);
12440 let codec = tonic_prost::ProstCodec::default();
12441 let mut grpc = tonic::server::Grpc::new(codec)
12442 .apply_compression_config(
12443 accept_compression_encodings,
12444 send_compression_encodings,
12445 )
12446 .apply_max_message_size_config(
12447 max_decoding_message_size,
12448 max_encoding_message_size,
12449 );
12450 let res = grpc.unary(method, req).await;
12451 Ok(res)
12452 };
12453 Box::pin(fut)
12454 }
12455 "/pidgr.v1.OrganizationService/DeleteSandboxOrganization" => {
12456 #[allow(non_camel_case_types)]
12457 struct DeleteSandboxOrganizationSvc<T: OrganizationService>(
12458 pub Arc<T>,
12459 );
12460 impl<
12461 T: OrganizationService,
12462 > tonic::server::UnaryService<
12463 super::DeleteSandboxOrganizationRequest,
12464 > for DeleteSandboxOrganizationSvc<T> {
12465 type Response = super::DeleteSandboxOrganizationResponse;
12466 type Future = BoxFuture<
12467 tonic::Response<Self::Response>,
12468 tonic::Status,
12469 >;
12470 fn call(
12471 &mut self,
12472 request: tonic::Request<
12473 super::DeleteSandboxOrganizationRequest,
12474 >,
12475 ) -> Self::Future {
12476 let inner = Arc::clone(&self.0);
12477 let fut = async move {
12478 <T as OrganizationService>::delete_sandbox_organization(
12479 &inner,
12480 request,
12481 )
12482 .await
12483 };
12484 Box::pin(fut)
12485 }
12486 }
12487 let accept_compression_encodings = self.accept_compression_encodings;
12488 let send_compression_encodings = self.send_compression_encodings;
12489 let max_decoding_message_size = self.max_decoding_message_size;
12490 let max_encoding_message_size = self.max_encoding_message_size;
12491 let inner = self.inner.clone();
12492 let fut = async move {
12493 let method = DeleteSandboxOrganizationSvc(inner);
12494 let codec = tonic_prost::ProstCodec::default();
12495 let mut grpc = tonic::server::Grpc::new(codec)
12496 .apply_compression_config(
12497 accept_compression_encodings,
12498 send_compression_encodings,
12499 )
12500 .apply_max_message_size_config(
12501 max_decoding_message_size,
12502 max_encoding_message_size,
12503 );
12504 let res = grpc.unary(method, req).await;
12505 Ok(res)
12506 };
12507 Box::pin(fut)
12508 }
12509 "/pidgr.v1.OrganizationService/ListSandboxFixtures" => {
12510 #[allow(non_camel_case_types)]
12511 struct ListSandboxFixturesSvc<T: OrganizationService>(pub Arc<T>);
12512 impl<
12513 T: OrganizationService,
12514 > tonic::server::UnaryService<super::ListSandboxFixturesRequest>
12515 for ListSandboxFixturesSvc<T> {
12516 type Response = super::ListSandboxFixturesResponse;
12517 type Future = BoxFuture<
12518 tonic::Response<Self::Response>,
12519 tonic::Status,
12520 >;
12521 fn call(
12522 &mut self,
12523 request: tonic::Request<super::ListSandboxFixturesRequest>,
12524 ) -> Self::Future {
12525 let inner = Arc::clone(&self.0);
12526 let fut = async move {
12527 <T as OrganizationService>::list_sandbox_fixtures(
12528 &inner,
12529 request,
12530 )
12531 .await
12532 };
12533 Box::pin(fut)
12534 }
12535 }
12536 let accept_compression_encodings = self.accept_compression_encodings;
12537 let send_compression_encodings = self.send_compression_encodings;
12538 let max_decoding_message_size = self.max_decoding_message_size;
12539 let max_encoding_message_size = self.max_encoding_message_size;
12540 let inner = self.inner.clone();
12541 let fut = async move {
12542 let method = ListSandboxFixturesSvc(inner);
12543 let codec = tonic_prost::ProstCodec::default();
12544 let mut grpc = tonic::server::Grpc::new(codec)
12545 .apply_compression_config(
12546 accept_compression_encodings,
12547 send_compression_encodings,
12548 )
12549 .apply_max_message_size_config(
12550 max_decoding_message_size,
12551 max_encoding_message_size,
12552 );
12553 let res = grpc.unary(method, req).await;
12554 Ok(res)
12555 };
12556 Box::pin(fut)
12557 }
12558 "/pidgr.v1.OrganizationService/ListUserOrganizations" => {
12559 #[allow(non_camel_case_types)]
12560 struct ListUserOrganizationsSvc<T: OrganizationService>(pub Arc<T>);
12561 impl<
12562 T: OrganizationService,
12563 > tonic::server::UnaryService<super::ListUserOrganizationsRequest>
12564 for ListUserOrganizationsSvc<T> {
12565 type Response = super::ListUserOrganizationsResponse;
12566 type Future = BoxFuture<
12567 tonic::Response<Self::Response>,
12568 tonic::Status,
12569 >;
12570 fn call(
12571 &mut self,
12572 request: tonic::Request<super::ListUserOrganizationsRequest>,
12573 ) -> Self::Future {
12574 let inner = Arc::clone(&self.0);
12575 let fut = async move {
12576 <T as OrganizationService>::list_user_organizations(
12577 &inner,
12578 request,
12579 )
12580 .await
12581 };
12582 Box::pin(fut)
12583 }
12584 }
12585 let accept_compression_encodings = self.accept_compression_encodings;
12586 let send_compression_encodings = self.send_compression_encodings;
12587 let max_decoding_message_size = self.max_decoding_message_size;
12588 let max_encoding_message_size = self.max_encoding_message_size;
12589 let inner = self.inner.clone();
12590 let fut = async move {
12591 let method = ListUserOrganizationsSvc(inner);
12592 let codec = tonic_prost::ProstCodec::default();
12593 let mut grpc = tonic::server::Grpc::new(codec)
12594 .apply_compression_config(
12595 accept_compression_encodings,
12596 send_compression_encodings,
12597 )
12598 .apply_max_message_size_config(
12599 max_decoding_message_size,
12600 max_encoding_message_size,
12601 );
12602 let res = grpc.unary(method, req).await;
12603 Ok(res)
12604 };
12605 Box::pin(fut)
12606 }
12607 "/pidgr.v1.OrganizationService/ListUserSandboxes" => {
12608 #[allow(non_camel_case_types)]
12609 struct ListUserSandboxesSvc<T: OrganizationService>(pub Arc<T>);
12610 impl<
12611 T: OrganizationService,
12612 > tonic::server::UnaryService<super::ListUserSandboxesRequest>
12613 for ListUserSandboxesSvc<T> {
12614 type Response = super::ListUserSandboxesResponse;
12615 type Future = BoxFuture<
12616 tonic::Response<Self::Response>,
12617 tonic::Status,
12618 >;
12619 fn call(
12620 &mut self,
12621 request: tonic::Request<super::ListUserSandboxesRequest>,
12622 ) -> Self::Future {
12623 let inner = Arc::clone(&self.0);
12624 let fut = async move {
12625 <T as OrganizationService>::list_user_sandboxes(
12626 &inner,
12627 request,
12628 )
12629 .await
12630 };
12631 Box::pin(fut)
12632 }
12633 }
12634 let accept_compression_encodings = self.accept_compression_encodings;
12635 let send_compression_encodings = self.send_compression_encodings;
12636 let max_decoding_message_size = self.max_decoding_message_size;
12637 let max_encoding_message_size = self.max_encoding_message_size;
12638 let inner = self.inner.clone();
12639 let fut = async move {
12640 let method = ListUserSandboxesSvc(inner);
12641 let codec = tonic_prost::ProstCodec::default();
12642 let mut grpc = tonic::server::Grpc::new(codec)
12643 .apply_compression_config(
12644 accept_compression_encodings,
12645 send_compression_encodings,
12646 )
12647 .apply_max_message_size_config(
12648 max_decoding_message_size,
12649 max_encoding_message_size,
12650 );
12651 let res = grpc.unary(method, req).await;
12652 Ok(res)
12653 };
12654 Box::pin(fut)
12655 }
12656 _ => {
12657 Box::pin(async move {
12658 let mut response = http::Response::new(
12659 tonic::body::Body::default(),
12660 );
12661 let headers = response.headers_mut();
12662 headers
12663 .insert(
12664 tonic::Status::GRPC_STATUS,
12665 (tonic::Code::Unimplemented as i32).into(),
12666 );
12667 headers
12668 .insert(
12669 http::header::CONTENT_TYPE,
12670 tonic::metadata::GRPC_CONTENT_TYPE,
12671 );
12672 Ok(response)
12673 })
12674 }
12675 }
12676 }
12677 }
12678 impl<T> Clone for OrganizationServiceServer<T> {
12679 fn clone(&self) -> Self {
12680 let inner = self.inner.clone();
12681 Self {
12682 inner,
12683 accept_compression_encodings: self.accept_compression_encodings,
12684 send_compression_encodings: self.send_compression_encodings,
12685 max_decoding_message_size: self.max_decoding_message_size,
12686 max_encoding_message_size: self.max_encoding_message_size,
12687 }
12688 }
12689 }
12690 pub const SERVICE_NAME: &str = "pidgr.v1.OrganizationService";
12692 impl<T> tonic::server::NamedService for OrganizationServiceServer<T> {
12693 const NAME: &'static str = SERVICE_NAME;
12694 }
12695}
12696pub mod render_service_client {
12698 #![allow(
12699 unused_variables,
12700 dead_code,
12701 missing_docs,
12702 clippy::wildcard_imports,
12703 clippy::let_unit_value,
12704 )]
12705 use tonic::codegen::*;
12706 use tonic::codegen::http::Uri;
12707 #[derive(Debug, Clone)]
12710 pub struct RenderServiceClient<T> {
12711 inner: tonic::client::Grpc<T>,
12712 }
12713 impl RenderServiceClient<tonic::transport::Channel> {
12714 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
12716 where
12717 D: TryInto<tonic::transport::Endpoint>,
12718 D::Error: Into<StdError>,
12719 {
12720 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
12721 Ok(Self::new(conn))
12722 }
12723 }
12724 impl<T> RenderServiceClient<T>
12725 where
12726 T: tonic::client::GrpcService<tonic::body::Body>,
12727 T::Error: Into<StdError>,
12728 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
12729 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
12730 {
12731 pub fn new(inner: T) -> Self {
12732 let inner = tonic::client::Grpc::new(inner);
12733 Self { inner }
12734 }
12735 pub fn with_origin(inner: T, origin: Uri) -> Self {
12736 let inner = tonic::client::Grpc::with_origin(inner, origin);
12737 Self { inner }
12738 }
12739 pub fn with_interceptor<F>(
12740 inner: T,
12741 interceptor: F,
12742 ) -> RenderServiceClient<InterceptedService<T, F>>
12743 where
12744 F: tonic::service::Interceptor,
12745 T::ResponseBody: Default,
12746 T: tonic::codegen::Service<
12747 http::Request<tonic::body::Body>,
12748 Response = http::Response<
12749 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
12750 >,
12751 >,
12752 <T as tonic::codegen::Service<
12753 http::Request<tonic::body::Body>,
12754 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
12755 {
12756 RenderServiceClient::new(InterceptedService::new(inner, interceptor))
12757 }
12758 #[must_use]
12763 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
12764 self.inner = self.inner.send_compressed(encoding);
12765 self
12766 }
12767 #[must_use]
12769 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
12770 self.inner = self.inner.accept_compressed(encoding);
12771 self
12772 }
12773 #[must_use]
12777 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
12778 self.inner = self.inner.max_decoding_message_size(limit);
12779 self
12780 }
12781 #[must_use]
12785 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
12786 self.inner = self.inner.max_encoding_message_size(limit);
12787 self
12788 }
12789 pub async fn render_batch(
12793 &mut self,
12794 request: impl tonic::IntoRequest<super::RenderBatchRequest>,
12795 ) -> std::result::Result<
12796 tonic::Response<tonic::codec::Streaming<super::RenderBatchResponse>>,
12797 tonic::Status,
12798 > {
12799 self.inner
12800 .ready()
12801 .await
12802 .map_err(|e| {
12803 tonic::Status::unknown(
12804 format!("Service was not ready: {}", e.into()),
12805 )
12806 })?;
12807 let codec = tonic_prost::ProstCodec::default();
12808 let path = http::uri::PathAndQuery::from_static(
12809 "/pidgr.v1.RenderService/RenderBatch",
12810 );
12811 let mut req = request.into_request();
12812 req.extensions_mut()
12813 .insert(GrpcMethod::new("pidgr.v1.RenderService", "RenderBatch"));
12814 self.inner.server_streaming(req, path, codec).await
12815 }
12816 }
12817}
12818pub mod render_service_server {
12820 #![allow(
12821 unused_variables,
12822 dead_code,
12823 missing_docs,
12824 clippy::wildcard_imports,
12825 clippy::let_unit_value,
12826 )]
12827 use tonic::codegen::*;
12828 #[async_trait]
12830 pub trait RenderService: std::marker::Send + std::marker::Sync + 'static {
12831 type RenderBatchStream: tonic::codegen::tokio_stream::Stream<
12833 Item = std::result::Result<super::RenderBatchResponse, tonic::Status>,
12834 >
12835 + std::marker::Send
12836 + 'static;
12837 async fn render_batch(
12841 &self,
12842 request: tonic::Request<super::RenderBatchRequest>,
12843 ) -> std::result::Result<
12844 tonic::Response<Self::RenderBatchStream>,
12845 tonic::Status,
12846 >;
12847 }
12848 #[derive(Debug)]
12851 pub struct RenderServiceServer<T> {
12852 inner: Arc<T>,
12853 accept_compression_encodings: EnabledCompressionEncodings,
12854 send_compression_encodings: EnabledCompressionEncodings,
12855 max_decoding_message_size: Option<usize>,
12856 max_encoding_message_size: Option<usize>,
12857 }
12858 impl<T> RenderServiceServer<T> {
12859 pub fn new(inner: T) -> Self {
12860 Self::from_arc(Arc::new(inner))
12861 }
12862 pub fn from_arc(inner: Arc<T>) -> Self {
12863 Self {
12864 inner,
12865 accept_compression_encodings: Default::default(),
12866 send_compression_encodings: Default::default(),
12867 max_decoding_message_size: None,
12868 max_encoding_message_size: None,
12869 }
12870 }
12871 pub fn with_interceptor<F>(
12872 inner: T,
12873 interceptor: F,
12874 ) -> InterceptedService<Self, F>
12875 where
12876 F: tonic::service::Interceptor,
12877 {
12878 InterceptedService::new(Self::new(inner), interceptor)
12879 }
12880 #[must_use]
12882 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
12883 self.accept_compression_encodings.enable(encoding);
12884 self
12885 }
12886 #[must_use]
12888 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
12889 self.send_compression_encodings.enable(encoding);
12890 self
12891 }
12892 #[must_use]
12896 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
12897 self.max_decoding_message_size = Some(limit);
12898 self
12899 }
12900 #[must_use]
12904 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
12905 self.max_encoding_message_size = Some(limit);
12906 self
12907 }
12908 }
12909 impl<T, B> tonic::codegen::Service<http::Request<B>> for RenderServiceServer<T>
12910 where
12911 T: RenderService,
12912 B: Body + std::marker::Send + 'static,
12913 B::Error: Into<StdError> + std::marker::Send + 'static,
12914 {
12915 type Response = http::Response<tonic::body::Body>;
12916 type Error = std::convert::Infallible;
12917 type Future = BoxFuture<Self::Response, Self::Error>;
12918 fn poll_ready(
12919 &mut self,
12920 _cx: &mut Context<'_>,
12921 ) -> Poll<std::result::Result<(), Self::Error>> {
12922 Poll::Ready(Ok(()))
12923 }
12924 fn call(&mut self, req: http::Request<B>) -> Self::Future {
12925 match req.uri().path() {
12926 "/pidgr.v1.RenderService/RenderBatch" => {
12927 #[allow(non_camel_case_types)]
12928 struct RenderBatchSvc<T: RenderService>(pub Arc<T>);
12929 impl<
12930 T: RenderService,
12931 > tonic::server::ServerStreamingService<super::RenderBatchRequest>
12932 for RenderBatchSvc<T> {
12933 type Response = super::RenderBatchResponse;
12934 type ResponseStream = T::RenderBatchStream;
12935 type Future = BoxFuture<
12936 tonic::Response<Self::ResponseStream>,
12937 tonic::Status,
12938 >;
12939 fn call(
12940 &mut self,
12941 request: tonic::Request<super::RenderBatchRequest>,
12942 ) -> Self::Future {
12943 let inner = Arc::clone(&self.0);
12944 let fut = async move {
12945 <T as RenderService>::render_batch(&inner, request).await
12946 };
12947 Box::pin(fut)
12948 }
12949 }
12950 let accept_compression_encodings = self.accept_compression_encodings;
12951 let send_compression_encodings = self.send_compression_encodings;
12952 let max_decoding_message_size = self.max_decoding_message_size;
12953 let max_encoding_message_size = self.max_encoding_message_size;
12954 let inner = self.inner.clone();
12955 let fut = async move {
12956 let method = RenderBatchSvc(inner);
12957 let codec = tonic_prost::ProstCodec::default();
12958 let mut grpc = tonic::server::Grpc::new(codec)
12959 .apply_compression_config(
12960 accept_compression_encodings,
12961 send_compression_encodings,
12962 )
12963 .apply_max_message_size_config(
12964 max_decoding_message_size,
12965 max_encoding_message_size,
12966 );
12967 let res = grpc.server_streaming(method, req).await;
12968 Ok(res)
12969 };
12970 Box::pin(fut)
12971 }
12972 _ => {
12973 Box::pin(async move {
12974 let mut response = http::Response::new(
12975 tonic::body::Body::default(),
12976 );
12977 let headers = response.headers_mut();
12978 headers
12979 .insert(
12980 tonic::Status::GRPC_STATUS,
12981 (tonic::Code::Unimplemented as i32).into(),
12982 );
12983 headers
12984 .insert(
12985 http::header::CONTENT_TYPE,
12986 tonic::metadata::GRPC_CONTENT_TYPE,
12987 );
12988 Ok(response)
12989 })
12990 }
12991 }
12992 }
12993 }
12994 impl<T> Clone for RenderServiceServer<T> {
12995 fn clone(&self) -> Self {
12996 let inner = self.inner.clone();
12997 Self {
12998 inner,
12999 accept_compression_encodings: self.accept_compression_encodings,
13000 send_compression_encodings: self.send_compression_encodings,
13001 max_decoding_message_size: self.max_decoding_message_size,
13002 max_encoding_message_size: self.max_encoding_message_size,
13003 }
13004 }
13005 }
13006 pub const SERVICE_NAME: &str = "pidgr.v1.RenderService";
13008 impl<T> tonic::server::NamedService for RenderServiceServer<T> {
13009 const NAME: &'static str = SERVICE_NAME;
13010 }
13011}
13012pub mod replay_service_client {
13014 #![allow(
13015 unused_variables,
13016 dead_code,
13017 missing_docs,
13018 clippy::wildcard_imports,
13019 clippy::let_unit_value,
13020 )]
13021 use tonic::codegen::*;
13022 use tonic::codegen::http::Uri;
13023 #[derive(Debug, Clone)]
13027 pub struct ReplayServiceClient<T> {
13028 inner: tonic::client::Grpc<T>,
13029 }
13030 impl ReplayServiceClient<tonic::transport::Channel> {
13031 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
13033 where
13034 D: TryInto<tonic::transport::Endpoint>,
13035 D::Error: Into<StdError>,
13036 {
13037 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
13038 Ok(Self::new(conn))
13039 }
13040 }
13041 impl<T> ReplayServiceClient<T>
13042 where
13043 T: tonic::client::GrpcService<tonic::body::Body>,
13044 T::Error: Into<StdError>,
13045 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
13046 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
13047 {
13048 pub fn new(inner: T) -> Self {
13049 let inner = tonic::client::Grpc::new(inner);
13050 Self { inner }
13051 }
13052 pub fn with_origin(inner: T, origin: Uri) -> Self {
13053 let inner = tonic::client::Grpc::with_origin(inner, origin);
13054 Self { inner }
13055 }
13056 pub fn with_interceptor<F>(
13057 inner: T,
13058 interceptor: F,
13059 ) -> ReplayServiceClient<InterceptedService<T, F>>
13060 where
13061 F: tonic::service::Interceptor,
13062 T::ResponseBody: Default,
13063 T: tonic::codegen::Service<
13064 http::Request<tonic::body::Body>,
13065 Response = http::Response<
13066 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
13067 >,
13068 >,
13069 <T as tonic::codegen::Service<
13070 http::Request<tonic::body::Body>,
13071 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
13072 {
13073 ReplayServiceClient::new(InterceptedService::new(inner, interceptor))
13074 }
13075 #[must_use]
13080 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13081 self.inner = self.inner.send_compressed(encoding);
13082 self
13083 }
13084 #[must_use]
13086 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13087 self.inner = self.inner.accept_compressed(encoding);
13088 self
13089 }
13090 #[must_use]
13094 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13095 self.inner = self.inner.max_decoding_message_size(limit);
13096 self
13097 }
13098 #[must_use]
13102 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13103 self.inner = self.inner.max_encoding_message_size(limit);
13104 self
13105 }
13106 pub async fn list_session_recordings(
13110 &mut self,
13111 request: impl tonic::IntoRequest<super::ListSessionRecordingsRequest>,
13112 ) -> std::result::Result<
13113 tonic::Response<super::ListSessionRecordingsResponse>,
13114 tonic::Status,
13115 > {
13116 self.inner
13117 .ready()
13118 .await
13119 .map_err(|e| {
13120 tonic::Status::unknown(
13121 format!("Service was not ready: {}", e.into()),
13122 )
13123 })?;
13124 let codec = tonic_prost::ProstCodec::default();
13125 let path = http::uri::PathAndQuery::from_static(
13126 "/pidgr.v1.ReplayService/ListSessionRecordings",
13127 );
13128 let mut req = request.into_request();
13129 req.extensions_mut()
13130 .insert(
13131 GrpcMethod::new("pidgr.v1.ReplayService", "ListSessionRecordings"),
13132 );
13133 self.inner.unary(req, path, codec).await
13134 }
13135 pub async fn get_session_snapshots(
13139 &mut self,
13140 request: impl tonic::IntoRequest<super::GetSessionSnapshotsRequest>,
13141 ) -> std::result::Result<
13142 tonic::Response<super::GetSessionSnapshotsResponse>,
13143 tonic::Status,
13144 > {
13145 self.inner
13146 .ready()
13147 .await
13148 .map_err(|e| {
13149 tonic::Status::unknown(
13150 format!("Service was not ready: {}", e.into()),
13151 )
13152 })?;
13153 let codec = tonic_prost::ProstCodec::default();
13154 let path = http::uri::PathAndQuery::from_static(
13155 "/pidgr.v1.ReplayService/GetSessionSnapshots",
13156 );
13157 let mut req = request.into_request();
13158 req.extensions_mut()
13159 .insert(
13160 GrpcMethod::new("pidgr.v1.ReplayService", "GetSessionSnapshots"),
13161 );
13162 self.inner.unary(req, path, codec).await
13163 }
13164 }
13165}
13166pub mod replay_service_server {
13168 #![allow(
13169 unused_variables,
13170 dead_code,
13171 missing_docs,
13172 clippy::wildcard_imports,
13173 clippy::let_unit_value,
13174 )]
13175 use tonic::codegen::*;
13176 #[async_trait]
13178 pub trait ReplayService: std::marker::Send + std::marker::Sync + 'static {
13179 async fn list_session_recordings(
13183 &self,
13184 request: tonic::Request<super::ListSessionRecordingsRequest>,
13185 ) -> std::result::Result<
13186 tonic::Response<super::ListSessionRecordingsResponse>,
13187 tonic::Status,
13188 >;
13189 async fn get_session_snapshots(
13193 &self,
13194 request: tonic::Request<super::GetSessionSnapshotsRequest>,
13195 ) -> std::result::Result<
13196 tonic::Response<super::GetSessionSnapshotsResponse>,
13197 tonic::Status,
13198 >;
13199 }
13200 #[derive(Debug)]
13204 pub struct ReplayServiceServer<T> {
13205 inner: Arc<T>,
13206 accept_compression_encodings: EnabledCompressionEncodings,
13207 send_compression_encodings: EnabledCompressionEncodings,
13208 max_decoding_message_size: Option<usize>,
13209 max_encoding_message_size: Option<usize>,
13210 }
13211 impl<T> ReplayServiceServer<T> {
13212 pub fn new(inner: T) -> Self {
13213 Self::from_arc(Arc::new(inner))
13214 }
13215 pub fn from_arc(inner: Arc<T>) -> Self {
13216 Self {
13217 inner,
13218 accept_compression_encodings: Default::default(),
13219 send_compression_encodings: Default::default(),
13220 max_decoding_message_size: None,
13221 max_encoding_message_size: None,
13222 }
13223 }
13224 pub fn with_interceptor<F>(
13225 inner: T,
13226 interceptor: F,
13227 ) -> InterceptedService<Self, F>
13228 where
13229 F: tonic::service::Interceptor,
13230 {
13231 InterceptedService::new(Self::new(inner), interceptor)
13232 }
13233 #[must_use]
13235 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13236 self.accept_compression_encodings.enable(encoding);
13237 self
13238 }
13239 #[must_use]
13241 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13242 self.send_compression_encodings.enable(encoding);
13243 self
13244 }
13245 #[must_use]
13249 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13250 self.max_decoding_message_size = Some(limit);
13251 self
13252 }
13253 #[must_use]
13257 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13258 self.max_encoding_message_size = Some(limit);
13259 self
13260 }
13261 }
13262 impl<T, B> tonic::codegen::Service<http::Request<B>> for ReplayServiceServer<T>
13263 where
13264 T: ReplayService,
13265 B: Body + std::marker::Send + 'static,
13266 B::Error: Into<StdError> + std::marker::Send + 'static,
13267 {
13268 type Response = http::Response<tonic::body::Body>;
13269 type Error = std::convert::Infallible;
13270 type Future = BoxFuture<Self::Response, Self::Error>;
13271 fn poll_ready(
13272 &mut self,
13273 _cx: &mut Context<'_>,
13274 ) -> Poll<std::result::Result<(), Self::Error>> {
13275 Poll::Ready(Ok(()))
13276 }
13277 fn call(&mut self, req: http::Request<B>) -> Self::Future {
13278 match req.uri().path() {
13279 "/pidgr.v1.ReplayService/ListSessionRecordings" => {
13280 #[allow(non_camel_case_types)]
13281 struct ListSessionRecordingsSvc<T: ReplayService>(pub Arc<T>);
13282 impl<
13283 T: ReplayService,
13284 > tonic::server::UnaryService<super::ListSessionRecordingsRequest>
13285 for ListSessionRecordingsSvc<T> {
13286 type Response = super::ListSessionRecordingsResponse;
13287 type Future = BoxFuture<
13288 tonic::Response<Self::Response>,
13289 tonic::Status,
13290 >;
13291 fn call(
13292 &mut self,
13293 request: tonic::Request<super::ListSessionRecordingsRequest>,
13294 ) -> Self::Future {
13295 let inner = Arc::clone(&self.0);
13296 let fut = async move {
13297 <T as ReplayService>::list_session_recordings(
13298 &inner,
13299 request,
13300 )
13301 .await
13302 };
13303 Box::pin(fut)
13304 }
13305 }
13306 let accept_compression_encodings = self.accept_compression_encodings;
13307 let send_compression_encodings = self.send_compression_encodings;
13308 let max_decoding_message_size = self.max_decoding_message_size;
13309 let max_encoding_message_size = self.max_encoding_message_size;
13310 let inner = self.inner.clone();
13311 let fut = async move {
13312 let method = ListSessionRecordingsSvc(inner);
13313 let codec = tonic_prost::ProstCodec::default();
13314 let mut grpc = tonic::server::Grpc::new(codec)
13315 .apply_compression_config(
13316 accept_compression_encodings,
13317 send_compression_encodings,
13318 )
13319 .apply_max_message_size_config(
13320 max_decoding_message_size,
13321 max_encoding_message_size,
13322 );
13323 let res = grpc.unary(method, req).await;
13324 Ok(res)
13325 };
13326 Box::pin(fut)
13327 }
13328 "/pidgr.v1.ReplayService/GetSessionSnapshots" => {
13329 #[allow(non_camel_case_types)]
13330 struct GetSessionSnapshotsSvc<T: ReplayService>(pub Arc<T>);
13331 impl<
13332 T: ReplayService,
13333 > tonic::server::UnaryService<super::GetSessionSnapshotsRequest>
13334 for GetSessionSnapshotsSvc<T> {
13335 type Response = super::GetSessionSnapshotsResponse;
13336 type Future = BoxFuture<
13337 tonic::Response<Self::Response>,
13338 tonic::Status,
13339 >;
13340 fn call(
13341 &mut self,
13342 request: tonic::Request<super::GetSessionSnapshotsRequest>,
13343 ) -> Self::Future {
13344 let inner = Arc::clone(&self.0);
13345 let fut = async move {
13346 <T as ReplayService>::get_session_snapshots(&inner, request)
13347 .await
13348 };
13349 Box::pin(fut)
13350 }
13351 }
13352 let accept_compression_encodings = self.accept_compression_encodings;
13353 let send_compression_encodings = self.send_compression_encodings;
13354 let max_decoding_message_size = self.max_decoding_message_size;
13355 let max_encoding_message_size = self.max_encoding_message_size;
13356 let inner = self.inner.clone();
13357 let fut = async move {
13358 let method = GetSessionSnapshotsSvc(inner);
13359 let codec = tonic_prost::ProstCodec::default();
13360 let mut grpc = tonic::server::Grpc::new(codec)
13361 .apply_compression_config(
13362 accept_compression_encodings,
13363 send_compression_encodings,
13364 )
13365 .apply_max_message_size_config(
13366 max_decoding_message_size,
13367 max_encoding_message_size,
13368 );
13369 let res = grpc.unary(method, req).await;
13370 Ok(res)
13371 };
13372 Box::pin(fut)
13373 }
13374 _ => {
13375 Box::pin(async move {
13376 let mut response = http::Response::new(
13377 tonic::body::Body::default(),
13378 );
13379 let headers = response.headers_mut();
13380 headers
13381 .insert(
13382 tonic::Status::GRPC_STATUS,
13383 (tonic::Code::Unimplemented as i32).into(),
13384 );
13385 headers
13386 .insert(
13387 http::header::CONTENT_TYPE,
13388 tonic::metadata::GRPC_CONTENT_TYPE,
13389 );
13390 Ok(response)
13391 })
13392 }
13393 }
13394 }
13395 }
13396 impl<T> Clone for ReplayServiceServer<T> {
13397 fn clone(&self) -> Self {
13398 let inner = self.inner.clone();
13399 Self {
13400 inner,
13401 accept_compression_encodings: self.accept_compression_encodings,
13402 send_compression_encodings: self.send_compression_encodings,
13403 max_decoding_message_size: self.max_decoding_message_size,
13404 max_encoding_message_size: self.max_encoding_message_size,
13405 }
13406 }
13407 }
13408 pub const SERVICE_NAME: &str = "pidgr.v1.ReplayService";
13410 impl<T> tonic::server::NamedService for ReplayServiceServer<T> {
13411 const NAME: &'static str = SERVICE_NAME;
13412 }
13413}
13414pub mod role_service_client {
13416 #![allow(
13417 unused_variables,
13418 dead_code,
13419 missing_docs,
13420 clippy::wildcard_imports,
13421 clippy::let_unit_value,
13422 )]
13423 use tonic::codegen::*;
13424 use tonic::codegen::http::Uri;
13425 #[derive(Debug, Clone)]
13429 pub struct RoleServiceClient<T> {
13430 inner: tonic::client::Grpc<T>,
13431 }
13432 impl RoleServiceClient<tonic::transport::Channel> {
13433 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
13435 where
13436 D: TryInto<tonic::transport::Endpoint>,
13437 D::Error: Into<StdError>,
13438 {
13439 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
13440 Ok(Self::new(conn))
13441 }
13442 }
13443 impl<T> RoleServiceClient<T>
13444 where
13445 T: tonic::client::GrpcService<tonic::body::Body>,
13446 T::Error: Into<StdError>,
13447 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
13448 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
13449 {
13450 pub fn new(inner: T) -> Self {
13451 let inner = tonic::client::Grpc::new(inner);
13452 Self { inner }
13453 }
13454 pub fn with_origin(inner: T, origin: Uri) -> Self {
13455 let inner = tonic::client::Grpc::with_origin(inner, origin);
13456 Self { inner }
13457 }
13458 pub fn with_interceptor<F>(
13459 inner: T,
13460 interceptor: F,
13461 ) -> RoleServiceClient<InterceptedService<T, F>>
13462 where
13463 F: tonic::service::Interceptor,
13464 T::ResponseBody: Default,
13465 T: tonic::codegen::Service<
13466 http::Request<tonic::body::Body>,
13467 Response = http::Response<
13468 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
13469 >,
13470 >,
13471 <T as tonic::codegen::Service<
13472 http::Request<tonic::body::Body>,
13473 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
13474 {
13475 RoleServiceClient::new(InterceptedService::new(inner, interceptor))
13476 }
13477 #[must_use]
13482 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13483 self.inner = self.inner.send_compressed(encoding);
13484 self
13485 }
13486 #[must_use]
13488 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13489 self.inner = self.inner.accept_compressed(encoding);
13490 self
13491 }
13492 #[must_use]
13496 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13497 self.inner = self.inner.max_decoding_message_size(limit);
13498 self
13499 }
13500 #[must_use]
13504 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13505 self.inner = self.inner.max_encoding_message_size(limit);
13506 self
13507 }
13508 pub async fn list_roles(
13512 &mut self,
13513 request: impl tonic::IntoRequest<super::ListRolesRequest>,
13514 ) -> std::result::Result<
13515 tonic::Response<super::ListRolesResponse>,
13516 tonic::Status,
13517 > {
13518 self.inner
13519 .ready()
13520 .await
13521 .map_err(|e| {
13522 tonic::Status::unknown(
13523 format!("Service was not ready: {}", e.into()),
13524 )
13525 })?;
13526 let codec = tonic_prost::ProstCodec::default();
13527 let path = http::uri::PathAndQuery::from_static(
13528 "/pidgr.v1.RoleService/ListRoles",
13529 );
13530 let mut req = request.into_request();
13531 req.extensions_mut()
13532 .insert(GrpcMethod::new("pidgr.v1.RoleService", "ListRoles"));
13533 self.inner.unary(req, path, codec).await
13534 }
13535 pub async fn create_role(
13540 &mut self,
13541 request: impl tonic::IntoRequest<super::CreateRoleRequest>,
13542 ) -> std::result::Result<
13543 tonic::Response<super::CreateRoleResponse>,
13544 tonic::Status,
13545 > {
13546 self.inner
13547 .ready()
13548 .await
13549 .map_err(|e| {
13550 tonic::Status::unknown(
13551 format!("Service was not ready: {}", e.into()),
13552 )
13553 })?;
13554 let codec = tonic_prost::ProstCodec::default();
13555 let path = http::uri::PathAndQuery::from_static(
13556 "/pidgr.v1.RoleService/CreateRole",
13557 );
13558 let mut req = request.into_request();
13559 req.extensions_mut()
13560 .insert(GrpcMethod::new("pidgr.v1.RoleService", "CreateRole"));
13561 self.inner.unary(req, path, codec).await
13562 }
13563 pub async fn update_role(
13568 &mut self,
13569 request: impl tonic::IntoRequest<super::UpdateRoleRequest>,
13570 ) -> std::result::Result<
13571 tonic::Response<super::UpdateRoleResponse>,
13572 tonic::Status,
13573 > {
13574 self.inner
13575 .ready()
13576 .await
13577 .map_err(|e| {
13578 tonic::Status::unknown(
13579 format!("Service was not ready: {}", e.into()),
13580 )
13581 })?;
13582 let codec = tonic_prost::ProstCodec::default();
13583 let path = http::uri::PathAndQuery::from_static(
13584 "/pidgr.v1.RoleService/UpdateRole",
13585 );
13586 let mut req = request.into_request();
13587 req.extensions_mut()
13588 .insert(GrpcMethod::new("pidgr.v1.RoleService", "UpdateRole"));
13589 self.inner.unary(req, path, codec).await
13590 }
13591 pub async fn delete_role(
13596 &mut self,
13597 request: impl tonic::IntoRequest<super::DeleteRoleRequest>,
13598 ) -> std::result::Result<
13599 tonic::Response<super::DeleteRoleResponse>,
13600 tonic::Status,
13601 > {
13602 self.inner
13603 .ready()
13604 .await
13605 .map_err(|e| {
13606 tonic::Status::unknown(
13607 format!("Service was not ready: {}", e.into()),
13608 )
13609 })?;
13610 let codec = tonic_prost::ProstCodec::default();
13611 let path = http::uri::PathAndQuery::from_static(
13612 "/pidgr.v1.RoleService/DeleteRole",
13613 );
13614 let mut req = request.into_request();
13615 req.extensions_mut()
13616 .insert(GrpcMethod::new("pidgr.v1.RoleService", "DeleteRole"));
13617 self.inner.unary(req, path, codec).await
13618 }
13619 }
13620}
13621pub mod role_service_server {
13623 #![allow(
13624 unused_variables,
13625 dead_code,
13626 missing_docs,
13627 clippy::wildcard_imports,
13628 clippy::let_unit_value,
13629 )]
13630 use tonic::codegen::*;
13631 #[async_trait]
13633 pub trait RoleService: std::marker::Send + std::marker::Sync + 'static {
13634 async fn list_roles(
13638 &self,
13639 request: tonic::Request<super::ListRolesRequest>,
13640 ) -> std::result::Result<
13641 tonic::Response<super::ListRolesResponse>,
13642 tonic::Status,
13643 >;
13644 async fn create_role(
13649 &self,
13650 request: tonic::Request<super::CreateRoleRequest>,
13651 ) -> std::result::Result<
13652 tonic::Response<super::CreateRoleResponse>,
13653 tonic::Status,
13654 >;
13655 async fn update_role(
13660 &self,
13661 request: tonic::Request<super::UpdateRoleRequest>,
13662 ) -> std::result::Result<
13663 tonic::Response<super::UpdateRoleResponse>,
13664 tonic::Status,
13665 >;
13666 async fn delete_role(
13671 &self,
13672 request: tonic::Request<super::DeleteRoleRequest>,
13673 ) -> std::result::Result<
13674 tonic::Response<super::DeleteRoleResponse>,
13675 tonic::Status,
13676 >;
13677 }
13678 #[derive(Debug)]
13682 pub struct RoleServiceServer<T> {
13683 inner: Arc<T>,
13684 accept_compression_encodings: EnabledCompressionEncodings,
13685 send_compression_encodings: EnabledCompressionEncodings,
13686 max_decoding_message_size: Option<usize>,
13687 max_encoding_message_size: Option<usize>,
13688 }
13689 impl<T> RoleServiceServer<T> {
13690 pub fn new(inner: T) -> Self {
13691 Self::from_arc(Arc::new(inner))
13692 }
13693 pub fn from_arc(inner: Arc<T>) -> Self {
13694 Self {
13695 inner,
13696 accept_compression_encodings: Default::default(),
13697 send_compression_encodings: Default::default(),
13698 max_decoding_message_size: None,
13699 max_encoding_message_size: None,
13700 }
13701 }
13702 pub fn with_interceptor<F>(
13703 inner: T,
13704 interceptor: F,
13705 ) -> InterceptedService<Self, F>
13706 where
13707 F: tonic::service::Interceptor,
13708 {
13709 InterceptedService::new(Self::new(inner), interceptor)
13710 }
13711 #[must_use]
13713 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13714 self.accept_compression_encodings.enable(encoding);
13715 self
13716 }
13717 #[must_use]
13719 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13720 self.send_compression_encodings.enable(encoding);
13721 self
13722 }
13723 #[must_use]
13727 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13728 self.max_decoding_message_size = Some(limit);
13729 self
13730 }
13731 #[must_use]
13735 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13736 self.max_encoding_message_size = Some(limit);
13737 self
13738 }
13739 }
13740 impl<T, B> tonic::codegen::Service<http::Request<B>> for RoleServiceServer<T>
13741 where
13742 T: RoleService,
13743 B: Body + std::marker::Send + 'static,
13744 B::Error: Into<StdError> + std::marker::Send + 'static,
13745 {
13746 type Response = http::Response<tonic::body::Body>;
13747 type Error = std::convert::Infallible;
13748 type Future = BoxFuture<Self::Response, Self::Error>;
13749 fn poll_ready(
13750 &mut self,
13751 _cx: &mut Context<'_>,
13752 ) -> Poll<std::result::Result<(), Self::Error>> {
13753 Poll::Ready(Ok(()))
13754 }
13755 fn call(&mut self, req: http::Request<B>) -> Self::Future {
13756 match req.uri().path() {
13757 "/pidgr.v1.RoleService/ListRoles" => {
13758 #[allow(non_camel_case_types)]
13759 struct ListRolesSvc<T: RoleService>(pub Arc<T>);
13760 impl<
13761 T: RoleService,
13762 > tonic::server::UnaryService<super::ListRolesRequest>
13763 for ListRolesSvc<T> {
13764 type Response = super::ListRolesResponse;
13765 type Future = BoxFuture<
13766 tonic::Response<Self::Response>,
13767 tonic::Status,
13768 >;
13769 fn call(
13770 &mut self,
13771 request: tonic::Request<super::ListRolesRequest>,
13772 ) -> Self::Future {
13773 let inner = Arc::clone(&self.0);
13774 let fut = async move {
13775 <T as RoleService>::list_roles(&inner, request).await
13776 };
13777 Box::pin(fut)
13778 }
13779 }
13780 let accept_compression_encodings = self.accept_compression_encodings;
13781 let send_compression_encodings = self.send_compression_encodings;
13782 let max_decoding_message_size = self.max_decoding_message_size;
13783 let max_encoding_message_size = self.max_encoding_message_size;
13784 let inner = self.inner.clone();
13785 let fut = async move {
13786 let method = ListRolesSvc(inner);
13787 let codec = tonic_prost::ProstCodec::default();
13788 let mut grpc = tonic::server::Grpc::new(codec)
13789 .apply_compression_config(
13790 accept_compression_encodings,
13791 send_compression_encodings,
13792 )
13793 .apply_max_message_size_config(
13794 max_decoding_message_size,
13795 max_encoding_message_size,
13796 );
13797 let res = grpc.unary(method, req).await;
13798 Ok(res)
13799 };
13800 Box::pin(fut)
13801 }
13802 "/pidgr.v1.RoleService/CreateRole" => {
13803 #[allow(non_camel_case_types)]
13804 struct CreateRoleSvc<T: RoleService>(pub Arc<T>);
13805 impl<
13806 T: RoleService,
13807 > tonic::server::UnaryService<super::CreateRoleRequest>
13808 for CreateRoleSvc<T> {
13809 type Response = super::CreateRoleResponse;
13810 type Future = BoxFuture<
13811 tonic::Response<Self::Response>,
13812 tonic::Status,
13813 >;
13814 fn call(
13815 &mut self,
13816 request: tonic::Request<super::CreateRoleRequest>,
13817 ) -> Self::Future {
13818 let inner = Arc::clone(&self.0);
13819 let fut = async move {
13820 <T as RoleService>::create_role(&inner, request).await
13821 };
13822 Box::pin(fut)
13823 }
13824 }
13825 let accept_compression_encodings = self.accept_compression_encodings;
13826 let send_compression_encodings = self.send_compression_encodings;
13827 let max_decoding_message_size = self.max_decoding_message_size;
13828 let max_encoding_message_size = self.max_encoding_message_size;
13829 let inner = self.inner.clone();
13830 let fut = async move {
13831 let method = CreateRoleSvc(inner);
13832 let codec = tonic_prost::ProstCodec::default();
13833 let mut grpc = tonic::server::Grpc::new(codec)
13834 .apply_compression_config(
13835 accept_compression_encodings,
13836 send_compression_encodings,
13837 )
13838 .apply_max_message_size_config(
13839 max_decoding_message_size,
13840 max_encoding_message_size,
13841 );
13842 let res = grpc.unary(method, req).await;
13843 Ok(res)
13844 };
13845 Box::pin(fut)
13846 }
13847 "/pidgr.v1.RoleService/UpdateRole" => {
13848 #[allow(non_camel_case_types)]
13849 struct UpdateRoleSvc<T: RoleService>(pub Arc<T>);
13850 impl<
13851 T: RoleService,
13852 > tonic::server::UnaryService<super::UpdateRoleRequest>
13853 for UpdateRoleSvc<T> {
13854 type Response = super::UpdateRoleResponse;
13855 type Future = BoxFuture<
13856 tonic::Response<Self::Response>,
13857 tonic::Status,
13858 >;
13859 fn call(
13860 &mut self,
13861 request: tonic::Request<super::UpdateRoleRequest>,
13862 ) -> Self::Future {
13863 let inner = Arc::clone(&self.0);
13864 let fut = async move {
13865 <T as RoleService>::update_role(&inner, request).await
13866 };
13867 Box::pin(fut)
13868 }
13869 }
13870 let accept_compression_encodings = self.accept_compression_encodings;
13871 let send_compression_encodings = self.send_compression_encodings;
13872 let max_decoding_message_size = self.max_decoding_message_size;
13873 let max_encoding_message_size = self.max_encoding_message_size;
13874 let inner = self.inner.clone();
13875 let fut = async move {
13876 let method = UpdateRoleSvc(inner);
13877 let codec = tonic_prost::ProstCodec::default();
13878 let mut grpc = tonic::server::Grpc::new(codec)
13879 .apply_compression_config(
13880 accept_compression_encodings,
13881 send_compression_encodings,
13882 )
13883 .apply_max_message_size_config(
13884 max_decoding_message_size,
13885 max_encoding_message_size,
13886 );
13887 let res = grpc.unary(method, req).await;
13888 Ok(res)
13889 };
13890 Box::pin(fut)
13891 }
13892 "/pidgr.v1.RoleService/DeleteRole" => {
13893 #[allow(non_camel_case_types)]
13894 struct DeleteRoleSvc<T: RoleService>(pub Arc<T>);
13895 impl<
13896 T: RoleService,
13897 > tonic::server::UnaryService<super::DeleteRoleRequest>
13898 for DeleteRoleSvc<T> {
13899 type Response = super::DeleteRoleResponse;
13900 type Future = BoxFuture<
13901 tonic::Response<Self::Response>,
13902 tonic::Status,
13903 >;
13904 fn call(
13905 &mut self,
13906 request: tonic::Request<super::DeleteRoleRequest>,
13907 ) -> Self::Future {
13908 let inner = Arc::clone(&self.0);
13909 let fut = async move {
13910 <T as RoleService>::delete_role(&inner, request).await
13911 };
13912 Box::pin(fut)
13913 }
13914 }
13915 let accept_compression_encodings = self.accept_compression_encodings;
13916 let send_compression_encodings = self.send_compression_encodings;
13917 let max_decoding_message_size = self.max_decoding_message_size;
13918 let max_encoding_message_size = self.max_encoding_message_size;
13919 let inner = self.inner.clone();
13920 let fut = async move {
13921 let method = DeleteRoleSvc(inner);
13922 let codec = tonic_prost::ProstCodec::default();
13923 let mut grpc = tonic::server::Grpc::new(codec)
13924 .apply_compression_config(
13925 accept_compression_encodings,
13926 send_compression_encodings,
13927 )
13928 .apply_max_message_size_config(
13929 max_decoding_message_size,
13930 max_encoding_message_size,
13931 );
13932 let res = grpc.unary(method, req).await;
13933 Ok(res)
13934 };
13935 Box::pin(fut)
13936 }
13937 _ => {
13938 Box::pin(async move {
13939 let mut response = http::Response::new(
13940 tonic::body::Body::default(),
13941 );
13942 let headers = response.headers_mut();
13943 headers
13944 .insert(
13945 tonic::Status::GRPC_STATUS,
13946 (tonic::Code::Unimplemented as i32).into(),
13947 );
13948 headers
13949 .insert(
13950 http::header::CONTENT_TYPE,
13951 tonic::metadata::GRPC_CONTENT_TYPE,
13952 );
13953 Ok(response)
13954 })
13955 }
13956 }
13957 }
13958 }
13959 impl<T> Clone for RoleServiceServer<T> {
13960 fn clone(&self) -> Self {
13961 let inner = self.inner.clone();
13962 Self {
13963 inner,
13964 accept_compression_encodings: self.accept_compression_encodings,
13965 send_compression_encodings: self.send_compression_encodings,
13966 max_decoding_message_size: self.max_decoding_message_size,
13967 max_encoding_message_size: self.max_encoding_message_size,
13968 }
13969 }
13970 }
13971 pub const SERVICE_NAME: &str = "pidgr.v1.RoleService";
13973 impl<T> tonic::server::NamedService for RoleServiceServer<T> {
13974 const NAME: &'static str = SERVICE_NAME;
13975 }
13976}
13977pub mod sso_service_client {
13979 #![allow(
13980 unused_variables,
13981 dead_code,
13982 missing_docs,
13983 clippy::wildcard_imports,
13984 clippy::let_unit_value,
13985 )]
13986 use tonic::codegen::*;
13987 use tonic::codegen::http::Uri;
13988 #[derive(Debug, Clone)]
13991 pub struct SsoServiceClient<T> {
13992 inner: tonic::client::Grpc<T>,
13993 }
13994 impl SsoServiceClient<tonic::transport::Channel> {
13995 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
13997 where
13998 D: TryInto<tonic::transport::Endpoint>,
13999 D::Error: Into<StdError>,
14000 {
14001 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
14002 Ok(Self::new(conn))
14003 }
14004 }
14005 impl<T> SsoServiceClient<T>
14006 where
14007 T: tonic::client::GrpcService<tonic::body::Body>,
14008 T::Error: Into<StdError>,
14009 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
14010 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
14011 {
14012 pub fn new(inner: T) -> Self {
14013 let inner = tonic::client::Grpc::new(inner);
14014 Self { inner }
14015 }
14016 pub fn with_origin(inner: T, origin: Uri) -> Self {
14017 let inner = tonic::client::Grpc::with_origin(inner, origin);
14018 Self { inner }
14019 }
14020 pub fn with_interceptor<F>(
14021 inner: T,
14022 interceptor: F,
14023 ) -> SsoServiceClient<InterceptedService<T, F>>
14024 where
14025 F: tonic::service::Interceptor,
14026 T::ResponseBody: Default,
14027 T: tonic::codegen::Service<
14028 http::Request<tonic::body::Body>,
14029 Response = http::Response<
14030 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
14031 >,
14032 >,
14033 <T as tonic::codegen::Service<
14034 http::Request<tonic::body::Body>,
14035 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
14036 {
14037 SsoServiceClient::new(InterceptedService::new(inner, interceptor))
14038 }
14039 #[must_use]
14044 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
14045 self.inner = self.inner.send_compressed(encoding);
14046 self
14047 }
14048 #[must_use]
14050 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
14051 self.inner = self.inner.accept_compressed(encoding);
14052 self
14053 }
14054 #[must_use]
14058 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
14059 self.inner = self.inner.max_decoding_message_size(limit);
14060 self
14061 }
14062 #[must_use]
14066 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
14067 self.inner = self.inner.max_encoding_message_size(limit);
14068 self
14069 }
14070 pub async fn check_sso_by_domain(
14075 &mut self,
14076 request: impl tonic::IntoRequest<super::CheckSsoByDomainRequest>,
14077 ) -> std::result::Result<
14078 tonic::Response<super::CheckSsoByDomainResponse>,
14079 tonic::Status,
14080 > {
14081 self.inner
14082 .ready()
14083 .await
14084 .map_err(|e| {
14085 tonic::Status::unknown(
14086 format!("Service was not ready: {}", e.into()),
14087 )
14088 })?;
14089 let codec = tonic_prost::ProstCodec::default();
14090 let path = http::uri::PathAndQuery::from_static(
14091 "/pidgr.v1.SSOService/CheckSSOByDomain",
14092 );
14093 let mut req = request.into_request();
14094 req.extensions_mut()
14095 .insert(GrpcMethod::new("pidgr.v1.SSOService", "CheckSSOByDomain"));
14096 self.inner.unary(req, path, codec).await
14097 }
14098 pub async fn create_sso_provider(
14104 &mut self,
14105 request: impl tonic::IntoRequest<super::CreateSsoProviderRequest>,
14106 ) -> std::result::Result<
14107 tonic::Response<super::CreateSsoProviderResponse>,
14108 tonic::Status,
14109 > {
14110 self.inner
14111 .ready()
14112 .await
14113 .map_err(|e| {
14114 tonic::Status::unknown(
14115 format!("Service was not ready: {}", e.into()),
14116 )
14117 })?;
14118 let codec = tonic_prost::ProstCodec::default();
14119 let path = http::uri::PathAndQuery::from_static(
14120 "/pidgr.v1.SSOService/CreateSSOProvider",
14121 );
14122 let mut req = request.into_request();
14123 req.extensions_mut()
14124 .insert(GrpcMethod::new("pidgr.v1.SSOService", "CreateSSOProvider"));
14125 self.inner.unary(req, path, codec).await
14126 }
14127 pub async fn get_sso_provider(
14131 &mut self,
14132 request: impl tonic::IntoRequest<super::GetSsoProviderRequest>,
14133 ) -> std::result::Result<
14134 tonic::Response<super::GetSsoProviderResponse>,
14135 tonic::Status,
14136 > {
14137 self.inner
14138 .ready()
14139 .await
14140 .map_err(|e| {
14141 tonic::Status::unknown(
14142 format!("Service was not ready: {}", e.into()),
14143 )
14144 })?;
14145 let codec = tonic_prost::ProstCodec::default();
14146 let path = http::uri::PathAndQuery::from_static(
14147 "/pidgr.v1.SSOService/GetSSOProvider",
14148 );
14149 let mut req = request.into_request();
14150 req.extensions_mut()
14151 .insert(GrpcMethod::new("pidgr.v1.SSOService", "GetSSOProvider"));
14152 self.inner.unary(req, path, codec).await
14153 }
14154 pub async fn delete_sso_provider(
14160 &mut self,
14161 request: impl tonic::IntoRequest<super::DeleteSsoProviderRequest>,
14162 ) -> std::result::Result<
14163 tonic::Response<super::DeleteSsoProviderResponse>,
14164 tonic::Status,
14165 > {
14166 self.inner
14167 .ready()
14168 .await
14169 .map_err(|e| {
14170 tonic::Status::unknown(
14171 format!("Service was not ready: {}", e.into()),
14172 )
14173 })?;
14174 let codec = tonic_prost::ProstCodec::default();
14175 let path = http::uri::PathAndQuery::from_static(
14176 "/pidgr.v1.SSOService/DeleteSSOProvider",
14177 );
14178 let mut req = request.into_request();
14179 req.extensions_mut()
14180 .insert(GrpcMethod::new("pidgr.v1.SSOService", "DeleteSSOProvider"));
14181 self.inner.unary(req, path, codec).await
14182 }
14183 }
14184}
14185pub mod sso_service_server {
14187 #![allow(
14188 unused_variables,
14189 dead_code,
14190 missing_docs,
14191 clippy::wildcard_imports,
14192 clippy::let_unit_value,
14193 )]
14194 use tonic::codegen::*;
14195 #[async_trait]
14197 pub trait SsoService: std::marker::Send + std::marker::Sync + 'static {
14198 async fn check_sso_by_domain(
14203 &self,
14204 request: tonic::Request<super::CheckSsoByDomainRequest>,
14205 ) -> std::result::Result<
14206 tonic::Response<super::CheckSsoByDomainResponse>,
14207 tonic::Status,
14208 >;
14209 async fn create_sso_provider(
14215 &self,
14216 request: tonic::Request<super::CreateSsoProviderRequest>,
14217 ) -> std::result::Result<
14218 tonic::Response<super::CreateSsoProviderResponse>,
14219 tonic::Status,
14220 >;
14221 async fn get_sso_provider(
14225 &self,
14226 request: tonic::Request<super::GetSsoProviderRequest>,
14227 ) -> std::result::Result<
14228 tonic::Response<super::GetSsoProviderResponse>,
14229 tonic::Status,
14230 >;
14231 async fn delete_sso_provider(
14237 &self,
14238 request: tonic::Request<super::DeleteSsoProviderRequest>,
14239 ) -> std::result::Result<
14240 tonic::Response<super::DeleteSsoProviderResponse>,
14241 tonic::Status,
14242 >;
14243 }
14244 #[derive(Debug)]
14247 pub struct SsoServiceServer<T> {
14248 inner: Arc<T>,
14249 accept_compression_encodings: EnabledCompressionEncodings,
14250 send_compression_encodings: EnabledCompressionEncodings,
14251 max_decoding_message_size: Option<usize>,
14252 max_encoding_message_size: Option<usize>,
14253 }
14254 impl<T> SsoServiceServer<T> {
14255 pub fn new(inner: T) -> Self {
14256 Self::from_arc(Arc::new(inner))
14257 }
14258 pub fn from_arc(inner: Arc<T>) -> Self {
14259 Self {
14260 inner,
14261 accept_compression_encodings: Default::default(),
14262 send_compression_encodings: Default::default(),
14263 max_decoding_message_size: None,
14264 max_encoding_message_size: None,
14265 }
14266 }
14267 pub fn with_interceptor<F>(
14268 inner: T,
14269 interceptor: F,
14270 ) -> InterceptedService<Self, F>
14271 where
14272 F: tonic::service::Interceptor,
14273 {
14274 InterceptedService::new(Self::new(inner), interceptor)
14275 }
14276 #[must_use]
14278 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
14279 self.accept_compression_encodings.enable(encoding);
14280 self
14281 }
14282 #[must_use]
14284 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
14285 self.send_compression_encodings.enable(encoding);
14286 self
14287 }
14288 #[must_use]
14292 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
14293 self.max_decoding_message_size = Some(limit);
14294 self
14295 }
14296 #[must_use]
14300 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
14301 self.max_encoding_message_size = Some(limit);
14302 self
14303 }
14304 }
14305 impl<T, B> tonic::codegen::Service<http::Request<B>> for SsoServiceServer<T>
14306 where
14307 T: SsoService,
14308 B: Body + std::marker::Send + 'static,
14309 B::Error: Into<StdError> + std::marker::Send + 'static,
14310 {
14311 type Response = http::Response<tonic::body::Body>;
14312 type Error = std::convert::Infallible;
14313 type Future = BoxFuture<Self::Response, Self::Error>;
14314 fn poll_ready(
14315 &mut self,
14316 _cx: &mut Context<'_>,
14317 ) -> Poll<std::result::Result<(), Self::Error>> {
14318 Poll::Ready(Ok(()))
14319 }
14320 fn call(&mut self, req: http::Request<B>) -> Self::Future {
14321 match req.uri().path() {
14322 "/pidgr.v1.SSOService/CheckSSOByDomain" => {
14323 #[allow(non_camel_case_types)]
14324 struct CheckSSOByDomainSvc<T: SsoService>(pub Arc<T>);
14325 impl<
14326 T: SsoService,
14327 > tonic::server::UnaryService<super::CheckSsoByDomainRequest>
14328 for CheckSSOByDomainSvc<T> {
14329 type Response = super::CheckSsoByDomainResponse;
14330 type Future = BoxFuture<
14331 tonic::Response<Self::Response>,
14332 tonic::Status,
14333 >;
14334 fn call(
14335 &mut self,
14336 request: tonic::Request<super::CheckSsoByDomainRequest>,
14337 ) -> Self::Future {
14338 let inner = Arc::clone(&self.0);
14339 let fut = async move {
14340 <T as SsoService>::check_sso_by_domain(&inner, request)
14341 .await
14342 };
14343 Box::pin(fut)
14344 }
14345 }
14346 let accept_compression_encodings = self.accept_compression_encodings;
14347 let send_compression_encodings = self.send_compression_encodings;
14348 let max_decoding_message_size = self.max_decoding_message_size;
14349 let max_encoding_message_size = self.max_encoding_message_size;
14350 let inner = self.inner.clone();
14351 let fut = async move {
14352 let method = CheckSSOByDomainSvc(inner);
14353 let codec = tonic_prost::ProstCodec::default();
14354 let mut grpc = tonic::server::Grpc::new(codec)
14355 .apply_compression_config(
14356 accept_compression_encodings,
14357 send_compression_encodings,
14358 )
14359 .apply_max_message_size_config(
14360 max_decoding_message_size,
14361 max_encoding_message_size,
14362 );
14363 let res = grpc.unary(method, req).await;
14364 Ok(res)
14365 };
14366 Box::pin(fut)
14367 }
14368 "/pidgr.v1.SSOService/CreateSSOProvider" => {
14369 #[allow(non_camel_case_types)]
14370 struct CreateSSOProviderSvc<T: SsoService>(pub Arc<T>);
14371 impl<
14372 T: SsoService,
14373 > tonic::server::UnaryService<super::CreateSsoProviderRequest>
14374 for CreateSSOProviderSvc<T> {
14375 type Response = super::CreateSsoProviderResponse;
14376 type Future = BoxFuture<
14377 tonic::Response<Self::Response>,
14378 tonic::Status,
14379 >;
14380 fn call(
14381 &mut self,
14382 request: tonic::Request<super::CreateSsoProviderRequest>,
14383 ) -> Self::Future {
14384 let inner = Arc::clone(&self.0);
14385 let fut = async move {
14386 <T as SsoService>::create_sso_provider(&inner, request)
14387 .await
14388 };
14389 Box::pin(fut)
14390 }
14391 }
14392 let accept_compression_encodings = self.accept_compression_encodings;
14393 let send_compression_encodings = self.send_compression_encodings;
14394 let max_decoding_message_size = self.max_decoding_message_size;
14395 let max_encoding_message_size = self.max_encoding_message_size;
14396 let inner = self.inner.clone();
14397 let fut = async move {
14398 let method = CreateSSOProviderSvc(inner);
14399 let codec = tonic_prost::ProstCodec::default();
14400 let mut grpc = tonic::server::Grpc::new(codec)
14401 .apply_compression_config(
14402 accept_compression_encodings,
14403 send_compression_encodings,
14404 )
14405 .apply_max_message_size_config(
14406 max_decoding_message_size,
14407 max_encoding_message_size,
14408 );
14409 let res = grpc.unary(method, req).await;
14410 Ok(res)
14411 };
14412 Box::pin(fut)
14413 }
14414 "/pidgr.v1.SSOService/GetSSOProvider" => {
14415 #[allow(non_camel_case_types)]
14416 struct GetSSOProviderSvc<T: SsoService>(pub Arc<T>);
14417 impl<
14418 T: SsoService,
14419 > tonic::server::UnaryService<super::GetSsoProviderRequest>
14420 for GetSSOProviderSvc<T> {
14421 type Response = super::GetSsoProviderResponse;
14422 type Future = BoxFuture<
14423 tonic::Response<Self::Response>,
14424 tonic::Status,
14425 >;
14426 fn call(
14427 &mut self,
14428 request: tonic::Request<super::GetSsoProviderRequest>,
14429 ) -> Self::Future {
14430 let inner = Arc::clone(&self.0);
14431 let fut = async move {
14432 <T as SsoService>::get_sso_provider(&inner, request).await
14433 };
14434 Box::pin(fut)
14435 }
14436 }
14437 let accept_compression_encodings = self.accept_compression_encodings;
14438 let send_compression_encodings = self.send_compression_encodings;
14439 let max_decoding_message_size = self.max_decoding_message_size;
14440 let max_encoding_message_size = self.max_encoding_message_size;
14441 let inner = self.inner.clone();
14442 let fut = async move {
14443 let method = GetSSOProviderSvc(inner);
14444 let codec = tonic_prost::ProstCodec::default();
14445 let mut grpc = tonic::server::Grpc::new(codec)
14446 .apply_compression_config(
14447 accept_compression_encodings,
14448 send_compression_encodings,
14449 )
14450 .apply_max_message_size_config(
14451 max_decoding_message_size,
14452 max_encoding_message_size,
14453 );
14454 let res = grpc.unary(method, req).await;
14455 Ok(res)
14456 };
14457 Box::pin(fut)
14458 }
14459 "/pidgr.v1.SSOService/DeleteSSOProvider" => {
14460 #[allow(non_camel_case_types)]
14461 struct DeleteSSOProviderSvc<T: SsoService>(pub Arc<T>);
14462 impl<
14463 T: SsoService,
14464 > tonic::server::UnaryService<super::DeleteSsoProviderRequest>
14465 for DeleteSSOProviderSvc<T> {
14466 type Response = super::DeleteSsoProviderResponse;
14467 type Future = BoxFuture<
14468 tonic::Response<Self::Response>,
14469 tonic::Status,
14470 >;
14471 fn call(
14472 &mut self,
14473 request: tonic::Request<super::DeleteSsoProviderRequest>,
14474 ) -> Self::Future {
14475 let inner = Arc::clone(&self.0);
14476 let fut = async move {
14477 <T as SsoService>::delete_sso_provider(&inner, request)
14478 .await
14479 };
14480 Box::pin(fut)
14481 }
14482 }
14483 let accept_compression_encodings = self.accept_compression_encodings;
14484 let send_compression_encodings = self.send_compression_encodings;
14485 let max_decoding_message_size = self.max_decoding_message_size;
14486 let max_encoding_message_size = self.max_encoding_message_size;
14487 let inner = self.inner.clone();
14488 let fut = async move {
14489 let method = DeleteSSOProviderSvc(inner);
14490 let codec = tonic_prost::ProstCodec::default();
14491 let mut grpc = tonic::server::Grpc::new(codec)
14492 .apply_compression_config(
14493 accept_compression_encodings,
14494 send_compression_encodings,
14495 )
14496 .apply_max_message_size_config(
14497 max_decoding_message_size,
14498 max_encoding_message_size,
14499 );
14500 let res = grpc.unary(method, req).await;
14501 Ok(res)
14502 };
14503 Box::pin(fut)
14504 }
14505 _ => {
14506 Box::pin(async move {
14507 let mut response = http::Response::new(
14508 tonic::body::Body::default(),
14509 );
14510 let headers = response.headers_mut();
14511 headers
14512 .insert(
14513 tonic::Status::GRPC_STATUS,
14514 (tonic::Code::Unimplemented as i32).into(),
14515 );
14516 headers
14517 .insert(
14518 http::header::CONTENT_TYPE,
14519 tonic::metadata::GRPC_CONTENT_TYPE,
14520 );
14521 Ok(response)
14522 })
14523 }
14524 }
14525 }
14526 }
14527 impl<T> Clone for SsoServiceServer<T> {
14528 fn clone(&self) -> Self {
14529 let inner = self.inner.clone();
14530 Self {
14531 inner,
14532 accept_compression_encodings: self.accept_compression_encodings,
14533 send_compression_encodings: self.send_compression_encodings,
14534 max_decoding_message_size: self.max_decoding_message_size,
14535 max_encoding_message_size: self.max_encoding_message_size,
14536 }
14537 }
14538 }
14539 pub const SERVICE_NAME: &str = "pidgr.v1.SSOService";
14541 impl<T> tonic::server::NamedService for SsoServiceServer<T> {
14542 const NAME: &'static str = SERVICE_NAME;
14543 }
14544}
14545pub mod team_service_client {
14547 #![allow(
14548 unused_variables,
14549 dead_code,
14550 missing_docs,
14551 clippy::wildcard_imports,
14552 clippy::let_unit_value,
14553 )]
14554 use tonic::codegen::*;
14555 use tonic::codegen::http::Uri;
14556 #[derive(Debug, Clone)]
14561 pub struct TeamServiceClient<T> {
14562 inner: tonic::client::Grpc<T>,
14563 }
14564 impl TeamServiceClient<tonic::transport::Channel> {
14565 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
14567 where
14568 D: TryInto<tonic::transport::Endpoint>,
14569 D::Error: Into<StdError>,
14570 {
14571 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
14572 Ok(Self::new(conn))
14573 }
14574 }
14575 impl<T> TeamServiceClient<T>
14576 where
14577 T: tonic::client::GrpcService<tonic::body::Body>,
14578 T::Error: Into<StdError>,
14579 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
14580 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
14581 {
14582 pub fn new(inner: T) -> Self {
14583 let inner = tonic::client::Grpc::new(inner);
14584 Self { inner }
14585 }
14586 pub fn with_origin(inner: T, origin: Uri) -> Self {
14587 let inner = tonic::client::Grpc::with_origin(inner, origin);
14588 Self { inner }
14589 }
14590 pub fn with_interceptor<F>(
14591 inner: T,
14592 interceptor: F,
14593 ) -> TeamServiceClient<InterceptedService<T, F>>
14594 where
14595 F: tonic::service::Interceptor,
14596 T::ResponseBody: Default,
14597 T: tonic::codegen::Service<
14598 http::Request<tonic::body::Body>,
14599 Response = http::Response<
14600 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
14601 >,
14602 >,
14603 <T as tonic::codegen::Service<
14604 http::Request<tonic::body::Body>,
14605 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
14606 {
14607 TeamServiceClient::new(InterceptedService::new(inner, interceptor))
14608 }
14609 #[must_use]
14614 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
14615 self.inner = self.inner.send_compressed(encoding);
14616 self
14617 }
14618 #[must_use]
14620 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
14621 self.inner = self.inner.accept_compressed(encoding);
14622 self
14623 }
14624 #[must_use]
14628 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
14629 self.inner = self.inner.max_decoding_message_size(limit);
14630 self
14631 }
14632 #[must_use]
14636 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
14637 self.inner = self.inner.max_encoding_message_size(limit);
14638 self
14639 }
14640 pub async fn create_team(
14644 &mut self,
14645 request: impl tonic::IntoRequest<super::CreateTeamRequest>,
14646 ) -> std::result::Result<
14647 tonic::Response<super::CreateTeamResponse>,
14648 tonic::Status,
14649 > {
14650 self.inner
14651 .ready()
14652 .await
14653 .map_err(|e| {
14654 tonic::Status::unknown(
14655 format!("Service was not ready: {}", e.into()),
14656 )
14657 })?;
14658 let codec = tonic_prost::ProstCodec::default();
14659 let path = http::uri::PathAndQuery::from_static(
14660 "/pidgr.v1.TeamService/CreateTeam",
14661 );
14662 let mut req = request.into_request();
14663 req.extensions_mut()
14664 .insert(GrpcMethod::new("pidgr.v1.TeamService", "CreateTeam"));
14665 self.inner.unary(req, path, codec).await
14666 }
14667 pub async fn get_team(
14672 &mut self,
14673 request: impl tonic::IntoRequest<super::GetTeamRequest>,
14674 ) -> std::result::Result<
14675 tonic::Response<super::GetTeamResponse>,
14676 tonic::Status,
14677 > {
14678 self.inner
14679 .ready()
14680 .await
14681 .map_err(|e| {
14682 tonic::Status::unknown(
14683 format!("Service was not ready: {}", e.into()),
14684 )
14685 })?;
14686 let codec = tonic_prost::ProstCodec::default();
14687 let path = http::uri::PathAndQuery::from_static(
14688 "/pidgr.v1.TeamService/GetTeam",
14689 );
14690 let mut req = request.into_request();
14691 req.extensions_mut()
14692 .insert(GrpcMethod::new("pidgr.v1.TeamService", "GetTeam"));
14693 self.inner.unary(req, path, codec).await
14694 }
14695 pub async fn list_teams(
14699 &mut self,
14700 request: impl tonic::IntoRequest<super::ListTeamsRequest>,
14701 ) -> std::result::Result<
14702 tonic::Response<super::ListTeamsResponse>,
14703 tonic::Status,
14704 > {
14705 self.inner
14706 .ready()
14707 .await
14708 .map_err(|e| {
14709 tonic::Status::unknown(
14710 format!("Service was not ready: {}", e.into()),
14711 )
14712 })?;
14713 let codec = tonic_prost::ProstCodec::default();
14714 let path = http::uri::PathAndQuery::from_static(
14715 "/pidgr.v1.TeamService/ListTeams",
14716 );
14717 let mut req = request.into_request();
14718 req.extensions_mut()
14719 .insert(GrpcMethod::new("pidgr.v1.TeamService", "ListTeams"));
14720 self.inner.unary(req, path, codec).await
14721 }
14722 pub async fn update_team(
14726 &mut self,
14727 request: impl tonic::IntoRequest<super::UpdateTeamRequest>,
14728 ) -> std::result::Result<
14729 tonic::Response<super::UpdateTeamResponse>,
14730 tonic::Status,
14731 > {
14732 self.inner
14733 .ready()
14734 .await
14735 .map_err(|e| {
14736 tonic::Status::unknown(
14737 format!("Service was not ready: {}", e.into()),
14738 )
14739 })?;
14740 let codec = tonic_prost::ProstCodec::default();
14741 let path = http::uri::PathAndQuery::from_static(
14742 "/pidgr.v1.TeamService/UpdateTeam",
14743 );
14744 let mut req = request.into_request();
14745 req.extensions_mut()
14746 .insert(GrpcMethod::new("pidgr.v1.TeamService", "UpdateTeam"));
14747 self.inner.unary(req, path, codec).await
14748 }
14749 pub async fn delete_team(
14753 &mut self,
14754 request: impl tonic::IntoRequest<super::DeleteTeamRequest>,
14755 ) -> std::result::Result<
14756 tonic::Response<super::DeleteTeamResponse>,
14757 tonic::Status,
14758 > {
14759 self.inner
14760 .ready()
14761 .await
14762 .map_err(|e| {
14763 tonic::Status::unknown(
14764 format!("Service was not ready: {}", e.into()),
14765 )
14766 })?;
14767 let codec = tonic_prost::ProstCodec::default();
14768 let path = http::uri::PathAndQuery::from_static(
14769 "/pidgr.v1.TeamService/DeleteTeam",
14770 );
14771 let mut req = request.into_request();
14772 req.extensions_mut()
14773 .insert(GrpcMethod::new("pidgr.v1.TeamService", "DeleteTeam"));
14774 self.inner.unary(req, path, codec).await
14775 }
14776 pub async fn add_team_members(
14780 &mut self,
14781 request: impl tonic::IntoRequest<super::AddTeamMembersRequest>,
14782 ) -> std::result::Result<
14783 tonic::Response<super::AddTeamMembersResponse>,
14784 tonic::Status,
14785 > {
14786 self.inner
14787 .ready()
14788 .await
14789 .map_err(|e| {
14790 tonic::Status::unknown(
14791 format!("Service was not ready: {}", e.into()),
14792 )
14793 })?;
14794 let codec = tonic_prost::ProstCodec::default();
14795 let path = http::uri::PathAndQuery::from_static(
14796 "/pidgr.v1.TeamService/AddTeamMembers",
14797 );
14798 let mut req = request.into_request();
14799 req.extensions_mut()
14800 .insert(GrpcMethod::new("pidgr.v1.TeamService", "AddTeamMembers"));
14801 self.inner.unary(req, path, codec).await
14802 }
14803 pub async fn remove_team_members(
14807 &mut self,
14808 request: impl tonic::IntoRequest<super::RemoveTeamMembersRequest>,
14809 ) -> std::result::Result<
14810 tonic::Response<super::RemoveTeamMembersResponse>,
14811 tonic::Status,
14812 > {
14813 self.inner
14814 .ready()
14815 .await
14816 .map_err(|e| {
14817 tonic::Status::unknown(
14818 format!("Service was not ready: {}", e.into()),
14819 )
14820 })?;
14821 let codec = tonic_prost::ProstCodec::default();
14822 let path = http::uri::PathAndQuery::from_static(
14823 "/pidgr.v1.TeamService/RemoveTeamMembers",
14824 );
14825 let mut req = request.into_request();
14826 req.extensions_mut()
14827 .insert(GrpcMethod::new("pidgr.v1.TeamService", "RemoveTeamMembers"));
14828 self.inner.unary(req, path, codec).await
14829 }
14830 pub async fn list_team_members(
14835 &mut self,
14836 request: impl tonic::IntoRequest<super::ListTeamMembersRequest>,
14837 ) -> std::result::Result<
14838 tonic::Response<super::ListTeamMembersResponse>,
14839 tonic::Status,
14840 > {
14841 self.inner
14842 .ready()
14843 .await
14844 .map_err(|e| {
14845 tonic::Status::unknown(
14846 format!("Service was not ready: {}", e.into()),
14847 )
14848 })?;
14849 let codec = tonic_prost::ProstCodec::default();
14850 let path = http::uri::PathAndQuery::from_static(
14851 "/pidgr.v1.TeamService/ListTeamMembers",
14852 );
14853 let mut req = request.into_request();
14854 req.extensions_mut()
14855 .insert(GrpcMethod::new("pidgr.v1.TeamService", "ListTeamMembers"));
14856 self.inner.unary(req, path, codec).await
14857 }
14858 }
14859}
14860pub mod team_service_server {
14862 #![allow(
14863 unused_variables,
14864 dead_code,
14865 missing_docs,
14866 clippy::wildcard_imports,
14867 clippy::let_unit_value,
14868 )]
14869 use tonic::codegen::*;
14870 #[async_trait]
14872 pub trait TeamService: std::marker::Send + std::marker::Sync + 'static {
14873 async fn create_team(
14877 &self,
14878 request: tonic::Request<super::CreateTeamRequest>,
14879 ) -> std::result::Result<
14880 tonic::Response<super::CreateTeamResponse>,
14881 tonic::Status,
14882 >;
14883 async fn get_team(
14888 &self,
14889 request: tonic::Request<super::GetTeamRequest>,
14890 ) -> std::result::Result<tonic::Response<super::GetTeamResponse>, tonic::Status>;
14891 async fn list_teams(
14895 &self,
14896 request: tonic::Request<super::ListTeamsRequest>,
14897 ) -> std::result::Result<
14898 tonic::Response<super::ListTeamsResponse>,
14899 tonic::Status,
14900 >;
14901 async fn update_team(
14905 &self,
14906 request: tonic::Request<super::UpdateTeamRequest>,
14907 ) -> std::result::Result<
14908 tonic::Response<super::UpdateTeamResponse>,
14909 tonic::Status,
14910 >;
14911 async fn delete_team(
14915 &self,
14916 request: tonic::Request<super::DeleteTeamRequest>,
14917 ) -> std::result::Result<
14918 tonic::Response<super::DeleteTeamResponse>,
14919 tonic::Status,
14920 >;
14921 async fn add_team_members(
14925 &self,
14926 request: tonic::Request<super::AddTeamMembersRequest>,
14927 ) -> std::result::Result<
14928 tonic::Response<super::AddTeamMembersResponse>,
14929 tonic::Status,
14930 >;
14931 async fn remove_team_members(
14935 &self,
14936 request: tonic::Request<super::RemoveTeamMembersRequest>,
14937 ) -> std::result::Result<
14938 tonic::Response<super::RemoveTeamMembersResponse>,
14939 tonic::Status,
14940 >;
14941 async fn list_team_members(
14946 &self,
14947 request: tonic::Request<super::ListTeamMembersRequest>,
14948 ) -> std::result::Result<
14949 tonic::Response<super::ListTeamMembersResponse>,
14950 tonic::Status,
14951 >;
14952 }
14953 #[derive(Debug)]
14958 pub struct TeamServiceServer<T> {
14959 inner: Arc<T>,
14960 accept_compression_encodings: EnabledCompressionEncodings,
14961 send_compression_encodings: EnabledCompressionEncodings,
14962 max_decoding_message_size: Option<usize>,
14963 max_encoding_message_size: Option<usize>,
14964 }
14965 impl<T> TeamServiceServer<T> {
14966 pub fn new(inner: T) -> Self {
14967 Self::from_arc(Arc::new(inner))
14968 }
14969 pub fn from_arc(inner: Arc<T>) -> Self {
14970 Self {
14971 inner,
14972 accept_compression_encodings: Default::default(),
14973 send_compression_encodings: Default::default(),
14974 max_decoding_message_size: None,
14975 max_encoding_message_size: None,
14976 }
14977 }
14978 pub fn with_interceptor<F>(
14979 inner: T,
14980 interceptor: F,
14981 ) -> InterceptedService<Self, F>
14982 where
14983 F: tonic::service::Interceptor,
14984 {
14985 InterceptedService::new(Self::new(inner), interceptor)
14986 }
14987 #[must_use]
14989 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
14990 self.accept_compression_encodings.enable(encoding);
14991 self
14992 }
14993 #[must_use]
14995 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
14996 self.send_compression_encodings.enable(encoding);
14997 self
14998 }
14999 #[must_use]
15003 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
15004 self.max_decoding_message_size = Some(limit);
15005 self
15006 }
15007 #[must_use]
15011 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
15012 self.max_encoding_message_size = Some(limit);
15013 self
15014 }
15015 }
15016 impl<T, B> tonic::codegen::Service<http::Request<B>> for TeamServiceServer<T>
15017 where
15018 T: TeamService,
15019 B: Body + std::marker::Send + 'static,
15020 B::Error: Into<StdError> + std::marker::Send + 'static,
15021 {
15022 type Response = http::Response<tonic::body::Body>;
15023 type Error = std::convert::Infallible;
15024 type Future = BoxFuture<Self::Response, Self::Error>;
15025 fn poll_ready(
15026 &mut self,
15027 _cx: &mut Context<'_>,
15028 ) -> Poll<std::result::Result<(), Self::Error>> {
15029 Poll::Ready(Ok(()))
15030 }
15031 fn call(&mut self, req: http::Request<B>) -> Self::Future {
15032 match req.uri().path() {
15033 "/pidgr.v1.TeamService/CreateTeam" => {
15034 #[allow(non_camel_case_types)]
15035 struct CreateTeamSvc<T: TeamService>(pub Arc<T>);
15036 impl<
15037 T: TeamService,
15038 > tonic::server::UnaryService<super::CreateTeamRequest>
15039 for CreateTeamSvc<T> {
15040 type Response = super::CreateTeamResponse;
15041 type Future = BoxFuture<
15042 tonic::Response<Self::Response>,
15043 tonic::Status,
15044 >;
15045 fn call(
15046 &mut self,
15047 request: tonic::Request<super::CreateTeamRequest>,
15048 ) -> Self::Future {
15049 let inner = Arc::clone(&self.0);
15050 let fut = async move {
15051 <T as TeamService>::create_team(&inner, request).await
15052 };
15053 Box::pin(fut)
15054 }
15055 }
15056 let accept_compression_encodings = self.accept_compression_encodings;
15057 let send_compression_encodings = self.send_compression_encodings;
15058 let max_decoding_message_size = self.max_decoding_message_size;
15059 let max_encoding_message_size = self.max_encoding_message_size;
15060 let inner = self.inner.clone();
15061 let fut = async move {
15062 let method = CreateTeamSvc(inner);
15063 let codec = tonic_prost::ProstCodec::default();
15064 let mut grpc = tonic::server::Grpc::new(codec)
15065 .apply_compression_config(
15066 accept_compression_encodings,
15067 send_compression_encodings,
15068 )
15069 .apply_max_message_size_config(
15070 max_decoding_message_size,
15071 max_encoding_message_size,
15072 );
15073 let res = grpc.unary(method, req).await;
15074 Ok(res)
15075 };
15076 Box::pin(fut)
15077 }
15078 "/pidgr.v1.TeamService/GetTeam" => {
15079 #[allow(non_camel_case_types)]
15080 struct GetTeamSvc<T: TeamService>(pub Arc<T>);
15081 impl<
15082 T: TeamService,
15083 > tonic::server::UnaryService<super::GetTeamRequest>
15084 for GetTeamSvc<T> {
15085 type Response = super::GetTeamResponse;
15086 type Future = BoxFuture<
15087 tonic::Response<Self::Response>,
15088 tonic::Status,
15089 >;
15090 fn call(
15091 &mut self,
15092 request: tonic::Request<super::GetTeamRequest>,
15093 ) -> Self::Future {
15094 let inner = Arc::clone(&self.0);
15095 let fut = async move {
15096 <T as TeamService>::get_team(&inner, request).await
15097 };
15098 Box::pin(fut)
15099 }
15100 }
15101 let accept_compression_encodings = self.accept_compression_encodings;
15102 let send_compression_encodings = self.send_compression_encodings;
15103 let max_decoding_message_size = self.max_decoding_message_size;
15104 let max_encoding_message_size = self.max_encoding_message_size;
15105 let inner = self.inner.clone();
15106 let fut = async move {
15107 let method = GetTeamSvc(inner);
15108 let codec = tonic_prost::ProstCodec::default();
15109 let mut grpc = tonic::server::Grpc::new(codec)
15110 .apply_compression_config(
15111 accept_compression_encodings,
15112 send_compression_encodings,
15113 )
15114 .apply_max_message_size_config(
15115 max_decoding_message_size,
15116 max_encoding_message_size,
15117 );
15118 let res = grpc.unary(method, req).await;
15119 Ok(res)
15120 };
15121 Box::pin(fut)
15122 }
15123 "/pidgr.v1.TeamService/ListTeams" => {
15124 #[allow(non_camel_case_types)]
15125 struct ListTeamsSvc<T: TeamService>(pub Arc<T>);
15126 impl<
15127 T: TeamService,
15128 > tonic::server::UnaryService<super::ListTeamsRequest>
15129 for ListTeamsSvc<T> {
15130 type Response = super::ListTeamsResponse;
15131 type Future = BoxFuture<
15132 tonic::Response<Self::Response>,
15133 tonic::Status,
15134 >;
15135 fn call(
15136 &mut self,
15137 request: tonic::Request<super::ListTeamsRequest>,
15138 ) -> Self::Future {
15139 let inner = Arc::clone(&self.0);
15140 let fut = async move {
15141 <T as TeamService>::list_teams(&inner, request).await
15142 };
15143 Box::pin(fut)
15144 }
15145 }
15146 let accept_compression_encodings = self.accept_compression_encodings;
15147 let send_compression_encodings = self.send_compression_encodings;
15148 let max_decoding_message_size = self.max_decoding_message_size;
15149 let max_encoding_message_size = self.max_encoding_message_size;
15150 let inner = self.inner.clone();
15151 let fut = async move {
15152 let method = ListTeamsSvc(inner);
15153 let codec = tonic_prost::ProstCodec::default();
15154 let mut grpc = tonic::server::Grpc::new(codec)
15155 .apply_compression_config(
15156 accept_compression_encodings,
15157 send_compression_encodings,
15158 )
15159 .apply_max_message_size_config(
15160 max_decoding_message_size,
15161 max_encoding_message_size,
15162 );
15163 let res = grpc.unary(method, req).await;
15164 Ok(res)
15165 };
15166 Box::pin(fut)
15167 }
15168 "/pidgr.v1.TeamService/UpdateTeam" => {
15169 #[allow(non_camel_case_types)]
15170 struct UpdateTeamSvc<T: TeamService>(pub Arc<T>);
15171 impl<
15172 T: TeamService,
15173 > tonic::server::UnaryService<super::UpdateTeamRequest>
15174 for UpdateTeamSvc<T> {
15175 type Response = super::UpdateTeamResponse;
15176 type Future = BoxFuture<
15177 tonic::Response<Self::Response>,
15178 tonic::Status,
15179 >;
15180 fn call(
15181 &mut self,
15182 request: tonic::Request<super::UpdateTeamRequest>,
15183 ) -> Self::Future {
15184 let inner = Arc::clone(&self.0);
15185 let fut = async move {
15186 <T as TeamService>::update_team(&inner, request).await
15187 };
15188 Box::pin(fut)
15189 }
15190 }
15191 let accept_compression_encodings = self.accept_compression_encodings;
15192 let send_compression_encodings = self.send_compression_encodings;
15193 let max_decoding_message_size = self.max_decoding_message_size;
15194 let max_encoding_message_size = self.max_encoding_message_size;
15195 let inner = self.inner.clone();
15196 let fut = async move {
15197 let method = UpdateTeamSvc(inner);
15198 let codec = tonic_prost::ProstCodec::default();
15199 let mut grpc = tonic::server::Grpc::new(codec)
15200 .apply_compression_config(
15201 accept_compression_encodings,
15202 send_compression_encodings,
15203 )
15204 .apply_max_message_size_config(
15205 max_decoding_message_size,
15206 max_encoding_message_size,
15207 );
15208 let res = grpc.unary(method, req).await;
15209 Ok(res)
15210 };
15211 Box::pin(fut)
15212 }
15213 "/pidgr.v1.TeamService/DeleteTeam" => {
15214 #[allow(non_camel_case_types)]
15215 struct DeleteTeamSvc<T: TeamService>(pub Arc<T>);
15216 impl<
15217 T: TeamService,
15218 > tonic::server::UnaryService<super::DeleteTeamRequest>
15219 for DeleteTeamSvc<T> {
15220 type Response = super::DeleteTeamResponse;
15221 type Future = BoxFuture<
15222 tonic::Response<Self::Response>,
15223 tonic::Status,
15224 >;
15225 fn call(
15226 &mut self,
15227 request: tonic::Request<super::DeleteTeamRequest>,
15228 ) -> Self::Future {
15229 let inner = Arc::clone(&self.0);
15230 let fut = async move {
15231 <T as TeamService>::delete_team(&inner, request).await
15232 };
15233 Box::pin(fut)
15234 }
15235 }
15236 let accept_compression_encodings = self.accept_compression_encodings;
15237 let send_compression_encodings = self.send_compression_encodings;
15238 let max_decoding_message_size = self.max_decoding_message_size;
15239 let max_encoding_message_size = self.max_encoding_message_size;
15240 let inner = self.inner.clone();
15241 let fut = async move {
15242 let method = DeleteTeamSvc(inner);
15243 let codec = tonic_prost::ProstCodec::default();
15244 let mut grpc = tonic::server::Grpc::new(codec)
15245 .apply_compression_config(
15246 accept_compression_encodings,
15247 send_compression_encodings,
15248 )
15249 .apply_max_message_size_config(
15250 max_decoding_message_size,
15251 max_encoding_message_size,
15252 );
15253 let res = grpc.unary(method, req).await;
15254 Ok(res)
15255 };
15256 Box::pin(fut)
15257 }
15258 "/pidgr.v1.TeamService/AddTeamMembers" => {
15259 #[allow(non_camel_case_types)]
15260 struct AddTeamMembersSvc<T: TeamService>(pub Arc<T>);
15261 impl<
15262 T: TeamService,
15263 > tonic::server::UnaryService<super::AddTeamMembersRequest>
15264 for AddTeamMembersSvc<T> {
15265 type Response = super::AddTeamMembersResponse;
15266 type Future = BoxFuture<
15267 tonic::Response<Self::Response>,
15268 tonic::Status,
15269 >;
15270 fn call(
15271 &mut self,
15272 request: tonic::Request<super::AddTeamMembersRequest>,
15273 ) -> Self::Future {
15274 let inner = Arc::clone(&self.0);
15275 let fut = async move {
15276 <T as TeamService>::add_team_members(&inner, request).await
15277 };
15278 Box::pin(fut)
15279 }
15280 }
15281 let accept_compression_encodings = self.accept_compression_encodings;
15282 let send_compression_encodings = self.send_compression_encodings;
15283 let max_decoding_message_size = self.max_decoding_message_size;
15284 let max_encoding_message_size = self.max_encoding_message_size;
15285 let inner = self.inner.clone();
15286 let fut = async move {
15287 let method = AddTeamMembersSvc(inner);
15288 let codec = tonic_prost::ProstCodec::default();
15289 let mut grpc = tonic::server::Grpc::new(codec)
15290 .apply_compression_config(
15291 accept_compression_encodings,
15292 send_compression_encodings,
15293 )
15294 .apply_max_message_size_config(
15295 max_decoding_message_size,
15296 max_encoding_message_size,
15297 );
15298 let res = grpc.unary(method, req).await;
15299 Ok(res)
15300 };
15301 Box::pin(fut)
15302 }
15303 "/pidgr.v1.TeamService/RemoveTeamMembers" => {
15304 #[allow(non_camel_case_types)]
15305 struct RemoveTeamMembersSvc<T: TeamService>(pub Arc<T>);
15306 impl<
15307 T: TeamService,
15308 > tonic::server::UnaryService<super::RemoveTeamMembersRequest>
15309 for RemoveTeamMembersSvc<T> {
15310 type Response = super::RemoveTeamMembersResponse;
15311 type Future = BoxFuture<
15312 tonic::Response<Self::Response>,
15313 tonic::Status,
15314 >;
15315 fn call(
15316 &mut self,
15317 request: tonic::Request<super::RemoveTeamMembersRequest>,
15318 ) -> Self::Future {
15319 let inner = Arc::clone(&self.0);
15320 let fut = async move {
15321 <T as TeamService>::remove_team_members(&inner, request)
15322 .await
15323 };
15324 Box::pin(fut)
15325 }
15326 }
15327 let accept_compression_encodings = self.accept_compression_encodings;
15328 let send_compression_encodings = self.send_compression_encodings;
15329 let max_decoding_message_size = self.max_decoding_message_size;
15330 let max_encoding_message_size = self.max_encoding_message_size;
15331 let inner = self.inner.clone();
15332 let fut = async move {
15333 let method = RemoveTeamMembersSvc(inner);
15334 let codec = tonic_prost::ProstCodec::default();
15335 let mut grpc = tonic::server::Grpc::new(codec)
15336 .apply_compression_config(
15337 accept_compression_encodings,
15338 send_compression_encodings,
15339 )
15340 .apply_max_message_size_config(
15341 max_decoding_message_size,
15342 max_encoding_message_size,
15343 );
15344 let res = grpc.unary(method, req).await;
15345 Ok(res)
15346 };
15347 Box::pin(fut)
15348 }
15349 "/pidgr.v1.TeamService/ListTeamMembers" => {
15350 #[allow(non_camel_case_types)]
15351 struct ListTeamMembersSvc<T: TeamService>(pub Arc<T>);
15352 impl<
15353 T: TeamService,
15354 > tonic::server::UnaryService<super::ListTeamMembersRequest>
15355 for ListTeamMembersSvc<T> {
15356 type Response = super::ListTeamMembersResponse;
15357 type Future = BoxFuture<
15358 tonic::Response<Self::Response>,
15359 tonic::Status,
15360 >;
15361 fn call(
15362 &mut self,
15363 request: tonic::Request<super::ListTeamMembersRequest>,
15364 ) -> Self::Future {
15365 let inner = Arc::clone(&self.0);
15366 let fut = async move {
15367 <T as TeamService>::list_team_members(&inner, request).await
15368 };
15369 Box::pin(fut)
15370 }
15371 }
15372 let accept_compression_encodings = self.accept_compression_encodings;
15373 let send_compression_encodings = self.send_compression_encodings;
15374 let max_decoding_message_size = self.max_decoding_message_size;
15375 let max_encoding_message_size = self.max_encoding_message_size;
15376 let inner = self.inner.clone();
15377 let fut = async move {
15378 let method = ListTeamMembersSvc(inner);
15379 let codec = tonic_prost::ProstCodec::default();
15380 let mut grpc = tonic::server::Grpc::new(codec)
15381 .apply_compression_config(
15382 accept_compression_encodings,
15383 send_compression_encodings,
15384 )
15385 .apply_max_message_size_config(
15386 max_decoding_message_size,
15387 max_encoding_message_size,
15388 );
15389 let res = grpc.unary(method, req).await;
15390 Ok(res)
15391 };
15392 Box::pin(fut)
15393 }
15394 _ => {
15395 Box::pin(async move {
15396 let mut response = http::Response::new(
15397 tonic::body::Body::default(),
15398 );
15399 let headers = response.headers_mut();
15400 headers
15401 .insert(
15402 tonic::Status::GRPC_STATUS,
15403 (tonic::Code::Unimplemented as i32).into(),
15404 );
15405 headers
15406 .insert(
15407 http::header::CONTENT_TYPE,
15408 tonic::metadata::GRPC_CONTENT_TYPE,
15409 );
15410 Ok(response)
15411 })
15412 }
15413 }
15414 }
15415 }
15416 impl<T> Clone for TeamServiceServer<T> {
15417 fn clone(&self) -> Self {
15418 let inner = self.inner.clone();
15419 Self {
15420 inner,
15421 accept_compression_encodings: self.accept_compression_encodings,
15422 send_compression_encodings: self.send_compression_encodings,
15423 max_decoding_message_size: self.max_decoding_message_size,
15424 max_encoding_message_size: self.max_encoding_message_size,
15425 }
15426 }
15427 }
15428 pub const SERVICE_NAME: &str = "pidgr.v1.TeamService";
15430 impl<T> tonic::server::NamedService for TeamServiceServer<T> {
15431 const NAME: &'static str = SERVICE_NAME;
15432 }
15433}
15434pub mod template_service_client {
15436 #![allow(
15437 unused_variables,
15438 dead_code,
15439 missing_docs,
15440 clippy::wildcard_imports,
15441 clippy::let_unit_value,
15442 )]
15443 use tonic::codegen::*;
15444 use tonic::codegen::http::Uri;
15445 #[derive(Debug, Clone)]
15449 pub struct TemplateServiceClient<T> {
15450 inner: tonic::client::Grpc<T>,
15451 }
15452 impl TemplateServiceClient<tonic::transport::Channel> {
15453 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
15455 where
15456 D: TryInto<tonic::transport::Endpoint>,
15457 D::Error: Into<StdError>,
15458 {
15459 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
15460 Ok(Self::new(conn))
15461 }
15462 }
15463 impl<T> TemplateServiceClient<T>
15464 where
15465 T: tonic::client::GrpcService<tonic::body::Body>,
15466 T::Error: Into<StdError>,
15467 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
15468 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
15469 {
15470 pub fn new(inner: T) -> Self {
15471 let inner = tonic::client::Grpc::new(inner);
15472 Self { inner }
15473 }
15474 pub fn with_origin(inner: T, origin: Uri) -> Self {
15475 let inner = tonic::client::Grpc::with_origin(inner, origin);
15476 Self { inner }
15477 }
15478 pub fn with_interceptor<F>(
15479 inner: T,
15480 interceptor: F,
15481 ) -> TemplateServiceClient<InterceptedService<T, F>>
15482 where
15483 F: tonic::service::Interceptor,
15484 T::ResponseBody: Default,
15485 T: tonic::codegen::Service<
15486 http::Request<tonic::body::Body>,
15487 Response = http::Response<
15488 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
15489 >,
15490 >,
15491 <T as tonic::codegen::Service<
15492 http::Request<tonic::body::Body>,
15493 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
15494 {
15495 TemplateServiceClient::new(InterceptedService::new(inner, interceptor))
15496 }
15497 #[must_use]
15502 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
15503 self.inner = self.inner.send_compressed(encoding);
15504 self
15505 }
15506 #[must_use]
15508 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
15509 self.inner = self.inner.accept_compressed(encoding);
15510 self
15511 }
15512 #[must_use]
15516 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
15517 self.inner = self.inner.max_decoding_message_size(limit);
15518 self
15519 }
15520 #[must_use]
15524 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
15525 self.inner = self.inner.max_encoding_message_size(limit);
15526 self
15527 }
15528 pub async fn create_template(
15532 &mut self,
15533 request: impl tonic::IntoRequest<super::CreateTemplateRequest>,
15534 ) -> std::result::Result<
15535 tonic::Response<super::CreateTemplateResponse>,
15536 tonic::Status,
15537 > {
15538 self.inner
15539 .ready()
15540 .await
15541 .map_err(|e| {
15542 tonic::Status::unknown(
15543 format!("Service was not ready: {}", e.into()),
15544 )
15545 })?;
15546 let codec = tonic_prost::ProstCodec::default();
15547 let path = http::uri::PathAndQuery::from_static(
15548 "/pidgr.v1.TemplateService/CreateTemplate",
15549 );
15550 let mut req = request.into_request();
15551 req.extensions_mut()
15552 .insert(GrpcMethod::new("pidgr.v1.TemplateService", "CreateTemplate"));
15553 self.inner.unary(req, path, codec).await
15554 }
15555 pub async fn update_template(
15559 &mut self,
15560 request: impl tonic::IntoRequest<super::UpdateTemplateRequest>,
15561 ) -> std::result::Result<
15562 tonic::Response<super::UpdateTemplateResponse>,
15563 tonic::Status,
15564 > {
15565 self.inner
15566 .ready()
15567 .await
15568 .map_err(|e| {
15569 tonic::Status::unknown(
15570 format!("Service was not ready: {}", e.into()),
15571 )
15572 })?;
15573 let codec = tonic_prost::ProstCodec::default();
15574 let path = http::uri::PathAndQuery::from_static(
15575 "/pidgr.v1.TemplateService/UpdateTemplate",
15576 );
15577 let mut req = request.into_request();
15578 req.extensions_mut()
15579 .insert(GrpcMethod::new("pidgr.v1.TemplateService", "UpdateTemplate"));
15580 self.inner.unary(req, path, codec).await
15581 }
15582 pub async fn get_template(
15586 &mut self,
15587 request: impl tonic::IntoRequest<super::GetTemplateRequest>,
15588 ) -> std::result::Result<
15589 tonic::Response<super::GetTemplateResponse>,
15590 tonic::Status,
15591 > {
15592 self.inner
15593 .ready()
15594 .await
15595 .map_err(|e| {
15596 tonic::Status::unknown(
15597 format!("Service was not ready: {}", e.into()),
15598 )
15599 })?;
15600 let codec = tonic_prost::ProstCodec::default();
15601 let path = http::uri::PathAndQuery::from_static(
15602 "/pidgr.v1.TemplateService/GetTemplate",
15603 );
15604 let mut req = request.into_request();
15605 req.extensions_mut()
15606 .insert(GrpcMethod::new("pidgr.v1.TemplateService", "GetTemplate"));
15607 self.inner.unary(req, path, codec).await
15608 }
15609 pub async fn list_templates(
15613 &mut self,
15614 request: impl tonic::IntoRequest<super::ListTemplatesRequest>,
15615 ) -> std::result::Result<
15616 tonic::Response<super::ListTemplatesResponse>,
15617 tonic::Status,
15618 > {
15619 self.inner
15620 .ready()
15621 .await
15622 .map_err(|e| {
15623 tonic::Status::unknown(
15624 format!("Service was not ready: {}", e.into()),
15625 )
15626 })?;
15627 let codec = tonic_prost::ProstCodec::default();
15628 let path = http::uri::PathAndQuery::from_static(
15629 "/pidgr.v1.TemplateService/ListTemplates",
15630 );
15631 let mut req = request.into_request();
15632 req.extensions_mut()
15633 .insert(GrpcMethod::new("pidgr.v1.TemplateService", "ListTemplates"));
15634 self.inner.unary(req, path, codec).await
15635 }
15636 pub async fn create_template_translation(
15640 &mut self,
15641 request: impl tonic::IntoRequest<super::CreateTemplateTranslationRequest>,
15642 ) -> std::result::Result<
15643 tonic::Response<super::CreateTemplateTranslationResponse>,
15644 tonic::Status,
15645 > {
15646 self.inner
15647 .ready()
15648 .await
15649 .map_err(|e| {
15650 tonic::Status::unknown(
15651 format!("Service was not ready: {}", e.into()),
15652 )
15653 })?;
15654 let codec = tonic_prost::ProstCodec::default();
15655 let path = http::uri::PathAndQuery::from_static(
15656 "/pidgr.v1.TemplateService/CreateTemplateTranslation",
15657 );
15658 let mut req = request.into_request();
15659 req.extensions_mut()
15660 .insert(
15661 GrpcMethod::new(
15662 "pidgr.v1.TemplateService",
15663 "CreateTemplateTranslation",
15664 ),
15665 );
15666 self.inner.unary(req, path, codec).await
15667 }
15668 pub async fn update_template_translation(
15672 &mut self,
15673 request: impl tonic::IntoRequest<super::UpdateTemplateTranslationRequest>,
15674 ) -> std::result::Result<
15675 tonic::Response<super::UpdateTemplateTranslationResponse>,
15676 tonic::Status,
15677 > {
15678 self.inner
15679 .ready()
15680 .await
15681 .map_err(|e| {
15682 tonic::Status::unknown(
15683 format!("Service was not ready: {}", e.into()),
15684 )
15685 })?;
15686 let codec = tonic_prost::ProstCodec::default();
15687 let path = http::uri::PathAndQuery::from_static(
15688 "/pidgr.v1.TemplateService/UpdateTemplateTranslation",
15689 );
15690 let mut req = request.into_request();
15691 req.extensions_mut()
15692 .insert(
15693 GrpcMethod::new(
15694 "pidgr.v1.TemplateService",
15695 "UpdateTemplateTranslation",
15696 ),
15697 );
15698 self.inner.unary(req, path, codec).await
15699 }
15700 pub async fn list_template_translations(
15704 &mut self,
15705 request: impl tonic::IntoRequest<super::ListTemplateTranslationsRequest>,
15706 ) -> std::result::Result<
15707 tonic::Response<super::ListTemplateTranslationsResponse>,
15708 tonic::Status,
15709 > {
15710 self.inner
15711 .ready()
15712 .await
15713 .map_err(|e| {
15714 tonic::Status::unknown(
15715 format!("Service was not ready: {}", e.into()),
15716 )
15717 })?;
15718 let codec = tonic_prost::ProstCodec::default();
15719 let path = http::uri::PathAndQuery::from_static(
15720 "/pidgr.v1.TemplateService/ListTemplateTranslations",
15721 );
15722 let mut req = request.into_request();
15723 req.extensions_mut()
15724 .insert(
15725 GrpcMethod::new(
15726 "pidgr.v1.TemplateService",
15727 "ListTemplateTranslations",
15728 ),
15729 );
15730 self.inner.unary(req, path, codec).await
15731 }
15732 pub async fn approve_template_translation(
15736 &mut self,
15737 request: impl tonic::IntoRequest<super::ApproveTemplateTranslationRequest>,
15738 ) -> std::result::Result<
15739 tonic::Response<super::ApproveTemplateTranslationResponse>,
15740 tonic::Status,
15741 > {
15742 self.inner
15743 .ready()
15744 .await
15745 .map_err(|e| {
15746 tonic::Status::unknown(
15747 format!("Service was not ready: {}", e.into()),
15748 )
15749 })?;
15750 let codec = tonic_prost::ProstCodec::default();
15751 let path = http::uri::PathAndQuery::from_static(
15752 "/pidgr.v1.TemplateService/ApproveTemplateTranslation",
15753 );
15754 let mut req = request.into_request();
15755 req.extensions_mut()
15756 .insert(
15757 GrpcMethod::new(
15758 "pidgr.v1.TemplateService",
15759 "ApproveTemplateTranslation",
15760 ),
15761 );
15762 self.inner.unary(req, path, codec).await
15763 }
15764 }
15765}
15766pub mod template_service_server {
15768 #![allow(
15769 unused_variables,
15770 dead_code,
15771 missing_docs,
15772 clippy::wildcard_imports,
15773 clippy::let_unit_value,
15774 )]
15775 use tonic::codegen::*;
15776 #[async_trait]
15778 pub trait TemplateService: std::marker::Send + std::marker::Sync + 'static {
15779 async fn create_template(
15783 &self,
15784 request: tonic::Request<super::CreateTemplateRequest>,
15785 ) -> std::result::Result<
15786 tonic::Response<super::CreateTemplateResponse>,
15787 tonic::Status,
15788 >;
15789 async fn update_template(
15793 &self,
15794 request: tonic::Request<super::UpdateTemplateRequest>,
15795 ) -> std::result::Result<
15796 tonic::Response<super::UpdateTemplateResponse>,
15797 tonic::Status,
15798 >;
15799 async fn get_template(
15803 &self,
15804 request: tonic::Request<super::GetTemplateRequest>,
15805 ) -> std::result::Result<
15806 tonic::Response<super::GetTemplateResponse>,
15807 tonic::Status,
15808 >;
15809 async fn list_templates(
15813 &self,
15814 request: tonic::Request<super::ListTemplatesRequest>,
15815 ) -> std::result::Result<
15816 tonic::Response<super::ListTemplatesResponse>,
15817 tonic::Status,
15818 >;
15819 async fn create_template_translation(
15823 &self,
15824 request: tonic::Request<super::CreateTemplateTranslationRequest>,
15825 ) -> std::result::Result<
15826 tonic::Response<super::CreateTemplateTranslationResponse>,
15827 tonic::Status,
15828 >;
15829 async fn update_template_translation(
15833 &self,
15834 request: tonic::Request<super::UpdateTemplateTranslationRequest>,
15835 ) -> std::result::Result<
15836 tonic::Response<super::UpdateTemplateTranslationResponse>,
15837 tonic::Status,
15838 >;
15839 async fn list_template_translations(
15843 &self,
15844 request: tonic::Request<super::ListTemplateTranslationsRequest>,
15845 ) -> std::result::Result<
15846 tonic::Response<super::ListTemplateTranslationsResponse>,
15847 tonic::Status,
15848 >;
15849 async fn approve_template_translation(
15853 &self,
15854 request: tonic::Request<super::ApproveTemplateTranslationRequest>,
15855 ) -> std::result::Result<
15856 tonic::Response<super::ApproveTemplateTranslationResponse>,
15857 tonic::Status,
15858 >;
15859 }
15860 #[derive(Debug)]
15864 pub struct TemplateServiceServer<T> {
15865 inner: Arc<T>,
15866 accept_compression_encodings: EnabledCompressionEncodings,
15867 send_compression_encodings: EnabledCompressionEncodings,
15868 max_decoding_message_size: Option<usize>,
15869 max_encoding_message_size: Option<usize>,
15870 }
15871 impl<T> TemplateServiceServer<T> {
15872 pub fn new(inner: T) -> Self {
15873 Self::from_arc(Arc::new(inner))
15874 }
15875 pub fn from_arc(inner: Arc<T>) -> Self {
15876 Self {
15877 inner,
15878 accept_compression_encodings: Default::default(),
15879 send_compression_encodings: Default::default(),
15880 max_decoding_message_size: None,
15881 max_encoding_message_size: None,
15882 }
15883 }
15884 pub fn with_interceptor<F>(
15885 inner: T,
15886 interceptor: F,
15887 ) -> InterceptedService<Self, F>
15888 where
15889 F: tonic::service::Interceptor,
15890 {
15891 InterceptedService::new(Self::new(inner), interceptor)
15892 }
15893 #[must_use]
15895 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
15896 self.accept_compression_encodings.enable(encoding);
15897 self
15898 }
15899 #[must_use]
15901 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
15902 self.send_compression_encodings.enable(encoding);
15903 self
15904 }
15905 #[must_use]
15909 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
15910 self.max_decoding_message_size = Some(limit);
15911 self
15912 }
15913 #[must_use]
15917 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
15918 self.max_encoding_message_size = Some(limit);
15919 self
15920 }
15921 }
15922 impl<T, B> tonic::codegen::Service<http::Request<B>> for TemplateServiceServer<T>
15923 where
15924 T: TemplateService,
15925 B: Body + std::marker::Send + 'static,
15926 B::Error: Into<StdError> + std::marker::Send + 'static,
15927 {
15928 type Response = http::Response<tonic::body::Body>;
15929 type Error = std::convert::Infallible;
15930 type Future = BoxFuture<Self::Response, Self::Error>;
15931 fn poll_ready(
15932 &mut self,
15933 _cx: &mut Context<'_>,
15934 ) -> Poll<std::result::Result<(), Self::Error>> {
15935 Poll::Ready(Ok(()))
15936 }
15937 fn call(&mut self, req: http::Request<B>) -> Self::Future {
15938 match req.uri().path() {
15939 "/pidgr.v1.TemplateService/CreateTemplate" => {
15940 #[allow(non_camel_case_types)]
15941 struct CreateTemplateSvc<T: TemplateService>(pub Arc<T>);
15942 impl<
15943 T: TemplateService,
15944 > tonic::server::UnaryService<super::CreateTemplateRequest>
15945 for CreateTemplateSvc<T> {
15946 type Response = super::CreateTemplateResponse;
15947 type Future = BoxFuture<
15948 tonic::Response<Self::Response>,
15949 tonic::Status,
15950 >;
15951 fn call(
15952 &mut self,
15953 request: tonic::Request<super::CreateTemplateRequest>,
15954 ) -> Self::Future {
15955 let inner = Arc::clone(&self.0);
15956 let fut = async move {
15957 <T as TemplateService>::create_template(&inner, request)
15958 .await
15959 };
15960 Box::pin(fut)
15961 }
15962 }
15963 let accept_compression_encodings = self.accept_compression_encodings;
15964 let send_compression_encodings = self.send_compression_encodings;
15965 let max_decoding_message_size = self.max_decoding_message_size;
15966 let max_encoding_message_size = self.max_encoding_message_size;
15967 let inner = self.inner.clone();
15968 let fut = async move {
15969 let method = CreateTemplateSvc(inner);
15970 let codec = tonic_prost::ProstCodec::default();
15971 let mut grpc = tonic::server::Grpc::new(codec)
15972 .apply_compression_config(
15973 accept_compression_encodings,
15974 send_compression_encodings,
15975 )
15976 .apply_max_message_size_config(
15977 max_decoding_message_size,
15978 max_encoding_message_size,
15979 );
15980 let res = grpc.unary(method, req).await;
15981 Ok(res)
15982 };
15983 Box::pin(fut)
15984 }
15985 "/pidgr.v1.TemplateService/UpdateTemplate" => {
15986 #[allow(non_camel_case_types)]
15987 struct UpdateTemplateSvc<T: TemplateService>(pub Arc<T>);
15988 impl<
15989 T: TemplateService,
15990 > tonic::server::UnaryService<super::UpdateTemplateRequest>
15991 for UpdateTemplateSvc<T> {
15992 type Response = super::UpdateTemplateResponse;
15993 type Future = BoxFuture<
15994 tonic::Response<Self::Response>,
15995 tonic::Status,
15996 >;
15997 fn call(
15998 &mut self,
15999 request: tonic::Request<super::UpdateTemplateRequest>,
16000 ) -> Self::Future {
16001 let inner = Arc::clone(&self.0);
16002 let fut = async move {
16003 <T as TemplateService>::update_template(&inner, request)
16004 .await
16005 };
16006 Box::pin(fut)
16007 }
16008 }
16009 let accept_compression_encodings = self.accept_compression_encodings;
16010 let send_compression_encodings = self.send_compression_encodings;
16011 let max_decoding_message_size = self.max_decoding_message_size;
16012 let max_encoding_message_size = self.max_encoding_message_size;
16013 let inner = self.inner.clone();
16014 let fut = async move {
16015 let method = UpdateTemplateSvc(inner);
16016 let codec = tonic_prost::ProstCodec::default();
16017 let mut grpc = tonic::server::Grpc::new(codec)
16018 .apply_compression_config(
16019 accept_compression_encodings,
16020 send_compression_encodings,
16021 )
16022 .apply_max_message_size_config(
16023 max_decoding_message_size,
16024 max_encoding_message_size,
16025 );
16026 let res = grpc.unary(method, req).await;
16027 Ok(res)
16028 };
16029 Box::pin(fut)
16030 }
16031 "/pidgr.v1.TemplateService/GetTemplate" => {
16032 #[allow(non_camel_case_types)]
16033 struct GetTemplateSvc<T: TemplateService>(pub Arc<T>);
16034 impl<
16035 T: TemplateService,
16036 > tonic::server::UnaryService<super::GetTemplateRequest>
16037 for GetTemplateSvc<T> {
16038 type Response = super::GetTemplateResponse;
16039 type Future = BoxFuture<
16040 tonic::Response<Self::Response>,
16041 tonic::Status,
16042 >;
16043 fn call(
16044 &mut self,
16045 request: tonic::Request<super::GetTemplateRequest>,
16046 ) -> Self::Future {
16047 let inner = Arc::clone(&self.0);
16048 let fut = async move {
16049 <T as TemplateService>::get_template(&inner, request).await
16050 };
16051 Box::pin(fut)
16052 }
16053 }
16054 let accept_compression_encodings = self.accept_compression_encodings;
16055 let send_compression_encodings = self.send_compression_encodings;
16056 let max_decoding_message_size = self.max_decoding_message_size;
16057 let max_encoding_message_size = self.max_encoding_message_size;
16058 let inner = self.inner.clone();
16059 let fut = async move {
16060 let method = GetTemplateSvc(inner);
16061 let codec = tonic_prost::ProstCodec::default();
16062 let mut grpc = tonic::server::Grpc::new(codec)
16063 .apply_compression_config(
16064 accept_compression_encodings,
16065 send_compression_encodings,
16066 )
16067 .apply_max_message_size_config(
16068 max_decoding_message_size,
16069 max_encoding_message_size,
16070 );
16071 let res = grpc.unary(method, req).await;
16072 Ok(res)
16073 };
16074 Box::pin(fut)
16075 }
16076 "/pidgr.v1.TemplateService/ListTemplates" => {
16077 #[allow(non_camel_case_types)]
16078 struct ListTemplatesSvc<T: TemplateService>(pub Arc<T>);
16079 impl<
16080 T: TemplateService,
16081 > tonic::server::UnaryService<super::ListTemplatesRequest>
16082 for ListTemplatesSvc<T> {
16083 type Response = super::ListTemplatesResponse;
16084 type Future = BoxFuture<
16085 tonic::Response<Self::Response>,
16086 tonic::Status,
16087 >;
16088 fn call(
16089 &mut self,
16090 request: tonic::Request<super::ListTemplatesRequest>,
16091 ) -> Self::Future {
16092 let inner = Arc::clone(&self.0);
16093 let fut = async move {
16094 <T as TemplateService>::list_templates(&inner, request)
16095 .await
16096 };
16097 Box::pin(fut)
16098 }
16099 }
16100 let accept_compression_encodings = self.accept_compression_encodings;
16101 let send_compression_encodings = self.send_compression_encodings;
16102 let max_decoding_message_size = self.max_decoding_message_size;
16103 let max_encoding_message_size = self.max_encoding_message_size;
16104 let inner = self.inner.clone();
16105 let fut = async move {
16106 let method = ListTemplatesSvc(inner);
16107 let codec = tonic_prost::ProstCodec::default();
16108 let mut grpc = tonic::server::Grpc::new(codec)
16109 .apply_compression_config(
16110 accept_compression_encodings,
16111 send_compression_encodings,
16112 )
16113 .apply_max_message_size_config(
16114 max_decoding_message_size,
16115 max_encoding_message_size,
16116 );
16117 let res = grpc.unary(method, req).await;
16118 Ok(res)
16119 };
16120 Box::pin(fut)
16121 }
16122 "/pidgr.v1.TemplateService/CreateTemplateTranslation" => {
16123 #[allow(non_camel_case_types)]
16124 struct CreateTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
16125 impl<
16126 T: TemplateService,
16127 > tonic::server::UnaryService<
16128 super::CreateTemplateTranslationRequest,
16129 > for CreateTemplateTranslationSvc<T> {
16130 type Response = super::CreateTemplateTranslationResponse;
16131 type Future = BoxFuture<
16132 tonic::Response<Self::Response>,
16133 tonic::Status,
16134 >;
16135 fn call(
16136 &mut self,
16137 request: tonic::Request<
16138 super::CreateTemplateTranslationRequest,
16139 >,
16140 ) -> Self::Future {
16141 let inner = Arc::clone(&self.0);
16142 let fut = async move {
16143 <T as TemplateService>::create_template_translation(
16144 &inner,
16145 request,
16146 )
16147 .await
16148 };
16149 Box::pin(fut)
16150 }
16151 }
16152 let accept_compression_encodings = self.accept_compression_encodings;
16153 let send_compression_encodings = self.send_compression_encodings;
16154 let max_decoding_message_size = self.max_decoding_message_size;
16155 let max_encoding_message_size = self.max_encoding_message_size;
16156 let inner = self.inner.clone();
16157 let fut = async move {
16158 let method = CreateTemplateTranslationSvc(inner);
16159 let codec = tonic_prost::ProstCodec::default();
16160 let mut grpc = tonic::server::Grpc::new(codec)
16161 .apply_compression_config(
16162 accept_compression_encodings,
16163 send_compression_encodings,
16164 )
16165 .apply_max_message_size_config(
16166 max_decoding_message_size,
16167 max_encoding_message_size,
16168 );
16169 let res = grpc.unary(method, req).await;
16170 Ok(res)
16171 };
16172 Box::pin(fut)
16173 }
16174 "/pidgr.v1.TemplateService/UpdateTemplateTranslation" => {
16175 #[allow(non_camel_case_types)]
16176 struct UpdateTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
16177 impl<
16178 T: TemplateService,
16179 > tonic::server::UnaryService<
16180 super::UpdateTemplateTranslationRequest,
16181 > for UpdateTemplateTranslationSvc<T> {
16182 type Response = super::UpdateTemplateTranslationResponse;
16183 type Future = BoxFuture<
16184 tonic::Response<Self::Response>,
16185 tonic::Status,
16186 >;
16187 fn call(
16188 &mut self,
16189 request: tonic::Request<
16190 super::UpdateTemplateTranslationRequest,
16191 >,
16192 ) -> Self::Future {
16193 let inner = Arc::clone(&self.0);
16194 let fut = async move {
16195 <T as TemplateService>::update_template_translation(
16196 &inner,
16197 request,
16198 )
16199 .await
16200 };
16201 Box::pin(fut)
16202 }
16203 }
16204 let accept_compression_encodings = self.accept_compression_encodings;
16205 let send_compression_encodings = self.send_compression_encodings;
16206 let max_decoding_message_size = self.max_decoding_message_size;
16207 let max_encoding_message_size = self.max_encoding_message_size;
16208 let inner = self.inner.clone();
16209 let fut = async move {
16210 let method = UpdateTemplateTranslationSvc(inner);
16211 let codec = tonic_prost::ProstCodec::default();
16212 let mut grpc = tonic::server::Grpc::new(codec)
16213 .apply_compression_config(
16214 accept_compression_encodings,
16215 send_compression_encodings,
16216 )
16217 .apply_max_message_size_config(
16218 max_decoding_message_size,
16219 max_encoding_message_size,
16220 );
16221 let res = grpc.unary(method, req).await;
16222 Ok(res)
16223 };
16224 Box::pin(fut)
16225 }
16226 "/pidgr.v1.TemplateService/ListTemplateTranslations" => {
16227 #[allow(non_camel_case_types)]
16228 struct ListTemplateTranslationsSvc<T: TemplateService>(pub Arc<T>);
16229 impl<
16230 T: TemplateService,
16231 > tonic::server::UnaryService<super::ListTemplateTranslationsRequest>
16232 for ListTemplateTranslationsSvc<T> {
16233 type Response = super::ListTemplateTranslationsResponse;
16234 type Future = BoxFuture<
16235 tonic::Response<Self::Response>,
16236 tonic::Status,
16237 >;
16238 fn call(
16239 &mut self,
16240 request: tonic::Request<
16241 super::ListTemplateTranslationsRequest,
16242 >,
16243 ) -> Self::Future {
16244 let inner = Arc::clone(&self.0);
16245 let fut = async move {
16246 <T as TemplateService>::list_template_translations(
16247 &inner,
16248 request,
16249 )
16250 .await
16251 };
16252 Box::pin(fut)
16253 }
16254 }
16255 let accept_compression_encodings = self.accept_compression_encodings;
16256 let send_compression_encodings = self.send_compression_encodings;
16257 let max_decoding_message_size = self.max_decoding_message_size;
16258 let max_encoding_message_size = self.max_encoding_message_size;
16259 let inner = self.inner.clone();
16260 let fut = async move {
16261 let method = ListTemplateTranslationsSvc(inner);
16262 let codec = tonic_prost::ProstCodec::default();
16263 let mut grpc = tonic::server::Grpc::new(codec)
16264 .apply_compression_config(
16265 accept_compression_encodings,
16266 send_compression_encodings,
16267 )
16268 .apply_max_message_size_config(
16269 max_decoding_message_size,
16270 max_encoding_message_size,
16271 );
16272 let res = grpc.unary(method, req).await;
16273 Ok(res)
16274 };
16275 Box::pin(fut)
16276 }
16277 "/pidgr.v1.TemplateService/ApproveTemplateTranslation" => {
16278 #[allow(non_camel_case_types)]
16279 struct ApproveTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
16280 impl<
16281 T: TemplateService,
16282 > tonic::server::UnaryService<
16283 super::ApproveTemplateTranslationRequest,
16284 > for ApproveTemplateTranslationSvc<T> {
16285 type Response = super::ApproveTemplateTranslationResponse;
16286 type Future = BoxFuture<
16287 tonic::Response<Self::Response>,
16288 tonic::Status,
16289 >;
16290 fn call(
16291 &mut self,
16292 request: tonic::Request<
16293 super::ApproveTemplateTranslationRequest,
16294 >,
16295 ) -> Self::Future {
16296 let inner = Arc::clone(&self.0);
16297 let fut = async move {
16298 <T as TemplateService>::approve_template_translation(
16299 &inner,
16300 request,
16301 )
16302 .await
16303 };
16304 Box::pin(fut)
16305 }
16306 }
16307 let accept_compression_encodings = self.accept_compression_encodings;
16308 let send_compression_encodings = self.send_compression_encodings;
16309 let max_decoding_message_size = self.max_decoding_message_size;
16310 let max_encoding_message_size = self.max_encoding_message_size;
16311 let inner = self.inner.clone();
16312 let fut = async move {
16313 let method = ApproveTemplateTranslationSvc(inner);
16314 let codec = tonic_prost::ProstCodec::default();
16315 let mut grpc = tonic::server::Grpc::new(codec)
16316 .apply_compression_config(
16317 accept_compression_encodings,
16318 send_compression_encodings,
16319 )
16320 .apply_max_message_size_config(
16321 max_decoding_message_size,
16322 max_encoding_message_size,
16323 );
16324 let res = grpc.unary(method, req).await;
16325 Ok(res)
16326 };
16327 Box::pin(fut)
16328 }
16329 _ => {
16330 Box::pin(async move {
16331 let mut response = http::Response::new(
16332 tonic::body::Body::default(),
16333 );
16334 let headers = response.headers_mut();
16335 headers
16336 .insert(
16337 tonic::Status::GRPC_STATUS,
16338 (tonic::Code::Unimplemented as i32).into(),
16339 );
16340 headers
16341 .insert(
16342 http::header::CONTENT_TYPE,
16343 tonic::metadata::GRPC_CONTENT_TYPE,
16344 );
16345 Ok(response)
16346 })
16347 }
16348 }
16349 }
16350 }
16351 impl<T> Clone for TemplateServiceServer<T> {
16352 fn clone(&self) -> Self {
16353 let inner = self.inner.clone();
16354 Self {
16355 inner,
16356 accept_compression_encodings: self.accept_compression_encodings,
16357 send_compression_encodings: self.send_compression_encodings,
16358 max_decoding_message_size: self.max_decoding_message_size,
16359 max_encoding_message_size: self.max_encoding_message_size,
16360 }
16361 }
16362 }
16363 pub const SERVICE_NAME: &str = "pidgr.v1.TemplateService";
16365 impl<T> tonic::server::NamedService for TemplateServiceServer<T> {
16366 const NAME: &'static str = SERVICE_NAME;
16367 }
16368}
16369pub mod token_service_client {
16371 #![allow(
16372 unused_variables,
16373 dead_code,
16374 missing_docs,
16375 clippy::wildcard_imports,
16376 clippy::let_unit_value,
16377 )]
16378 use tonic::codegen::*;
16379 use tonic::codegen::http::Uri;
16380 #[derive(Debug, Clone)]
16390 pub struct TokenServiceClient<T> {
16391 inner: tonic::client::Grpc<T>,
16392 }
16393 impl TokenServiceClient<tonic::transport::Channel> {
16394 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
16396 where
16397 D: TryInto<tonic::transport::Endpoint>,
16398 D::Error: Into<StdError>,
16399 {
16400 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
16401 Ok(Self::new(conn))
16402 }
16403 }
16404 impl<T> TokenServiceClient<T>
16405 where
16406 T: tonic::client::GrpcService<tonic::body::Body>,
16407 T::Error: Into<StdError>,
16408 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
16409 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
16410 {
16411 pub fn new(inner: T) -> Self {
16412 let inner = tonic::client::Grpc::new(inner);
16413 Self { inner }
16414 }
16415 pub fn with_origin(inner: T, origin: Uri) -> Self {
16416 let inner = tonic::client::Grpc::with_origin(inner, origin);
16417 Self { inner }
16418 }
16419 pub fn with_interceptor<F>(
16420 inner: T,
16421 interceptor: F,
16422 ) -> TokenServiceClient<InterceptedService<T, F>>
16423 where
16424 F: tonic::service::Interceptor,
16425 T::ResponseBody: Default,
16426 T: tonic::codegen::Service<
16427 http::Request<tonic::body::Body>,
16428 Response = http::Response<
16429 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
16430 >,
16431 >,
16432 <T as tonic::codegen::Service<
16433 http::Request<tonic::body::Body>,
16434 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
16435 {
16436 TokenServiceClient::new(InterceptedService::new(inner, interceptor))
16437 }
16438 #[must_use]
16443 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
16444 self.inner = self.inner.send_compressed(encoding);
16445 self
16446 }
16447 #[must_use]
16449 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
16450 self.inner = self.inner.accept_compressed(encoding);
16451 self
16452 }
16453 #[must_use]
16457 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
16458 self.inner = self.inner.max_decoding_message_size(limit);
16459 self
16460 }
16461 #[must_use]
16465 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
16466 self.inner = self.inner.max_encoding_message_size(limit);
16467 self
16468 }
16469 pub async fn sign_deeplink_token(
16474 &mut self,
16475 request: impl tonic::IntoRequest<super::SignDeeplinkTokenRequest>,
16476 ) -> std::result::Result<
16477 tonic::Response<super::SignDeeplinkTokenResponse>,
16478 tonic::Status,
16479 > {
16480 self.inner
16481 .ready()
16482 .await
16483 .map_err(|e| {
16484 tonic::Status::unknown(
16485 format!("Service was not ready: {}", e.into()),
16486 )
16487 })?;
16488 let codec = tonic_prost::ProstCodec::default();
16489 let path = http::uri::PathAndQuery::from_static(
16490 "/pidgr.v1.TokenService/SignDeeplinkToken",
16491 );
16492 let mut req = request.into_request();
16493 req.extensions_mut()
16494 .insert(GrpcMethod::new("pidgr.v1.TokenService", "SignDeeplinkToken"));
16495 self.inner.unary(req, path, codec).await
16496 }
16497 pub async fn validate_deeplink_token(
16502 &mut self,
16503 request: impl tonic::IntoRequest<super::ValidateDeeplinkTokenRequest>,
16504 ) -> std::result::Result<
16505 tonic::Response<super::ValidateDeeplinkTokenResponse>,
16506 tonic::Status,
16507 > {
16508 self.inner
16509 .ready()
16510 .await
16511 .map_err(|e| {
16512 tonic::Status::unknown(
16513 format!("Service was not ready: {}", e.into()),
16514 )
16515 })?;
16516 let codec = tonic_prost::ProstCodec::default();
16517 let path = http::uri::PathAndQuery::from_static(
16518 "/pidgr.v1.TokenService/ValidateDeeplinkToken",
16519 );
16520 let mut req = request.into_request();
16521 req.extensions_mut()
16522 .insert(
16523 GrpcMethod::new("pidgr.v1.TokenService", "ValidateDeeplinkToken"),
16524 );
16525 self.inner.unary(req, path, codec).await
16526 }
16527 }
16528}
16529pub mod token_service_server {
16531 #![allow(
16532 unused_variables,
16533 dead_code,
16534 missing_docs,
16535 clippy::wildcard_imports,
16536 clippy::let_unit_value,
16537 )]
16538 use tonic::codegen::*;
16539 #[async_trait]
16541 pub trait TokenService: std::marker::Send + std::marker::Sync + 'static {
16542 async fn sign_deeplink_token(
16547 &self,
16548 request: tonic::Request<super::SignDeeplinkTokenRequest>,
16549 ) -> std::result::Result<
16550 tonic::Response<super::SignDeeplinkTokenResponse>,
16551 tonic::Status,
16552 >;
16553 async fn validate_deeplink_token(
16558 &self,
16559 request: tonic::Request<super::ValidateDeeplinkTokenRequest>,
16560 ) -> std::result::Result<
16561 tonic::Response<super::ValidateDeeplinkTokenResponse>,
16562 tonic::Status,
16563 >;
16564 }
16565 #[derive(Debug)]
16575 pub struct TokenServiceServer<T> {
16576 inner: Arc<T>,
16577 accept_compression_encodings: EnabledCompressionEncodings,
16578 send_compression_encodings: EnabledCompressionEncodings,
16579 max_decoding_message_size: Option<usize>,
16580 max_encoding_message_size: Option<usize>,
16581 }
16582 impl<T> TokenServiceServer<T> {
16583 pub fn new(inner: T) -> Self {
16584 Self::from_arc(Arc::new(inner))
16585 }
16586 pub fn from_arc(inner: Arc<T>) -> Self {
16587 Self {
16588 inner,
16589 accept_compression_encodings: Default::default(),
16590 send_compression_encodings: Default::default(),
16591 max_decoding_message_size: None,
16592 max_encoding_message_size: None,
16593 }
16594 }
16595 pub fn with_interceptor<F>(
16596 inner: T,
16597 interceptor: F,
16598 ) -> InterceptedService<Self, F>
16599 where
16600 F: tonic::service::Interceptor,
16601 {
16602 InterceptedService::new(Self::new(inner), interceptor)
16603 }
16604 #[must_use]
16606 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
16607 self.accept_compression_encodings.enable(encoding);
16608 self
16609 }
16610 #[must_use]
16612 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
16613 self.send_compression_encodings.enable(encoding);
16614 self
16615 }
16616 #[must_use]
16620 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
16621 self.max_decoding_message_size = Some(limit);
16622 self
16623 }
16624 #[must_use]
16628 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
16629 self.max_encoding_message_size = Some(limit);
16630 self
16631 }
16632 }
16633 impl<T, B> tonic::codegen::Service<http::Request<B>> for TokenServiceServer<T>
16634 where
16635 T: TokenService,
16636 B: Body + std::marker::Send + 'static,
16637 B::Error: Into<StdError> + std::marker::Send + 'static,
16638 {
16639 type Response = http::Response<tonic::body::Body>;
16640 type Error = std::convert::Infallible;
16641 type Future = BoxFuture<Self::Response, Self::Error>;
16642 fn poll_ready(
16643 &mut self,
16644 _cx: &mut Context<'_>,
16645 ) -> Poll<std::result::Result<(), Self::Error>> {
16646 Poll::Ready(Ok(()))
16647 }
16648 fn call(&mut self, req: http::Request<B>) -> Self::Future {
16649 match req.uri().path() {
16650 "/pidgr.v1.TokenService/SignDeeplinkToken" => {
16651 #[allow(non_camel_case_types)]
16652 struct SignDeeplinkTokenSvc<T: TokenService>(pub Arc<T>);
16653 impl<
16654 T: TokenService,
16655 > tonic::server::UnaryService<super::SignDeeplinkTokenRequest>
16656 for SignDeeplinkTokenSvc<T> {
16657 type Response = super::SignDeeplinkTokenResponse;
16658 type Future = BoxFuture<
16659 tonic::Response<Self::Response>,
16660 tonic::Status,
16661 >;
16662 fn call(
16663 &mut self,
16664 request: tonic::Request<super::SignDeeplinkTokenRequest>,
16665 ) -> Self::Future {
16666 let inner = Arc::clone(&self.0);
16667 let fut = async move {
16668 <T as TokenService>::sign_deeplink_token(&inner, request)
16669 .await
16670 };
16671 Box::pin(fut)
16672 }
16673 }
16674 let accept_compression_encodings = self.accept_compression_encodings;
16675 let send_compression_encodings = self.send_compression_encodings;
16676 let max_decoding_message_size = self.max_decoding_message_size;
16677 let max_encoding_message_size = self.max_encoding_message_size;
16678 let inner = self.inner.clone();
16679 let fut = async move {
16680 let method = SignDeeplinkTokenSvc(inner);
16681 let codec = tonic_prost::ProstCodec::default();
16682 let mut grpc = tonic::server::Grpc::new(codec)
16683 .apply_compression_config(
16684 accept_compression_encodings,
16685 send_compression_encodings,
16686 )
16687 .apply_max_message_size_config(
16688 max_decoding_message_size,
16689 max_encoding_message_size,
16690 );
16691 let res = grpc.unary(method, req).await;
16692 Ok(res)
16693 };
16694 Box::pin(fut)
16695 }
16696 "/pidgr.v1.TokenService/ValidateDeeplinkToken" => {
16697 #[allow(non_camel_case_types)]
16698 struct ValidateDeeplinkTokenSvc<T: TokenService>(pub Arc<T>);
16699 impl<
16700 T: TokenService,
16701 > tonic::server::UnaryService<super::ValidateDeeplinkTokenRequest>
16702 for ValidateDeeplinkTokenSvc<T> {
16703 type Response = super::ValidateDeeplinkTokenResponse;
16704 type Future = BoxFuture<
16705 tonic::Response<Self::Response>,
16706 tonic::Status,
16707 >;
16708 fn call(
16709 &mut self,
16710 request: tonic::Request<super::ValidateDeeplinkTokenRequest>,
16711 ) -> Self::Future {
16712 let inner = Arc::clone(&self.0);
16713 let fut = async move {
16714 <T as TokenService>::validate_deeplink_token(
16715 &inner,
16716 request,
16717 )
16718 .await
16719 };
16720 Box::pin(fut)
16721 }
16722 }
16723 let accept_compression_encodings = self.accept_compression_encodings;
16724 let send_compression_encodings = self.send_compression_encodings;
16725 let max_decoding_message_size = self.max_decoding_message_size;
16726 let max_encoding_message_size = self.max_encoding_message_size;
16727 let inner = self.inner.clone();
16728 let fut = async move {
16729 let method = ValidateDeeplinkTokenSvc(inner);
16730 let codec = tonic_prost::ProstCodec::default();
16731 let mut grpc = tonic::server::Grpc::new(codec)
16732 .apply_compression_config(
16733 accept_compression_encodings,
16734 send_compression_encodings,
16735 )
16736 .apply_max_message_size_config(
16737 max_decoding_message_size,
16738 max_encoding_message_size,
16739 );
16740 let res = grpc.unary(method, req).await;
16741 Ok(res)
16742 };
16743 Box::pin(fut)
16744 }
16745 _ => {
16746 Box::pin(async move {
16747 let mut response = http::Response::new(
16748 tonic::body::Body::default(),
16749 );
16750 let headers = response.headers_mut();
16751 headers
16752 .insert(
16753 tonic::Status::GRPC_STATUS,
16754 (tonic::Code::Unimplemented as i32).into(),
16755 );
16756 headers
16757 .insert(
16758 http::header::CONTENT_TYPE,
16759 tonic::metadata::GRPC_CONTENT_TYPE,
16760 );
16761 Ok(response)
16762 })
16763 }
16764 }
16765 }
16766 }
16767 impl<T> Clone for TokenServiceServer<T> {
16768 fn clone(&self) -> Self {
16769 let inner = self.inner.clone();
16770 Self {
16771 inner,
16772 accept_compression_encodings: self.accept_compression_encodings,
16773 send_compression_encodings: self.send_compression_encodings,
16774 max_decoding_message_size: self.max_decoding_message_size,
16775 max_encoding_message_size: self.max_encoding_message_size,
16776 }
16777 }
16778 }
16779 pub const SERVICE_NAME: &str = "pidgr.v1.TokenService";
16781 impl<T> tonic::server::NamedService for TokenServiceServer<T> {
16782 const NAME: &'static str = SERVICE_NAME;
16783 }
16784}