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 authorization_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)]
3021 pub struct AuthorizationServiceClient<T> {
3022 inner: tonic::client::Grpc<T>,
3023 }
3024 impl AuthorizationServiceClient<tonic::transport::Channel> {
3025 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
3027 where
3028 D: TryInto<tonic::transport::Endpoint>,
3029 D::Error: Into<StdError>,
3030 {
3031 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
3032 Ok(Self::new(conn))
3033 }
3034 }
3035 impl<T> AuthorizationServiceClient<T>
3036 where
3037 T: tonic::client::GrpcService<tonic::body::Body>,
3038 T::Error: Into<StdError>,
3039 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
3040 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
3041 {
3042 pub fn new(inner: T) -> Self {
3043 let inner = tonic::client::Grpc::new(inner);
3044 Self { inner }
3045 }
3046 pub fn with_origin(inner: T, origin: Uri) -> Self {
3047 let inner = tonic::client::Grpc::with_origin(inner, origin);
3048 Self { inner }
3049 }
3050 pub fn with_interceptor<F>(
3051 inner: T,
3052 interceptor: F,
3053 ) -> AuthorizationServiceClient<InterceptedService<T, F>>
3054 where
3055 F: tonic::service::Interceptor,
3056 T::ResponseBody: Default,
3057 T: tonic::codegen::Service<
3058 http::Request<tonic::body::Body>,
3059 Response = http::Response<
3060 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
3061 >,
3062 >,
3063 <T as tonic::codegen::Service<
3064 http::Request<tonic::body::Body>,
3065 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
3066 {
3067 AuthorizationServiceClient::new(InterceptedService::new(inner, interceptor))
3068 }
3069 #[must_use]
3074 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3075 self.inner = self.inner.send_compressed(encoding);
3076 self
3077 }
3078 #[must_use]
3080 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3081 self.inner = self.inner.accept_compressed(encoding);
3082 self
3083 }
3084 #[must_use]
3088 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3089 self.inner = self.inner.max_decoding_message_size(limit);
3090 self
3091 }
3092 #[must_use]
3096 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3097 self.inner = self.inner.max_encoding_message_size(limit);
3098 self
3099 }
3100 pub async fn resolve_principal_permissions(
3103 &mut self,
3104 request: impl tonic::IntoRequest<super::ResolvePrincipalPermissionsRequest>,
3105 ) -> std::result::Result<
3106 tonic::Response<super::ResolvePrincipalPermissionsResponse>,
3107 tonic::Status,
3108 > {
3109 self.inner
3110 .ready()
3111 .await
3112 .map_err(|e| {
3113 tonic::Status::unknown(
3114 format!("Service was not ready: {}", e.into()),
3115 )
3116 })?;
3117 let codec = tonic_prost::ProstCodec::default();
3118 let path = http::uri::PathAndQuery::from_static(
3119 "/pidgr.v1.AuthorizationService/ResolvePrincipalPermissions",
3120 );
3121 let mut req = request.into_request();
3122 req.extensions_mut()
3123 .insert(
3124 GrpcMethod::new(
3125 "pidgr.v1.AuthorizationService",
3126 "ResolvePrincipalPermissions",
3127 ),
3128 );
3129 self.inner.unary(req, path, codec).await
3130 }
3131 pub async fn check_org_suspended(
3136 &mut self,
3137 request: impl tonic::IntoRequest<super::CheckOrgSuspendedRequest>,
3138 ) -> std::result::Result<
3139 tonic::Response<super::CheckOrgSuspendedResponse>,
3140 tonic::Status,
3141 > {
3142 self.inner
3143 .ready()
3144 .await
3145 .map_err(|e| {
3146 tonic::Status::unknown(
3147 format!("Service was not ready: {}", e.into()),
3148 )
3149 })?;
3150 let codec = tonic_prost::ProstCodec::default();
3151 let path = http::uri::PathAndQuery::from_static(
3152 "/pidgr.v1.AuthorizationService/CheckOrgSuspended",
3153 );
3154 let mut req = request.into_request();
3155 req.extensions_mut()
3156 .insert(
3157 GrpcMethod::new("pidgr.v1.AuthorizationService", "CheckOrgSuspended"),
3158 );
3159 self.inner.unary(req, path, codec).await
3160 }
3161 }
3162}
3163pub mod authorization_service_server {
3165 #![allow(
3166 unused_variables,
3167 dead_code,
3168 missing_docs,
3169 clippy::wildcard_imports,
3170 clippy::let_unit_value,
3171 )]
3172 use tonic::codegen::*;
3173 #[async_trait]
3175 pub trait AuthorizationService: std::marker::Send + std::marker::Sync + 'static {
3176 async fn resolve_principal_permissions(
3179 &self,
3180 request: tonic::Request<super::ResolvePrincipalPermissionsRequest>,
3181 ) -> std::result::Result<
3182 tonic::Response<super::ResolvePrincipalPermissionsResponse>,
3183 tonic::Status,
3184 >;
3185 async fn check_org_suspended(
3190 &self,
3191 request: tonic::Request<super::CheckOrgSuspendedRequest>,
3192 ) -> std::result::Result<
3193 tonic::Response<super::CheckOrgSuspendedResponse>,
3194 tonic::Status,
3195 >;
3196 }
3197 #[derive(Debug)]
3206 pub struct AuthorizationServiceServer<T> {
3207 inner: Arc<T>,
3208 accept_compression_encodings: EnabledCompressionEncodings,
3209 send_compression_encodings: EnabledCompressionEncodings,
3210 max_decoding_message_size: Option<usize>,
3211 max_encoding_message_size: Option<usize>,
3212 }
3213 impl<T> AuthorizationServiceServer<T> {
3214 pub fn new(inner: T) -> Self {
3215 Self::from_arc(Arc::new(inner))
3216 }
3217 pub fn from_arc(inner: Arc<T>) -> Self {
3218 Self {
3219 inner,
3220 accept_compression_encodings: Default::default(),
3221 send_compression_encodings: Default::default(),
3222 max_decoding_message_size: None,
3223 max_encoding_message_size: None,
3224 }
3225 }
3226 pub fn with_interceptor<F>(
3227 inner: T,
3228 interceptor: F,
3229 ) -> InterceptedService<Self, F>
3230 where
3231 F: tonic::service::Interceptor,
3232 {
3233 InterceptedService::new(Self::new(inner), interceptor)
3234 }
3235 #[must_use]
3237 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3238 self.accept_compression_encodings.enable(encoding);
3239 self
3240 }
3241 #[must_use]
3243 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3244 self.send_compression_encodings.enable(encoding);
3245 self
3246 }
3247 #[must_use]
3251 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3252 self.max_decoding_message_size = Some(limit);
3253 self
3254 }
3255 #[must_use]
3259 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3260 self.max_encoding_message_size = Some(limit);
3261 self
3262 }
3263 }
3264 impl<T, B> tonic::codegen::Service<http::Request<B>>
3265 for AuthorizationServiceServer<T>
3266 where
3267 T: AuthorizationService,
3268 B: Body + std::marker::Send + 'static,
3269 B::Error: Into<StdError> + std::marker::Send + 'static,
3270 {
3271 type Response = http::Response<tonic::body::Body>;
3272 type Error = std::convert::Infallible;
3273 type Future = BoxFuture<Self::Response, Self::Error>;
3274 fn poll_ready(
3275 &mut self,
3276 _cx: &mut Context<'_>,
3277 ) -> Poll<std::result::Result<(), Self::Error>> {
3278 Poll::Ready(Ok(()))
3279 }
3280 fn call(&mut self, req: http::Request<B>) -> Self::Future {
3281 match req.uri().path() {
3282 "/pidgr.v1.AuthorizationService/ResolvePrincipalPermissions" => {
3283 #[allow(non_camel_case_types)]
3284 struct ResolvePrincipalPermissionsSvc<T: AuthorizationService>(
3285 pub Arc<T>,
3286 );
3287 impl<
3288 T: AuthorizationService,
3289 > tonic::server::UnaryService<
3290 super::ResolvePrincipalPermissionsRequest,
3291 > for ResolvePrincipalPermissionsSvc<T> {
3292 type Response = super::ResolvePrincipalPermissionsResponse;
3293 type Future = BoxFuture<
3294 tonic::Response<Self::Response>,
3295 tonic::Status,
3296 >;
3297 fn call(
3298 &mut self,
3299 request: tonic::Request<
3300 super::ResolvePrincipalPermissionsRequest,
3301 >,
3302 ) -> Self::Future {
3303 let inner = Arc::clone(&self.0);
3304 let fut = async move {
3305 <T as AuthorizationService>::resolve_principal_permissions(
3306 &inner,
3307 request,
3308 )
3309 .await
3310 };
3311 Box::pin(fut)
3312 }
3313 }
3314 let accept_compression_encodings = self.accept_compression_encodings;
3315 let send_compression_encodings = self.send_compression_encodings;
3316 let max_decoding_message_size = self.max_decoding_message_size;
3317 let max_encoding_message_size = self.max_encoding_message_size;
3318 let inner = self.inner.clone();
3319 let fut = async move {
3320 let method = ResolvePrincipalPermissionsSvc(inner);
3321 let codec = tonic_prost::ProstCodec::default();
3322 let mut grpc = tonic::server::Grpc::new(codec)
3323 .apply_compression_config(
3324 accept_compression_encodings,
3325 send_compression_encodings,
3326 )
3327 .apply_max_message_size_config(
3328 max_decoding_message_size,
3329 max_encoding_message_size,
3330 );
3331 let res = grpc.unary(method, req).await;
3332 Ok(res)
3333 };
3334 Box::pin(fut)
3335 }
3336 "/pidgr.v1.AuthorizationService/CheckOrgSuspended" => {
3337 #[allow(non_camel_case_types)]
3338 struct CheckOrgSuspendedSvc<T: AuthorizationService>(pub Arc<T>);
3339 impl<
3340 T: AuthorizationService,
3341 > tonic::server::UnaryService<super::CheckOrgSuspendedRequest>
3342 for CheckOrgSuspendedSvc<T> {
3343 type Response = super::CheckOrgSuspendedResponse;
3344 type Future = BoxFuture<
3345 tonic::Response<Self::Response>,
3346 tonic::Status,
3347 >;
3348 fn call(
3349 &mut self,
3350 request: tonic::Request<super::CheckOrgSuspendedRequest>,
3351 ) -> Self::Future {
3352 let inner = Arc::clone(&self.0);
3353 let fut = async move {
3354 <T as AuthorizationService>::check_org_suspended(
3355 &inner,
3356 request,
3357 )
3358 .await
3359 };
3360 Box::pin(fut)
3361 }
3362 }
3363 let accept_compression_encodings = self.accept_compression_encodings;
3364 let send_compression_encodings = self.send_compression_encodings;
3365 let max_decoding_message_size = self.max_decoding_message_size;
3366 let max_encoding_message_size = self.max_encoding_message_size;
3367 let inner = self.inner.clone();
3368 let fut = async move {
3369 let method = CheckOrgSuspendedSvc(inner);
3370 let codec = tonic_prost::ProstCodec::default();
3371 let mut grpc = tonic::server::Grpc::new(codec)
3372 .apply_compression_config(
3373 accept_compression_encodings,
3374 send_compression_encodings,
3375 )
3376 .apply_max_message_size_config(
3377 max_decoding_message_size,
3378 max_encoding_message_size,
3379 );
3380 let res = grpc.unary(method, req).await;
3381 Ok(res)
3382 };
3383 Box::pin(fut)
3384 }
3385 _ => {
3386 Box::pin(async move {
3387 let mut response = http::Response::new(
3388 tonic::body::Body::default(),
3389 );
3390 let headers = response.headers_mut();
3391 headers
3392 .insert(
3393 tonic::Status::GRPC_STATUS,
3394 (tonic::Code::Unimplemented as i32).into(),
3395 );
3396 headers
3397 .insert(
3398 http::header::CONTENT_TYPE,
3399 tonic::metadata::GRPC_CONTENT_TYPE,
3400 );
3401 Ok(response)
3402 })
3403 }
3404 }
3405 }
3406 }
3407 impl<T> Clone for AuthorizationServiceServer<T> {
3408 fn clone(&self) -> Self {
3409 let inner = self.inner.clone();
3410 Self {
3411 inner,
3412 accept_compression_encodings: self.accept_compression_encodings,
3413 send_compression_encodings: self.send_compression_encodings,
3414 max_decoding_message_size: self.max_decoding_message_size,
3415 max_encoding_message_size: self.max_encoding_message_size,
3416 }
3417 }
3418 }
3419 pub const SERVICE_NAME: &str = "pidgr.v1.AuthorizationService";
3421 impl<T> tonic::server::NamedService for AuthorizationServiceServer<T> {
3422 const NAME: &'static str = SERVICE_NAME;
3423 }
3424}
3425pub mod campaign_service_client {
3427 #![allow(
3428 unused_variables,
3429 dead_code,
3430 missing_docs,
3431 clippy::wildcard_imports,
3432 clippy::let_unit_value,
3433 )]
3434 use tonic::codegen::*;
3435 use tonic::codegen::http::Uri;
3436 #[derive(Debug, Clone)]
3440 pub struct CampaignServiceClient<T> {
3441 inner: tonic::client::Grpc<T>,
3442 }
3443 impl CampaignServiceClient<tonic::transport::Channel> {
3444 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
3446 where
3447 D: TryInto<tonic::transport::Endpoint>,
3448 D::Error: Into<StdError>,
3449 {
3450 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
3451 Ok(Self::new(conn))
3452 }
3453 }
3454 impl<T> CampaignServiceClient<T>
3455 where
3456 T: tonic::client::GrpcService<tonic::body::Body>,
3457 T::Error: Into<StdError>,
3458 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
3459 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
3460 {
3461 pub fn new(inner: T) -> Self {
3462 let inner = tonic::client::Grpc::new(inner);
3463 Self { inner }
3464 }
3465 pub fn with_origin(inner: T, origin: Uri) -> Self {
3466 let inner = tonic::client::Grpc::with_origin(inner, origin);
3467 Self { inner }
3468 }
3469 pub fn with_interceptor<F>(
3470 inner: T,
3471 interceptor: F,
3472 ) -> CampaignServiceClient<InterceptedService<T, F>>
3473 where
3474 F: tonic::service::Interceptor,
3475 T::ResponseBody: Default,
3476 T: tonic::codegen::Service<
3477 http::Request<tonic::body::Body>,
3478 Response = http::Response<
3479 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
3480 >,
3481 >,
3482 <T as tonic::codegen::Service<
3483 http::Request<tonic::body::Body>,
3484 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
3485 {
3486 CampaignServiceClient::new(InterceptedService::new(inner, interceptor))
3487 }
3488 #[must_use]
3493 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3494 self.inner = self.inner.send_compressed(encoding);
3495 self
3496 }
3497 #[must_use]
3499 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3500 self.inner = self.inner.accept_compressed(encoding);
3501 self
3502 }
3503 #[must_use]
3507 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3508 self.inner = self.inner.max_decoding_message_size(limit);
3509 self
3510 }
3511 #[must_use]
3515 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3516 self.inner = self.inner.max_encoding_message_size(limit);
3517 self
3518 }
3519 pub async fn create_campaign(
3523 &mut self,
3524 request: impl tonic::IntoRequest<super::CreateCampaignRequest>,
3525 ) -> std::result::Result<
3526 tonic::Response<super::CreateCampaignResponse>,
3527 tonic::Status,
3528 > {
3529 self.inner
3530 .ready()
3531 .await
3532 .map_err(|e| {
3533 tonic::Status::unknown(
3534 format!("Service was not ready: {}", e.into()),
3535 )
3536 })?;
3537 let codec = tonic_prost::ProstCodec::default();
3538 let path = http::uri::PathAndQuery::from_static(
3539 "/pidgr.v1.CampaignService/CreateCampaign",
3540 );
3541 let mut req = request.into_request();
3542 req.extensions_mut()
3543 .insert(GrpcMethod::new("pidgr.v1.CampaignService", "CreateCampaign"));
3544 self.inner.unary(req, path, codec).await
3545 }
3546 pub async fn start_campaign(
3550 &mut self,
3551 request: impl tonic::IntoRequest<super::StartCampaignRequest>,
3552 ) -> std::result::Result<
3553 tonic::Response<super::StartCampaignResponse>,
3554 tonic::Status,
3555 > {
3556 self.inner
3557 .ready()
3558 .await
3559 .map_err(|e| {
3560 tonic::Status::unknown(
3561 format!("Service was not ready: {}", e.into()),
3562 )
3563 })?;
3564 let codec = tonic_prost::ProstCodec::default();
3565 let path = http::uri::PathAndQuery::from_static(
3566 "/pidgr.v1.CampaignService/StartCampaign",
3567 );
3568 let mut req = request.into_request();
3569 req.extensions_mut()
3570 .insert(GrpcMethod::new("pidgr.v1.CampaignService", "StartCampaign"));
3571 self.inner.unary(req, path, codec).await
3572 }
3573 pub async fn get_campaign(
3577 &mut self,
3578 request: impl tonic::IntoRequest<super::GetCampaignRequest>,
3579 ) -> std::result::Result<
3580 tonic::Response<super::GetCampaignResponse>,
3581 tonic::Status,
3582 > {
3583 self.inner
3584 .ready()
3585 .await
3586 .map_err(|e| {
3587 tonic::Status::unknown(
3588 format!("Service was not ready: {}", e.into()),
3589 )
3590 })?;
3591 let codec = tonic_prost::ProstCodec::default();
3592 let path = http::uri::PathAndQuery::from_static(
3593 "/pidgr.v1.CampaignService/GetCampaign",
3594 );
3595 let mut req = request.into_request();
3596 req.extensions_mut()
3597 .insert(GrpcMethod::new("pidgr.v1.CampaignService", "GetCampaign"));
3598 self.inner.unary(req, path, codec).await
3599 }
3600 pub async fn list_campaigns(
3604 &mut self,
3605 request: impl tonic::IntoRequest<super::ListCampaignsRequest>,
3606 ) -> std::result::Result<
3607 tonic::Response<super::ListCampaignsResponse>,
3608 tonic::Status,
3609 > {
3610 self.inner
3611 .ready()
3612 .await
3613 .map_err(|e| {
3614 tonic::Status::unknown(
3615 format!("Service was not ready: {}", e.into()),
3616 )
3617 })?;
3618 let codec = tonic_prost::ProstCodec::default();
3619 let path = http::uri::PathAndQuery::from_static(
3620 "/pidgr.v1.CampaignService/ListCampaigns",
3621 );
3622 let mut req = request.into_request();
3623 req.extensions_mut()
3624 .insert(GrpcMethod::new("pidgr.v1.CampaignService", "ListCampaigns"));
3625 self.inner.unary(req, path, codec).await
3626 }
3627 pub async fn update_campaign(
3631 &mut self,
3632 request: impl tonic::IntoRequest<super::UpdateCampaignRequest>,
3633 ) -> std::result::Result<
3634 tonic::Response<super::UpdateCampaignResponse>,
3635 tonic::Status,
3636 > {
3637 self.inner
3638 .ready()
3639 .await
3640 .map_err(|e| {
3641 tonic::Status::unknown(
3642 format!("Service was not ready: {}", e.into()),
3643 )
3644 })?;
3645 let codec = tonic_prost::ProstCodec::default();
3646 let path = http::uri::PathAndQuery::from_static(
3647 "/pidgr.v1.CampaignService/UpdateCampaign",
3648 );
3649 let mut req = request.into_request();
3650 req.extensions_mut()
3651 .insert(GrpcMethod::new("pidgr.v1.CampaignService", "UpdateCampaign"));
3652 self.inner.unary(req, path, codec).await
3653 }
3654 pub async fn get_campaign_audience(
3660 &mut self,
3661 request: impl tonic::IntoRequest<super::GetCampaignAudienceRequest>,
3662 ) -> std::result::Result<
3663 tonic::Response<super::GetCampaignAudienceResponse>,
3664 tonic::Status,
3665 > {
3666 self.inner
3667 .ready()
3668 .await
3669 .map_err(|e| {
3670 tonic::Status::unknown(
3671 format!("Service was not ready: {}", e.into()),
3672 )
3673 })?;
3674 let codec = tonic_prost::ProstCodec::default();
3675 let path = http::uri::PathAndQuery::from_static(
3676 "/pidgr.v1.CampaignService/GetCampaignAudience",
3677 );
3678 let mut req = request.into_request();
3679 req.extensions_mut()
3680 .insert(
3681 GrpcMethod::new("pidgr.v1.CampaignService", "GetCampaignAudience"),
3682 );
3683 self.inner.unary(req, path, codec).await
3684 }
3685 pub async fn cancel_campaign(
3689 &mut self,
3690 request: impl tonic::IntoRequest<super::CancelCampaignRequest>,
3691 ) -> std::result::Result<
3692 tonic::Response<super::CancelCampaignResponse>,
3693 tonic::Status,
3694 > {
3695 self.inner
3696 .ready()
3697 .await
3698 .map_err(|e| {
3699 tonic::Status::unknown(
3700 format!("Service was not ready: {}", e.into()),
3701 )
3702 })?;
3703 let codec = tonic_prost::ProstCodec::default();
3704 let path = http::uri::PathAndQuery::from_static(
3705 "/pidgr.v1.CampaignService/CancelCampaign",
3706 );
3707 let mut req = request.into_request();
3708 req.extensions_mut()
3709 .insert(GrpcMethod::new("pidgr.v1.CampaignService", "CancelCampaign"));
3710 self.inner.unary(req, path, codec).await
3711 }
3712 pub async fn list_deliveries(
3716 &mut self,
3717 request: impl tonic::IntoRequest<super::ListDeliveriesRequest>,
3718 ) -> std::result::Result<
3719 tonic::Response<super::ListDeliveriesResponse>,
3720 tonic::Status,
3721 > {
3722 self.inner
3723 .ready()
3724 .await
3725 .map_err(|e| {
3726 tonic::Status::unknown(
3727 format!("Service was not ready: {}", e.into()),
3728 )
3729 })?;
3730 let codec = tonic_prost::ProstCodec::default();
3731 let path = http::uri::PathAndQuery::from_static(
3732 "/pidgr.v1.CampaignService/ListDeliveries",
3733 );
3734 let mut req = request.into_request();
3735 req.extensions_mut()
3736 .insert(GrpcMethod::new("pidgr.v1.CampaignService", "ListDeliveries"));
3737 self.inner.unary(req, path, codec).await
3738 }
3739 pub async fn get_campaign_archetype_breakdown(
3745 &mut self,
3746 request: impl tonic::IntoRequest<super::GetCampaignArchetypeBreakdownRequest>,
3747 ) -> std::result::Result<
3748 tonic::Response<super::GetCampaignArchetypeBreakdownResponse>,
3749 tonic::Status,
3750 > {
3751 self.inner
3752 .ready()
3753 .await
3754 .map_err(|e| {
3755 tonic::Status::unknown(
3756 format!("Service was not ready: {}", e.into()),
3757 )
3758 })?;
3759 let codec = tonic_prost::ProstCodec::default();
3760 let path = http::uri::PathAndQuery::from_static(
3761 "/pidgr.v1.CampaignService/GetCampaignArchetypeBreakdown",
3762 );
3763 let mut req = request.into_request();
3764 req.extensions_mut()
3765 .insert(
3766 GrpcMethod::new(
3767 "pidgr.v1.CampaignService",
3768 "GetCampaignArchetypeBreakdown",
3769 ),
3770 );
3771 self.inner.unary(req, path, codec).await
3772 }
3773 pub async fn resolve_or_create_short_code(
3781 &mut self,
3782 request: impl tonic::IntoRequest<super::ResolveOrCreateShortCodeRequest>,
3783 ) -> std::result::Result<
3784 tonic::Response<super::ResolveOrCreateShortCodeResponse>,
3785 tonic::Status,
3786 > {
3787 self.inner
3788 .ready()
3789 .await
3790 .map_err(|e| {
3791 tonic::Status::unknown(
3792 format!("Service was not ready: {}", e.into()),
3793 )
3794 })?;
3795 let codec = tonic_prost::ProstCodec::default();
3796 let path = http::uri::PathAndQuery::from_static(
3797 "/pidgr.v1.CampaignService/ResolveOrCreateShortCode",
3798 );
3799 let mut req = request.into_request();
3800 req.extensions_mut()
3801 .insert(
3802 GrpcMethod::new(
3803 "pidgr.v1.CampaignService",
3804 "ResolveOrCreateShortCode",
3805 ),
3806 );
3807 self.inner.unary(req, path, codec).await
3808 }
3809 pub async fn get_campaign_by_short_code(
3818 &mut self,
3819 request: impl tonic::IntoRequest<super::GetCampaignByShortCodeRequest>,
3820 ) -> std::result::Result<
3821 tonic::Response<super::GetCampaignByShortCodeResponse>,
3822 tonic::Status,
3823 > {
3824 self.inner
3825 .ready()
3826 .await
3827 .map_err(|e| {
3828 tonic::Status::unknown(
3829 format!("Service was not ready: {}", e.into()),
3830 )
3831 })?;
3832 let codec = tonic_prost::ProstCodec::default();
3833 let path = http::uri::PathAndQuery::from_static(
3834 "/pidgr.v1.CampaignService/GetCampaignByShortCode",
3835 );
3836 let mut req = request.into_request();
3837 req.extensions_mut()
3838 .insert(
3839 GrpcMethod::new("pidgr.v1.CampaignService", "GetCampaignByShortCode"),
3840 );
3841 self.inner.unary(req, path, codec).await
3842 }
3843 }
3844}
3845pub mod campaign_service_server {
3847 #![allow(
3848 unused_variables,
3849 dead_code,
3850 missing_docs,
3851 clippy::wildcard_imports,
3852 clippy::let_unit_value,
3853 )]
3854 use tonic::codegen::*;
3855 #[async_trait]
3857 pub trait CampaignService: std::marker::Send + std::marker::Sync + 'static {
3858 async fn create_campaign(
3862 &self,
3863 request: tonic::Request<super::CreateCampaignRequest>,
3864 ) -> std::result::Result<
3865 tonic::Response<super::CreateCampaignResponse>,
3866 tonic::Status,
3867 >;
3868 async fn start_campaign(
3872 &self,
3873 request: tonic::Request<super::StartCampaignRequest>,
3874 ) -> std::result::Result<
3875 tonic::Response<super::StartCampaignResponse>,
3876 tonic::Status,
3877 >;
3878 async fn get_campaign(
3882 &self,
3883 request: tonic::Request<super::GetCampaignRequest>,
3884 ) -> std::result::Result<
3885 tonic::Response<super::GetCampaignResponse>,
3886 tonic::Status,
3887 >;
3888 async fn list_campaigns(
3892 &self,
3893 request: tonic::Request<super::ListCampaignsRequest>,
3894 ) -> std::result::Result<
3895 tonic::Response<super::ListCampaignsResponse>,
3896 tonic::Status,
3897 >;
3898 async fn update_campaign(
3902 &self,
3903 request: tonic::Request<super::UpdateCampaignRequest>,
3904 ) -> std::result::Result<
3905 tonic::Response<super::UpdateCampaignResponse>,
3906 tonic::Status,
3907 >;
3908 async fn get_campaign_audience(
3914 &self,
3915 request: tonic::Request<super::GetCampaignAudienceRequest>,
3916 ) -> std::result::Result<
3917 tonic::Response<super::GetCampaignAudienceResponse>,
3918 tonic::Status,
3919 >;
3920 async fn cancel_campaign(
3924 &self,
3925 request: tonic::Request<super::CancelCampaignRequest>,
3926 ) -> std::result::Result<
3927 tonic::Response<super::CancelCampaignResponse>,
3928 tonic::Status,
3929 >;
3930 async fn list_deliveries(
3934 &self,
3935 request: tonic::Request<super::ListDeliveriesRequest>,
3936 ) -> std::result::Result<
3937 tonic::Response<super::ListDeliveriesResponse>,
3938 tonic::Status,
3939 >;
3940 async fn get_campaign_archetype_breakdown(
3946 &self,
3947 request: tonic::Request<super::GetCampaignArchetypeBreakdownRequest>,
3948 ) -> std::result::Result<
3949 tonic::Response<super::GetCampaignArchetypeBreakdownResponse>,
3950 tonic::Status,
3951 >;
3952 async fn resolve_or_create_short_code(
3960 &self,
3961 request: tonic::Request<super::ResolveOrCreateShortCodeRequest>,
3962 ) -> std::result::Result<
3963 tonic::Response<super::ResolveOrCreateShortCodeResponse>,
3964 tonic::Status,
3965 >;
3966 async fn get_campaign_by_short_code(
3975 &self,
3976 request: tonic::Request<super::GetCampaignByShortCodeRequest>,
3977 ) -> std::result::Result<
3978 tonic::Response<super::GetCampaignByShortCodeResponse>,
3979 tonic::Status,
3980 >;
3981 }
3982 #[derive(Debug)]
3986 pub struct CampaignServiceServer<T> {
3987 inner: Arc<T>,
3988 accept_compression_encodings: EnabledCompressionEncodings,
3989 send_compression_encodings: EnabledCompressionEncodings,
3990 max_decoding_message_size: Option<usize>,
3991 max_encoding_message_size: Option<usize>,
3992 }
3993 impl<T> CampaignServiceServer<T> {
3994 pub fn new(inner: T) -> Self {
3995 Self::from_arc(Arc::new(inner))
3996 }
3997 pub fn from_arc(inner: Arc<T>) -> Self {
3998 Self {
3999 inner,
4000 accept_compression_encodings: Default::default(),
4001 send_compression_encodings: Default::default(),
4002 max_decoding_message_size: None,
4003 max_encoding_message_size: None,
4004 }
4005 }
4006 pub fn with_interceptor<F>(
4007 inner: T,
4008 interceptor: F,
4009 ) -> InterceptedService<Self, F>
4010 where
4011 F: tonic::service::Interceptor,
4012 {
4013 InterceptedService::new(Self::new(inner), interceptor)
4014 }
4015 #[must_use]
4017 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4018 self.accept_compression_encodings.enable(encoding);
4019 self
4020 }
4021 #[must_use]
4023 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4024 self.send_compression_encodings.enable(encoding);
4025 self
4026 }
4027 #[must_use]
4031 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4032 self.max_decoding_message_size = Some(limit);
4033 self
4034 }
4035 #[must_use]
4039 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4040 self.max_encoding_message_size = Some(limit);
4041 self
4042 }
4043 }
4044 impl<T, B> tonic::codegen::Service<http::Request<B>> for CampaignServiceServer<T>
4045 where
4046 T: CampaignService,
4047 B: Body + std::marker::Send + 'static,
4048 B::Error: Into<StdError> + std::marker::Send + 'static,
4049 {
4050 type Response = http::Response<tonic::body::Body>;
4051 type Error = std::convert::Infallible;
4052 type Future = BoxFuture<Self::Response, Self::Error>;
4053 fn poll_ready(
4054 &mut self,
4055 _cx: &mut Context<'_>,
4056 ) -> Poll<std::result::Result<(), Self::Error>> {
4057 Poll::Ready(Ok(()))
4058 }
4059 fn call(&mut self, req: http::Request<B>) -> Self::Future {
4060 match req.uri().path() {
4061 "/pidgr.v1.CampaignService/CreateCampaign" => {
4062 #[allow(non_camel_case_types)]
4063 struct CreateCampaignSvc<T: CampaignService>(pub Arc<T>);
4064 impl<
4065 T: CampaignService,
4066 > tonic::server::UnaryService<super::CreateCampaignRequest>
4067 for CreateCampaignSvc<T> {
4068 type Response = super::CreateCampaignResponse;
4069 type Future = BoxFuture<
4070 tonic::Response<Self::Response>,
4071 tonic::Status,
4072 >;
4073 fn call(
4074 &mut self,
4075 request: tonic::Request<super::CreateCampaignRequest>,
4076 ) -> Self::Future {
4077 let inner = Arc::clone(&self.0);
4078 let fut = async move {
4079 <T as CampaignService>::create_campaign(&inner, request)
4080 .await
4081 };
4082 Box::pin(fut)
4083 }
4084 }
4085 let accept_compression_encodings = self.accept_compression_encodings;
4086 let send_compression_encodings = self.send_compression_encodings;
4087 let max_decoding_message_size = self.max_decoding_message_size;
4088 let max_encoding_message_size = self.max_encoding_message_size;
4089 let inner = self.inner.clone();
4090 let fut = async move {
4091 let method = CreateCampaignSvc(inner);
4092 let codec = tonic_prost::ProstCodec::default();
4093 let mut grpc = tonic::server::Grpc::new(codec)
4094 .apply_compression_config(
4095 accept_compression_encodings,
4096 send_compression_encodings,
4097 )
4098 .apply_max_message_size_config(
4099 max_decoding_message_size,
4100 max_encoding_message_size,
4101 );
4102 let res = grpc.unary(method, req).await;
4103 Ok(res)
4104 };
4105 Box::pin(fut)
4106 }
4107 "/pidgr.v1.CampaignService/StartCampaign" => {
4108 #[allow(non_camel_case_types)]
4109 struct StartCampaignSvc<T: CampaignService>(pub Arc<T>);
4110 impl<
4111 T: CampaignService,
4112 > tonic::server::UnaryService<super::StartCampaignRequest>
4113 for StartCampaignSvc<T> {
4114 type Response = super::StartCampaignResponse;
4115 type Future = BoxFuture<
4116 tonic::Response<Self::Response>,
4117 tonic::Status,
4118 >;
4119 fn call(
4120 &mut self,
4121 request: tonic::Request<super::StartCampaignRequest>,
4122 ) -> Self::Future {
4123 let inner = Arc::clone(&self.0);
4124 let fut = async move {
4125 <T as CampaignService>::start_campaign(&inner, request)
4126 .await
4127 };
4128 Box::pin(fut)
4129 }
4130 }
4131 let accept_compression_encodings = self.accept_compression_encodings;
4132 let send_compression_encodings = self.send_compression_encodings;
4133 let max_decoding_message_size = self.max_decoding_message_size;
4134 let max_encoding_message_size = self.max_encoding_message_size;
4135 let inner = self.inner.clone();
4136 let fut = async move {
4137 let method = StartCampaignSvc(inner);
4138 let codec = tonic_prost::ProstCodec::default();
4139 let mut grpc = tonic::server::Grpc::new(codec)
4140 .apply_compression_config(
4141 accept_compression_encodings,
4142 send_compression_encodings,
4143 )
4144 .apply_max_message_size_config(
4145 max_decoding_message_size,
4146 max_encoding_message_size,
4147 );
4148 let res = grpc.unary(method, req).await;
4149 Ok(res)
4150 };
4151 Box::pin(fut)
4152 }
4153 "/pidgr.v1.CampaignService/GetCampaign" => {
4154 #[allow(non_camel_case_types)]
4155 struct GetCampaignSvc<T: CampaignService>(pub Arc<T>);
4156 impl<
4157 T: CampaignService,
4158 > tonic::server::UnaryService<super::GetCampaignRequest>
4159 for GetCampaignSvc<T> {
4160 type Response = super::GetCampaignResponse;
4161 type Future = BoxFuture<
4162 tonic::Response<Self::Response>,
4163 tonic::Status,
4164 >;
4165 fn call(
4166 &mut self,
4167 request: tonic::Request<super::GetCampaignRequest>,
4168 ) -> Self::Future {
4169 let inner = Arc::clone(&self.0);
4170 let fut = async move {
4171 <T as CampaignService>::get_campaign(&inner, request).await
4172 };
4173 Box::pin(fut)
4174 }
4175 }
4176 let accept_compression_encodings = self.accept_compression_encodings;
4177 let send_compression_encodings = self.send_compression_encodings;
4178 let max_decoding_message_size = self.max_decoding_message_size;
4179 let max_encoding_message_size = self.max_encoding_message_size;
4180 let inner = self.inner.clone();
4181 let fut = async move {
4182 let method = GetCampaignSvc(inner);
4183 let codec = tonic_prost::ProstCodec::default();
4184 let mut grpc = tonic::server::Grpc::new(codec)
4185 .apply_compression_config(
4186 accept_compression_encodings,
4187 send_compression_encodings,
4188 )
4189 .apply_max_message_size_config(
4190 max_decoding_message_size,
4191 max_encoding_message_size,
4192 );
4193 let res = grpc.unary(method, req).await;
4194 Ok(res)
4195 };
4196 Box::pin(fut)
4197 }
4198 "/pidgr.v1.CampaignService/ListCampaigns" => {
4199 #[allow(non_camel_case_types)]
4200 struct ListCampaignsSvc<T: CampaignService>(pub Arc<T>);
4201 impl<
4202 T: CampaignService,
4203 > tonic::server::UnaryService<super::ListCampaignsRequest>
4204 for ListCampaignsSvc<T> {
4205 type Response = super::ListCampaignsResponse;
4206 type Future = BoxFuture<
4207 tonic::Response<Self::Response>,
4208 tonic::Status,
4209 >;
4210 fn call(
4211 &mut self,
4212 request: tonic::Request<super::ListCampaignsRequest>,
4213 ) -> Self::Future {
4214 let inner = Arc::clone(&self.0);
4215 let fut = async move {
4216 <T as CampaignService>::list_campaigns(&inner, request)
4217 .await
4218 };
4219 Box::pin(fut)
4220 }
4221 }
4222 let accept_compression_encodings = self.accept_compression_encodings;
4223 let send_compression_encodings = self.send_compression_encodings;
4224 let max_decoding_message_size = self.max_decoding_message_size;
4225 let max_encoding_message_size = self.max_encoding_message_size;
4226 let inner = self.inner.clone();
4227 let fut = async move {
4228 let method = ListCampaignsSvc(inner);
4229 let codec = tonic_prost::ProstCodec::default();
4230 let mut grpc = tonic::server::Grpc::new(codec)
4231 .apply_compression_config(
4232 accept_compression_encodings,
4233 send_compression_encodings,
4234 )
4235 .apply_max_message_size_config(
4236 max_decoding_message_size,
4237 max_encoding_message_size,
4238 );
4239 let res = grpc.unary(method, req).await;
4240 Ok(res)
4241 };
4242 Box::pin(fut)
4243 }
4244 "/pidgr.v1.CampaignService/UpdateCampaign" => {
4245 #[allow(non_camel_case_types)]
4246 struct UpdateCampaignSvc<T: CampaignService>(pub Arc<T>);
4247 impl<
4248 T: CampaignService,
4249 > tonic::server::UnaryService<super::UpdateCampaignRequest>
4250 for UpdateCampaignSvc<T> {
4251 type Response = super::UpdateCampaignResponse;
4252 type Future = BoxFuture<
4253 tonic::Response<Self::Response>,
4254 tonic::Status,
4255 >;
4256 fn call(
4257 &mut self,
4258 request: tonic::Request<super::UpdateCampaignRequest>,
4259 ) -> Self::Future {
4260 let inner = Arc::clone(&self.0);
4261 let fut = async move {
4262 <T as CampaignService>::update_campaign(&inner, request)
4263 .await
4264 };
4265 Box::pin(fut)
4266 }
4267 }
4268 let accept_compression_encodings = self.accept_compression_encodings;
4269 let send_compression_encodings = self.send_compression_encodings;
4270 let max_decoding_message_size = self.max_decoding_message_size;
4271 let max_encoding_message_size = self.max_encoding_message_size;
4272 let inner = self.inner.clone();
4273 let fut = async move {
4274 let method = UpdateCampaignSvc(inner);
4275 let codec = tonic_prost::ProstCodec::default();
4276 let mut grpc = tonic::server::Grpc::new(codec)
4277 .apply_compression_config(
4278 accept_compression_encodings,
4279 send_compression_encodings,
4280 )
4281 .apply_max_message_size_config(
4282 max_decoding_message_size,
4283 max_encoding_message_size,
4284 );
4285 let res = grpc.unary(method, req).await;
4286 Ok(res)
4287 };
4288 Box::pin(fut)
4289 }
4290 "/pidgr.v1.CampaignService/GetCampaignAudience" => {
4291 #[allow(non_camel_case_types)]
4292 struct GetCampaignAudienceSvc<T: CampaignService>(pub Arc<T>);
4293 impl<
4294 T: CampaignService,
4295 > tonic::server::UnaryService<super::GetCampaignAudienceRequest>
4296 for GetCampaignAudienceSvc<T> {
4297 type Response = super::GetCampaignAudienceResponse;
4298 type Future = BoxFuture<
4299 tonic::Response<Self::Response>,
4300 tonic::Status,
4301 >;
4302 fn call(
4303 &mut self,
4304 request: tonic::Request<super::GetCampaignAudienceRequest>,
4305 ) -> Self::Future {
4306 let inner = Arc::clone(&self.0);
4307 let fut = async move {
4308 <T as CampaignService>::get_campaign_audience(
4309 &inner,
4310 request,
4311 )
4312 .await
4313 };
4314 Box::pin(fut)
4315 }
4316 }
4317 let accept_compression_encodings = self.accept_compression_encodings;
4318 let send_compression_encodings = self.send_compression_encodings;
4319 let max_decoding_message_size = self.max_decoding_message_size;
4320 let max_encoding_message_size = self.max_encoding_message_size;
4321 let inner = self.inner.clone();
4322 let fut = async move {
4323 let method = GetCampaignAudienceSvc(inner);
4324 let codec = tonic_prost::ProstCodec::default();
4325 let mut grpc = tonic::server::Grpc::new(codec)
4326 .apply_compression_config(
4327 accept_compression_encodings,
4328 send_compression_encodings,
4329 )
4330 .apply_max_message_size_config(
4331 max_decoding_message_size,
4332 max_encoding_message_size,
4333 );
4334 let res = grpc.unary(method, req).await;
4335 Ok(res)
4336 };
4337 Box::pin(fut)
4338 }
4339 "/pidgr.v1.CampaignService/CancelCampaign" => {
4340 #[allow(non_camel_case_types)]
4341 struct CancelCampaignSvc<T: CampaignService>(pub Arc<T>);
4342 impl<
4343 T: CampaignService,
4344 > tonic::server::UnaryService<super::CancelCampaignRequest>
4345 for CancelCampaignSvc<T> {
4346 type Response = super::CancelCampaignResponse;
4347 type Future = BoxFuture<
4348 tonic::Response<Self::Response>,
4349 tonic::Status,
4350 >;
4351 fn call(
4352 &mut self,
4353 request: tonic::Request<super::CancelCampaignRequest>,
4354 ) -> Self::Future {
4355 let inner = Arc::clone(&self.0);
4356 let fut = async move {
4357 <T as CampaignService>::cancel_campaign(&inner, request)
4358 .await
4359 };
4360 Box::pin(fut)
4361 }
4362 }
4363 let accept_compression_encodings = self.accept_compression_encodings;
4364 let send_compression_encodings = self.send_compression_encodings;
4365 let max_decoding_message_size = self.max_decoding_message_size;
4366 let max_encoding_message_size = self.max_encoding_message_size;
4367 let inner = self.inner.clone();
4368 let fut = async move {
4369 let method = CancelCampaignSvc(inner);
4370 let codec = tonic_prost::ProstCodec::default();
4371 let mut grpc = tonic::server::Grpc::new(codec)
4372 .apply_compression_config(
4373 accept_compression_encodings,
4374 send_compression_encodings,
4375 )
4376 .apply_max_message_size_config(
4377 max_decoding_message_size,
4378 max_encoding_message_size,
4379 );
4380 let res = grpc.unary(method, req).await;
4381 Ok(res)
4382 };
4383 Box::pin(fut)
4384 }
4385 "/pidgr.v1.CampaignService/ListDeliveries" => {
4386 #[allow(non_camel_case_types)]
4387 struct ListDeliveriesSvc<T: CampaignService>(pub Arc<T>);
4388 impl<
4389 T: CampaignService,
4390 > tonic::server::UnaryService<super::ListDeliveriesRequest>
4391 for ListDeliveriesSvc<T> {
4392 type Response = super::ListDeliveriesResponse;
4393 type Future = BoxFuture<
4394 tonic::Response<Self::Response>,
4395 tonic::Status,
4396 >;
4397 fn call(
4398 &mut self,
4399 request: tonic::Request<super::ListDeliveriesRequest>,
4400 ) -> Self::Future {
4401 let inner = Arc::clone(&self.0);
4402 let fut = async move {
4403 <T as CampaignService>::list_deliveries(&inner, request)
4404 .await
4405 };
4406 Box::pin(fut)
4407 }
4408 }
4409 let accept_compression_encodings = self.accept_compression_encodings;
4410 let send_compression_encodings = self.send_compression_encodings;
4411 let max_decoding_message_size = self.max_decoding_message_size;
4412 let max_encoding_message_size = self.max_encoding_message_size;
4413 let inner = self.inner.clone();
4414 let fut = async move {
4415 let method = ListDeliveriesSvc(inner);
4416 let codec = tonic_prost::ProstCodec::default();
4417 let mut grpc = tonic::server::Grpc::new(codec)
4418 .apply_compression_config(
4419 accept_compression_encodings,
4420 send_compression_encodings,
4421 )
4422 .apply_max_message_size_config(
4423 max_decoding_message_size,
4424 max_encoding_message_size,
4425 );
4426 let res = grpc.unary(method, req).await;
4427 Ok(res)
4428 };
4429 Box::pin(fut)
4430 }
4431 "/pidgr.v1.CampaignService/GetCampaignArchetypeBreakdown" => {
4432 #[allow(non_camel_case_types)]
4433 struct GetCampaignArchetypeBreakdownSvc<T: CampaignService>(
4434 pub Arc<T>,
4435 );
4436 impl<
4437 T: CampaignService,
4438 > tonic::server::UnaryService<
4439 super::GetCampaignArchetypeBreakdownRequest,
4440 > for GetCampaignArchetypeBreakdownSvc<T> {
4441 type Response = super::GetCampaignArchetypeBreakdownResponse;
4442 type Future = BoxFuture<
4443 tonic::Response<Self::Response>,
4444 tonic::Status,
4445 >;
4446 fn call(
4447 &mut self,
4448 request: tonic::Request<
4449 super::GetCampaignArchetypeBreakdownRequest,
4450 >,
4451 ) -> Self::Future {
4452 let inner = Arc::clone(&self.0);
4453 let fut = async move {
4454 <T as CampaignService>::get_campaign_archetype_breakdown(
4455 &inner,
4456 request,
4457 )
4458 .await
4459 };
4460 Box::pin(fut)
4461 }
4462 }
4463 let accept_compression_encodings = self.accept_compression_encodings;
4464 let send_compression_encodings = self.send_compression_encodings;
4465 let max_decoding_message_size = self.max_decoding_message_size;
4466 let max_encoding_message_size = self.max_encoding_message_size;
4467 let inner = self.inner.clone();
4468 let fut = async move {
4469 let method = GetCampaignArchetypeBreakdownSvc(inner);
4470 let codec = tonic_prost::ProstCodec::default();
4471 let mut grpc = tonic::server::Grpc::new(codec)
4472 .apply_compression_config(
4473 accept_compression_encodings,
4474 send_compression_encodings,
4475 )
4476 .apply_max_message_size_config(
4477 max_decoding_message_size,
4478 max_encoding_message_size,
4479 );
4480 let res = grpc.unary(method, req).await;
4481 Ok(res)
4482 };
4483 Box::pin(fut)
4484 }
4485 "/pidgr.v1.CampaignService/ResolveOrCreateShortCode" => {
4486 #[allow(non_camel_case_types)]
4487 struct ResolveOrCreateShortCodeSvc<T: CampaignService>(pub Arc<T>);
4488 impl<
4489 T: CampaignService,
4490 > tonic::server::UnaryService<super::ResolveOrCreateShortCodeRequest>
4491 for ResolveOrCreateShortCodeSvc<T> {
4492 type Response = super::ResolveOrCreateShortCodeResponse;
4493 type Future = BoxFuture<
4494 tonic::Response<Self::Response>,
4495 tonic::Status,
4496 >;
4497 fn call(
4498 &mut self,
4499 request: tonic::Request<
4500 super::ResolveOrCreateShortCodeRequest,
4501 >,
4502 ) -> Self::Future {
4503 let inner = Arc::clone(&self.0);
4504 let fut = async move {
4505 <T as CampaignService>::resolve_or_create_short_code(
4506 &inner,
4507 request,
4508 )
4509 .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 = ResolveOrCreateShortCodeSvc(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.CampaignService/GetCampaignByShortCode" => {
4537 #[allow(non_camel_case_types)]
4538 struct GetCampaignByShortCodeSvc<T: CampaignService>(pub Arc<T>);
4539 impl<
4540 T: CampaignService,
4541 > tonic::server::UnaryService<super::GetCampaignByShortCodeRequest>
4542 for GetCampaignByShortCodeSvc<T> {
4543 type Response = super::GetCampaignByShortCodeResponse;
4544 type Future = BoxFuture<
4545 tonic::Response<Self::Response>,
4546 tonic::Status,
4547 >;
4548 fn call(
4549 &mut self,
4550 request: tonic::Request<super::GetCampaignByShortCodeRequest>,
4551 ) -> Self::Future {
4552 let inner = Arc::clone(&self.0);
4553 let fut = async move {
4554 <T as CampaignService>::get_campaign_by_short_code(
4555 &inner,
4556 request,
4557 )
4558 .await
4559 };
4560 Box::pin(fut)
4561 }
4562 }
4563 let accept_compression_encodings = self.accept_compression_encodings;
4564 let send_compression_encodings = self.send_compression_encodings;
4565 let max_decoding_message_size = self.max_decoding_message_size;
4566 let max_encoding_message_size = self.max_encoding_message_size;
4567 let inner = self.inner.clone();
4568 let fut = async move {
4569 let method = GetCampaignByShortCodeSvc(inner);
4570 let codec = tonic_prost::ProstCodec::default();
4571 let mut grpc = tonic::server::Grpc::new(codec)
4572 .apply_compression_config(
4573 accept_compression_encodings,
4574 send_compression_encodings,
4575 )
4576 .apply_max_message_size_config(
4577 max_decoding_message_size,
4578 max_encoding_message_size,
4579 );
4580 let res = grpc.unary(method, req).await;
4581 Ok(res)
4582 };
4583 Box::pin(fut)
4584 }
4585 _ => {
4586 Box::pin(async move {
4587 let mut response = http::Response::new(
4588 tonic::body::Body::default(),
4589 );
4590 let headers = response.headers_mut();
4591 headers
4592 .insert(
4593 tonic::Status::GRPC_STATUS,
4594 (tonic::Code::Unimplemented as i32).into(),
4595 );
4596 headers
4597 .insert(
4598 http::header::CONTENT_TYPE,
4599 tonic::metadata::GRPC_CONTENT_TYPE,
4600 );
4601 Ok(response)
4602 })
4603 }
4604 }
4605 }
4606 }
4607 impl<T> Clone for CampaignServiceServer<T> {
4608 fn clone(&self) -> Self {
4609 let inner = self.inner.clone();
4610 Self {
4611 inner,
4612 accept_compression_encodings: self.accept_compression_encodings,
4613 send_compression_encodings: self.send_compression_encodings,
4614 max_decoding_message_size: self.max_decoding_message_size,
4615 max_encoding_message_size: self.max_encoding_message_size,
4616 }
4617 }
4618 }
4619 pub const SERVICE_NAME: &str = "pidgr.v1.CampaignService";
4621 impl<T> tonic::server::NamedService for CampaignServiceServer<T> {
4622 const NAME: &'static str = SERVICE_NAME;
4623 }
4624}
4625pub mod device_service_client {
4627 #![allow(
4628 unused_variables,
4629 dead_code,
4630 missing_docs,
4631 clippy::wildcard_imports,
4632 clippy::let_unit_value,
4633 )]
4634 use tonic::codegen::*;
4635 use tonic::codegen::http::Uri;
4636 #[derive(Debug, Clone)]
4640 pub struct DeviceServiceClient<T> {
4641 inner: tonic::client::Grpc<T>,
4642 }
4643 impl DeviceServiceClient<tonic::transport::Channel> {
4644 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4646 where
4647 D: TryInto<tonic::transport::Endpoint>,
4648 D::Error: Into<StdError>,
4649 {
4650 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4651 Ok(Self::new(conn))
4652 }
4653 }
4654 impl<T> DeviceServiceClient<T>
4655 where
4656 T: tonic::client::GrpcService<tonic::body::Body>,
4657 T::Error: Into<StdError>,
4658 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4659 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4660 {
4661 pub fn new(inner: T) -> Self {
4662 let inner = tonic::client::Grpc::new(inner);
4663 Self { inner }
4664 }
4665 pub fn with_origin(inner: T, origin: Uri) -> Self {
4666 let inner = tonic::client::Grpc::with_origin(inner, origin);
4667 Self { inner }
4668 }
4669 pub fn with_interceptor<F>(
4670 inner: T,
4671 interceptor: F,
4672 ) -> DeviceServiceClient<InterceptedService<T, F>>
4673 where
4674 F: tonic::service::Interceptor,
4675 T::ResponseBody: Default,
4676 T: tonic::codegen::Service<
4677 http::Request<tonic::body::Body>,
4678 Response = http::Response<
4679 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4680 >,
4681 >,
4682 <T as tonic::codegen::Service<
4683 http::Request<tonic::body::Body>,
4684 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4685 {
4686 DeviceServiceClient::new(InterceptedService::new(inner, interceptor))
4687 }
4688 #[must_use]
4693 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4694 self.inner = self.inner.send_compressed(encoding);
4695 self
4696 }
4697 #[must_use]
4699 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4700 self.inner = self.inner.accept_compressed(encoding);
4701 self
4702 }
4703 #[must_use]
4707 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4708 self.inner = self.inner.max_decoding_message_size(limit);
4709 self
4710 }
4711 #[must_use]
4715 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4716 self.inner = self.inner.max_encoding_message_size(limit);
4717 self
4718 }
4719 pub async fn register(
4723 &mut self,
4724 request: impl tonic::IntoRequest<super::RegisterRequest>,
4725 ) -> std::result::Result<
4726 tonic::Response<super::RegisterResponse>,
4727 tonic::Status,
4728 > {
4729 self.inner
4730 .ready()
4731 .await
4732 .map_err(|e| {
4733 tonic::Status::unknown(
4734 format!("Service was not ready: {}", e.into()),
4735 )
4736 })?;
4737 let codec = tonic_prost::ProstCodec::default();
4738 let path = http::uri::PathAndQuery::from_static(
4739 "/pidgr.v1.DeviceService/Register",
4740 );
4741 let mut req = request.into_request();
4742 req.extensions_mut()
4743 .insert(GrpcMethod::new("pidgr.v1.DeviceService", "Register"));
4744 self.inner.unary(req, path, codec).await
4745 }
4746 pub async fn deactivate(
4750 &mut self,
4751 request: impl tonic::IntoRequest<super::DeactivateRequest>,
4752 ) -> std::result::Result<
4753 tonic::Response<super::DeactivateResponse>,
4754 tonic::Status,
4755 > {
4756 self.inner
4757 .ready()
4758 .await
4759 .map_err(|e| {
4760 tonic::Status::unknown(
4761 format!("Service was not ready: {}", e.into()),
4762 )
4763 })?;
4764 let codec = tonic_prost::ProstCodec::default();
4765 let path = http::uri::PathAndQuery::from_static(
4766 "/pidgr.v1.DeviceService/Deactivate",
4767 );
4768 let mut req = request.into_request();
4769 req.extensions_mut()
4770 .insert(GrpcMethod::new("pidgr.v1.DeviceService", "Deactivate"));
4771 self.inner.unary(req, path, codec).await
4772 }
4773 pub async fn list_devices(
4777 &mut self,
4778 request: impl tonic::IntoRequest<super::ListDevicesRequest>,
4779 ) -> std::result::Result<
4780 tonic::Response<super::ListDevicesResponse>,
4781 tonic::Status,
4782 > {
4783 self.inner
4784 .ready()
4785 .await
4786 .map_err(|e| {
4787 tonic::Status::unknown(
4788 format!("Service was not ready: {}", e.into()),
4789 )
4790 })?;
4791 let codec = tonic_prost::ProstCodec::default();
4792 let path = http::uri::PathAndQuery::from_static(
4793 "/pidgr.v1.DeviceService/ListDevices",
4794 );
4795 let mut req = request.into_request();
4796 req.extensions_mut()
4797 .insert(GrpcMethod::new("pidgr.v1.DeviceService", "ListDevices"));
4798 self.inner.unary(req, path, codec).await
4799 }
4800 pub async fn list_member_devices(
4804 &mut self,
4805 request: impl tonic::IntoRequest<super::ListMemberDevicesRequest>,
4806 ) -> std::result::Result<
4807 tonic::Response<super::ListMemberDevicesResponse>,
4808 tonic::Status,
4809 > {
4810 self.inner
4811 .ready()
4812 .await
4813 .map_err(|e| {
4814 tonic::Status::unknown(
4815 format!("Service was not ready: {}", e.into()),
4816 )
4817 })?;
4818 let codec = tonic_prost::ProstCodec::default();
4819 let path = http::uri::PathAndQuery::from_static(
4820 "/pidgr.v1.DeviceService/ListMemberDevices",
4821 );
4822 let mut req = request.into_request();
4823 req.extensions_mut()
4824 .insert(GrpcMethod::new("pidgr.v1.DeviceService", "ListMemberDevices"));
4825 self.inner.unary(req, path, codec).await
4826 }
4827 }
4828}
4829pub mod device_service_server {
4831 #![allow(
4832 unused_variables,
4833 dead_code,
4834 missing_docs,
4835 clippy::wildcard_imports,
4836 clippy::let_unit_value,
4837 )]
4838 use tonic::codegen::*;
4839 #[async_trait]
4841 pub trait DeviceService: std::marker::Send + std::marker::Sync + 'static {
4842 async fn register(
4846 &self,
4847 request: tonic::Request<super::RegisterRequest>,
4848 ) -> std::result::Result<
4849 tonic::Response<super::RegisterResponse>,
4850 tonic::Status,
4851 >;
4852 async fn deactivate(
4856 &self,
4857 request: tonic::Request<super::DeactivateRequest>,
4858 ) -> std::result::Result<
4859 tonic::Response<super::DeactivateResponse>,
4860 tonic::Status,
4861 >;
4862 async fn list_devices(
4866 &self,
4867 request: tonic::Request<super::ListDevicesRequest>,
4868 ) -> std::result::Result<
4869 tonic::Response<super::ListDevicesResponse>,
4870 tonic::Status,
4871 >;
4872 async fn list_member_devices(
4876 &self,
4877 request: tonic::Request<super::ListMemberDevicesRequest>,
4878 ) -> std::result::Result<
4879 tonic::Response<super::ListMemberDevicesResponse>,
4880 tonic::Status,
4881 >;
4882 }
4883 #[derive(Debug)]
4887 pub struct DeviceServiceServer<T> {
4888 inner: Arc<T>,
4889 accept_compression_encodings: EnabledCompressionEncodings,
4890 send_compression_encodings: EnabledCompressionEncodings,
4891 max_decoding_message_size: Option<usize>,
4892 max_encoding_message_size: Option<usize>,
4893 }
4894 impl<T> DeviceServiceServer<T> {
4895 pub fn new(inner: T) -> Self {
4896 Self::from_arc(Arc::new(inner))
4897 }
4898 pub fn from_arc(inner: Arc<T>) -> Self {
4899 Self {
4900 inner,
4901 accept_compression_encodings: Default::default(),
4902 send_compression_encodings: Default::default(),
4903 max_decoding_message_size: None,
4904 max_encoding_message_size: None,
4905 }
4906 }
4907 pub fn with_interceptor<F>(
4908 inner: T,
4909 interceptor: F,
4910 ) -> InterceptedService<Self, F>
4911 where
4912 F: tonic::service::Interceptor,
4913 {
4914 InterceptedService::new(Self::new(inner), interceptor)
4915 }
4916 #[must_use]
4918 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4919 self.accept_compression_encodings.enable(encoding);
4920 self
4921 }
4922 #[must_use]
4924 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4925 self.send_compression_encodings.enable(encoding);
4926 self
4927 }
4928 #[must_use]
4932 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4933 self.max_decoding_message_size = Some(limit);
4934 self
4935 }
4936 #[must_use]
4940 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4941 self.max_encoding_message_size = Some(limit);
4942 self
4943 }
4944 }
4945 impl<T, B> tonic::codegen::Service<http::Request<B>> for DeviceServiceServer<T>
4946 where
4947 T: DeviceService,
4948 B: Body + std::marker::Send + 'static,
4949 B::Error: Into<StdError> + std::marker::Send + 'static,
4950 {
4951 type Response = http::Response<tonic::body::Body>;
4952 type Error = std::convert::Infallible;
4953 type Future = BoxFuture<Self::Response, Self::Error>;
4954 fn poll_ready(
4955 &mut self,
4956 _cx: &mut Context<'_>,
4957 ) -> Poll<std::result::Result<(), Self::Error>> {
4958 Poll::Ready(Ok(()))
4959 }
4960 fn call(&mut self, req: http::Request<B>) -> Self::Future {
4961 match req.uri().path() {
4962 "/pidgr.v1.DeviceService/Register" => {
4963 #[allow(non_camel_case_types)]
4964 struct RegisterSvc<T: DeviceService>(pub Arc<T>);
4965 impl<
4966 T: DeviceService,
4967 > tonic::server::UnaryService<super::RegisterRequest>
4968 for RegisterSvc<T> {
4969 type Response = super::RegisterResponse;
4970 type Future = BoxFuture<
4971 tonic::Response<Self::Response>,
4972 tonic::Status,
4973 >;
4974 fn call(
4975 &mut self,
4976 request: tonic::Request<super::RegisterRequest>,
4977 ) -> Self::Future {
4978 let inner = Arc::clone(&self.0);
4979 let fut = async move {
4980 <T as DeviceService>::register(&inner, request).await
4981 };
4982 Box::pin(fut)
4983 }
4984 }
4985 let accept_compression_encodings = self.accept_compression_encodings;
4986 let send_compression_encodings = self.send_compression_encodings;
4987 let max_decoding_message_size = self.max_decoding_message_size;
4988 let max_encoding_message_size = self.max_encoding_message_size;
4989 let inner = self.inner.clone();
4990 let fut = async move {
4991 let method = RegisterSvc(inner);
4992 let codec = tonic_prost::ProstCodec::default();
4993 let mut grpc = tonic::server::Grpc::new(codec)
4994 .apply_compression_config(
4995 accept_compression_encodings,
4996 send_compression_encodings,
4997 )
4998 .apply_max_message_size_config(
4999 max_decoding_message_size,
5000 max_encoding_message_size,
5001 );
5002 let res = grpc.unary(method, req).await;
5003 Ok(res)
5004 };
5005 Box::pin(fut)
5006 }
5007 "/pidgr.v1.DeviceService/Deactivate" => {
5008 #[allow(non_camel_case_types)]
5009 struct DeactivateSvc<T: DeviceService>(pub Arc<T>);
5010 impl<
5011 T: DeviceService,
5012 > tonic::server::UnaryService<super::DeactivateRequest>
5013 for DeactivateSvc<T> {
5014 type Response = super::DeactivateResponse;
5015 type Future = BoxFuture<
5016 tonic::Response<Self::Response>,
5017 tonic::Status,
5018 >;
5019 fn call(
5020 &mut self,
5021 request: tonic::Request<super::DeactivateRequest>,
5022 ) -> Self::Future {
5023 let inner = Arc::clone(&self.0);
5024 let fut = async move {
5025 <T as DeviceService>::deactivate(&inner, request).await
5026 };
5027 Box::pin(fut)
5028 }
5029 }
5030 let accept_compression_encodings = self.accept_compression_encodings;
5031 let send_compression_encodings = self.send_compression_encodings;
5032 let max_decoding_message_size = self.max_decoding_message_size;
5033 let max_encoding_message_size = self.max_encoding_message_size;
5034 let inner = self.inner.clone();
5035 let fut = async move {
5036 let method = DeactivateSvc(inner);
5037 let codec = tonic_prost::ProstCodec::default();
5038 let mut grpc = tonic::server::Grpc::new(codec)
5039 .apply_compression_config(
5040 accept_compression_encodings,
5041 send_compression_encodings,
5042 )
5043 .apply_max_message_size_config(
5044 max_decoding_message_size,
5045 max_encoding_message_size,
5046 );
5047 let res = grpc.unary(method, req).await;
5048 Ok(res)
5049 };
5050 Box::pin(fut)
5051 }
5052 "/pidgr.v1.DeviceService/ListDevices" => {
5053 #[allow(non_camel_case_types)]
5054 struct ListDevicesSvc<T: DeviceService>(pub Arc<T>);
5055 impl<
5056 T: DeviceService,
5057 > tonic::server::UnaryService<super::ListDevicesRequest>
5058 for ListDevicesSvc<T> {
5059 type Response = super::ListDevicesResponse;
5060 type Future = BoxFuture<
5061 tonic::Response<Self::Response>,
5062 tonic::Status,
5063 >;
5064 fn call(
5065 &mut self,
5066 request: tonic::Request<super::ListDevicesRequest>,
5067 ) -> Self::Future {
5068 let inner = Arc::clone(&self.0);
5069 let fut = async move {
5070 <T as DeviceService>::list_devices(&inner, request).await
5071 };
5072 Box::pin(fut)
5073 }
5074 }
5075 let accept_compression_encodings = self.accept_compression_encodings;
5076 let send_compression_encodings = self.send_compression_encodings;
5077 let max_decoding_message_size = self.max_decoding_message_size;
5078 let max_encoding_message_size = self.max_encoding_message_size;
5079 let inner = self.inner.clone();
5080 let fut = async move {
5081 let method = ListDevicesSvc(inner);
5082 let codec = tonic_prost::ProstCodec::default();
5083 let mut grpc = tonic::server::Grpc::new(codec)
5084 .apply_compression_config(
5085 accept_compression_encodings,
5086 send_compression_encodings,
5087 )
5088 .apply_max_message_size_config(
5089 max_decoding_message_size,
5090 max_encoding_message_size,
5091 );
5092 let res = grpc.unary(method, req).await;
5093 Ok(res)
5094 };
5095 Box::pin(fut)
5096 }
5097 "/pidgr.v1.DeviceService/ListMemberDevices" => {
5098 #[allow(non_camel_case_types)]
5099 struct ListMemberDevicesSvc<T: DeviceService>(pub Arc<T>);
5100 impl<
5101 T: DeviceService,
5102 > tonic::server::UnaryService<super::ListMemberDevicesRequest>
5103 for ListMemberDevicesSvc<T> {
5104 type Response = super::ListMemberDevicesResponse;
5105 type Future = BoxFuture<
5106 tonic::Response<Self::Response>,
5107 tonic::Status,
5108 >;
5109 fn call(
5110 &mut self,
5111 request: tonic::Request<super::ListMemberDevicesRequest>,
5112 ) -> Self::Future {
5113 let inner = Arc::clone(&self.0);
5114 let fut = async move {
5115 <T as DeviceService>::list_member_devices(&inner, request)
5116 .await
5117 };
5118 Box::pin(fut)
5119 }
5120 }
5121 let accept_compression_encodings = self.accept_compression_encodings;
5122 let send_compression_encodings = self.send_compression_encodings;
5123 let max_decoding_message_size = self.max_decoding_message_size;
5124 let max_encoding_message_size = self.max_encoding_message_size;
5125 let inner = self.inner.clone();
5126 let fut = async move {
5127 let method = ListMemberDevicesSvc(inner);
5128 let codec = tonic_prost::ProstCodec::default();
5129 let mut grpc = tonic::server::Grpc::new(codec)
5130 .apply_compression_config(
5131 accept_compression_encodings,
5132 send_compression_encodings,
5133 )
5134 .apply_max_message_size_config(
5135 max_decoding_message_size,
5136 max_encoding_message_size,
5137 );
5138 let res = grpc.unary(method, req).await;
5139 Ok(res)
5140 };
5141 Box::pin(fut)
5142 }
5143 _ => {
5144 Box::pin(async move {
5145 let mut response = http::Response::new(
5146 tonic::body::Body::default(),
5147 );
5148 let headers = response.headers_mut();
5149 headers
5150 .insert(
5151 tonic::Status::GRPC_STATUS,
5152 (tonic::Code::Unimplemented as i32).into(),
5153 );
5154 headers
5155 .insert(
5156 http::header::CONTENT_TYPE,
5157 tonic::metadata::GRPC_CONTENT_TYPE,
5158 );
5159 Ok(response)
5160 })
5161 }
5162 }
5163 }
5164 }
5165 impl<T> Clone for DeviceServiceServer<T> {
5166 fn clone(&self) -> Self {
5167 let inner = self.inner.clone();
5168 Self {
5169 inner,
5170 accept_compression_encodings: self.accept_compression_encodings,
5171 send_compression_encodings: self.send_compression_encodings,
5172 max_decoding_message_size: self.max_decoding_message_size,
5173 max_encoding_message_size: self.max_encoding_message_size,
5174 }
5175 }
5176 }
5177 pub const SERVICE_NAME: &str = "pidgr.v1.DeviceService";
5179 impl<T> tonic::server::NamedService for DeviceServiceServer<T> {
5180 const NAME: &'static str = SERVICE_NAME;
5181 }
5182}
5183pub mod group_service_client {
5185 #![allow(
5186 unused_variables,
5187 dead_code,
5188 missing_docs,
5189 clippy::wildcard_imports,
5190 clippy::let_unit_value,
5191 )]
5192 use tonic::codegen::*;
5193 use tonic::codegen::http::Uri;
5194 #[derive(Debug, Clone)]
5199 pub struct GroupServiceClient<T> {
5200 inner: tonic::client::Grpc<T>,
5201 }
5202 impl GroupServiceClient<tonic::transport::Channel> {
5203 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5205 where
5206 D: TryInto<tonic::transport::Endpoint>,
5207 D::Error: Into<StdError>,
5208 {
5209 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5210 Ok(Self::new(conn))
5211 }
5212 }
5213 impl<T> GroupServiceClient<T>
5214 where
5215 T: tonic::client::GrpcService<tonic::body::Body>,
5216 T::Error: Into<StdError>,
5217 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5218 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5219 {
5220 pub fn new(inner: T) -> Self {
5221 let inner = tonic::client::Grpc::new(inner);
5222 Self { inner }
5223 }
5224 pub fn with_origin(inner: T, origin: Uri) -> Self {
5225 let inner = tonic::client::Grpc::with_origin(inner, origin);
5226 Self { inner }
5227 }
5228 pub fn with_interceptor<F>(
5229 inner: T,
5230 interceptor: F,
5231 ) -> GroupServiceClient<InterceptedService<T, F>>
5232 where
5233 F: tonic::service::Interceptor,
5234 T::ResponseBody: Default,
5235 T: tonic::codegen::Service<
5236 http::Request<tonic::body::Body>,
5237 Response = http::Response<
5238 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
5239 >,
5240 >,
5241 <T as tonic::codegen::Service<
5242 http::Request<tonic::body::Body>,
5243 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
5244 {
5245 GroupServiceClient::new(InterceptedService::new(inner, interceptor))
5246 }
5247 #[must_use]
5252 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5253 self.inner = self.inner.send_compressed(encoding);
5254 self
5255 }
5256 #[must_use]
5258 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5259 self.inner = self.inner.accept_compressed(encoding);
5260 self
5261 }
5262 #[must_use]
5266 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5267 self.inner = self.inner.max_decoding_message_size(limit);
5268 self
5269 }
5270 #[must_use]
5274 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5275 self.inner = self.inner.max_encoding_message_size(limit);
5276 self
5277 }
5278 pub async fn create_group(
5282 &mut self,
5283 request: impl tonic::IntoRequest<super::CreateGroupRequest>,
5284 ) -> std::result::Result<
5285 tonic::Response<super::CreateGroupResponse>,
5286 tonic::Status,
5287 > {
5288 self.inner
5289 .ready()
5290 .await
5291 .map_err(|e| {
5292 tonic::Status::unknown(
5293 format!("Service was not ready: {}", e.into()),
5294 )
5295 })?;
5296 let codec = tonic_prost::ProstCodec::default();
5297 let path = http::uri::PathAndQuery::from_static(
5298 "/pidgr.v1.GroupService/CreateGroup",
5299 );
5300 let mut req = request.into_request();
5301 req.extensions_mut()
5302 .insert(GrpcMethod::new("pidgr.v1.GroupService", "CreateGroup"));
5303 self.inner.unary(req, path, codec).await
5304 }
5305 pub async fn get_group(
5310 &mut self,
5311 request: impl tonic::IntoRequest<super::GetGroupRequest>,
5312 ) -> std::result::Result<
5313 tonic::Response<super::GetGroupResponse>,
5314 tonic::Status,
5315 > {
5316 self.inner
5317 .ready()
5318 .await
5319 .map_err(|e| {
5320 tonic::Status::unknown(
5321 format!("Service was not ready: {}", e.into()),
5322 )
5323 })?;
5324 let codec = tonic_prost::ProstCodec::default();
5325 let path = http::uri::PathAndQuery::from_static(
5326 "/pidgr.v1.GroupService/GetGroup",
5327 );
5328 let mut req = request.into_request();
5329 req.extensions_mut()
5330 .insert(GrpcMethod::new("pidgr.v1.GroupService", "GetGroup"));
5331 self.inner.unary(req, path, codec).await
5332 }
5333 pub async fn list_groups(
5337 &mut self,
5338 request: impl tonic::IntoRequest<super::ListGroupsRequest>,
5339 ) -> std::result::Result<
5340 tonic::Response<super::ListGroupsResponse>,
5341 tonic::Status,
5342 > {
5343 self.inner
5344 .ready()
5345 .await
5346 .map_err(|e| {
5347 tonic::Status::unknown(
5348 format!("Service was not ready: {}", e.into()),
5349 )
5350 })?;
5351 let codec = tonic_prost::ProstCodec::default();
5352 let path = http::uri::PathAndQuery::from_static(
5353 "/pidgr.v1.GroupService/ListGroups",
5354 );
5355 let mut req = request.into_request();
5356 req.extensions_mut()
5357 .insert(GrpcMethod::new("pidgr.v1.GroupService", "ListGroups"));
5358 self.inner.unary(req, path, codec).await
5359 }
5360 pub async fn update_group(
5364 &mut self,
5365 request: impl tonic::IntoRequest<super::UpdateGroupRequest>,
5366 ) -> std::result::Result<
5367 tonic::Response<super::UpdateGroupResponse>,
5368 tonic::Status,
5369 > {
5370 self.inner
5371 .ready()
5372 .await
5373 .map_err(|e| {
5374 tonic::Status::unknown(
5375 format!("Service was not ready: {}", e.into()),
5376 )
5377 })?;
5378 let codec = tonic_prost::ProstCodec::default();
5379 let path = http::uri::PathAndQuery::from_static(
5380 "/pidgr.v1.GroupService/UpdateGroup",
5381 );
5382 let mut req = request.into_request();
5383 req.extensions_mut()
5384 .insert(GrpcMethod::new("pidgr.v1.GroupService", "UpdateGroup"));
5385 self.inner.unary(req, path, codec).await
5386 }
5387 pub async fn delete_group(
5391 &mut self,
5392 request: impl tonic::IntoRequest<super::DeleteGroupRequest>,
5393 ) -> std::result::Result<
5394 tonic::Response<super::DeleteGroupResponse>,
5395 tonic::Status,
5396 > {
5397 self.inner
5398 .ready()
5399 .await
5400 .map_err(|e| {
5401 tonic::Status::unknown(
5402 format!("Service was not ready: {}", e.into()),
5403 )
5404 })?;
5405 let codec = tonic_prost::ProstCodec::default();
5406 let path = http::uri::PathAndQuery::from_static(
5407 "/pidgr.v1.GroupService/DeleteGroup",
5408 );
5409 let mut req = request.into_request();
5410 req.extensions_mut()
5411 .insert(GrpcMethod::new("pidgr.v1.GroupService", "DeleteGroup"));
5412 self.inner.unary(req, path, codec).await
5413 }
5414 pub async fn add_group_members(
5418 &mut self,
5419 request: impl tonic::IntoRequest<super::AddGroupMembersRequest>,
5420 ) -> std::result::Result<
5421 tonic::Response<super::AddGroupMembersResponse>,
5422 tonic::Status,
5423 > {
5424 self.inner
5425 .ready()
5426 .await
5427 .map_err(|e| {
5428 tonic::Status::unknown(
5429 format!("Service was not ready: {}", e.into()),
5430 )
5431 })?;
5432 let codec = tonic_prost::ProstCodec::default();
5433 let path = http::uri::PathAndQuery::from_static(
5434 "/pidgr.v1.GroupService/AddGroupMembers",
5435 );
5436 let mut req = request.into_request();
5437 req.extensions_mut()
5438 .insert(GrpcMethod::new("pidgr.v1.GroupService", "AddGroupMembers"));
5439 self.inner.unary(req, path, codec).await
5440 }
5441 pub async fn remove_group_members(
5445 &mut self,
5446 request: impl tonic::IntoRequest<super::RemoveGroupMembersRequest>,
5447 ) -> std::result::Result<
5448 tonic::Response<super::RemoveGroupMembersResponse>,
5449 tonic::Status,
5450 > {
5451 self.inner
5452 .ready()
5453 .await
5454 .map_err(|e| {
5455 tonic::Status::unknown(
5456 format!("Service was not ready: {}", e.into()),
5457 )
5458 })?;
5459 let codec = tonic_prost::ProstCodec::default();
5460 let path = http::uri::PathAndQuery::from_static(
5461 "/pidgr.v1.GroupService/RemoveGroupMembers",
5462 );
5463 let mut req = request.into_request();
5464 req.extensions_mut()
5465 .insert(GrpcMethod::new("pidgr.v1.GroupService", "RemoveGroupMembers"));
5466 self.inner.unary(req, path, codec).await
5467 }
5468 pub async fn list_group_members(
5473 &mut self,
5474 request: impl tonic::IntoRequest<super::ListGroupMembersRequest>,
5475 ) -> std::result::Result<
5476 tonic::Response<super::ListGroupMembersResponse>,
5477 tonic::Status,
5478 > {
5479 self.inner
5480 .ready()
5481 .await
5482 .map_err(|e| {
5483 tonic::Status::unknown(
5484 format!("Service was not ready: {}", e.into()),
5485 )
5486 })?;
5487 let codec = tonic_prost::ProstCodec::default();
5488 let path = http::uri::PathAndQuery::from_static(
5489 "/pidgr.v1.GroupService/ListGroupMembers",
5490 );
5491 let mut req = request.into_request();
5492 req.extensions_mut()
5493 .insert(GrpcMethod::new("pidgr.v1.GroupService", "ListGroupMembers"));
5494 self.inner.unary(req, path, codec).await
5495 }
5496 pub async fn get_user_group_memberships(
5501 &mut self,
5502 request: impl tonic::IntoRequest<super::GetUserGroupMembershipsRequest>,
5503 ) -> std::result::Result<
5504 tonic::Response<super::GetUserGroupMembershipsResponse>,
5505 tonic::Status,
5506 > {
5507 self.inner
5508 .ready()
5509 .await
5510 .map_err(|e| {
5511 tonic::Status::unknown(
5512 format!("Service was not ready: {}", e.into()),
5513 )
5514 })?;
5515 let codec = tonic_prost::ProstCodec::default();
5516 let path = http::uri::PathAndQuery::from_static(
5517 "/pidgr.v1.GroupService/GetUserGroupMemberships",
5518 );
5519 let mut req = request.into_request();
5520 req.extensions_mut()
5521 .insert(
5522 GrpcMethod::new("pidgr.v1.GroupService", "GetUserGroupMemberships"),
5523 );
5524 self.inner.unary(req, path, codec).await
5525 }
5526 }
5527}
5528pub mod group_service_server {
5530 #![allow(
5531 unused_variables,
5532 dead_code,
5533 missing_docs,
5534 clippy::wildcard_imports,
5535 clippy::let_unit_value,
5536 )]
5537 use tonic::codegen::*;
5538 #[async_trait]
5540 pub trait GroupService: std::marker::Send + std::marker::Sync + 'static {
5541 async fn create_group(
5545 &self,
5546 request: tonic::Request<super::CreateGroupRequest>,
5547 ) -> std::result::Result<
5548 tonic::Response<super::CreateGroupResponse>,
5549 tonic::Status,
5550 >;
5551 async fn get_group(
5556 &self,
5557 request: tonic::Request<super::GetGroupRequest>,
5558 ) -> std::result::Result<
5559 tonic::Response<super::GetGroupResponse>,
5560 tonic::Status,
5561 >;
5562 async fn list_groups(
5566 &self,
5567 request: tonic::Request<super::ListGroupsRequest>,
5568 ) -> std::result::Result<
5569 tonic::Response<super::ListGroupsResponse>,
5570 tonic::Status,
5571 >;
5572 async fn update_group(
5576 &self,
5577 request: tonic::Request<super::UpdateGroupRequest>,
5578 ) -> std::result::Result<
5579 tonic::Response<super::UpdateGroupResponse>,
5580 tonic::Status,
5581 >;
5582 async fn delete_group(
5586 &self,
5587 request: tonic::Request<super::DeleteGroupRequest>,
5588 ) -> std::result::Result<
5589 tonic::Response<super::DeleteGroupResponse>,
5590 tonic::Status,
5591 >;
5592 async fn add_group_members(
5596 &self,
5597 request: tonic::Request<super::AddGroupMembersRequest>,
5598 ) -> std::result::Result<
5599 tonic::Response<super::AddGroupMembersResponse>,
5600 tonic::Status,
5601 >;
5602 async fn remove_group_members(
5606 &self,
5607 request: tonic::Request<super::RemoveGroupMembersRequest>,
5608 ) -> std::result::Result<
5609 tonic::Response<super::RemoveGroupMembersResponse>,
5610 tonic::Status,
5611 >;
5612 async fn list_group_members(
5617 &self,
5618 request: tonic::Request<super::ListGroupMembersRequest>,
5619 ) -> std::result::Result<
5620 tonic::Response<super::ListGroupMembersResponse>,
5621 tonic::Status,
5622 >;
5623 async fn get_user_group_memberships(
5628 &self,
5629 request: tonic::Request<super::GetUserGroupMembershipsRequest>,
5630 ) -> std::result::Result<
5631 tonic::Response<super::GetUserGroupMembershipsResponse>,
5632 tonic::Status,
5633 >;
5634 }
5635 #[derive(Debug)]
5640 pub struct GroupServiceServer<T> {
5641 inner: Arc<T>,
5642 accept_compression_encodings: EnabledCompressionEncodings,
5643 send_compression_encodings: EnabledCompressionEncodings,
5644 max_decoding_message_size: Option<usize>,
5645 max_encoding_message_size: Option<usize>,
5646 }
5647 impl<T> GroupServiceServer<T> {
5648 pub fn new(inner: T) -> Self {
5649 Self::from_arc(Arc::new(inner))
5650 }
5651 pub fn from_arc(inner: Arc<T>) -> Self {
5652 Self {
5653 inner,
5654 accept_compression_encodings: Default::default(),
5655 send_compression_encodings: Default::default(),
5656 max_decoding_message_size: None,
5657 max_encoding_message_size: None,
5658 }
5659 }
5660 pub fn with_interceptor<F>(
5661 inner: T,
5662 interceptor: F,
5663 ) -> InterceptedService<Self, F>
5664 where
5665 F: tonic::service::Interceptor,
5666 {
5667 InterceptedService::new(Self::new(inner), interceptor)
5668 }
5669 #[must_use]
5671 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5672 self.accept_compression_encodings.enable(encoding);
5673 self
5674 }
5675 #[must_use]
5677 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5678 self.send_compression_encodings.enable(encoding);
5679 self
5680 }
5681 #[must_use]
5685 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5686 self.max_decoding_message_size = Some(limit);
5687 self
5688 }
5689 #[must_use]
5693 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5694 self.max_encoding_message_size = Some(limit);
5695 self
5696 }
5697 }
5698 impl<T, B> tonic::codegen::Service<http::Request<B>> for GroupServiceServer<T>
5699 where
5700 T: GroupService,
5701 B: Body + std::marker::Send + 'static,
5702 B::Error: Into<StdError> + std::marker::Send + 'static,
5703 {
5704 type Response = http::Response<tonic::body::Body>;
5705 type Error = std::convert::Infallible;
5706 type Future = BoxFuture<Self::Response, Self::Error>;
5707 fn poll_ready(
5708 &mut self,
5709 _cx: &mut Context<'_>,
5710 ) -> Poll<std::result::Result<(), Self::Error>> {
5711 Poll::Ready(Ok(()))
5712 }
5713 fn call(&mut self, req: http::Request<B>) -> Self::Future {
5714 match req.uri().path() {
5715 "/pidgr.v1.GroupService/CreateGroup" => {
5716 #[allow(non_camel_case_types)]
5717 struct CreateGroupSvc<T: GroupService>(pub Arc<T>);
5718 impl<
5719 T: GroupService,
5720 > tonic::server::UnaryService<super::CreateGroupRequest>
5721 for CreateGroupSvc<T> {
5722 type Response = super::CreateGroupResponse;
5723 type Future = BoxFuture<
5724 tonic::Response<Self::Response>,
5725 tonic::Status,
5726 >;
5727 fn call(
5728 &mut self,
5729 request: tonic::Request<super::CreateGroupRequest>,
5730 ) -> Self::Future {
5731 let inner = Arc::clone(&self.0);
5732 let fut = async move {
5733 <T as GroupService>::create_group(&inner, request).await
5734 };
5735 Box::pin(fut)
5736 }
5737 }
5738 let accept_compression_encodings = self.accept_compression_encodings;
5739 let send_compression_encodings = self.send_compression_encodings;
5740 let max_decoding_message_size = self.max_decoding_message_size;
5741 let max_encoding_message_size = self.max_encoding_message_size;
5742 let inner = self.inner.clone();
5743 let fut = async move {
5744 let method = CreateGroupSvc(inner);
5745 let codec = tonic_prost::ProstCodec::default();
5746 let mut grpc = tonic::server::Grpc::new(codec)
5747 .apply_compression_config(
5748 accept_compression_encodings,
5749 send_compression_encodings,
5750 )
5751 .apply_max_message_size_config(
5752 max_decoding_message_size,
5753 max_encoding_message_size,
5754 );
5755 let res = grpc.unary(method, req).await;
5756 Ok(res)
5757 };
5758 Box::pin(fut)
5759 }
5760 "/pidgr.v1.GroupService/GetGroup" => {
5761 #[allow(non_camel_case_types)]
5762 struct GetGroupSvc<T: GroupService>(pub Arc<T>);
5763 impl<
5764 T: GroupService,
5765 > tonic::server::UnaryService<super::GetGroupRequest>
5766 for GetGroupSvc<T> {
5767 type Response = super::GetGroupResponse;
5768 type Future = BoxFuture<
5769 tonic::Response<Self::Response>,
5770 tonic::Status,
5771 >;
5772 fn call(
5773 &mut self,
5774 request: tonic::Request<super::GetGroupRequest>,
5775 ) -> Self::Future {
5776 let inner = Arc::clone(&self.0);
5777 let fut = async move {
5778 <T as GroupService>::get_group(&inner, request).await
5779 };
5780 Box::pin(fut)
5781 }
5782 }
5783 let accept_compression_encodings = self.accept_compression_encodings;
5784 let send_compression_encodings = self.send_compression_encodings;
5785 let max_decoding_message_size = self.max_decoding_message_size;
5786 let max_encoding_message_size = self.max_encoding_message_size;
5787 let inner = self.inner.clone();
5788 let fut = async move {
5789 let method = GetGroupSvc(inner);
5790 let codec = tonic_prost::ProstCodec::default();
5791 let mut grpc = tonic::server::Grpc::new(codec)
5792 .apply_compression_config(
5793 accept_compression_encodings,
5794 send_compression_encodings,
5795 )
5796 .apply_max_message_size_config(
5797 max_decoding_message_size,
5798 max_encoding_message_size,
5799 );
5800 let res = grpc.unary(method, req).await;
5801 Ok(res)
5802 };
5803 Box::pin(fut)
5804 }
5805 "/pidgr.v1.GroupService/ListGroups" => {
5806 #[allow(non_camel_case_types)]
5807 struct ListGroupsSvc<T: GroupService>(pub Arc<T>);
5808 impl<
5809 T: GroupService,
5810 > tonic::server::UnaryService<super::ListGroupsRequest>
5811 for ListGroupsSvc<T> {
5812 type Response = super::ListGroupsResponse;
5813 type Future = BoxFuture<
5814 tonic::Response<Self::Response>,
5815 tonic::Status,
5816 >;
5817 fn call(
5818 &mut self,
5819 request: tonic::Request<super::ListGroupsRequest>,
5820 ) -> Self::Future {
5821 let inner = Arc::clone(&self.0);
5822 let fut = async move {
5823 <T as GroupService>::list_groups(&inner, request).await
5824 };
5825 Box::pin(fut)
5826 }
5827 }
5828 let accept_compression_encodings = self.accept_compression_encodings;
5829 let send_compression_encodings = self.send_compression_encodings;
5830 let max_decoding_message_size = self.max_decoding_message_size;
5831 let max_encoding_message_size = self.max_encoding_message_size;
5832 let inner = self.inner.clone();
5833 let fut = async move {
5834 let method = ListGroupsSvc(inner);
5835 let codec = tonic_prost::ProstCodec::default();
5836 let mut grpc = tonic::server::Grpc::new(codec)
5837 .apply_compression_config(
5838 accept_compression_encodings,
5839 send_compression_encodings,
5840 )
5841 .apply_max_message_size_config(
5842 max_decoding_message_size,
5843 max_encoding_message_size,
5844 );
5845 let res = grpc.unary(method, req).await;
5846 Ok(res)
5847 };
5848 Box::pin(fut)
5849 }
5850 "/pidgr.v1.GroupService/UpdateGroup" => {
5851 #[allow(non_camel_case_types)]
5852 struct UpdateGroupSvc<T: GroupService>(pub Arc<T>);
5853 impl<
5854 T: GroupService,
5855 > tonic::server::UnaryService<super::UpdateGroupRequest>
5856 for UpdateGroupSvc<T> {
5857 type Response = super::UpdateGroupResponse;
5858 type Future = BoxFuture<
5859 tonic::Response<Self::Response>,
5860 tonic::Status,
5861 >;
5862 fn call(
5863 &mut self,
5864 request: tonic::Request<super::UpdateGroupRequest>,
5865 ) -> Self::Future {
5866 let inner = Arc::clone(&self.0);
5867 let fut = async move {
5868 <T as GroupService>::update_group(&inner, request).await
5869 };
5870 Box::pin(fut)
5871 }
5872 }
5873 let accept_compression_encodings = self.accept_compression_encodings;
5874 let send_compression_encodings = self.send_compression_encodings;
5875 let max_decoding_message_size = self.max_decoding_message_size;
5876 let max_encoding_message_size = self.max_encoding_message_size;
5877 let inner = self.inner.clone();
5878 let fut = async move {
5879 let method = UpdateGroupSvc(inner);
5880 let codec = tonic_prost::ProstCodec::default();
5881 let mut grpc = tonic::server::Grpc::new(codec)
5882 .apply_compression_config(
5883 accept_compression_encodings,
5884 send_compression_encodings,
5885 )
5886 .apply_max_message_size_config(
5887 max_decoding_message_size,
5888 max_encoding_message_size,
5889 );
5890 let res = grpc.unary(method, req).await;
5891 Ok(res)
5892 };
5893 Box::pin(fut)
5894 }
5895 "/pidgr.v1.GroupService/DeleteGroup" => {
5896 #[allow(non_camel_case_types)]
5897 struct DeleteGroupSvc<T: GroupService>(pub Arc<T>);
5898 impl<
5899 T: GroupService,
5900 > tonic::server::UnaryService<super::DeleteGroupRequest>
5901 for DeleteGroupSvc<T> {
5902 type Response = super::DeleteGroupResponse;
5903 type Future = BoxFuture<
5904 tonic::Response<Self::Response>,
5905 tonic::Status,
5906 >;
5907 fn call(
5908 &mut self,
5909 request: tonic::Request<super::DeleteGroupRequest>,
5910 ) -> Self::Future {
5911 let inner = Arc::clone(&self.0);
5912 let fut = async move {
5913 <T as GroupService>::delete_group(&inner, request).await
5914 };
5915 Box::pin(fut)
5916 }
5917 }
5918 let accept_compression_encodings = self.accept_compression_encodings;
5919 let send_compression_encodings = self.send_compression_encodings;
5920 let max_decoding_message_size = self.max_decoding_message_size;
5921 let max_encoding_message_size = self.max_encoding_message_size;
5922 let inner = self.inner.clone();
5923 let fut = async move {
5924 let method = DeleteGroupSvc(inner);
5925 let codec = tonic_prost::ProstCodec::default();
5926 let mut grpc = tonic::server::Grpc::new(codec)
5927 .apply_compression_config(
5928 accept_compression_encodings,
5929 send_compression_encodings,
5930 )
5931 .apply_max_message_size_config(
5932 max_decoding_message_size,
5933 max_encoding_message_size,
5934 );
5935 let res = grpc.unary(method, req).await;
5936 Ok(res)
5937 };
5938 Box::pin(fut)
5939 }
5940 "/pidgr.v1.GroupService/AddGroupMembers" => {
5941 #[allow(non_camel_case_types)]
5942 struct AddGroupMembersSvc<T: GroupService>(pub Arc<T>);
5943 impl<
5944 T: GroupService,
5945 > tonic::server::UnaryService<super::AddGroupMembersRequest>
5946 for AddGroupMembersSvc<T> {
5947 type Response = super::AddGroupMembersResponse;
5948 type Future = BoxFuture<
5949 tonic::Response<Self::Response>,
5950 tonic::Status,
5951 >;
5952 fn call(
5953 &mut self,
5954 request: tonic::Request<super::AddGroupMembersRequest>,
5955 ) -> Self::Future {
5956 let inner = Arc::clone(&self.0);
5957 let fut = async move {
5958 <T as GroupService>::add_group_members(&inner, request)
5959 .await
5960 };
5961 Box::pin(fut)
5962 }
5963 }
5964 let accept_compression_encodings = self.accept_compression_encodings;
5965 let send_compression_encodings = self.send_compression_encodings;
5966 let max_decoding_message_size = self.max_decoding_message_size;
5967 let max_encoding_message_size = self.max_encoding_message_size;
5968 let inner = self.inner.clone();
5969 let fut = async move {
5970 let method = AddGroupMembersSvc(inner);
5971 let codec = tonic_prost::ProstCodec::default();
5972 let mut grpc = tonic::server::Grpc::new(codec)
5973 .apply_compression_config(
5974 accept_compression_encodings,
5975 send_compression_encodings,
5976 )
5977 .apply_max_message_size_config(
5978 max_decoding_message_size,
5979 max_encoding_message_size,
5980 );
5981 let res = grpc.unary(method, req).await;
5982 Ok(res)
5983 };
5984 Box::pin(fut)
5985 }
5986 "/pidgr.v1.GroupService/RemoveGroupMembers" => {
5987 #[allow(non_camel_case_types)]
5988 struct RemoveGroupMembersSvc<T: GroupService>(pub Arc<T>);
5989 impl<
5990 T: GroupService,
5991 > tonic::server::UnaryService<super::RemoveGroupMembersRequest>
5992 for RemoveGroupMembersSvc<T> {
5993 type Response = super::RemoveGroupMembersResponse;
5994 type Future = BoxFuture<
5995 tonic::Response<Self::Response>,
5996 tonic::Status,
5997 >;
5998 fn call(
5999 &mut self,
6000 request: tonic::Request<super::RemoveGroupMembersRequest>,
6001 ) -> Self::Future {
6002 let inner = Arc::clone(&self.0);
6003 let fut = async move {
6004 <T as GroupService>::remove_group_members(&inner, request)
6005 .await
6006 };
6007 Box::pin(fut)
6008 }
6009 }
6010 let accept_compression_encodings = self.accept_compression_encodings;
6011 let send_compression_encodings = self.send_compression_encodings;
6012 let max_decoding_message_size = self.max_decoding_message_size;
6013 let max_encoding_message_size = self.max_encoding_message_size;
6014 let inner = self.inner.clone();
6015 let fut = async move {
6016 let method = RemoveGroupMembersSvc(inner);
6017 let codec = tonic_prost::ProstCodec::default();
6018 let mut grpc = tonic::server::Grpc::new(codec)
6019 .apply_compression_config(
6020 accept_compression_encodings,
6021 send_compression_encodings,
6022 )
6023 .apply_max_message_size_config(
6024 max_decoding_message_size,
6025 max_encoding_message_size,
6026 );
6027 let res = grpc.unary(method, req).await;
6028 Ok(res)
6029 };
6030 Box::pin(fut)
6031 }
6032 "/pidgr.v1.GroupService/ListGroupMembers" => {
6033 #[allow(non_camel_case_types)]
6034 struct ListGroupMembersSvc<T: GroupService>(pub Arc<T>);
6035 impl<
6036 T: GroupService,
6037 > tonic::server::UnaryService<super::ListGroupMembersRequest>
6038 for ListGroupMembersSvc<T> {
6039 type Response = super::ListGroupMembersResponse;
6040 type Future = BoxFuture<
6041 tonic::Response<Self::Response>,
6042 tonic::Status,
6043 >;
6044 fn call(
6045 &mut self,
6046 request: tonic::Request<super::ListGroupMembersRequest>,
6047 ) -> Self::Future {
6048 let inner = Arc::clone(&self.0);
6049 let fut = async move {
6050 <T as GroupService>::list_group_members(&inner, request)
6051 .await
6052 };
6053 Box::pin(fut)
6054 }
6055 }
6056 let accept_compression_encodings = self.accept_compression_encodings;
6057 let send_compression_encodings = self.send_compression_encodings;
6058 let max_decoding_message_size = self.max_decoding_message_size;
6059 let max_encoding_message_size = self.max_encoding_message_size;
6060 let inner = self.inner.clone();
6061 let fut = async move {
6062 let method = ListGroupMembersSvc(inner);
6063 let codec = tonic_prost::ProstCodec::default();
6064 let mut grpc = tonic::server::Grpc::new(codec)
6065 .apply_compression_config(
6066 accept_compression_encodings,
6067 send_compression_encodings,
6068 )
6069 .apply_max_message_size_config(
6070 max_decoding_message_size,
6071 max_encoding_message_size,
6072 );
6073 let res = grpc.unary(method, req).await;
6074 Ok(res)
6075 };
6076 Box::pin(fut)
6077 }
6078 "/pidgr.v1.GroupService/GetUserGroupMemberships" => {
6079 #[allow(non_camel_case_types)]
6080 struct GetUserGroupMembershipsSvc<T: GroupService>(pub Arc<T>);
6081 impl<
6082 T: GroupService,
6083 > tonic::server::UnaryService<super::GetUserGroupMembershipsRequest>
6084 for GetUserGroupMembershipsSvc<T> {
6085 type Response = super::GetUserGroupMembershipsResponse;
6086 type Future = BoxFuture<
6087 tonic::Response<Self::Response>,
6088 tonic::Status,
6089 >;
6090 fn call(
6091 &mut self,
6092 request: tonic::Request<
6093 super::GetUserGroupMembershipsRequest,
6094 >,
6095 ) -> Self::Future {
6096 let inner = Arc::clone(&self.0);
6097 let fut = async move {
6098 <T as GroupService>::get_user_group_memberships(
6099 &inner,
6100 request,
6101 )
6102 .await
6103 };
6104 Box::pin(fut)
6105 }
6106 }
6107 let accept_compression_encodings = self.accept_compression_encodings;
6108 let send_compression_encodings = self.send_compression_encodings;
6109 let max_decoding_message_size = self.max_decoding_message_size;
6110 let max_encoding_message_size = self.max_encoding_message_size;
6111 let inner = self.inner.clone();
6112 let fut = async move {
6113 let method = GetUserGroupMembershipsSvc(inner);
6114 let codec = tonic_prost::ProstCodec::default();
6115 let mut grpc = tonic::server::Grpc::new(codec)
6116 .apply_compression_config(
6117 accept_compression_encodings,
6118 send_compression_encodings,
6119 )
6120 .apply_max_message_size_config(
6121 max_decoding_message_size,
6122 max_encoding_message_size,
6123 );
6124 let res = grpc.unary(method, req).await;
6125 Ok(res)
6126 };
6127 Box::pin(fut)
6128 }
6129 _ => {
6130 Box::pin(async move {
6131 let mut response = http::Response::new(
6132 tonic::body::Body::default(),
6133 );
6134 let headers = response.headers_mut();
6135 headers
6136 .insert(
6137 tonic::Status::GRPC_STATUS,
6138 (tonic::Code::Unimplemented as i32).into(),
6139 );
6140 headers
6141 .insert(
6142 http::header::CONTENT_TYPE,
6143 tonic::metadata::GRPC_CONTENT_TYPE,
6144 );
6145 Ok(response)
6146 })
6147 }
6148 }
6149 }
6150 }
6151 impl<T> Clone for GroupServiceServer<T> {
6152 fn clone(&self) -> Self {
6153 let inner = self.inner.clone();
6154 Self {
6155 inner,
6156 accept_compression_encodings: self.accept_compression_encodings,
6157 send_compression_encodings: self.send_compression_encodings,
6158 max_decoding_message_size: self.max_decoding_message_size,
6159 max_encoding_message_size: self.max_encoding_message_size,
6160 }
6161 }
6162 }
6163 pub const SERVICE_NAME: &str = "pidgr.v1.GroupService";
6165 impl<T> tonic::server::NamedService for GroupServiceServer<T> {
6166 const NAME: &'static str = SERVICE_NAME;
6167 }
6168}
6169pub mod heatmap_service_client {
6171 #![allow(
6172 unused_variables,
6173 dead_code,
6174 missing_docs,
6175 clippy::wildcard_imports,
6176 clippy::let_unit_value,
6177 )]
6178 use tonic::codegen::*;
6179 use tonic::codegen::http::Uri;
6180 #[derive(Debug, Clone)]
6184 pub struct HeatmapServiceClient<T> {
6185 inner: tonic::client::Grpc<T>,
6186 }
6187 impl HeatmapServiceClient<tonic::transport::Channel> {
6188 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6190 where
6191 D: TryInto<tonic::transport::Endpoint>,
6192 D::Error: Into<StdError>,
6193 {
6194 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6195 Ok(Self::new(conn))
6196 }
6197 }
6198 impl<T> HeatmapServiceClient<T>
6199 where
6200 T: tonic::client::GrpcService<tonic::body::Body>,
6201 T::Error: Into<StdError>,
6202 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6203 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6204 {
6205 pub fn new(inner: T) -> Self {
6206 let inner = tonic::client::Grpc::new(inner);
6207 Self { inner }
6208 }
6209 pub fn with_origin(inner: T, origin: Uri) -> Self {
6210 let inner = tonic::client::Grpc::with_origin(inner, origin);
6211 Self { inner }
6212 }
6213 pub fn with_interceptor<F>(
6214 inner: T,
6215 interceptor: F,
6216 ) -> HeatmapServiceClient<InterceptedService<T, F>>
6217 where
6218 F: tonic::service::Interceptor,
6219 T::ResponseBody: Default,
6220 T: tonic::codegen::Service<
6221 http::Request<tonic::body::Body>,
6222 Response = http::Response<
6223 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6224 >,
6225 >,
6226 <T as tonic::codegen::Service<
6227 http::Request<tonic::body::Body>,
6228 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6229 {
6230 HeatmapServiceClient::new(InterceptedService::new(inner, interceptor))
6231 }
6232 #[must_use]
6237 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6238 self.inner = self.inner.send_compressed(encoding);
6239 self
6240 }
6241 #[must_use]
6243 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6244 self.inner = self.inner.accept_compressed(encoding);
6245 self
6246 }
6247 #[must_use]
6251 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6252 self.inner = self.inner.max_decoding_message_size(limit);
6253 self
6254 }
6255 #[must_use]
6259 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6260 self.inner = self.inner.max_encoding_message_size(limit);
6261 self
6262 }
6263 pub async fn ingest_touch_events(
6267 &mut self,
6268 request: impl tonic::IntoRequest<super::IngestTouchEventsRequest>,
6269 ) -> std::result::Result<
6270 tonic::Response<super::IngestTouchEventsResponse>,
6271 tonic::Status,
6272 > {
6273 self.inner
6274 .ready()
6275 .await
6276 .map_err(|e| {
6277 tonic::Status::unknown(
6278 format!("Service was not ready: {}", e.into()),
6279 )
6280 })?;
6281 let codec = tonic_prost::ProstCodec::default();
6282 let path = http::uri::PathAndQuery::from_static(
6283 "/pidgr.v1.HeatmapService/IngestTouchEvents",
6284 );
6285 let mut req = request.into_request();
6286 req.extensions_mut()
6287 .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "IngestTouchEvents"));
6288 self.inner.unary(req, path, codec).await
6289 }
6290 pub async fn query_heatmap_data(
6294 &mut self,
6295 request: impl tonic::IntoRequest<super::QueryHeatmapDataRequest>,
6296 ) -> std::result::Result<
6297 tonic::Response<super::QueryHeatmapDataResponse>,
6298 tonic::Status,
6299 > {
6300 self.inner
6301 .ready()
6302 .await
6303 .map_err(|e| {
6304 tonic::Status::unknown(
6305 format!("Service was not ready: {}", e.into()),
6306 )
6307 })?;
6308 let codec = tonic_prost::ProstCodec::default();
6309 let path = http::uri::PathAndQuery::from_static(
6310 "/pidgr.v1.HeatmapService/QueryHeatmapData",
6311 );
6312 let mut req = request.into_request();
6313 req.extensions_mut()
6314 .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "QueryHeatmapData"));
6315 self.inner.unary(req, path, codec).await
6316 }
6317 pub async fn list_screenshots(
6321 &mut self,
6322 request: impl tonic::IntoRequest<super::ListScreenshotsRequest>,
6323 ) -> std::result::Result<
6324 tonic::Response<super::ListScreenshotsResponse>,
6325 tonic::Status,
6326 > {
6327 self.inner
6328 .ready()
6329 .await
6330 .map_err(|e| {
6331 tonic::Status::unknown(
6332 format!("Service was not ready: {}", e.into()),
6333 )
6334 })?;
6335 let codec = tonic_prost::ProstCodec::default();
6336 let path = http::uri::PathAndQuery::from_static(
6337 "/pidgr.v1.HeatmapService/ListScreenshots",
6338 );
6339 let mut req = request.into_request();
6340 req.extensions_mut()
6341 .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "ListScreenshots"));
6342 self.inner.unary(req, path, codec).await
6343 }
6344 pub async fn upload_screenshot(
6348 &mut self,
6349 request: impl tonic::IntoRequest<super::UploadScreenshotRequest>,
6350 ) -> std::result::Result<
6351 tonic::Response<super::UploadScreenshotResponse>,
6352 tonic::Status,
6353 > {
6354 self.inner
6355 .ready()
6356 .await
6357 .map_err(|e| {
6358 tonic::Status::unknown(
6359 format!("Service was not ready: {}", e.into()),
6360 )
6361 })?;
6362 let codec = tonic_prost::ProstCodec::default();
6363 let path = http::uri::PathAndQuery::from_static(
6364 "/pidgr.v1.HeatmapService/UploadScreenshot",
6365 );
6366 let mut req = request.into_request();
6367 req.extensions_mut()
6368 .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "UploadScreenshot"));
6369 self.inner.unary(req, path, codec).await
6370 }
6371 }
6372}
6373pub mod heatmap_service_server {
6375 #![allow(
6376 unused_variables,
6377 dead_code,
6378 missing_docs,
6379 clippy::wildcard_imports,
6380 clippy::let_unit_value,
6381 )]
6382 use tonic::codegen::*;
6383 #[async_trait]
6385 pub trait HeatmapService: std::marker::Send + std::marker::Sync + 'static {
6386 async fn ingest_touch_events(
6390 &self,
6391 request: tonic::Request<super::IngestTouchEventsRequest>,
6392 ) -> std::result::Result<
6393 tonic::Response<super::IngestTouchEventsResponse>,
6394 tonic::Status,
6395 >;
6396 async fn query_heatmap_data(
6400 &self,
6401 request: tonic::Request<super::QueryHeatmapDataRequest>,
6402 ) -> std::result::Result<
6403 tonic::Response<super::QueryHeatmapDataResponse>,
6404 tonic::Status,
6405 >;
6406 async fn list_screenshots(
6410 &self,
6411 request: tonic::Request<super::ListScreenshotsRequest>,
6412 ) -> std::result::Result<
6413 tonic::Response<super::ListScreenshotsResponse>,
6414 tonic::Status,
6415 >;
6416 async fn upload_screenshot(
6420 &self,
6421 request: tonic::Request<super::UploadScreenshotRequest>,
6422 ) -> std::result::Result<
6423 tonic::Response<super::UploadScreenshotResponse>,
6424 tonic::Status,
6425 >;
6426 }
6427 #[derive(Debug)]
6431 pub struct HeatmapServiceServer<T> {
6432 inner: Arc<T>,
6433 accept_compression_encodings: EnabledCompressionEncodings,
6434 send_compression_encodings: EnabledCompressionEncodings,
6435 max_decoding_message_size: Option<usize>,
6436 max_encoding_message_size: Option<usize>,
6437 }
6438 impl<T> HeatmapServiceServer<T> {
6439 pub fn new(inner: T) -> Self {
6440 Self::from_arc(Arc::new(inner))
6441 }
6442 pub fn from_arc(inner: Arc<T>) -> Self {
6443 Self {
6444 inner,
6445 accept_compression_encodings: Default::default(),
6446 send_compression_encodings: Default::default(),
6447 max_decoding_message_size: None,
6448 max_encoding_message_size: None,
6449 }
6450 }
6451 pub fn with_interceptor<F>(
6452 inner: T,
6453 interceptor: F,
6454 ) -> InterceptedService<Self, F>
6455 where
6456 F: tonic::service::Interceptor,
6457 {
6458 InterceptedService::new(Self::new(inner), interceptor)
6459 }
6460 #[must_use]
6462 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6463 self.accept_compression_encodings.enable(encoding);
6464 self
6465 }
6466 #[must_use]
6468 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6469 self.send_compression_encodings.enable(encoding);
6470 self
6471 }
6472 #[must_use]
6476 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6477 self.max_decoding_message_size = Some(limit);
6478 self
6479 }
6480 #[must_use]
6484 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6485 self.max_encoding_message_size = Some(limit);
6486 self
6487 }
6488 }
6489 impl<T, B> tonic::codegen::Service<http::Request<B>> for HeatmapServiceServer<T>
6490 where
6491 T: HeatmapService,
6492 B: Body + std::marker::Send + 'static,
6493 B::Error: Into<StdError> + std::marker::Send + 'static,
6494 {
6495 type Response = http::Response<tonic::body::Body>;
6496 type Error = std::convert::Infallible;
6497 type Future = BoxFuture<Self::Response, Self::Error>;
6498 fn poll_ready(
6499 &mut self,
6500 _cx: &mut Context<'_>,
6501 ) -> Poll<std::result::Result<(), Self::Error>> {
6502 Poll::Ready(Ok(()))
6503 }
6504 fn call(&mut self, req: http::Request<B>) -> Self::Future {
6505 match req.uri().path() {
6506 "/pidgr.v1.HeatmapService/IngestTouchEvents" => {
6507 #[allow(non_camel_case_types)]
6508 struct IngestTouchEventsSvc<T: HeatmapService>(pub Arc<T>);
6509 impl<
6510 T: HeatmapService,
6511 > tonic::server::UnaryService<super::IngestTouchEventsRequest>
6512 for IngestTouchEventsSvc<T> {
6513 type Response = super::IngestTouchEventsResponse;
6514 type Future = BoxFuture<
6515 tonic::Response<Self::Response>,
6516 tonic::Status,
6517 >;
6518 fn call(
6519 &mut self,
6520 request: tonic::Request<super::IngestTouchEventsRequest>,
6521 ) -> Self::Future {
6522 let inner = Arc::clone(&self.0);
6523 let fut = async move {
6524 <T as HeatmapService>::ingest_touch_events(&inner, request)
6525 .await
6526 };
6527 Box::pin(fut)
6528 }
6529 }
6530 let accept_compression_encodings = self.accept_compression_encodings;
6531 let send_compression_encodings = self.send_compression_encodings;
6532 let max_decoding_message_size = self.max_decoding_message_size;
6533 let max_encoding_message_size = self.max_encoding_message_size;
6534 let inner = self.inner.clone();
6535 let fut = async move {
6536 let method = IngestTouchEventsSvc(inner);
6537 let codec = tonic_prost::ProstCodec::default();
6538 let mut grpc = tonic::server::Grpc::new(codec)
6539 .apply_compression_config(
6540 accept_compression_encodings,
6541 send_compression_encodings,
6542 )
6543 .apply_max_message_size_config(
6544 max_decoding_message_size,
6545 max_encoding_message_size,
6546 );
6547 let res = grpc.unary(method, req).await;
6548 Ok(res)
6549 };
6550 Box::pin(fut)
6551 }
6552 "/pidgr.v1.HeatmapService/QueryHeatmapData" => {
6553 #[allow(non_camel_case_types)]
6554 struct QueryHeatmapDataSvc<T: HeatmapService>(pub Arc<T>);
6555 impl<
6556 T: HeatmapService,
6557 > tonic::server::UnaryService<super::QueryHeatmapDataRequest>
6558 for QueryHeatmapDataSvc<T> {
6559 type Response = super::QueryHeatmapDataResponse;
6560 type Future = BoxFuture<
6561 tonic::Response<Self::Response>,
6562 tonic::Status,
6563 >;
6564 fn call(
6565 &mut self,
6566 request: tonic::Request<super::QueryHeatmapDataRequest>,
6567 ) -> Self::Future {
6568 let inner = Arc::clone(&self.0);
6569 let fut = async move {
6570 <T as HeatmapService>::query_heatmap_data(&inner, request)
6571 .await
6572 };
6573 Box::pin(fut)
6574 }
6575 }
6576 let accept_compression_encodings = self.accept_compression_encodings;
6577 let send_compression_encodings = self.send_compression_encodings;
6578 let max_decoding_message_size = self.max_decoding_message_size;
6579 let max_encoding_message_size = self.max_encoding_message_size;
6580 let inner = self.inner.clone();
6581 let fut = async move {
6582 let method = QueryHeatmapDataSvc(inner);
6583 let codec = tonic_prost::ProstCodec::default();
6584 let mut grpc = tonic::server::Grpc::new(codec)
6585 .apply_compression_config(
6586 accept_compression_encodings,
6587 send_compression_encodings,
6588 )
6589 .apply_max_message_size_config(
6590 max_decoding_message_size,
6591 max_encoding_message_size,
6592 );
6593 let res = grpc.unary(method, req).await;
6594 Ok(res)
6595 };
6596 Box::pin(fut)
6597 }
6598 "/pidgr.v1.HeatmapService/ListScreenshots" => {
6599 #[allow(non_camel_case_types)]
6600 struct ListScreenshotsSvc<T: HeatmapService>(pub Arc<T>);
6601 impl<
6602 T: HeatmapService,
6603 > tonic::server::UnaryService<super::ListScreenshotsRequest>
6604 for ListScreenshotsSvc<T> {
6605 type Response = super::ListScreenshotsResponse;
6606 type Future = BoxFuture<
6607 tonic::Response<Self::Response>,
6608 tonic::Status,
6609 >;
6610 fn call(
6611 &mut self,
6612 request: tonic::Request<super::ListScreenshotsRequest>,
6613 ) -> Self::Future {
6614 let inner = Arc::clone(&self.0);
6615 let fut = async move {
6616 <T as HeatmapService>::list_screenshots(&inner, request)
6617 .await
6618 };
6619 Box::pin(fut)
6620 }
6621 }
6622 let accept_compression_encodings = self.accept_compression_encodings;
6623 let send_compression_encodings = self.send_compression_encodings;
6624 let max_decoding_message_size = self.max_decoding_message_size;
6625 let max_encoding_message_size = self.max_encoding_message_size;
6626 let inner = self.inner.clone();
6627 let fut = async move {
6628 let method = ListScreenshotsSvc(inner);
6629 let codec = tonic_prost::ProstCodec::default();
6630 let mut grpc = tonic::server::Grpc::new(codec)
6631 .apply_compression_config(
6632 accept_compression_encodings,
6633 send_compression_encodings,
6634 )
6635 .apply_max_message_size_config(
6636 max_decoding_message_size,
6637 max_encoding_message_size,
6638 );
6639 let res = grpc.unary(method, req).await;
6640 Ok(res)
6641 };
6642 Box::pin(fut)
6643 }
6644 "/pidgr.v1.HeatmapService/UploadScreenshot" => {
6645 #[allow(non_camel_case_types)]
6646 struct UploadScreenshotSvc<T: HeatmapService>(pub Arc<T>);
6647 impl<
6648 T: HeatmapService,
6649 > tonic::server::UnaryService<super::UploadScreenshotRequest>
6650 for UploadScreenshotSvc<T> {
6651 type Response = super::UploadScreenshotResponse;
6652 type Future = BoxFuture<
6653 tonic::Response<Self::Response>,
6654 tonic::Status,
6655 >;
6656 fn call(
6657 &mut self,
6658 request: tonic::Request<super::UploadScreenshotRequest>,
6659 ) -> Self::Future {
6660 let inner = Arc::clone(&self.0);
6661 let fut = async move {
6662 <T as HeatmapService>::upload_screenshot(&inner, request)
6663 .await
6664 };
6665 Box::pin(fut)
6666 }
6667 }
6668 let accept_compression_encodings = self.accept_compression_encodings;
6669 let send_compression_encodings = self.send_compression_encodings;
6670 let max_decoding_message_size = self.max_decoding_message_size;
6671 let max_encoding_message_size = self.max_encoding_message_size;
6672 let inner = self.inner.clone();
6673 let fut = async move {
6674 let method = UploadScreenshotSvc(inner);
6675 let codec = tonic_prost::ProstCodec::default();
6676 let mut grpc = tonic::server::Grpc::new(codec)
6677 .apply_compression_config(
6678 accept_compression_encodings,
6679 send_compression_encodings,
6680 )
6681 .apply_max_message_size_config(
6682 max_decoding_message_size,
6683 max_encoding_message_size,
6684 );
6685 let res = grpc.unary(method, req).await;
6686 Ok(res)
6687 };
6688 Box::pin(fut)
6689 }
6690 _ => {
6691 Box::pin(async move {
6692 let mut response = http::Response::new(
6693 tonic::body::Body::default(),
6694 );
6695 let headers = response.headers_mut();
6696 headers
6697 .insert(
6698 tonic::Status::GRPC_STATUS,
6699 (tonic::Code::Unimplemented as i32).into(),
6700 );
6701 headers
6702 .insert(
6703 http::header::CONTENT_TYPE,
6704 tonic::metadata::GRPC_CONTENT_TYPE,
6705 );
6706 Ok(response)
6707 })
6708 }
6709 }
6710 }
6711 }
6712 impl<T> Clone for HeatmapServiceServer<T> {
6713 fn clone(&self) -> Self {
6714 let inner = self.inner.clone();
6715 Self {
6716 inner,
6717 accept_compression_encodings: self.accept_compression_encodings,
6718 send_compression_encodings: self.send_compression_encodings,
6719 max_decoding_message_size: self.max_decoding_message_size,
6720 max_encoding_message_size: self.max_encoding_message_size,
6721 }
6722 }
6723 }
6724 pub const SERVICE_NAME: &str = "pidgr.v1.HeatmapService";
6726 impl<T> tonic::server::NamedService for HeatmapServiceServer<T> {
6727 const NAME: &'static str = SERVICE_NAME;
6728 }
6729}
6730pub mod inbox_service_client {
6732 #![allow(
6733 unused_variables,
6734 dead_code,
6735 missing_docs,
6736 clippy::wildcard_imports,
6737 clippy::let_unit_value,
6738 )]
6739 use tonic::codegen::*;
6740 use tonic::codegen::http::Uri;
6741 #[derive(Debug, Clone)]
6745 pub struct InboxServiceClient<T> {
6746 inner: tonic::client::Grpc<T>,
6747 }
6748 impl InboxServiceClient<tonic::transport::Channel> {
6749 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6751 where
6752 D: TryInto<tonic::transport::Endpoint>,
6753 D::Error: Into<StdError>,
6754 {
6755 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6756 Ok(Self::new(conn))
6757 }
6758 }
6759 impl<T> InboxServiceClient<T>
6760 where
6761 T: tonic::client::GrpcService<tonic::body::Body>,
6762 T::Error: Into<StdError>,
6763 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6764 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6765 {
6766 pub fn new(inner: T) -> Self {
6767 let inner = tonic::client::Grpc::new(inner);
6768 Self { inner }
6769 }
6770 pub fn with_origin(inner: T, origin: Uri) -> Self {
6771 let inner = tonic::client::Grpc::with_origin(inner, origin);
6772 Self { inner }
6773 }
6774 pub fn with_interceptor<F>(
6775 inner: T,
6776 interceptor: F,
6777 ) -> InboxServiceClient<InterceptedService<T, F>>
6778 where
6779 F: tonic::service::Interceptor,
6780 T::ResponseBody: Default,
6781 T: tonic::codegen::Service<
6782 http::Request<tonic::body::Body>,
6783 Response = http::Response<
6784 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6785 >,
6786 >,
6787 <T as tonic::codegen::Service<
6788 http::Request<tonic::body::Body>,
6789 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6790 {
6791 InboxServiceClient::new(InterceptedService::new(inner, interceptor))
6792 }
6793 #[must_use]
6798 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6799 self.inner = self.inner.send_compressed(encoding);
6800 self
6801 }
6802 #[must_use]
6804 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6805 self.inner = self.inner.accept_compressed(encoding);
6806 self
6807 }
6808 #[must_use]
6812 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6813 self.inner = self.inner.max_decoding_message_size(limit);
6814 self
6815 }
6816 #[must_use]
6820 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6821 self.inner = self.inner.max_encoding_message_size(limit);
6822 self
6823 }
6824 pub async fn sync(
6828 &mut self,
6829 request: impl tonic::IntoRequest<super::SyncRequest>,
6830 ) -> std::result::Result<tonic::Response<super::SyncResponse>, tonic::Status> {
6831 self.inner
6832 .ready()
6833 .await
6834 .map_err(|e| {
6835 tonic::Status::unknown(
6836 format!("Service was not ready: {}", e.into()),
6837 )
6838 })?;
6839 let codec = tonic_prost::ProstCodec::default();
6840 let path = http::uri::PathAndQuery::from_static(
6841 "/pidgr.v1.InboxService/Sync",
6842 );
6843 let mut req = request.into_request();
6844 req.extensions_mut()
6845 .insert(GrpcMethod::new("pidgr.v1.InboxService", "Sync"));
6846 self.inner.unary(req, path, codec).await
6847 }
6848 pub async fn mark_read(
6852 &mut self,
6853 request: impl tonic::IntoRequest<super::MarkReadRequest>,
6854 ) -> std::result::Result<
6855 tonic::Response<super::MarkReadResponse>,
6856 tonic::Status,
6857 > {
6858 self.inner
6859 .ready()
6860 .await
6861 .map_err(|e| {
6862 tonic::Status::unknown(
6863 format!("Service was not ready: {}", e.into()),
6864 )
6865 })?;
6866 let codec = tonic_prost::ProstCodec::default();
6867 let path = http::uri::PathAndQuery::from_static(
6868 "/pidgr.v1.InboxService/MarkRead",
6869 );
6870 let mut req = request.into_request();
6871 req.extensions_mut()
6872 .insert(GrpcMethod::new("pidgr.v1.InboxService", "MarkRead"));
6873 self.inner.unary(req, path, codec).await
6874 }
6875 pub async fn get_message(
6879 &mut self,
6880 request: impl tonic::IntoRequest<super::GetMessageRequest>,
6881 ) -> std::result::Result<
6882 tonic::Response<super::GetMessageResponse>,
6883 tonic::Status,
6884 > {
6885 self.inner
6886 .ready()
6887 .await
6888 .map_err(|e| {
6889 tonic::Status::unknown(
6890 format!("Service was not ready: {}", e.into()),
6891 )
6892 })?;
6893 let codec = tonic_prost::ProstCodec::default();
6894 let path = http::uri::PathAndQuery::from_static(
6895 "/pidgr.v1.InboxService/GetMessage",
6896 );
6897 let mut req = request.into_request();
6898 req.extensions_mut()
6899 .insert(GrpcMethod::new("pidgr.v1.InboxService", "GetMessage"));
6900 self.inner.unary(req, path, codec).await
6901 }
6902 }
6903}
6904pub mod inbox_service_server {
6906 #![allow(
6907 unused_variables,
6908 dead_code,
6909 missing_docs,
6910 clippy::wildcard_imports,
6911 clippy::let_unit_value,
6912 )]
6913 use tonic::codegen::*;
6914 #[async_trait]
6916 pub trait InboxService: std::marker::Send + std::marker::Sync + 'static {
6917 async fn sync(
6921 &self,
6922 request: tonic::Request<super::SyncRequest>,
6923 ) -> std::result::Result<tonic::Response<super::SyncResponse>, tonic::Status>;
6924 async fn mark_read(
6928 &self,
6929 request: tonic::Request<super::MarkReadRequest>,
6930 ) -> std::result::Result<
6931 tonic::Response<super::MarkReadResponse>,
6932 tonic::Status,
6933 >;
6934 async fn get_message(
6938 &self,
6939 request: tonic::Request<super::GetMessageRequest>,
6940 ) -> std::result::Result<
6941 tonic::Response<super::GetMessageResponse>,
6942 tonic::Status,
6943 >;
6944 }
6945 #[derive(Debug)]
6949 pub struct InboxServiceServer<T> {
6950 inner: Arc<T>,
6951 accept_compression_encodings: EnabledCompressionEncodings,
6952 send_compression_encodings: EnabledCompressionEncodings,
6953 max_decoding_message_size: Option<usize>,
6954 max_encoding_message_size: Option<usize>,
6955 }
6956 impl<T> InboxServiceServer<T> {
6957 pub fn new(inner: T) -> Self {
6958 Self::from_arc(Arc::new(inner))
6959 }
6960 pub fn from_arc(inner: Arc<T>) -> Self {
6961 Self {
6962 inner,
6963 accept_compression_encodings: Default::default(),
6964 send_compression_encodings: Default::default(),
6965 max_decoding_message_size: None,
6966 max_encoding_message_size: None,
6967 }
6968 }
6969 pub fn with_interceptor<F>(
6970 inner: T,
6971 interceptor: F,
6972 ) -> InterceptedService<Self, F>
6973 where
6974 F: tonic::service::Interceptor,
6975 {
6976 InterceptedService::new(Self::new(inner), interceptor)
6977 }
6978 #[must_use]
6980 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6981 self.accept_compression_encodings.enable(encoding);
6982 self
6983 }
6984 #[must_use]
6986 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6987 self.send_compression_encodings.enable(encoding);
6988 self
6989 }
6990 #[must_use]
6994 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6995 self.max_decoding_message_size = Some(limit);
6996 self
6997 }
6998 #[must_use]
7002 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7003 self.max_encoding_message_size = Some(limit);
7004 self
7005 }
7006 }
7007 impl<T, B> tonic::codegen::Service<http::Request<B>> for InboxServiceServer<T>
7008 where
7009 T: InboxService,
7010 B: Body + std::marker::Send + 'static,
7011 B::Error: Into<StdError> + std::marker::Send + 'static,
7012 {
7013 type Response = http::Response<tonic::body::Body>;
7014 type Error = std::convert::Infallible;
7015 type Future = BoxFuture<Self::Response, Self::Error>;
7016 fn poll_ready(
7017 &mut self,
7018 _cx: &mut Context<'_>,
7019 ) -> Poll<std::result::Result<(), Self::Error>> {
7020 Poll::Ready(Ok(()))
7021 }
7022 fn call(&mut self, req: http::Request<B>) -> Self::Future {
7023 match req.uri().path() {
7024 "/pidgr.v1.InboxService/Sync" => {
7025 #[allow(non_camel_case_types)]
7026 struct SyncSvc<T: InboxService>(pub Arc<T>);
7027 impl<T: InboxService> tonic::server::UnaryService<super::SyncRequest>
7028 for SyncSvc<T> {
7029 type Response = super::SyncResponse;
7030 type Future = BoxFuture<
7031 tonic::Response<Self::Response>,
7032 tonic::Status,
7033 >;
7034 fn call(
7035 &mut self,
7036 request: tonic::Request<super::SyncRequest>,
7037 ) -> Self::Future {
7038 let inner = Arc::clone(&self.0);
7039 let fut = async move {
7040 <T as InboxService>::sync(&inner, request).await
7041 };
7042 Box::pin(fut)
7043 }
7044 }
7045 let accept_compression_encodings = self.accept_compression_encodings;
7046 let send_compression_encodings = self.send_compression_encodings;
7047 let max_decoding_message_size = self.max_decoding_message_size;
7048 let max_encoding_message_size = self.max_encoding_message_size;
7049 let inner = self.inner.clone();
7050 let fut = async move {
7051 let method = SyncSvc(inner);
7052 let codec = tonic_prost::ProstCodec::default();
7053 let mut grpc = tonic::server::Grpc::new(codec)
7054 .apply_compression_config(
7055 accept_compression_encodings,
7056 send_compression_encodings,
7057 )
7058 .apply_max_message_size_config(
7059 max_decoding_message_size,
7060 max_encoding_message_size,
7061 );
7062 let res = grpc.unary(method, req).await;
7063 Ok(res)
7064 };
7065 Box::pin(fut)
7066 }
7067 "/pidgr.v1.InboxService/MarkRead" => {
7068 #[allow(non_camel_case_types)]
7069 struct MarkReadSvc<T: InboxService>(pub Arc<T>);
7070 impl<
7071 T: InboxService,
7072 > tonic::server::UnaryService<super::MarkReadRequest>
7073 for MarkReadSvc<T> {
7074 type Response = super::MarkReadResponse;
7075 type Future = BoxFuture<
7076 tonic::Response<Self::Response>,
7077 tonic::Status,
7078 >;
7079 fn call(
7080 &mut self,
7081 request: tonic::Request<super::MarkReadRequest>,
7082 ) -> Self::Future {
7083 let inner = Arc::clone(&self.0);
7084 let fut = async move {
7085 <T as InboxService>::mark_read(&inner, request).await
7086 };
7087 Box::pin(fut)
7088 }
7089 }
7090 let accept_compression_encodings = self.accept_compression_encodings;
7091 let send_compression_encodings = self.send_compression_encodings;
7092 let max_decoding_message_size = self.max_decoding_message_size;
7093 let max_encoding_message_size = self.max_encoding_message_size;
7094 let inner = self.inner.clone();
7095 let fut = async move {
7096 let method = MarkReadSvc(inner);
7097 let codec = tonic_prost::ProstCodec::default();
7098 let mut grpc = tonic::server::Grpc::new(codec)
7099 .apply_compression_config(
7100 accept_compression_encodings,
7101 send_compression_encodings,
7102 )
7103 .apply_max_message_size_config(
7104 max_decoding_message_size,
7105 max_encoding_message_size,
7106 );
7107 let res = grpc.unary(method, req).await;
7108 Ok(res)
7109 };
7110 Box::pin(fut)
7111 }
7112 "/pidgr.v1.InboxService/GetMessage" => {
7113 #[allow(non_camel_case_types)]
7114 struct GetMessageSvc<T: InboxService>(pub Arc<T>);
7115 impl<
7116 T: InboxService,
7117 > tonic::server::UnaryService<super::GetMessageRequest>
7118 for GetMessageSvc<T> {
7119 type Response = super::GetMessageResponse;
7120 type Future = BoxFuture<
7121 tonic::Response<Self::Response>,
7122 tonic::Status,
7123 >;
7124 fn call(
7125 &mut self,
7126 request: tonic::Request<super::GetMessageRequest>,
7127 ) -> Self::Future {
7128 let inner = Arc::clone(&self.0);
7129 let fut = async move {
7130 <T as InboxService>::get_message(&inner, request).await
7131 };
7132 Box::pin(fut)
7133 }
7134 }
7135 let accept_compression_encodings = self.accept_compression_encodings;
7136 let send_compression_encodings = self.send_compression_encodings;
7137 let max_decoding_message_size = self.max_decoding_message_size;
7138 let max_encoding_message_size = self.max_encoding_message_size;
7139 let inner = self.inner.clone();
7140 let fut = async move {
7141 let method = GetMessageSvc(inner);
7142 let codec = tonic_prost::ProstCodec::default();
7143 let mut grpc = tonic::server::Grpc::new(codec)
7144 .apply_compression_config(
7145 accept_compression_encodings,
7146 send_compression_encodings,
7147 )
7148 .apply_max_message_size_config(
7149 max_decoding_message_size,
7150 max_encoding_message_size,
7151 );
7152 let res = grpc.unary(method, req).await;
7153 Ok(res)
7154 };
7155 Box::pin(fut)
7156 }
7157 _ => {
7158 Box::pin(async move {
7159 let mut response = http::Response::new(
7160 tonic::body::Body::default(),
7161 );
7162 let headers = response.headers_mut();
7163 headers
7164 .insert(
7165 tonic::Status::GRPC_STATUS,
7166 (tonic::Code::Unimplemented as i32).into(),
7167 );
7168 headers
7169 .insert(
7170 http::header::CONTENT_TYPE,
7171 tonic::metadata::GRPC_CONTENT_TYPE,
7172 );
7173 Ok(response)
7174 })
7175 }
7176 }
7177 }
7178 }
7179 impl<T> Clone for InboxServiceServer<T> {
7180 fn clone(&self) -> Self {
7181 let inner = self.inner.clone();
7182 Self {
7183 inner,
7184 accept_compression_encodings: self.accept_compression_encodings,
7185 send_compression_encodings: self.send_compression_encodings,
7186 max_decoding_message_size: self.max_decoding_message_size,
7187 max_encoding_message_size: self.max_encoding_message_size,
7188 }
7189 }
7190 }
7191 pub const SERVICE_NAME: &str = "pidgr.v1.InboxService";
7193 impl<T> tonic::server::NamedService for InboxServiceServer<T> {
7194 const NAME: &'static str = SERVICE_NAME;
7195 }
7196}
7197pub mod insights_service_client {
7199 #![allow(
7200 unused_variables,
7201 dead_code,
7202 missing_docs,
7203 clippy::wildcard_imports,
7204 clippy::let_unit_value,
7205 )]
7206 use tonic::codegen::*;
7207 use tonic::codegen::http::Uri;
7208 #[derive(Debug, Clone)]
7214 pub struct InsightsServiceClient<T> {
7215 inner: tonic::client::Grpc<T>,
7216 }
7217 impl InsightsServiceClient<tonic::transport::Channel> {
7218 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
7220 where
7221 D: TryInto<tonic::transport::Endpoint>,
7222 D::Error: Into<StdError>,
7223 {
7224 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
7225 Ok(Self::new(conn))
7226 }
7227 }
7228 impl<T> InsightsServiceClient<T>
7229 where
7230 T: tonic::client::GrpcService<tonic::body::Body>,
7231 T::Error: Into<StdError>,
7232 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
7233 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
7234 {
7235 pub fn new(inner: T) -> Self {
7236 let inner = tonic::client::Grpc::new(inner);
7237 Self { inner }
7238 }
7239 pub fn with_origin(inner: T, origin: Uri) -> Self {
7240 let inner = tonic::client::Grpc::with_origin(inner, origin);
7241 Self { inner }
7242 }
7243 pub fn with_interceptor<F>(
7244 inner: T,
7245 interceptor: F,
7246 ) -> InsightsServiceClient<InterceptedService<T, F>>
7247 where
7248 F: tonic::service::Interceptor,
7249 T::ResponseBody: Default,
7250 T: tonic::codegen::Service<
7251 http::Request<tonic::body::Body>,
7252 Response = http::Response<
7253 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
7254 >,
7255 >,
7256 <T as tonic::codegen::Service<
7257 http::Request<tonic::body::Body>,
7258 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
7259 {
7260 InsightsServiceClient::new(InterceptedService::new(inner, interceptor))
7261 }
7262 #[must_use]
7267 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7268 self.inner = self.inner.send_compressed(encoding);
7269 self
7270 }
7271 #[must_use]
7273 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7274 self.inner = self.inner.accept_compressed(encoding);
7275 self
7276 }
7277 #[must_use]
7281 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7282 self.inner = self.inner.max_decoding_message_size(limit);
7283 self
7284 }
7285 #[must_use]
7289 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7290 self.inner = self.inner.max_encoding_message_size(limit);
7291 self
7292 }
7293 pub async fn get_group_archetypes(
7298 &mut self,
7299 request: impl tonic::IntoRequest<super::GetGroupArchetypesRequest>,
7300 ) -> std::result::Result<
7301 tonic::Response<super::GetGroupArchetypesResponse>,
7302 tonic::Status,
7303 > {
7304 self.inner
7305 .ready()
7306 .await
7307 .map_err(|e| {
7308 tonic::Status::unknown(
7309 format!("Service was not ready: {}", e.into()),
7310 )
7311 })?;
7312 let codec = tonic_prost::ProstCodec::default();
7313 let path = http::uri::PathAndQuery::from_static(
7314 "/pidgr.v1.InsightsService/GetGroupArchetypes",
7315 );
7316 let mut req = request.into_request();
7317 req.extensions_mut()
7318 .insert(
7319 GrpcMethod::new("pidgr.v1.InsightsService", "GetGroupArchetypes"),
7320 );
7321 self.inner.unary(req, path, codec).await
7322 }
7323 pub async fn predict_campaign_ack(
7328 &mut self,
7329 request: impl tonic::IntoRequest<super::PredictCampaignAckRequest>,
7330 ) -> std::result::Result<
7331 tonic::Response<super::PredictCampaignAckResponse>,
7332 tonic::Status,
7333 > {
7334 self.inner
7335 .ready()
7336 .await
7337 .map_err(|e| {
7338 tonic::Status::unknown(
7339 format!("Service was not ready: {}", e.into()),
7340 )
7341 })?;
7342 let codec = tonic_prost::ProstCodec::default();
7343 let path = http::uri::PathAndQuery::from_static(
7344 "/pidgr.v1.InsightsService/PredictCampaignACK",
7345 );
7346 let mut req = request.into_request();
7347 req.extensions_mut()
7348 .insert(
7349 GrpcMethod::new("pidgr.v1.InsightsService", "PredictCampaignACK"),
7350 );
7351 self.inner.unary(req, path, codec).await
7352 }
7353 pub async fn get_campaign_advisory(
7358 &mut self,
7359 request: impl tonic::IntoRequest<super::GetCampaignAdvisoryRequest>,
7360 ) -> std::result::Result<
7361 tonic::Response<super::GetCampaignAdvisoryResponse>,
7362 tonic::Status,
7363 > {
7364 self.inner
7365 .ready()
7366 .await
7367 .map_err(|e| {
7368 tonic::Status::unknown(
7369 format!("Service was not ready: {}", e.into()),
7370 )
7371 })?;
7372 let codec = tonic_prost::ProstCodec::default();
7373 let path = http::uri::PathAndQuery::from_static(
7374 "/pidgr.v1.InsightsService/GetCampaignAdvisory",
7375 );
7376 let mut req = request.into_request();
7377 req.extensions_mut()
7378 .insert(
7379 GrpcMethod::new("pidgr.v1.InsightsService", "GetCampaignAdvisory"),
7380 );
7381 self.inner.unary(req, path, codec).await
7382 }
7383 pub async fn get_insight_narrative(
7388 &mut self,
7389 request: impl tonic::IntoRequest<super::GetInsightNarrativeRequest>,
7390 ) -> std::result::Result<
7391 tonic::Response<super::GetInsightNarrativeResponse>,
7392 tonic::Status,
7393 > {
7394 self.inner
7395 .ready()
7396 .await
7397 .map_err(|e| {
7398 tonic::Status::unknown(
7399 format!("Service was not ready: {}", e.into()),
7400 )
7401 })?;
7402 let codec = tonic_prost::ProstCodec::default();
7403 let path = http::uri::PathAndQuery::from_static(
7404 "/pidgr.v1.InsightsService/GetInsightNarrative",
7405 );
7406 let mut req = request.into_request();
7407 req.extensions_mut()
7408 .insert(
7409 GrpcMethod::new("pidgr.v1.InsightsService", "GetInsightNarrative"),
7410 );
7411 self.inner.unary(req, path, codec).await
7412 }
7413 pub async fn trigger_ml_pipeline(
7418 &mut self,
7419 request: impl tonic::IntoRequest<super::TriggerMlPipelineRequest>,
7420 ) -> std::result::Result<
7421 tonic::Response<super::TriggerMlPipelineResponse>,
7422 tonic::Status,
7423 > {
7424 self.inner
7425 .ready()
7426 .await
7427 .map_err(|e| {
7428 tonic::Status::unknown(
7429 format!("Service was not ready: {}", e.into()),
7430 )
7431 })?;
7432 let codec = tonic_prost::ProstCodec::default();
7433 let path = http::uri::PathAndQuery::from_static(
7434 "/pidgr.v1.InsightsService/TriggerMLPipeline",
7435 );
7436 let mut req = request.into_request();
7437 req.extensions_mut()
7438 .insert(
7439 GrpcMethod::new("pidgr.v1.InsightsService", "TriggerMLPipeline"),
7440 );
7441 self.inner.unary(req, path, codec).await
7442 }
7443 pub async fn trigger_archetype_clustering(
7451 &mut self,
7452 request: impl tonic::IntoRequest<super::TriggerArchetypeClusteringRequest>,
7453 ) -> std::result::Result<
7454 tonic::Response<super::TriggerArchetypeClusteringResponse>,
7455 tonic::Status,
7456 > {
7457 self.inner
7458 .ready()
7459 .await
7460 .map_err(|e| {
7461 tonic::Status::unknown(
7462 format!("Service was not ready: {}", e.into()),
7463 )
7464 })?;
7465 let codec = tonic_prost::ProstCodec::default();
7466 let path = http::uri::PathAndQuery::from_static(
7467 "/pidgr.v1.InsightsService/TriggerArchetypeClustering",
7468 );
7469 let mut req = request.into_request();
7470 req.extensions_mut()
7471 .insert(
7472 GrpcMethod::new(
7473 "pidgr.v1.InsightsService",
7474 "TriggerArchetypeClustering",
7475 ),
7476 );
7477 self.inner.unary(req, path, codec).await
7478 }
7479 pub async fn generate_campaign_body_draft(
7487 &mut self,
7488 request: impl tonic::IntoRequest<super::GenerateCampaignBodyDraftRequest>,
7489 ) -> std::result::Result<
7490 tonic::Response<super::GenerateCampaignBodyDraftResponse>,
7491 tonic::Status,
7492 > {
7493 self.inner
7494 .ready()
7495 .await
7496 .map_err(|e| {
7497 tonic::Status::unknown(
7498 format!("Service was not ready: {}", e.into()),
7499 )
7500 })?;
7501 let codec = tonic_prost::ProstCodec::default();
7502 let path = http::uri::PathAndQuery::from_static(
7503 "/pidgr.v1.InsightsService/GenerateCampaignBodyDraft",
7504 );
7505 let mut req = request.into_request();
7506 req.extensions_mut()
7507 .insert(
7508 GrpcMethod::new(
7509 "pidgr.v1.InsightsService",
7510 "GenerateCampaignBodyDraft",
7511 ),
7512 );
7513 self.inner.unary(req, path, codec).await
7514 }
7515 }
7516}
7517pub mod insights_service_server {
7519 #![allow(
7520 unused_variables,
7521 dead_code,
7522 missing_docs,
7523 clippy::wildcard_imports,
7524 clippy::let_unit_value,
7525 )]
7526 use tonic::codegen::*;
7527 #[async_trait]
7529 pub trait InsightsService: std::marker::Send + std::marker::Sync + 'static {
7530 async fn get_group_archetypes(
7535 &self,
7536 request: tonic::Request<super::GetGroupArchetypesRequest>,
7537 ) -> std::result::Result<
7538 tonic::Response<super::GetGroupArchetypesResponse>,
7539 tonic::Status,
7540 >;
7541 async fn predict_campaign_ack(
7546 &self,
7547 request: tonic::Request<super::PredictCampaignAckRequest>,
7548 ) -> std::result::Result<
7549 tonic::Response<super::PredictCampaignAckResponse>,
7550 tonic::Status,
7551 >;
7552 async fn get_campaign_advisory(
7557 &self,
7558 request: tonic::Request<super::GetCampaignAdvisoryRequest>,
7559 ) -> std::result::Result<
7560 tonic::Response<super::GetCampaignAdvisoryResponse>,
7561 tonic::Status,
7562 >;
7563 async fn get_insight_narrative(
7568 &self,
7569 request: tonic::Request<super::GetInsightNarrativeRequest>,
7570 ) -> std::result::Result<
7571 tonic::Response<super::GetInsightNarrativeResponse>,
7572 tonic::Status,
7573 >;
7574 async fn trigger_ml_pipeline(
7579 &self,
7580 request: tonic::Request<super::TriggerMlPipelineRequest>,
7581 ) -> std::result::Result<
7582 tonic::Response<super::TriggerMlPipelineResponse>,
7583 tonic::Status,
7584 >;
7585 async fn trigger_archetype_clustering(
7593 &self,
7594 request: tonic::Request<super::TriggerArchetypeClusteringRequest>,
7595 ) -> std::result::Result<
7596 tonic::Response<super::TriggerArchetypeClusteringResponse>,
7597 tonic::Status,
7598 >;
7599 async fn generate_campaign_body_draft(
7607 &self,
7608 request: tonic::Request<super::GenerateCampaignBodyDraftRequest>,
7609 ) -> std::result::Result<
7610 tonic::Response<super::GenerateCampaignBodyDraftResponse>,
7611 tonic::Status,
7612 >;
7613 }
7614 #[derive(Debug)]
7620 pub struct InsightsServiceServer<T> {
7621 inner: Arc<T>,
7622 accept_compression_encodings: EnabledCompressionEncodings,
7623 send_compression_encodings: EnabledCompressionEncodings,
7624 max_decoding_message_size: Option<usize>,
7625 max_encoding_message_size: Option<usize>,
7626 }
7627 impl<T> InsightsServiceServer<T> {
7628 pub fn new(inner: T) -> Self {
7629 Self::from_arc(Arc::new(inner))
7630 }
7631 pub fn from_arc(inner: Arc<T>) -> Self {
7632 Self {
7633 inner,
7634 accept_compression_encodings: Default::default(),
7635 send_compression_encodings: Default::default(),
7636 max_decoding_message_size: None,
7637 max_encoding_message_size: None,
7638 }
7639 }
7640 pub fn with_interceptor<F>(
7641 inner: T,
7642 interceptor: F,
7643 ) -> InterceptedService<Self, F>
7644 where
7645 F: tonic::service::Interceptor,
7646 {
7647 InterceptedService::new(Self::new(inner), interceptor)
7648 }
7649 #[must_use]
7651 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7652 self.accept_compression_encodings.enable(encoding);
7653 self
7654 }
7655 #[must_use]
7657 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7658 self.send_compression_encodings.enable(encoding);
7659 self
7660 }
7661 #[must_use]
7665 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7666 self.max_decoding_message_size = Some(limit);
7667 self
7668 }
7669 #[must_use]
7673 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7674 self.max_encoding_message_size = Some(limit);
7675 self
7676 }
7677 }
7678 impl<T, B> tonic::codegen::Service<http::Request<B>> for InsightsServiceServer<T>
7679 where
7680 T: InsightsService,
7681 B: Body + std::marker::Send + 'static,
7682 B::Error: Into<StdError> + std::marker::Send + 'static,
7683 {
7684 type Response = http::Response<tonic::body::Body>;
7685 type Error = std::convert::Infallible;
7686 type Future = BoxFuture<Self::Response, Self::Error>;
7687 fn poll_ready(
7688 &mut self,
7689 _cx: &mut Context<'_>,
7690 ) -> Poll<std::result::Result<(), Self::Error>> {
7691 Poll::Ready(Ok(()))
7692 }
7693 fn call(&mut self, req: http::Request<B>) -> Self::Future {
7694 match req.uri().path() {
7695 "/pidgr.v1.InsightsService/GetGroupArchetypes" => {
7696 #[allow(non_camel_case_types)]
7697 struct GetGroupArchetypesSvc<T: InsightsService>(pub Arc<T>);
7698 impl<
7699 T: InsightsService,
7700 > tonic::server::UnaryService<super::GetGroupArchetypesRequest>
7701 for GetGroupArchetypesSvc<T> {
7702 type Response = super::GetGroupArchetypesResponse;
7703 type Future = BoxFuture<
7704 tonic::Response<Self::Response>,
7705 tonic::Status,
7706 >;
7707 fn call(
7708 &mut self,
7709 request: tonic::Request<super::GetGroupArchetypesRequest>,
7710 ) -> Self::Future {
7711 let inner = Arc::clone(&self.0);
7712 let fut = async move {
7713 <T as InsightsService>::get_group_archetypes(
7714 &inner,
7715 request,
7716 )
7717 .await
7718 };
7719 Box::pin(fut)
7720 }
7721 }
7722 let accept_compression_encodings = self.accept_compression_encodings;
7723 let send_compression_encodings = self.send_compression_encodings;
7724 let max_decoding_message_size = self.max_decoding_message_size;
7725 let max_encoding_message_size = self.max_encoding_message_size;
7726 let inner = self.inner.clone();
7727 let fut = async move {
7728 let method = GetGroupArchetypesSvc(inner);
7729 let codec = tonic_prost::ProstCodec::default();
7730 let mut grpc = tonic::server::Grpc::new(codec)
7731 .apply_compression_config(
7732 accept_compression_encodings,
7733 send_compression_encodings,
7734 )
7735 .apply_max_message_size_config(
7736 max_decoding_message_size,
7737 max_encoding_message_size,
7738 );
7739 let res = grpc.unary(method, req).await;
7740 Ok(res)
7741 };
7742 Box::pin(fut)
7743 }
7744 "/pidgr.v1.InsightsService/PredictCampaignACK" => {
7745 #[allow(non_camel_case_types)]
7746 struct PredictCampaignACKSvc<T: InsightsService>(pub Arc<T>);
7747 impl<
7748 T: InsightsService,
7749 > tonic::server::UnaryService<super::PredictCampaignAckRequest>
7750 for PredictCampaignACKSvc<T> {
7751 type Response = super::PredictCampaignAckResponse;
7752 type Future = BoxFuture<
7753 tonic::Response<Self::Response>,
7754 tonic::Status,
7755 >;
7756 fn call(
7757 &mut self,
7758 request: tonic::Request<super::PredictCampaignAckRequest>,
7759 ) -> Self::Future {
7760 let inner = Arc::clone(&self.0);
7761 let fut = async move {
7762 <T as InsightsService>::predict_campaign_ack(
7763 &inner,
7764 request,
7765 )
7766 .await
7767 };
7768 Box::pin(fut)
7769 }
7770 }
7771 let accept_compression_encodings = self.accept_compression_encodings;
7772 let send_compression_encodings = self.send_compression_encodings;
7773 let max_decoding_message_size = self.max_decoding_message_size;
7774 let max_encoding_message_size = self.max_encoding_message_size;
7775 let inner = self.inner.clone();
7776 let fut = async move {
7777 let method = PredictCampaignACKSvc(inner);
7778 let codec = tonic_prost::ProstCodec::default();
7779 let mut grpc = tonic::server::Grpc::new(codec)
7780 .apply_compression_config(
7781 accept_compression_encodings,
7782 send_compression_encodings,
7783 )
7784 .apply_max_message_size_config(
7785 max_decoding_message_size,
7786 max_encoding_message_size,
7787 );
7788 let res = grpc.unary(method, req).await;
7789 Ok(res)
7790 };
7791 Box::pin(fut)
7792 }
7793 "/pidgr.v1.InsightsService/GetCampaignAdvisory" => {
7794 #[allow(non_camel_case_types)]
7795 struct GetCampaignAdvisorySvc<T: InsightsService>(pub Arc<T>);
7796 impl<
7797 T: InsightsService,
7798 > tonic::server::UnaryService<super::GetCampaignAdvisoryRequest>
7799 for GetCampaignAdvisorySvc<T> {
7800 type Response = super::GetCampaignAdvisoryResponse;
7801 type Future = BoxFuture<
7802 tonic::Response<Self::Response>,
7803 tonic::Status,
7804 >;
7805 fn call(
7806 &mut self,
7807 request: tonic::Request<super::GetCampaignAdvisoryRequest>,
7808 ) -> Self::Future {
7809 let inner = Arc::clone(&self.0);
7810 let fut = async move {
7811 <T as InsightsService>::get_campaign_advisory(
7812 &inner,
7813 request,
7814 )
7815 .await
7816 };
7817 Box::pin(fut)
7818 }
7819 }
7820 let accept_compression_encodings = self.accept_compression_encodings;
7821 let send_compression_encodings = self.send_compression_encodings;
7822 let max_decoding_message_size = self.max_decoding_message_size;
7823 let max_encoding_message_size = self.max_encoding_message_size;
7824 let inner = self.inner.clone();
7825 let fut = async move {
7826 let method = GetCampaignAdvisorySvc(inner);
7827 let codec = tonic_prost::ProstCodec::default();
7828 let mut grpc = tonic::server::Grpc::new(codec)
7829 .apply_compression_config(
7830 accept_compression_encodings,
7831 send_compression_encodings,
7832 )
7833 .apply_max_message_size_config(
7834 max_decoding_message_size,
7835 max_encoding_message_size,
7836 );
7837 let res = grpc.unary(method, req).await;
7838 Ok(res)
7839 };
7840 Box::pin(fut)
7841 }
7842 "/pidgr.v1.InsightsService/GetInsightNarrative" => {
7843 #[allow(non_camel_case_types)]
7844 struct GetInsightNarrativeSvc<T: InsightsService>(pub Arc<T>);
7845 impl<
7846 T: InsightsService,
7847 > tonic::server::UnaryService<super::GetInsightNarrativeRequest>
7848 for GetInsightNarrativeSvc<T> {
7849 type Response = super::GetInsightNarrativeResponse;
7850 type Future = BoxFuture<
7851 tonic::Response<Self::Response>,
7852 tonic::Status,
7853 >;
7854 fn call(
7855 &mut self,
7856 request: tonic::Request<super::GetInsightNarrativeRequest>,
7857 ) -> Self::Future {
7858 let inner = Arc::clone(&self.0);
7859 let fut = async move {
7860 <T as InsightsService>::get_insight_narrative(
7861 &inner,
7862 request,
7863 )
7864 .await
7865 };
7866 Box::pin(fut)
7867 }
7868 }
7869 let accept_compression_encodings = self.accept_compression_encodings;
7870 let send_compression_encodings = self.send_compression_encodings;
7871 let max_decoding_message_size = self.max_decoding_message_size;
7872 let max_encoding_message_size = self.max_encoding_message_size;
7873 let inner = self.inner.clone();
7874 let fut = async move {
7875 let method = GetInsightNarrativeSvc(inner);
7876 let codec = tonic_prost::ProstCodec::default();
7877 let mut grpc = tonic::server::Grpc::new(codec)
7878 .apply_compression_config(
7879 accept_compression_encodings,
7880 send_compression_encodings,
7881 )
7882 .apply_max_message_size_config(
7883 max_decoding_message_size,
7884 max_encoding_message_size,
7885 );
7886 let res = grpc.unary(method, req).await;
7887 Ok(res)
7888 };
7889 Box::pin(fut)
7890 }
7891 "/pidgr.v1.InsightsService/TriggerMLPipeline" => {
7892 #[allow(non_camel_case_types)]
7893 struct TriggerMLPipelineSvc<T: InsightsService>(pub Arc<T>);
7894 impl<
7895 T: InsightsService,
7896 > tonic::server::UnaryService<super::TriggerMlPipelineRequest>
7897 for TriggerMLPipelineSvc<T> {
7898 type Response = super::TriggerMlPipelineResponse;
7899 type Future = BoxFuture<
7900 tonic::Response<Self::Response>,
7901 tonic::Status,
7902 >;
7903 fn call(
7904 &mut self,
7905 request: tonic::Request<super::TriggerMlPipelineRequest>,
7906 ) -> Self::Future {
7907 let inner = Arc::clone(&self.0);
7908 let fut = async move {
7909 <T as InsightsService>::trigger_ml_pipeline(&inner, request)
7910 .await
7911 };
7912 Box::pin(fut)
7913 }
7914 }
7915 let accept_compression_encodings = self.accept_compression_encodings;
7916 let send_compression_encodings = self.send_compression_encodings;
7917 let max_decoding_message_size = self.max_decoding_message_size;
7918 let max_encoding_message_size = self.max_encoding_message_size;
7919 let inner = self.inner.clone();
7920 let fut = async move {
7921 let method = TriggerMLPipelineSvc(inner);
7922 let codec = tonic_prost::ProstCodec::default();
7923 let mut grpc = tonic::server::Grpc::new(codec)
7924 .apply_compression_config(
7925 accept_compression_encodings,
7926 send_compression_encodings,
7927 )
7928 .apply_max_message_size_config(
7929 max_decoding_message_size,
7930 max_encoding_message_size,
7931 );
7932 let res = grpc.unary(method, req).await;
7933 Ok(res)
7934 };
7935 Box::pin(fut)
7936 }
7937 "/pidgr.v1.InsightsService/TriggerArchetypeClustering" => {
7938 #[allow(non_camel_case_types)]
7939 struct TriggerArchetypeClusteringSvc<T: InsightsService>(pub Arc<T>);
7940 impl<
7941 T: InsightsService,
7942 > tonic::server::UnaryService<
7943 super::TriggerArchetypeClusteringRequest,
7944 > for TriggerArchetypeClusteringSvc<T> {
7945 type Response = super::TriggerArchetypeClusteringResponse;
7946 type Future = BoxFuture<
7947 tonic::Response<Self::Response>,
7948 tonic::Status,
7949 >;
7950 fn call(
7951 &mut self,
7952 request: tonic::Request<
7953 super::TriggerArchetypeClusteringRequest,
7954 >,
7955 ) -> Self::Future {
7956 let inner = Arc::clone(&self.0);
7957 let fut = async move {
7958 <T as InsightsService>::trigger_archetype_clustering(
7959 &inner,
7960 request,
7961 )
7962 .await
7963 };
7964 Box::pin(fut)
7965 }
7966 }
7967 let accept_compression_encodings = self.accept_compression_encodings;
7968 let send_compression_encodings = self.send_compression_encodings;
7969 let max_decoding_message_size = self.max_decoding_message_size;
7970 let max_encoding_message_size = self.max_encoding_message_size;
7971 let inner = self.inner.clone();
7972 let fut = async move {
7973 let method = TriggerArchetypeClusteringSvc(inner);
7974 let codec = tonic_prost::ProstCodec::default();
7975 let mut grpc = tonic::server::Grpc::new(codec)
7976 .apply_compression_config(
7977 accept_compression_encodings,
7978 send_compression_encodings,
7979 )
7980 .apply_max_message_size_config(
7981 max_decoding_message_size,
7982 max_encoding_message_size,
7983 );
7984 let res = grpc.unary(method, req).await;
7985 Ok(res)
7986 };
7987 Box::pin(fut)
7988 }
7989 "/pidgr.v1.InsightsService/GenerateCampaignBodyDraft" => {
7990 #[allow(non_camel_case_types)]
7991 struct GenerateCampaignBodyDraftSvc<T: InsightsService>(pub Arc<T>);
7992 impl<
7993 T: InsightsService,
7994 > tonic::server::UnaryService<
7995 super::GenerateCampaignBodyDraftRequest,
7996 > for GenerateCampaignBodyDraftSvc<T> {
7997 type Response = super::GenerateCampaignBodyDraftResponse;
7998 type Future = BoxFuture<
7999 tonic::Response<Self::Response>,
8000 tonic::Status,
8001 >;
8002 fn call(
8003 &mut self,
8004 request: tonic::Request<
8005 super::GenerateCampaignBodyDraftRequest,
8006 >,
8007 ) -> Self::Future {
8008 let inner = Arc::clone(&self.0);
8009 let fut = async move {
8010 <T as InsightsService>::generate_campaign_body_draft(
8011 &inner,
8012 request,
8013 )
8014 .await
8015 };
8016 Box::pin(fut)
8017 }
8018 }
8019 let accept_compression_encodings = self.accept_compression_encodings;
8020 let send_compression_encodings = self.send_compression_encodings;
8021 let max_decoding_message_size = self.max_decoding_message_size;
8022 let max_encoding_message_size = self.max_encoding_message_size;
8023 let inner = self.inner.clone();
8024 let fut = async move {
8025 let method = GenerateCampaignBodyDraftSvc(inner);
8026 let codec = tonic_prost::ProstCodec::default();
8027 let mut grpc = tonic::server::Grpc::new(codec)
8028 .apply_compression_config(
8029 accept_compression_encodings,
8030 send_compression_encodings,
8031 )
8032 .apply_max_message_size_config(
8033 max_decoding_message_size,
8034 max_encoding_message_size,
8035 );
8036 let res = grpc.unary(method, req).await;
8037 Ok(res)
8038 };
8039 Box::pin(fut)
8040 }
8041 _ => {
8042 Box::pin(async move {
8043 let mut response = http::Response::new(
8044 tonic::body::Body::default(),
8045 );
8046 let headers = response.headers_mut();
8047 headers
8048 .insert(
8049 tonic::Status::GRPC_STATUS,
8050 (tonic::Code::Unimplemented as i32).into(),
8051 );
8052 headers
8053 .insert(
8054 http::header::CONTENT_TYPE,
8055 tonic::metadata::GRPC_CONTENT_TYPE,
8056 );
8057 Ok(response)
8058 })
8059 }
8060 }
8061 }
8062 }
8063 impl<T> Clone for InsightsServiceServer<T> {
8064 fn clone(&self) -> Self {
8065 let inner = self.inner.clone();
8066 Self {
8067 inner,
8068 accept_compression_encodings: self.accept_compression_encodings,
8069 send_compression_encodings: self.send_compression_encodings,
8070 max_decoding_message_size: self.max_decoding_message_size,
8071 max_encoding_message_size: self.max_encoding_message_size,
8072 }
8073 }
8074 }
8075 pub const SERVICE_NAME: &str = "pidgr.v1.InsightsService";
8077 impl<T> tonic::server::NamedService for InsightsServiceServer<T> {
8078 const NAME: &'static str = SERVICE_NAME;
8079 }
8080}
8081pub mod integrations_service_client {
8083 #![allow(
8084 unused_variables,
8085 dead_code,
8086 missing_docs,
8087 clippy::wildcard_imports,
8088 clippy::let_unit_value,
8089 )]
8090 use tonic::codegen::*;
8091 use tonic::codegen::http::Uri;
8092 #[derive(Debug, Clone)]
8107 pub struct IntegrationsServiceClient<T> {
8108 inner: tonic::client::Grpc<T>,
8109 }
8110 impl IntegrationsServiceClient<tonic::transport::Channel> {
8111 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
8113 where
8114 D: TryInto<tonic::transport::Endpoint>,
8115 D::Error: Into<StdError>,
8116 {
8117 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
8118 Ok(Self::new(conn))
8119 }
8120 }
8121 impl<T> IntegrationsServiceClient<T>
8122 where
8123 T: tonic::client::GrpcService<tonic::body::Body>,
8124 T::Error: Into<StdError>,
8125 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
8126 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
8127 {
8128 pub fn new(inner: T) -> Self {
8129 let inner = tonic::client::Grpc::new(inner);
8130 Self { inner }
8131 }
8132 pub fn with_origin(inner: T, origin: Uri) -> Self {
8133 let inner = tonic::client::Grpc::with_origin(inner, origin);
8134 Self { inner }
8135 }
8136 pub fn with_interceptor<F>(
8137 inner: T,
8138 interceptor: F,
8139 ) -> IntegrationsServiceClient<InterceptedService<T, F>>
8140 where
8141 F: tonic::service::Interceptor,
8142 T::ResponseBody: Default,
8143 T: tonic::codegen::Service<
8144 http::Request<tonic::body::Body>,
8145 Response = http::Response<
8146 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
8147 >,
8148 >,
8149 <T as tonic::codegen::Service<
8150 http::Request<tonic::body::Body>,
8151 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
8152 {
8153 IntegrationsServiceClient::new(InterceptedService::new(inner, interceptor))
8154 }
8155 #[must_use]
8160 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8161 self.inner = self.inner.send_compressed(encoding);
8162 self
8163 }
8164 #[must_use]
8166 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8167 self.inner = self.inner.accept_compressed(encoding);
8168 self
8169 }
8170 #[must_use]
8174 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8175 self.inner = self.inner.max_decoding_message_size(limit);
8176 self
8177 }
8178 #[must_use]
8182 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8183 self.inner = self.inner.max_encoding_message_size(limit);
8184 self
8185 }
8186 pub async fn dispatch_to_channel(
8190 &mut self,
8191 request: impl tonic::IntoRequest<super::DispatchToChannelRequest>,
8192 ) -> std::result::Result<
8193 tonic::Response<super::DispatchToChannelResponse>,
8194 tonic::Status,
8195 > {
8196 self.inner
8197 .ready()
8198 .await
8199 .map_err(|e| {
8200 tonic::Status::unknown(
8201 format!("Service was not ready: {}", e.into()),
8202 )
8203 })?;
8204 let codec = tonic_prost::ProstCodec::default();
8205 let path = http::uri::PathAndQuery::from_static(
8206 "/pidgr.v1.IntegrationsService/DispatchToChannel",
8207 );
8208 let mut req = request.into_request();
8209 req.extensions_mut()
8210 .insert(
8211 GrpcMethod::new("pidgr.v1.IntegrationsService", "DispatchToChannel"),
8212 );
8213 self.inner.unary(req, path, codec).await
8214 }
8215 pub async fn upsert_reachability(
8220 &mut self,
8221 request: impl tonic::IntoRequest<super::UpsertReachabilityRequest>,
8222 ) -> std::result::Result<
8223 tonic::Response<super::UpsertReachabilityResponse>,
8224 tonic::Status,
8225 > {
8226 self.inner
8227 .ready()
8228 .await
8229 .map_err(|e| {
8230 tonic::Status::unknown(
8231 format!("Service was not ready: {}", e.into()),
8232 )
8233 })?;
8234 let codec = tonic_prost::ProstCodec::default();
8235 let path = http::uri::PathAndQuery::from_static(
8236 "/pidgr.v1.IntegrationsService/UpsertReachability",
8237 );
8238 let mut req = request.into_request();
8239 req.extensions_mut()
8240 .insert(
8241 GrpcMethod::new("pidgr.v1.IntegrationsService", "UpsertReachability"),
8242 );
8243 self.inner.unary(req, path, codec).await
8244 }
8245 pub async fn remove_reachability(
8249 &mut self,
8250 request: impl tonic::IntoRequest<super::RemoveReachabilityRequest>,
8251 ) -> std::result::Result<
8252 tonic::Response<super::RemoveReachabilityResponse>,
8253 tonic::Status,
8254 > {
8255 self.inner
8256 .ready()
8257 .await
8258 .map_err(|e| {
8259 tonic::Status::unknown(
8260 format!("Service was not ready: {}", e.into()),
8261 )
8262 })?;
8263 let codec = tonic_prost::ProstCodec::default();
8264 let path = http::uri::PathAndQuery::from_static(
8265 "/pidgr.v1.IntegrationsService/RemoveReachability",
8266 );
8267 let mut req = request.into_request();
8268 req.extensions_mut()
8269 .insert(
8270 GrpcMethod::new("pidgr.v1.IntegrationsService", "RemoveReachability"),
8271 );
8272 self.inner.unary(req, path, codec).await
8273 }
8274 pub async fn get_reachability(
8278 &mut self,
8279 request: impl tonic::IntoRequest<super::GetReachabilityRequest>,
8280 ) -> std::result::Result<
8281 tonic::Response<super::GetReachabilityResponse>,
8282 tonic::Status,
8283 > {
8284 self.inner
8285 .ready()
8286 .await
8287 .map_err(|e| {
8288 tonic::Status::unknown(
8289 format!("Service was not ready: {}", e.into()),
8290 )
8291 })?;
8292 let codec = tonic_prost::ProstCodec::default();
8293 let path = http::uri::PathAndQuery::from_static(
8294 "/pidgr.v1.IntegrationsService/GetReachability",
8295 );
8296 let mut req = request.into_request();
8297 req.extensions_mut()
8298 .insert(
8299 GrpcMethod::new("pidgr.v1.IntegrationsService", "GetReachability"),
8300 );
8301 self.inner.unary(req, path, codec).await
8302 }
8303 pub async fn list_reachability_for_user(
8307 &mut self,
8308 request: impl tonic::IntoRequest<super::ListReachabilityForUserRequest>,
8309 ) -> std::result::Result<
8310 tonic::Response<super::ListReachabilityForUserResponse>,
8311 tonic::Status,
8312 > {
8313 self.inner
8314 .ready()
8315 .await
8316 .map_err(|e| {
8317 tonic::Status::unknown(
8318 format!("Service was not ready: {}", e.into()),
8319 )
8320 })?;
8321 let codec = tonic_prost::ProstCodec::default();
8322 let path = http::uri::PathAndQuery::from_static(
8323 "/pidgr.v1.IntegrationsService/ListReachabilityForUser",
8324 );
8325 let mut req = request.into_request();
8326 req.extensions_mut()
8327 .insert(
8328 GrpcMethod::new(
8329 "pidgr.v1.IntegrationsService",
8330 "ListReachabilityForUser",
8331 ),
8332 );
8333 self.inner.unary(req, path, codec).await
8334 }
8335 pub async fn get_region_policy(
8339 &mut self,
8340 request: impl tonic::IntoRequest<super::GetRegionPolicyRequest>,
8341 ) -> std::result::Result<
8342 tonic::Response<super::GetRegionPolicyResponse>,
8343 tonic::Status,
8344 > {
8345 self.inner
8346 .ready()
8347 .await
8348 .map_err(|e| {
8349 tonic::Status::unknown(
8350 format!("Service was not ready: {}", e.into()),
8351 )
8352 })?;
8353 let codec = tonic_prost::ProstCodec::default();
8354 let path = http::uri::PathAndQuery::from_static(
8355 "/pidgr.v1.IntegrationsService/GetRegionPolicy",
8356 );
8357 let mut req = request.into_request();
8358 req.extensions_mut()
8359 .insert(
8360 GrpcMethod::new("pidgr.v1.IntegrationsService", "GetRegionPolicy"),
8361 );
8362 self.inner.unary(req, path, codec).await
8363 }
8364 pub async fn set_region_policy(
8367 &mut self,
8368 request: impl tonic::IntoRequest<super::SetRegionPolicyRequest>,
8369 ) -> std::result::Result<
8370 tonic::Response<super::SetRegionPolicyResponse>,
8371 tonic::Status,
8372 > {
8373 self.inner
8374 .ready()
8375 .await
8376 .map_err(|e| {
8377 tonic::Status::unknown(
8378 format!("Service was not ready: {}", e.into()),
8379 )
8380 })?;
8381 let codec = tonic_prost::ProstCodec::default();
8382 let path = http::uri::PathAndQuery::from_static(
8383 "/pidgr.v1.IntegrationsService/SetRegionPolicy",
8384 );
8385 let mut req = request.into_request();
8386 req.extensions_mut()
8387 .insert(
8388 GrpcMethod::new("pidgr.v1.IntegrationsService", "SetRegionPolicy"),
8389 );
8390 self.inner.unary(req, path, codec).await
8391 }
8392 pub async fn get_cost_cap_policy(
8396 &mut self,
8397 request: impl tonic::IntoRequest<super::GetCostCapPolicyRequest>,
8398 ) -> std::result::Result<
8399 tonic::Response<super::GetCostCapPolicyResponse>,
8400 tonic::Status,
8401 > {
8402 self.inner
8403 .ready()
8404 .await
8405 .map_err(|e| {
8406 tonic::Status::unknown(
8407 format!("Service was not ready: {}", e.into()),
8408 )
8409 })?;
8410 let codec = tonic_prost::ProstCodec::default();
8411 let path = http::uri::PathAndQuery::from_static(
8412 "/pidgr.v1.IntegrationsService/GetCostCapPolicy",
8413 );
8414 let mut req = request.into_request();
8415 req.extensions_mut()
8416 .insert(
8417 GrpcMethod::new("pidgr.v1.IntegrationsService", "GetCostCapPolicy"),
8418 );
8419 self.inner.unary(req, path, codec).await
8420 }
8421 pub async fn set_cost_cap_policy(
8424 &mut self,
8425 request: impl tonic::IntoRequest<super::SetCostCapPolicyRequest>,
8426 ) -> std::result::Result<
8427 tonic::Response<super::SetCostCapPolicyResponse>,
8428 tonic::Status,
8429 > {
8430 self.inner
8431 .ready()
8432 .await
8433 .map_err(|e| {
8434 tonic::Status::unknown(
8435 format!("Service was not ready: {}", e.into()),
8436 )
8437 })?;
8438 let codec = tonic_prost::ProstCodec::default();
8439 let path = http::uri::PathAndQuery::from_static(
8440 "/pidgr.v1.IntegrationsService/SetCostCapPolicy",
8441 );
8442 let mut req = request.into_request();
8443 req.extensions_mut()
8444 .insert(
8445 GrpcMethod::new("pidgr.v1.IntegrationsService", "SetCostCapPolicy"),
8446 );
8447 self.inner.unary(req, path, codec).await
8448 }
8449 pub async fn get_org_webhook_config(
8454 &mut self,
8455 request: impl tonic::IntoRequest<super::GetOrgWebhookConfigRequest>,
8456 ) -> std::result::Result<
8457 tonic::Response<super::GetOrgWebhookConfigResponse>,
8458 tonic::Status,
8459 > {
8460 self.inner
8461 .ready()
8462 .await
8463 .map_err(|e| {
8464 tonic::Status::unknown(
8465 format!("Service was not ready: {}", e.into()),
8466 )
8467 })?;
8468 let codec = tonic_prost::ProstCodec::default();
8469 let path = http::uri::PathAndQuery::from_static(
8470 "/pidgr.v1.IntegrationsService/GetOrgWebhookConfig",
8471 );
8472 let mut req = request.into_request();
8473 req.extensions_mut()
8474 .insert(
8475 GrpcMethod::new(
8476 "pidgr.v1.IntegrationsService",
8477 "GetOrgWebhookConfig",
8478 ),
8479 );
8480 self.inner.unary(req, path, codec).await
8481 }
8482 pub async fn set_org_webhook_config(
8487 &mut self,
8488 request: impl tonic::IntoRequest<super::SetOrgWebhookConfigRequest>,
8489 ) -> std::result::Result<
8490 tonic::Response<super::SetOrgWebhookConfigResponse>,
8491 tonic::Status,
8492 > {
8493 self.inner
8494 .ready()
8495 .await
8496 .map_err(|e| {
8497 tonic::Status::unknown(
8498 format!("Service was not ready: {}", e.into()),
8499 )
8500 })?;
8501 let codec = tonic_prost::ProstCodec::default();
8502 let path = http::uri::PathAndQuery::from_static(
8503 "/pidgr.v1.IntegrationsService/SetOrgWebhookConfig",
8504 );
8505 let mut req = request.into_request();
8506 req.extensions_mut()
8507 .insert(
8508 GrpcMethod::new(
8509 "pidgr.v1.IntegrationsService",
8510 "SetOrgWebhookConfig",
8511 ),
8512 );
8513 self.inner.unary(req, path, codec).await
8514 }
8515 pub async fn create_channel_connect_link(
8522 &mut self,
8523 request: impl tonic::IntoRequest<super::CreateChannelConnectLinkRequest>,
8524 ) -> std::result::Result<
8525 tonic::Response<super::CreateChannelConnectLinkResponse>,
8526 tonic::Status,
8527 > {
8528 self.inner
8529 .ready()
8530 .await
8531 .map_err(|e| {
8532 tonic::Status::unknown(
8533 format!("Service was not ready: {}", e.into()),
8534 )
8535 })?;
8536 let codec = tonic_prost::ProstCodec::default();
8537 let path = http::uri::PathAndQuery::from_static(
8538 "/pidgr.v1.IntegrationsService/CreateChannelConnectLink",
8539 );
8540 let mut req = request.into_request();
8541 req.extensions_mut()
8542 .insert(
8543 GrpcMethod::new(
8544 "pidgr.v1.IntegrationsService",
8545 "CreateChannelConnectLink",
8546 ),
8547 );
8548 self.inner.unary(req, path, codec).await
8549 }
8550 pub async fn create_slack_workspace_install_authorization(
8558 &mut self,
8559 request: impl tonic::IntoRequest<
8560 super::CreateSlackWorkspaceInstallAuthorizationRequest,
8561 >,
8562 ) -> std::result::Result<
8563 tonic::Response<super::CreateSlackWorkspaceInstallAuthorizationResponse>,
8564 tonic::Status,
8565 > {
8566 self.inner
8567 .ready()
8568 .await
8569 .map_err(|e| {
8570 tonic::Status::unknown(
8571 format!("Service was not ready: {}", e.into()),
8572 )
8573 })?;
8574 let codec = tonic_prost::ProstCodec::default();
8575 let path = http::uri::PathAndQuery::from_static(
8576 "/pidgr.v1.IntegrationsService/CreateSlackWorkspaceInstallAuthorization",
8577 );
8578 let mut req = request.into_request();
8579 req.extensions_mut()
8580 .insert(
8581 GrpcMethod::new(
8582 "pidgr.v1.IntegrationsService",
8583 "CreateSlackWorkspaceInstallAuthorization",
8584 ),
8585 );
8586 self.inner.unary(req, path, codec).await
8587 }
8588 }
8589}
8590pub mod integrations_service_server {
8592 #![allow(
8593 unused_variables,
8594 dead_code,
8595 missing_docs,
8596 clippy::wildcard_imports,
8597 clippy::let_unit_value,
8598 )]
8599 use tonic::codegen::*;
8600 #[async_trait]
8602 pub trait IntegrationsService: std::marker::Send + std::marker::Sync + 'static {
8603 async fn dispatch_to_channel(
8607 &self,
8608 request: tonic::Request<super::DispatchToChannelRequest>,
8609 ) -> std::result::Result<
8610 tonic::Response<super::DispatchToChannelResponse>,
8611 tonic::Status,
8612 >;
8613 async fn upsert_reachability(
8618 &self,
8619 request: tonic::Request<super::UpsertReachabilityRequest>,
8620 ) -> std::result::Result<
8621 tonic::Response<super::UpsertReachabilityResponse>,
8622 tonic::Status,
8623 >;
8624 async fn remove_reachability(
8628 &self,
8629 request: tonic::Request<super::RemoveReachabilityRequest>,
8630 ) -> std::result::Result<
8631 tonic::Response<super::RemoveReachabilityResponse>,
8632 tonic::Status,
8633 >;
8634 async fn get_reachability(
8638 &self,
8639 request: tonic::Request<super::GetReachabilityRequest>,
8640 ) -> std::result::Result<
8641 tonic::Response<super::GetReachabilityResponse>,
8642 tonic::Status,
8643 >;
8644 async fn list_reachability_for_user(
8648 &self,
8649 request: tonic::Request<super::ListReachabilityForUserRequest>,
8650 ) -> std::result::Result<
8651 tonic::Response<super::ListReachabilityForUserResponse>,
8652 tonic::Status,
8653 >;
8654 async fn get_region_policy(
8658 &self,
8659 request: tonic::Request<super::GetRegionPolicyRequest>,
8660 ) -> std::result::Result<
8661 tonic::Response<super::GetRegionPolicyResponse>,
8662 tonic::Status,
8663 >;
8664 async fn set_region_policy(
8667 &self,
8668 request: tonic::Request<super::SetRegionPolicyRequest>,
8669 ) -> std::result::Result<
8670 tonic::Response<super::SetRegionPolicyResponse>,
8671 tonic::Status,
8672 >;
8673 async fn get_cost_cap_policy(
8677 &self,
8678 request: tonic::Request<super::GetCostCapPolicyRequest>,
8679 ) -> std::result::Result<
8680 tonic::Response<super::GetCostCapPolicyResponse>,
8681 tonic::Status,
8682 >;
8683 async fn set_cost_cap_policy(
8686 &self,
8687 request: tonic::Request<super::SetCostCapPolicyRequest>,
8688 ) -> std::result::Result<
8689 tonic::Response<super::SetCostCapPolicyResponse>,
8690 tonic::Status,
8691 >;
8692 async fn get_org_webhook_config(
8697 &self,
8698 request: tonic::Request<super::GetOrgWebhookConfigRequest>,
8699 ) -> std::result::Result<
8700 tonic::Response<super::GetOrgWebhookConfigResponse>,
8701 tonic::Status,
8702 >;
8703 async fn set_org_webhook_config(
8708 &self,
8709 request: tonic::Request<super::SetOrgWebhookConfigRequest>,
8710 ) -> std::result::Result<
8711 tonic::Response<super::SetOrgWebhookConfigResponse>,
8712 tonic::Status,
8713 >;
8714 async fn create_channel_connect_link(
8721 &self,
8722 request: tonic::Request<super::CreateChannelConnectLinkRequest>,
8723 ) -> std::result::Result<
8724 tonic::Response<super::CreateChannelConnectLinkResponse>,
8725 tonic::Status,
8726 >;
8727 async fn create_slack_workspace_install_authorization(
8735 &self,
8736 request: tonic::Request<
8737 super::CreateSlackWorkspaceInstallAuthorizationRequest,
8738 >,
8739 ) -> std::result::Result<
8740 tonic::Response<super::CreateSlackWorkspaceInstallAuthorizationResponse>,
8741 tonic::Status,
8742 >;
8743 }
8744 #[derive(Debug)]
8759 pub struct IntegrationsServiceServer<T> {
8760 inner: Arc<T>,
8761 accept_compression_encodings: EnabledCompressionEncodings,
8762 send_compression_encodings: EnabledCompressionEncodings,
8763 max_decoding_message_size: Option<usize>,
8764 max_encoding_message_size: Option<usize>,
8765 }
8766 impl<T> IntegrationsServiceServer<T> {
8767 pub fn new(inner: T) -> Self {
8768 Self::from_arc(Arc::new(inner))
8769 }
8770 pub fn from_arc(inner: Arc<T>) -> Self {
8771 Self {
8772 inner,
8773 accept_compression_encodings: Default::default(),
8774 send_compression_encodings: Default::default(),
8775 max_decoding_message_size: None,
8776 max_encoding_message_size: None,
8777 }
8778 }
8779 pub fn with_interceptor<F>(
8780 inner: T,
8781 interceptor: F,
8782 ) -> InterceptedService<Self, F>
8783 where
8784 F: tonic::service::Interceptor,
8785 {
8786 InterceptedService::new(Self::new(inner), interceptor)
8787 }
8788 #[must_use]
8790 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8791 self.accept_compression_encodings.enable(encoding);
8792 self
8793 }
8794 #[must_use]
8796 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8797 self.send_compression_encodings.enable(encoding);
8798 self
8799 }
8800 #[must_use]
8804 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8805 self.max_decoding_message_size = Some(limit);
8806 self
8807 }
8808 #[must_use]
8812 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8813 self.max_encoding_message_size = Some(limit);
8814 self
8815 }
8816 }
8817 impl<T, B> tonic::codegen::Service<http::Request<B>> for IntegrationsServiceServer<T>
8818 where
8819 T: IntegrationsService,
8820 B: Body + std::marker::Send + 'static,
8821 B::Error: Into<StdError> + std::marker::Send + 'static,
8822 {
8823 type Response = http::Response<tonic::body::Body>;
8824 type Error = std::convert::Infallible;
8825 type Future = BoxFuture<Self::Response, Self::Error>;
8826 fn poll_ready(
8827 &mut self,
8828 _cx: &mut Context<'_>,
8829 ) -> Poll<std::result::Result<(), Self::Error>> {
8830 Poll::Ready(Ok(()))
8831 }
8832 fn call(&mut self, req: http::Request<B>) -> Self::Future {
8833 match req.uri().path() {
8834 "/pidgr.v1.IntegrationsService/DispatchToChannel" => {
8835 #[allow(non_camel_case_types)]
8836 struct DispatchToChannelSvc<T: IntegrationsService>(pub Arc<T>);
8837 impl<
8838 T: IntegrationsService,
8839 > tonic::server::UnaryService<super::DispatchToChannelRequest>
8840 for DispatchToChannelSvc<T> {
8841 type Response = super::DispatchToChannelResponse;
8842 type Future = BoxFuture<
8843 tonic::Response<Self::Response>,
8844 tonic::Status,
8845 >;
8846 fn call(
8847 &mut self,
8848 request: tonic::Request<super::DispatchToChannelRequest>,
8849 ) -> Self::Future {
8850 let inner = Arc::clone(&self.0);
8851 let fut = async move {
8852 <T as IntegrationsService>::dispatch_to_channel(
8853 &inner,
8854 request,
8855 )
8856 .await
8857 };
8858 Box::pin(fut)
8859 }
8860 }
8861 let accept_compression_encodings = self.accept_compression_encodings;
8862 let send_compression_encodings = self.send_compression_encodings;
8863 let max_decoding_message_size = self.max_decoding_message_size;
8864 let max_encoding_message_size = self.max_encoding_message_size;
8865 let inner = self.inner.clone();
8866 let fut = async move {
8867 let method = DispatchToChannelSvc(inner);
8868 let codec = tonic_prost::ProstCodec::default();
8869 let mut grpc = tonic::server::Grpc::new(codec)
8870 .apply_compression_config(
8871 accept_compression_encodings,
8872 send_compression_encodings,
8873 )
8874 .apply_max_message_size_config(
8875 max_decoding_message_size,
8876 max_encoding_message_size,
8877 );
8878 let res = grpc.unary(method, req).await;
8879 Ok(res)
8880 };
8881 Box::pin(fut)
8882 }
8883 "/pidgr.v1.IntegrationsService/UpsertReachability" => {
8884 #[allow(non_camel_case_types)]
8885 struct UpsertReachabilitySvc<T: IntegrationsService>(pub Arc<T>);
8886 impl<
8887 T: IntegrationsService,
8888 > tonic::server::UnaryService<super::UpsertReachabilityRequest>
8889 for UpsertReachabilitySvc<T> {
8890 type Response = super::UpsertReachabilityResponse;
8891 type Future = BoxFuture<
8892 tonic::Response<Self::Response>,
8893 tonic::Status,
8894 >;
8895 fn call(
8896 &mut self,
8897 request: tonic::Request<super::UpsertReachabilityRequest>,
8898 ) -> Self::Future {
8899 let inner = Arc::clone(&self.0);
8900 let fut = async move {
8901 <T as IntegrationsService>::upsert_reachability(
8902 &inner,
8903 request,
8904 )
8905 .await
8906 };
8907 Box::pin(fut)
8908 }
8909 }
8910 let accept_compression_encodings = self.accept_compression_encodings;
8911 let send_compression_encodings = self.send_compression_encodings;
8912 let max_decoding_message_size = self.max_decoding_message_size;
8913 let max_encoding_message_size = self.max_encoding_message_size;
8914 let inner = self.inner.clone();
8915 let fut = async move {
8916 let method = UpsertReachabilitySvc(inner);
8917 let codec = tonic_prost::ProstCodec::default();
8918 let mut grpc = tonic::server::Grpc::new(codec)
8919 .apply_compression_config(
8920 accept_compression_encodings,
8921 send_compression_encodings,
8922 )
8923 .apply_max_message_size_config(
8924 max_decoding_message_size,
8925 max_encoding_message_size,
8926 );
8927 let res = grpc.unary(method, req).await;
8928 Ok(res)
8929 };
8930 Box::pin(fut)
8931 }
8932 "/pidgr.v1.IntegrationsService/RemoveReachability" => {
8933 #[allow(non_camel_case_types)]
8934 struct RemoveReachabilitySvc<T: IntegrationsService>(pub Arc<T>);
8935 impl<
8936 T: IntegrationsService,
8937 > tonic::server::UnaryService<super::RemoveReachabilityRequest>
8938 for RemoveReachabilitySvc<T> {
8939 type Response = super::RemoveReachabilityResponse;
8940 type Future = BoxFuture<
8941 tonic::Response<Self::Response>,
8942 tonic::Status,
8943 >;
8944 fn call(
8945 &mut self,
8946 request: tonic::Request<super::RemoveReachabilityRequest>,
8947 ) -> Self::Future {
8948 let inner = Arc::clone(&self.0);
8949 let fut = async move {
8950 <T as IntegrationsService>::remove_reachability(
8951 &inner,
8952 request,
8953 )
8954 .await
8955 };
8956 Box::pin(fut)
8957 }
8958 }
8959 let accept_compression_encodings = self.accept_compression_encodings;
8960 let send_compression_encodings = self.send_compression_encodings;
8961 let max_decoding_message_size = self.max_decoding_message_size;
8962 let max_encoding_message_size = self.max_encoding_message_size;
8963 let inner = self.inner.clone();
8964 let fut = async move {
8965 let method = RemoveReachabilitySvc(inner);
8966 let codec = tonic_prost::ProstCodec::default();
8967 let mut grpc = tonic::server::Grpc::new(codec)
8968 .apply_compression_config(
8969 accept_compression_encodings,
8970 send_compression_encodings,
8971 )
8972 .apply_max_message_size_config(
8973 max_decoding_message_size,
8974 max_encoding_message_size,
8975 );
8976 let res = grpc.unary(method, req).await;
8977 Ok(res)
8978 };
8979 Box::pin(fut)
8980 }
8981 "/pidgr.v1.IntegrationsService/GetReachability" => {
8982 #[allow(non_camel_case_types)]
8983 struct GetReachabilitySvc<T: IntegrationsService>(pub Arc<T>);
8984 impl<
8985 T: IntegrationsService,
8986 > tonic::server::UnaryService<super::GetReachabilityRequest>
8987 for GetReachabilitySvc<T> {
8988 type Response = super::GetReachabilityResponse;
8989 type Future = BoxFuture<
8990 tonic::Response<Self::Response>,
8991 tonic::Status,
8992 >;
8993 fn call(
8994 &mut self,
8995 request: tonic::Request<super::GetReachabilityRequest>,
8996 ) -> Self::Future {
8997 let inner = Arc::clone(&self.0);
8998 let fut = async move {
8999 <T as IntegrationsService>::get_reachability(
9000 &inner,
9001 request,
9002 )
9003 .await
9004 };
9005 Box::pin(fut)
9006 }
9007 }
9008 let accept_compression_encodings = self.accept_compression_encodings;
9009 let send_compression_encodings = self.send_compression_encodings;
9010 let max_decoding_message_size = self.max_decoding_message_size;
9011 let max_encoding_message_size = self.max_encoding_message_size;
9012 let inner = self.inner.clone();
9013 let fut = async move {
9014 let method = GetReachabilitySvc(inner);
9015 let codec = tonic_prost::ProstCodec::default();
9016 let mut grpc = tonic::server::Grpc::new(codec)
9017 .apply_compression_config(
9018 accept_compression_encodings,
9019 send_compression_encodings,
9020 )
9021 .apply_max_message_size_config(
9022 max_decoding_message_size,
9023 max_encoding_message_size,
9024 );
9025 let res = grpc.unary(method, req).await;
9026 Ok(res)
9027 };
9028 Box::pin(fut)
9029 }
9030 "/pidgr.v1.IntegrationsService/ListReachabilityForUser" => {
9031 #[allow(non_camel_case_types)]
9032 struct ListReachabilityForUserSvc<T: IntegrationsService>(
9033 pub Arc<T>,
9034 );
9035 impl<
9036 T: IntegrationsService,
9037 > tonic::server::UnaryService<super::ListReachabilityForUserRequest>
9038 for ListReachabilityForUserSvc<T> {
9039 type Response = super::ListReachabilityForUserResponse;
9040 type Future = BoxFuture<
9041 tonic::Response<Self::Response>,
9042 tonic::Status,
9043 >;
9044 fn call(
9045 &mut self,
9046 request: tonic::Request<
9047 super::ListReachabilityForUserRequest,
9048 >,
9049 ) -> Self::Future {
9050 let inner = Arc::clone(&self.0);
9051 let fut = async move {
9052 <T as IntegrationsService>::list_reachability_for_user(
9053 &inner,
9054 request,
9055 )
9056 .await
9057 };
9058 Box::pin(fut)
9059 }
9060 }
9061 let accept_compression_encodings = self.accept_compression_encodings;
9062 let send_compression_encodings = self.send_compression_encodings;
9063 let max_decoding_message_size = self.max_decoding_message_size;
9064 let max_encoding_message_size = self.max_encoding_message_size;
9065 let inner = self.inner.clone();
9066 let fut = async move {
9067 let method = ListReachabilityForUserSvc(inner);
9068 let codec = tonic_prost::ProstCodec::default();
9069 let mut grpc = tonic::server::Grpc::new(codec)
9070 .apply_compression_config(
9071 accept_compression_encodings,
9072 send_compression_encodings,
9073 )
9074 .apply_max_message_size_config(
9075 max_decoding_message_size,
9076 max_encoding_message_size,
9077 );
9078 let res = grpc.unary(method, req).await;
9079 Ok(res)
9080 };
9081 Box::pin(fut)
9082 }
9083 "/pidgr.v1.IntegrationsService/GetRegionPolicy" => {
9084 #[allow(non_camel_case_types)]
9085 struct GetRegionPolicySvc<T: IntegrationsService>(pub Arc<T>);
9086 impl<
9087 T: IntegrationsService,
9088 > tonic::server::UnaryService<super::GetRegionPolicyRequest>
9089 for GetRegionPolicySvc<T> {
9090 type Response = super::GetRegionPolicyResponse;
9091 type Future = BoxFuture<
9092 tonic::Response<Self::Response>,
9093 tonic::Status,
9094 >;
9095 fn call(
9096 &mut self,
9097 request: tonic::Request<super::GetRegionPolicyRequest>,
9098 ) -> Self::Future {
9099 let inner = Arc::clone(&self.0);
9100 let fut = async move {
9101 <T as IntegrationsService>::get_region_policy(
9102 &inner,
9103 request,
9104 )
9105 .await
9106 };
9107 Box::pin(fut)
9108 }
9109 }
9110 let accept_compression_encodings = self.accept_compression_encodings;
9111 let send_compression_encodings = self.send_compression_encodings;
9112 let max_decoding_message_size = self.max_decoding_message_size;
9113 let max_encoding_message_size = self.max_encoding_message_size;
9114 let inner = self.inner.clone();
9115 let fut = async move {
9116 let method = GetRegionPolicySvc(inner);
9117 let codec = tonic_prost::ProstCodec::default();
9118 let mut grpc = tonic::server::Grpc::new(codec)
9119 .apply_compression_config(
9120 accept_compression_encodings,
9121 send_compression_encodings,
9122 )
9123 .apply_max_message_size_config(
9124 max_decoding_message_size,
9125 max_encoding_message_size,
9126 );
9127 let res = grpc.unary(method, req).await;
9128 Ok(res)
9129 };
9130 Box::pin(fut)
9131 }
9132 "/pidgr.v1.IntegrationsService/SetRegionPolicy" => {
9133 #[allow(non_camel_case_types)]
9134 struct SetRegionPolicySvc<T: IntegrationsService>(pub Arc<T>);
9135 impl<
9136 T: IntegrationsService,
9137 > tonic::server::UnaryService<super::SetRegionPolicyRequest>
9138 for SetRegionPolicySvc<T> {
9139 type Response = super::SetRegionPolicyResponse;
9140 type Future = BoxFuture<
9141 tonic::Response<Self::Response>,
9142 tonic::Status,
9143 >;
9144 fn call(
9145 &mut self,
9146 request: tonic::Request<super::SetRegionPolicyRequest>,
9147 ) -> Self::Future {
9148 let inner = Arc::clone(&self.0);
9149 let fut = async move {
9150 <T as IntegrationsService>::set_region_policy(
9151 &inner,
9152 request,
9153 )
9154 .await
9155 };
9156 Box::pin(fut)
9157 }
9158 }
9159 let accept_compression_encodings = self.accept_compression_encodings;
9160 let send_compression_encodings = self.send_compression_encodings;
9161 let max_decoding_message_size = self.max_decoding_message_size;
9162 let max_encoding_message_size = self.max_encoding_message_size;
9163 let inner = self.inner.clone();
9164 let fut = async move {
9165 let method = SetRegionPolicySvc(inner);
9166 let codec = tonic_prost::ProstCodec::default();
9167 let mut grpc = tonic::server::Grpc::new(codec)
9168 .apply_compression_config(
9169 accept_compression_encodings,
9170 send_compression_encodings,
9171 )
9172 .apply_max_message_size_config(
9173 max_decoding_message_size,
9174 max_encoding_message_size,
9175 );
9176 let res = grpc.unary(method, req).await;
9177 Ok(res)
9178 };
9179 Box::pin(fut)
9180 }
9181 "/pidgr.v1.IntegrationsService/GetCostCapPolicy" => {
9182 #[allow(non_camel_case_types)]
9183 struct GetCostCapPolicySvc<T: IntegrationsService>(pub Arc<T>);
9184 impl<
9185 T: IntegrationsService,
9186 > tonic::server::UnaryService<super::GetCostCapPolicyRequest>
9187 for GetCostCapPolicySvc<T> {
9188 type Response = super::GetCostCapPolicyResponse;
9189 type Future = BoxFuture<
9190 tonic::Response<Self::Response>,
9191 tonic::Status,
9192 >;
9193 fn call(
9194 &mut self,
9195 request: tonic::Request<super::GetCostCapPolicyRequest>,
9196 ) -> Self::Future {
9197 let inner = Arc::clone(&self.0);
9198 let fut = async move {
9199 <T as IntegrationsService>::get_cost_cap_policy(
9200 &inner,
9201 request,
9202 )
9203 .await
9204 };
9205 Box::pin(fut)
9206 }
9207 }
9208 let accept_compression_encodings = self.accept_compression_encodings;
9209 let send_compression_encodings = self.send_compression_encodings;
9210 let max_decoding_message_size = self.max_decoding_message_size;
9211 let max_encoding_message_size = self.max_encoding_message_size;
9212 let inner = self.inner.clone();
9213 let fut = async move {
9214 let method = GetCostCapPolicySvc(inner);
9215 let codec = tonic_prost::ProstCodec::default();
9216 let mut grpc = tonic::server::Grpc::new(codec)
9217 .apply_compression_config(
9218 accept_compression_encodings,
9219 send_compression_encodings,
9220 )
9221 .apply_max_message_size_config(
9222 max_decoding_message_size,
9223 max_encoding_message_size,
9224 );
9225 let res = grpc.unary(method, req).await;
9226 Ok(res)
9227 };
9228 Box::pin(fut)
9229 }
9230 "/pidgr.v1.IntegrationsService/SetCostCapPolicy" => {
9231 #[allow(non_camel_case_types)]
9232 struct SetCostCapPolicySvc<T: IntegrationsService>(pub Arc<T>);
9233 impl<
9234 T: IntegrationsService,
9235 > tonic::server::UnaryService<super::SetCostCapPolicyRequest>
9236 for SetCostCapPolicySvc<T> {
9237 type Response = super::SetCostCapPolicyResponse;
9238 type Future = BoxFuture<
9239 tonic::Response<Self::Response>,
9240 tonic::Status,
9241 >;
9242 fn call(
9243 &mut self,
9244 request: tonic::Request<super::SetCostCapPolicyRequest>,
9245 ) -> Self::Future {
9246 let inner = Arc::clone(&self.0);
9247 let fut = async move {
9248 <T as IntegrationsService>::set_cost_cap_policy(
9249 &inner,
9250 request,
9251 )
9252 .await
9253 };
9254 Box::pin(fut)
9255 }
9256 }
9257 let accept_compression_encodings = self.accept_compression_encodings;
9258 let send_compression_encodings = self.send_compression_encodings;
9259 let max_decoding_message_size = self.max_decoding_message_size;
9260 let max_encoding_message_size = self.max_encoding_message_size;
9261 let inner = self.inner.clone();
9262 let fut = async move {
9263 let method = SetCostCapPolicySvc(inner);
9264 let codec = tonic_prost::ProstCodec::default();
9265 let mut grpc = tonic::server::Grpc::new(codec)
9266 .apply_compression_config(
9267 accept_compression_encodings,
9268 send_compression_encodings,
9269 )
9270 .apply_max_message_size_config(
9271 max_decoding_message_size,
9272 max_encoding_message_size,
9273 );
9274 let res = grpc.unary(method, req).await;
9275 Ok(res)
9276 };
9277 Box::pin(fut)
9278 }
9279 "/pidgr.v1.IntegrationsService/GetOrgWebhookConfig" => {
9280 #[allow(non_camel_case_types)]
9281 struct GetOrgWebhookConfigSvc<T: IntegrationsService>(pub Arc<T>);
9282 impl<
9283 T: IntegrationsService,
9284 > tonic::server::UnaryService<super::GetOrgWebhookConfigRequest>
9285 for GetOrgWebhookConfigSvc<T> {
9286 type Response = super::GetOrgWebhookConfigResponse;
9287 type Future = BoxFuture<
9288 tonic::Response<Self::Response>,
9289 tonic::Status,
9290 >;
9291 fn call(
9292 &mut self,
9293 request: tonic::Request<super::GetOrgWebhookConfigRequest>,
9294 ) -> Self::Future {
9295 let inner = Arc::clone(&self.0);
9296 let fut = async move {
9297 <T as IntegrationsService>::get_org_webhook_config(
9298 &inner,
9299 request,
9300 )
9301 .await
9302 };
9303 Box::pin(fut)
9304 }
9305 }
9306 let accept_compression_encodings = self.accept_compression_encodings;
9307 let send_compression_encodings = self.send_compression_encodings;
9308 let max_decoding_message_size = self.max_decoding_message_size;
9309 let max_encoding_message_size = self.max_encoding_message_size;
9310 let inner = self.inner.clone();
9311 let fut = async move {
9312 let method = GetOrgWebhookConfigSvc(inner);
9313 let codec = tonic_prost::ProstCodec::default();
9314 let mut grpc = tonic::server::Grpc::new(codec)
9315 .apply_compression_config(
9316 accept_compression_encodings,
9317 send_compression_encodings,
9318 )
9319 .apply_max_message_size_config(
9320 max_decoding_message_size,
9321 max_encoding_message_size,
9322 );
9323 let res = grpc.unary(method, req).await;
9324 Ok(res)
9325 };
9326 Box::pin(fut)
9327 }
9328 "/pidgr.v1.IntegrationsService/SetOrgWebhookConfig" => {
9329 #[allow(non_camel_case_types)]
9330 struct SetOrgWebhookConfigSvc<T: IntegrationsService>(pub Arc<T>);
9331 impl<
9332 T: IntegrationsService,
9333 > tonic::server::UnaryService<super::SetOrgWebhookConfigRequest>
9334 for SetOrgWebhookConfigSvc<T> {
9335 type Response = super::SetOrgWebhookConfigResponse;
9336 type Future = BoxFuture<
9337 tonic::Response<Self::Response>,
9338 tonic::Status,
9339 >;
9340 fn call(
9341 &mut self,
9342 request: tonic::Request<super::SetOrgWebhookConfigRequest>,
9343 ) -> Self::Future {
9344 let inner = Arc::clone(&self.0);
9345 let fut = async move {
9346 <T as IntegrationsService>::set_org_webhook_config(
9347 &inner,
9348 request,
9349 )
9350 .await
9351 };
9352 Box::pin(fut)
9353 }
9354 }
9355 let accept_compression_encodings = self.accept_compression_encodings;
9356 let send_compression_encodings = self.send_compression_encodings;
9357 let max_decoding_message_size = self.max_decoding_message_size;
9358 let max_encoding_message_size = self.max_encoding_message_size;
9359 let inner = self.inner.clone();
9360 let fut = async move {
9361 let method = SetOrgWebhookConfigSvc(inner);
9362 let codec = tonic_prost::ProstCodec::default();
9363 let mut grpc = tonic::server::Grpc::new(codec)
9364 .apply_compression_config(
9365 accept_compression_encodings,
9366 send_compression_encodings,
9367 )
9368 .apply_max_message_size_config(
9369 max_decoding_message_size,
9370 max_encoding_message_size,
9371 );
9372 let res = grpc.unary(method, req).await;
9373 Ok(res)
9374 };
9375 Box::pin(fut)
9376 }
9377 "/pidgr.v1.IntegrationsService/CreateChannelConnectLink" => {
9378 #[allow(non_camel_case_types)]
9379 struct CreateChannelConnectLinkSvc<T: IntegrationsService>(
9380 pub Arc<T>,
9381 );
9382 impl<
9383 T: IntegrationsService,
9384 > tonic::server::UnaryService<super::CreateChannelConnectLinkRequest>
9385 for CreateChannelConnectLinkSvc<T> {
9386 type Response = super::CreateChannelConnectLinkResponse;
9387 type Future = BoxFuture<
9388 tonic::Response<Self::Response>,
9389 tonic::Status,
9390 >;
9391 fn call(
9392 &mut self,
9393 request: tonic::Request<
9394 super::CreateChannelConnectLinkRequest,
9395 >,
9396 ) -> Self::Future {
9397 let inner = Arc::clone(&self.0);
9398 let fut = async move {
9399 <T as IntegrationsService>::create_channel_connect_link(
9400 &inner,
9401 request,
9402 )
9403 .await
9404 };
9405 Box::pin(fut)
9406 }
9407 }
9408 let accept_compression_encodings = self.accept_compression_encodings;
9409 let send_compression_encodings = self.send_compression_encodings;
9410 let max_decoding_message_size = self.max_decoding_message_size;
9411 let max_encoding_message_size = self.max_encoding_message_size;
9412 let inner = self.inner.clone();
9413 let fut = async move {
9414 let method = CreateChannelConnectLinkSvc(inner);
9415 let codec = tonic_prost::ProstCodec::default();
9416 let mut grpc = tonic::server::Grpc::new(codec)
9417 .apply_compression_config(
9418 accept_compression_encodings,
9419 send_compression_encodings,
9420 )
9421 .apply_max_message_size_config(
9422 max_decoding_message_size,
9423 max_encoding_message_size,
9424 );
9425 let res = grpc.unary(method, req).await;
9426 Ok(res)
9427 };
9428 Box::pin(fut)
9429 }
9430 "/pidgr.v1.IntegrationsService/CreateSlackWorkspaceInstallAuthorization" => {
9431 #[allow(non_camel_case_types)]
9432 struct CreateSlackWorkspaceInstallAuthorizationSvc<
9433 T: IntegrationsService,
9434 >(
9435 pub Arc<T>,
9436 );
9437 impl<
9438 T: IntegrationsService,
9439 > tonic::server::UnaryService<
9440 super::CreateSlackWorkspaceInstallAuthorizationRequest,
9441 > for CreateSlackWorkspaceInstallAuthorizationSvc<T> {
9442 type Response = super::CreateSlackWorkspaceInstallAuthorizationResponse;
9443 type Future = BoxFuture<
9444 tonic::Response<Self::Response>,
9445 tonic::Status,
9446 >;
9447 fn call(
9448 &mut self,
9449 request: tonic::Request<
9450 super::CreateSlackWorkspaceInstallAuthorizationRequest,
9451 >,
9452 ) -> Self::Future {
9453 let inner = Arc::clone(&self.0);
9454 let fut = async move {
9455 <T as IntegrationsService>::create_slack_workspace_install_authorization(
9456 &inner,
9457 request,
9458 )
9459 .await
9460 };
9461 Box::pin(fut)
9462 }
9463 }
9464 let accept_compression_encodings = self.accept_compression_encodings;
9465 let send_compression_encodings = self.send_compression_encodings;
9466 let max_decoding_message_size = self.max_decoding_message_size;
9467 let max_encoding_message_size = self.max_encoding_message_size;
9468 let inner = self.inner.clone();
9469 let fut = async move {
9470 let method = CreateSlackWorkspaceInstallAuthorizationSvc(inner);
9471 let codec = tonic_prost::ProstCodec::default();
9472 let mut grpc = tonic::server::Grpc::new(codec)
9473 .apply_compression_config(
9474 accept_compression_encodings,
9475 send_compression_encodings,
9476 )
9477 .apply_max_message_size_config(
9478 max_decoding_message_size,
9479 max_encoding_message_size,
9480 );
9481 let res = grpc.unary(method, req).await;
9482 Ok(res)
9483 };
9484 Box::pin(fut)
9485 }
9486 _ => {
9487 Box::pin(async move {
9488 let mut response = http::Response::new(
9489 tonic::body::Body::default(),
9490 );
9491 let headers = response.headers_mut();
9492 headers
9493 .insert(
9494 tonic::Status::GRPC_STATUS,
9495 (tonic::Code::Unimplemented as i32).into(),
9496 );
9497 headers
9498 .insert(
9499 http::header::CONTENT_TYPE,
9500 tonic::metadata::GRPC_CONTENT_TYPE,
9501 );
9502 Ok(response)
9503 })
9504 }
9505 }
9506 }
9507 }
9508 impl<T> Clone for IntegrationsServiceServer<T> {
9509 fn clone(&self) -> Self {
9510 let inner = self.inner.clone();
9511 Self {
9512 inner,
9513 accept_compression_encodings: self.accept_compression_encodings,
9514 send_compression_encodings: self.send_compression_encodings,
9515 max_decoding_message_size: self.max_decoding_message_size,
9516 max_encoding_message_size: self.max_encoding_message_size,
9517 }
9518 }
9519 }
9520 pub const SERVICE_NAME: &str = "pidgr.v1.IntegrationsService";
9522 impl<T> tonic::server::NamedService for IntegrationsServiceServer<T> {
9523 const NAME: &'static str = SERVICE_NAME;
9524 }
9525}
9526pub mod invite_link_service_client {
9528 #![allow(
9529 unused_variables,
9530 dead_code,
9531 missing_docs,
9532 clippy::wildcard_imports,
9533 clippy::let_unit_value,
9534 )]
9535 use tonic::codegen::*;
9536 use tonic::codegen::http::Uri;
9537 #[derive(Debug, Clone)]
9543 pub struct InviteLinkServiceClient<T> {
9544 inner: tonic::client::Grpc<T>,
9545 }
9546 impl InviteLinkServiceClient<tonic::transport::Channel> {
9547 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
9549 where
9550 D: TryInto<tonic::transport::Endpoint>,
9551 D::Error: Into<StdError>,
9552 {
9553 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
9554 Ok(Self::new(conn))
9555 }
9556 }
9557 impl<T> InviteLinkServiceClient<T>
9558 where
9559 T: tonic::client::GrpcService<tonic::body::Body>,
9560 T::Error: Into<StdError>,
9561 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
9562 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
9563 {
9564 pub fn new(inner: T) -> Self {
9565 let inner = tonic::client::Grpc::new(inner);
9566 Self { inner }
9567 }
9568 pub fn with_origin(inner: T, origin: Uri) -> Self {
9569 let inner = tonic::client::Grpc::with_origin(inner, origin);
9570 Self { inner }
9571 }
9572 pub fn with_interceptor<F>(
9573 inner: T,
9574 interceptor: F,
9575 ) -> InviteLinkServiceClient<InterceptedService<T, F>>
9576 where
9577 F: tonic::service::Interceptor,
9578 T::ResponseBody: Default,
9579 T: tonic::codegen::Service<
9580 http::Request<tonic::body::Body>,
9581 Response = http::Response<
9582 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
9583 >,
9584 >,
9585 <T as tonic::codegen::Service<
9586 http::Request<tonic::body::Body>,
9587 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
9588 {
9589 InviteLinkServiceClient::new(InterceptedService::new(inner, interceptor))
9590 }
9591 #[must_use]
9596 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9597 self.inner = self.inner.send_compressed(encoding);
9598 self
9599 }
9600 #[must_use]
9602 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9603 self.inner = self.inner.accept_compressed(encoding);
9604 self
9605 }
9606 #[must_use]
9610 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9611 self.inner = self.inner.max_decoding_message_size(limit);
9612 self
9613 }
9614 #[must_use]
9618 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9619 self.inner = self.inner.max_encoding_message_size(limit);
9620 self
9621 }
9622 pub async fn create_invite_link(
9626 &mut self,
9627 request: impl tonic::IntoRequest<super::CreateInviteLinkRequest>,
9628 ) -> std::result::Result<
9629 tonic::Response<super::CreateInviteLinkResponse>,
9630 tonic::Status,
9631 > {
9632 self.inner
9633 .ready()
9634 .await
9635 .map_err(|e| {
9636 tonic::Status::unknown(
9637 format!("Service was not ready: {}", e.into()),
9638 )
9639 })?;
9640 let codec = tonic_prost::ProstCodec::default();
9641 let path = http::uri::PathAndQuery::from_static(
9642 "/pidgr.v1.InviteLinkService/CreateInviteLink",
9643 );
9644 let mut req = request.into_request();
9645 req.extensions_mut()
9646 .insert(
9647 GrpcMethod::new("pidgr.v1.InviteLinkService", "CreateInviteLink"),
9648 );
9649 self.inner.unary(req, path, codec).await
9650 }
9651 pub async fn list_invite_links(
9655 &mut self,
9656 request: impl tonic::IntoRequest<super::ListInviteLinksRequest>,
9657 ) -> std::result::Result<
9658 tonic::Response<super::ListInviteLinksResponse>,
9659 tonic::Status,
9660 > {
9661 self.inner
9662 .ready()
9663 .await
9664 .map_err(|e| {
9665 tonic::Status::unknown(
9666 format!("Service was not ready: {}", e.into()),
9667 )
9668 })?;
9669 let codec = tonic_prost::ProstCodec::default();
9670 let path = http::uri::PathAndQuery::from_static(
9671 "/pidgr.v1.InviteLinkService/ListInviteLinks",
9672 );
9673 let mut req = request.into_request();
9674 req.extensions_mut()
9675 .insert(
9676 GrpcMethod::new("pidgr.v1.InviteLinkService", "ListInviteLinks"),
9677 );
9678 self.inner.unary(req, path, codec).await
9679 }
9680 pub async fn revoke_invite_link(
9684 &mut self,
9685 request: impl tonic::IntoRequest<super::RevokeInviteLinkRequest>,
9686 ) -> std::result::Result<
9687 tonic::Response<super::RevokeInviteLinkResponse>,
9688 tonic::Status,
9689 > {
9690 self.inner
9691 .ready()
9692 .await
9693 .map_err(|e| {
9694 tonic::Status::unknown(
9695 format!("Service was not ready: {}", e.into()),
9696 )
9697 })?;
9698 let codec = tonic_prost::ProstCodec::default();
9699 let path = http::uri::PathAndQuery::from_static(
9700 "/pidgr.v1.InviteLinkService/RevokeInviteLink",
9701 );
9702 let mut req = request.into_request();
9703 req.extensions_mut()
9704 .insert(
9705 GrpcMethod::new("pidgr.v1.InviteLinkService", "RevokeInviteLink"),
9706 );
9707 self.inner.unary(req, path, codec).await
9708 }
9709 pub async fn validate_invite_link(
9715 &mut self,
9716 request: impl tonic::IntoRequest<super::ValidateInviteLinkRequest>,
9717 ) -> std::result::Result<
9718 tonic::Response<super::ValidateInviteLinkResponse>,
9719 tonic::Status,
9720 > {
9721 self.inner
9722 .ready()
9723 .await
9724 .map_err(|e| {
9725 tonic::Status::unknown(
9726 format!("Service was not ready: {}", e.into()),
9727 )
9728 })?;
9729 let codec = tonic_prost::ProstCodec::default();
9730 let path = http::uri::PathAndQuery::from_static(
9731 "/pidgr.v1.InviteLinkService/ValidateInviteLink",
9732 );
9733 let mut req = request.into_request();
9734 req.extensions_mut()
9735 .insert(
9736 GrpcMethod::new("pidgr.v1.InviteLinkService", "ValidateInviteLink"),
9737 );
9738 self.inner.unary(req, path, codec).await
9739 }
9740 pub async fn redeem_invite_link(
9745 &mut self,
9746 request: impl tonic::IntoRequest<super::RedeemInviteLinkRequest>,
9747 ) -> std::result::Result<
9748 tonic::Response<super::RedeemInviteLinkResponse>,
9749 tonic::Status,
9750 > {
9751 self.inner
9752 .ready()
9753 .await
9754 .map_err(|e| {
9755 tonic::Status::unknown(
9756 format!("Service was not ready: {}", e.into()),
9757 )
9758 })?;
9759 let codec = tonic_prost::ProstCodec::default();
9760 let path = http::uri::PathAndQuery::from_static(
9761 "/pidgr.v1.InviteLinkService/RedeemInviteLink",
9762 );
9763 let mut req = request.into_request();
9764 req.extensions_mut()
9765 .insert(
9766 GrpcMethod::new("pidgr.v1.InviteLinkService", "RedeemInviteLink"),
9767 );
9768 self.inner.unary(req, path, codec).await
9769 }
9770 }
9771}
9772pub mod invite_link_service_server {
9774 #![allow(
9775 unused_variables,
9776 dead_code,
9777 missing_docs,
9778 clippy::wildcard_imports,
9779 clippy::let_unit_value,
9780 )]
9781 use tonic::codegen::*;
9782 #[async_trait]
9784 pub trait InviteLinkService: std::marker::Send + std::marker::Sync + 'static {
9785 async fn create_invite_link(
9789 &self,
9790 request: tonic::Request<super::CreateInviteLinkRequest>,
9791 ) -> std::result::Result<
9792 tonic::Response<super::CreateInviteLinkResponse>,
9793 tonic::Status,
9794 >;
9795 async fn list_invite_links(
9799 &self,
9800 request: tonic::Request<super::ListInviteLinksRequest>,
9801 ) -> std::result::Result<
9802 tonic::Response<super::ListInviteLinksResponse>,
9803 tonic::Status,
9804 >;
9805 async fn revoke_invite_link(
9809 &self,
9810 request: tonic::Request<super::RevokeInviteLinkRequest>,
9811 ) -> std::result::Result<
9812 tonic::Response<super::RevokeInviteLinkResponse>,
9813 tonic::Status,
9814 >;
9815 async fn validate_invite_link(
9821 &self,
9822 request: tonic::Request<super::ValidateInviteLinkRequest>,
9823 ) -> std::result::Result<
9824 tonic::Response<super::ValidateInviteLinkResponse>,
9825 tonic::Status,
9826 >;
9827 async fn redeem_invite_link(
9832 &self,
9833 request: tonic::Request<super::RedeemInviteLinkRequest>,
9834 ) -> std::result::Result<
9835 tonic::Response<super::RedeemInviteLinkResponse>,
9836 tonic::Status,
9837 >;
9838 }
9839 #[derive(Debug)]
9845 pub struct InviteLinkServiceServer<T> {
9846 inner: Arc<T>,
9847 accept_compression_encodings: EnabledCompressionEncodings,
9848 send_compression_encodings: EnabledCompressionEncodings,
9849 max_decoding_message_size: Option<usize>,
9850 max_encoding_message_size: Option<usize>,
9851 }
9852 impl<T> InviteLinkServiceServer<T> {
9853 pub fn new(inner: T) -> Self {
9854 Self::from_arc(Arc::new(inner))
9855 }
9856 pub fn from_arc(inner: Arc<T>) -> Self {
9857 Self {
9858 inner,
9859 accept_compression_encodings: Default::default(),
9860 send_compression_encodings: Default::default(),
9861 max_decoding_message_size: None,
9862 max_encoding_message_size: None,
9863 }
9864 }
9865 pub fn with_interceptor<F>(
9866 inner: T,
9867 interceptor: F,
9868 ) -> InterceptedService<Self, F>
9869 where
9870 F: tonic::service::Interceptor,
9871 {
9872 InterceptedService::new(Self::new(inner), interceptor)
9873 }
9874 #[must_use]
9876 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9877 self.accept_compression_encodings.enable(encoding);
9878 self
9879 }
9880 #[must_use]
9882 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9883 self.send_compression_encodings.enable(encoding);
9884 self
9885 }
9886 #[must_use]
9890 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9891 self.max_decoding_message_size = Some(limit);
9892 self
9893 }
9894 #[must_use]
9898 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9899 self.max_encoding_message_size = Some(limit);
9900 self
9901 }
9902 }
9903 impl<T, B> tonic::codegen::Service<http::Request<B>> for InviteLinkServiceServer<T>
9904 where
9905 T: InviteLinkService,
9906 B: Body + std::marker::Send + 'static,
9907 B::Error: Into<StdError> + std::marker::Send + 'static,
9908 {
9909 type Response = http::Response<tonic::body::Body>;
9910 type Error = std::convert::Infallible;
9911 type Future = BoxFuture<Self::Response, Self::Error>;
9912 fn poll_ready(
9913 &mut self,
9914 _cx: &mut Context<'_>,
9915 ) -> Poll<std::result::Result<(), Self::Error>> {
9916 Poll::Ready(Ok(()))
9917 }
9918 fn call(&mut self, req: http::Request<B>) -> Self::Future {
9919 match req.uri().path() {
9920 "/pidgr.v1.InviteLinkService/CreateInviteLink" => {
9921 #[allow(non_camel_case_types)]
9922 struct CreateInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
9923 impl<
9924 T: InviteLinkService,
9925 > tonic::server::UnaryService<super::CreateInviteLinkRequest>
9926 for CreateInviteLinkSvc<T> {
9927 type Response = super::CreateInviteLinkResponse;
9928 type Future = BoxFuture<
9929 tonic::Response<Self::Response>,
9930 tonic::Status,
9931 >;
9932 fn call(
9933 &mut self,
9934 request: tonic::Request<super::CreateInviteLinkRequest>,
9935 ) -> Self::Future {
9936 let inner = Arc::clone(&self.0);
9937 let fut = async move {
9938 <T as InviteLinkService>::create_invite_link(
9939 &inner,
9940 request,
9941 )
9942 .await
9943 };
9944 Box::pin(fut)
9945 }
9946 }
9947 let accept_compression_encodings = self.accept_compression_encodings;
9948 let send_compression_encodings = self.send_compression_encodings;
9949 let max_decoding_message_size = self.max_decoding_message_size;
9950 let max_encoding_message_size = self.max_encoding_message_size;
9951 let inner = self.inner.clone();
9952 let fut = async move {
9953 let method = CreateInviteLinkSvc(inner);
9954 let codec = tonic_prost::ProstCodec::default();
9955 let mut grpc = tonic::server::Grpc::new(codec)
9956 .apply_compression_config(
9957 accept_compression_encodings,
9958 send_compression_encodings,
9959 )
9960 .apply_max_message_size_config(
9961 max_decoding_message_size,
9962 max_encoding_message_size,
9963 );
9964 let res = grpc.unary(method, req).await;
9965 Ok(res)
9966 };
9967 Box::pin(fut)
9968 }
9969 "/pidgr.v1.InviteLinkService/ListInviteLinks" => {
9970 #[allow(non_camel_case_types)]
9971 struct ListInviteLinksSvc<T: InviteLinkService>(pub Arc<T>);
9972 impl<
9973 T: InviteLinkService,
9974 > tonic::server::UnaryService<super::ListInviteLinksRequest>
9975 for ListInviteLinksSvc<T> {
9976 type Response = super::ListInviteLinksResponse;
9977 type Future = BoxFuture<
9978 tonic::Response<Self::Response>,
9979 tonic::Status,
9980 >;
9981 fn call(
9982 &mut self,
9983 request: tonic::Request<super::ListInviteLinksRequest>,
9984 ) -> Self::Future {
9985 let inner = Arc::clone(&self.0);
9986 let fut = async move {
9987 <T as InviteLinkService>::list_invite_links(&inner, request)
9988 .await
9989 };
9990 Box::pin(fut)
9991 }
9992 }
9993 let accept_compression_encodings = self.accept_compression_encodings;
9994 let send_compression_encodings = self.send_compression_encodings;
9995 let max_decoding_message_size = self.max_decoding_message_size;
9996 let max_encoding_message_size = self.max_encoding_message_size;
9997 let inner = self.inner.clone();
9998 let fut = async move {
9999 let method = ListInviteLinksSvc(inner);
10000 let codec = tonic_prost::ProstCodec::default();
10001 let mut grpc = tonic::server::Grpc::new(codec)
10002 .apply_compression_config(
10003 accept_compression_encodings,
10004 send_compression_encodings,
10005 )
10006 .apply_max_message_size_config(
10007 max_decoding_message_size,
10008 max_encoding_message_size,
10009 );
10010 let res = grpc.unary(method, req).await;
10011 Ok(res)
10012 };
10013 Box::pin(fut)
10014 }
10015 "/pidgr.v1.InviteLinkService/RevokeInviteLink" => {
10016 #[allow(non_camel_case_types)]
10017 struct RevokeInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
10018 impl<
10019 T: InviteLinkService,
10020 > tonic::server::UnaryService<super::RevokeInviteLinkRequest>
10021 for RevokeInviteLinkSvc<T> {
10022 type Response = super::RevokeInviteLinkResponse;
10023 type Future = BoxFuture<
10024 tonic::Response<Self::Response>,
10025 tonic::Status,
10026 >;
10027 fn call(
10028 &mut self,
10029 request: tonic::Request<super::RevokeInviteLinkRequest>,
10030 ) -> Self::Future {
10031 let inner = Arc::clone(&self.0);
10032 let fut = async move {
10033 <T as InviteLinkService>::revoke_invite_link(
10034 &inner,
10035 request,
10036 )
10037 .await
10038 };
10039 Box::pin(fut)
10040 }
10041 }
10042 let accept_compression_encodings = self.accept_compression_encodings;
10043 let send_compression_encodings = self.send_compression_encodings;
10044 let max_decoding_message_size = self.max_decoding_message_size;
10045 let max_encoding_message_size = self.max_encoding_message_size;
10046 let inner = self.inner.clone();
10047 let fut = async move {
10048 let method = RevokeInviteLinkSvc(inner);
10049 let codec = tonic_prost::ProstCodec::default();
10050 let mut grpc = tonic::server::Grpc::new(codec)
10051 .apply_compression_config(
10052 accept_compression_encodings,
10053 send_compression_encodings,
10054 )
10055 .apply_max_message_size_config(
10056 max_decoding_message_size,
10057 max_encoding_message_size,
10058 );
10059 let res = grpc.unary(method, req).await;
10060 Ok(res)
10061 };
10062 Box::pin(fut)
10063 }
10064 "/pidgr.v1.InviteLinkService/ValidateInviteLink" => {
10065 #[allow(non_camel_case_types)]
10066 struct ValidateInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
10067 impl<
10068 T: InviteLinkService,
10069 > tonic::server::UnaryService<super::ValidateInviteLinkRequest>
10070 for ValidateInviteLinkSvc<T> {
10071 type Response = super::ValidateInviteLinkResponse;
10072 type Future = BoxFuture<
10073 tonic::Response<Self::Response>,
10074 tonic::Status,
10075 >;
10076 fn call(
10077 &mut self,
10078 request: tonic::Request<super::ValidateInviteLinkRequest>,
10079 ) -> Self::Future {
10080 let inner = Arc::clone(&self.0);
10081 let fut = async move {
10082 <T as InviteLinkService>::validate_invite_link(
10083 &inner,
10084 request,
10085 )
10086 .await
10087 };
10088 Box::pin(fut)
10089 }
10090 }
10091 let accept_compression_encodings = self.accept_compression_encodings;
10092 let send_compression_encodings = self.send_compression_encodings;
10093 let max_decoding_message_size = self.max_decoding_message_size;
10094 let max_encoding_message_size = self.max_encoding_message_size;
10095 let inner = self.inner.clone();
10096 let fut = async move {
10097 let method = ValidateInviteLinkSvc(inner);
10098 let codec = tonic_prost::ProstCodec::default();
10099 let mut grpc = tonic::server::Grpc::new(codec)
10100 .apply_compression_config(
10101 accept_compression_encodings,
10102 send_compression_encodings,
10103 )
10104 .apply_max_message_size_config(
10105 max_decoding_message_size,
10106 max_encoding_message_size,
10107 );
10108 let res = grpc.unary(method, req).await;
10109 Ok(res)
10110 };
10111 Box::pin(fut)
10112 }
10113 "/pidgr.v1.InviteLinkService/RedeemInviteLink" => {
10114 #[allow(non_camel_case_types)]
10115 struct RedeemInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
10116 impl<
10117 T: InviteLinkService,
10118 > tonic::server::UnaryService<super::RedeemInviteLinkRequest>
10119 for RedeemInviteLinkSvc<T> {
10120 type Response = super::RedeemInviteLinkResponse;
10121 type Future = BoxFuture<
10122 tonic::Response<Self::Response>,
10123 tonic::Status,
10124 >;
10125 fn call(
10126 &mut self,
10127 request: tonic::Request<super::RedeemInviteLinkRequest>,
10128 ) -> Self::Future {
10129 let inner = Arc::clone(&self.0);
10130 let fut = async move {
10131 <T as InviteLinkService>::redeem_invite_link(
10132 &inner,
10133 request,
10134 )
10135 .await
10136 };
10137 Box::pin(fut)
10138 }
10139 }
10140 let accept_compression_encodings = self.accept_compression_encodings;
10141 let send_compression_encodings = self.send_compression_encodings;
10142 let max_decoding_message_size = self.max_decoding_message_size;
10143 let max_encoding_message_size = self.max_encoding_message_size;
10144 let inner = self.inner.clone();
10145 let fut = async move {
10146 let method = RedeemInviteLinkSvc(inner);
10147 let codec = tonic_prost::ProstCodec::default();
10148 let mut grpc = tonic::server::Grpc::new(codec)
10149 .apply_compression_config(
10150 accept_compression_encodings,
10151 send_compression_encodings,
10152 )
10153 .apply_max_message_size_config(
10154 max_decoding_message_size,
10155 max_encoding_message_size,
10156 );
10157 let res = grpc.unary(method, req).await;
10158 Ok(res)
10159 };
10160 Box::pin(fut)
10161 }
10162 _ => {
10163 Box::pin(async move {
10164 let mut response = http::Response::new(
10165 tonic::body::Body::default(),
10166 );
10167 let headers = response.headers_mut();
10168 headers
10169 .insert(
10170 tonic::Status::GRPC_STATUS,
10171 (tonic::Code::Unimplemented as i32).into(),
10172 );
10173 headers
10174 .insert(
10175 http::header::CONTENT_TYPE,
10176 tonic::metadata::GRPC_CONTENT_TYPE,
10177 );
10178 Ok(response)
10179 })
10180 }
10181 }
10182 }
10183 }
10184 impl<T> Clone for InviteLinkServiceServer<T> {
10185 fn clone(&self) -> Self {
10186 let inner = self.inner.clone();
10187 Self {
10188 inner,
10189 accept_compression_encodings: self.accept_compression_encodings,
10190 send_compression_encodings: self.send_compression_encodings,
10191 max_decoding_message_size: self.max_decoding_message_size,
10192 max_encoding_message_size: self.max_encoding_message_size,
10193 }
10194 }
10195 }
10196 pub const SERVICE_NAME: &str = "pidgr.v1.InviteLinkService";
10198 impl<T> tonic::server::NamedService for InviteLinkServiceServer<T> {
10199 const NAME: &'static str = SERVICE_NAME;
10200 }
10201}
10202pub mod member_service_client {
10204 #![allow(
10205 unused_variables,
10206 dead_code,
10207 missing_docs,
10208 clippy::wildcard_imports,
10209 clippy::let_unit_value,
10210 )]
10211 use tonic::codegen::*;
10212 use tonic::codegen::http::Uri;
10213 #[derive(Debug, Clone)]
10217 pub struct MemberServiceClient<T> {
10218 inner: tonic::client::Grpc<T>,
10219 }
10220 impl MemberServiceClient<tonic::transport::Channel> {
10221 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
10223 where
10224 D: TryInto<tonic::transport::Endpoint>,
10225 D::Error: Into<StdError>,
10226 {
10227 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
10228 Ok(Self::new(conn))
10229 }
10230 }
10231 impl<T> MemberServiceClient<T>
10232 where
10233 T: tonic::client::GrpcService<tonic::body::Body>,
10234 T::Error: Into<StdError>,
10235 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
10236 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
10237 {
10238 pub fn new(inner: T) -> Self {
10239 let inner = tonic::client::Grpc::new(inner);
10240 Self { inner }
10241 }
10242 pub fn with_origin(inner: T, origin: Uri) -> Self {
10243 let inner = tonic::client::Grpc::with_origin(inner, origin);
10244 Self { inner }
10245 }
10246 pub fn with_interceptor<F>(
10247 inner: T,
10248 interceptor: F,
10249 ) -> MemberServiceClient<InterceptedService<T, F>>
10250 where
10251 F: tonic::service::Interceptor,
10252 T::ResponseBody: Default,
10253 T: tonic::codegen::Service<
10254 http::Request<tonic::body::Body>,
10255 Response = http::Response<
10256 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
10257 >,
10258 >,
10259 <T as tonic::codegen::Service<
10260 http::Request<tonic::body::Body>,
10261 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
10262 {
10263 MemberServiceClient::new(InterceptedService::new(inner, interceptor))
10264 }
10265 #[must_use]
10270 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10271 self.inner = self.inner.send_compressed(encoding);
10272 self
10273 }
10274 #[must_use]
10276 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10277 self.inner = self.inner.accept_compressed(encoding);
10278 self
10279 }
10280 #[must_use]
10284 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10285 self.inner = self.inner.max_decoding_message_size(limit);
10286 self
10287 }
10288 #[must_use]
10292 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10293 self.inner = self.inner.max_encoding_message_size(limit);
10294 self
10295 }
10296 pub async fn invite_user(
10300 &mut self,
10301 request: impl tonic::IntoRequest<super::InviteUserRequest>,
10302 ) -> std::result::Result<
10303 tonic::Response<super::InviteUserResponse>,
10304 tonic::Status,
10305 > {
10306 self.inner
10307 .ready()
10308 .await
10309 .map_err(|e| {
10310 tonic::Status::unknown(
10311 format!("Service was not ready: {}", e.into()),
10312 )
10313 })?;
10314 let codec = tonic_prost::ProstCodec::default();
10315 let path = http::uri::PathAndQuery::from_static(
10316 "/pidgr.v1.MemberService/InviteUser",
10317 );
10318 let mut req = request.into_request();
10319 req.extensions_mut()
10320 .insert(GrpcMethod::new("pidgr.v1.MemberService", "InviteUser"));
10321 self.inner.unary(req, path, codec).await
10322 }
10323 pub async fn get_user(
10328 &mut self,
10329 request: impl tonic::IntoRequest<super::GetUserRequest>,
10330 ) -> std::result::Result<
10331 tonic::Response<super::GetUserResponse>,
10332 tonic::Status,
10333 > {
10334 self.inner
10335 .ready()
10336 .await
10337 .map_err(|e| {
10338 tonic::Status::unknown(
10339 format!("Service was not ready: {}", e.into()),
10340 )
10341 })?;
10342 let codec = tonic_prost::ProstCodec::default();
10343 let path = http::uri::PathAndQuery::from_static(
10344 "/pidgr.v1.MemberService/GetUser",
10345 );
10346 let mut req = request.into_request();
10347 req.extensions_mut()
10348 .insert(GrpcMethod::new("pidgr.v1.MemberService", "GetUser"));
10349 self.inner.unary(req, path, codec).await
10350 }
10351 pub async fn list_users(
10355 &mut self,
10356 request: impl tonic::IntoRequest<super::ListUsersRequest>,
10357 ) -> std::result::Result<
10358 tonic::Response<super::ListUsersResponse>,
10359 tonic::Status,
10360 > {
10361 self.inner
10362 .ready()
10363 .await
10364 .map_err(|e| {
10365 tonic::Status::unknown(
10366 format!("Service was not ready: {}", e.into()),
10367 )
10368 })?;
10369 let codec = tonic_prost::ProstCodec::default();
10370 let path = http::uri::PathAndQuery::from_static(
10371 "/pidgr.v1.MemberService/ListUsers",
10372 );
10373 let mut req = request.into_request();
10374 req.extensions_mut()
10375 .insert(GrpcMethod::new("pidgr.v1.MemberService", "ListUsers"));
10376 self.inner.unary(req, path, codec).await
10377 }
10378 pub async fn update_user_role(
10382 &mut self,
10383 request: impl tonic::IntoRequest<super::UpdateUserRoleRequest>,
10384 ) -> std::result::Result<
10385 tonic::Response<super::UpdateUserRoleResponse>,
10386 tonic::Status,
10387 > {
10388 self.inner
10389 .ready()
10390 .await
10391 .map_err(|e| {
10392 tonic::Status::unknown(
10393 format!("Service was not ready: {}", e.into()),
10394 )
10395 })?;
10396 let codec = tonic_prost::ProstCodec::default();
10397 let path = http::uri::PathAndQuery::from_static(
10398 "/pidgr.v1.MemberService/UpdateUserRole",
10399 );
10400 let mut req = request.into_request();
10401 req.extensions_mut()
10402 .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserRole"));
10403 self.inner.unary(req, path, codec).await
10404 }
10405 pub async fn deactivate_user(
10409 &mut self,
10410 request: impl tonic::IntoRequest<super::DeactivateUserRequest>,
10411 ) -> std::result::Result<
10412 tonic::Response<super::DeactivateUserResponse>,
10413 tonic::Status,
10414 > {
10415 self.inner
10416 .ready()
10417 .await
10418 .map_err(|e| {
10419 tonic::Status::unknown(
10420 format!("Service was not ready: {}", e.into()),
10421 )
10422 })?;
10423 let codec = tonic_prost::ProstCodec::default();
10424 let path = http::uri::PathAndQuery::from_static(
10425 "/pidgr.v1.MemberService/DeactivateUser",
10426 );
10427 let mut req = request.into_request();
10428 req.extensions_mut()
10429 .insert(GrpcMethod::new("pidgr.v1.MemberService", "DeactivateUser"));
10430 self.inner.unary(req, path, codec).await
10431 }
10432 pub async fn reactivate_user(
10437 &mut self,
10438 request: impl tonic::IntoRequest<super::ReactivateUserRequest>,
10439 ) -> std::result::Result<
10440 tonic::Response<super::ReactivateUserResponse>,
10441 tonic::Status,
10442 > {
10443 self.inner
10444 .ready()
10445 .await
10446 .map_err(|e| {
10447 tonic::Status::unknown(
10448 format!("Service was not ready: {}", e.into()),
10449 )
10450 })?;
10451 let codec = tonic_prost::ProstCodec::default();
10452 let path = http::uri::PathAndQuery::from_static(
10453 "/pidgr.v1.MemberService/ReactivateUser",
10454 );
10455 let mut req = request.into_request();
10456 req.extensions_mut()
10457 .insert(GrpcMethod::new("pidgr.v1.MemberService", "ReactivateUser"));
10458 self.inner.unary(req, path, codec).await
10459 }
10460 pub async fn revoke_invite(
10465 &mut self,
10466 request: impl tonic::IntoRequest<super::RevokeInviteRequest>,
10467 ) -> std::result::Result<
10468 tonic::Response<super::RevokeInviteResponse>,
10469 tonic::Status,
10470 > {
10471 self.inner
10472 .ready()
10473 .await
10474 .map_err(|e| {
10475 tonic::Status::unknown(
10476 format!("Service was not ready: {}", e.into()),
10477 )
10478 })?;
10479 let codec = tonic_prost::ProstCodec::default();
10480 let path = http::uri::PathAndQuery::from_static(
10481 "/pidgr.v1.MemberService/RevokeInvite",
10482 );
10483 let mut req = request.into_request();
10484 req.extensions_mut()
10485 .insert(GrpcMethod::new("pidgr.v1.MemberService", "RevokeInvite"));
10486 self.inner.unary(req, path, codec).await
10487 }
10488 pub async fn update_user_profile(
10493 &mut self,
10494 request: impl tonic::IntoRequest<super::UpdateUserProfileRequest>,
10495 ) -> std::result::Result<
10496 tonic::Response<super::UpdateUserProfileResponse>,
10497 tonic::Status,
10498 > {
10499 self.inner
10500 .ready()
10501 .await
10502 .map_err(|e| {
10503 tonic::Status::unknown(
10504 format!("Service was not ready: {}", e.into()),
10505 )
10506 })?;
10507 let codec = tonic_prost::ProstCodec::default();
10508 let path = http::uri::PathAndQuery::from_static(
10509 "/pidgr.v1.MemberService/UpdateUserProfile",
10510 );
10511 let mut req = request.into_request();
10512 req.extensions_mut()
10513 .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserProfile"));
10514 self.inner.unary(req, path, codec).await
10515 }
10516 pub async fn get_user_settings(
10520 &mut self,
10521 request: impl tonic::IntoRequest<super::GetUserSettingsRequest>,
10522 ) -> std::result::Result<
10523 tonic::Response<super::GetUserSettingsResponse>,
10524 tonic::Status,
10525 > {
10526 self.inner
10527 .ready()
10528 .await
10529 .map_err(|e| {
10530 tonic::Status::unknown(
10531 format!("Service was not ready: {}", e.into()),
10532 )
10533 })?;
10534 let codec = tonic_prost::ProstCodec::default();
10535 let path = http::uri::PathAndQuery::from_static(
10536 "/pidgr.v1.MemberService/GetUserSettings",
10537 );
10538 let mut req = request.into_request();
10539 req.extensions_mut()
10540 .insert(GrpcMethod::new("pidgr.v1.MemberService", "GetUserSettings"));
10541 self.inner.unary(req, path, codec).await
10542 }
10543 pub async fn update_user_settings(
10548 &mut self,
10549 request: impl tonic::IntoRequest<super::UpdateUserSettingsRequest>,
10550 ) -> std::result::Result<
10551 tonic::Response<super::UpdateUserSettingsResponse>,
10552 tonic::Status,
10553 > {
10554 self.inner
10555 .ready()
10556 .await
10557 .map_err(|e| {
10558 tonic::Status::unknown(
10559 format!("Service was not ready: {}", e.into()),
10560 )
10561 })?;
10562 let codec = tonic_prost::ProstCodec::default();
10563 let path = http::uri::PathAndQuery::from_static(
10564 "/pidgr.v1.MemberService/UpdateUserSettings",
10565 );
10566 let mut req = request.into_request();
10567 req.extensions_mut()
10568 .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserSettings"));
10569 self.inner.unary(req, path, codec).await
10570 }
10571 pub async fn bulk_invite_users(
10577 &mut self,
10578 request: impl tonic::IntoRequest<super::BulkInviteUsersRequest>,
10579 ) -> std::result::Result<
10580 tonic::Response<super::BulkInviteUsersResponse>,
10581 tonic::Status,
10582 > {
10583 self.inner
10584 .ready()
10585 .await
10586 .map_err(|e| {
10587 tonic::Status::unknown(
10588 format!("Service was not ready: {}", e.into()),
10589 )
10590 })?;
10591 let codec = tonic_prost::ProstCodec::default();
10592 let path = http::uri::PathAndQuery::from_static(
10593 "/pidgr.v1.MemberService/BulkInviteUsers",
10594 );
10595 let mut req = request.into_request();
10596 req.extensions_mut()
10597 .insert(GrpcMethod::new("pidgr.v1.MemberService", "BulkInviteUsers"));
10598 self.inner.unary(req, path, codec).await
10599 }
10600 pub async fn confirm_passkey_enrollment(
10606 &mut self,
10607 request: impl tonic::IntoRequest<super::ConfirmPasskeyEnrollmentRequest>,
10608 ) -> std::result::Result<
10609 tonic::Response<super::ConfirmPasskeyEnrollmentResponse>,
10610 tonic::Status,
10611 > {
10612 self.inner
10613 .ready()
10614 .await
10615 .map_err(|e| {
10616 tonic::Status::unknown(
10617 format!("Service was not ready: {}", e.into()),
10618 )
10619 })?;
10620 let codec = tonic_prost::ProstCodec::default();
10621 let path = http::uri::PathAndQuery::from_static(
10622 "/pidgr.v1.MemberService/ConfirmPasskeyEnrollment",
10623 );
10624 let mut req = request.into_request();
10625 req.extensions_mut()
10626 .insert(
10627 GrpcMethod::new("pidgr.v1.MemberService", "ConfirmPasskeyEnrollment"),
10628 );
10629 self.inner.unary(req, path, codec).await
10630 }
10631 pub async fn update_user_region(
10636 &mut self,
10637 request: impl tonic::IntoRequest<super::UpdateUserRegionRequest>,
10638 ) -> std::result::Result<
10639 tonic::Response<super::UpdateUserRegionResponse>,
10640 tonic::Status,
10641 > {
10642 self.inner
10643 .ready()
10644 .await
10645 .map_err(|e| {
10646 tonic::Status::unknown(
10647 format!("Service was not ready: {}", e.into()),
10648 )
10649 })?;
10650 let codec = tonic_prost::ProstCodec::default();
10651 let path = http::uri::PathAndQuery::from_static(
10652 "/pidgr.v1.MemberService/UpdateUserRegion",
10653 );
10654 let mut req = request.into_request();
10655 req.extensions_mut()
10656 .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserRegion"));
10657 self.inner.unary(req, path, codec).await
10658 }
10659 }
10660}
10661pub mod member_service_server {
10663 #![allow(
10664 unused_variables,
10665 dead_code,
10666 missing_docs,
10667 clippy::wildcard_imports,
10668 clippy::let_unit_value,
10669 )]
10670 use tonic::codegen::*;
10671 #[async_trait]
10673 pub trait MemberService: std::marker::Send + std::marker::Sync + 'static {
10674 async fn invite_user(
10678 &self,
10679 request: tonic::Request<super::InviteUserRequest>,
10680 ) -> std::result::Result<
10681 tonic::Response<super::InviteUserResponse>,
10682 tonic::Status,
10683 >;
10684 async fn get_user(
10689 &self,
10690 request: tonic::Request<super::GetUserRequest>,
10691 ) -> std::result::Result<tonic::Response<super::GetUserResponse>, tonic::Status>;
10692 async fn list_users(
10696 &self,
10697 request: tonic::Request<super::ListUsersRequest>,
10698 ) -> std::result::Result<
10699 tonic::Response<super::ListUsersResponse>,
10700 tonic::Status,
10701 >;
10702 async fn update_user_role(
10706 &self,
10707 request: tonic::Request<super::UpdateUserRoleRequest>,
10708 ) -> std::result::Result<
10709 tonic::Response<super::UpdateUserRoleResponse>,
10710 tonic::Status,
10711 >;
10712 async fn deactivate_user(
10716 &self,
10717 request: tonic::Request<super::DeactivateUserRequest>,
10718 ) -> std::result::Result<
10719 tonic::Response<super::DeactivateUserResponse>,
10720 tonic::Status,
10721 >;
10722 async fn reactivate_user(
10727 &self,
10728 request: tonic::Request<super::ReactivateUserRequest>,
10729 ) -> std::result::Result<
10730 tonic::Response<super::ReactivateUserResponse>,
10731 tonic::Status,
10732 >;
10733 async fn revoke_invite(
10738 &self,
10739 request: tonic::Request<super::RevokeInviteRequest>,
10740 ) -> std::result::Result<
10741 tonic::Response<super::RevokeInviteResponse>,
10742 tonic::Status,
10743 >;
10744 async fn update_user_profile(
10749 &self,
10750 request: tonic::Request<super::UpdateUserProfileRequest>,
10751 ) -> std::result::Result<
10752 tonic::Response<super::UpdateUserProfileResponse>,
10753 tonic::Status,
10754 >;
10755 async fn get_user_settings(
10759 &self,
10760 request: tonic::Request<super::GetUserSettingsRequest>,
10761 ) -> std::result::Result<
10762 tonic::Response<super::GetUserSettingsResponse>,
10763 tonic::Status,
10764 >;
10765 async fn update_user_settings(
10770 &self,
10771 request: tonic::Request<super::UpdateUserSettingsRequest>,
10772 ) -> std::result::Result<
10773 tonic::Response<super::UpdateUserSettingsResponse>,
10774 tonic::Status,
10775 >;
10776 async fn bulk_invite_users(
10782 &self,
10783 request: tonic::Request<super::BulkInviteUsersRequest>,
10784 ) -> std::result::Result<
10785 tonic::Response<super::BulkInviteUsersResponse>,
10786 tonic::Status,
10787 >;
10788 async fn confirm_passkey_enrollment(
10794 &self,
10795 request: tonic::Request<super::ConfirmPasskeyEnrollmentRequest>,
10796 ) -> std::result::Result<
10797 tonic::Response<super::ConfirmPasskeyEnrollmentResponse>,
10798 tonic::Status,
10799 >;
10800 async fn update_user_region(
10805 &self,
10806 request: tonic::Request<super::UpdateUserRegionRequest>,
10807 ) -> std::result::Result<
10808 tonic::Response<super::UpdateUserRegionResponse>,
10809 tonic::Status,
10810 >;
10811 }
10812 #[derive(Debug)]
10816 pub struct MemberServiceServer<T> {
10817 inner: Arc<T>,
10818 accept_compression_encodings: EnabledCompressionEncodings,
10819 send_compression_encodings: EnabledCompressionEncodings,
10820 max_decoding_message_size: Option<usize>,
10821 max_encoding_message_size: Option<usize>,
10822 }
10823 impl<T> MemberServiceServer<T> {
10824 pub fn new(inner: T) -> Self {
10825 Self::from_arc(Arc::new(inner))
10826 }
10827 pub fn from_arc(inner: Arc<T>) -> Self {
10828 Self {
10829 inner,
10830 accept_compression_encodings: Default::default(),
10831 send_compression_encodings: Default::default(),
10832 max_decoding_message_size: None,
10833 max_encoding_message_size: None,
10834 }
10835 }
10836 pub fn with_interceptor<F>(
10837 inner: T,
10838 interceptor: F,
10839 ) -> InterceptedService<Self, F>
10840 where
10841 F: tonic::service::Interceptor,
10842 {
10843 InterceptedService::new(Self::new(inner), interceptor)
10844 }
10845 #[must_use]
10847 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10848 self.accept_compression_encodings.enable(encoding);
10849 self
10850 }
10851 #[must_use]
10853 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10854 self.send_compression_encodings.enable(encoding);
10855 self
10856 }
10857 #[must_use]
10861 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10862 self.max_decoding_message_size = Some(limit);
10863 self
10864 }
10865 #[must_use]
10869 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10870 self.max_encoding_message_size = Some(limit);
10871 self
10872 }
10873 }
10874 impl<T, B> tonic::codegen::Service<http::Request<B>> for MemberServiceServer<T>
10875 where
10876 T: MemberService,
10877 B: Body + std::marker::Send + 'static,
10878 B::Error: Into<StdError> + std::marker::Send + 'static,
10879 {
10880 type Response = http::Response<tonic::body::Body>;
10881 type Error = std::convert::Infallible;
10882 type Future = BoxFuture<Self::Response, Self::Error>;
10883 fn poll_ready(
10884 &mut self,
10885 _cx: &mut Context<'_>,
10886 ) -> Poll<std::result::Result<(), Self::Error>> {
10887 Poll::Ready(Ok(()))
10888 }
10889 fn call(&mut self, req: http::Request<B>) -> Self::Future {
10890 match req.uri().path() {
10891 "/pidgr.v1.MemberService/InviteUser" => {
10892 #[allow(non_camel_case_types)]
10893 struct InviteUserSvc<T: MemberService>(pub Arc<T>);
10894 impl<
10895 T: MemberService,
10896 > tonic::server::UnaryService<super::InviteUserRequest>
10897 for InviteUserSvc<T> {
10898 type Response = super::InviteUserResponse;
10899 type Future = BoxFuture<
10900 tonic::Response<Self::Response>,
10901 tonic::Status,
10902 >;
10903 fn call(
10904 &mut self,
10905 request: tonic::Request<super::InviteUserRequest>,
10906 ) -> Self::Future {
10907 let inner = Arc::clone(&self.0);
10908 let fut = async move {
10909 <T as MemberService>::invite_user(&inner, request).await
10910 };
10911 Box::pin(fut)
10912 }
10913 }
10914 let accept_compression_encodings = self.accept_compression_encodings;
10915 let send_compression_encodings = self.send_compression_encodings;
10916 let max_decoding_message_size = self.max_decoding_message_size;
10917 let max_encoding_message_size = self.max_encoding_message_size;
10918 let inner = self.inner.clone();
10919 let fut = async move {
10920 let method = InviteUserSvc(inner);
10921 let codec = tonic_prost::ProstCodec::default();
10922 let mut grpc = tonic::server::Grpc::new(codec)
10923 .apply_compression_config(
10924 accept_compression_encodings,
10925 send_compression_encodings,
10926 )
10927 .apply_max_message_size_config(
10928 max_decoding_message_size,
10929 max_encoding_message_size,
10930 );
10931 let res = grpc.unary(method, req).await;
10932 Ok(res)
10933 };
10934 Box::pin(fut)
10935 }
10936 "/pidgr.v1.MemberService/GetUser" => {
10937 #[allow(non_camel_case_types)]
10938 struct GetUserSvc<T: MemberService>(pub Arc<T>);
10939 impl<
10940 T: MemberService,
10941 > tonic::server::UnaryService<super::GetUserRequest>
10942 for GetUserSvc<T> {
10943 type Response = super::GetUserResponse;
10944 type Future = BoxFuture<
10945 tonic::Response<Self::Response>,
10946 tonic::Status,
10947 >;
10948 fn call(
10949 &mut self,
10950 request: tonic::Request<super::GetUserRequest>,
10951 ) -> Self::Future {
10952 let inner = Arc::clone(&self.0);
10953 let fut = async move {
10954 <T as MemberService>::get_user(&inner, request).await
10955 };
10956 Box::pin(fut)
10957 }
10958 }
10959 let accept_compression_encodings = self.accept_compression_encodings;
10960 let send_compression_encodings = self.send_compression_encodings;
10961 let max_decoding_message_size = self.max_decoding_message_size;
10962 let max_encoding_message_size = self.max_encoding_message_size;
10963 let inner = self.inner.clone();
10964 let fut = async move {
10965 let method = GetUserSvc(inner);
10966 let codec = tonic_prost::ProstCodec::default();
10967 let mut grpc = tonic::server::Grpc::new(codec)
10968 .apply_compression_config(
10969 accept_compression_encodings,
10970 send_compression_encodings,
10971 )
10972 .apply_max_message_size_config(
10973 max_decoding_message_size,
10974 max_encoding_message_size,
10975 );
10976 let res = grpc.unary(method, req).await;
10977 Ok(res)
10978 };
10979 Box::pin(fut)
10980 }
10981 "/pidgr.v1.MemberService/ListUsers" => {
10982 #[allow(non_camel_case_types)]
10983 struct ListUsersSvc<T: MemberService>(pub Arc<T>);
10984 impl<
10985 T: MemberService,
10986 > tonic::server::UnaryService<super::ListUsersRequest>
10987 for ListUsersSvc<T> {
10988 type Response = super::ListUsersResponse;
10989 type Future = BoxFuture<
10990 tonic::Response<Self::Response>,
10991 tonic::Status,
10992 >;
10993 fn call(
10994 &mut self,
10995 request: tonic::Request<super::ListUsersRequest>,
10996 ) -> Self::Future {
10997 let inner = Arc::clone(&self.0);
10998 let fut = async move {
10999 <T as MemberService>::list_users(&inner, request).await
11000 };
11001 Box::pin(fut)
11002 }
11003 }
11004 let accept_compression_encodings = self.accept_compression_encodings;
11005 let send_compression_encodings = self.send_compression_encodings;
11006 let max_decoding_message_size = self.max_decoding_message_size;
11007 let max_encoding_message_size = self.max_encoding_message_size;
11008 let inner = self.inner.clone();
11009 let fut = async move {
11010 let method = ListUsersSvc(inner);
11011 let codec = tonic_prost::ProstCodec::default();
11012 let mut grpc = tonic::server::Grpc::new(codec)
11013 .apply_compression_config(
11014 accept_compression_encodings,
11015 send_compression_encodings,
11016 )
11017 .apply_max_message_size_config(
11018 max_decoding_message_size,
11019 max_encoding_message_size,
11020 );
11021 let res = grpc.unary(method, req).await;
11022 Ok(res)
11023 };
11024 Box::pin(fut)
11025 }
11026 "/pidgr.v1.MemberService/UpdateUserRole" => {
11027 #[allow(non_camel_case_types)]
11028 struct UpdateUserRoleSvc<T: MemberService>(pub Arc<T>);
11029 impl<
11030 T: MemberService,
11031 > tonic::server::UnaryService<super::UpdateUserRoleRequest>
11032 for UpdateUserRoleSvc<T> {
11033 type Response = super::UpdateUserRoleResponse;
11034 type Future = BoxFuture<
11035 tonic::Response<Self::Response>,
11036 tonic::Status,
11037 >;
11038 fn call(
11039 &mut self,
11040 request: tonic::Request<super::UpdateUserRoleRequest>,
11041 ) -> Self::Future {
11042 let inner = Arc::clone(&self.0);
11043 let fut = async move {
11044 <T as MemberService>::update_user_role(&inner, request)
11045 .await
11046 };
11047 Box::pin(fut)
11048 }
11049 }
11050 let accept_compression_encodings = self.accept_compression_encodings;
11051 let send_compression_encodings = self.send_compression_encodings;
11052 let max_decoding_message_size = self.max_decoding_message_size;
11053 let max_encoding_message_size = self.max_encoding_message_size;
11054 let inner = self.inner.clone();
11055 let fut = async move {
11056 let method = UpdateUserRoleSvc(inner);
11057 let codec = tonic_prost::ProstCodec::default();
11058 let mut grpc = tonic::server::Grpc::new(codec)
11059 .apply_compression_config(
11060 accept_compression_encodings,
11061 send_compression_encodings,
11062 )
11063 .apply_max_message_size_config(
11064 max_decoding_message_size,
11065 max_encoding_message_size,
11066 );
11067 let res = grpc.unary(method, req).await;
11068 Ok(res)
11069 };
11070 Box::pin(fut)
11071 }
11072 "/pidgr.v1.MemberService/DeactivateUser" => {
11073 #[allow(non_camel_case_types)]
11074 struct DeactivateUserSvc<T: MemberService>(pub Arc<T>);
11075 impl<
11076 T: MemberService,
11077 > tonic::server::UnaryService<super::DeactivateUserRequest>
11078 for DeactivateUserSvc<T> {
11079 type Response = super::DeactivateUserResponse;
11080 type Future = BoxFuture<
11081 tonic::Response<Self::Response>,
11082 tonic::Status,
11083 >;
11084 fn call(
11085 &mut self,
11086 request: tonic::Request<super::DeactivateUserRequest>,
11087 ) -> Self::Future {
11088 let inner = Arc::clone(&self.0);
11089 let fut = async move {
11090 <T as MemberService>::deactivate_user(&inner, request).await
11091 };
11092 Box::pin(fut)
11093 }
11094 }
11095 let accept_compression_encodings = self.accept_compression_encodings;
11096 let send_compression_encodings = self.send_compression_encodings;
11097 let max_decoding_message_size = self.max_decoding_message_size;
11098 let max_encoding_message_size = self.max_encoding_message_size;
11099 let inner = self.inner.clone();
11100 let fut = async move {
11101 let method = DeactivateUserSvc(inner);
11102 let codec = tonic_prost::ProstCodec::default();
11103 let mut grpc = tonic::server::Grpc::new(codec)
11104 .apply_compression_config(
11105 accept_compression_encodings,
11106 send_compression_encodings,
11107 )
11108 .apply_max_message_size_config(
11109 max_decoding_message_size,
11110 max_encoding_message_size,
11111 );
11112 let res = grpc.unary(method, req).await;
11113 Ok(res)
11114 };
11115 Box::pin(fut)
11116 }
11117 "/pidgr.v1.MemberService/ReactivateUser" => {
11118 #[allow(non_camel_case_types)]
11119 struct ReactivateUserSvc<T: MemberService>(pub Arc<T>);
11120 impl<
11121 T: MemberService,
11122 > tonic::server::UnaryService<super::ReactivateUserRequest>
11123 for ReactivateUserSvc<T> {
11124 type Response = super::ReactivateUserResponse;
11125 type Future = BoxFuture<
11126 tonic::Response<Self::Response>,
11127 tonic::Status,
11128 >;
11129 fn call(
11130 &mut self,
11131 request: tonic::Request<super::ReactivateUserRequest>,
11132 ) -> Self::Future {
11133 let inner = Arc::clone(&self.0);
11134 let fut = async move {
11135 <T as MemberService>::reactivate_user(&inner, request).await
11136 };
11137 Box::pin(fut)
11138 }
11139 }
11140 let accept_compression_encodings = self.accept_compression_encodings;
11141 let send_compression_encodings = self.send_compression_encodings;
11142 let max_decoding_message_size = self.max_decoding_message_size;
11143 let max_encoding_message_size = self.max_encoding_message_size;
11144 let inner = self.inner.clone();
11145 let fut = async move {
11146 let method = ReactivateUserSvc(inner);
11147 let codec = tonic_prost::ProstCodec::default();
11148 let mut grpc = tonic::server::Grpc::new(codec)
11149 .apply_compression_config(
11150 accept_compression_encodings,
11151 send_compression_encodings,
11152 )
11153 .apply_max_message_size_config(
11154 max_decoding_message_size,
11155 max_encoding_message_size,
11156 );
11157 let res = grpc.unary(method, req).await;
11158 Ok(res)
11159 };
11160 Box::pin(fut)
11161 }
11162 "/pidgr.v1.MemberService/RevokeInvite" => {
11163 #[allow(non_camel_case_types)]
11164 struct RevokeInviteSvc<T: MemberService>(pub Arc<T>);
11165 impl<
11166 T: MemberService,
11167 > tonic::server::UnaryService<super::RevokeInviteRequest>
11168 for RevokeInviteSvc<T> {
11169 type Response = super::RevokeInviteResponse;
11170 type Future = BoxFuture<
11171 tonic::Response<Self::Response>,
11172 tonic::Status,
11173 >;
11174 fn call(
11175 &mut self,
11176 request: tonic::Request<super::RevokeInviteRequest>,
11177 ) -> Self::Future {
11178 let inner = Arc::clone(&self.0);
11179 let fut = async move {
11180 <T as MemberService>::revoke_invite(&inner, request).await
11181 };
11182 Box::pin(fut)
11183 }
11184 }
11185 let accept_compression_encodings = self.accept_compression_encodings;
11186 let send_compression_encodings = self.send_compression_encodings;
11187 let max_decoding_message_size = self.max_decoding_message_size;
11188 let max_encoding_message_size = self.max_encoding_message_size;
11189 let inner = self.inner.clone();
11190 let fut = async move {
11191 let method = RevokeInviteSvc(inner);
11192 let codec = tonic_prost::ProstCodec::default();
11193 let mut grpc = tonic::server::Grpc::new(codec)
11194 .apply_compression_config(
11195 accept_compression_encodings,
11196 send_compression_encodings,
11197 )
11198 .apply_max_message_size_config(
11199 max_decoding_message_size,
11200 max_encoding_message_size,
11201 );
11202 let res = grpc.unary(method, req).await;
11203 Ok(res)
11204 };
11205 Box::pin(fut)
11206 }
11207 "/pidgr.v1.MemberService/UpdateUserProfile" => {
11208 #[allow(non_camel_case_types)]
11209 struct UpdateUserProfileSvc<T: MemberService>(pub Arc<T>);
11210 impl<
11211 T: MemberService,
11212 > tonic::server::UnaryService<super::UpdateUserProfileRequest>
11213 for UpdateUserProfileSvc<T> {
11214 type Response = super::UpdateUserProfileResponse;
11215 type Future = BoxFuture<
11216 tonic::Response<Self::Response>,
11217 tonic::Status,
11218 >;
11219 fn call(
11220 &mut self,
11221 request: tonic::Request<super::UpdateUserProfileRequest>,
11222 ) -> Self::Future {
11223 let inner = Arc::clone(&self.0);
11224 let fut = async move {
11225 <T as MemberService>::update_user_profile(&inner, request)
11226 .await
11227 };
11228 Box::pin(fut)
11229 }
11230 }
11231 let accept_compression_encodings = self.accept_compression_encodings;
11232 let send_compression_encodings = self.send_compression_encodings;
11233 let max_decoding_message_size = self.max_decoding_message_size;
11234 let max_encoding_message_size = self.max_encoding_message_size;
11235 let inner = self.inner.clone();
11236 let fut = async move {
11237 let method = UpdateUserProfileSvc(inner);
11238 let codec = tonic_prost::ProstCodec::default();
11239 let mut grpc = tonic::server::Grpc::new(codec)
11240 .apply_compression_config(
11241 accept_compression_encodings,
11242 send_compression_encodings,
11243 )
11244 .apply_max_message_size_config(
11245 max_decoding_message_size,
11246 max_encoding_message_size,
11247 );
11248 let res = grpc.unary(method, req).await;
11249 Ok(res)
11250 };
11251 Box::pin(fut)
11252 }
11253 "/pidgr.v1.MemberService/GetUserSettings" => {
11254 #[allow(non_camel_case_types)]
11255 struct GetUserSettingsSvc<T: MemberService>(pub Arc<T>);
11256 impl<
11257 T: MemberService,
11258 > tonic::server::UnaryService<super::GetUserSettingsRequest>
11259 for GetUserSettingsSvc<T> {
11260 type Response = super::GetUserSettingsResponse;
11261 type Future = BoxFuture<
11262 tonic::Response<Self::Response>,
11263 tonic::Status,
11264 >;
11265 fn call(
11266 &mut self,
11267 request: tonic::Request<super::GetUserSettingsRequest>,
11268 ) -> Self::Future {
11269 let inner = Arc::clone(&self.0);
11270 let fut = async move {
11271 <T as MemberService>::get_user_settings(&inner, request)
11272 .await
11273 };
11274 Box::pin(fut)
11275 }
11276 }
11277 let accept_compression_encodings = self.accept_compression_encodings;
11278 let send_compression_encodings = self.send_compression_encodings;
11279 let max_decoding_message_size = self.max_decoding_message_size;
11280 let max_encoding_message_size = self.max_encoding_message_size;
11281 let inner = self.inner.clone();
11282 let fut = async move {
11283 let method = GetUserSettingsSvc(inner);
11284 let codec = tonic_prost::ProstCodec::default();
11285 let mut grpc = tonic::server::Grpc::new(codec)
11286 .apply_compression_config(
11287 accept_compression_encodings,
11288 send_compression_encodings,
11289 )
11290 .apply_max_message_size_config(
11291 max_decoding_message_size,
11292 max_encoding_message_size,
11293 );
11294 let res = grpc.unary(method, req).await;
11295 Ok(res)
11296 };
11297 Box::pin(fut)
11298 }
11299 "/pidgr.v1.MemberService/UpdateUserSettings" => {
11300 #[allow(non_camel_case_types)]
11301 struct UpdateUserSettingsSvc<T: MemberService>(pub Arc<T>);
11302 impl<
11303 T: MemberService,
11304 > tonic::server::UnaryService<super::UpdateUserSettingsRequest>
11305 for UpdateUserSettingsSvc<T> {
11306 type Response = super::UpdateUserSettingsResponse;
11307 type Future = BoxFuture<
11308 tonic::Response<Self::Response>,
11309 tonic::Status,
11310 >;
11311 fn call(
11312 &mut self,
11313 request: tonic::Request<super::UpdateUserSettingsRequest>,
11314 ) -> Self::Future {
11315 let inner = Arc::clone(&self.0);
11316 let fut = async move {
11317 <T as MemberService>::update_user_settings(&inner, request)
11318 .await
11319 };
11320 Box::pin(fut)
11321 }
11322 }
11323 let accept_compression_encodings = self.accept_compression_encodings;
11324 let send_compression_encodings = self.send_compression_encodings;
11325 let max_decoding_message_size = self.max_decoding_message_size;
11326 let max_encoding_message_size = self.max_encoding_message_size;
11327 let inner = self.inner.clone();
11328 let fut = async move {
11329 let method = UpdateUserSettingsSvc(inner);
11330 let codec = tonic_prost::ProstCodec::default();
11331 let mut grpc = tonic::server::Grpc::new(codec)
11332 .apply_compression_config(
11333 accept_compression_encodings,
11334 send_compression_encodings,
11335 )
11336 .apply_max_message_size_config(
11337 max_decoding_message_size,
11338 max_encoding_message_size,
11339 );
11340 let res = grpc.unary(method, req).await;
11341 Ok(res)
11342 };
11343 Box::pin(fut)
11344 }
11345 "/pidgr.v1.MemberService/BulkInviteUsers" => {
11346 #[allow(non_camel_case_types)]
11347 struct BulkInviteUsersSvc<T: MemberService>(pub Arc<T>);
11348 impl<
11349 T: MemberService,
11350 > tonic::server::UnaryService<super::BulkInviteUsersRequest>
11351 for BulkInviteUsersSvc<T> {
11352 type Response = super::BulkInviteUsersResponse;
11353 type Future = BoxFuture<
11354 tonic::Response<Self::Response>,
11355 tonic::Status,
11356 >;
11357 fn call(
11358 &mut self,
11359 request: tonic::Request<super::BulkInviteUsersRequest>,
11360 ) -> Self::Future {
11361 let inner = Arc::clone(&self.0);
11362 let fut = async move {
11363 <T as MemberService>::bulk_invite_users(&inner, request)
11364 .await
11365 };
11366 Box::pin(fut)
11367 }
11368 }
11369 let accept_compression_encodings = self.accept_compression_encodings;
11370 let send_compression_encodings = self.send_compression_encodings;
11371 let max_decoding_message_size = self.max_decoding_message_size;
11372 let max_encoding_message_size = self.max_encoding_message_size;
11373 let inner = self.inner.clone();
11374 let fut = async move {
11375 let method = BulkInviteUsersSvc(inner);
11376 let codec = tonic_prost::ProstCodec::default();
11377 let mut grpc = tonic::server::Grpc::new(codec)
11378 .apply_compression_config(
11379 accept_compression_encodings,
11380 send_compression_encodings,
11381 )
11382 .apply_max_message_size_config(
11383 max_decoding_message_size,
11384 max_encoding_message_size,
11385 );
11386 let res = grpc.unary(method, req).await;
11387 Ok(res)
11388 };
11389 Box::pin(fut)
11390 }
11391 "/pidgr.v1.MemberService/ConfirmPasskeyEnrollment" => {
11392 #[allow(non_camel_case_types)]
11393 struct ConfirmPasskeyEnrollmentSvc<T: MemberService>(pub Arc<T>);
11394 impl<
11395 T: MemberService,
11396 > tonic::server::UnaryService<super::ConfirmPasskeyEnrollmentRequest>
11397 for ConfirmPasskeyEnrollmentSvc<T> {
11398 type Response = super::ConfirmPasskeyEnrollmentResponse;
11399 type Future = BoxFuture<
11400 tonic::Response<Self::Response>,
11401 tonic::Status,
11402 >;
11403 fn call(
11404 &mut self,
11405 request: tonic::Request<
11406 super::ConfirmPasskeyEnrollmentRequest,
11407 >,
11408 ) -> Self::Future {
11409 let inner = Arc::clone(&self.0);
11410 let fut = async move {
11411 <T as MemberService>::confirm_passkey_enrollment(
11412 &inner,
11413 request,
11414 )
11415 .await
11416 };
11417 Box::pin(fut)
11418 }
11419 }
11420 let accept_compression_encodings = self.accept_compression_encodings;
11421 let send_compression_encodings = self.send_compression_encodings;
11422 let max_decoding_message_size = self.max_decoding_message_size;
11423 let max_encoding_message_size = self.max_encoding_message_size;
11424 let inner = self.inner.clone();
11425 let fut = async move {
11426 let method = ConfirmPasskeyEnrollmentSvc(inner);
11427 let codec = tonic_prost::ProstCodec::default();
11428 let mut grpc = tonic::server::Grpc::new(codec)
11429 .apply_compression_config(
11430 accept_compression_encodings,
11431 send_compression_encodings,
11432 )
11433 .apply_max_message_size_config(
11434 max_decoding_message_size,
11435 max_encoding_message_size,
11436 );
11437 let res = grpc.unary(method, req).await;
11438 Ok(res)
11439 };
11440 Box::pin(fut)
11441 }
11442 "/pidgr.v1.MemberService/UpdateUserRegion" => {
11443 #[allow(non_camel_case_types)]
11444 struct UpdateUserRegionSvc<T: MemberService>(pub Arc<T>);
11445 impl<
11446 T: MemberService,
11447 > tonic::server::UnaryService<super::UpdateUserRegionRequest>
11448 for UpdateUserRegionSvc<T> {
11449 type Response = super::UpdateUserRegionResponse;
11450 type Future = BoxFuture<
11451 tonic::Response<Self::Response>,
11452 tonic::Status,
11453 >;
11454 fn call(
11455 &mut self,
11456 request: tonic::Request<super::UpdateUserRegionRequest>,
11457 ) -> Self::Future {
11458 let inner = Arc::clone(&self.0);
11459 let fut = async move {
11460 <T as MemberService>::update_user_region(&inner, request)
11461 .await
11462 };
11463 Box::pin(fut)
11464 }
11465 }
11466 let accept_compression_encodings = self.accept_compression_encodings;
11467 let send_compression_encodings = self.send_compression_encodings;
11468 let max_decoding_message_size = self.max_decoding_message_size;
11469 let max_encoding_message_size = self.max_encoding_message_size;
11470 let inner = self.inner.clone();
11471 let fut = async move {
11472 let method = UpdateUserRegionSvc(inner);
11473 let codec = tonic_prost::ProstCodec::default();
11474 let mut grpc = tonic::server::Grpc::new(codec)
11475 .apply_compression_config(
11476 accept_compression_encodings,
11477 send_compression_encodings,
11478 )
11479 .apply_max_message_size_config(
11480 max_decoding_message_size,
11481 max_encoding_message_size,
11482 );
11483 let res = grpc.unary(method, req).await;
11484 Ok(res)
11485 };
11486 Box::pin(fut)
11487 }
11488 _ => {
11489 Box::pin(async move {
11490 let mut response = http::Response::new(
11491 tonic::body::Body::default(),
11492 );
11493 let headers = response.headers_mut();
11494 headers
11495 .insert(
11496 tonic::Status::GRPC_STATUS,
11497 (tonic::Code::Unimplemented as i32).into(),
11498 );
11499 headers
11500 .insert(
11501 http::header::CONTENT_TYPE,
11502 tonic::metadata::GRPC_CONTENT_TYPE,
11503 );
11504 Ok(response)
11505 })
11506 }
11507 }
11508 }
11509 }
11510 impl<T> Clone for MemberServiceServer<T> {
11511 fn clone(&self) -> Self {
11512 let inner = self.inner.clone();
11513 Self {
11514 inner,
11515 accept_compression_encodings: self.accept_compression_encodings,
11516 send_compression_encodings: self.send_compression_encodings,
11517 max_decoding_message_size: self.max_decoding_message_size,
11518 max_encoding_message_size: self.max_encoding_message_size,
11519 }
11520 }
11521 }
11522 pub const SERVICE_NAME: &str = "pidgr.v1.MemberService";
11524 impl<T> tonic::server::NamedService for MemberServiceServer<T> {
11525 const NAME: &'static str = SERVICE_NAME;
11526 }
11527}
11528pub mod org_security_keys_service_client {
11530 #![allow(
11531 unused_variables,
11532 dead_code,
11533 missing_docs,
11534 clippy::wildcard_imports,
11535 clippy::let_unit_value,
11536 )]
11537 use tonic::codegen::*;
11538 use tonic::codegen::http::Uri;
11539 #[derive(Debug, Clone)]
11553 pub struct OrgSecurityKeysServiceClient<T> {
11554 inner: tonic::client::Grpc<T>,
11555 }
11556 impl OrgSecurityKeysServiceClient<tonic::transport::Channel> {
11557 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
11559 where
11560 D: TryInto<tonic::transport::Endpoint>,
11561 D::Error: Into<StdError>,
11562 {
11563 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
11564 Ok(Self::new(conn))
11565 }
11566 }
11567 impl<T> OrgSecurityKeysServiceClient<T>
11568 where
11569 T: tonic::client::GrpcService<tonic::body::Body>,
11570 T::Error: Into<StdError>,
11571 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
11572 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
11573 {
11574 pub fn new(inner: T) -> Self {
11575 let inner = tonic::client::Grpc::new(inner);
11576 Self { inner }
11577 }
11578 pub fn with_origin(inner: T, origin: Uri) -> Self {
11579 let inner = tonic::client::Grpc::with_origin(inner, origin);
11580 Self { inner }
11581 }
11582 pub fn with_interceptor<F>(
11583 inner: T,
11584 interceptor: F,
11585 ) -> OrgSecurityKeysServiceClient<InterceptedService<T, F>>
11586 where
11587 F: tonic::service::Interceptor,
11588 T::ResponseBody: Default,
11589 T: tonic::codegen::Service<
11590 http::Request<tonic::body::Body>,
11591 Response = http::Response<
11592 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
11593 >,
11594 >,
11595 <T as tonic::codegen::Service<
11596 http::Request<tonic::body::Body>,
11597 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
11598 {
11599 OrgSecurityKeysServiceClient::new(
11600 InterceptedService::new(inner, interceptor),
11601 )
11602 }
11603 #[must_use]
11608 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11609 self.inner = self.inner.send_compressed(encoding);
11610 self
11611 }
11612 #[must_use]
11614 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11615 self.inner = self.inner.accept_compressed(encoding);
11616 self
11617 }
11618 #[must_use]
11622 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11623 self.inner = self.inner.max_decoding_message_size(limit);
11624 self
11625 }
11626 #[must_use]
11630 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11631 self.inner = self.inner.max_encoding_message_size(limit);
11632 self
11633 }
11634 pub async fn get_peppers(
11639 &mut self,
11640 request: impl tonic::IntoRequest<super::GetPeppersRequest>,
11641 ) -> std::result::Result<
11642 tonic::Response<super::GetPeppersResponse>,
11643 tonic::Status,
11644 > {
11645 self.inner
11646 .ready()
11647 .await
11648 .map_err(|e| {
11649 tonic::Status::unknown(
11650 format!("Service was not ready: {}", e.into()),
11651 )
11652 })?;
11653 let codec = tonic_prost::ProstCodec::default();
11654 let path = http::uri::PathAndQuery::from_static(
11655 "/pidgr.v1.OrgSecurityKeysService/GetPeppers",
11656 );
11657 let mut req = request.into_request();
11658 req.extensions_mut()
11659 .insert(
11660 GrpcMethod::new("pidgr.v1.OrgSecurityKeysService", "GetPeppers"),
11661 );
11662 self.inner.unary(req, path, codec).await
11663 }
11664 }
11665}
11666pub mod org_security_keys_service_server {
11668 #![allow(
11669 unused_variables,
11670 dead_code,
11671 missing_docs,
11672 clippy::wildcard_imports,
11673 clippy::let_unit_value,
11674 )]
11675 use tonic::codegen::*;
11676 #[async_trait]
11678 pub trait OrgSecurityKeysService: std::marker::Send + std::marker::Sync + 'static {
11679 async fn get_peppers(
11684 &self,
11685 request: tonic::Request<super::GetPeppersRequest>,
11686 ) -> std::result::Result<
11687 tonic::Response<super::GetPeppersResponse>,
11688 tonic::Status,
11689 >;
11690 }
11691 #[derive(Debug)]
11705 pub struct OrgSecurityKeysServiceServer<T> {
11706 inner: Arc<T>,
11707 accept_compression_encodings: EnabledCompressionEncodings,
11708 send_compression_encodings: EnabledCompressionEncodings,
11709 max_decoding_message_size: Option<usize>,
11710 max_encoding_message_size: Option<usize>,
11711 }
11712 impl<T> OrgSecurityKeysServiceServer<T> {
11713 pub fn new(inner: T) -> Self {
11714 Self::from_arc(Arc::new(inner))
11715 }
11716 pub fn from_arc(inner: Arc<T>) -> Self {
11717 Self {
11718 inner,
11719 accept_compression_encodings: Default::default(),
11720 send_compression_encodings: Default::default(),
11721 max_decoding_message_size: None,
11722 max_encoding_message_size: None,
11723 }
11724 }
11725 pub fn with_interceptor<F>(
11726 inner: T,
11727 interceptor: F,
11728 ) -> InterceptedService<Self, F>
11729 where
11730 F: tonic::service::Interceptor,
11731 {
11732 InterceptedService::new(Self::new(inner), interceptor)
11733 }
11734 #[must_use]
11736 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11737 self.accept_compression_encodings.enable(encoding);
11738 self
11739 }
11740 #[must_use]
11742 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11743 self.send_compression_encodings.enable(encoding);
11744 self
11745 }
11746 #[must_use]
11750 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11751 self.max_decoding_message_size = Some(limit);
11752 self
11753 }
11754 #[must_use]
11758 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11759 self.max_encoding_message_size = Some(limit);
11760 self
11761 }
11762 }
11763 impl<T, B> tonic::codegen::Service<http::Request<B>>
11764 for OrgSecurityKeysServiceServer<T>
11765 where
11766 T: OrgSecurityKeysService,
11767 B: Body + std::marker::Send + 'static,
11768 B::Error: Into<StdError> + std::marker::Send + 'static,
11769 {
11770 type Response = http::Response<tonic::body::Body>;
11771 type Error = std::convert::Infallible;
11772 type Future = BoxFuture<Self::Response, Self::Error>;
11773 fn poll_ready(
11774 &mut self,
11775 _cx: &mut Context<'_>,
11776 ) -> Poll<std::result::Result<(), Self::Error>> {
11777 Poll::Ready(Ok(()))
11778 }
11779 fn call(&mut self, req: http::Request<B>) -> Self::Future {
11780 match req.uri().path() {
11781 "/pidgr.v1.OrgSecurityKeysService/GetPeppers" => {
11782 #[allow(non_camel_case_types)]
11783 struct GetPeppersSvc<T: OrgSecurityKeysService>(pub Arc<T>);
11784 impl<
11785 T: OrgSecurityKeysService,
11786 > tonic::server::UnaryService<super::GetPeppersRequest>
11787 for GetPeppersSvc<T> {
11788 type Response = super::GetPeppersResponse;
11789 type Future = BoxFuture<
11790 tonic::Response<Self::Response>,
11791 tonic::Status,
11792 >;
11793 fn call(
11794 &mut self,
11795 request: tonic::Request<super::GetPeppersRequest>,
11796 ) -> Self::Future {
11797 let inner = Arc::clone(&self.0);
11798 let fut = async move {
11799 <T as OrgSecurityKeysService>::get_peppers(&inner, request)
11800 .await
11801 };
11802 Box::pin(fut)
11803 }
11804 }
11805 let accept_compression_encodings = self.accept_compression_encodings;
11806 let send_compression_encodings = self.send_compression_encodings;
11807 let max_decoding_message_size = self.max_decoding_message_size;
11808 let max_encoding_message_size = self.max_encoding_message_size;
11809 let inner = self.inner.clone();
11810 let fut = async move {
11811 let method = GetPeppersSvc(inner);
11812 let codec = tonic_prost::ProstCodec::default();
11813 let mut grpc = tonic::server::Grpc::new(codec)
11814 .apply_compression_config(
11815 accept_compression_encodings,
11816 send_compression_encodings,
11817 )
11818 .apply_max_message_size_config(
11819 max_decoding_message_size,
11820 max_encoding_message_size,
11821 );
11822 let res = grpc.unary(method, req).await;
11823 Ok(res)
11824 };
11825 Box::pin(fut)
11826 }
11827 _ => {
11828 Box::pin(async move {
11829 let mut response = http::Response::new(
11830 tonic::body::Body::default(),
11831 );
11832 let headers = response.headers_mut();
11833 headers
11834 .insert(
11835 tonic::Status::GRPC_STATUS,
11836 (tonic::Code::Unimplemented as i32).into(),
11837 );
11838 headers
11839 .insert(
11840 http::header::CONTENT_TYPE,
11841 tonic::metadata::GRPC_CONTENT_TYPE,
11842 );
11843 Ok(response)
11844 })
11845 }
11846 }
11847 }
11848 }
11849 impl<T> Clone for OrgSecurityKeysServiceServer<T> {
11850 fn clone(&self) -> Self {
11851 let inner = self.inner.clone();
11852 Self {
11853 inner,
11854 accept_compression_encodings: self.accept_compression_encodings,
11855 send_compression_encodings: self.send_compression_encodings,
11856 max_decoding_message_size: self.max_decoding_message_size,
11857 max_encoding_message_size: self.max_encoding_message_size,
11858 }
11859 }
11860 }
11861 pub const SERVICE_NAME: &str = "pidgr.v1.OrgSecurityKeysService";
11863 impl<T> tonic::server::NamedService for OrgSecurityKeysServiceServer<T> {
11864 const NAME: &'static str = SERVICE_NAME;
11865 }
11866}
11867pub mod organization_service_client {
11869 #![allow(
11870 unused_variables,
11871 dead_code,
11872 missing_docs,
11873 clippy::wildcard_imports,
11874 clippy::let_unit_value,
11875 )]
11876 use tonic::codegen::*;
11877 use tonic::codegen::http::Uri;
11878 #[derive(Debug, Clone)]
11883 pub struct OrganizationServiceClient<T> {
11884 inner: tonic::client::Grpc<T>,
11885 }
11886 impl OrganizationServiceClient<tonic::transport::Channel> {
11887 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
11889 where
11890 D: TryInto<tonic::transport::Endpoint>,
11891 D::Error: Into<StdError>,
11892 {
11893 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
11894 Ok(Self::new(conn))
11895 }
11896 }
11897 impl<T> OrganizationServiceClient<T>
11898 where
11899 T: tonic::client::GrpcService<tonic::body::Body>,
11900 T::Error: Into<StdError>,
11901 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
11902 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
11903 {
11904 pub fn new(inner: T) -> Self {
11905 let inner = tonic::client::Grpc::new(inner);
11906 Self { inner }
11907 }
11908 pub fn with_origin(inner: T, origin: Uri) -> Self {
11909 let inner = tonic::client::Grpc::with_origin(inner, origin);
11910 Self { inner }
11911 }
11912 pub fn with_interceptor<F>(
11913 inner: T,
11914 interceptor: F,
11915 ) -> OrganizationServiceClient<InterceptedService<T, F>>
11916 where
11917 F: tonic::service::Interceptor,
11918 T::ResponseBody: Default,
11919 T: tonic::codegen::Service<
11920 http::Request<tonic::body::Body>,
11921 Response = http::Response<
11922 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
11923 >,
11924 >,
11925 <T as tonic::codegen::Service<
11926 http::Request<tonic::body::Body>,
11927 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
11928 {
11929 OrganizationServiceClient::new(InterceptedService::new(inner, interceptor))
11930 }
11931 #[must_use]
11936 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11937 self.inner = self.inner.send_compressed(encoding);
11938 self
11939 }
11940 #[must_use]
11942 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11943 self.inner = self.inner.accept_compressed(encoding);
11944 self
11945 }
11946 #[must_use]
11950 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11951 self.inner = self.inner.max_decoding_message_size(limit);
11952 self
11953 }
11954 #[must_use]
11958 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11959 self.inner = self.inner.max_encoding_message_size(limit);
11960 self
11961 }
11962 pub async fn create_organization(
11967 &mut self,
11968 request: impl tonic::IntoRequest<super::CreateOrganizationRequest>,
11969 ) -> std::result::Result<
11970 tonic::Response<super::CreateOrganizationResponse>,
11971 tonic::Status,
11972 > {
11973 self.inner
11974 .ready()
11975 .await
11976 .map_err(|e| {
11977 tonic::Status::unknown(
11978 format!("Service was not ready: {}", e.into()),
11979 )
11980 })?;
11981 let codec = tonic_prost::ProstCodec::default();
11982 let path = http::uri::PathAndQuery::from_static(
11983 "/pidgr.v1.OrganizationService/CreateOrganization",
11984 );
11985 let mut req = request.into_request();
11986 req.extensions_mut()
11987 .insert(
11988 GrpcMethod::new("pidgr.v1.OrganizationService", "CreateOrganization"),
11989 );
11990 self.inner.unary(req, path, codec).await
11991 }
11992 pub async fn get_organization(
11996 &mut self,
11997 request: impl tonic::IntoRequest<super::GetOrganizationRequest>,
11998 ) -> std::result::Result<
11999 tonic::Response<super::GetOrganizationResponse>,
12000 tonic::Status,
12001 > {
12002 self.inner
12003 .ready()
12004 .await
12005 .map_err(|e| {
12006 tonic::Status::unknown(
12007 format!("Service was not ready: {}", e.into()),
12008 )
12009 })?;
12010 let codec = tonic_prost::ProstCodec::default();
12011 let path = http::uri::PathAndQuery::from_static(
12012 "/pidgr.v1.OrganizationService/GetOrganization",
12013 );
12014 let mut req = request.into_request();
12015 req.extensions_mut()
12016 .insert(
12017 GrpcMethod::new("pidgr.v1.OrganizationService", "GetOrganization"),
12018 );
12019 self.inner.unary(req, path, codec).await
12020 }
12021 pub async fn update_organization(
12025 &mut self,
12026 request: impl tonic::IntoRequest<super::UpdateOrganizationRequest>,
12027 ) -> std::result::Result<
12028 tonic::Response<super::UpdateOrganizationResponse>,
12029 tonic::Status,
12030 > {
12031 self.inner
12032 .ready()
12033 .await
12034 .map_err(|e| {
12035 tonic::Status::unknown(
12036 format!("Service was not ready: {}", e.into()),
12037 )
12038 })?;
12039 let codec = tonic_prost::ProstCodec::default();
12040 let path = http::uri::PathAndQuery::from_static(
12041 "/pidgr.v1.OrganizationService/UpdateOrganization",
12042 );
12043 let mut req = request.into_request();
12044 req.extensions_mut()
12045 .insert(
12046 GrpcMethod::new("pidgr.v1.OrganizationService", "UpdateOrganization"),
12047 );
12048 self.inner.unary(req, path, codec).await
12049 }
12050 pub async fn update_sso_attribute_mappings(
12054 &mut self,
12055 request: impl tonic::IntoRequest<super::UpdateSsoAttributeMappingsRequest>,
12056 ) -> std::result::Result<
12057 tonic::Response<super::UpdateSsoAttributeMappingsResponse>,
12058 tonic::Status,
12059 > {
12060 self.inner
12061 .ready()
12062 .await
12063 .map_err(|e| {
12064 tonic::Status::unknown(
12065 format!("Service was not ready: {}", e.into()),
12066 )
12067 })?;
12068 let codec = tonic_prost::ProstCodec::default();
12069 let path = http::uri::PathAndQuery::from_static(
12070 "/pidgr.v1.OrganizationService/UpdateSsoAttributeMappings",
12071 );
12072 let mut req = request.into_request();
12073 req.extensions_mut()
12074 .insert(
12075 GrpcMethod::new(
12076 "pidgr.v1.OrganizationService",
12077 "UpdateSsoAttributeMappings",
12078 ),
12079 );
12080 self.inner.unary(req, path, codec).await
12081 }
12082 pub async fn rotate_analytics_salt(
12086 &mut self,
12087 request: impl tonic::IntoRequest<super::RotateAnalyticsSaltRequest>,
12088 ) -> std::result::Result<
12089 tonic::Response<super::RotateAnalyticsSaltResponse>,
12090 tonic::Status,
12091 > {
12092 self.inner
12093 .ready()
12094 .await
12095 .map_err(|e| {
12096 tonic::Status::unknown(
12097 format!("Service was not ready: {}", e.into()),
12098 )
12099 })?;
12100 let codec = tonic_prost::ProstCodec::default();
12101 let path = http::uri::PathAndQuery::from_static(
12102 "/pidgr.v1.OrganizationService/RotateAnalyticsSalt",
12103 );
12104 let mut req = request.into_request();
12105 req.extensions_mut()
12106 .insert(
12107 GrpcMethod::new(
12108 "pidgr.v1.OrganizationService",
12109 "RotateAnalyticsSalt",
12110 ),
12111 );
12112 self.inner.unary(req, path, codec).await
12113 }
12114 pub async fn update_analytics_epsilon(
12118 &mut self,
12119 request: impl tonic::IntoRequest<super::UpdateAnalyticsEpsilonRequest>,
12120 ) -> std::result::Result<
12121 tonic::Response<super::UpdateAnalyticsEpsilonResponse>,
12122 tonic::Status,
12123 > {
12124 self.inner
12125 .ready()
12126 .await
12127 .map_err(|e| {
12128 tonic::Status::unknown(
12129 format!("Service was not ready: {}", e.into()),
12130 )
12131 })?;
12132 let codec = tonic_prost::ProstCodec::default();
12133 let path = http::uri::PathAndQuery::from_static(
12134 "/pidgr.v1.OrganizationService/UpdateAnalyticsEpsilon",
12135 );
12136 let mut req = request.into_request();
12137 req.extensions_mut()
12138 .insert(
12139 GrpcMethod::new(
12140 "pidgr.v1.OrganizationService",
12141 "UpdateAnalyticsEpsilon",
12142 ),
12143 );
12144 self.inner.unary(req, path, codec).await
12145 }
12146 pub async fn get_org_privacy_settings(
12152 &mut self,
12153 request: impl tonic::IntoRequest<super::GetOrgPrivacySettingsRequest>,
12154 ) -> std::result::Result<
12155 tonic::Response<super::GetOrgPrivacySettingsResponse>,
12156 tonic::Status,
12157 > {
12158 self.inner
12159 .ready()
12160 .await
12161 .map_err(|e| {
12162 tonic::Status::unknown(
12163 format!("Service was not ready: {}", e.into()),
12164 )
12165 })?;
12166 let codec = tonic_prost::ProstCodec::default();
12167 let path = http::uri::PathAndQuery::from_static(
12168 "/pidgr.v1.OrganizationService/GetOrgPrivacySettings",
12169 );
12170 let mut req = request.into_request();
12171 req.extensions_mut()
12172 .insert(
12173 GrpcMethod::new(
12174 "pidgr.v1.OrganizationService",
12175 "GetOrgPrivacySettings",
12176 ),
12177 );
12178 self.inner.unary(req, path, codec).await
12179 }
12180 pub async fn update_org_privacy_settings(
12185 &mut self,
12186 request: impl tonic::IntoRequest<super::UpdateOrgPrivacySettingsRequest>,
12187 ) -> std::result::Result<
12188 tonic::Response<super::UpdateOrgPrivacySettingsResponse>,
12189 tonic::Status,
12190 > {
12191 self.inner
12192 .ready()
12193 .await
12194 .map_err(|e| {
12195 tonic::Status::unknown(
12196 format!("Service was not ready: {}", e.into()),
12197 )
12198 })?;
12199 let codec = tonic_prost::ProstCodec::default();
12200 let path = http::uri::PathAndQuery::from_static(
12201 "/pidgr.v1.OrganizationService/UpdateOrgPrivacySettings",
12202 );
12203 let mut req = request.into_request();
12204 req.extensions_mut()
12205 .insert(
12206 GrpcMethod::new(
12207 "pidgr.v1.OrganizationService",
12208 "UpdateOrgPrivacySettings",
12209 ),
12210 );
12211 self.inner.unary(req, path, codec).await
12212 }
12213 pub async fn create_sandbox_organization(
12219 &mut self,
12220 request: impl tonic::IntoRequest<super::CreateSandboxOrganizationRequest>,
12221 ) -> std::result::Result<
12222 tonic::Response<super::CreateSandboxOrganizationResponse>,
12223 tonic::Status,
12224 > {
12225 self.inner
12226 .ready()
12227 .await
12228 .map_err(|e| {
12229 tonic::Status::unknown(
12230 format!("Service was not ready: {}", e.into()),
12231 )
12232 })?;
12233 let codec = tonic_prost::ProstCodec::default();
12234 let path = http::uri::PathAndQuery::from_static(
12235 "/pidgr.v1.OrganizationService/CreateSandboxOrganization",
12236 );
12237 let mut req = request.into_request();
12238 req.extensions_mut()
12239 .insert(
12240 GrpcMethod::new(
12241 "pidgr.v1.OrganizationService",
12242 "CreateSandboxOrganization",
12243 ),
12244 );
12245 self.inner.unary(req, path, codec).await
12246 }
12247 pub async fn delete_sandbox_organization(
12253 &mut self,
12254 request: impl tonic::IntoRequest<super::DeleteSandboxOrganizationRequest>,
12255 ) -> std::result::Result<
12256 tonic::Response<super::DeleteSandboxOrganizationResponse>,
12257 tonic::Status,
12258 > {
12259 self.inner
12260 .ready()
12261 .await
12262 .map_err(|e| {
12263 tonic::Status::unknown(
12264 format!("Service was not ready: {}", e.into()),
12265 )
12266 })?;
12267 let codec = tonic_prost::ProstCodec::default();
12268 let path = http::uri::PathAndQuery::from_static(
12269 "/pidgr.v1.OrganizationService/DeleteSandboxOrganization",
12270 );
12271 let mut req = request.into_request();
12272 req.extensions_mut()
12273 .insert(
12274 GrpcMethod::new(
12275 "pidgr.v1.OrganizationService",
12276 "DeleteSandboxOrganization",
12277 ),
12278 );
12279 self.inner.unary(req, path, codec).await
12280 }
12281 pub async fn list_sandbox_fixtures(
12287 &mut self,
12288 request: impl tonic::IntoRequest<super::ListSandboxFixturesRequest>,
12289 ) -> std::result::Result<
12290 tonic::Response<super::ListSandboxFixturesResponse>,
12291 tonic::Status,
12292 > {
12293 self.inner
12294 .ready()
12295 .await
12296 .map_err(|e| {
12297 tonic::Status::unknown(
12298 format!("Service was not ready: {}", e.into()),
12299 )
12300 })?;
12301 let codec = tonic_prost::ProstCodec::default();
12302 let path = http::uri::PathAndQuery::from_static(
12303 "/pidgr.v1.OrganizationService/ListSandboxFixtures",
12304 );
12305 let mut req = request.into_request();
12306 req.extensions_mut()
12307 .insert(
12308 GrpcMethod::new(
12309 "pidgr.v1.OrganizationService",
12310 "ListSandboxFixtures",
12311 ),
12312 );
12313 self.inner.unary(req, path, codec).await
12314 }
12315 pub async fn list_user_organizations(
12322 &mut self,
12323 request: impl tonic::IntoRequest<super::ListUserOrganizationsRequest>,
12324 ) -> std::result::Result<
12325 tonic::Response<super::ListUserOrganizationsResponse>,
12326 tonic::Status,
12327 > {
12328 self.inner
12329 .ready()
12330 .await
12331 .map_err(|e| {
12332 tonic::Status::unknown(
12333 format!("Service was not ready: {}", e.into()),
12334 )
12335 })?;
12336 let codec = tonic_prost::ProstCodec::default();
12337 let path = http::uri::PathAndQuery::from_static(
12338 "/pidgr.v1.OrganizationService/ListUserOrganizations",
12339 );
12340 let mut req = request.into_request();
12341 req.extensions_mut()
12342 .insert(
12343 GrpcMethod::new(
12344 "pidgr.v1.OrganizationService",
12345 "ListUserOrganizations",
12346 ),
12347 );
12348 self.inner.unary(req, path, codec).await
12349 }
12350 pub async fn list_user_sandboxes(
12358 &mut self,
12359 request: impl tonic::IntoRequest<super::ListUserSandboxesRequest>,
12360 ) -> std::result::Result<
12361 tonic::Response<super::ListUserSandboxesResponse>,
12362 tonic::Status,
12363 > {
12364 self.inner
12365 .ready()
12366 .await
12367 .map_err(|e| {
12368 tonic::Status::unknown(
12369 format!("Service was not ready: {}", e.into()),
12370 )
12371 })?;
12372 let codec = tonic_prost::ProstCodec::default();
12373 let path = http::uri::PathAndQuery::from_static(
12374 "/pidgr.v1.OrganizationService/ListUserSandboxes",
12375 );
12376 let mut req = request.into_request();
12377 req.extensions_mut()
12378 .insert(
12379 GrpcMethod::new("pidgr.v1.OrganizationService", "ListUserSandboxes"),
12380 );
12381 self.inner.unary(req, path, codec).await
12382 }
12383 }
12384}
12385pub mod organization_service_server {
12387 #![allow(
12388 unused_variables,
12389 dead_code,
12390 missing_docs,
12391 clippy::wildcard_imports,
12392 clippy::let_unit_value,
12393 )]
12394 use tonic::codegen::*;
12395 #[async_trait]
12397 pub trait OrganizationService: std::marker::Send + std::marker::Sync + 'static {
12398 async fn create_organization(
12403 &self,
12404 request: tonic::Request<super::CreateOrganizationRequest>,
12405 ) -> std::result::Result<
12406 tonic::Response<super::CreateOrganizationResponse>,
12407 tonic::Status,
12408 >;
12409 async fn get_organization(
12413 &self,
12414 request: tonic::Request<super::GetOrganizationRequest>,
12415 ) -> std::result::Result<
12416 tonic::Response<super::GetOrganizationResponse>,
12417 tonic::Status,
12418 >;
12419 async fn update_organization(
12423 &self,
12424 request: tonic::Request<super::UpdateOrganizationRequest>,
12425 ) -> std::result::Result<
12426 tonic::Response<super::UpdateOrganizationResponse>,
12427 tonic::Status,
12428 >;
12429 async fn update_sso_attribute_mappings(
12433 &self,
12434 request: tonic::Request<super::UpdateSsoAttributeMappingsRequest>,
12435 ) -> std::result::Result<
12436 tonic::Response<super::UpdateSsoAttributeMappingsResponse>,
12437 tonic::Status,
12438 >;
12439 async fn rotate_analytics_salt(
12443 &self,
12444 request: tonic::Request<super::RotateAnalyticsSaltRequest>,
12445 ) -> std::result::Result<
12446 tonic::Response<super::RotateAnalyticsSaltResponse>,
12447 tonic::Status,
12448 >;
12449 async fn update_analytics_epsilon(
12453 &self,
12454 request: tonic::Request<super::UpdateAnalyticsEpsilonRequest>,
12455 ) -> std::result::Result<
12456 tonic::Response<super::UpdateAnalyticsEpsilonResponse>,
12457 tonic::Status,
12458 >;
12459 async fn get_org_privacy_settings(
12465 &self,
12466 request: tonic::Request<super::GetOrgPrivacySettingsRequest>,
12467 ) -> std::result::Result<
12468 tonic::Response<super::GetOrgPrivacySettingsResponse>,
12469 tonic::Status,
12470 >;
12471 async fn update_org_privacy_settings(
12476 &self,
12477 request: tonic::Request<super::UpdateOrgPrivacySettingsRequest>,
12478 ) -> std::result::Result<
12479 tonic::Response<super::UpdateOrgPrivacySettingsResponse>,
12480 tonic::Status,
12481 >;
12482 async fn create_sandbox_organization(
12488 &self,
12489 request: tonic::Request<super::CreateSandboxOrganizationRequest>,
12490 ) -> std::result::Result<
12491 tonic::Response<super::CreateSandboxOrganizationResponse>,
12492 tonic::Status,
12493 >;
12494 async fn delete_sandbox_organization(
12500 &self,
12501 request: tonic::Request<super::DeleteSandboxOrganizationRequest>,
12502 ) -> std::result::Result<
12503 tonic::Response<super::DeleteSandboxOrganizationResponse>,
12504 tonic::Status,
12505 >;
12506 async fn list_sandbox_fixtures(
12512 &self,
12513 request: tonic::Request<super::ListSandboxFixturesRequest>,
12514 ) -> std::result::Result<
12515 tonic::Response<super::ListSandboxFixturesResponse>,
12516 tonic::Status,
12517 >;
12518 async fn list_user_organizations(
12525 &self,
12526 request: tonic::Request<super::ListUserOrganizationsRequest>,
12527 ) -> std::result::Result<
12528 tonic::Response<super::ListUserOrganizationsResponse>,
12529 tonic::Status,
12530 >;
12531 async fn list_user_sandboxes(
12539 &self,
12540 request: tonic::Request<super::ListUserSandboxesRequest>,
12541 ) -> std::result::Result<
12542 tonic::Response<super::ListUserSandboxesResponse>,
12543 tonic::Status,
12544 >;
12545 }
12546 #[derive(Debug)]
12551 pub struct OrganizationServiceServer<T> {
12552 inner: Arc<T>,
12553 accept_compression_encodings: EnabledCompressionEncodings,
12554 send_compression_encodings: EnabledCompressionEncodings,
12555 max_decoding_message_size: Option<usize>,
12556 max_encoding_message_size: Option<usize>,
12557 }
12558 impl<T> OrganizationServiceServer<T> {
12559 pub fn new(inner: T) -> Self {
12560 Self::from_arc(Arc::new(inner))
12561 }
12562 pub fn from_arc(inner: Arc<T>) -> Self {
12563 Self {
12564 inner,
12565 accept_compression_encodings: Default::default(),
12566 send_compression_encodings: Default::default(),
12567 max_decoding_message_size: None,
12568 max_encoding_message_size: None,
12569 }
12570 }
12571 pub fn with_interceptor<F>(
12572 inner: T,
12573 interceptor: F,
12574 ) -> InterceptedService<Self, F>
12575 where
12576 F: tonic::service::Interceptor,
12577 {
12578 InterceptedService::new(Self::new(inner), interceptor)
12579 }
12580 #[must_use]
12582 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
12583 self.accept_compression_encodings.enable(encoding);
12584 self
12585 }
12586 #[must_use]
12588 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
12589 self.send_compression_encodings.enable(encoding);
12590 self
12591 }
12592 #[must_use]
12596 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
12597 self.max_decoding_message_size = Some(limit);
12598 self
12599 }
12600 #[must_use]
12604 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
12605 self.max_encoding_message_size = Some(limit);
12606 self
12607 }
12608 }
12609 impl<T, B> tonic::codegen::Service<http::Request<B>> for OrganizationServiceServer<T>
12610 where
12611 T: OrganizationService,
12612 B: Body + std::marker::Send + 'static,
12613 B::Error: Into<StdError> + std::marker::Send + 'static,
12614 {
12615 type Response = http::Response<tonic::body::Body>;
12616 type Error = std::convert::Infallible;
12617 type Future = BoxFuture<Self::Response, Self::Error>;
12618 fn poll_ready(
12619 &mut self,
12620 _cx: &mut Context<'_>,
12621 ) -> Poll<std::result::Result<(), Self::Error>> {
12622 Poll::Ready(Ok(()))
12623 }
12624 fn call(&mut self, req: http::Request<B>) -> Self::Future {
12625 match req.uri().path() {
12626 "/pidgr.v1.OrganizationService/CreateOrganization" => {
12627 #[allow(non_camel_case_types)]
12628 struct CreateOrganizationSvc<T: OrganizationService>(pub Arc<T>);
12629 impl<
12630 T: OrganizationService,
12631 > tonic::server::UnaryService<super::CreateOrganizationRequest>
12632 for CreateOrganizationSvc<T> {
12633 type Response = super::CreateOrganizationResponse;
12634 type Future = BoxFuture<
12635 tonic::Response<Self::Response>,
12636 tonic::Status,
12637 >;
12638 fn call(
12639 &mut self,
12640 request: tonic::Request<super::CreateOrganizationRequest>,
12641 ) -> Self::Future {
12642 let inner = Arc::clone(&self.0);
12643 let fut = async move {
12644 <T as OrganizationService>::create_organization(
12645 &inner,
12646 request,
12647 )
12648 .await
12649 };
12650 Box::pin(fut)
12651 }
12652 }
12653 let accept_compression_encodings = self.accept_compression_encodings;
12654 let send_compression_encodings = self.send_compression_encodings;
12655 let max_decoding_message_size = self.max_decoding_message_size;
12656 let max_encoding_message_size = self.max_encoding_message_size;
12657 let inner = self.inner.clone();
12658 let fut = async move {
12659 let method = CreateOrganizationSvc(inner);
12660 let codec = tonic_prost::ProstCodec::default();
12661 let mut grpc = tonic::server::Grpc::new(codec)
12662 .apply_compression_config(
12663 accept_compression_encodings,
12664 send_compression_encodings,
12665 )
12666 .apply_max_message_size_config(
12667 max_decoding_message_size,
12668 max_encoding_message_size,
12669 );
12670 let res = grpc.unary(method, req).await;
12671 Ok(res)
12672 };
12673 Box::pin(fut)
12674 }
12675 "/pidgr.v1.OrganizationService/GetOrganization" => {
12676 #[allow(non_camel_case_types)]
12677 struct GetOrganizationSvc<T: OrganizationService>(pub Arc<T>);
12678 impl<
12679 T: OrganizationService,
12680 > tonic::server::UnaryService<super::GetOrganizationRequest>
12681 for GetOrganizationSvc<T> {
12682 type Response = super::GetOrganizationResponse;
12683 type Future = BoxFuture<
12684 tonic::Response<Self::Response>,
12685 tonic::Status,
12686 >;
12687 fn call(
12688 &mut self,
12689 request: tonic::Request<super::GetOrganizationRequest>,
12690 ) -> Self::Future {
12691 let inner = Arc::clone(&self.0);
12692 let fut = async move {
12693 <T as OrganizationService>::get_organization(
12694 &inner,
12695 request,
12696 )
12697 .await
12698 };
12699 Box::pin(fut)
12700 }
12701 }
12702 let accept_compression_encodings = self.accept_compression_encodings;
12703 let send_compression_encodings = self.send_compression_encodings;
12704 let max_decoding_message_size = self.max_decoding_message_size;
12705 let max_encoding_message_size = self.max_encoding_message_size;
12706 let inner = self.inner.clone();
12707 let fut = async move {
12708 let method = GetOrganizationSvc(inner);
12709 let codec = tonic_prost::ProstCodec::default();
12710 let mut grpc = tonic::server::Grpc::new(codec)
12711 .apply_compression_config(
12712 accept_compression_encodings,
12713 send_compression_encodings,
12714 )
12715 .apply_max_message_size_config(
12716 max_decoding_message_size,
12717 max_encoding_message_size,
12718 );
12719 let res = grpc.unary(method, req).await;
12720 Ok(res)
12721 };
12722 Box::pin(fut)
12723 }
12724 "/pidgr.v1.OrganizationService/UpdateOrganization" => {
12725 #[allow(non_camel_case_types)]
12726 struct UpdateOrganizationSvc<T: OrganizationService>(pub Arc<T>);
12727 impl<
12728 T: OrganizationService,
12729 > tonic::server::UnaryService<super::UpdateOrganizationRequest>
12730 for UpdateOrganizationSvc<T> {
12731 type Response = super::UpdateOrganizationResponse;
12732 type Future = BoxFuture<
12733 tonic::Response<Self::Response>,
12734 tonic::Status,
12735 >;
12736 fn call(
12737 &mut self,
12738 request: tonic::Request<super::UpdateOrganizationRequest>,
12739 ) -> Self::Future {
12740 let inner = Arc::clone(&self.0);
12741 let fut = async move {
12742 <T as OrganizationService>::update_organization(
12743 &inner,
12744 request,
12745 )
12746 .await
12747 };
12748 Box::pin(fut)
12749 }
12750 }
12751 let accept_compression_encodings = self.accept_compression_encodings;
12752 let send_compression_encodings = self.send_compression_encodings;
12753 let max_decoding_message_size = self.max_decoding_message_size;
12754 let max_encoding_message_size = self.max_encoding_message_size;
12755 let inner = self.inner.clone();
12756 let fut = async move {
12757 let method = UpdateOrganizationSvc(inner);
12758 let codec = tonic_prost::ProstCodec::default();
12759 let mut grpc = tonic::server::Grpc::new(codec)
12760 .apply_compression_config(
12761 accept_compression_encodings,
12762 send_compression_encodings,
12763 )
12764 .apply_max_message_size_config(
12765 max_decoding_message_size,
12766 max_encoding_message_size,
12767 );
12768 let res = grpc.unary(method, req).await;
12769 Ok(res)
12770 };
12771 Box::pin(fut)
12772 }
12773 "/pidgr.v1.OrganizationService/UpdateSsoAttributeMappings" => {
12774 #[allow(non_camel_case_types)]
12775 struct UpdateSsoAttributeMappingsSvc<T: OrganizationService>(
12776 pub Arc<T>,
12777 );
12778 impl<
12779 T: OrganizationService,
12780 > tonic::server::UnaryService<
12781 super::UpdateSsoAttributeMappingsRequest,
12782 > for UpdateSsoAttributeMappingsSvc<T> {
12783 type Response = super::UpdateSsoAttributeMappingsResponse;
12784 type Future = BoxFuture<
12785 tonic::Response<Self::Response>,
12786 tonic::Status,
12787 >;
12788 fn call(
12789 &mut self,
12790 request: tonic::Request<
12791 super::UpdateSsoAttributeMappingsRequest,
12792 >,
12793 ) -> Self::Future {
12794 let inner = Arc::clone(&self.0);
12795 let fut = async move {
12796 <T as OrganizationService>::update_sso_attribute_mappings(
12797 &inner,
12798 request,
12799 )
12800 .await
12801 };
12802 Box::pin(fut)
12803 }
12804 }
12805 let accept_compression_encodings = self.accept_compression_encodings;
12806 let send_compression_encodings = self.send_compression_encodings;
12807 let max_decoding_message_size = self.max_decoding_message_size;
12808 let max_encoding_message_size = self.max_encoding_message_size;
12809 let inner = self.inner.clone();
12810 let fut = async move {
12811 let method = UpdateSsoAttributeMappingsSvc(inner);
12812 let codec = tonic_prost::ProstCodec::default();
12813 let mut grpc = tonic::server::Grpc::new(codec)
12814 .apply_compression_config(
12815 accept_compression_encodings,
12816 send_compression_encodings,
12817 )
12818 .apply_max_message_size_config(
12819 max_decoding_message_size,
12820 max_encoding_message_size,
12821 );
12822 let res = grpc.unary(method, req).await;
12823 Ok(res)
12824 };
12825 Box::pin(fut)
12826 }
12827 "/pidgr.v1.OrganizationService/RotateAnalyticsSalt" => {
12828 #[allow(non_camel_case_types)]
12829 struct RotateAnalyticsSaltSvc<T: OrganizationService>(pub Arc<T>);
12830 impl<
12831 T: OrganizationService,
12832 > tonic::server::UnaryService<super::RotateAnalyticsSaltRequest>
12833 for RotateAnalyticsSaltSvc<T> {
12834 type Response = super::RotateAnalyticsSaltResponse;
12835 type Future = BoxFuture<
12836 tonic::Response<Self::Response>,
12837 tonic::Status,
12838 >;
12839 fn call(
12840 &mut self,
12841 request: tonic::Request<super::RotateAnalyticsSaltRequest>,
12842 ) -> Self::Future {
12843 let inner = Arc::clone(&self.0);
12844 let fut = async move {
12845 <T as OrganizationService>::rotate_analytics_salt(
12846 &inner,
12847 request,
12848 )
12849 .await
12850 };
12851 Box::pin(fut)
12852 }
12853 }
12854 let accept_compression_encodings = self.accept_compression_encodings;
12855 let send_compression_encodings = self.send_compression_encodings;
12856 let max_decoding_message_size = self.max_decoding_message_size;
12857 let max_encoding_message_size = self.max_encoding_message_size;
12858 let inner = self.inner.clone();
12859 let fut = async move {
12860 let method = RotateAnalyticsSaltSvc(inner);
12861 let codec = tonic_prost::ProstCodec::default();
12862 let mut grpc = tonic::server::Grpc::new(codec)
12863 .apply_compression_config(
12864 accept_compression_encodings,
12865 send_compression_encodings,
12866 )
12867 .apply_max_message_size_config(
12868 max_decoding_message_size,
12869 max_encoding_message_size,
12870 );
12871 let res = grpc.unary(method, req).await;
12872 Ok(res)
12873 };
12874 Box::pin(fut)
12875 }
12876 "/pidgr.v1.OrganizationService/UpdateAnalyticsEpsilon" => {
12877 #[allow(non_camel_case_types)]
12878 struct UpdateAnalyticsEpsilonSvc<T: OrganizationService>(pub Arc<T>);
12879 impl<
12880 T: OrganizationService,
12881 > tonic::server::UnaryService<super::UpdateAnalyticsEpsilonRequest>
12882 for UpdateAnalyticsEpsilonSvc<T> {
12883 type Response = super::UpdateAnalyticsEpsilonResponse;
12884 type Future = BoxFuture<
12885 tonic::Response<Self::Response>,
12886 tonic::Status,
12887 >;
12888 fn call(
12889 &mut self,
12890 request: tonic::Request<super::UpdateAnalyticsEpsilonRequest>,
12891 ) -> Self::Future {
12892 let inner = Arc::clone(&self.0);
12893 let fut = async move {
12894 <T as OrganizationService>::update_analytics_epsilon(
12895 &inner,
12896 request,
12897 )
12898 .await
12899 };
12900 Box::pin(fut)
12901 }
12902 }
12903 let accept_compression_encodings = self.accept_compression_encodings;
12904 let send_compression_encodings = self.send_compression_encodings;
12905 let max_decoding_message_size = self.max_decoding_message_size;
12906 let max_encoding_message_size = self.max_encoding_message_size;
12907 let inner = self.inner.clone();
12908 let fut = async move {
12909 let method = UpdateAnalyticsEpsilonSvc(inner);
12910 let codec = tonic_prost::ProstCodec::default();
12911 let mut grpc = tonic::server::Grpc::new(codec)
12912 .apply_compression_config(
12913 accept_compression_encodings,
12914 send_compression_encodings,
12915 )
12916 .apply_max_message_size_config(
12917 max_decoding_message_size,
12918 max_encoding_message_size,
12919 );
12920 let res = grpc.unary(method, req).await;
12921 Ok(res)
12922 };
12923 Box::pin(fut)
12924 }
12925 "/pidgr.v1.OrganizationService/GetOrgPrivacySettings" => {
12926 #[allow(non_camel_case_types)]
12927 struct GetOrgPrivacySettingsSvc<T: OrganizationService>(pub Arc<T>);
12928 impl<
12929 T: OrganizationService,
12930 > tonic::server::UnaryService<super::GetOrgPrivacySettingsRequest>
12931 for GetOrgPrivacySettingsSvc<T> {
12932 type Response = super::GetOrgPrivacySettingsResponse;
12933 type Future = BoxFuture<
12934 tonic::Response<Self::Response>,
12935 tonic::Status,
12936 >;
12937 fn call(
12938 &mut self,
12939 request: tonic::Request<super::GetOrgPrivacySettingsRequest>,
12940 ) -> Self::Future {
12941 let inner = Arc::clone(&self.0);
12942 let fut = async move {
12943 <T as OrganizationService>::get_org_privacy_settings(
12944 &inner,
12945 request,
12946 )
12947 .await
12948 };
12949 Box::pin(fut)
12950 }
12951 }
12952 let accept_compression_encodings = self.accept_compression_encodings;
12953 let send_compression_encodings = self.send_compression_encodings;
12954 let max_decoding_message_size = self.max_decoding_message_size;
12955 let max_encoding_message_size = self.max_encoding_message_size;
12956 let inner = self.inner.clone();
12957 let fut = async move {
12958 let method = GetOrgPrivacySettingsSvc(inner);
12959 let codec = tonic_prost::ProstCodec::default();
12960 let mut grpc = tonic::server::Grpc::new(codec)
12961 .apply_compression_config(
12962 accept_compression_encodings,
12963 send_compression_encodings,
12964 )
12965 .apply_max_message_size_config(
12966 max_decoding_message_size,
12967 max_encoding_message_size,
12968 );
12969 let res = grpc.unary(method, req).await;
12970 Ok(res)
12971 };
12972 Box::pin(fut)
12973 }
12974 "/pidgr.v1.OrganizationService/UpdateOrgPrivacySettings" => {
12975 #[allow(non_camel_case_types)]
12976 struct UpdateOrgPrivacySettingsSvc<T: OrganizationService>(
12977 pub Arc<T>,
12978 );
12979 impl<
12980 T: OrganizationService,
12981 > tonic::server::UnaryService<super::UpdateOrgPrivacySettingsRequest>
12982 for UpdateOrgPrivacySettingsSvc<T> {
12983 type Response = super::UpdateOrgPrivacySettingsResponse;
12984 type Future = BoxFuture<
12985 tonic::Response<Self::Response>,
12986 tonic::Status,
12987 >;
12988 fn call(
12989 &mut self,
12990 request: tonic::Request<
12991 super::UpdateOrgPrivacySettingsRequest,
12992 >,
12993 ) -> Self::Future {
12994 let inner = Arc::clone(&self.0);
12995 let fut = async move {
12996 <T as OrganizationService>::update_org_privacy_settings(
12997 &inner,
12998 request,
12999 )
13000 .await
13001 };
13002 Box::pin(fut)
13003 }
13004 }
13005 let accept_compression_encodings = self.accept_compression_encodings;
13006 let send_compression_encodings = self.send_compression_encodings;
13007 let max_decoding_message_size = self.max_decoding_message_size;
13008 let max_encoding_message_size = self.max_encoding_message_size;
13009 let inner = self.inner.clone();
13010 let fut = async move {
13011 let method = UpdateOrgPrivacySettingsSvc(inner);
13012 let codec = tonic_prost::ProstCodec::default();
13013 let mut grpc = tonic::server::Grpc::new(codec)
13014 .apply_compression_config(
13015 accept_compression_encodings,
13016 send_compression_encodings,
13017 )
13018 .apply_max_message_size_config(
13019 max_decoding_message_size,
13020 max_encoding_message_size,
13021 );
13022 let res = grpc.unary(method, req).await;
13023 Ok(res)
13024 };
13025 Box::pin(fut)
13026 }
13027 "/pidgr.v1.OrganizationService/CreateSandboxOrganization" => {
13028 #[allow(non_camel_case_types)]
13029 struct CreateSandboxOrganizationSvc<T: OrganizationService>(
13030 pub Arc<T>,
13031 );
13032 impl<
13033 T: OrganizationService,
13034 > tonic::server::UnaryService<
13035 super::CreateSandboxOrganizationRequest,
13036 > for CreateSandboxOrganizationSvc<T> {
13037 type Response = super::CreateSandboxOrganizationResponse;
13038 type Future = BoxFuture<
13039 tonic::Response<Self::Response>,
13040 tonic::Status,
13041 >;
13042 fn call(
13043 &mut self,
13044 request: tonic::Request<
13045 super::CreateSandboxOrganizationRequest,
13046 >,
13047 ) -> Self::Future {
13048 let inner = Arc::clone(&self.0);
13049 let fut = async move {
13050 <T as OrganizationService>::create_sandbox_organization(
13051 &inner,
13052 request,
13053 )
13054 .await
13055 };
13056 Box::pin(fut)
13057 }
13058 }
13059 let accept_compression_encodings = self.accept_compression_encodings;
13060 let send_compression_encodings = self.send_compression_encodings;
13061 let max_decoding_message_size = self.max_decoding_message_size;
13062 let max_encoding_message_size = self.max_encoding_message_size;
13063 let inner = self.inner.clone();
13064 let fut = async move {
13065 let method = CreateSandboxOrganizationSvc(inner);
13066 let codec = tonic_prost::ProstCodec::default();
13067 let mut grpc = tonic::server::Grpc::new(codec)
13068 .apply_compression_config(
13069 accept_compression_encodings,
13070 send_compression_encodings,
13071 )
13072 .apply_max_message_size_config(
13073 max_decoding_message_size,
13074 max_encoding_message_size,
13075 );
13076 let res = grpc.unary(method, req).await;
13077 Ok(res)
13078 };
13079 Box::pin(fut)
13080 }
13081 "/pidgr.v1.OrganizationService/DeleteSandboxOrganization" => {
13082 #[allow(non_camel_case_types)]
13083 struct DeleteSandboxOrganizationSvc<T: OrganizationService>(
13084 pub Arc<T>,
13085 );
13086 impl<
13087 T: OrganizationService,
13088 > tonic::server::UnaryService<
13089 super::DeleteSandboxOrganizationRequest,
13090 > for DeleteSandboxOrganizationSvc<T> {
13091 type Response = super::DeleteSandboxOrganizationResponse;
13092 type Future = BoxFuture<
13093 tonic::Response<Self::Response>,
13094 tonic::Status,
13095 >;
13096 fn call(
13097 &mut self,
13098 request: tonic::Request<
13099 super::DeleteSandboxOrganizationRequest,
13100 >,
13101 ) -> Self::Future {
13102 let inner = Arc::clone(&self.0);
13103 let fut = async move {
13104 <T as OrganizationService>::delete_sandbox_organization(
13105 &inner,
13106 request,
13107 )
13108 .await
13109 };
13110 Box::pin(fut)
13111 }
13112 }
13113 let accept_compression_encodings = self.accept_compression_encodings;
13114 let send_compression_encodings = self.send_compression_encodings;
13115 let max_decoding_message_size = self.max_decoding_message_size;
13116 let max_encoding_message_size = self.max_encoding_message_size;
13117 let inner = self.inner.clone();
13118 let fut = async move {
13119 let method = DeleteSandboxOrganizationSvc(inner);
13120 let codec = tonic_prost::ProstCodec::default();
13121 let mut grpc = tonic::server::Grpc::new(codec)
13122 .apply_compression_config(
13123 accept_compression_encodings,
13124 send_compression_encodings,
13125 )
13126 .apply_max_message_size_config(
13127 max_decoding_message_size,
13128 max_encoding_message_size,
13129 );
13130 let res = grpc.unary(method, req).await;
13131 Ok(res)
13132 };
13133 Box::pin(fut)
13134 }
13135 "/pidgr.v1.OrganizationService/ListSandboxFixtures" => {
13136 #[allow(non_camel_case_types)]
13137 struct ListSandboxFixturesSvc<T: OrganizationService>(pub Arc<T>);
13138 impl<
13139 T: OrganizationService,
13140 > tonic::server::UnaryService<super::ListSandboxFixturesRequest>
13141 for ListSandboxFixturesSvc<T> {
13142 type Response = super::ListSandboxFixturesResponse;
13143 type Future = BoxFuture<
13144 tonic::Response<Self::Response>,
13145 tonic::Status,
13146 >;
13147 fn call(
13148 &mut self,
13149 request: tonic::Request<super::ListSandboxFixturesRequest>,
13150 ) -> Self::Future {
13151 let inner = Arc::clone(&self.0);
13152 let fut = async move {
13153 <T as OrganizationService>::list_sandbox_fixtures(
13154 &inner,
13155 request,
13156 )
13157 .await
13158 };
13159 Box::pin(fut)
13160 }
13161 }
13162 let accept_compression_encodings = self.accept_compression_encodings;
13163 let send_compression_encodings = self.send_compression_encodings;
13164 let max_decoding_message_size = self.max_decoding_message_size;
13165 let max_encoding_message_size = self.max_encoding_message_size;
13166 let inner = self.inner.clone();
13167 let fut = async move {
13168 let method = ListSandboxFixturesSvc(inner);
13169 let codec = tonic_prost::ProstCodec::default();
13170 let mut grpc = tonic::server::Grpc::new(codec)
13171 .apply_compression_config(
13172 accept_compression_encodings,
13173 send_compression_encodings,
13174 )
13175 .apply_max_message_size_config(
13176 max_decoding_message_size,
13177 max_encoding_message_size,
13178 );
13179 let res = grpc.unary(method, req).await;
13180 Ok(res)
13181 };
13182 Box::pin(fut)
13183 }
13184 "/pidgr.v1.OrganizationService/ListUserOrganizations" => {
13185 #[allow(non_camel_case_types)]
13186 struct ListUserOrganizationsSvc<T: OrganizationService>(pub Arc<T>);
13187 impl<
13188 T: OrganizationService,
13189 > tonic::server::UnaryService<super::ListUserOrganizationsRequest>
13190 for ListUserOrganizationsSvc<T> {
13191 type Response = super::ListUserOrganizationsResponse;
13192 type Future = BoxFuture<
13193 tonic::Response<Self::Response>,
13194 tonic::Status,
13195 >;
13196 fn call(
13197 &mut self,
13198 request: tonic::Request<super::ListUserOrganizationsRequest>,
13199 ) -> Self::Future {
13200 let inner = Arc::clone(&self.0);
13201 let fut = async move {
13202 <T as OrganizationService>::list_user_organizations(
13203 &inner,
13204 request,
13205 )
13206 .await
13207 };
13208 Box::pin(fut)
13209 }
13210 }
13211 let accept_compression_encodings = self.accept_compression_encodings;
13212 let send_compression_encodings = self.send_compression_encodings;
13213 let max_decoding_message_size = self.max_decoding_message_size;
13214 let max_encoding_message_size = self.max_encoding_message_size;
13215 let inner = self.inner.clone();
13216 let fut = async move {
13217 let method = ListUserOrganizationsSvc(inner);
13218 let codec = tonic_prost::ProstCodec::default();
13219 let mut grpc = tonic::server::Grpc::new(codec)
13220 .apply_compression_config(
13221 accept_compression_encodings,
13222 send_compression_encodings,
13223 )
13224 .apply_max_message_size_config(
13225 max_decoding_message_size,
13226 max_encoding_message_size,
13227 );
13228 let res = grpc.unary(method, req).await;
13229 Ok(res)
13230 };
13231 Box::pin(fut)
13232 }
13233 "/pidgr.v1.OrganizationService/ListUserSandboxes" => {
13234 #[allow(non_camel_case_types)]
13235 struct ListUserSandboxesSvc<T: OrganizationService>(pub Arc<T>);
13236 impl<
13237 T: OrganizationService,
13238 > tonic::server::UnaryService<super::ListUserSandboxesRequest>
13239 for ListUserSandboxesSvc<T> {
13240 type Response = super::ListUserSandboxesResponse;
13241 type Future = BoxFuture<
13242 tonic::Response<Self::Response>,
13243 tonic::Status,
13244 >;
13245 fn call(
13246 &mut self,
13247 request: tonic::Request<super::ListUserSandboxesRequest>,
13248 ) -> Self::Future {
13249 let inner = Arc::clone(&self.0);
13250 let fut = async move {
13251 <T as OrganizationService>::list_user_sandboxes(
13252 &inner,
13253 request,
13254 )
13255 .await
13256 };
13257 Box::pin(fut)
13258 }
13259 }
13260 let accept_compression_encodings = self.accept_compression_encodings;
13261 let send_compression_encodings = self.send_compression_encodings;
13262 let max_decoding_message_size = self.max_decoding_message_size;
13263 let max_encoding_message_size = self.max_encoding_message_size;
13264 let inner = self.inner.clone();
13265 let fut = async move {
13266 let method = ListUserSandboxesSvc(inner);
13267 let codec = tonic_prost::ProstCodec::default();
13268 let mut grpc = tonic::server::Grpc::new(codec)
13269 .apply_compression_config(
13270 accept_compression_encodings,
13271 send_compression_encodings,
13272 )
13273 .apply_max_message_size_config(
13274 max_decoding_message_size,
13275 max_encoding_message_size,
13276 );
13277 let res = grpc.unary(method, req).await;
13278 Ok(res)
13279 };
13280 Box::pin(fut)
13281 }
13282 _ => {
13283 Box::pin(async move {
13284 let mut response = http::Response::new(
13285 tonic::body::Body::default(),
13286 );
13287 let headers = response.headers_mut();
13288 headers
13289 .insert(
13290 tonic::Status::GRPC_STATUS,
13291 (tonic::Code::Unimplemented as i32).into(),
13292 );
13293 headers
13294 .insert(
13295 http::header::CONTENT_TYPE,
13296 tonic::metadata::GRPC_CONTENT_TYPE,
13297 );
13298 Ok(response)
13299 })
13300 }
13301 }
13302 }
13303 }
13304 impl<T> Clone for OrganizationServiceServer<T> {
13305 fn clone(&self) -> Self {
13306 let inner = self.inner.clone();
13307 Self {
13308 inner,
13309 accept_compression_encodings: self.accept_compression_encodings,
13310 send_compression_encodings: self.send_compression_encodings,
13311 max_decoding_message_size: self.max_decoding_message_size,
13312 max_encoding_message_size: self.max_encoding_message_size,
13313 }
13314 }
13315 }
13316 pub const SERVICE_NAME: &str = "pidgr.v1.OrganizationService";
13318 impl<T> tonic::server::NamedService for OrganizationServiceServer<T> {
13319 const NAME: &'static str = SERVICE_NAME;
13320 }
13321}
13322pub mod render_service_client {
13324 #![allow(
13325 unused_variables,
13326 dead_code,
13327 missing_docs,
13328 clippy::wildcard_imports,
13329 clippy::let_unit_value,
13330 )]
13331 use tonic::codegen::*;
13332 use tonic::codegen::http::Uri;
13333 #[derive(Debug, Clone)]
13336 pub struct RenderServiceClient<T> {
13337 inner: tonic::client::Grpc<T>,
13338 }
13339 impl RenderServiceClient<tonic::transport::Channel> {
13340 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
13342 where
13343 D: TryInto<tonic::transport::Endpoint>,
13344 D::Error: Into<StdError>,
13345 {
13346 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
13347 Ok(Self::new(conn))
13348 }
13349 }
13350 impl<T> RenderServiceClient<T>
13351 where
13352 T: tonic::client::GrpcService<tonic::body::Body>,
13353 T::Error: Into<StdError>,
13354 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
13355 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
13356 {
13357 pub fn new(inner: T) -> Self {
13358 let inner = tonic::client::Grpc::new(inner);
13359 Self { inner }
13360 }
13361 pub fn with_origin(inner: T, origin: Uri) -> Self {
13362 let inner = tonic::client::Grpc::with_origin(inner, origin);
13363 Self { inner }
13364 }
13365 pub fn with_interceptor<F>(
13366 inner: T,
13367 interceptor: F,
13368 ) -> RenderServiceClient<InterceptedService<T, F>>
13369 where
13370 F: tonic::service::Interceptor,
13371 T::ResponseBody: Default,
13372 T: tonic::codegen::Service<
13373 http::Request<tonic::body::Body>,
13374 Response = http::Response<
13375 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
13376 >,
13377 >,
13378 <T as tonic::codegen::Service<
13379 http::Request<tonic::body::Body>,
13380 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
13381 {
13382 RenderServiceClient::new(InterceptedService::new(inner, interceptor))
13383 }
13384 #[must_use]
13389 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13390 self.inner = self.inner.send_compressed(encoding);
13391 self
13392 }
13393 #[must_use]
13395 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13396 self.inner = self.inner.accept_compressed(encoding);
13397 self
13398 }
13399 #[must_use]
13403 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13404 self.inner = self.inner.max_decoding_message_size(limit);
13405 self
13406 }
13407 #[must_use]
13411 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13412 self.inner = self.inner.max_encoding_message_size(limit);
13413 self
13414 }
13415 pub async fn render_batch(
13419 &mut self,
13420 request: impl tonic::IntoRequest<super::RenderBatchRequest>,
13421 ) -> std::result::Result<
13422 tonic::Response<tonic::codec::Streaming<super::RenderBatchResponse>>,
13423 tonic::Status,
13424 > {
13425 self.inner
13426 .ready()
13427 .await
13428 .map_err(|e| {
13429 tonic::Status::unknown(
13430 format!("Service was not ready: {}", e.into()),
13431 )
13432 })?;
13433 let codec = tonic_prost::ProstCodec::default();
13434 let path = http::uri::PathAndQuery::from_static(
13435 "/pidgr.v1.RenderService/RenderBatch",
13436 );
13437 let mut req = request.into_request();
13438 req.extensions_mut()
13439 .insert(GrpcMethod::new("pidgr.v1.RenderService", "RenderBatch"));
13440 self.inner.server_streaming(req, path, codec).await
13441 }
13442 }
13443}
13444pub mod render_service_server {
13446 #![allow(
13447 unused_variables,
13448 dead_code,
13449 missing_docs,
13450 clippy::wildcard_imports,
13451 clippy::let_unit_value,
13452 )]
13453 use tonic::codegen::*;
13454 #[async_trait]
13456 pub trait RenderService: std::marker::Send + std::marker::Sync + 'static {
13457 type RenderBatchStream: tonic::codegen::tokio_stream::Stream<
13459 Item = std::result::Result<super::RenderBatchResponse, tonic::Status>,
13460 >
13461 + std::marker::Send
13462 + 'static;
13463 async fn render_batch(
13467 &self,
13468 request: tonic::Request<super::RenderBatchRequest>,
13469 ) -> std::result::Result<
13470 tonic::Response<Self::RenderBatchStream>,
13471 tonic::Status,
13472 >;
13473 }
13474 #[derive(Debug)]
13477 pub struct RenderServiceServer<T> {
13478 inner: Arc<T>,
13479 accept_compression_encodings: EnabledCompressionEncodings,
13480 send_compression_encodings: EnabledCompressionEncodings,
13481 max_decoding_message_size: Option<usize>,
13482 max_encoding_message_size: Option<usize>,
13483 }
13484 impl<T> RenderServiceServer<T> {
13485 pub fn new(inner: T) -> Self {
13486 Self::from_arc(Arc::new(inner))
13487 }
13488 pub fn from_arc(inner: Arc<T>) -> Self {
13489 Self {
13490 inner,
13491 accept_compression_encodings: Default::default(),
13492 send_compression_encodings: Default::default(),
13493 max_decoding_message_size: None,
13494 max_encoding_message_size: None,
13495 }
13496 }
13497 pub fn with_interceptor<F>(
13498 inner: T,
13499 interceptor: F,
13500 ) -> InterceptedService<Self, F>
13501 where
13502 F: tonic::service::Interceptor,
13503 {
13504 InterceptedService::new(Self::new(inner), interceptor)
13505 }
13506 #[must_use]
13508 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13509 self.accept_compression_encodings.enable(encoding);
13510 self
13511 }
13512 #[must_use]
13514 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13515 self.send_compression_encodings.enable(encoding);
13516 self
13517 }
13518 #[must_use]
13522 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13523 self.max_decoding_message_size = Some(limit);
13524 self
13525 }
13526 #[must_use]
13530 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13531 self.max_encoding_message_size = Some(limit);
13532 self
13533 }
13534 }
13535 impl<T, B> tonic::codegen::Service<http::Request<B>> for RenderServiceServer<T>
13536 where
13537 T: RenderService,
13538 B: Body + std::marker::Send + 'static,
13539 B::Error: Into<StdError> + std::marker::Send + 'static,
13540 {
13541 type Response = http::Response<tonic::body::Body>;
13542 type Error = std::convert::Infallible;
13543 type Future = BoxFuture<Self::Response, Self::Error>;
13544 fn poll_ready(
13545 &mut self,
13546 _cx: &mut Context<'_>,
13547 ) -> Poll<std::result::Result<(), Self::Error>> {
13548 Poll::Ready(Ok(()))
13549 }
13550 fn call(&mut self, req: http::Request<B>) -> Self::Future {
13551 match req.uri().path() {
13552 "/pidgr.v1.RenderService/RenderBatch" => {
13553 #[allow(non_camel_case_types)]
13554 struct RenderBatchSvc<T: RenderService>(pub Arc<T>);
13555 impl<
13556 T: RenderService,
13557 > tonic::server::ServerStreamingService<super::RenderBatchRequest>
13558 for RenderBatchSvc<T> {
13559 type Response = super::RenderBatchResponse;
13560 type ResponseStream = T::RenderBatchStream;
13561 type Future = BoxFuture<
13562 tonic::Response<Self::ResponseStream>,
13563 tonic::Status,
13564 >;
13565 fn call(
13566 &mut self,
13567 request: tonic::Request<super::RenderBatchRequest>,
13568 ) -> Self::Future {
13569 let inner = Arc::clone(&self.0);
13570 let fut = async move {
13571 <T as RenderService>::render_batch(&inner, request).await
13572 };
13573 Box::pin(fut)
13574 }
13575 }
13576 let accept_compression_encodings = self.accept_compression_encodings;
13577 let send_compression_encodings = self.send_compression_encodings;
13578 let max_decoding_message_size = self.max_decoding_message_size;
13579 let max_encoding_message_size = self.max_encoding_message_size;
13580 let inner = self.inner.clone();
13581 let fut = async move {
13582 let method = RenderBatchSvc(inner);
13583 let codec = tonic_prost::ProstCodec::default();
13584 let mut grpc = tonic::server::Grpc::new(codec)
13585 .apply_compression_config(
13586 accept_compression_encodings,
13587 send_compression_encodings,
13588 )
13589 .apply_max_message_size_config(
13590 max_decoding_message_size,
13591 max_encoding_message_size,
13592 );
13593 let res = grpc.server_streaming(method, req).await;
13594 Ok(res)
13595 };
13596 Box::pin(fut)
13597 }
13598 _ => {
13599 Box::pin(async move {
13600 let mut response = http::Response::new(
13601 tonic::body::Body::default(),
13602 );
13603 let headers = response.headers_mut();
13604 headers
13605 .insert(
13606 tonic::Status::GRPC_STATUS,
13607 (tonic::Code::Unimplemented as i32).into(),
13608 );
13609 headers
13610 .insert(
13611 http::header::CONTENT_TYPE,
13612 tonic::metadata::GRPC_CONTENT_TYPE,
13613 );
13614 Ok(response)
13615 })
13616 }
13617 }
13618 }
13619 }
13620 impl<T> Clone for RenderServiceServer<T> {
13621 fn clone(&self) -> Self {
13622 let inner = self.inner.clone();
13623 Self {
13624 inner,
13625 accept_compression_encodings: self.accept_compression_encodings,
13626 send_compression_encodings: self.send_compression_encodings,
13627 max_decoding_message_size: self.max_decoding_message_size,
13628 max_encoding_message_size: self.max_encoding_message_size,
13629 }
13630 }
13631 }
13632 pub const SERVICE_NAME: &str = "pidgr.v1.RenderService";
13634 impl<T> tonic::server::NamedService for RenderServiceServer<T> {
13635 const NAME: &'static str = SERVICE_NAME;
13636 }
13637}
13638pub mod replay_service_client {
13640 #![allow(
13641 unused_variables,
13642 dead_code,
13643 missing_docs,
13644 clippy::wildcard_imports,
13645 clippy::let_unit_value,
13646 )]
13647 use tonic::codegen::*;
13648 use tonic::codegen::http::Uri;
13649 #[derive(Debug, Clone)]
13653 pub struct ReplayServiceClient<T> {
13654 inner: tonic::client::Grpc<T>,
13655 }
13656 impl ReplayServiceClient<tonic::transport::Channel> {
13657 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
13659 where
13660 D: TryInto<tonic::transport::Endpoint>,
13661 D::Error: Into<StdError>,
13662 {
13663 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
13664 Ok(Self::new(conn))
13665 }
13666 }
13667 impl<T> ReplayServiceClient<T>
13668 where
13669 T: tonic::client::GrpcService<tonic::body::Body>,
13670 T::Error: Into<StdError>,
13671 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
13672 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
13673 {
13674 pub fn new(inner: T) -> Self {
13675 let inner = tonic::client::Grpc::new(inner);
13676 Self { inner }
13677 }
13678 pub fn with_origin(inner: T, origin: Uri) -> Self {
13679 let inner = tonic::client::Grpc::with_origin(inner, origin);
13680 Self { inner }
13681 }
13682 pub fn with_interceptor<F>(
13683 inner: T,
13684 interceptor: F,
13685 ) -> ReplayServiceClient<InterceptedService<T, F>>
13686 where
13687 F: tonic::service::Interceptor,
13688 T::ResponseBody: Default,
13689 T: tonic::codegen::Service<
13690 http::Request<tonic::body::Body>,
13691 Response = http::Response<
13692 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
13693 >,
13694 >,
13695 <T as tonic::codegen::Service<
13696 http::Request<tonic::body::Body>,
13697 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
13698 {
13699 ReplayServiceClient::new(InterceptedService::new(inner, interceptor))
13700 }
13701 #[must_use]
13706 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13707 self.inner = self.inner.send_compressed(encoding);
13708 self
13709 }
13710 #[must_use]
13712 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13713 self.inner = self.inner.accept_compressed(encoding);
13714 self
13715 }
13716 #[must_use]
13720 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13721 self.inner = self.inner.max_decoding_message_size(limit);
13722 self
13723 }
13724 #[must_use]
13728 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13729 self.inner = self.inner.max_encoding_message_size(limit);
13730 self
13731 }
13732 pub async fn list_session_recordings(
13736 &mut self,
13737 request: impl tonic::IntoRequest<super::ListSessionRecordingsRequest>,
13738 ) -> std::result::Result<
13739 tonic::Response<super::ListSessionRecordingsResponse>,
13740 tonic::Status,
13741 > {
13742 self.inner
13743 .ready()
13744 .await
13745 .map_err(|e| {
13746 tonic::Status::unknown(
13747 format!("Service was not ready: {}", e.into()),
13748 )
13749 })?;
13750 let codec = tonic_prost::ProstCodec::default();
13751 let path = http::uri::PathAndQuery::from_static(
13752 "/pidgr.v1.ReplayService/ListSessionRecordings",
13753 );
13754 let mut req = request.into_request();
13755 req.extensions_mut()
13756 .insert(
13757 GrpcMethod::new("pidgr.v1.ReplayService", "ListSessionRecordings"),
13758 );
13759 self.inner.unary(req, path, codec).await
13760 }
13761 pub async fn get_session_snapshots(
13765 &mut self,
13766 request: impl tonic::IntoRequest<super::GetSessionSnapshotsRequest>,
13767 ) -> std::result::Result<
13768 tonic::Response<super::GetSessionSnapshotsResponse>,
13769 tonic::Status,
13770 > {
13771 self.inner
13772 .ready()
13773 .await
13774 .map_err(|e| {
13775 tonic::Status::unknown(
13776 format!("Service was not ready: {}", e.into()),
13777 )
13778 })?;
13779 let codec = tonic_prost::ProstCodec::default();
13780 let path = http::uri::PathAndQuery::from_static(
13781 "/pidgr.v1.ReplayService/GetSessionSnapshots",
13782 );
13783 let mut req = request.into_request();
13784 req.extensions_mut()
13785 .insert(
13786 GrpcMethod::new("pidgr.v1.ReplayService", "GetSessionSnapshots"),
13787 );
13788 self.inner.unary(req, path, codec).await
13789 }
13790 }
13791}
13792pub mod replay_service_server {
13794 #![allow(
13795 unused_variables,
13796 dead_code,
13797 missing_docs,
13798 clippy::wildcard_imports,
13799 clippy::let_unit_value,
13800 )]
13801 use tonic::codegen::*;
13802 #[async_trait]
13804 pub trait ReplayService: std::marker::Send + std::marker::Sync + 'static {
13805 async fn list_session_recordings(
13809 &self,
13810 request: tonic::Request<super::ListSessionRecordingsRequest>,
13811 ) -> std::result::Result<
13812 tonic::Response<super::ListSessionRecordingsResponse>,
13813 tonic::Status,
13814 >;
13815 async fn get_session_snapshots(
13819 &self,
13820 request: tonic::Request<super::GetSessionSnapshotsRequest>,
13821 ) -> std::result::Result<
13822 tonic::Response<super::GetSessionSnapshotsResponse>,
13823 tonic::Status,
13824 >;
13825 }
13826 #[derive(Debug)]
13830 pub struct ReplayServiceServer<T> {
13831 inner: Arc<T>,
13832 accept_compression_encodings: EnabledCompressionEncodings,
13833 send_compression_encodings: EnabledCompressionEncodings,
13834 max_decoding_message_size: Option<usize>,
13835 max_encoding_message_size: Option<usize>,
13836 }
13837 impl<T> ReplayServiceServer<T> {
13838 pub fn new(inner: T) -> Self {
13839 Self::from_arc(Arc::new(inner))
13840 }
13841 pub fn from_arc(inner: Arc<T>) -> Self {
13842 Self {
13843 inner,
13844 accept_compression_encodings: Default::default(),
13845 send_compression_encodings: Default::default(),
13846 max_decoding_message_size: None,
13847 max_encoding_message_size: None,
13848 }
13849 }
13850 pub fn with_interceptor<F>(
13851 inner: T,
13852 interceptor: F,
13853 ) -> InterceptedService<Self, F>
13854 where
13855 F: tonic::service::Interceptor,
13856 {
13857 InterceptedService::new(Self::new(inner), interceptor)
13858 }
13859 #[must_use]
13861 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
13862 self.accept_compression_encodings.enable(encoding);
13863 self
13864 }
13865 #[must_use]
13867 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
13868 self.send_compression_encodings.enable(encoding);
13869 self
13870 }
13871 #[must_use]
13875 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
13876 self.max_decoding_message_size = Some(limit);
13877 self
13878 }
13879 #[must_use]
13883 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
13884 self.max_encoding_message_size = Some(limit);
13885 self
13886 }
13887 }
13888 impl<T, B> tonic::codegen::Service<http::Request<B>> for ReplayServiceServer<T>
13889 where
13890 T: ReplayService,
13891 B: Body + std::marker::Send + 'static,
13892 B::Error: Into<StdError> + std::marker::Send + 'static,
13893 {
13894 type Response = http::Response<tonic::body::Body>;
13895 type Error = std::convert::Infallible;
13896 type Future = BoxFuture<Self::Response, Self::Error>;
13897 fn poll_ready(
13898 &mut self,
13899 _cx: &mut Context<'_>,
13900 ) -> Poll<std::result::Result<(), Self::Error>> {
13901 Poll::Ready(Ok(()))
13902 }
13903 fn call(&mut self, req: http::Request<B>) -> Self::Future {
13904 match req.uri().path() {
13905 "/pidgr.v1.ReplayService/ListSessionRecordings" => {
13906 #[allow(non_camel_case_types)]
13907 struct ListSessionRecordingsSvc<T: ReplayService>(pub Arc<T>);
13908 impl<
13909 T: ReplayService,
13910 > tonic::server::UnaryService<super::ListSessionRecordingsRequest>
13911 for ListSessionRecordingsSvc<T> {
13912 type Response = super::ListSessionRecordingsResponse;
13913 type Future = BoxFuture<
13914 tonic::Response<Self::Response>,
13915 tonic::Status,
13916 >;
13917 fn call(
13918 &mut self,
13919 request: tonic::Request<super::ListSessionRecordingsRequest>,
13920 ) -> Self::Future {
13921 let inner = Arc::clone(&self.0);
13922 let fut = async move {
13923 <T as ReplayService>::list_session_recordings(
13924 &inner,
13925 request,
13926 )
13927 .await
13928 };
13929 Box::pin(fut)
13930 }
13931 }
13932 let accept_compression_encodings = self.accept_compression_encodings;
13933 let send_compression_encodings = self.send_compression_encodings;
13934 let max_decoding_message_size = self.max_decoding_message_size;
13935 let max_encoding_message_size = self.max_encoding_message_size;
13936 let inner = self.inner.clone();
13937 let fut = async move {
13938 let method = ListSessionRecordingsSvc(inner);
13939 let codec = tonic_prost::ProstCodec::default();
13940 let mut grpc = tonic::server::Grpc::new(codec)
13941 .apply_compression_config(
13942 accept_compression_encodings,
13943 send_compression_encodings,
13944 )
13945 .apply_max_message_size_config(
13946 max_decoding_message_size,
13947 max_encoding_message_size,
13948 );
13949 let res = grpc.unary(method, req).await;
13950 Ok(res)
13951 };
13952 Box::pin(fut)
13953 }
13954 "/pidgr.v1.ReplayService/GetSessionSnapshots" => {
13955 #[allow(non_camel_case_types)]
13956 struct GetSessionSnapshotsSvc<T: ReplayService>(pub Arc<T>);
13957 impl<
13958 T: ReplayService,
13959 > tonic::server::UnaryService<super::GetSessionSnapshotsRequest>
13960 for GetSessionSnapshotsSvc<T> {
13961 type Response = super::GetSessionSnapshotsResponse;
13962 type Future = BoxFuture<
13963 tonic::Response<Self::Response>,
13964 tonic::Status,
13965 >;
13966 fn call(
13967 &mut self,
13968 request: tonic::Request<super::GetSessionSnapshotsRequest>,
13969 ) -> Self::Future {
13970 let inner = Arc::clone(&self.0);
13971 let fut = async move {
13972 <T as ReplayService>::get_session_snapshots(&inner, request)
13973 .await
13974 };
13975 Box::pin(fut)
13976 }
13977 }
13978 let accept_compression_encodings = self.accept_compression_encodings;
13979 let send_compression_encodings = self.send_compression_encodings;
13980 let max_decoding_message_size = self.max_decoding_message_size;
13981 let max_encoding_message_size = self.max_encoding_message_size;
13982 let inner = self.inner.clone();
13983 let fut = async move {
13984 let method = GetSessionSnapshotsSvc(inner);
13985 let codec = tonic_prost::ProstCodec::default();
13986 let mut grpc = tonic::server::Grpc::new(codec)
13987 .apply_compression_config(
13988 accept_compression_encodings,
13989 send_compression_encodings,
13990 )
13991 .apply_max_message_size_config(
13992 max_decoding_message_size,
13993 max_encoding_message_size,
13994 );
13995 let res = grpc.unary(method, req).await;
13996 Ok(res)
13997 };
13998 Box::pin(fut)
13999 }
14000 _ => {
14001 Box::pin(async move {
14002 let mut response = http::Response::new(
14003 tonic::body::Body::default(),
14004 );
14005 let headers = response.headers_mut();
14006 headers
14007 .insert(
14008 tonic::Status::GRPC_STATUS,
14009 (tonic::Code::Unimplemented as i32).into(),
14010 );
14011 headers
14012 .insert(
14013 http::header::CONTENT_TYPE,
14014 tonic::metadata::GRPC_CONTENT_TYPE,
14015 );
14016 Ok(response)
14017 })
14018 }
14019 }
14020 }
14021 }
14022 impl<T> Clone for ReplayServiceServer<T> {
14023 fn clone(&self) -> Self {
14024 let inner = self.inner.clone();
14025 Self {
14026 inner,
14027 accept_compression_encodings: self.accept_compression_encodings,
14028 send_compression_encodings: self.send_compression_encodings,
14029 max_decoding_message_size: self.max_decoding_message_size,
14030 max_encoding_message_size: self.max_encoding_message_size,
14031 }
14032 }
14033 }
14034 pub const SERVICE_NAME: &str = "pidgr.v1.ReplayService";
14036 impl<T> tonic::server::NamedService for ReplayServiceServer<T> {
14037 const NAME: &'static str = SERVICE_NAME;
14038 }
14039}
14040pub mod role_service_client {
14042 #![allow(
14043 unused_variables,
14044 dead_code,
14045 missing_docs,
14046 clippy::wildcard_imports,
14047 clippy::let_unit_value,
14048 )]
14049 use tonic::codegen::*;
14050 use tonic::codegen::http::Uri;
14051 #[derive(Debug, Clone)]
14055 pub struct RoleServiceClient<T> {
14056 inner: tonic::client::Grpc<T>,
14057 }
14058 impl RoleServiceClient<tonic::transport::Channel> {
14059 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
14061 where
14062 D: TryInto<tonic::transport::Endpoint>,
14063 D::Error: Into<StdError>,
14064 {
14065 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
14066 Ok(Self::new(conn))
14067 }
14068 }
14069 impl<T> RoleServiceClient<T>
14070 where
14071 T: tonic::client::GrpcService<tonic::body::Body>,
14072 T::Error: Into<StdError>,
14073 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
14074 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
14075 {
14076 pub fn new(inner: T) -> Self {
14077 let inner = tonic::client::Grpc::new(inner);
14078 Self { inner }
14079 }
14080 pub fn with_origin(inner: T, origin: Uri) -> Self {
14081 let inner = tonic::client::Grpc::with_origin(inner, origin);
14082 Self { inner }
14083 }
14084 pub fn with_interceptor<F>(
14085 inner: T,
14086 interceptor: F,
14087 ) -> RoleServiceClient<InterceptedService<T, F>>
14088 where
14089 F: tonic::service::Interceptor,
14090 T::ResponseBody: Default,
14091 T: tonic::codegen::Service<
14092 http::Request<tonic::body::Body>,
14093 Response = http::Response<
14094 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
14095 >,
14096 >,
14097 <T as tonic::codegen::Service<
14098 http::Request<tonic::body::Body>,
14099 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
14100 {
14101 RoleServiceClient::new(InterceptedService::new(inner, interceptor))
14102 }
14103 #[must_use]
14108 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
14109 self.inner = self.inner.send_compressed(encoding);
14110 self
14111 }
14112 #[must_use]
14114 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
14115 self.inner = self.inner.accept_compressed(encoding);
14116 self
14117 }
14118 #[must_use]
14122 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
14123 self.inner = self.inner.max_decoding_message_size(limit);
14124 self
14125 }
14126 #[must_use]
14130 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
14131 self.inner = self.inner.max_encoding_message_size(limit);
14132 self
14133 }
14134 pub async fn list_roles(
14138 &mut self,
14139 request: impl tonic::IntoRequest<super::ListRolesRequest>,
14140 ) -> std::result::Result<
14141 tonic::Response<super::ListRolesResponse>,
14142 tonic::Status,
14143 > {
14144 self.inner
14145 .ready()
14146 .await
14147 .map_err(|e| {
14148 tonic::Status::unknown(
14149 format!("Service was not ready: {}", e.into()),
14150 )
14151 })?;
14152 let codec = tonic_prost::ProstCodec::default();
14153 let path = http::uri::PathAndQuery::from_static(
14154 "/pidgr.v1.RoleService/ListRoles",
14155 );
14156 let mut req = request.into_request();
14157 req.extensions_mut()
14158 .insert(GrpcMethod::new("pidgr.v1.RoleService", "ListRoles"));
14159 self.inner.unary(req, path, codec).await
14160 }
14161 pub async fn create_role(
14166 &mut self,
14167 request: impl tonic::IntoRequest<super::CreateRoleRequest>,
14168 ) -> std::result::Result<
14169 tonic::Response<super::CreateRoleResponse>,
14170 tonic::Status,
14171 > {
14172 self.inner
14173 .ready()
14174 .await
14175 .map_err(|e| {
14176 tonic::Status::unknown(
14177 format!("Service was not ready: {}", e.into()),
14178 )
14179 })?;
14180 let codec = tonic_prost::ProstCodec::default();
14181 let path = http::uri::PathAndQuery::from_static(
14182 "/pidgr.v1.RoleService/CreateRole",
14183 );
14184 let mut req = request.into_request();
14185 req.extensions_mut()
14186 .insert(GrpcMethod::new("pidgr.v1.RoleService", "CreateRole"));
14187 self.inner.unary(req, path, codec).await
14188 }
14189 pub async fn update_role(
14194 &mut self,
14195 request: impl tonic::IntoRequest<super::UpdateRoleRequest>,
14196 ) -> std::result::Result<
14197 tonic::Response<super::UpdateRoleResponse>,
14198 tonic::Status,
14199 > {
14200 self.inner
14201 .ready()
14202 .await
14203 .map_err(|e| {
14204 tonic::Status::unknown(
14205 format!("Service was not ready: {}", e.into()),
14206 )
14207 })?;
14208 let codec = tonic_prost::ProstCodec::default();
14209 let path = http::uri::PathAndQuery::from_static(
14210 "/pidgr.v1.RoleService/UpdateRole",
14211 );
14212 let mut req = request.into_request();
14213 req.extensions_mut()
14214 .insert(GrpcMethod::new("pidgr.v1.RoleService", "UpdateRole"));
14215 self.inner.unary(req, path, codec).await
14216 }
14217 pub async fn delete_role(
14222 &mut self,
14223 request: impl tonic::IntoRequest<super::DeleteRoleRequest>,
14224 ) -> std::result::Result<
14225 tonic::Response<super::DeleteRoleResponse>,
14226 tonic::Status,
14227 > {
14228 self.inner
14229 .ready()
14230 .await
14231 .map_err(|e| {
14232 tonic::Status::unknown(
14233 format!("Service was not ready: {}", e.into()),
14234 )
14235 })?;
14236 let codec = tonic_prost::ProstCodec::default();
14237 let path = http::uri::PathAndQuery::from_static(
14238 "/pidgr.v1.RoleService/DeleteRole",
14239 );
14240 let mut req = request.into_request();
14241 req.extensions_mut()
14242 .insert(GrpcMethod::new("pidgr.v1.RoleService", "DeleteRole"));
14243 self.inner.unary(req, path, codec).await
14244 }
14245 }
14246}
14247pub mod role_service_server {
14249 #![allow(
14250 unused_variables,
14251 dead_code,
14252 missing_docs,
14253 clippy::wildcard_imports,
14254 clippy::let_unit_value,
14255 )]
14256 use tonic::codegen::*;
14257 #[async_trait]
14259 pub trait RoleService: std::marker::Send + std::marker::Sync + 'static {
14260 async fn list_roles(
14264 &self,
14265 request: tonic::Request<super::ListRolesRequest>,
14266 ) -> std::result::Result<
14267 tonic::Response<super::ListRolesResponse>,
14268 tonic::Status,
14269 >;
14270 async fn create_role(
14275 &self,
14276 request: tonic::Request<super::CreateRoleRequest>,
14277 ) -> std::result::Result<
14278 tonic::Response<super::CreateRoleResponse>,
14279 tonic::Status,
14280 >;
14281 async fn update_role(
14286 &self,
14287 request: tonic::Request<super::UpdateRoleRequest>,
14288 ) -> std::result::Result<
14289 tonic::Response<super::UpdateRoleResponse>,
14290 tonic::Status,
14291 >;
14292 async fn delete_role(
14297 &self,
14298 request: tonic::Request<super::DeleteRoleRequest>,
14299 ) -> std::result::Result<
14300 tonic::Response<super::DeleteRoleResponse>,
14301 tonic::Status,
14302 >;
14303 }
14304 #[derive(Debug)]
14308 pub struct RoleServiceServer<T> {
14309 inner: Arc<T>,
14310 accept_compression_encodings: EnabledCompressionEncodings,
14311 send_compression_encodings: EnabledCompressionEncodings,
14312 max_decoding_message_size: Option<usize>,
14313 max_encoding_message_size: Option<usize>,
14314 }
14315 impl<T> RoleServiceServer<T> {
14316 pub fn new(inner: T) -> Self {
14317 Self::from_arc(Arc::new(inner))
14318 }
14319 pub fn from_arc(inner: Arc<T>) -> Self {
14320 Self {
14321 inner,
14322 accept_compression_encodings: Default::default(),
14323 send_compression_encodings: Default::default(),
14324 max_decoding_message_size: None,
14325 max_encoding_message_size: None,
14326 }
14327 }
14328 pub fn with_interceptor<F>(
14329 inner: T,
14330 interceptor: F,
14331 ) -> InterceptedService<Self, F>
14332 where
14333 F: tonic::service::Interceptor,
14334 {
14335 InterceptedService::new(Self::new(inner), interceptor)
14336 }
14337 #[must_use]
14339 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
14340 self.accept_compression_encodings.enable(encoding);
14341 self
14342 }
14343 #[must_use]
14345 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
14346 self.send_compression_encodings.enable(encoding);
14347 self
14348 }
14349 #[must_use]
14353 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
14354 self.max_decoding_message_size = Some(limit);
14355 self
14356 }
14357 #[must_use]
14361 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
14362 self.max_encoding_message_size = Some(limit);
14363 self
14364 }
14365 }
14366 impl<T, B> tonic::codegen::Service<http::Request<B>> for RoleServiceServer<T>
14367 where
14368 T: RoleService,
14369 B: Body + std::marker::Send + 'static,
14370 B::Error: Into<StdError> + std::marker::Send + 'static,
14371 {
14372 type Response = http::Response<tonic::body::Body>;
14373 type Error = std::convert::Infallible;
14374 type Future = BoxFuture<Self::Response, Self::Error>;
14375 fn poll_ready(
14376 &mut self,
14377 _cx: &mut Context<'_>,
14378 ) -> Poll<std::result::Result<(), Self::Error>> {
14379 Poll::Ready(Ok(()))
14380 }
14381 fn call(&mut self, req: http::Request<B>) -> Self::Future {
14382 match req.uri().path() {
14383 "/pidgr.v1.RoleService/ListRoles" => {
14384 #[allow(non_camel_case_types)]
14385 struct ListRolesSvc<T: RoleService>(pub Arc<T>);
14386 impl<
14387 T: RoleService,
14388 > tonic::server::UnaryService<super::ListRolesRequest>
14389 for ListRolesSvc<T> {
14390 type Response = super::ListRolesResponse;
14391 type Future = BoxFuture<
14392 tonic::Response<Self::Response>,
14393 tonic::Status,
14394 >;
14395 fn call(
14396 &mut self,
14397 request: tonic::Request<super::ListRolesRequest>,
14398 ) -> Self::Future {
14399 let inner = Arc::clone(&self.0);
14400 let fut = async move {
14401 <T as RoleService>::list_roles(&inner, request).await
14402 };
14403 Box::pin(fut)
14404 }
14405 }
14406 let accept_compression_encodings = self.accept_compression_encodings;
14407 let send_compression_encodings = self.send_compression_encodings;
14408 let max_decoding_message_size = self.max_decoding_message_size;
14409 let max_encoding_message_size = self.max_encoding_message_size;
14410 let inner = self.inner.clone();
14411 let fut = async move {
14412 let method = ListRolesSvc(inner);
14413 let codec = tonic_prost::ProstCodec::default();
14414 let mut grpc = tonic::server::Grpc::new(codec)
14415 .apply_compression_config(
14416 accept_compression_encodings,
14417 send_compression_encodings,
14418 )
14419 .apply_max_message_size_config(
14420 max_decoding_message_size,
14421 max_encoding_message_size,
14422 );
14423 let res = grpc.unary(method, req).await;
14424 Ok(res)
14425 };
14426 Box::pin(fut)
14427 }
14428 "/pidgr.v1.RoleService/CreateRole" => {
14429 #[allow(non_camel_case_types)]
14430 struct CreateRoleSvc<T: RoleService>(pub Arc<T>);
14431 impl<
14432 T: RoleService,
14433 > tonic::server::UnaryService<super::CreateRoleRequest>
14434 for CreateRoleSvc<T> {
14435 type Response = super::CreateRoleResponse;
14436 type Future = BoxFuture<
14437 tonic::Response<Self::Response>,
14438 tonic::Status,
14439 >;
14440 fn call(
14441 &mut self,
14442 request: tonic::Request<super::CreateRoleRequest>,
14443 ) -> Self::Future {
14444 let inner = Arc::clone(&self.0);
14445 let fut = async move {
14446 <T as RoleService>::create_role(&inner, request).await
14447 };
14448 Box::pin(fut)
14449 }
14450 }
14451 let accept_compression_encodings = self.accept_compression_encodings;
14452 let send_compression_encodings = self.send_compression_encodings;
14453 let max_decoding_message_size = self.max_decoding_message_size;
14454 let max_encoding_message_size = self.max_encoding_message_size;
14455 let inner = self.inner.clone();
14456 let fut = async move {
14457 let method = CreateRoleSvc(inner);
14458 let codec = tonic_prost::ProstCodec::default();
14459 let mut grpc = tonic::server::Grpc::new(codec)
14460 .apply_compression_config(
14461 accept_compression_encodings,
14462 send_compression_encodings,
14463 )
14464 .apply_max_message_size_config(
14465 max_decoding_message_size,
14466 max_encoding_message_size,
14467 );
14468 let res = grpc.unary(method, req).await;
14469 Ok(res)
14470 };
14471 Box::pin(fut)
14472 }
14473 "/pidgr.v1.RoleService/UpdateRole" => {
14474 #[allow(non_camel_case_types)]
14475 struct UpdateRoleSvc<T: RoleService>(pub Arc<T>);
14476 impl<
14477 T: RoleService,
14478 > tonic::server::UnaryService<super::UpdateRoleRequest>
14479 for UpdateRoleSvc<T> {
14480 type Response = super::UpdateRoleResponse;
14481 type Future = BoxFuture<
14482 tonic::Response<Self::Response>,
14483 tonic::Status,
14484 >;
14485 fn call(
14486 &mut self,
14487 request: tonic::Request<super::UpdateRoleRequest>,
14488 ) -> Self::Future {
14489 let inner = Arc::clone(&self.0);
14490 let fut = async move {
14491 <T as RoleService>::update_role(&inner, request).await
14492 };
14493 Box::pin(fut)
14494 }
14495 }
14496 let accept_compression_encodings = self.accept_compression_encodings;
14497 let send_compression_encodings = self.send_compression_encodings;
14498 let max_decoding_message_size = self.max_decoding_message_size;
14499 let max_encoding_message_size = self.max_encoding_message_size;
14500 let inner = self.inner.clone();
14501 let fut = async move {
14502 let method = UpdateRoleSvc(inner);
14503 let codec = tonic_prost::ProstCodec::default();
14504 let mut grpc = tonic::server::Grpc::new(codec)
14505 .apply_compression_config(
14506 accept_compression_encodings,
14507 send_compression_encodings,
14508 )
14509 .apply_max_message_size_config(
14510 max_decoding_message_size,
14511 max_encoding_message_size,
14512 );
14513 let res = grpc.unary(method, req).await;
14514 Ok(res)
14515 };
14516 Box::pin(fut)
14517 }
14518 "/pidgr.v1.RoleService/DeleteRole" => {
14519 #[allow(non_camel_case_types)]
14520 struct DeleteRoleSvc<T: RoleService>(pub Arc<T>);
14521 impl<
14522 T: RoleService,
14523 > tonic::server::UnaryService<super::DeleteRoleRequest>
14524 for DeleteRoleSvc<T> {
14525 type Response = super::DeleteRoleResponse;
14526 type Future = BoxFuture<
14527 tonic::Response<Self::Response>,
14528 tonic::Status,
14529 >;
14530 fn call(
14531 &mut self,
14532 request: tonic::Request<super::DeleteRoleRequest>,
14533 ) -> Self::Future {
14534 let inner = Arc::clone(&self.0);
14535 let fut = async move {
14536 <T as RoleService>::delete_role(&inner, request).await
14537 };
14538 Box::pin(fut)
14539 }
14540 }
14541 let accept_compression_encodings = self.accept_compression_encodings;
14542 let send_compression_encodings = self.send_compression_encodings;
14543 let max_decoding_message_size = self.max_decoding_message_size;
14544 let max_encoding_message_size = self.max_encoding_message_size;
14545 let inner = self.inner.clone();
14546 let fut = async move {
14547 let method = DeleteRoleSvc(inner);
14548 let codec = tonic_prost::ProstCodec::default();
14549 let mut grpc = tonic::server::Grpc::new(codec)
14550 .apply_compression_config(
14551 accept_compression_encodings,
14552 send_compression_encodings,
14553 )
14554 .apply_max_message_size_config(
14555 max_decoding_message_size,
14556 max_encoding_message_size,
14557 );
14558 let res = grpc.unary(method, req).await;
14559 Ok(res)
14560 };
14561 Box::pin(fut)
14562 }
14563 _ => {
14564 Box::pin(async move {
14565 let mut response = http::Response::new(
14566 tonic::body::Body::default(),
14567 );
14568 let headers = response.headers_mut();
14569 headers
14570 .insert(
14571 tonic::Status::GRPC_STATUS,
14572 (tonic::Code::Unimplemented as i32).into(),
14573 );
14574 headers
14575 .insert(
14576 http::header::CONTENT_TYPE,
14577 tonic::metadata::GRPC_CONTENT_TYPE,
14578 );
14579 Ok(response)
14580 })
14581 }
14582 }
14583 }
14584 }
14585 impl<T> Clone for RoleServiceServer<T> {
14586 fn clone(&self) -> Self {
14587 let inner = self.inner.clone();
14588 Self {
14589 inner,
14590 accept_compression_encodings: self.accept_compression_encodings,
14591 send_compression_encodings: self.send_compression_encodings,
14592 max_decoding_message_size: self.max_decoding_message_size,
14593 max_encoding_message_size: self.max_encoding_message_size,
14594 }
14595 }
14596 }
14597 pub const SERVICE_NAME: &str = "pidgr.v1.RoleService";
14599 impl<T> tonic::server::NamedService for RoleServiceServer<T> {
14600 const NAME: &'static str = SERVICE_NAME;
14601 }
14602}
14603pub mod sso_service_client {
14605 #![allow(
14606 unused_variables,
14607 dead_code,
14608 missing_docs,
14609 clippy::wildcard_imports,
14610 clippy::let_unit_value,
14611 )]
14612 use tonic::codegen::*;
14613 use tonic::codegen::http::Uri;
14614 #[derive(Debug, Clone)]
14617 pub struct SsoServiceClient<T> {
14618 inner: tonic::client::Grpc<T>,
14619 }
14620 impl SsoServiceClient<tonic::transport::Channel> {
14621 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
14623 where
14624 D: TryInto<tonic::transport::Endpoint>,
14625 D::Error: Into<StdError>,
14626 {
14627 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
14628 Ok(Self::new(conn))
14629 }
14630 }
14631 impl<T> SsoServiceClient<T>
14632 where
14633 T: tonic::client::GrpcService<tonic::body::Body>,
14634 T::Error: Into<StdError>,
14635 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
14636 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
14637 {
14638 pub fn new(inner: T) -> Self {
14639 let inner = tonic::client::Grpc::new(inner);
14640 Self { inner }
14641 }
14642 pub fn with_origin(inner: T, origin: Uri) -> Self {
14643 let inner = tonic::client::Grpc::with_origin(inner, origin);
14644 Self { inner }
14645 }
14646 pub fn with_interceptor<F>(
14647 inner: T,
14648 interceptor: F,
14649 ) -> SsoServiceClient<InterceptedService<T, F>>
14650 where
14651 F: tonic::service::Interceptor,
14652 T::ResponseBody: Default,
14653 T: tonic::codegen::Service<
14654 http::Request<tonic::body::Body>,
14655 Response = http::Response<
14656 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
14657 >,
14658 >,
14659 <T as tonic::codegen::Service<
14660 http::Request<tonic::body::Body>,
14661 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
14662 {
14663 SsoServiceClient::new(InterceptedService::new(inner, interceptor))
14664 }
14665 #[must_use]
14670 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
14671 self.inner = self.inner.send_compressed(encoding);
14672 self
14673 }
14674 #[must_use]
14676 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
14677 self.inner = self.inner.accept_compressed(encoding);
14678 self
14679 }
14680 #[must_use]
14684 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
14685 self.inner = self.inner.max_decoding_message_size(limit);
14686 self
14687 }
14688 #[must_use]
14692 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
14693 self.inner = self.inner.max_encoding_message_size(limit);
14694 self
14695 }
14696 pub async fn check_sso_by_domain(
14701 &mut self,
14702 request: impl tonic::IntoRequest<super::CheckSsoByDomainRequest>,
14703 ) -> std::result::Result<
14704 tonic::Response<super::CheckSsoByDomainResponse>,
14705 tonic::Status,
14706 > {
14707 self.inner
14708 .ready()
14709 .await
14710 .map_err(|e| {
14711 tonic::Status::unknown(
14712 format!("Service was not ready: {}", e.into()),
14713 )
14714 })?;
14715 let codec = tonic_prost::ProstCodec::default();
14716 let path = http::uri::PathAndQuery::from_static(
14717 "/pidgr.v1.SSOService/CheckSSOByDomain",
14718 );
14719 let mut req = request.into_request();
14720 req.extensions_mut()
14721 .insert(GrpcMethod::new("pidgr.v1.SSOService", "CheckSSOByDomain"));
14722 self.inner.unary(req, path, codec).await
14723 }
14724 pub async fn create_sso_provider(
14730 &mut self,
14731 request: impl tonic::IntoRequest<super::CreateSsoProviderRequest>,
14732 ) -> std::result::Result<
14733 tonic::Response<super::CreateSsoProviderResponse>,
14734 tonic::Status,
14735 > {
14736 self.inner
14737 .ready()
14738 .await
14739 .map_err(|e| {
14740 tonic::Status::unknown(
14741 format!("Service was not ready: {}", e.into()),
14742 )
14743 })?;
14744 let codec = tonic_prost::ProstCodec::default();
14745 let path = http::uri::PathAndQuery::from_static(
14746 "/pidgr.v1.SSOService/CreateSSOProvider",
14747 );
14748 let mut req = request.into_request();
14749 req.extensions_mut()
14750 .insert(GrpcMethod::new("pidgr.v1.SSOService", "CreateSSOProvider"));
14751 self.inner.unary(req, path, codec).await
14752 }
14753 pub async fn get_sso_provider(
14757 &mut self,
14758 request: impl tonic::IntoRequest<super::GetSsoProviderRequest>,
14759 ) -> std::result::Result<
14760 tonic::Response<super::GetSsoProviderResponse>,
14761 tonic::Status,
14762 > {
14763 self.inner
14764 .ready()
14765 .await
14766 .map_err(|e| {
14767 tonic::Status::unknown(
14768 format!("Service was not ready: {}", e.into()),
14769 )
14770 })?;
14771 let codec = tonic_prost::ProstCodec::default();
14772 let path = http::uri::PathAndQuery::from_static(
14773 "/pidgr.v1.SSOService/GetSSOProvider",
14774 );
14775 let mut req = request.into_request();
14776 req.extensions_mut()
14777 .insert(GrpcMethod::new("pidgr.v1.SSOService", "GetSSOProvider"));
14778 self.inner.unary(req, path, codec).await
14779 }
14780 pub async fn delete_sso_provider(
14786 &mut self,
14787 request: impl tonic::IntoRequest<super::DeleteSsoProviderRequest>,
14788 ) -> std::result::Result<
14789 tonic::Response<super::DeleteSsoProviderResponse>,
14790 tonic::Status,
14791 > {
14792 self.inner
14793 .ready()
14794 .await
14795 .map_err(|e| {
14796 tonic::Status::unknown(
14797 format!("Service was not ready: {}", e.into()),
14798 )
14799 })?;
14800 let codec = tonic_prost::ProstCodec::default();
14801 let path = http::uri::PathAndQuery::from_static(
14802 "/pidgr.v1.SSOService/DeleteSSOProvider",
14803 );
14804 let mut req = request.into_request();
14805 req.extensions_mut()
14806 .insert(GrpcMethod::new("pidgr.v1.SSOService", "DeleteSSOProvider"));
14807 self.inner.unary(req, path, codec).await
14808 }
14809 }
14810}
14811pub mod sso_service_server {
14813 #![allow(
14814 unused_variables,
14815 dead_code,
14816 missing_docs,
14817 clippy::wildcard_imports,
14818 clippy::let_unit_value,
14819 )]
14820 use tonic::codegen::*;
14821 #[async_trait]
14823 pub trait SsoService: std::marker::Send + std::marker::Sync + 'static {
14824 async fn check_sso_by_domain(
14829 &self,
14830 request: tonic::Request<super::CheckSsoByDomainRequest>,
14831 ) -> std::result::Result<
14832 tonic::Response<super::CheckSsoByDomainResponse>,
14833 tonic::Status,
14834 >;
14835 async fn create_sso_provider(
14841 &self,
14842 request: tonic::Request<super::CreateSsoProviderRequest>,
14843 ) -> std::result::Result<
14844 tonic::Response<super::CreateSsoProviderResponse>,
14845 tonic::Status,
14846 >;
14847 async fn get_sso_provider(
14851 &self,
14852 request: tonic::Request<super::GetSsoProviderRequest>,
14853 ) -> std::result::Result<
14854 tonic::Response<super::GetSsoProviderResponse>,
14855 tonic::Status,
14856 >;
14857 async fn delete_sso_provider(
14863 &self,
14864 request: tonic::Request<super::DeleteSsoProviderRequest>,
14865 ) -> std::result::Result<
14866 tonic::Response<super::DeleteSsoProviderResponse>,
14867 tonic::Status,
14868 >;
14869 }
14870 #[derive(Debug)]
14873 pub struct SsoServiceServer<T> {
14874 inner: Arc<T>,
14875 accept_compression_encodings: EnabledCompressionEncodings,
14876 send_compression_encodings: EnabledCompressionEncodings,
14877 max_decoding_message_size: Option<usize>,
14878 max_encoding_message_size: Option<usize>,
14879 }
14880 impl<T> SsoServiceServer<T> {
14881 pub fn new(inner: T) -> Self {
14882 Self::from_arc(Arc::new(inner))
14883 }
14884 pub fn from_arc(inner: Arc<T>) -> Self {
14885 Self {
14886 inner,
14887 accept_compression_encodings: Default::default(),
14888 send_compression_encodings: Default::default(),
14889 max_decoding_message_size: None,
14890 max_encoding_message_size: None,
14891 }
14892 }
14893 pub fn with_interceptor<F>(
14894 inner: T,
14895 interceptor: F,
14896 ) -> InterceptedService<Self, F>
14897 where
14898 F: tonic::service::Interceptor,
14899 {
14900 InterceptedService::new(Self::new(inner), interceptor)
14901 }
14902 #[must_use]
14904 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
14905 self.accept_compression_encodings.enable(encoding);
14906 self
14907 }
14908 #[must_use]
14910 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
14911 self.send_compression_encodings.enable(encoding);
14912 self
14913 }
14914 #[must_use]
14918 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
14919 self.max_decoding_message_size = Some(limit);
14920 self
14921 }
14922 #[must_use]
14926 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
14927 self.max_encoding_message_size = Some(limit);
14928 self
14929 }
14930 }
14931 impl<T, B> tonic::codegen::Service<http::Request<B>> for SsoServiceServer<T>
14932 where
14933 T: SsoService,
14934 B: Body + std::marker::Send + 'static,
14935 B::Error: Into<StdError> + std::marker::Send + 'static,
14936 {
14937 type Response = http::Response<tonic::body::Body>;
14938 type Error = std::convert::Infallible;
14939 type Future = BoxFuture<Self::Response, Self::Error>;
14940 fn poll_ready(
14941 &mut self,
14942 _cx: &mut Context<'_>,
14943 ) -> Poll<std::result::Result<(), Self::Error>> {
14944 Poll::Ready(Ok(()))
14945 }
14946 fn call(&mut self, req: http::Request<B>) -> Self::Future {
14947 match req.uri().path() {
14948 "/pidgr.v1.SSOService/CheckSSOByDomain" => {
14949 #[allow(non_camel_case_types)]
14950 struct CheckSSOByDomainSvc<T: SsoService>(pub Arc<T>);
14951 impl<
14952 T: SsoService,
14953 > tonic::server::UnaryService<super::CheckSsoByDomainRequest>
14954 for CheckSSOByDomainSvc<T> {
14955 type Response = super::CheckSsoByDomainResponse;
14956 type Future = BoxFuture<
14957 tonic::Response<Self::Response>,
14958 tonic::Status,
14959 >;
14960 fn call(
14961 &mut self,
14962 request: tonic::Request<super::CheckSsoByDomainRequest>,
14963 ) -> Self::Future {
14964 let inner = Arc::clone(&self.0);
14965 let fut = async move {
14966 <T as SsoService>::check_sso_by_domain(&inner, request)
14967 .await
14968 };
14969 Box::pin(fut)
14970 }
14971 }
14972 let accept_compression_encodings = self.accept_compression_encodings;
14973 let send_compression_encodings = self.send_compression_encodings;
14974 let max_decoding_message_size = self.max_decoding_message_size;
14975 let max_encoding_message_size = self.max_encoding_message_size;
14976 let inner = self.inner.clone();
14977 let fut = async move {
14978 let method = CheckSSOByDomainSvc(inner);
14979 let codec = tonic_prost::ProstCodec::default();
14980 let mut grpc = tonic::server::Grpc::new(codec)
14981 .apply_compression_config(
14982 accept_compression_encodings,
14983 send_compression_encodings,
14984 )
14985 .apply_max_message_size_config(
14986 max_decoding_message_size,
14987 max_encoding_message_size,
14988 );
14989 let res = grpc.unary(method, req).await;
14990 Ok(res)
14991 };
14992 Box::pin(fut)
14993 }
14994 "/pidgr.v1.SSOService/CreateSSOProvider" => {
14995 #[allow(non_camel_case_types)]
14996 struct CreateSSOProviderSvc<T: SsoService>(pub Arc<T>);
14997 impl<
14998 T: SsoService,
14999 > tonic::server::UnaryService<super::CreateSsoProviderRequest>
15000 for CreateSSOProviderSvc<T> {
15001 type Response = super::CreateSsoProviderResponse;
15002 type Future = BoxFuture<
15003 tonic::Response<Self::Response>,
15004 tonic::Status,
15005 >;
15006 fn call(
15007 &mut self,
15008 request: tonic::Request<super::CreateSsoProviderRequest>,
15009 ) -> Self::Future {
15010 let inner = Arc::clone(&self.0);
15011 let fut = async move {
15012 <T as SsoService>::create_sso_provider(&inner, request)
15013 .await
15014 };
15015 Box::pin(fut)
15016 }
15017 }
15018 let accept_compression_encodings = self.accept_compression_encodings;
15019 let send_compression_encodings = self.send_compression_encodings;
15020 let max_decoding_message_size = self.max_decoding_message_size;
15021 let max_encoding_message_size = self.max_encoding_message_size;
15022 let inner = self.inner.clone();
15023 let fut = async move {
15024 let method = CreateSSOProviderSvc(inner);
15025 let codec = tonic_prost::ProstCodec::default();
15026 let mut grpc = tonic::server::Grpc::new(codec)
15027 .apply_compression_config(
15028 accept_compression_encodings,
15029 send_compression_encodings,
15030 )
15031 .apply_max_message_size_config(
15032 max_decoding_message_size,
15033 max_encoding_message_size,
15034 );
15035 let res = grpc.unary(method, req).await;
15036 Ok(res)
15037 };
15038 Box::pin(fut)
15039 }
15040 "/pidgr.v1.SSOService/GetSSOProvider" => {
15041 #[allow(non_camel_case_types)]
15042 struct GetSSOProviderSvc<T: SsoService>(pub Arc<T>);
15043 impl<
15044 T: SsoService,
15045 > tonic::server::UnaryService<super::GetSsoProviderRequest>
15046 for GetSSOProviderSvc<T> {
15047 type Response = super::GetSsoProviderResponse;
15048 type Future = BoxFuture<
15049 tonic::Response<Self::Response>,
15050 tonic::Status,
15051 >;
15052 fn call(
15053 &mut self,
15054 request: tonic::Request<super::GetSsoProviderRequest>,
15055 ) -> Self::Future {
15056 let inner = Arc::clone(&self.0);
15057 let fut = async move {
15058 <T as SsoService>::get_sso_provider(&inner, request).await
15059 };
15060 Box::pin(fut)
15061 }
15062 }
15063 let accept_compression_encodings = self.accept_compression_encodings;
15064 let send_compression_encodings = self.send_compression_encodings;
15065 let max_decoding_message_size = self.max_decoding_message_size;
15066 let max_encoding_message_size = self.max_encoding_message_size;
15067 let inner = self.inner.clone();
15068 let fut = async move {
15069 let method = GetSSOProviderSvc(inner);
15070 let codec = tonic_prost::ProstCodec::default();
15071 let mut grpc = tonic::server::Grpc::new(codec)
15072 .apply_compression_config(
15073 accept_compression_encodings,
15074 send_compression_encodings,
15075 )
15076 .apply_max_message_size_config(
15077 max_decoding_message_size,
15078 max_encoding_message_size,
15079 );
15080 let res = grpc.unary(method, req).await;
15081 Ok(res)
15082 };
15083 Box::pin(fut)
15084 }
15085 "/pidgr.v1.SSOService/DeleteSSOProvider" => {
15086 #[allow(non_camel_case_types)]
15087 struct DeleteSSOProviderSvc<T: SsoService>(pub Arc<T>);
15088 impl<
15089 T: SsoService,
15090 > tonic::server::UnaryService<super::DeleteSsoProviderRequest>
15091 for DeleteSSOProviderSvc<T> {
15092 type Response = super::DeleteSsoProviderResponse;
15093 type Future = BoxFuture<
15094 tonic::Response<Self::Response>,
15095 tonic::Status,
15096 >;
15097 fn call(
15098 &mut self,
15099 request: tonic::Request<super::DeleteSsoProviderRequest>,
15100 ) -> Self::Future {
15101 let inner = Arc::clone(&self.0);
15102 let fut = async move {
15103 <T as SsoService>::delete_sso_provider(&inner, request)
15104 .await
15105 };
15106 Box::pin(fut)
15107 }
15108 }
15109 let accept_compression_encodings = self.accept_compression_encodings;
15110 let send_compression_encodings = self.send_compression_encodings;
15111 let max_decoding_message_size = self.max_decoding_message_size;
15112 let max_encoding_message_size = self.max_encoding_message_size;
15113 let inner = self.inner.clone();
15114 let fut = async move {
15115 let method = DeleteSSOProviderSvc(inner);
15116 let codec = tonic_prost::ProstCodec::default();
15117 let mut grpc = tonic::server::Grpc::new(codec)
15118 .apply_compression_config(
15119 accept_compression_encodings,
15120 send_compression_encodings,
15121 )
15122 .apply_max_message_size_config(
15123 max_decoding_message_size,
15124 max_encoding_message_size,
15125 );
15126 let res = grpc.unary(method, req).await;
15127 Ok(res)
15128 };
15129 Box::pin(fut)
15130 }
15131 _ => {
15132 Box::pin(async move {
15133 let mut response = http::Response::new(
15134 tonic::body::Body::default(),
15135 );
15136 let headers = response.headers_mut();
15137 headers
15138 .insert(
15139 tonic::Status::GRPC_STATUS,
15140 (tonic::Code::Unimplemented as i32).into(),
15141 );
15142 headers
15143 .insert(
15144 http::header::CONTENT_TYPE,
15145 tonic::metadata::GRPC_CONTENT_TYPE,
15146 );
15147 Ok(response)
15148 })
15149 }
15150 }
15151 }
15152 }
15153 impl<T> Clone for SsoServiceServer<T> {
15154 fn clone(&self) -> Self {
15155 let inner = self.inner.clone();
15156 Self {
15157 inner,
15158 accept_compression_encodings: self.accept_compression_encodings,
15159 send_compression_encodings: self.send_compression_encodings,
15160 max_decoding_message_size: self.max_decoding_message_size,
15161 max_encoding_message_size: self.max_encoding_message_size,
15162 }
15163 }
15164 }
15165 pub const SERVICE_NAME: &str = "pidgr.v1.SSOService";
15167 impl<T> tonic::server::NamedService for SsoServiceServer<T> {
15168 const NAME: &'static str = SERVICE_NAME;
15169 }
15170}
15171pub mod team_service_client {
15173 #![allow(
15174 unused_variables,
15175 dead_code,
15176 missing_docs,
15177 clippy::wildcard_imports,
15178 clippy::let_unit_value,
15179 )]
15180 use tonic::codegen::*;
15181 use tonic::codegen::http::Uri;
15182 #[derive(Debug, Clone)]
15187 pub struct TeamServiceClient<T> {
15188 inner: tonic::client::Grpc<T>,
15189 }
15190 impl TeamServiceClient<tonic::transport::Channel> {
15191 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
15193 where
15194 D: TryInto<tonic::transport::Endpoint>,
15195 D::Error: Into<StdError>,
15196 {
15197 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
15198 Ok(Self::new(conn))
15199 }
15200 }
15201 impl<T> TeamServiceClient<T>
15202 where
15203 T: tonic::client::GrpcService<tonic::body::Body>,
15204 T::Error: Into<StdError>,
15205 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
15206 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
15207 {
15208 pub fn new(inner: T) -> Self {
15209 let inner = tonic::client::Grpc::new(inner);
15210 Self { inner }
15211 }
15212 pub fn with_origin(inner: T, origin: Uri) -> Self {
15213 let inner = tonic::client::Grpc::with_origin(inner, origin);
15214 Self { inner }
15215 }
15216 pub fn with_interceptor<F>(
15217 inner: T,
15218 interceptor: F,
15219 ) -> TeamServiceClient<InterceptedService<T, F>>
15220 where
15221 F: tonic::service::Interceptor,
15222 T::ResponseBody: Default,
15223 T: tonic::codegen::Service<
15224 http::Request<tonic::body::Body>,
15225 Response = http::Response<
15226 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
15227 >,
15228 >,
15229 <T as tonic::codegen::Service<
15230 http::Request<tonic::body::Body>,
15231 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
15232 {
15233 TeamServiceClient::new(InterceptedService::new(inner, interceptor))
15234 }
15235 #[must_use]
15240 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
15241 self.inner = self.inner.send_compressed(encoding);
15242 self
15243 }
15244 #[must_use]
15246 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
15247 self.inner = self.inner.accept_compressed(encoding);
15248 self
15249 }
15250 #[must_use]
15254 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
15255 self.inner = self.inner.max_decoding_message_size(limit);
15256 self
15257 }
15258 #[must_use]
15262 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
15263 self.inner = self.inner.max_encoding_message_size(limit);
15264 self
15265 }
15266 pub async fn create_team(
15270 &mut self,
15271 request: impl tonic::IntoRequest<super::CreateTeamRequest>,
15272 ) -> std::result::Result<
15273 tonic::Response<super::CreateTeamResponse>,
15274 tonic::Status,
15275 > {
15276 self.inner
15277 .ready()
15278 .await
15279 .map_err(|e| {
15280 tonic::Status::unknown(
15281 format!("Service was not ready: {}", e.into()),
15282 )
15283 })?;
15284 let codec = tonic_prost::ProstCodec::default();
15285 let path = http::uri::PathAndQuery::from_static(
15286 "/pidgr.v1.TeamService/CreateTeam",
15287 );
15288 let mut req = request.into_request();
15289 req.extensions_mut()
15290 .insert(GrpcMethod::new("pidgr.v1.TeamService", "CreateTeam"));
15291 self.inner.unary(req, path, codec).await
15292 }
15293 pub async fn get_team(
15298 &mut self,
15299 request: impl tonic::IntoRequest<super::GetTeamRequest>,
15300 ) -> std::result::Result<
15301 tonic::Response<super::GetTeamResponse>,
15302 tonic::Status,
15303 > {
15304 self.inner
15305 .ready()
15306 .await
15307 .map_err(|e| {
15308 tonic::Status::unknown(
15309 format!("Service was not ready: {}", e.into()),
15310 )
15311 })?;
15312 let codec = tonic_prost::ProstCodec::default();
15313 let path = http::uri::PathAndQuery::from_static(
15314 "/pidgr.v1.TeamService/GetTeam",
15315 );
15316 let mut req = request.into_request();
15317 req.extensions_mut()
15318 .insert(GrpcMethod::new("pidgr.v1.TeamService", "GetTeam"));
15319 self.inner.unary(req, path, codec).await
15320 }
15321 pub async fn list_teams(
15325 &mut self,
15326 request: impl tonic::IntoRequest<super::ListTeamsRequest>,
15327 ) -> std::result::Result<
15328 tonic::Response<super::ListTeamsResponse>,
15329 tonic::Status,
15330 > {
15331 self.inner
15332 .ready()
15333 .await
15334 .map_err(|e| {
15335 tonic::Status::unknown(
15336 format!("Service was not ready: {}", e.into()),
15337 )
15338 })?;
15339 let codec = tonic_prost::ProstCodec::default();
15340 let path = http::uri::PathAndQuery::from_static(
15341 "/pidgr.v1.TeamService/ListTeams",
15342 );
15343 let mut req = request.into_request();
15344 req.extensions_mut()
15345 .insert(GrpcMethod::new("pidgr.v1.TeamService", "ListTeams"));
15346 self.inner.unary(req, path, codec).await
15347 }
15348 pub async fn update_team(
15352 &mut self,
15353 request: impl tonic::IntoRequest<super::UpdateTeamRequest>,
15354 ) -> std::result::Result<
15355 tonic::Response<super::UpdateTeamResponse>,
15356 tonic::Status,
15357 > {
15358 self.inner
15359 .ready()
15360 .await
15361 .map_err(|e| {
15362 tonic::Status::unknown(
15363 format!("Service was not ready: {}", e.into()),
15364 )
15365 })?;
15366 let codec = tonic_prost::ProstCodec::default();
15367 let path = http::uri::PathAndQuery::from_static(
15368 "/pidgr.v1.TeamService/UpdateTeam",
15369 );
15370 let mut req = request.into_request();
15371 req.extensions_mut()
15372 .insert(GrpcMethod::new("pidgr.v1.TeamService", "UpdateTeam"));
15373 self.inner.unary(req, path, codec).await
15374 }
15375 pub async fn delete_team(
15379 &mut self,
15380 request: impl tonic::IntoRequest<super::DeleteTeamRequest>,
15381 ) -> std::result::Result<
15382 tonic::Response<super::DeleteTeamResponse>,
15383 tonic::Status,
15384 > {
15385 self.inner
15386 .ready()
15387 .await
15388 .map_err(|e| {
15389 tonic::Status::unknown(
15390 format!("Service was not ready: {}", e.into()),
15391 )
15392 })?;
15393 let codec = tonic_prost::ProstCodec::default();
15394 let path = http::uri::PathAndQuery::from_static(
15395 "/pidgr.v1.TeamService/DeleteTeam",
15396 );
15397 let mut req = request.into_request();
15398 req.extensions_mut()
15399 .insert(GrpcMethod::new("pidgr.v1.TeamService", "DeleteTeam"));
15400 self.inner.unary(req, path, codec).await
15401 }
15402 pub async fn add_team_members(
15406 &mut self,
15407 request: impl tonic::IntoRequest<super::AddTeamMembersRequest>,
15408 ) -> std::result::Result<
15409 tonic::Response<super::AddTeamMembersResponse>,
15410 tonic::Status,
15411 > {
15412 self.inner
15413 .ready()
15414 .await
15415 .map_err(|e| {
15416 tonic::Status::unknown(
15417 format!("Service was not ready: {}", e.into()),
15418 )
15419 })?;
15420 let codec = tonic_prost::ProstCodec::default();
15421 let path = http::uri::PathAndQuery::from_static(
15422 "/pidgr.v1.TeamService/AddTeamMembers",
15423 );
15424 let mut req = request.into_request();
15425 req.extensions_mut()
15426 .insert(GrpcMethod::new("pidgr.v1.TeamService", "AddTeamMembers"));
15427 self.inner.unary(req, path, codec).await
15428 }
15429 pub async fn remove_team_members(
15433 &mut self,
15434 request: impl tonic::IntoRequest<super::RemoveTeamMembersRequest>,
15435 ) -> std::result::Result<
15436 tonic::Response<super::RemoveTeamMembersResponse>,
15437 tonic::Status,
15438 > {
15439 self.inner
15440 .ready()
15441 .await
15442 .map_err(|e| {
15443 tonic::Status::unknown(
15444 format!("Service was not ready: {}", e.into()),
15445 )
15446 })?;
15447 let codec = tonic_prost::ProstCodec::default();
15448 let path = http::uri::PathAndQuery::from_static(
15449 "/pidgr.v1.TeamService/RemoveTeamMembers",
15450 );
15451 let mut req = request.into_request();
15452 req.extensions_mut()
15453 .insert(GrpcMethod::new("pidgr.v1.TeamService", "RemoveTeamMembers"));
15454 self.inner.unary(req, path, codec).await
15455 }
15456 pub async fn list_team_members(
15461 &mut self,
15462 request: impl tonic::IntoRequest<super::ListTeamMembersRequest>,
15463 ) -> std::result::Result<
15464 tonic::Response<super::ListTeamMembersResponse>,
15465 tonic::Status,
15466 > {
15467 self.inner
15468 .ready()
15469 .await
15470 .map_err(|e| {
15471 tonic::Status::unknown(
15472 format!("Service was not ready: {}", e.into()),
15473 )
15474 })?;
15475 let codec = tonic_prost::ProstCodec::default();
15476 let path = http::uri::PathAndQuery::from_static(
15477 "/pidgr.v1.TeamService/ListTeamMembers",
15478 );
15479 let mut req = request.into_request();
15480 req.extensions_mut()
15481 .insert(GrpcMethod::new("pidgr.v1.TeamService", "ListTeamMembers"));
15482 self.inner.unary(req, path, codec).await
15483 }
15484 }
15485}
15486pub mod team_service_server {
15488 #![allow(
15489 unused_variables,
15490 dead_code,
15491 missing_docs,
15492 clippy::wildcard_imports,
15493 clippy::let_unit_value,
15494 )]
15495 use tonic::codegen::*;
15496 #[async_trait]
15498 pub trait TeamService: std::marker::Send + std::marker::Sync + 'static {
15499 async fn create_team(
15503 &self,
15504 request: tonic::Request<super::CreateTeamRequest>,
15505 ) -> std::result::Result<
15506 tonic::Response<super::CreateTeamResponse>,
15507 tonic::Status,
15508 >;
15509 async fn get_team(
15514 &self,
15515 request: tonic::Request<super::GetTeamRequest>,
15516 ) -> std::result::Result<tonic::Response<super::GetTeamResponse>, tonic::Status>;
15517 async fn list_teams(
15521 &self,
15522 request: tonic::Request<super::ListTeamsRequest>,
15523 ) -> std::result::Result<
15524 tonic::Response<super::ListTeamsResponse>,
15525 tonic::Status,
15526 >;
15527 async fn update_team(
15531 &self,
15532 request: tonic::Request<super::UpdateTeamRequest>,
15533 ) -> std::result::Result<
15534 tonic::Response<super::UpdateTeamResponse>,
15535 tonic::Status,
15536 >;
15537 async fn delete_team(
15541 &self,
15542 request: tonic::Request<super::DeleteTeamRequest>,
15543 ) -> std::result::Result<
15544 tonic::Response<super::DeleteTeamResponse>,
15545 tonic::Status,
15546 >;
15547 async fn add_team_members(
15551 &self,
15552 request: tonic::Request<super::AddTeamMembersRequest>,
15553 ) -> std::result::Result<
15554 tonic::Response<super::AddTeamMembersResponse>,
15555 tonic::Status,
15556 >;
15557 async fn remove_team_members(
15561 &self,
15562 request: tonic::Request<super::RemoveTeamMembersRequest>,
15563 ) -> std::result::Result<
15564 tonic::Response<super::RemoveTeamMembersResponse>,
15565 tonic::Status,
15566 >;
15567 async fn list_team_members(
15572 &self,
15573 request: tonic::Request<super::ListTeamMembersRequest>,
15574 ) -> std::result::Result<
15575 tonic::Response<super::ListTeamMembersResponse>,
15576 tonic::Status,
15577 >;
15578 }
15579 #[derive(Debug)]
15584 pub struct TeamServiceServer<T> {
15585 inner: Arc<T>,
15586 accept_compression_encodings: EnabledCompressionEncodings,
15587 send_compression_encodings: EnabledCompressionEncodings,
15588 max_decoding_message_size: Option<usize>,
15589 max_encoding_message_size: Option<usize>,
15590 }
15591 impl<T> TeamServiceServer<T> {
15592 pub fn new(inner: T) -> Self {
15593 Self::from_arc(Arc::new(inner))
15594 }
15595 pub fn from_arc(inner: Arc<T>) -> Self {
15596 Self {
15597 inner,
15598 accept_compression_encodings: Default::default(),
15599 send_compression_encodings: Default::default(),
15600 max_decoding_message_size: None,
15601 max_encoding_message_size: None,
15602 }
15603 }
15604 pub fn with_interceptor<F>(
15605 inner: T,
15606 interceptor: F,
15607 ) -> InterceptedService<Self, F>
15608 where
15609 F: tonic::service::Interceptor,
15610 {
15611 InterceptedService::new(Self::new(inner), interceptor)
15612 }
15613 #[must_use]
15615 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
15616 self.accept_compression_encodings.enable(encoding);
15617 self
15618 }
15619 #[must_use]
15621 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
15622 self.send_compression_encodings.enable(encoding);
15623 self
15624 }
15625 #[must_use]
15629 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
15630 self.max_decoding_message_size = Some(limit);
15631 self
15632 }
15633 #[must_use]
15637 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
15638 self.max_encoding_message_size = Some(limit);
15639 self
15640 }
15641 }
15642 impl<T, B> tonic::codegen::Service<http::Request<B>> for TeamServiceServer<T>
15643 where
15644 T: TeamService,
15645 B: Body + std::marker::Send + 'static,
15646 B::Error: Into<StdError> + std::marker::Send + 'static,
15647 {
15648 type Response = http::Response<tonic::body::Body>;
15649 type Error = std::convert::Infallible;
15650 type Future = BoxFuture<Self::Response, Self::Error>;
15651 fn poll_ready(
15652 &mut self,
15653 _cx: &mut Context<'_>,
15654 ) -> Poll<std::result::Result<(), Self::Error>> {
15655 Poll::Ready(Ok(()))
15656 }
15657 fn call(&mut self, req: http::Request<B>) -> Self::Future {
15658 match req.uri().path() {
15659 "/pidgr.v1.TeamService/CreateTeam" => {
15660 #[allow(non_camel_case_types)]
15661 struct CreateTeamSvc<T: TeamService>(pub Arc<T>);
15662 impl<
15663 T: TeamService,
15664 > tonic::server::UnaryService<super::CreateTeamRequest>
15665 for CreateTeamSvc<T> {
15666 type Response = super::CreateTeamResponse;
15667 type Future = BoxFuture<
15668 tonic::Response<Self::Response>,
15669 tonic::Status,
15670 >;
15671 fn call(
15672 &mut self,
15673 request: tonic::Request<super::CreateTeamRequest>,
15674 ) -> Self::Future {
15675 let inner = Arc::clone(&self.0);
15676 let fut = async move {
15677 <T as TeamService>::create_team(&inner, request).await
15678 };
15679 Box::pin(fut)
15680 }
15681 }
15682 let accept_compression_encodings = self.accept_compression_encodings;
15683 let send_compression_encodings = self.send_compression_encodings;
15684 let max_decoding_message_size = self.max_decoding_message_size;
15685 let max_encoding_message_size = self.max_encoding_message_size;
15686 let inner = self.inner.clone();
15687 let fut = async move {
15688 let method = CreateTeamSvc(inner);
15689 let codec = tonic_prost::ProstCodec::default();
15690 let mut grpc = tonic::server::Grpc::new(codec)
15691 .apply_compression_config(
15692 accept_compression_encodings,
15693 send_compression_encodings,
15694 )
15695 .apply_max_message_size_config(
15696 max_decoding_message_size,
15697 max_encoding_message_size,
15698 );
15699 let res = grpc.unary(method, req).await;
15700 Ok(res)
15701 };
15702 Box::pin(fut)
15703 }
15704 "/pidgr.v1.TeamService/GetTeam" => {
15705 #[allow(non_camel_case_types)]
15706 struct GetTeamSvc<T: TeamService>(pub Arc<T>);
15707 impl<
15708 T: TeamService,
15709 > tonic::server::UnaryService<super::GetTeamRequest>
15710 for GetTeamSvc<T> {
15711 type Response = super::GetTeamResponse;
15712 type Future = BoxFuture<
15713 tonic::Response<Self::Response>,
15714 tonic::Status,
15715 >;
15716 fn call(
15717 &mut self,
15718 request: tonic::Request<super::GetTeamRequest>,
15719 ) -> Self::Future {
15720 let inner = Arc::clone(&self.0);
15721 let fut = async move {
15722 <T as TeamService>::get_team(&inner, request).await
15723 };
15724 Box::pin(fut)
15725 }
15726 }
15727 let accept_compression_encodings = self.accept_compression_encodings;
15728 let send_compression_encodings = self.send_compression_encodings;
15729 let max_decoding_message_size = self.max_decoding_message_size;
15730 let max_encoding_message_size = self.max_encoding_message_size;
15731 let inner = self.inner.clone();
15732 let fut = async move {
15733 let method = GetTeamSvc(inner);
15734 let codec = tonic_prost::ProstCodec::default();
15735 let mut grpc = tonic::server::Grpc::new(codec)
15736 .apply_compression_config(
15737 accept_compression_encodings,
15738 send_compression_encodings,
15739 )
15740 .apply_max_message_size_config(
15741 max_decoding_message_size,
15742 max_encoding_message_size,
15743 );
15744 let res = grpc.unary(method, req).await;
15745 Ok(res)
15746 };
15747 Box::pin(fut)
15748 }
15749 "/pidgr.v1.TeamService/ListTeams" => {
15750 #[allow(non_camel_case_types)]
15751 struct ListTeamsSvc<T: TeamService>(pub Arc<T>);
15752 impl<
15753 T: TeamService,
15754 > tonic::server::UnaryService<super::ListTeamsRequest>
15755 for ListTeamsSvc<T> {
15756 type Response = super::ListTeamsResponse;
15757 type Future = BoxFuture<
15758 tonic::Response<Self::Response>,
15759 tonic::Status,
15760 >;
15761 fn call(
15762 &mut self,
15763 request: tonic::Request<super::ListTeamsRequest>,
15764 ) -> Self::Future {
15765 let inner = Arc::clone(&self.0);
15766 let fut = async move {
15767 <T as TeamService>::list_teams(&inner, request).await
15768 };
15769 Box::pin(fut)
15770 }
15771 }
15772 let accept_compression_encodings = self.accept_compression_encodings;
15773 let send_compression_encodings = self.send_compression_encodings;
15774 let max_decoding_message_size = self.max_decoding_message_size;
15775 let max_encoding_message_size = self.max_encoding_message_size;
15776 let inner = self.inner.clone();
15777 let fut = async move {
15778 let method = ListTeamsSvc(inner);
15779 let codec = tonic_prost::ProstCodec::default();
15780 let mut grpc = tonic::server::Grpc::new(codec)
15781 .apply_compression_config(
15782 accept_compression_encodings,
15783 send_compression_encodings,
15784 )
15785 .apply_max_message_size_config(
15786 max_decoding_message_size,
15787 max_encoding_message_size,
15788 );
15789 let res = grpc.unary(method, req).await;
15790 Ok(res)
15791 };
15792 Box::pin(fut)
15793 }
15794 "/pidgr.v1.TeamService/UpdateTeam" => {
15795 #[allow(non_camel_case_types)]
15796 struct UpdateTeamSvc<T: TeamService>(pub Arc<T>);
15797 impl<
15798 T: TeamService,
15799 > tonic::server::UnaryService<super::UpdateTeamRequest>
15800 for UpdateTeamSvc<T> {
15801 type Response = super::UpdateTeamResponse;
15802 type Future = BoxFuture<
15803 tonic::Response<Self::Response>,
15804 tonic::Status,
15805 >;
15806 fn call(
15807 &mut self,
15808 request: tonic::Request<super::UpdateTeamRequest>,
15809 ) -> Self::Future {
15810 let inner = Arc::clone(&self.0);
15811 let fut = async move {
15812 <T as TeamService>::update_team(&inner, request).await
15813 };
15814 Box::pin(fut)
15815 }
15816 }
15817 let accept_compression_encodings = self.accept_compression_encodings;
15818 let send_compression_encodings = self.send_compression_encodings;
15819 let max_decoding_message_size = self.max_decoding_message_size;
15820 let max_encoding_message_size = self.max_encoding_message_size;
15821 let inner = self.inner.clone();
15822 let fut = async move {
15823 let method = UpdateTeamSvc(inner);
15824 let codec = tonic_prost::ProstCodec::default();
15825 let mut grpc = tonic::server::Grpc::new(codec)
15826 .apply_compression_config(
15827 accept_compression_encodings,
15828 send_compression_encodings,
15829 )
15830 .apply_max_message_size_config(
15831 max_decoding_message_size,
15832 max_encoding_message_size,
15833 );
15834 let res = grpc.unary(method, req).await;
15835 Ok(res)
15836 };
15837 Box::pin(fut)
15838 }
15839 "/pidgr.v1.TeamService/DeleteTeam" => {
15840 #[allow(non_camel_case_types)]
15841 struct DeleteTeamSvc<T: TeamService>(pub Arc<T>);
15842 impl<
15843 T: TeamService,
15844 > tonic::server::UnaryService<super::DeleteTeamRequest>
15845 for DeleteTeamSvc<T> {
15846 type Response = super::DeleteTeamResponse;
15847 type Future = BoxFuture<
15848 tonic::Response<Self::Response>,
15849 tonic::Status,
15850 >;
15851 fn call(
15852 &mut self,
15853 request: tonic::Request<super::DeleteTeamRequest>,
15854 ) -> Self::Future {
15855 let inner = Arc::clone(&self.0);
15856 let fut = async move {
15857 <T as TeamService>::delete_team(&inner, request).await
15858 };
15859 Box::pin(fut)
15860 }
15861 }
15862 let accept_compression_encodings = self.accept_compression_encodings;
15863 let send_compression_encodings = self.send_compression_encodings;
15864 let max_decoding_message_size = self.max_decoding_message_size;
15865 let max_encoding_message_size = self.max_encoding_message_size;
15866 let inner = self.inner.clone();
15867 let fut = async move {
15868 let method = DeleteTeamSvc(inner);
15869 let codec = tonic_prost::ProstCodec::default();
15870 let mut grpc = tonic::server::Grpc::new(codec)
15871 .apply_compression_config(
15872 accept_compression_encodings,
15873 send_compression_encodings,
15874 )
15875 .apply_max_message_size_config(
15876 max_decoding_message_size,
15877 max_encoding_message_size,
15878 );
15879 let res = grpc.unary(method, req).await;
15880 Ok(res)
15881 };
15882 Box::pin(fut)
15883 }
15884 "/pidgr.v1.TeamService/AddTeamMembers" => {
15885 #[allow(non_camel_case_types)]
15886 struct AddTeamMembersSvc<T: TeamService>(pub Arc<T>);
15887 impl<
15888 T: TeamService,
15889 > tonic::server::UnaryService<super::AddTeamMembersRequest>
15890 for AddTeamMembersSvc<T> {
15891 type Response = super::AddTeamMembersResponse;
15892 type Future = BoxFuture<
15893 tonic::Response<Self::Response>,
15894 tonic::Status,
15895 >;
15896 fn call(
15897 &mut self,
15898 request: tonic::Request<super::AddTeamMembersRequest>,
15899 ) -> Self::Future {
15900 let inner = Arc::clone(&self.0);
15901 let fut = async move {
15902 <T as TeamService>::add_team_members(&inner, request).await
15903 };
15904 Box::pin(fut)
15905 }
15906 }
15907 let accept_compression_encodings = self.accept_compression_encodings;
15908 let send_compression_encodings = self.send_compression_encodings;
15909 let max_decoding_message_size = self.max_decoding_message_size;
15910 let max_encoding_message_size = self.max_encoding_message_size;
15911 let inner = self.inner.clone();
15912 let fut = async move {
15913 let method = AddTeamMembersSvc(inner);
15914 let codec = tonic_prost::ProstCodec::default();
15915 let mut grpc = tonic::server::Grpc::new(codec)
15916 .apply_compression_config(
15917 accept_compression_encodings,
15918 send_compression_encodings,
15919 )
15920 .apply_max_message_size_config(
15921 max_decoding_message_size,
15922 max_encoding_message_size,
15923 );
15924 let res = grpc.unary(method, req).await;
15925 Ok(res)
15926 };
15927 Box::pin(fut)
15928 }
15929 "/pidgr.v1.TeamService/RemoveTeamMembers" => {
15930 #[allow(non_camel_case_types)]
15931 struct RemoveTeamMembersSvc<T: TeamService>(pub Arc<T>);
15932 impl<
15933 T: TeamService,
15934 > tonic::server::UnaryService<super::RemoveTeamMembersRequest>
15935 for RemoveTeamMembersSvc<T> {
15936 type Response = super::RemoveTeamMembersResponse;
15937 type Future = BoxFuture<
15938 tonic::Response<Self::Response>,
15939 tonic::Status,
15940 >;
15941 fn call(
15942 &mut self,
15943 request: tonic::Request<super::RemoveTeamMembersRequest>,
15944 ) -> Self::Future {
15945 let inner = Arc::clone(&self.0);
15946 let fut = async move {
15947 <T as TeamService>::remove_team_members(&inner, request)
15948 .await
15949 };
15950 Box::pin(fut)
15951 }
15952 }
15953 let accept_compression_encodings = self.accept_compression_encodings;
15954 let send_compression_encodings = self.send_compression_encodings;
15955 let max_decoding_message_size = self.max_decoding_message_size;
15956 let max_encoding_message_size = self.max_encoding_message_size;
15957 let inner = self.inner.clone();
15958 let fut = async move {
15959 let method = RemoveTeamMembersSvc(inner);
15960 let codec = tonic_prost::ProstCodec::default();
15961 let mut grpc = tonic::server::Grpc::new(codec)
15962 .apply_compression_config(
15963 accept_compression_encodings,
15964 send_compression_encodings,
15965 )
15966 .apply_max_message_size_config(
15967 max_decoding_message_size,
15968 max_encoding_message_size,
15969 );
15970 let res = grpc.unary(method, req).await;
15971 Ok(res)
15972 };
15973 Box::pin(fut)
15974 }
15975 "/pidgr.v1.TeamService/ListTeamMembers" => {
15976 #[allow(non_camel_case_types)]
15977 struct ListTeamMembersSvc<T: TeamService>(pub Arc<T>);
15978 impl<
15979 T: TeamService,
15980 > tonic::server::UnaryService<super::ListTeamMembersRequest>
15981 for ListTeamMembersSvc<T> {
15982 type Response = super::ListTeamMembersResponse;
15983 type Future = BoxFuture<
15984 tonic::Response<Self::Response>,
15985 tonic::Status,
15986 >;
15987 fn call(
15988 &mut self,
15989 request: tonic::Request<super::ListTeamMembersRequest>,
15990 ) -> Self::Future {
15991 let inner = Arc::clone(&self.0);
15992 let fut = async move {
15993 <T as TeamService>::list_team_members(&inner, request).await
15994 };
15995 Box::pin(fut)
15996 }
15997 }
15998 let accept_compression_encodings = self.accept_compression_encodings;
15999 let send_compression_encodings = self.send_compression_encodings;
16000 let max_decoding_message_size = self.max_decoding_message_size;
16001 let max_encoding_message_size = self.max_encoding_message_size;
16002 let inner = self.inner.clone();
16003 let fut = async move {
16004 let method = ListTeamMembersSvc(inner);
16005 let codec = tonic_prost::ProstCodec::default();
16006 let mut grpc = tonic::server::Grpc::new(codec)
16007 .apply_compression_config(
16008 accept_compression_encodings,
16009 send_compression_encodings,
16010 )
16011 .apply_max_message_size_config(
16012 max_decoding_message_size,
16013 max_encoding_message_size,
16014 );
16015 let res = grpc.unary(method, req).await;
16016 Ok(res)
16017 };
16018 Box::pin(fut)
16019 }
16020 _ => {
16021 Box::pin(async move {
16022 let mut response = http::Response::new(
16023 tonic::body::Body::default(),
16024 );
16025 let headers = response.headers_mut();
16026 headers
16027 .insert(
16028 tonic::Status::GRPC_STATUS,
16029 (tonic::Code::Unimplemented as i32).into(),
16030 );
16031 headers
16032 .insert(
16033 http::header::CONTENT_TYPE,
16034 tonic::metadata::GRPC_CONTENT_TYPE,
16035 );
16036 Ok(response)
16037 })
16038 }
16039 }
16040 }
16041 }
16042 impl<T> Clone for TeamServiceServer<T> {
16043 fn clone(&self) -> Self {
16044 let inner = self.inner.clone();
16045 Self {
16046 inner,
16047 accept_compression_encodings: self.accept_compression_encodings,
16048 send_compression_encodings: self.send_compression_encodings,
16049 max_decoding_message_size: self.max_decoding_message_size,
16050 max_encoding_message_size: self.max_encoding_message_size,
16051 }
16052 }
16053 }
16054 pub const SERVICE_NAME: &str = "pidgr.v1.TeamService";
16056 impl<T> tonic::server::NamedService for TeamServiceServer<T> {
16057 const NAME: &'static str = SERVICE_NAME;
16058 }
16059}
16060pub mod template_service_client {
16062 #![allow(
16063 unused_variables,
16064 dead_code,
16065 missing_docs,
16066 clippy::wildcard_imports,
16067 clippy::let_unit_value,
16068 )]
16069 use tonic::codegen::*;
16070 use tonic::codegen::http::Uri;
16071 #[derive(Debug, Clone)]
16075 pub struct TemplateServiceClient<T> {
16076 inner: tonic::client::Grpc<T>,
16077 }
16078 impl TemplateServiceClient<tonic::transport::Channel> {
16079 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
16081 where
16082 D: TryInto<tonic::transport::Endpoint>,
16083 D::Error: Into<StdError>,
16084 {
16085 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
16086 Ok(Self::new(conn))
16087 }
16088 }
16089 impl<T> TemplateServiceClient<T>
16090 where
16091 T: tonic::client::GrpcService<tonic::body::Body>,
16092 T::Error: Into<StdError>,
16093 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
16094 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
16095 {
16096 pub fn new(inner: T) -> Self {
16097 let inner = tonic::client::Grpc::new(inner);
16098 Self { inner }
16099 }
16100 pub fn with_origin(inner: T, origin: Uri) -> Self {
16101 let inner = tonic::client::Grpc::with_origin(inner, origin);
16102 Self { inner }
16103 }
16104 pub fn with_interceptor<F>(
16105 inner: T,
16106 interceptor: F,
16107 ) -> TemplateServiceClient<InterceptedService<T, F>>
16108 where
16109 F: tonic::service::Interceptor,
16110 T::ResponseBody: Default,
16111 T: tonic::codegen::Service<
16112 http::Request<tonic::body::Body>,
16113 Response = http::Response<
16114 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
16115 >,
16116 >,
16117 <T as tonic::codegen::Service<
16118 http::Request<tonic::body::Body>,
16119 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
16120 {
16121 TemplateServiceClient::new(InterceptedService::new(inner, interceptor))
16122 }
16123 #[must_use]
16128 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
16129 self.inner = self.inner.send_compressed(encoding);
16130 self
16131 }
16132 #[must_use]
16134 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
16135 self.inner = self.inner.accept_compressed(encoding);
16136 self
16137 }
16138 #[must_use]
16142 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
16143 self.inner = self.inner.max_decoding_message_size(limit);
16144 self
16145 }
16146 #[must_use]
16150 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
16151 self.inner = self.inner.max_encoding_message_size(limit);
16152 self
16153 }
16154 pub async fn create_template(
16158 &mut self,
16159 request: impl tonic::IntoRequest<super::CreateTemplateRequest>,
16160 ) -> std::result::Result<
16161 tonic::Response<super::CreateTemplateResponse>,
16162 tonic::Status,
16163 > {
16164 self.inner
16165 .ready()
16166 .await
16167 .map_err(|e| {
16168 tonic::Status::unknown(
16169 format!("Service was not ready: {}", e.into()),
16170 )
16171 })?;
16172 let codec = tonic_prost::ProstCodec::default();
16173 let path = http::uri::PathAndQuery::from_static(
16174 "/pidgr.v1.TemplateService/CreateTemplate",
16175 );
16176 let mut req = request.into_request();
16177 req.extensions_mut()
16178 .insert(GrpcMethod::new("pidgr.v1.TemplateService", "CreateTemplate"));
16179 self.inner.unary(req, path, codec).await
16180 }
16181 pub async fn update_template(
16185 &mut self,
16186 request: impl tonic::IntoRequest<super::UpdateTemplateRequest>,
16187 ) -> std::result::Result<
16188 tonic::Response<super::UpdateTemplateResponse>,
16189 tonic::Status,
16190 > {
16191 self.inner
16192 .ready()
16193 .await
16194 .map_err(|e| {
16195 tonic::Status::unknown(
16196 format!("Service was not ready: {}", e.into()),
16197 )
16198 })?;
16199 let codec = tonic_prost::ProstCodec::default();
16200 let path = http::uri::PathAndQuery::from_static(
16201 "/pidgr.v1.TemplateService/UpdateTemplate",
16202 );
16203 let mut req = request.into_request();
16204 req.extensions_mut()
16205 .insert(GrpcMethod::new("pidgr.v1.TemplateService", "UpdateTemplate"));
16206 self.inner.unary(req, path, codec).await
16207 }
16208 pub async fn get_template(
16212 &mut self,
16213 request: impl tonic::IntoRequest<super::GetTemplateRequest>,
16214 ) -> std::result::Result<
16215 tonic::Response<super::GetTemplateResponse>,
16216 tonic::Status,
16217 > {
16218 self.inner
16219 .ready()
16220 .await
16221 .map_err(|e| {
16222 tonic::Status::unknown(
16223 format!("Service was not ready: {}", e.into()),
16224 )
16225 })?;
16226 let codec = tonic_prost::ProstCodec::default();
16227 let path = http::uri::PathAndQuery::from_static(
16228 "/pidgr.v1.TemplateService/GetTemplate",
16229 );
16230 let mut req = request.into_request();
16231 req.extensions_mut()
16232 .insert(GrpcMethod::new("pidgr.v1.TemplateService", "GetTemplate"));
16233 self.inner.unary(req, path, codec).await
16234 }
16235 pub async fn list_templates(
16239 &mut self,
16240 request: impl tonic::IntoRequest<super::ListTemplatesRequest>,
16241 ) -> std::result::Result<
16242 tonic::Response<super::ListTemplatesResponse>,
16243 tonic::Status,
16244 > {
16245 self.inner
16246 .ready()
16247 .await
16248 .map_err(|e| {
16249 tonic::Status::unknown(
16250 format!("Service was not ready: {}", e.into()),
16251 )
16252 })?;
16253 let codec = tonic_prost::ProstCodec::default();
16254 let path = http::uri::PathAndQuery::from_static(
16255 "/pidgr.v1.TemplateService/ListTemplates",
16256 );
16257 let mut req = request.into_request();
16258 req.extensions_mut()
16259 .insert(GrpcMethod::new("pidgr.v1.TemplateService", "ListTemplates"));
16260 self.inner.unary(req, path, codec).await
16261 }
16262 pub async fn create_template_translation(
16266 &mut self,
16267 request: impl tonic::IntoRequest<super::CreateTemplateTranslationRequest>,
16268 ) -> std::result::Result<
16269 tonic::Response<super::CreateTemplateTranslationResponse>,
16270 tonic::Status,
16271 > {
16272 self.inner
16273 .ready()
16274 .await
16275 .map_err(|e| {
16276 tonic::Status::unknown(
16277 format!("Service was not ready: {}", e.into()),
16278 )
16279 })?;
16280 let codec = tonic_prost::ProstCodec::default();
16281 let path = http::uri::PathAndQuery::from_static(
16282 "/pidgr.v1.TemplateService/CreateTemplateTranslation",
16283 );
16284 let mut req = request.into_request();
16285 req.extensions_mut()
16286 .insert(
16287 GrpcMethod::new(
16288 "pidgr.v1.TemplateService",
16289 "CreateTemplateTranslation",
16290 ),
16291 );
16292 self.inner.unary(req, path, codec).await
16293 }
16294 pub async fn update_template_translation(
16298 &mut self,
16299 request: impl tonic::IntoRequest<super::UpdateTemplateTranslationRequest>,
16300 ) -> std::result::Result<
16301 tonic::Response<super::UpdateTemplateTranslationResponse>,
16302 tonic::Status,
16303 > {
16304 self.inner
16305 .ready()
16306 .await
16307 .map_err(|e| {
16308 tonic::Status::unknown(
16309 format!("Service was not ready: {}", e.into()),
16310 )
16311 })?;
16312 let codec = tonic_prost::ProstCodec::default();
16313 let path = http::uri::PathAndQuery::from_static(
16314 "/pidgr.v1.TemplateService/UpdateTemplateTranslation",
16315 );
16316 let mut req = request.into_request();
16317 req.extensions_mut()
16318 .insert(
16319 GrpcMethod::new(
16320 "pidgr.v1.TemplateService",
16321 "UpdateTemplateTranslation",
16322 ),
16323 );
16324 self.inner.unary(req, path, codec).await
16325 }
16326 pub async fn list_template_translations(
16330 &mut self,
16331 request: impl tonic::IntoRequest<super::ListTemplateTranslationsRequest>,
16332 ) -> std::result::Result<
16333 tonic::Response<super::ListTemplateTranslationsResponse>,
16334 tonic::Status,
16335 > {
16336 self.inner
16337 .ready()
16338 .await
16339 .map_err(|e| {
16340 tonic::Status::unknown(
16341 format!("Service was not ready: {}", e.into()),
16342 )
16343 })?;
16344 let codec = tonic_prost::ProstCodec::default();
16345 let path = http::uri::PathAndQuery::from_static(
16346 "/pidgr.v1.TemplateService/ListTemplateTranslations",
16347 );
16348 let mut req = request.into_request();
16349 req.extensions_mut()
16350 .insert(
16351 GrpcMethod::new(
16352 "pidgr.v1.TemplateService",
16353 "ListTemplateTranslations",
16354 ),
16355 );
16356 self.inner.unary(req, path, codec).await
16357 }
16358 pub async fn approve_template_translation(
16362 &mut self,
16363 request: impl tonic::IntoRequest<super::ApproveTemplateTranslationRequest>,
16364 ) -> std::result::Result<
16365 tonic::Response<super::ApproveTemplateTranslationResponse>,
16366 tonic::Status,
16367 > {
16368 self.inner
16369 .ready()
16370 .await
16371 .map_err(|e| {
16372 tonic::Status::unknown(
16373 format!("Service was not ready: {}", e.into()),
16374 )
16375 })?;
16376 let codec = tonic_prost::ProstCodec::default();
16377 let path = http::uri::PathAndQuery::from_static(
16378 "/pidgr.v1.TemplateService/ApproveTemplateTranslation",
16379 );
16380 let mut req = request.into_request();
16381 req.extensions_mut()
16382 .insert(
16383 GrpcMethod::new(
16384 "pidgr.v1.TemplateService",
16385 "ApproveTemplateTranslation",
16386 ),
16387 );
16388 self.inner.unary(req, path, codec).await
16389 }
16390 }
16391}
16392pub mod template_service_server {
16394 #![allow(
16395 unused_variables,
16396 dead_code,
16397 missing_docs,
16398 clippy::wildcard_imports,
16399 clippy::let_unit_value,
16400 )]
16401 use tonic::codegen::*;
16402 #[async_trait]
16404 pub trait TemplateService: std::marker::Send + std::marker::Sync + 'static {
16405 async fn create_template(
16409 &self,
16410 request: tonic::Request<super::CreateTemplateRequest>,
16411 ) -> std::result::Result<
16412 tonic::Response<super::CreateTemplateResponse>,
16413 tonic::Status,
16414 >;
16415 async fn update_template(
16419 &self,
16420 request: tonic::Request<super::UpdateTemplateRequest>,
16421 ) -> std::result::Result<
16422 tonic::Response<super::UpdateTemplateResponse>,
16423 tonic::Status,
16424 >;
16425 async fn get_template(
16429 &self,
16430 request: tonic::Request<super::GetTemplateRequest>,
16431 ) -> std::result::Result<
16432 tonic::Response<super::GetTemplateResponse>,
16433 tonic::Status,
16434 >;
16435 async fn list_templates(
16439 &self,
16440 request: tonic::Request<super::ListTemplatesRequest>,
16441 ) -> std::result::Result<
16442 tonic::Response<super::ListTemplatesResponse>,
16443 tonic::Status,
16444 >;
16445 async fn create_template_translation(
16449 &self,
16450 request: tonic::Request<super::CreateTemplateTranslationRequest>,
16451 ) -> std::result::Result<
16452 tonic::Response<super::CreateTemplateTranslationResponse>,
16453 tonic::Status,
16454 >;
16455 async fn update_template_translation(
16459 &self,
16460 request: tonic::Request<super::UpdateTemplateTranslationRequest>,
16461 ) -> std::result::Result<
16462 tonic::Response<super::UpdateTemplateTranslationResponse>,
16463 tonic::Status,
16464 >;
16465 async fn list_template_translations(
16469 &self,
16470 request: tonic::Request<super::ListTemplateTranslationsRequest>,
16471 ) -> std::result::Result<
16472 tonic::Response<super::ListTemplateTranslationsResponse>,
16473 tonic::Status,
16474 >;
16475 async fn approve_template_translation(
16479 &self,
16480 request: tonic::Request<super::ApproveTemplateTranslationRequest>,
16481 ) -> std::result::Result<
16482 tonic::Response<super::ApproveTemplateTranslationResponse>,
16483 tonic::Status,
16484 >;
16485 }
16486 #[derive(Debug)]
16490 pub struct TemplateServiceServer<T> {
16491 inner: Arc<T>,
16492 accept_compression_encodings: EnabledCompressionEncodings,
16493 send_compression_encodings: EnabledCompressionEncodings,
16494 max_decoding_message_size: Option<usize>,
16495 max_encoding_message_size: Option<usize>,
16496 }
16497 impl<T> TemplateServiceServer<T> {
16498 pub fn new(inner: T) -> Self {
16499 Self::from_arc(Arc::new(inner))
16500 }
16501 pub fn from_arc(inner: Arc<T>) -> Self {
16502 Self {
16503 inner,
16504 accept_compression_encodings: Default::default(),
16505 send_compression_encodings: Default::default(),
16506 max_decoding_message_size: None,
16507 max_encoding_message_size: None,
16508 }
16509 }
16510 pub fn with_interceptor<F>(
16511 inner: T,
16512 interceptor: F,
16513 ) -> InterceptedService<Self, F>
16514 where
16515 F: tonic::service::Interceptor,
16516 {
16517 InterceptedService::new(Self::new(inner), interceptor)
16518 }
16519 #[must_use]
16521 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
16522 self.accept_compression_encodings.enable(encoding);
16523 self
16524 }
16525 #[must_use]
16527 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
16528 self.send_compression_encodings.enable(encoding);
16529 self
16530 }
16531 #[must_use]
16535 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
16536 self.max_decoding_message_size = Some(limit);
16537 self
16538 }
16539 #[must_use]
16543 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
16544 self.max_encoding_message_size = Some(limit);
16545 self
16546 }
16547 }
16548 impl<T, B> tonic::codegen::Service<http::Request<B>> for TemplateServiceServer<T>
16549 where
16550 T: TemplateService,
16551 B: Body + std::marker::Send + 'static,
16552 B::Error: Into<StdError> + std::marker::Send + 'static,
16553 {
16554 type Response = http::Response<tonic::body::Body>;
16555 type Error = std::convert::Infallible;
16556 type Future = BoxFuture<Self::Response, Self::Error>;
16557 fn poll_ready(
16558 &mut self,
16559 _cx: &mut Context<'_>,
16560 ) -> Poll<std::result::Result<(), Self::Error>> {
16561 Poll::Ready(Ok(()))
16562 }
16563 fn call(&mut self, req: http::Request<B>) -> Self::Future {
16564 match req.uri().path() {
16565 "/pidgr.v1.TemplateService/CreateTemplate" => {
16566 #[allow(non_camel_case_types)]
16567 struct CreateTemplateSvc<T: TemplateService>(pub Arc<T>);
16568 impl<
16569 T: TemplateService,
16570 > tonic::server::UnaryService<super::CreateTemplateRequest>
16571 for CreateTemplateSvc<T> {
16572 type Response = super::CreateTemplateResponse;
16573 type Future = BoxFuture<
16574 tonic::Response<Self::Response>,
16575 tonic::Status,
16576 >;
16577 fn call(
16578 &mut self,
16579 request: tonic::Request<super::CreateTemplateRequest>,
16580 ) -> Self::Future {
16581 let inner = Arc::clone(&self.0);
16582 let fut = async move {
16583 <T as TemplateService>::create_template(&inner, request)
16584 .await
16585 };
16586 Box::pin(fut)
16587 }
16588 }
16589 let accept_compression_encodings = self.accept_compression_encodings;
16590 let send_compression_encodings = self.send_compression_encodings;
16591 let max_decoding_message_size = self.max_decoding_message_size;
16592 let max_encoding_message_size = self.max_encoding_message_size;
16593 let inner = self.inner.clone();
16594 let fut = async move {
16595 let method = CreateTemplateSvc(inner);
16596 let codec = tonic_prost::ProstCodec::default();
16597 let mut grpc = tonic::server::Grpc::new(codec)
16598 .apply_compression_config(
16599 accept_compression_encodings,
16600 send_compression_encodings,
16601 )
16602 .apply_max_message_size_config(
16603 max_decoding_message_size,
16604 max_encoding_message_size,
16605 );
16606 let res = grpc.unary(method, req).await;
16607 Ok(res)
16608 };
16609 Box::pin(fut)
16610 }
16611 "/pidgr.v1.TemplateService/UpdateTemplate" => {
16612 #[allow(non_camel_case_types)]
16613 struct UpdateTemplateSvc<T: TemplateService>(pub Arc<T>);
16614 impl<
16615 T: TemplateService,
16616 > tonic::server::UnaryService<super::UpdateTemplateRequest>
16617 for UpdateTemplateSvc<T> {
16618 type Response = super::UpdateTemplateResponse;
16619 type Future = BoxFuture<
16620 tonic::Response<Self::Response>,
16621 tonic::Status,
16622 >;
16623 fn call(
16624 &mut self,
16625 request: tonic::Request<super::UpdateTemplateRequest>,
16626 ) -> Self::Future {
16627 let inner = Arc::clone(&self.0);
16628 let fut = async move {
16629 <T as TemplateService>::update_template(&inner, request)
16630 .await
16631 };
16632 Box::pin(fut)
16633 }
16634 }
16635 let accept_compression_encodings = self.accept_compression_encodings;
16636 let send_compression_encodings = self.send_compression_encodings;
16637 let max_decoding_message_size = self.max_decoding_message_size;
16638 let max_encoding_message_size = self.max_encoding_message_size;
16639 let inner = self.inner.clone();
16640 let fut = async move {
16641 let method = UpdateTemplateSvc(inner);
16642 let codec = tonic_prost::ProstCodec::default();
16643 let mut grpc = tonic::server::Grpc::new(codec)
16644 .apply_compression_config(
16645 accept_compression_encodings,
16646 send_compression_encodings,
16647 )
16648 .apply_max_message_size_config(
16649 max_decoding_message_size,
16650 max_encoding_message_size,
16651 );
16652 let res = grpc.unary(method, req).await;
16653 Ok(res)
16654 };
16655 Box::pin(fut)
16656 }
16657 "/pidgr.v1.TemplateService/GetTemplate" => {
16658 #[allow(non_camel_case_types)]
16659 struct GetTemplateSvc<T: TemplateService>(pub Arc<T>);
16660 impl<
16661 T: TemplateService,
16662 > tonic::server::UnaryService<super::GetTemplateRequest>
16663 for GetTemplateSvc<T> {
16664 type Response = super::GetTemplateResponse;
16665 type Future = BoxFuture<
16666 tonic::Response<Self::Response>,
16667 tonic::Status,
16668 >;
16669 fn call(
16670 &mut self,
16671 request: tonic::Request<super::GetTemplateRequest>,
16672 ) -> Self::Future {
16673 let inner = Arc::clone(&self.0);
16674 let fut = async move {
16675 <T as TemplateService>::get_template(&inner, request).await
16676 };
16677 Box::pin(fut)
16678 }
16679 }
16680 let accept_compression_encodings = self.accept_compression_encodings;
16681 let send_compression_encodings = self.send_compression_encodings;
16682 let max_decoding_message_size = self.max_decoding_message_size;
16683 let max_encoding_message_size = self.max_encoding_message_size;
16684 let inner = self.inner.clone();
16685 let fut = async move {
16686 let method = GetTemplateSvc(inner);
16687 let codec = tonic_prost::ProstCodec::default();
16688 let mut grpc = tonic::server::Grpc::new(codec)
16689 .apply_compression_config(
16690 accept_compression_encodings,
16691 send_compression_encodings,
16692 )
16693 .apply_max_message_size_config(
16694 max_decoding_message_size,
16695 max_encoding_message_size,
16696 );
16697 let res = grpc.unary(method, req).await;
16698 Ok(res)
16699 };
16700 Box::pin(fut)
16701 }
16702 "/pidgr.v1.TemplateService/ListTemplates" => {
16703 #[allow(non_camel_case_types)]
16704 struct ListTemplatesSvc<T: TemplateService>(pub Arc<T>);
16705 impl<
16706 T: TemplateService,
16707 > tonic::server::UnaryService<super::ListTemplatesRequest>
16708 for ListTemplatesSvc<T> {
16709 type Response = super::ListTemplatesResponse;
16710 type Future = BoxFuture<
16711 tonic::Response<Self::Response>,
16712 tonic::Status,
16713 >;
16714 fn call(
16715 &mut self,
16716 request: tonic::Request<super::ListTemplatesRequest>,
16717 ) -> Self::Future {
16718 let inner = Arc::clone(&self.0);
16719 let fut = async move {
16720 <T as TemplateService>::list_templates(&inner, request)
16721 .await
16722 };
16723 Box::pin(fut)
16724 }
16725 }
16726 let accept_compression_encodings = self.accept_compression_encodings;
16727 let send_compression_encodings = self.send_compression_encodings;
16728 let max_decoding_message_size = self.max_decoding_message_size;
16729 let max_encoding_message_size = self.max_encoding_message_size;
16730 let inner = self.inner.clone();
16731 let fut = async move {
16732 let method = ListTemplatesSvc(inner);
16733 let codec = tonic_prost::ProstCodec::default();
16734 let mut grpc = tonic::server::Grpc::new(codec)
16735 .apply_compression_config(
16736 accept_compression_encodings,
16737 send_compression_encodings,
16738 )
16739 .apply_max_message_size_config(
16740 max_decoding_message_size,
16741 max_encoding_message_size,
16742 );
16743 let res = grpc.unary(method, req).await;
16744 Ok(res)
16745 };
16746 Box::pin(fut)
16747 }
16748 "/pidgr.v1.TemplateService/CreateTemplateTranslation" => {
16749 #[allow(non_camel_case_types)]
16750 struct CreateTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
16751 impl<
16752 T: TemplateService,
16753 > tonic::server::UnaryService<
16754 super::CreateTemplateTranslationRequest,
16755 > for CreateTemplateTranslationSvc<T> {
16756 type Response = super::CreateTemplateTranslationResponse;
16757 type Future = BoxFuture<
16758 tonic::Response<Self::Response>,
16759 tonic::Status,
16760 >;
16761 fn call(
16762 &mut self,
16763 request: tonic::Request<
16764 super::CreateTemplateTranslationRequest,
16765 >,
16766 ) -> Self::Future {
16767 let inner = Arc::clone(&self.0);
16768 let fut = async move {
16769 <T as TemplateService>::create_template_translation(
16770 &inner,
16771 request,
16772 )
16773 .await
16774 };
16775 Box::pin(fut)
16776 }
16777 }
16778 let accept_compression_encodings = self.accept_compression_encodings;
16779 let send_compression_encodings = self.send_compression_encodings;
16780 let max_decoding_message_size = self.max_decoding_message_size;
16781 let max_encoding_message_size = self.max_encoding_message_size;
16782 let inner = self.inner.clone();
16783 let fut = async move {
16784 let method = CreateTemplateTranslationSvc(inner);
16785 let codec = tonic_prost::ProstCodec::default();
16786 let mut grpc = tonic::server::Grpc::new(codec)
16787 .apply_compression_config(
16788 accept_compression_encodings,
16789 send_compression_encodings,
16790 )
16791 .apply_max_message_size_config(
16792 max_decoding_message_size,
16793 max_encoding_message_size,
16794 );
16795 let res = grpc.unary(method, req).await;
16796 Ok(res)
16797 };
16798 Box::pin(fut)
16799 }
16800 "/pidgr.v1.TemplateService/UpdateTemplateTranslation" => {
16801 #[allow(non_camel_case_types)]
16802 struct UpdateTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
16803 impl<
16804 T: TemplateService,
16805 > tonic::server::UnaryService<
16806 super::UpdateTemplateTranslationRequest,
16807 > for UpdateTemplateTranslationSvc<T> {
16808 type Response = super::UpdateTemplateTranslationResponse;
16809 type Future = BoxFuture<
16810 tonic::Response<Self::Response>,
16811 tonic::Status,
16812 >;
16813 fn call(
16814 &mut self,
16815 request: tonic::Request<
16816 super::UpdateTemplateTranslationRequest,
16817 >,
16818 ) -> Self::Future {
16819 let inner = Arc::clone(&self.0);
16820 let fut = async move {
16821 <T as TemplateService>::update_template_translation(
16822 &inner,
16823 request,
16824 )
16825 .await
16826 };
16827 Box::pin(fut)
16828 }
16829 }
16830 let accept_compression_encodings = self.accept_compression_encodings;
16831 let send_compression_encodings = self.send_compression_encodings;
16832 let max_decoding_message_size = self.max_decoding_message_size;
16833 let max_encoding_message_size = self.max_encoding_message_size;
16834 let inner = self.inner.clone();
16835 let fut = async move {
16836 let method = UpdateTemplateTranslationSvc(inner);
16837 let codec = tonic_prost::ProstCodec::default();
16838 let mut grpc = tonic::server::Grpc::new(codec)
16839 .apply_compression_config(
16840 accept_compression_encodings,
16841 send_compression_encodings,
16842 )
16843 .apply_max_message_size_config(
16844 max_decoding_message_size,
16845 max_encoding_message_size,
16846 );
16847 let res = grpc.unary(method, req).await;
16848 Ok(res)
16849 };
16850 Box::pin(fut)
16851 }
16852 "/pidgr.v1.TemplateService/ListTemplateTranslations" => {
16853 #[allow(non_camel_case_types)]
16854 struct ListTemplateTranslationsSvc<T: TemplateService>(pub Arc<T>);
16855 impl<
16856 T: TemplateService,
16857 > tonic::server::UnaryService<super::ListTemplateTranslationsRequest>
16858 for ListTemplateTranslationsSvc<T> {
16859 type Response = super::ListTemplateTranslationsResponse;
16860 type Future = BoxFuture<
16861 tonic::Response<Self::Response>,
16862 tonic::Status,
16863 >;
16864 fn call(
16865 &mut self,
16866 request: tonic::Request<
16867 super::ListTemplateTranslationsRequest,
16868 >,
16869 ) -> Self::Future {
16870 let inner = Arc::clone(&self.0);
16871 let fut = async move {
16872 <T as TemplateService>::list_template_translations(
16873 &inner,
16874 request,
16875 )
16876 .await
16877 };
16878 Box::pin(fut)
16879 }
16880 }
16881 let accept_compression_encodings = self.accept_compression_encodings;
16882 let send_compression_encodings = self.send_compression_encodings;
16883 let max_decoding_message_size = self.max_decoding_message_size;
16884 let max_encoding_message_size = self.max_encoding_message_size;
16885 let inner = self.inner.clone();
16886 let fut = async move {
16887 let method = ListTemplateTranslationsSvc(inner);
16888 let codec = tonic_prost::ProstCodec::default();
16889 let mut grpc = tonic::server::Grpc::new(codec)
16890 .apply_compression_config(
16891 accept_compression_encodings,
16892 send_compression_encodings,
16893 )
16894 .apply_max_message_size_config(
16895 max_decoding_message_size,
16896 max_encoding_message_size,
16897 );
16898 let res = grpc.unary(method, req).await;
16899 Ok(res)
16900 };
16901 Box::pin(fut)
16902 }
16903 "/pidgr.v1.TemplateService/ApproveTemplateTranslation" => {
16904 #[allow(non_camel_case_types)]
16905 struct ApproveTemplateTranslationSvc<T: TemplateService>(pub Arc<T>);
16906 impl<
16907 T: TemplateService,
16908 > tonic::server::UnaryService<
16909 super::ApproveTemplateTranslationRequest,
16910 > for ApproveTemplateTranslationSvc<T> {
16911 type Response = super::ApproveTemplateTranslationResponse;
16912 type Future = BoxFuture<
16913 tonic::Response<Self::Response>,
16914 tonic::Status,
16915 >;
16916 fn call(
16917 &mut self,
16918 request: tonic::Request<
16919 super::ApproveTemplateTranslationRequest,
16920 >,
16921 ) -> Self::Future {
16922 let inner = Arc::clone(&self.0);
16923 let fut = async move {
16924 <T as TemplateService>::approve_template_translation(
16925 &inner,
16926 request,
16927 )
16928 .await
16929 };
16930 Box::pin(fut)
16931 }
16932 }
16933 let accept_compression_encodings = self.accept_compression_encodings;
16934 let send_compression_encodings = self.send_compression_encodings;
16935 let max_decoding_message_size = self.max_decoding_message_size;
16936 let max_encoding_message_size = self.max_encoding_message_size;
16937 let inner = self.inner.clone();
16938 let fut = async move {
16939 let method = ApproveTemplateTranslationSvc(inner);
16940 let codec = tonic_prost::ProstCodec::default();
16941 let mut grpc = tonic::server::Grpc::new(codec)
16942 .apply_compression_config(
16943 accept_compression_encodings,
16944 send_compression_encodings,
16945 )
16946 .apply_max_message_size_config(
16947 max_decoding_message_size,
16948 max_encoding_message_size,
16949 );
16950 let res = grpc.unary(method, req).await;
16951 Ok(res)
16952 };
16953 Box::pin(fut)
16954 }
16955 _ => {
16956 Box::pin(async move {
16957 let mut response = http::Response::new(
16958 tonic::body::Body::default(),
16959 );
16960 let headers = response.headers_mut();
16961 headers
16962 .insert(
16963 tonic::Status::GRPC_STATUS,
16964 (tonic::Code::Unimplemented as i32).into(),
16965 );
16966 headers
16967 .insert(
16968 http::header::CONTENT_TYPE,
16969 tonic::metadata::GRPC_CONTENT_TYPE,
16970 );
16971 Ok(response)
16972 })
16973 }
16974 }
16975 }
16976 }
16977 impl<T> Clone for TemplateServiceServer<T> {
16978 fn clone(&self) -> Self {
16979 let inner = self.inner.clone();
16980 Self {
16981 inner,
16982 accept_compression_encodings: self.accept_compression_encodings,
16983 send_compression_encodings: self.send_compression_encodings,
16984 max_decoding_message_size: self.max_decoding_message_size,
16985 max_encoding_message_size: self.max_encoding_message_size,
16986 }
16987 }
16988 }
16989 pub const SERVICE_NAME: &str = "pidgr.v1.TemplateService";
16991 impl<T> tonic::server::NamedService for TemplateServiceServer<T> {
16992 const NAME: &'static str = SERVICE_NAME;
16993 }
16994}
16995pub mod token_service_client {
16997 #![allow(
16998 unused_variables,
16999 dead_code,
17000 missing_docs,
17001 clippy::wildcard_imports,
17002 clippy::let_unit_value,
17003 )]
17004 use tonic::codegen::*;
17005 use tonic::codegen::http::Uri;
17006 #[derive(Debug, Clone)]
17016 pub struct TokenServiceClient<T> {
17017 inner: tonic::client::Grpc<T>,
17018 }
17019 impl TokenServiceClient<tonic::transport::Channel> {
17020 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
17022 where
17023 D: TryInto<tonic::transport::Endpoint>,
17024 D::Error: Into<StdError>,
17025 {
17026 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
17027 Ok(Self::new(conn))
17028 }
17029 }
17030 impl<T> TokenServiceClient<T>
17031 where
17032 T: tonic::client::GrpcService<tonic::body::Body>,
17033 T::Error: Into<StdError>,
17034 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
17035 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
17036 {
17037 pub fn new(inner: T) -> Self {
17038 let inner = tonic::client::Grpc::new(inner);
17039 Self { inner }
17040 }
17041 pub fn with_origin(inner: T, origin: Uri) -> Self {
17042 let inner = tonic::client::Grpc::with_origin(inner, origin);
17043 Self { inner }
17044 }
17045 pub fn with_interceptor<F>(
17046 inner: T,
17047 interceptor: F,
17048 ) -> TokenServiceClient<InterceptedService<T, F>>
17049 where
17050 F: tonic::service::Interceptor,
17051 T::ResponseBody: Default,
17052 T: tonic::codegen::Service<
17053 http::Request<tonic::body::Body>,
17054 Response = http::Response<
17055 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
17056 >,
17057 >,
17058 <T as tonic::codegen::Service<
17059 http::Request<tonic::body::Body>,
17060 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
17061 {
17062 TokenServiceClient::new(InterceptedService::new(inner, interceptor))
17063 }
17064 #[must_use]
17069 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
17070 self.inner = self.inner.send_compressed(encoding);
17071 self
17072 }
17073 #[must_use]
17075 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
17076 self.inner = self.inner.accept_compressed(encoding);
17077 self
17078 }
17079 #[must_use]
17083 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
17084 self.inner = self.inner.max_decoding_message_size(limit);
17085 self
17086 }
17087 #[must_use]
17091 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
17092 self.inner = self.inner.max_encoding_message_size(limit);
17093 self
17094 }
17095 pub async fn sign_deeplink_token(
17100 &mut self,
17101 request: impl tonic::IntoRequest<super::SignDeeplinkTokenRequest>,
17102 ) -> std::result::Result<
17103 tonic::Response<super::SignDeeplinkTokenResponse>,
17104 tonic::Status,
17105 > {
17106 self.inner
17107 .ready()
17108 .await
17109 .map_err(|e| {
17110 tonic::Status::unknown(
17111 format!("Service was not ready: {}", e.into()),
17112 )
17113 })?;
17114 let codec = tonic_prost::ProstCodec::default();
17115 let path = http::uri::PathAndQuery::from_static(
17116 "/pidgr.v1.TokenService/SignDeeplinkToken",
17117 );
17118 let mut req = request.into_request();
17119 req.extensions_mut()
17120 .insert(GrpcMethod::new("pidgr.v1.TokenService", "SignDeeplinkToken"));
17121 self.inner.unary(req, path, codec).await
17122 }
17123 pub async fn validate_deeplink_token(
17128 &mut self,
17129 request: impl tonic::IntoRequest<super::ValidateDeeplinkTokenRequest>,
17130 ) -> std::result::Result<
17131 tonic::Response<super::ValidateDeeplinkTokenResponse>,
17132 tonic::Status,
17133 > {
17134 self.inner
17135 .ready()
17136 .await
17137 .map_err(|e| {
17138 tonic::Status::unknown(
17139 format!("Service was not ready: {}", e.into()),
17140 )
17141 })?;
17142 let codec = tonic_prost::ProstCodec::default();
17143 let path = http::uri::PathAndQuery::from_static(
17144 "/pidgr.v1.TokenService/ValidateDeeplinkToken",
17145 );
17146 let mut req = request.into_request();
17147 req.extensions_mut()
17148 .insert(
17149 GrpcMethod::new("pidgr.v1.TokenService", "ValidateDeeplinkToken"),
17150 );
17151 self.inner.unary(req, path, codec).await
17152 }
17153 }
17154}
17155pub mod token_service_server {
17157 #![allow(
17158 unused_variables,
17159 dead_code,
17160 missing_docs,
17161 clippy::wildcard_imports,
17162 clippy::let_unit_value,
17163 )]
17164 use tonic::codegen::*;
17165 #[async_trait]
17167 pub trait TokenService: std::marker::Send + std::marker::Sync + 'static {
17168 async fn sign_deeplink_token(
17173 &self,
17174 request: tonic::Request<super::SignDeeplinkTokenRequest>,
17175 ) -> std::result::Result<
17176 tonic::Response<super::SignDeeplinkTokenResponse>,
17177 tonic::Status,
17178 >;
17179 async fn validate_deeplink_token(
17184 &self,
17185 request: tonic::Request<super::ValidateDeeplinkTokenRequest>,
17186 ) -> std::result::Result<
17187 tonic::Response<super::ValidateDeeplinkTokenResponse>,
17188 tonic::Status,
17189 >;
17190 }
17191 #[derive(Debug)]
17201 pub struct TokenServiceServer<T> {
17202 inner: Arc<T>,
17203 accept_compression_encodings: EnabledCompressionEncodings,
17204 send_compression_encodings: EnabledCompressionEncodings,
17205 max_decoding_message_size: Option<usize>,
17206 max_encoding_message_size: Option<usize>,
17207 }
17208 impl<T> TokenServiceServer<T> {
17209 pub fn new(inner: T) -> Self {
17210 Self::from_arc(Arc::new(inner))
17211 }
17212 pub fn from_arc(inner: Arc<T>) -> Self {
17213 Self {
17214 inner,
17215 accept_compression_encodings: Default::default(),
17216 send_compression_encodings: Default::default(),
17217 max_decoding_message_size: None,
17218 max_encoding_message_size: None,
17219 }
17220 }
17221 pub fn with_interceptor<F>(
17222 inner: T,
17223 interceptor: F,
17224 ) -> InterceptedService<Self, F>
17225 where
17226 F: tonic::service::Interceptor,
17227 {
17228 InterceptedService::new(Self::new(inner), interceptor)
17229 }
17230 #[must_use]
17232 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
17233 self.accept_compression_encodings.enable(encoding);
17234 self
17235 }
17236 #[must_use]
17238 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
17239 self.send_compression_encodings.enable(encoding);
17240 self
17241 }
17242 #[must_use]
17246 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
17247 self.max_decoding_message_size = Some(limit);
17248 self
17249 }
17250 #[must_use]
17254 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
17255 self.max_encoding_message_size = Some(limit);
17256 self
17257 }
17258 }
17259 impl<T, B> tonic::codegen::Service<http::Request<B>> for TokenServiceServer<T>
17260 where
17261 T: TokenService,
17262 B: Body + std::marker::Send + 'static,
17263 B::Error: Into<StdError> + std::marker::Send + 'static,
17264 {
17265 type Response = http::Response<tonic::body::Body>;
17266 type Error = std::convert::Infallible;
17267 type Future = BoxFuture<Self::Response, Self::Error>;
17268 fn poll_ready(
17269 &mut self,
17270 _cx: &mut Context<'_>,
17271 ) -> Poll<std::result::Result<(), Self::Error>> {
17272 Poll::Ready(Ok(()))
17273 }
17274 fn call(&mut self, req: http::Request<B>) -> Self::Future {
17275 match req.uri().path() {
17276 "/pidgr.v1.TokenService/SignDeeplinkToken" => {
17277 #[allow(non_camel_case_types)]
17278 struct SignDeeplinkTokenSvc<T: TokenService>(pub Arc<T>);
17279 impl<
17280 T: TokenService,
17281 > tonic::server::UnaryService<super::SignDeeplinkTokenRequest>
17282 for SignDeeplinkTokenSvc<T> {
17283 type Response = super::SignDeeplinkTokenResponse;
17284 type Future = BoxFuture<
17285 tonic::Response<Self::Response>,
17286 tonic::Status,
17287 >;
17288 fn call(
17289 &mut self,
17290 request: tonic::Request<super::SignDeeplinkTokenRequest>,
17291 ) -> Self::Future {
17292 let inner = Arc::clone(&self.0);
17293 let fut = async move {
17294 <T as TokenService>::sign_deeplink_token(&inner, request)
17295 .await
17296 };
17297 Box::pin(fut)
17298 }
17299 }
17300 let accept_compression_encodings = self.accept_compression_encodings;
17301 let send_compression_encodings = self.send_compression_encodings;
17302 let max_decoding_message_size = self.max_decoding_message_size;
17303 let max_encoding_message_size = self.max_encoding_message_size;
17304 let inner = self.inner.clone();
17305 let fut = async move {
17306 let method = SignDeeplinkTokenSvc(inner);
17307 let codec = tonic_prost::ProstCodec::default();
17308 let mut grpc = tonic::server::Grpc::new(codec)
17309 .apply_compression_config(
17310 accept_compression_encodings,
17311 send_compression_encodings,
17312 )
17313 .apply_max_message_size_config(
17314 max_decoding_message_size,
17315 max_encoding_message_size,
17316 );
17317 let res = grpc.unary(method, req).await;
17318 Ok(res)
17319 };
17320 Box::pin(fut)
17321 }
17322 "/pidgr.v1.TokenService/ValidateDeeplinkToken" => {
17323 #[allow(non_camel_case_types)]
17324 struct ValidateDeeplinkTokenSvc<T: TokenService>(pub Arc<T>);
17325 impl<
17326 T: TokenService,
17327 > tonic::server::UnaryService<super::ValidateDeeplinkTokenRequest>
17328 for ValidateDeeplinkTokenSvc<T> {
17329 type Response = super::ValidateDeeplinkTokenResponse;
17330 type Future = BoxFuture<
17331 tonic::Response<Self::Response>,
17332 tonic::Status,
17333 >;
17334 fn call(
17335 &mut self,
17336 request: tonic::Request<super::ValidateDeeplinkTokenRequest>,
17337 ) -> Self::Future {
17338 let inner = Arc::clone(&self.0);
17339 let fut = async move {
17340 <T as TokenService>::validate_deeplink_token(
17341 &inner,
17342 request,
17343 )
17344 .await
17345 };
17346 Box::pin(fut)
17347 }
17348 }
17349 let accept_compression_encodings = self.accept_compression_encodings;
17350 let send_compression_encodings = self.send_compression_encodings;
17351 let max_decoding_message_size = self.max_decoding_message_size;
17352 let max_encoding_message_size = self.max_encoding_message_size;
17353 let inner = self.inner.clone();
17354 let fut = async move {
17355 let method = ValidateDeeplinkTokenSvc(inner);
17356 let codec = tonic_prost::ProstCodec::default();
17357 let mut grpc = tonic::server::Grpc::new(codec)
17358 .apply_compression_config(
17359 accept_compression_encodings,
17360 send_compression_encodings,
17361 )
17362 .apply_max_message_size_config(
17363 max_decoding_message_size,
17364 max_encoding_message_size,
17365 );
17366 let res = grpc.unary(method, req).await;
17367 Ok(res)
17368 };
17369 Box::pin(fut)
17370 }
17371 _ => {
17372 Box::pin(async move {
17373 let mut response = http::Response::new(
17374 tonic::body::Body::default(),
17375 );
17376 let headers = response.headers_mut();
17377 headers
17378 .insert(
17379 tonic::Status::GRPC_STATUS,
17380 (tonic::Code::Unimplemented as i32).into(),
17381 );
17382 headers
17383 .insert(
17384 http::header::CONTENT_TYPE,
17385 tonic::metadata::GRPC_CONTENT_TYPE,
17386 );
17387 Ok(response)
17388 })
17389 }
17390 }
17391 }
17392 }
17393 impl<T> Clone for TokenServiceServer<T> {
17394 fn clone(&self) -> Self {
17395 let inner = self.inner.clone();
17396 Self {
17397 inner,
17398 accept_compression_encodings: self.accept_compression_encodings,
17399 send_compression_encodings: self.send_compression_encodings,
17400 max_decoding_message_size: self.max_decoding_message_size,
17401 max_encoding_message_size: self.max_encoding_message_size,
17402 }
17403 }
17404 }
17405 pub const SERVICE_NAME: &str = "pidgr.v1.TokenService";
17407 impl<T> tonic::server::NamedService for TokenServiceServer<T> {
17408 const NAME: &'static str = SERVICE_NAME;
17409 }
17410}