1pub mod access_code_service_client {
4 #![allow(
5 unused_variables,
6 dead_code,
7 missing_docs,
8 clippy::wildcard_imports,
9 clippy::let_unit_value,
10 )]
11 use tonic::codegen::*;
12 use tonic::codegen::http::Uri;
13 #[derive(Debug, Clone)]
17 pub struct AccessCodeServiceClient<T> {
18 inner: tonic::client::Grpc<T>,
19 }
20 impl AccessCodeServiceClient<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> AccessCodeServiceClient<T>
32 where
33 T: tonic::client::GrpcService<tonic::body::Body>,
34 T::Error: Into<StdError>,
35 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
36 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
37 {
38 pub fn new(inner: T) -> Self {
39 let inner = tonic::client::Grpc::new(inner);
40 Self { inner }
41 }
42 pub fn with_origin(inner: T, origin: Uri) -> Self {
43 let inner = tonic::client::Grpc::with_origin(inner, origin);
44 Self { inner }
45 }
46 pub fn with_interceptor<F>(
47 inner: T,
48 interceptor: F,
49 ) -> AccessCodeServiceClient<InterceptedService<T, F>>
50 where
51 F: tonic::service::Interceptor,
52 T::ResponseBody: Default,
53 T: tonic::codegen::Service<
54 http::Request<tonic::body::Body>,
55 Response = http::Response<
56 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
57 >,
58 >,
59 <T as tonic::codegen::Service<
60 http::Request<tonic::body::Body>,
61 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
62 {
63 AccessCodeServiceClient::new(InterceptedService::new(inner, interceptor))
64 }
65 #[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 generate_access_codes(
100 &mut self,
101 request: impl tonic::IntoRequest<super::GenerateAccessCodesRequest>,
102 ) -> std::result::Result<
103 tonic::Response<super::GenerateAccessCodesResponse>,
104 tonic::Status,
105 > {
106 self.inner
107 .ready()
108 .await
109 .map_err(|e| {
110 tonic::Status::unknown(
111 format!("Service was not ready: {}", e.into()),
112 )
113 })?;
114 let codec = tonic_prost::ProstCodec::default();
115 let path = http::uri::PathAndQuery::from_static(
116 "/pidgr.v1.AccessCodeService/GenerateAccessCodes",
117 );
118 let mut req = request.into_request();
119 req.extensions_mut()
120 .insert(
121 GrpcMethod::new("pidgr.v1.AccessCodeService", "GenerateAccessCodes"),
122 );
123 self.inner.unary(req, path, codec).await
124 }
125 pub async fn list_access_codes(
129 &mut self,
130 request: impl tonic::IntoRequest<super::ListAccessCodesRequest>,
131 ) -> std::result::Result<
132 tonic::Response<super::ListAccessCodesResponse>,
133 tonic::Status,
134 > {
135 self.inner
136 .ready()
137 .await
138 .map_err(|e| {
139 tonic::Status::unknown(
140 format!("Service was not ready: {}", e.into()),
141 )
142 })?;
143 let codec = tonic_prost::ProstCodec::default();
144 let path = http::uri::PathAndQuery::from_static(
145 "/pidgr.v1.AccessCodeService/ListAccessCodes",
146 );
147 let mut req = request.into_request();
148 req.extensions_mut()
149 .insert(
150 GrpcMethod::new("pidgr.v1.AccessCodeService", "ListAccessCodes"),
151 );
152 self.inner.unary(req, path, codec).await
153 }
154 pub async fn revoke_access_code(
158 &mut self,
159 request: impl tonic::IntoRequest<super::RevokeAccessCodeRequest>,
160 ) -> std::result::Result<
161 tonic::Response<super::RevokeAccessCodeResponse>,
162 tonic::Status,
163 > {
164 self.inner
165 .ready()
166 .await
167 .map_err(|e| {
168 tonic::Status::unknown(
169 format!("Service was not ready: {}", e.into()),
170 )
171 })?;
172 let codec = tonic_prost::ProstCodec::default();
173 let path = http::uri::PathAndQuery::from_static(
174 "/pidgr.v1.AccessCodeService/RevokeAccessCode",
175 );
176 let mut req = request.into_request();
177 req.extensions_mut()
178 .insert(
179 GrpcMethod::new("pidgr.v1.AccessCodeService", "RevokeAccessCode"),
180 );
181 self.inner.unary(req, path, codec).await
182 }
183 }
184}
185pub mod access_code_service_server {
187 #![allow(
188 unused_variables,
189 dead_code,
190 missing_docs,
191 clippy::wildcard_imports,
192 clippy::let_unit_value,
193 )]
194 use tonic::codegen::*;
195 #[async_trait]
197 pub trait AccessCodeService: std::marker::Send + std::marker::Sync + 'static {
198 async fn generate_access_codes(
202 &self,
203 request: tonic::Request<super::GenerateAccessCodesRequest>,
204 ) -> std::result::Result<
205 tonic::Response<super::GenerateAccessCodesResponse>,
206 tonic::Status,
207 >;
208 async fn list_access_codes(
212 &self,
213 request: tonic::Request<super::ListAccessCodesRequest>,
214 ) -> std::result::Result<
215 tonic::Response<super::ListAccessCodesResponse>,
216 tonic::Status,
217 >;
218 async fn revoke_access_code(
222 &self,
223 request: tonic::Request<super::RevokeAccessCodeRequest>,
224 ) -> std::result::Result<
225 tonic::Response<super::RevokeAccessCodeResponse>,
226 tonic::Status,
227 >;
228 }
229 #[derive(Debug)]
233 pub struct AccessCodeServiceServer<T> {
234 inner: Arc<T>,
235 accept_compression_encodings: EnabledCompressionEncodings,
236 send_compression_encodings: EnabledCompressionEncodings,
237 max_decoding_message_size: Option<usize>,
238 max_encoding_message_size: Option<usize>,
239 }
240 impl<T> AccessCodeServiceServer<T> {
241 pub fn new(inner: T) -> Self {
242 Self::from_arc(Arc::new(inner))
243 }
244 pub fn from_arc(inner: Arc<T>) -> Self {
245 Self {
246 inner,
247 accept_compression_encodings: Default::default(),
248 send_compression_encodings: Default::default(),
249 max_decoding_message_size: None,
250 max_encoding_message_size: None,
251 }
252 }
253 pub fn with_interceptor<F>(
254 inner: T,
255 interceptor: F,
256 ) -> InterceptedService<Self, F>
257 where
258 F: tonic::service::Interceptor,
259 {
260 InterceptedService::new(Self::new(inner), interceptor)
261 }
262 #[must_use]
264 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
265 self.accept_compression_encodings.enable(encoding);
266 self
267 }
268 #[must_use]
270 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
271 self.send_compression_encodings.enable(encoding);
272 self
273 }
274 #[must_use]
278 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
279 self.max_decoding_message_size = Some(limit);
280 self
281 }
282 #[must_use]
286 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
287 self.max_encoding_message_size = Some(limit);
288 self
289 }
290 }
291 impl<T, B> tonic::codegen::Service<http::Request<B>> for AccessCodeServiceServer<T>
292 where
293 T: AccessCodeService,
294 B: Body + std::marker::Send + 'static,
295 B::Error: Into<StdError> + std::marker::Send + 'static,
296 {
297 type Response = http::Response<tonic::body::Body>;
298 type Error = std::convert::Infallible;
299 type Future = BoxFuture<Self::Response, Self::Error>;
300 fn poll_ready(
301 &mut self,
302 _cx: &mut Context<'_>,
303 ) -> Poll<std::result::Result<(), Self::Error>> {
304 Poll::Ready(Ok(()))
305 }
306 fn call(&mut self, req: http::Request<B>) -> Self::Future {
307 match req.uri().path() {
308 "/pidgr.v1.AccessCodeService/GenerateAccessCodes" => {
309 #[allow(non_camel_case_types)]
310 struct GenerateAccessCodesSvc<T: AccessCodeService>(pub Arc<T>);
311 impl<
312 T: AccessCodeService,
313 > tonic::server::UnaryService<super::GenerateAccessCodesRequest>
314 for GenerateAccessCodesSvc<T> {
315 type Response = super::GenerateAccessCodesResponse;
316 type Future = BoxFuture<
317 tonic::Response<Self::Response>,
318 tonic::Status,
319 >;
320 fn call(
321 &mut self,
322 request: tonic::Request<super::GenerateAccessCodesRequest>,
323 ) -> Self::Future {
324 let inner = Arc::clone(&self.0);
325 let fut = async move {
326 <T as AccessCodeService>::generate_access_codes(
327 &inner,
328 request,
329 )
330 .await
331 };
332 Box::pin(fut)
333 }
334 }
335 let accept_compression_encodings = self.accept_compression_encodings;
336 let send_compression_encodings = self.send_compression_encodings;
337 let max_decoding_message_size = self.max_decoding_message_size;
338 let max_encoding_message_size = self.max_encoding_message_size;
339 let inner = self.inner.clone();
340 let fut = async move {
341 let method = GenerateAccessCodesSvc(inner);
342 let codec = tonic_prost::ProstCodec::default();
343 let mut grpc = tonic::server::Grpc::new(codec)
344 .apply_compression_config(
345 accept_compression_encodings,
346 send_compression_encodings,
347 )
348 .apply_max_message_size_config(
349 max_decoding_message_size,
350 max_encoding_message_size,
351 );
352 let res = grpc.unary(method, req).await;
353 Ok(res)
354 };
355 Box::pin(fut)
356 }
357 "/pidgr.v1.AccessCodeService/ListAccessCodes" => {
358 #[allow(non_camel_case_types)]
359 struct ListAccessCodesSvc<T: AccessCodeService>(pub Arc<T>);
360 impl<
361 T: AccessCodeService,
362 > tonic::server::UnaryService<super::ListAccessCodesRequest>
363 for ListAccessCodesSvc<T> {
364 type Response = super::ListAccessCodesResponse;
365 type Future = BoxFuture<
366 tonic::Response<Self::Response>,
367 tonic::Status,
368 >;
369 fn call(
370 &mut self,
371 request: tonic::Request<super::ListAccessCodesRequest>,
372 ) -> Self::Future {
373 let inner = Arc::clone(&self.0);
374 let fut = async move {
375 <T as AccessCodeService>::list_access_codes(&inner, request)
376 .await
377 };
378 Box::pin(fut)
379 }
380 }
381 let accept_compression_encodings = self.accept_compression_encodings;
382 let send_compression_encodings = self.send_compression_encodings;
383 let max_decoding_message_size = self.max_decoding_message_size;
384 let max_encoding_message_size = self.max_encoding_message_size;
385 let inner = self.inner.clone();
386 let fut = async move {
387 let method = ListAccessCodesSvc(inner);
388 let codec = tonic_prost::ProstCodec::default();
389 let mut grpc = tonic::server::Grpc::new(codec)
390 .apply_compression_config(
391 accept_compression_encodings,
392 send_compression_encodings,
393 )
394 .apply_max_message_size_config(
395 max_decoding_message_size,
396 max_encoding_message_size,
397 );
398 let res = grpc.unary(method, req).await;
399 Ok(res)
400 };
401 Box::pin(fut)
402 }
403 "/pidgr.v1.AccessCodeService/RevokeAccessCode" => {
404 #[allow(non_camel_case_types)]
405 struct RevokeAccessCodeSvc<T: AccessCodeService>(pub Arc<T>);
406 impl<
407 T: AccessCodeService,
408 > tonic::server::UnaryService<super::RevokeAccessCodeRequest>
409 for RevokeAccessCodeSvc<T> {
410 type Response = super::RevokeAccessCodeResponse;
411 type Future = BoxFuture<
412 tonic::Response<Self::Response>,
413 tonic::Status,
414 >;
415 fn call(
416 &mut self,
417 request: tonic::Request<super::RevokeAccessCodeRequest>,
418 ) -> Self::Future {
419 let inner = Arc::clone(&self.0);
420 let fut = async move {
421 <T as AccessCodeService>::revoke_access_code(
422 &inner,
423 request,
424 )
425 .await
426 };
427 Box::pin(fut)
428 }
429 }
430 let accept_compression_encodings = self.accept_compression_encodings;
431 let send_compression_encodings = self.send_compression_encodings;
432 let max_decoding_message_size = self.max_decoding_message_size;
433 let max_encoding_message_size = self.max_encoding_message_size;
434 let inner = self.inner.clone();
435 let fut = async move {
436 let method = RevokeAccessCodeSvc(inner);
437 let codec = tonic_prost::ProstCodec::default();
438 let mut grpc = tonic::server::Grpc::new(codec)
439 .apply_compression_config(
440 accept_compression_encodings,
441 send_compression_encodings,
442 )
443 .apply_max_message_size_config(
444 max_decoding_message_size,
445 max_encoding_message_size,
446 );
447 let res = grpc.unary(method, req).await;
448 Ok(res)
449 };
450 Box::pin(fut)
451 }
452 _ => {
453 Box::pin(async move {
454 let mut response = http::Response::new(
455 tonic::body::Body::default(),
456 );
457 let headers = response.headers_mut();
458 headers
459 .insert(
460 tonic::Status::GRPC_STATUS,
461 (tonic::Code::Unimplemented as i32).into(),
462 );
463 headers
464 .insert(
465 http::header::CONTENT_TYPE,
466 tonic::metadata::GRPC_CONTENT_TYPE,
467 );
468 Ok(response)
469 })
470 }
471 }
472 }
473 }
474 impl<T> Clone for AccessCodeServiceServer<T> {
475 fn clone(&self) -> Self {
476 let inner = self.inner.clone();
477 Self {
478 inner,
479 accept_compression_encodings: self.accept_compression_encodings,
480 send_compression_encodings: self.send_compression_encodings,
481 max_decoding_message_size: self.max_decoding_message_size,
482 max_encoding_message_size: self.max_encoding_message_size,
483 }
484 }
485 }
486 pub const SERVICE_NAME: &str = "pidgr.v1.AccessCodeService";
488 impl<T> tonic::server::NamedService for AccessCodeServiceServer<T> {
489 const NAME: &'static str = SERVICE_NAME;
490 }
491}
492pub mod action_service_client {
494 #![allow(
495 unused_variables,
496 dead_code,
497 missing_docs,
498 clippy::wildcard_imports,
499 clippy::let_unit_value,
500 )]
501 use tonic::codegen::*;
502 use tonic::codegen::http::Uri;
503 #[derive(Debug, Clone)]
507 pub struct ActionServiceClient<T> {
508 inner: tonic::client::Grpc<T>,
509 }
510 impl ActionServiceClient<tonic::transport::Channel> {
511 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
513 where
514 D: TryInto<tonic::transport::Endpoint>,
515 D::Error: Into<StdError>,
516 {
517 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
518 Ok(Self::new(conn))
519 }
520 }
521 impl<T> ActionServiceClient<T>
522 where
523 T: tonic::client::GrpcService<tonic::body::Body>,
524 T::Error: Into<StdError>,
525 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
526 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
527 {
528 pub fn new(inner: T) -> Self {
529 let inner = tonic::client::Grpc::new(inner);
530 Self { inner }
531 }
532 pub fn with_origin(inner: T, origin: Uri) -> Self {
533 let inner = tonic::client::Grpc::with_origin(inner, origin);
534 Self { inner }
535 }
536 pub fn with_interceptor<F>(
537 inner: T,
538 interceptor: F,
539 ) -> ActionServiceClient<InterceptedService<T, F>>
540 where
541 F: tonic::service::Interceptor,
542 T::ResponseBody: Default,
543 T: tonic::codegen::Service<
544 http::Request<tonic::body::Body>,
545 Response = http::Response<
546 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
547 >,
548 >,
549 <T as tonic::codegen::Service<
550 http::Request<tonic::body::Body>,
551 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
552 {
553 ActionServiceClient::new(InterceptedService::new(inner, interceptor))
554 }
555 #[must_use]
560 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
561 self.inner = self.inner.send_compressed(encoding);
562 self
563 }
564 #[must_use]
566 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
567 self.inner = self.inner.accept_compressed(encoding);
568 self
569 }
570 #[must_use]
574 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
575 self.inner = self.inner.max_decoding_message_size(limit);
576 self
577 }
578 #[must_use]
582 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
583 self.inner = self.inner.max_encoding_message_size(limit);
584 self
585 }
586 pub async fn submit_action(
590 &mut self,
591 request: impl tonic::IntoRequest<super::SubmitActionRequest>,
592 ) -> std::result::Result<
593 tonic::Response<super::SubmitActionResponse>,
594 tonic::Status,
595 > {
596 self.inner
597 .ready()
598 .await
599 .map_err(|e| {
600 tonic::Status::unknown(
601 format!("Service was not ready: {}", e.into()),
602 )
603 })?;
604 let codec = tonic_prost::ProstCodec::default();
605 let path = http::uri::PathAndQuery::from_static(
606 "/pidgr.v1.ActionService/SubmitAction",
607 );
608 let mut req = request.into_request();
609 req.extensions_mut()
610 .insert(GrpcMethod::new("pidgr.v1.ActionService", "SubmitAction"));
611 self.inner.unary(req, path, codec).await
612 }
613 }
614}
615pub mod action_service_server {
617 #![allow(
618 unused_variables,
619 dead_code,
620 missing_docs,
621 clippy::wildcard_imports,
622 clippy::let_unit_value,
623 )]
624 use tonic::codegen::*;
625 #[async_trait]
627 pub trait ActionService: std::marker::Send + std::marker::Sync + 'static {
628 async fn submit_action(
632 &self,
633 request: tonic::Request<super::SubmitActionRequest>,
634 ) -> std::result::Result<
635 tonic::Response<super::SubmitActionResponse>,
636 tonic::Status,
637 >;
638 }
639 #[derive(Debug)]
643 pub struct ActionServiceServer<T> {
644 inner: Arc<T>,
645 accept_compression_encodings: EnabledCompressionEncodings,
646 send_compression_encodings: EnabledCompressionEncodings,
647 max_decoding_message_size: Option<usize>,
648 max_encoding_message_size: Option<usize>,
649 }
650 impl<T> ActionServiceServer<T> {
651 pub fn new(inner: T) -> Self {
652 Self::from_arc(Arc::new(inner))
653 }
654 pub fn from_arc(inner: Arc<T>) -> Self {
655 Self {
656 inner,
657 accept_compression_encodings: Default::default(),
658 send_compression_encodings: Default::default(),
659 max_decoding_message_size: None,
660 max_encoding_message_size: None,
661 }
662 }
663 pub fn with_interceptor<F>(
664 inner: T,
665 interceptor: F,
666 ) -> InterceptedService<Self, F>
667 where
668 F: tonic::service::Interceptor,
669 {
670 InterceptedService::new(Self::new(inner), interceptor)
671 }
672 #[must_use]
674 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
675 self.accept_compression_encodings.enable(encoding);
676 self
677 }
678 #[must_use]
680 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
681 self.send_compression_encodings.enable(encoding);
682 self
683 }
684 #[must_use]
688 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
689 self.max_decoding_message_size = Some(limit);
690 self
691 }
692 #[must_use]
696 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
697 self.max_encoding_message_size = Some(limit);
698 self
699 }
700 }
701 impl<T, B> tonic::codegen::Service<http::Request<B>> for ActionServiceServer<T>
702 where
703 T: ActionService,
704 B: Body + std::marker::Send + 'static,
705 B::Error: Into<StdError> + std::marker::Send + 'static,
706 {
707 type Response = http::Response<tonic::body::Body>;
708 type Error = std::convert::Infallible;
709 type Future = BoxFuture<Self::Response, Self::Error>;
710 fn poll_ready(
711 &mut self,
712 _cx: &mut Context<'_>,
713 ) -> Poll<std::result::Result<(), Self::Error>> {
714 Poll::Ready(Ok(()))
715 }
716 fn call(&mut self, req: http::Request<B>) -> Self::Future {
717 match req.uri().path() {
718 "/pidgr.v1.ActionService/SubmitAction" => {
719 #[allow(non_camel_case_types)]
720 struct SubmitActionSvc<T: ActionService>(pub Arc<T>);
721 impl<
722 T: ActionService,
723 > tonic::server::UnaryService<super::SubmitActionRequest>
724 for SubmitActionSvc<T> {
725 type Response = super::SubmitActionResponse;
726 type Future = BoxFuture<
727 tonic::Response<Self::Response>,
728 tonic::Status,
729 >;
730 fn call(
731 &mut self,
732 request: tonic::Request<super::SubmitActionRequest>,
733 ) -> Self::Future {
734 let inner = Arc::clone(&self.0);
735 let fut = async move {
736 <T as ActionService>::submit_action(&inner, request).await
737 };
738 Box::pin(fut)
739 }
740 }
741 let accept_compression_encodings = self.accept_compression_encodings;
742 let send_compression_encodings = self.send_compression_encodings;
743 let max_decoding_message_size = self.max_decoding_message_size;
744 let max_encoding_message_size = self.max_encoding_message_size;
745 let inner = self.inner.clone();
746 let fut = async move {
747 let method = SubmitActionSvc(inner);
748 let codec = tonic_prost::ProstCodec::default();
749 let mut grpc = tonic::server::Grpc::new(codec)
750 .apply_compression_config(
751 accept_compression_encodings,
752 send_compression_encodings,
753 )
754 .apply_max_message_size_config(
755 max_decoding_message_size,
756 max_encoding_message_size,
757 );
758 let res = grpc.unary(method, req).await;
759 Ok(res)
760 };
761 Box::pin(fut)
762 }
763 _ => {
764 Box::pin(async move {
765 let mut response = http::Response::new(
766 tonic::body::Body::default(),
767 );
768 let headers = response.headers_mut();
769 headers
770 .insert(
771 tonic::Status::GRPC_STATUS,
772 (tonic::Code::Unimplemented as i32).into(),
773 );
774 headers
775 .insert(
776 http::header::CONTENT_TYPE,
777 tonic::metadata::GRPC_CONTENT_TYPE,
778 );
779 Ok(response)
780 })
781 }
782 }
783 }
784 }
785 impl<T> Clone for ActionServiceServer<T> {
786 fn clone(&self) -> Self {
787 let inner = self.inner.clone();
788 Self {
789 inner,
790 accept_compression_encodings: self.accept_compression_encodings,
791 send_compression_encodings: self.send_compression_encodings,
792 max_decoding_message_size: self.max_decoding_message_size,
793 max_encoding_message_size: self.max_encoding_message_size,
794 }
795 }
796 }
797 pub const SERVICE_NAME: &str = "pidgr.v1.ActionService";
799 impl<T> tonic::server::NamedService for ActionServiceServer<T> {
800 const NAME: &'static str = SERVICE_NAME;
801 }
802}
803pub mod api_key_service_client {
805 #![allow(
806 unused_variables,
807 dead_code,
808 missing_docs,
809 clippy::wildcard_imports,
810 clippy::let_unit_value,
811 )]
812 use tonic::codegen::*;
813 use tonic::codegen::http::Uri;
814 #[derive(Debug, Clone)]
818 pub struct ApiKeyServiceClient<T> {
819 inner: tonic::client::Grpc<T>,
820 }
821 impl ApiKeyServiceClient<tonic::transport::Channel> {
822 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
824 where
825 D: TryInto<tonic::transport::Endpoint>,
826 D::Error: Into<StdError>,
827 {
828 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
829 Ok(Self::new(conn))
830 }
831 }
832 impl<T> ApiKeyServiceClient<T>
833 where
834 T: tonic::client::GrpcService<tonic::body::Body>,
835 T::Error: Into<StdError>,
836 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
837 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
838 {
839 pub fn new(inner: T) -> Self {
840 let inner = tonic::client::Grpc::new(inner);
841 Self { inner }
842 }
843 pub fn with_origin(inner: T, origin: Uri) -> Self {
844 let inner = tonic::client::Grpc::with_origin(inner, origin);
845 Self { inner }
846 }
847 pub fn with_interceptor<F>(
848 inner: T,
849 interceptor: F,
850 ) -> ApiKeyServiceClient<InterceptedService<T, F>>
851 where
852 F: tonic::service::Interceptor,
853 T::ResponseBody: Default,
854 T: tonic::codegen::Service<
855 http::Request<tonic::body::Body>,
856 Response = http::Response<
857 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
858 >,
859 >,
860 <T as tonic::codegen::Service<
861 http::Request<tonic::body::Body>,
862 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
863 {
864 ApiKeyServiceClient::new(InterceptedService::new(inner, interceptor))
865 }
866 #[must_use]
871 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
872 self.inner = self.inner.send_compressed(encoding);
873 self
874 }
875 #[must_use]
877 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
878 self.inner = self.inner.accept_compressed(encoding);
879 self
880 }
881 #[must_use]
885 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
886 self.inner = self.inner.max_decoding_message_size(limit);
887 self
888 }
889 #[must_use]
893 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
894 self.inner = self.inner.max_encoding_message_size(limit);
895 self
896 }
897 pub async fn create_api_key(
902 &mut self,
903 request: impl tonic::IntoRequest<super::CreateApiKeyRequest>,
904 ) -> std::result::Result<
905 tonic::Response<super::CreateApiKeyResponse>,
906 tonic::Status,
907 > {
908 self.inner
909 .ready()
910 .await
911 .map_err(|e| {
912 tonic::Status::unknown(
913 format!("Service was not ready: {}", e.into()),
914 )
915 })?;
916 let codec = tonic_prost::ProstCodec::default();
917 let path = http::uri::PathAndQuery::from_static(
918 "/pidgr.v1.ApiKeyService/CreateApiKey",
919 );
920 let mut req = request.into_request();
921 req.extensions_mut()
922 .insert(GrpcMethod::new("pidgr.v1.ApiKeyService", "CreateApiKey"));
923 self.inner.unary(req, path, codec).await
924 }
925 pub async fn list_api_keys(
929 &mut self,
930 request: impl tonic::IntoRequest<super::ListApiKeysRequest>,
931 ) -> std::result::Result<
932 tonic::Response<super::ListApiKeysResponse>,
933 tonic::Status,
934 > {
935 self.inner
936 .ready()
937 .await
938 .map_err(|e| {
939 tonic::Status::unknown(
940 format!("Service was not ready: {}", e.into()),
941 )
942 })?;
943 let codec = tonic_prost::ProstCodec::default();
944 let path = http::uri::PathAndQuery::from_static(
945 "/pidgr.v1.ApiKeyService/ListApiKeys",
946 );
947 let mut req = request.into_request();
948 req.extensions_mut()
949 .insert(GrpcMethod::new("pidgr.v1.ApiKeyService", "ListApiKeys"));
950 self.inner.unary(req, path, codec).await
951 }
952 pub async fn revoke_api_key(
956 &mut self,
957 request: impl tonic::IntoRequest<super::RevokeApiKeyRequest>,
958 ) -> std::result::Result<
959 tonic::Response<super::RevokeApiKeyResponse>,
960 tonic::Status,
961 > {
962 self.inner
963 .ready()
964 .await
965 .map_err(|e| {
966 tonic::Status::unknown(
967 format!("Service was not ready: {}", e.into()),
968 )
969 })?;
970 let codec = tonic_prost::ProstCodec::default();
971 let path = http::uri::PathAndQuery::from_static(
972 "/pidgr.v1.ApiKeyService/RevokeApiKey",
973 );
974 let mut req = request.into_request();
975 req.extensions_mut()
976 .insert(GrpcMethod::new("pidgr.v1.ApiKeyService", "RevokeApiKey"));
977 self.inner.unary(req, path, codec).await
978 }
979 }
980}
981pub mod api_key_service_server {
983 #![allow(
984 unused_variables,
985 dead_code,
986 missing_docs,
987 clippy::wildcard_imports,
988 clippy::let_unit_value,
989 )]
990 use tonic::codegen::*;
991 #[async_trait]
993 pub trait ApiKeyService: std::marker::Send + std::marker::Sync + 'static {
994 async fn create_api_key(
999 &self,
1000 request: tonic::Request<super::CreateApiKeyRequest>,
1001 ) -> std::result::Result<
1002 tonic::Response<super::CreateApiKeyResponse>,
1003 tonic::Status,
1004 >;
1005 async fn list_api_keys(
1009 &self,
1010 request: tonic::Request<super::ListApiKeysRequest>,
1011 ) -> std::result::Result<
1012 tonic::Response<super::ListApiKeysResponse>,
1013 tonic::Status,
1014 >;
1015 async fn revoke_api_key(
1019 &self,
1020 request: tonic::Request<super::RevokeApiKeyRequest>,
1021 ) -> std::result::Result<
1022 tonic::Response<super::RevokeApiKeyResponse>,
1023 tonic::Status,
1024 >;
1025 }
1026 #[derive(Debug)]
1030 pub struct ApiKeyServiceServer<T> {
1031 inner: Arc<T>,
1032 accept_compression_encodings: EnabledCompressionEncodings,
1033 send_compression_encodings: EnabledCompressionEncodings,
1034 max_decoding_message_size: Option<usize>,
1035 max_encoding_message_size: Option<usize>,
1036 }
1037 impl<T> ApiKeyServiceServer<T> {
1038 pub fn new(inner: T) -> Self {
1039 Self::from_arc(Arc::new(inner))
1040 }
1041 pub fn from_arc(inner: Arc<T>) -> Self {
1042 Self {
1043 inner,
1044 accept_compression_encodings: Default::default(),
1045 send_compression_encodings: Default::default(),
1046 max_decoding_message_size: None,
1047 max_encoding_message_size: None,
1048 }
1049 }
1050 pub fn with_interceptor<F>(
1051 inner: T,
1052 interceptor: F,
1053 ) -> InterceptedService<Self, F>
1054 where
1055 F: tonic::service::Interceptor,
1056 {
1057 InterceptedService::new(Self::new(inner), interceptor)
1058 }
1059 #[must_use]
1061 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1062 self.accept_compression_encodings.enable(encoding);
1063 self
1064 }
1065 #[must_use]
1067 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1068 self.send_compression_encodings.enable(encoding);
1069 self
1070 }
1071 #[must_use]
1075 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1076 self.max_decoding_message_size = Some(limit);
1077 self
1078 }
1079 #[must_use]
1083 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1084 self.max_encoding_message_size = Some(limit);
1085 self
1086 }
1087 }
1088 impl<T, B> tonic::codegen::Service<http::Request<B>> for ApiKeyServiceServer<T>
1089 where
1090 T: ApiKeyService,
1091 B: Body + std::marker::Send + 'static,
1092 B::Error: Into<StdError> + std::marker::Send + 'static,
1093 {
1094 type Response = http::Response<tonic::body::Body>;
1095 type Error = std::convert::Infallible;
1096 type Future = BoxFuture<Self::Response, Self::Error>;
1097 fn poll_ready(
1098 &mut self,
1099 _cx: &mut Context<'_>,
1100 ) -> Poll<std::result::Result<(), Self::Error>> {
1101 Poll::Ready(Ok(()))
1102 }
1103 fn call(&mut self, req: http::Request<B>) -> Self::Future {
1104 match req.uri().path() {
1105 "/pidgr.v1.ApiKeyService/CreateApiKey" => {
1106 #[allow(non_camel_case_types)]
1107 struct CreateApiKeySvc<T: ApiKeyService>(pub Arc<T>);
1108 impl<
1109 T: ApiKeyService,
1110 > tonic::server::UnaryService<super::CreateApiKeyRequest>
1111 for CreateApiKeySvc<T> {
1112 type Response = super::CreateApiKeyResponse;
1113 type Future = BoxFuture<
1114 tonic::Response<Self::Response>,
1115 tonic::Status,
1116 >;
1117 fn call(
1118 &mut self,
1119 request: tonic::Request<super::CreateApiKeyRequest>,
1120 ) -> Self::Future {
1121 let inner = Arc::clone(&self.0);
1122 let fut = async move {
1123 <T as ApiKeyService>::create_api_key(&inner, request).await
1124 };
1125 Box::pin(fut)
1126 }
1127 }
1128 let accept_compression_encodings = self.accept_compression_encodings;
1129 let send_compression_encodings = self.send_compression_encodings;
1130 let max_decoding_message_size = self.max_decoding_message_size;
1131 let max_encoding_message_size = self.max_encoding_message_size;
1132 let inner = self.inner.clone();
1133 let fut = async move {
1134 let method = CreateApiKeySvc(inner);
1135 let codec = tonic_prost::ProstCodec::default();
1136 let mut grpc = tonic::server::Grpc::new(codec)
1137 .apply_compression_config(
1138 accept_compression_encodings,
1139 send_compression_encodings,
1140 )
1141 .apply_max_message_size_config(
1142 max_decoding_message_size,
1143 max_encoding_message_size,
1144 );
1145 let res = grpc.unary(method, req).await;
1146 Ok(res)
1147 };
1148 Box::pin(fut)
1149 }
1150 "/pidgr.v1.ApiKeyService/ListApiKeys" => {
1151 #[allow(non_camel_case_types)]
1152 struct ListApiKeysSvc<T: ApiKeyService>(pub Arc<T>);
1153 impl<
1154 T: ApiKeyService,
1155 > tonic::server::UnaryService<super::ListApiKeysRequest>
1156 for ListApiKeysSvc<T> {
1157 type Response = super::ListApiKeysResponse;
1158 type Future = BoxFuture<
1159 tonic::Response<Self::Response>,
1160 tonic::Status,
1161 >;
1162 fn call(
1163 &mut self,
1164 request: tonic::Request<super::ListApiKeysRequest>,
1165 ) -> Self::Future {
1166 let inner = Arc::clone(&self.0);
1167 let fut = async move {
1168 <T as ApiKeyService>::list_api_keys(&inner, request).await
1169 };
1170 Box::pin(fut)
1171 }
1172 }
1173 let accept_compression_encodings = self.accept_compression_encodings;
1174 let send_compression_encodings = self.send_compression_encodings;
1175 let max_decoding_message_size = self.max_decoding_message_size;
1176 let max_encoding_message_size = self.max_encoding_message_size;
1177 let inner = self.inner.clone();
1178 let fut = async move {
1179 let method = ListApiKeysSvc(inner);
1180 let codec = tonic_prost::ProstCodec::default();
1181 let mut grpc = tonic::server::Grpc::new(codec)
1182 .apply_compression_config(
1183 accept_compression_encodings,
1184 send_compression_encodings,
1185 )
1186 .apply_max_message_size_config(
1187 max_decoding_message_size,
1188 max_encoding_message_size,
1189 );
1190 let res = grpc.unary(method, req).await;
1191 Ok(res)
1192 };
1193 Box::pin(fut)
1194 }
1195 "/pidgr.v1.ApiKeyService/RevokeApiKey" => {
1196 #[allow(non_camel_case_types)]
1197 struct RevokeApiKeySvc<T: ApiKeyService>(pub Arc<T>);
1198 impl<
1199 T: ApiKeyService,
1200 > tonic::server::UnaryService<super::RevokeApiKeyRequest>
1201 for RevokeApiKeySvc<T> {
1202 type Response = super::RevokeApiKeyResponse;
1203 type Future = BoxFuture<
1204 tonic::Response<Self::Response>,
1205 tonic::Status,
1206 >;
1207 fn call(
1208 &mut self,
1209 request: tonic::Request<super::RevokeApiKeyRequest>,
1210 ) -> Self::Future {
1211 let inner = Arc::clone(&self.0);
1212 let fut = async move {
1213 <T as ApiKeyService>::revoke_api_key(&inner, request).await
1214 };
1215 Box::pin(fut)
1216 }
1217 }
1218 let accept_compression_encodings = self.accept_compression_encodings;
1219 let send_compression_encodings = self.send_compression_encodings;
1220 let max_decoding_message_size = self.max_decoding_message_size;
1221 let max_encoding_message_size = self.max_encoding_message_size;
1222 let inner = self.inner.clone();
1223 let fut = async move {
1224 let method = RevokeApiKeySvc(inner);
1225 let codec = tonic_prost::ProstCodec::default();
1226 let mut grpc = tonic::server::Grpc::new(codec)
1227 .apply_compression_config(
1228 accept_compression_encodings,
1229 send_compression_encodings,
1230 )
1231 .apply_max_message_size_config(
1232 max_decoding_message_size,
1233 max_encoding_message_size,
1234 );
1235 let res = grpc.unary(method, req).await;
1236 Ok(res)
1237 };
1238 Box::pin(fut)
1239 }
1240 _ => {
1241 Box::pin(async move {
1242 let mut response = http::Response::new(
1243 tonic::body::Body::default(),
1244 );
1245 let headers = response.headers_mut();
1246 headers
1247 .insert(
1248 tonic::Status::GRPC_STATUS,
1249 (tonic::Code::Unimplemented as i32).into(),
1250 );
1251 headers
1252 .insert(
1253 http::header::CONTENT_TYPE,
1254 tonic::metadata::GRPC_CONTENT_TYPE,
1255 );
1256 Ok(response)
1257 })
1258 }
1259 }
1260 }
1261 }
1262 impl<T> Clone for ApiKeyServiceServer<T> {
1263 fn clone(&self) -> Self {
1264 let inner = self.inner.clone();
1265 Self {
1266 inner,
1267 accept_compression_encodings: self.accept_compression_encodings,
1268 send_compression_encodings: self.send_compression_encodings,
1269 max_decoding_message_size: self.max_decoding_message_size,
1270 max_encoding_message_size: self.max_encoding_message_size,
1271 }
1272 }
1273 }
1274 pub const SERVICE_NAME: &str = "pidgr.v1.ApiKeyService";
1276 impl<T> tonic::server::NamedService for ApiKeyServiceServer<T> {
1277 const NAME: &'static str = SERVICE_NAME;
1278 }
1279}
1280pub mod privacy_service_client {
1282 #![allow(
1283 unused_variables,
1284 dead_code,
1285 missing_docs,
1286 clippy::wildcard_imports,
1287 clippy::let_unit_value,
1288 )]
1289 use tonic::codegen::*;
1290 use tonic::codegen::http::Uri;
1291 #[derive(Debug, Clone)]
1295 pub struct PrivacyServiceClient<T> {
1296 inner: tonic::client::Grpc<T>,
1297 }
1298 impl PrivacyServiceClient<tonic::transport::Channel> {
1299 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1301 where
1302 D: TryInto<tonic::transport::Endpoint>,
1303 D::Error: Into<StdError>,
1304 {
1305 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1306 Ok(Self::new(conn))
1307 }
1308 }
1309 impl<T> PrivacyServiceClient<T>
1310 where
1311 T: tonic::client::GrpcService<tonic::body::Body>,
1312 T::Error: Into<StdError>,
1313 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1314 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1315 {
1316 pub fn new(inner: T) -> Self {
1317 let inner = tonic::client::Grpc::new(inner);
1318 Self { inner }
1319 }
1320 pub fn with_origin(inner: T, origin: Uri) -> Self {
1321 let inner = tonic::client::Grpc::with_origin(inner, origin);
1322 Self { inner }
1323 }
1324 pub fn with_interceptor<F>(
1325 inner: T,
1326 interceptor: F,
1327 ) -> PrivacyServiceClient<InterceptedService<T, F>>
1328 where
1329 F: tonic::service::Interceptor,
1330 T::ResponseBody: Default,
1331 T: tonic::codegen::Service<
1332 http::Request<tonic::body::Body>,
1333 Response = http::Response<
1334 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
1335 >,
1336 >,
1337 <T as tonic::codegen::Service<
1338 http::Request<tonic::body::Body>,
1339 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1340 {
1341 PrivacyServiceClient::new(InterceptedService::new(inner, interceptor))
1342 }
1343 #[must_use]
1348 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1349 self.inner = self.inner.send_compressed(encoding);
1350 self
1351 }
1352 #[must_use]
1354 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1355 self.inner = self.inner.accept_compressed(encoding);
1356 self
1357 }
1358 #[must_use]
1362 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1363 self.inner = self.inner.max_decoding_message_size(limit);
1364 self
1365 }
1366 #[must_use]
1370 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1371 self.inner = self.inner.max_encoding_message_size(limit);
1372 self
1373 }
1374 pub async fn export_user_data(
1380 &mut self,
1381 request: impl tonic::IntoRequest<super::ExportUserDataRequest>,
1382 ) -> std::result::Result<
1383 tonic::Response<super::ExportUserDataResponse>,
1384 tonic::Status,
1385 > {
1386 self.inner
1387 .ready()
1388 .await
1389 .map_err(|e| {
1390 tonic::Status::unknown(
1391 format!("Service was not ready: {}", e.into()),
1392 )
1393 })?;
1394 let codec = tonic_prost::ProstCodec::default();
1395 let path = http::uri::PathAndQuery::from_static(
1396 "/pidgr.v1.PrivacyService/ExportUserData",
1397 );
1398 let mut req = request.into_request();
1399 req.extensions_mut()
1400 .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "ExportUserData"));
1401 self.inner.unary(req, path, codec).await
1402 }
1403 pub async fn delete_user_data(
1409 &mut self,
1410 request: impl tonic::IntoRequest<super::DeleteUserDataRequest>,
1411 ) -> std::result::Result<
1412 tonic::Response<super::DeleteUserDataResponse>,
1413 tonic::Status,
1414 > {
1415 self.inner
1416 .ready()
1417 .await
1418 .map_err(|e| {
1419 tonic::Status::unknown(
1420 format!("Service was not ready: {}", e.into()),
1421 )
1422 })?;
1423 let codec = tonic_prost::ProstCodec::default();
1424 let path = http::uri::PathAndQuery::from_static(
1425 "/pidgr.v1.PrivacyService/DeleteUserData",
1426 );
1427 let mut req = request.into_request();
1428 req.extensions_mut()
1429 .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "DeleteUserData"));
1430 self.inner.unary(req, path, codec).await
1431 }
1432 pub async fn rectify_user_data(
1437 &mut self,
1438 request: impl tonic::IntoRequest<super::RectifyUserDataRequest>,
1439 ) -> std::result::Result<
1440 tonic::Response<super::RectifyUserDataResponse>,
1441 tonic::Status,
1442 > {
1443 self.inner
1444 .ready()
1445 .await
1446 .map_err(|e| {
1447 tonic::Status::unknown(
1448 format!("Service was not ready: {}", e.into()),
1449 )
1450 })?;
1451 let codec = tonic_prost::ProstCodec::default();
1452 let path = http::uri::PathAndQuery::from_static(
1453 "/pidgr.v1.PrivacyService/RectifyUserData",
1454 );
1455 let mut req = request.into_request();
1456 req.extensions_mut()
1457 .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "RectifyUserData"));
1458 self.inner.unary(req, path, codec).await
1459 }
1460 pub async fn restrict_processing(
1465 &mut self,
1466 request: impl tonic::IntoRequest<super::RestrictProcessingRequest>,
1467 ) -> std::result::Result<
1468 tonic::Response<super::RestrictProcessingResponse>,
1469 tonic::Status,
1470 > {
1471 self.inner
1472 .ready()
1473 .await
1474 .map_err(|e| {
1475 tonic::Status::unknown(
1476 format!("Service was not ready: {}", e.into()),
1477 )
1478 })?;
1479 let codec = tonic_prost::ProstCodec::default();
1480 let path = http::uri::PathAndQuery::from_static(
1481 "/pidgr.v1.PrivacyService/RestrictProcessing",
1482 );
1483 let mut req = request.into_request();
1484 req.extensions_mut()
1485 .insert(
1486 GrpcMethod::new("pidgr.v1.PrivacyService", "RestrictProcessing"),
1487 );
1488 self.inner.unary(req, path, codec).await
1489 }
1490 pub async fn get_data_existence_confirmation(
1495 &mut self,
1496 request: impl tonic::IntoRequest<super::GetDataExistenceConfirmationRequest>,
1497 ) -> std::result::Result<
1498 tonic::Response<super::GetDataExistenceConfirmationResponse>,
1499 tonic::Status,
1500 > {
1501 self.inner
1502 .ready()
1503 .await
1504 .map_err(|e| {
1505 tonic::Status::unknown(
1506 format!("Service was not ready: {}", e.into()),
1507 )
1508 })?;
1509 let codec = tonic_prost::ProstCodec::default();
1510 let path = http::uri::PathAndQuery::from_static(
1511 "/pidgr.v1.PrivacyService/GetDataExistenceConfirmation",
1512 );
1513 let mut req = request.into_request();
1514 req.extensions_mut()
1515 .insert(
1516 GrpcMethod::new(
1517 "pidgr.v1.PrivacyService",
1518 "GetDataExistenceConfirmation",
1519 ),
1520 );
1521 self.inner.unary(req, path, codec).await
1522 }
1523 pub async fn list_privacy_requests(
1528 &mut self,
1529 request: impl tonic::IntoRequest<super::ListPrivacyRequestsRequest>,
1530 ) -> std::result::Result<
1531 tonic::Response<super::ListPrivacyRequestsResponse>,
1532 tonic::Status,
1533 > {
1534 self.inner
1535 .ready()
1536 .await
1537 .map_err(|e| {
1538 tonic::Status::unknown(
1539 format!("Service was not ready: {}", e.into()),
1540 )
1541 })?;
1542 let codec = tonic_prost::ProstCodec::default();
1543 let path = http::uri::PathAndQuery::from_static(
1544 "/pidgr.v1.PrivacyService/ListPrivacyRequests",
1545 );
1546 let mut req = request.into_request();
1547 req.extensions_mut()
1548 .insert(
1549 GrpcMethod::new("pidgr.v1.PrivacyService", "ListPrivacyRequests"),
1550 );
1551 self.inner.unary(req, path, codec).await
1552 }
1553 pub async fn cancel_deletion(
1558 &mut self,
1559 request: impl tonic::IntoRequest<super::CancelDeletionRequest>,
1560 ) -> std::result::Result<
1561 tonic::Response<super::CancelDeletionResponse>,
1562 tonic::Status,
1563 > {
1564 self.inner
1565 .ready()
1566 .await
1567 .map_err(|e| {
1568 tonic::Status::unknown(
1569 format!("Service was not ready: {}", e.into()),
1570 )
1571 })?;
1572 let codec = tonic_prost::ProstCodec::default();
1573 let path = http::uri::PathAndQuery::from_static(
1574 "/pidgr.v1.PrivacyService/CancelDeletion",
1575 );
1576 let mut req = request.into_request();
1577 req.extensions_mut()
1578 .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "CancelDeletion"));
1579 self.inner.unary(req, path, codec).await
1580 }
1581 pub async fn immediate_delete(
1586 &mut self,
1587 request: impl tonic::IntoRequest<super::ImmediateDeleteRequest>,
1588 ) -> std::result::Result<
1589 tonic::Response<super::ImmediateDeleteResponse>,
1590 tonic::Status,
1591 > {
1592 self.inner
1593 .ready()
1594 .await
1595 .map_err(|e| {
1596 tonic::Status::unknown(
1597 format!("Service was not ready: {}", e.into()),
1598 )
1599 })?;
1600 let codec = tonic_prost::ProstCodec::default();
1601 let path = http::uri::PathAndQuery::from_static(
1602 "/pidgr.v1.PrivacyService/ImmediateDelete",
1603 );
1604 let mut req = request.into_request();
1605 req.extensions_mut()
1606 .insert(GrpcMethod::new("pidgr.v1.PrivacyService", "ImmediateDelete"));
1607 self.inner.unary(req, path, codec).await
1608 }
1609 }
1610}
1611pub mod privacy_service_server {
1613 #![allow(
1614 unused_variables,
1615 dead_code,
1616 missing_docs,
1617 clippy::wildcard_imports,
1618 clippy::let_unit_value,
1619 )]
1620 use tonic::codegen::*;
1621 #[async_trait]
1623 pub trait PrivacyService: std::marker::Send + std::marker::Sync + 'static {
1624 async fn export_user_data(
1630 &self,
1631 request: tonic::Request<super::ExportUserDataRequest>,
1632 ) -> std::result::Result<
1633 tonic::Response<super::ExportUserDataResponse>,
1634 tonic::Status,
1635 >;
1636 async fn delete_user_data(
1642 &self,
1643 request: tonic::Request<super::DeleteUserDataRequest>,
1644 ) -> std::result::Result<
1645 tonic::Response<super::DeleteUserDataResponse>,
1646 tonic::Status,
1647 >;
1648 async fn rectify_user_data(
1653 &self,
1654 request: tonic::Request<super::RectifyUserDataRequest>,
1655 ) -> std::result::Result<
1656 tonic::Response<super::RectifyUserDataResponse>,
1657 tonic::Status,
1658 >;
1659 async fn restrict_processing(
1664 &self,
1665 request: tonic::Request<super::RestrictProcessingRequest>,
1666 ) -> std::result::Result<
1667 tonic::Response<super::RestrictProcessingResponse>,
1668 tonic::Status,
1669 >;
1670 async fn get_data_existence_confirmation(
1675 &self,
1676 request: tonic::Request<super::GetDataExistenceConfirmationRequest>,
1677 ) -> std::result::Result<
1678 tonic::Response<super::GetDataExistenceConfirmationResponse>,
1679 tonic::Status,
1680 >;
1681 async fn list_privacy_requests(
1686 &self,
1687 request: tonic::Request<super::ListPrivacyRequestsRequest>,
1688 ) -> std::result::Result<
1689 tonic::Response<super::ListPrivacyRequestsResponse>,
1690 tonic::Status,
1691 >;
1692 async fn cancel_deletion(
1697 &self,
1698 request: tonic::Request<super::CancelDeletionRequest>,
1699 ) -> std::result::Result<
1700 tonic::Response<super::CancelDeletionResponse>,
1701 tonic::Status,
1702 >;
1703 async fn immediate_delete(
1708 &self,
1709 request: tonic::Request<super::ImmediateDeleteRequest>,
1710 ) -> std::result::Result<
1711 tonic::Response<super::ImmediateDeleteResponse>,
1712 tonic::Status,
1713 >;
1714 }
1715 #[derive(Debug)]
1719 pub struct PrivacyServiceServer<T> {
1720 inner: Arc<T>,
1721 accept_compression_encodings: EnabledCompressionEncodings,
1722 send_compression_encodings: EnabledCompressionEncodings,
1723 max_decoding_message_size: Option<usize>,
1724 max_encoding_message_size: Option<usize>,
1725 }
1726 impl<T> PrivacyServiceServer<T> {
1727 pub fn new(inner: T) -> Self {
1728 Self::from_arc(Arc::new(inner))
1729 }
1730 pub fn from_arc(inner: Arc<T>) -> Self {
1731 Self {
1732 inner,
1733 accept_compression_encodings: Default::default(),
1734 send_compression_encodings: Default::default(),
1735 max_decoding_message_size: None,
1736 max_encoding_message_size: None,
1737 }
1738 }
1739 pub fn with_interceptor<F>(
1740 inner: T,
1741 interceptor: F,
1742 ) -> InterceptedService<Self, F>
1743 where
1744 F: tonic::service::Interceptor,
1745 {
1746 InterceptedService::new(Self::new(inner), interceptor)
1747 }
1748 #[must_use]
1750 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1751 self.accept_compression_encodings.enable(encoding);
1752 self
1753 }
1754 #[must_use]
1756 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1757 self.send_compression_encodings.enable(encoding);
1758 self
1759 }
1760 #[must_use]
1764 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1765 self.max_decoding_message_size = Some(limit);
1766 self
1767 }
1768 #[must_use]
1772 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1773 self.max_encoding_message_size = Some(limit);
1774 self
1775 }
1776 }
1777 impl<T, B> tonic::codegen::Service<http::Request<B>> for PrivacyServiceServer<T>
1778 where
1779 T: PrivacyService,
1780 B: Body + std::marker::Send + 'static,
1781 B::Error: Into<StdError> + std::marker::Send + 'static,
1782 {
1783 type Response = http::Response<tonic::body::Body>;
1784 type Error = std::convert::Infallible;
1785 type Future = BoxFuture<Self::Response, Self::Error>;
1786 fn poll_ready(
1787 &mut self,
1788 _cx: &mut Context<'_>,
1789 ) -> Poll<std::result::Result<(), Self::Error>> {
1790 Poll::Ready(Ok(()))
1791 }
1792 fn call(&mut self, req: http::Request<B>) -> Self::Future {
1793 match req.uri().path() {
1794 "/pidgr.v1.PrivacyService/ExportUserData" => {
1795 #[allow(non_camel_case_types)]
1796 struct ExportUserDataSvc<T: PrivacyService>(pub Arc<T>);
1797 impl<
1798 T: PrivacyService,
1799 > tonic::server::UnaryService<super::ExportUserDataRequest>
1800 for ExportUserDataSvc<T> {
1801 type Response = super::ExportUserDataResponse;
1802 type Future = BoxFuture<
1803 tonic::Response<Self::Response>,
1804 tonic::Status,
1805 >;
1806 fn call(
1807 &mut self,
1808 request: tonic::Request<super::ExportUserDataRequest>,
1809 ) -> Self::Future {
1810 let inner = Arc::clone(&self.0);
1811 let fut = async move {
1812 <T as PrivacyService>::export_user_data(&inner, request)
1813 .await
1814 };
1815 Box::pin(fut)
1816 }
1817 }
1818 let accept_compression_encodings = self.accept_compression_encodings;
1819 let send_compression_encodings = self.send_compression_encodings;
1820 let max_decoding_message_size = self.max_decoding_message_size;
1821 let max_encoding_message_size = self.max_encoding_message_size;
1822 let inner = self.inner.clone();
1823 let fut = async move {
1824 let method = ExportUserDataSvc(inner);
1825 let codec = tonic_prost::ProstCodec::default();
1826 let mut grpc = tonic::server::Grpc::new(codec)
1827 .apply_compression_config(
1828 accept_compression_encodings,
1829 send_compression_encodings,
1830 )
1831 .apply_max_message_size_config(
1832 max_decoding_message_size,
1833 max_encoding_message_size,
1834 );
1835 let res = grpc.unary(method, req).await;
1836 Ok(res)
1837 };
1838 Box::pin(fut)
1839 }
1840 "/pidgr.v1.PrivacyService/DeleteUserData" => {
1841 #[allow(non_camel_case_types)]
1842 struct DeleteUserDataSvc<T: PrivacyService>(pub Arc<T>);
1843 impl<
1844 T: PrivacyService,
1845 > tonic::server::UnaryService<super::DeleteUserDataRequest>
1846 for DeleteUserDataSvc<T> {
1847 type Response = super::DeleteUserDataResponse;
1848 type Future = BoxFuture<
1849 tonic::Response<Self::Response>,
1850 tonic::Status,
1851 >;
1852 fn call(
1853 &mut self,
1854 request: tonic::Request<super::DeleteUserDataRequest>,
1855 ) -> Self::Future {
1856 let inner = Arc::clone(&self.0);
1857 let fut = async move {
1858 <T as PrivacyService>::delete_user_data(&inner, request)
1859 .await
1860 };
1861 Box::pin(fut)
1862 }
1863 }
1864 let accept_compression_encodings = self.accept_compression_encodings;
1865 let send_compression_encodings = self.send_compression_encodings;
1866 let max_decoding_message_size = self.max_decoding_message_size;
1867 let max_encoding_message_size = self.max_encoding_message_size;
1868 let inner = self.inner.clone();
1869 let fut = async move {
1870 let method = DeleteUserDataSvc(inner);
1871 let codec = tonic_prost::ProstCodec::default();
1872 let mut grpc = tonic::server::Grpc::new(codec)
1873 .apply_compression_config(
1874 accept_compression_encodings,
1875 send_compression_encodings,
1876 )
1877 .apply_max_message_size_config(
1878 max_decoding_message_size,
1879 max_encoding_message_size,
1880 );
1881 let res = grpc.unary(method, req).await;
1882 Ok(res)
1883 };
1884 Box::pin(fut)
1885 }
1886 "/pidgr.v1.PrivacyService/RectifyUserData" => {
1887 #[allow(non_camel_case_types)]
1888 struct RectifyUserDataSvc<T: PrivacyService>(pub Arc<T>);
1889 impl<
1890 T: PrivacyService,
1891 > tonic::server::UnaryService<super::RectifyUserDataRequest>
1892 for RectifyUserDataSvc<T> {
1893 type Response = super::RectifyUserDataResponse;
1894 type Future = BoxFuture<
1895 tonic::Response<Self::Response>,
1896 tonic::Status,
1897 >;
1898 fn call(
1899 &mut self,
1900 request: tonic::Request<super::RectifyUserDataRequest>,
1901 ) -> Self::Future {
1902 let inner = Arc::clone(&self.0);
1903 let fut = async move {
1904 <T as PrivacyService>::rectify_user_data(&inner, request)
1905 .await
1906 };
1907 Box::pin(fut)
1908 }
1909 }
1910 let accept_compression_encodings = self.accept_compression_encodings;
1911 let send_compression_encodings = self.send_compression_encodings;
1912 let max_decoding_message_size = self.max_decoding_message_size;
1913 let max_encoding_message_size = self.max_encoding_message_size;
1914 let inner = self.inner.clone();
1915 let fut = async move {
1916 let method = RectifyUserDataSvc(inner);
1917 let codec = tonic_prost::ProstCodec::default();
1918 let mut grpc = tonic::server::Grpc::new(codec)
1919 .apply_compression_config(
1920 accept_compression_encodings,
1921 send_compression_encodings,
1922 )
1923 .apply_max_message_size_config(
1924 max_decoding_message_size,
1925 max_encoding_message_size,
1926 );
1927 let res = grpc.unary(method, req).await;
1928 Ok(res)
1929 };
1930 Box::pin(fut)
1931 }
1932 "/pidgr.v1.PrivacyService/RestrictProcessing" => {
1933 #[allow(non_camel_case_types)]
1934 struct RestrictProcessingSvc<T: PrivacyService>(pub Arc<T>);
1935 impl<
1936 T: PrivacyService,
1937 > tonic::server::UnaryService<super::RestrictProcessingRequest>
1938 for RestrictProcessingSvc<T> {
1939 type Response = super::RestrictProcessingResponse;
1940 type Future = BoxFuture<
1941 tonic::Response<Self::Response>,
1942 tonic::Status,
1943 >;
1944 fn call(
1945 &mut self,
1946 request: tonic::Request<super::RestrictProcessingRequest>,
1947 ) -> Self::Future {
1948 let inner = Arc::clone(&self.0);
1949 let fut = async move {
1950 <T as PrivacyService>::restrict_processing(&inner, request)
1951 .await
1952 };
1953 Box::pin(fut)
1954 }
1955 }
1956 let accept_compression_encodings = self.accept_compression_encodings;
1957 let send_compression_encodings = self.send_compression_encodings;
1958 let max_decoding_message_size = self.max_decoding_message_size;
1959 let max_encoding_message_size = self.max_encoding_message_size;
1960 let inner = self.inner.clone();
1961 let fut = async move {
1962 let method = RestrictProcessingSvc(inner);
1963 let codec = tonic_prost::ProstCodec::default();
1964 let mut grpc = tonic::server::Grpc::new(codec)
1965 .apply_compression_config(
1966 accept_compression_encodings,
1967 send_compression_encodings,
1968 )
1969 .apply_max_message_size_config(
1970 max_decoding_message_size,
1971 max_encoding_message_size,
1972 );
1973 let res = grpc.unary(method, req).await;
1974 Ok(res)
1975 };
1976 Box::pin(fut)
1977 }
1978 "/pidgr.v1.PrivacyService/GetDataExistenceConfirmation" => {
1979 #[allow(non_camel_case_types)]
1980 struct GetDataExistenceConfirmationSvc<T: PrivacyService>(
1981 pub Arc<T>,
1982 );
1983 impl<
1984 T: PrivacyService,
1985 > tonic::server::UnaryService<
1986 super::GetDataExistenceConfirmationRequest,
1987 > for GetDataExistenceConfirmationSvc<T> {
1988 type Response = super::GetDataExistenceConfirmationResponse;
1989 type Future = BoxFuture<
1990 tonic::Response<Self::Response>,
1991 tonic::Status,
1992 >;
1993 fn call(
1994 &mut self,
1995 request: tonic::Request<
1996 super::GetDataExistenceConfirmationRequest,
1997 >,
1998 ) -> Self::Future {
1999 let inner = Arc::clone(&self.0);
2000 let fut = async move {
2001 <T as PrivacyService>::get_data_existence_confirmation(
2002 &inner,
2003 request,
2004 )
2005 .await
2006 };
2007 Box::pin(fut)
2008 }
2009 }
2010 let accept_compression_encodings = self.accept_compression_encodings;
2011 let send_compression_encodings = self.send_compression_encodings;
2012 let max_decoding_message_size = self.max_decoding_message_size;
2013 let max_encoding_message_size = self.max_encoding_message_size;
2014 let inner = self.inner.clone();
2015 let fut = async move {
2016 let method = GetDataExistenceConfirmationSvc(inner);
2017 let codec = tonic_prost::ProstCodec::default();
2018 let mut grpc = tonic::server::Grpc::new(codec)
2019 .apply_compression_config(
2020 accept_compression_encodings,
2021 send_compression_encodings,
2022 )
2023 .apply_max_message_size_config(
2024 max_decoding_message_size,
2025 max_encoding_message_size,
2026 );
2027 let res = grpc.unary(method, req).await;
2028 Ok(res)
2029 };
2030 Box::pin(fut)
2031 }
2032 "/pidgr.v1.PrivacyService/ListPrivacyRequests" => {
2033 #[allow(non_camel_case_types)]
2034 struct ListPrivacyRequestsSvc<T: PrivacyService>(pub Arc<T>);
2035 impl<
2036 T: PrivacyService,
2037 > tonic::server::UnaryService<super::ListPrivacyRequestsRequest>
2038 for ListPrivacyRequestsSvc<T> {
2039 type Response = super::ListPrivacyRequestsResponse;
2040 type Future = BoxFuture<
2041 tonic::Response<Self::Response>,
2042 tonic::Status,
2043 >;
2044 fn call(
2045 &mut self,
2046 request: tonic::Request<super::ListPrivacyRequestsRequest>,
2047 ) -> Self::Future {
2048 let inner = Arc::clone(&self.0);
2049 let fut = async move {
2050 <T as PrivacyService>::list_privacy_requests(
2051 &inner,
2052 request,
2053 )
2054 .await
2055 };
2056 Box::pin(fut)
2057 }
2058 }
2059 let accept_compression_encodings = self.accept_compression_encodings;
2060 let send_compression_encodings = self.send_compression_encodings;
2061 let max_decoding_message_size = self.max_decoding_message_size;
2062 let max_encoding_message_size = self.max_encoding_message_size;
2063 let inner = self.inner.clone();
2064 let fut = async move {
2065 let method = ListPrivacyRequestsSvc(inner);
2066 let codec = tonic_prost::ProstCodec::default();
2067 let mut grpc = tonic::server::Grpc::new(codec)
2068 .apply_compression_config(
2069 accept_compression_encodings,
2070 send_compression_encodings,
2071 )
2072 .apply_max_message_size_config(
2073 max_decoding_message_size,
2074 max_encoding_message_size,
2075 );
2076 let res = grpc.unary(method, req).await;
2077 Ok(res)
2078 };
2079 Box::pin(fut)
2080 }
2081 "/pidgr.v1.PrivacyService/CancelDeletion" => {
2082 #[allow(non_camel_case_types)]
2083 struct CancelDeletionSvc<T: PrivacyService>(pub Arc<T>);
2084 impl<
2085 T: PrivacyService,
2086 > tonic::server::UnaryService<super::CancelDeletionRequest>
2087 for CancelDeletionSvc<T> {
2088 type Response = super::CancelDeletionResponse;
2089 type Future = BoxFuture<
2090 tonic::Response<Self::Response>,
2091 tonic::Status,
2092 >;
2093 fn call(
2094 &mut self,
2095 request: tonic::Request<super::CancelDeletionRequest>,
2096 ) -> Self::Future {
2097 let inner = Arc::clone(&self.0);
2098 let fut = async move {
2099 <T as PrivacyService>::cancel_deletion(&inner, request)
2100 .await
2101 };
2102 Box::pin(fut)
2103 }
2104 }
2105 let accept_compression_encodings = self.accept_compression_encodings;
2106 let send_compression_encodings = self.send_compression_encodings;
2107 let max_decoding_message_size = self.max_decoding_message_size;
2108 let max_encoding_message_size = self.max_encoding_message_size;
2109 let inner = self.inner.clone();
2110 let fut = async move {
2111 let method = CancelDeletionSvc(inner);
2112 let codec = tonic_prost::ProstCodec::default();
2113 let mut grpc = tonic::server::Grpc::new(codec)
2114 .apply_compression_config(
2115 accept_compression_encodings,
2116 send_compression_encodings,
2117 )
2118 .apply_max_message_size_config(
2119 max_decoding_message_size,
2120 max_encoding_message_size,
2121 );
2122 let res = grpc.unary(method, req).await;
2123 Ok(res)
2124 };
2125 Box::pin(fut)
2126 }
2127 "/pidgr.v1.PrivacyService/ImmediateDelete" => {
2128 #[allow(non_camel_case_types)]
2129 struct ImmediateDeleteSvc<T: PrivacyService>(pub Arc<T>);
2130 impl<
2131 T: PrivacyService,
2132 > tonic::server::UnaryService<super::ImmediateDeleteRequest>
2133 for ImmediateDeleteSvc<T> {
2134 type Response = super::ImmediateDeleteResponse;
2135 type Future = BoxFuture<
2136 tonic::Response<Self::Response>,
2137 tonic::Status,
2138 >;
2139 fn call(
2140 &mut self,
2141 request: tonic::Request<super::ImmediateDeleteRequest>,
2142 ) -> Self::Future {
2143 let inner = Arc::clone(&self.0);
2144 let fut = async move {
2145 <T as PrivacyService>::immediate_delete(&inner, request)
2146 .await
2147 };
2148 Box::pin(fut)
2149 }
2150 }
2151 let accept_compression_encodings = self.accept_compression_encodings;
2152 let send_compression_encodings = self.send_compression_encodings;
2153 let max_decoding_message_size = self.max_decoding_message_size;
2154 let max_encoding_message_size = self.max_encoding_message_size;
2155 let inner = self.inner.clone();
2156 let fut = async move {
2157 let method = ImmediateDeleteSvc(inner);
2158 let codec = tonic_prost::ProstCodec::default();
2159 let mut grpc = tonic::server::Grpc::new(codec)
2160 .apply_compression_config(
2161 accept_compression_encodings,
2162 send_compression_encodings,
2163 )
2164 .apply_max_message_size_config(
2165 max_decoding_message_size,
2166 max_encoding_message_size,
2167 );
2168 let res = grpc.unary(method, req).await;
2169 Ok(res)
2170 };
2171 Box::pin(fut)
2172 }
2173 _ => {
2174 Box::pin(async move {
2175 let mut response = http::Response::new(
2176 tonic::body::Body::default(),
2177 );
2178 let headers = response.headers_mut();
2179 headers
2180 .insert(
2181 tonic::Status::GRPC_STATUS,
2182 (tonic::Code::Unimplemented as i32).into(),
2183 );
2184 headers
2185 .insert(
2186 http::header::CONTENT_TYPE,
2187 tonic::metadata::GRPC_CONTENT_TYPE,
2188 );
2189 Ok(response)
2190 })
2191 }
2192 }
2193 }
2194 }
2195 impl<T> Clone for PrivacyServiceServer<T> {
2196 fn clone(&self) -> Self {
2197 let inner = self.inner.clone();
2198 Self {
2199 inner,
2200 accept_compression_encodings: self.accept_compression_encodings,
2201 send_compression_encodings: self.send_compression_encodings,
2202 max_decoding_message_size: self.max_decoding_message_size,
2203 max_encoding_message_size: self.max_encoding_message_size,
2204 }
2205 }
2206 }
2207 pub const SERVICE_NAME: &str = "pidgr.v1.PrivacyService";
2209 impl<T> tonic::server::NamedService for PrivacyServiceServer<T> {
2210 const NAME: &'static str = SERVICE_NAME;
2211 }
2212}
2213pub mod audit_service_client {
2215 #![allow(
2216 unused_variables,
2217 dead_code,
2218 missing_docs,
2219 clippy::wildcard_imports,
2220 clippy::let_unit_value,
2221 )]
2222 use tonic::codegen::*;
2223 use tonic::codegen::http::Uri;
2224 #[derive(Debug, Clone)]
2228 pub struct AuditServiceClient<T> {
2229 inner: tonic::client::Grpc<T>,
2230 }
2231 impl AuditServiceClient<tonic::transport::Channel> {
2232 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
2234 where
2235 D: TryInto<tonic::transport::Endpoint>,
2236 D::Error: Into<StdError>,
2237 {
2238 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
2239 Ok(Self::new(conn))
2240 }
2241 }
2242 impl<T> AuditServiceClient<T>
2243 where
2244 T: tonic::client::GrpcService<tonic::body::Body>,
2245 T::Error: Into<StdError>,
2246 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
2247 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
2248 {
2249 pub fn new(inner: T) -> Self {
2250 let inner = tonic::client::Grpc::new(inner);
2251 Self { inner }
2252 }
2253 pub fn with_origin(inner: T, origin: Uri) -> Self {
2254 let inner = tonic::client::Grpc::with_origin(inner, origin);
2255 Self { inner }
2256 }
2257 pub fn with_interceptor<F>(
2258 inner: T,
2259 interceptor: F,
2260 ) -> AuditServiceClient<InterceptedService<T, F>>
2261 where
2262 F: tonic::service::Interceptor,
2263 T::ResponseBody: Default,
2264 T: tonic::codegen::Service<
2265 http::Request<tonic::body::Body>,
2266 Response = http::Response<
2267 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
2268 >,
2269 >,
2270 <T as tonic::codegen::Service<
2271 http::Request<tonic::body::Body>,
2272 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
2273 {
2274 AuditServiceClient::new(InterceptedService::new(inner, interceptor))
2275 }
2276 #[must_use]
2281 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2282 self.inner = self.inner.send_compressed(encoding);
2283 self
2284 }
2285 #[must_use]
2287 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2288 self.inner = self.inner.accept_compressed(encoding);
2289 self
2290 }
2291 #[must_use]
2295 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2296 self.inner = self.inner.max_decoding_message_size(limit);
2297 self
2298 }
2299 #[must_use]
2303 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2304 self.inner = self.inner.max_encoding_message_size(limit);
2305 self
2306 }
2307 pub async fn list_audit_events(
2312 &mut self,
2313 request: impl tonic::IntoRequest<super::ListAuditEventsRequest>,
2314 ) -> std::result::Result<
2315 tonic::Response<super::ListAuditEventsResponse>,
2316 tonic::Status,
2317 > {
2318 self.inner
2319 .ready()
2320 .await
2321 .map_err(|e| {
2322 tonic::Status::unknown(
2323 format!("Service was not ready: {}", e.into()),
2324 )
2325 })?;
2326 let codec = tonic_prost::ProstCodec::default();
2327 let path = http::uri::PathAndQuery::from_static(
2328 "/pidgr.v1.AuditService/ListAuditEvents",
2329 );
2330 let mut req = request.into_request();
2331 req.extensions_mut()
2332 .insert(GrpcMethod::new("pidgr.v1.AuditService", "ListAuditEvents"));
2333 self.inner.unary(req, path, codec).await
2334 }
2335 pub async fn export_audit_trail(
2340 &mut self,
2341 request: impl tonic::IntoRequest<super::ExportAuditTrailRequest>,
2342 ) -> std::result::Result<
2343 tonic::Response<super::ExportAuditTrailResponse>,
2344 tonic::Status,
2345 > {
2346 self.inner
2347 .ready()
2348 .await
2349 .map_err(|e| {
2350 tonic::Status::unknown(
2351 format!("Service was not ready: {}", e.into()),
2352 )
2353 })?;
2354 let codec = tonic_prost::ProstCodec::default();
2355 let path = http::uri::PathAndQuery::from_static(
2356 "/pidgr.v1.AuditService/ExportAuditTrail",
2357 );
2358 let mut req = request.into_request();
2359 req.extensions_mut()
2360 .insert(GrpcMethod::new("pidgr.v1.AuditService", "ExportAuditTrail"));
2361 self.inner.unary(req, path, codec).await
2362 }
2363 pub async fn list_audit_exports(
2367 &mut self,
2368 request: impl tonic::IntoRequest<super::ListAuditExportsRequest>,
2369 ) -> std::result::Result<
2370 tonic::Response<super::ListAuditExportsResponse>,
2371 tonic::Status,
2372 > {
2373 self.inner
2374 .ready()
2375 .await
2376 .map_err(|e| {
2377 tonic::Status::unknown(
2378 format!("Service was not ready: {}", e.into()),
2379 )
2380 })?;
2381 let codec = tonic_prost::ProstCodec::default();
2382 let path = http::uri::PathAndQuery::from_static(
2383 "/pidgr.v1.AuditService/ListAuditExports",
2384 );
2385 let mut req = request.into_request();
2386 req.extensions_mut()
2387 .insert(GrpcMethod::new("pidgr.v1.AuditService", "ListAuditExports"));
2388 self.inner.unary(req, path, codec).await
2389 }
2390 }
2391}
2392pub mod audit_service_server {
2394 #![allow(
2395 unused_variables,
2396 dead_code,
2397 missing_docs,
2398 clippy::wildcard_imports,
2399 clippy::let_unit_value,
2400 )]
2401 use tonic::codegen::*;
2402 #[async_trait]
2404 pub trait AuditService: std::marker::Send + std::marker::Sync + 'static {
2405 async fn list_audit_events(
2410 &self,
2411 request: tonic::Request<super::ListAuditEventsRequest>,
2412 ) -> std::result::Result<
2413 tonic::Response<super::ListAuditEventsResponse>,
2414 tonic::Status,
2415 >;
2416 async fn export_audit_trail(
2421 &self,
2422 request: tonic::Request<super::ExportAuditTrailRequest>,
2423 ) -> std::result::Result<
2424 tonic::Response<super::ExportAuditTrailResponse>,
2425 tonic::Status,
2426 >;
2427 async fn list_audit_exports(
2431 &self,
2432 request: tonic::Request<super::ListAuditExportsRequest>,
2433 ) -> std::result::Result<
2434 tonic::Response<super::ListAuditExportsResponse>,
2435 tonic::Status,
2436 >;
2437 }
2438 #[derive(Debug)]
2442 pub struct AuditServiceServer<T> {
2443 inner: Arc<T>,
2444 accept_compression_encodings: EnabledCompressionEncodings,
2445 send_compression_encodings: EnabledCompressionEncodings,
2446 max_decoding_message_size: Option<usize>,
2447 max_encoding_message_size: Option<usize>,
2448 }
2449 impl<T> AuditServiceServer<T> {
2450 pub fn new(inner: T) -> Self {
2451 Self::from_arc(Arc::new(inner))
2452 }
2453 pub fn from_arc(inner: Arc<T>) -> Self {
2454 Self {
2455 inner,
2456 accept_compression_encodings: Default::default(),
2457 send_compression_encodings: Default::default(),
2458 max_decoding_message_size: None,
2459 max_encoding_message_size: None,
2460 }
2461 }
2462 pub fn with_interceptor<F>(
2463 inner: T,
2464 interceptor: F,
2465 ) -> InterceptedService<Self, F>
2466 where
2467 F: tonic::service::Interceptor,
2468 {
2469 InterceptedService::new(Self::new(inner), interceptor)
2470 }
2471 #[must_use]
2473 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2474 self.accept_compression_encodings.enable(encoding);
2475 self
2476 }
2477 #[must_use]
2479 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2480 self.send_compression_encodings.enable(encoding);
2481 self
2482 }
2483 #[must_use]
2487 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2488 self.max_decoding_message_size = Some(limit);
2489 self
2490 }
2491 #[must_use]
2495 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2496 self.max_encoding_message_size = Some(limit);
2497 self
2498 }
2499 }
2500 impl<T, B> tonic::codegen::Service<http::Request<B>> for AuditServiceServer<T>
2501 where
2502 T: AuditService,
2503 B: Body + std::marker::Send + 'static,
2504 B::Error: Into<StdError> + std::marker::Send + 'static,
2505 {
2506 type Response = http::Response<tonic::body::Body>;
2507 type Error = std::convert::Infallible;
2508 type Future = BoxFuture<Self::Response, Self::Error>;
2509 fn poll_ready(
2510 &mut self,
2511 _cx: &mut Context<'_>,
2512 ) -> Poll<std::result::Result<(), Self::Error>> {
2513 Poll::Ready(Ok(()))
2514 }
2515 fn call(&mut self, req: http::Request<B>) -> Self::Future {
2516 match req.uri().path() {
2517 "/pidgr.v1.AuditService/ListAuditEvents" => {
2518 #[allow(non_camel_case_types)]
2519 struct ListAuditEventsSvc<T: AuditService>(pub Arc<T>);
2520 impl<
2521 T: AuditService,
2522 > tonic::server::UnaryService<super::ListAuditEventsRequest>
2523 for ListAuditEventsSvc<T> {
2524 type Response = super::ListAuditEventsResponse;
2525 type Future = BoxFuture<
2526 tonic::Response<Self::Response>,
2527 tonic::Status,
2528 >;
2529 fn call(
2530 &mut self,
2531 request: tonic::Request<super::ListAuditEventsRequest>,
2532 ) -> Self::Future {
2533 let inner = Arc::clone(&self.0);
2534 let fut = async move {
2535 <T as AuditService>::list_audit_events(&inner, request)
2536 .await
2537 };
2538 Box::pin(fut)
2539 }
2540 }
2541 let accept_compression_encodings = self.accept_compression_encodings;
2542 let send_compression_encodings = self.send_compression_encodings;
2543 let max_decoding_message_size = self.max_decoding_message_size;
2544 let max_encoding_message_size = self.max_encoding_message_size;
2545 let inner = self.inner.clone();
2546 let fut = async move {
2547 let method = ListAuditEventsSvc(inner);
2548 let codec = tonic_prost::ProstCodec::default();
2549 let mut grpc = tonic::server::Grpc::new(codec)
2550 .apply_compression_config(
2551 accept_compression_encodings,
2552 send_compression_encodings,
2553 )
2554 .apply_max_message_size_config(
2555 max_decoding_message_size,
2556 max_encoding_message_size,
2557 );
2558 let res = grpc.unary(method, req).await;
2559 Ok(res)
2560 };
2561 Box::pin(fut)
2562 }
2563 "/pidgr.v1.AuditService/ExportAuditTrail" => {
2564 #[allow(non_camel_case_types)]
2565 struct ExportAuditTrailSvc<T: AuditService>(pub Arc<T>);
2566 impl<
2567 T: AuditService,
2568 > tonic::server::UnaryService<super::ExportAuditTrailRequest>
2569 for ExportAuditTrailSvc<T> {
2570 type Response = super::ExportAuditTrailResponse;
2571 type Future = BoxFuture<
2572 tonic::Response<Self::Response>,
2573 tonic::Status,
2574 >;
2575 fn call(
2576 &mut self,
2577 request: tonic::Request<super::ExportAuditTrailRequest>,
2578 ) -> Self::Future {
2579 let inner = Arc::clone(&self.0);
2580 let fut = async move {
2581 <T as AuditService>::export_audit_trail(&inner, request)
2582 .await
2583 };
2584 Box::pin(fut)
2585 }
2586 }
2587 let accept_compression_encodings = self.accept_compression_encodings;
2588 let send_compression_encodings = self.send_compression_encodings;
2589 let max_decoding_message_size = self.max_decoding_message_size;
2590 let max_encoding_message_size = self.max_encoding_message_size;
2591 let inner = self.inner.clone();
2592 let fut = async move {
2593 let method = ExportAuditTrailSvc(inner);
2594 let codec = tonic_prost::ProstCodec::default();
2595 let mut grpc = tonic::server::Grpc::new(codec)
2596 .apply_compression_config(
2597 accept_compression_encodings,
2598 send_compression_encodings,
2599 )
2600 .apply_max_message_size_config(
2601 max_decoding_message_size,
2602 max_encoding_message_size,
2603 );
2604 let res = grpc.unary(method, req).await;
2605 Ok(res)
2606 };
2607 Box::pin(fut)
2608 }
2609 "/pidgr.v1.AuditService/ListAuditExports" => {
2610 #[allow(non_camel_case_types)]
2611 struct ListAuditExportsSvc<T: AuditService>(pub Arc<T>);
2612 impl<
2613 T: AuditService,
2614 > tonic::server::UnaryService<super::ListAuditExportsRequest>
2615 for ListAuditExportsSvc<T> {
2616 type Response = super::ListAuditExportsResponse;
2617 type Future = BoxFuture<
2618 tonic::Response<Self::Response>,
2619 tonic::Status,
2620 >;
2621 fn call(
2622 &mut self,
2623 request: tonic::Request<super::ListAuditExportsRequest>,
2624 ) -> Self::Future {
2625 let inner = Arc::clone(&self.0);
2626 let fut = async move {
2627 <T as AuditService>::list_audit_exports(&inner, request)
2628 .await
2629 };
2630 Box::pin(fut)
2631 }
2632 }
2633 let accept_compression_encodings = self.accept_compression_encodings;
2634 let send_compression_encodings = self.send_compression_encodings;
2635 let max_decoding_message_size = self.max_decoding_message_size;
2636 let max_encoding_message_size = self.max_encoding_message_size;
2637 let inner = self.inner.clone();
2638 let fut = async move {
2639 let method = ListAuditExportsSvc(inner);
2640 let codec = tonic_prost::ProstCodec::default();
2641 let mut grpc = tonic::server::Grpc::new(codec)
2642 .apply_compression_config(
2643 accept_compression_encodings,
2644 send_compression_encodings,
2645 )
2646 .apply_max_message_size_config(
2647 max_decoding_message_size,
2648 max_encoding_message_size,
2649 );
2650 let res = grpc.unary(method, req).await;
2651 Ok(res)
2652 };
2653 Box::pin(fut)
2654 }
2655 _ => {
2656 Box::pin(async move {
2657 let mut response = http::Response::new(
2658 tonic::body::Body::default(),
2659 );
2660 let headers = response.headers_mut();
2661 headers
2662 .insert(
2663 tonic::Status::GRPC_STATUS,
2664 (tonic::Code::Unimplemented as i32).into(),
2665 );
2666 headers
2667 .insert(
2668 http::header::CONTENT_TYPE,
2669 tonic::metadata::GRPC_CONTENT_TYPE,
2670 );
2671 Ok(response)
2672 })
2673 }
2674 }
2675 }
2676 }
2677 impl<T> Clone for AuditServiceServer<T> {
2678 fn clone(&self) -> Self {
2679 let inner = self.inner.clone();
2680 Self {
2681 inner,
2682 accept_compression_encodings: self.accept_compression_encodings,
2683 send_compression_encodings: self.send_compression_encodings,
2684 max_decoding_message_size: self.max_decoding_message_size,
2685 max_encoding_message_size: self.max_encoding_message_size,
2686 }
2687 }
2688 }
2689 pub const SERVICE_NAME: &str = "pidgr.v1.AuditService";
2691 impl<T> tonic::server::NamedService for AuditServiceServer<T> {
2692 const NAME: &'static str = SERVICE_NAME;
2693 }
2694}
2695pub mod campaign_service_client {
2697 #![allow(
2698 unused_variables,
2699 dead_code,
2700 missing_docs,
2701 clippy::wildcard_imports,
2702 clippy::let_unit_value,
2703 )]
2704 use tonic::codegen::*;
2705 use tonic::codegen::http::Uri;
2706 #[derive(Debug, Clone)]
2710 pub struct CampaignServiceClient<T> {
2711 inner: tonic::client::Grpc<T>,
2712 }
2713 impl CampaignServiceClient<tonic::transport::Channel> {
2714 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
2716 where
2717 D: TryInto<tonic::transport::Endpoint>,
2718 D::Error: Into<StdError>,
2719 {
2720 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
2721 Ok(Self::new(conn))
2722 }
2723 }
2724 impl<T> CampaignServiceClient<T>
2725 where
2726 T: tonic::client::GrpcService<tonic::body::Body>,
2727 T::Error: Into<StdError>,
2728 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
2729 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
2730 {
2731 pub fn new(inner: T) -> Self {
2732 let inner = tonic::client::Grpc::new(inner);
2733 Self { inner }
2734 }
2735 pub fn with_origin(inner: T, origin: Uri) -> Self {
2736 let inner = tonic::client::Grpc::with_origin(inner, origin);
2737 Self { inner }
2738 }
2739 pub fn with_interceptor<F>(
2740 inner: T,
2741 interceptor: F,
2742 ) -> CampaignServiceClient<InterceptedService<T, F>>
2743 where
2744 F: tonic::service::Interceptor,
2745 T::ResponseBody: Default,
2746 T: tonic::codegen::Service<
2747 http::Request<tonic::body::Body>,
2748 Response = http::Response<
2749 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
2750 >,
2751 >,
2752 <T as tonic::codegen::Service<
2753 http::Request<tonic::body::Body>,
2754 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
2755 {
2756 CampaignServiceClient::new(InterceptedService::new(inner, interceptor))
2757 }
2758 #[must_use]
2763 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2764 self.inner = self.inner.send_compressed(encoding);
2765 self
2766 }
2767 #[must_use]
2769 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2770 self.inner = self.inner.accept_compressed(encoding);
2771 self
2772 }
2773 #[must_use]
2777 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2778 self.inner = self.inner.max_decoding_message_size(limit);
2779 self
2780 }
2781 #[must_use]
2785 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2786 self.inner = self.inner.max_encoding_message_size(limit);
2787 self
2788 }
2789 pub async fn create_campaign(
2793 &mut self,
2794 request: impl tonic::IntoRequest<super::CreateCampaignRequest>,
2795 ) -> std::result::Result<
2796 tonic::Response<super::CreateCampaignResponse>,
2797 tonic::Status,
2798 > {
2799 self.inner
2800 .ready()
2801 .await
2802 .map_err(|e| {
2803 tonic::Status::unknown(
2804 format!("Service was not ready: {}", e.into()),
2805 )
2806 })?;
2807 let codec = tonic_prost::ProstCodec::default();
2808 let path = http::uri::PathAndQuery::from_static(
2809 "/pidgr.v1.CampaignService/CreateCampaign",
2810 );
2811 let mut req = request.into_request();
2812 req.extensions_mut()
2813 .insert(GrpcMethod::new("pidgr.v1.CampaignService", "CreateCampaign"));
2814 self.inner.unary(req, path, codec).await
2815 }
2816 pub async fn start_campaign(
2820 &mut self,
2821 request: impl tonic::IntoRequest<super::StartCampaignRequest>,
2822 ) -> std::result::Result<
2823 tonic::Response<super::StartCampaignResponse>,
2824 tonic::Status,
2825 > {
2826 self.inner
2827 .ready()
2828 .await
2829 .map_err(|e| {
2830 tonic::Status::unknown(
2831 format!("Service was not ready: {}", e.into()),
2832 )
2833 })?;
2834 let codec = tonic_prost::ProstCodec::default();
2835 let path = http::uri::PathAndQuery::from_static(
2836 "/pidgr.v1.CampaignService/StartCampaign",
2837 );
2838 let mut req = request.into_request();
2839 req.extensions_mut()
2840 .insert(GrpcMethod::new("pidgr.v1.CampaignService", "StartCampaign"));
2841 self.inner.unary(req, path, codec).await
2842 }
2843 pub async fn get_campaign(
2847 &mut self,
2848 request: impl tonic::IntoRequest<super::GetCampaignRequest>,
2849 ) -> std::result::Result<
2850 tonic::Response<super::GetCampaignResponse>,
2851 tonic::Status,
2852 > {
2853 self.inner
2854 .ready()
2855 .await
2856 .map_err(|e| {
2857 tonic::Status::unknown(
2858 format!("Service was not ready: {}", e.into()),
2859 )
2860 })?;
2861 let codec = tonic_prost::ProstCodec::default();
2862 let path = http::uri::PathAndQuery::from_static(
2863 "/pidgr.v1.CampaignService/GetCampaign",
2864 );
2865 let mut req = request.into_request();
2866 req.extensions_mut()
2867 .insert(GrpcMethod::new("pidgr.v1.CampaignService", "GetCampaign"));
2868 self.inner.unary(req, path, codec).await
2869 }
2870 pub async fn list_campaigns(
2874 &mut self,
2875 request: impl tonic::IntoRequest<super::ListCampaignsRequest>,
2876 ) -> std::result::Result<
2877 tonic::Response<super::ListCampaignsResponse>,
2878 tonic::Status,
2879 > {
2880 self.inner
2881 .ready()
2882 .await
2883 .map_err(|e| {
2884 tonic::Status::unknown(
2885 format!("Service was not ready: {}", e.into()),
2886 )
2887 })?;
2888 let codec = tonic_prost::ProstCodec::default();
2889 let path = http::uri::PathAndQuery::from_static(
2890 "/pidgr.v1.CampaignService/ListCampaigns",
2891 );
2892 let mut req = request.into_request();
2893 req.extensions_mut()
2894 .insert(GrpcMethod::new("pidgr.v1.CampaignService", "ListCampaigns"));
2895 self.inner.unary(req, path, codec).await
2896 }
2897 pub async fn update_campaign(
2901 &mut self,
2902 request: impl tonic::IntoRequest<super::UpdateCampaignRequest>,
2903 ) -> std::result::Result<
2904 tonic::Response<super::UpdateCampaignResponse>,
2905 tonic::Status,
2906 > {
2907 self.inner
2908 .ready()
2909 .await
2910 .map_err(|e| {
2911 tonic::Status::unknown(
2912 format!("Service was not ready: {}", e.into()),
2913 )
2914 })?;
2915 let codec = tonic_prost::ProstCodec::default();
2916 let path = http::uri::PathAndQuery::from_static(
2917 "/pidgr.v1.CampaignService/UpdateCampaign",
2918 );
2919 let mut req = request.into_request();
2920 req.extensions_mut()
2921 .insert(GrpcMethod::new("pidgr.v1.CampaignService", "UpdateCampaign"));
2922 self.inner.unary(req, path, codec).await
2923 }
2924 pub async fn cancel_campaign(
2928 &mut self,
2929 request: impl tonic::IntoRequest<super::CancelCampaignRequest>,
2930 ) -> std::result::Result<
2931 tonic::Response<super::CancelCampaignResponse>,
2932 tonic::Status,
2933 > {
2934 self.inner
2935 .ready()
2936 .await
2937 .map_err(|e| {
2938 tonic::Status::unknown(
2939 format!("Service was not ready: {}", e.into()),
2940 )
2941 })?;
2942 let codec = tonic_prost::ProstCodec::default();
2943 let path = http::uri::PathAndQuery::from_static(
2944 "/pidgr.v1.CampaignService/CancelCampaign",
2945 );
2946 let mut req = request.into_request();
2947 req.extensions_mut()
2948 .insert(GrpcMethod::new("pidgr.v1.CampaignService", "CancelCampaign"));
2949 self.inner.unary(req, path, codec).await
2950 }
2951 pub async fn list_deliveries(
2955 &mut self,
2956 request: impl tonic::IntoRequest<super::ListDeliveriesRequest>,
2957 ) -> std::result::Result<
2958 tonic::Response<super::ListDeliveriesResponse>,
2959 tonic::Status,
2960 > {
2961 self.inner
2962 .ready()
2963 .await
2964 .map_err(|e| {
2965 tonic::Status::unknown(
2966 format!("Service was not ready: {}", e.into()),
2967 )
2968 })?;
2969 let codec = tonic_prost::ProstCodec::default();
2970 let path = http::uri::PathAndQuery::from_static(
2971 "/pidgr.v1.CampaignService/ListDeliveries",
2972 );
2973 let mut req = request.into_request();
2974 req.extensions_mut()
2975 .insert(GrpcMethod::new("pidgr.v1.CampaignService", "ListDeliveries"));
2976 self.inner.unary(req, path, codec).await
2977 }
2978 }
2979}
2980pub mod campaign_service_server {
2982 #![allow(
2983 unused_variables,
2984 dead_code,
2985 missing_docs,
2986 clippy::wildcard_imports,
2987 clippy::let_unit_value,
2988 )]
2989 use tonic::codegen::*;
2990 #[async_trait]
2992 pub trait CampaignService: std::marker::Send + std::marker::Sync + 'static {
2993 async fn create_campaign(
2997 &self,
2998 request: tonic::Request<super::CreateCampaignRequest>,
2999 ) -> std::result::Result<
3000 tonic::Response<super::CreateCampaignResponse>,
3001 tonic::Status,
3002 >;
3003 async fn start_campaign(
3007 &self,
3008 request: tonic::Request<super::StartCampaignRequest>,
3009 ) -> std::result::Result<
3010 tonic::Response<super::StartCampaignResponse>,
3011 tonic::Status,
3012 >;
3013 async fn get_campaign(
3017 &self,
3018 request: tonic::Request<super::GetCampaignRequest>,
3019 ) -> std::result::Result<
3020 tonic::Response<super::GetCampaignResponse>,
3021 tonic::Status,
3022 >;
3023 async fn list_campaigns(
3027 &self,
3028 request: tonic::Request<super::ListCampaignsRequest>,
3029 ) -> std::result::Result<
3030 tonic::Response<super::ListCampaignsResponse>,
3031 tonic::Status,
3032 >;
3033 async fn update_campaign(
3037 &self,
3038 request: tonic::Request<super::UpdateCampaignRequest>,
3039 ) -> std::result::Result<
3040 tonic::Response<super::UpdateCampaignResponse>,
3041 tonic::Status,
3042 >;
3043 async fn cancel_campaign(
3047 &self,
3048 request: tonic::Request<super::CancelCampaignRequest>,
3049 ) -> std::result::Result<
3050 tonic::Response<super::CancelCampaignResponse>,
3051 tonic::Status,
3052 >;
3053 async fn list_deliveries(
3057 &self,
3058 request: tonic::Request<super::ListDeliveriesRequest>,
3059 ) -> std::result::Result<
3060 tonic::Response<super::ListDeliveriesResponse>,
3061 tonic::Status,
3062 >;
3063 }
3064 #[derive(Debug)]
3068 pub struct CampaignServiceServer<T> {
3069 inner: Arc<T>,
3070 accept_compression_encodings: EnabledCompressionEncodings,
3071 send_compression_encodings: EnabledCompressionEncodings,
3072 max_decoding_message_size: Option<usize>,
3073 max_encoding_message_size: Option<usize>,
3074 }
3075 impl<T> CampaignServiceServer<T> {
3076 pub fn new(inner: T) -> Self {
3077 Self::from_arc(Arc::new(inner))
3078 }
3079 pub fn from_arc(inner: Arc<T>) -> Self {
3080 Self {
3081 inner,
3082 accept_compression_encodings: Default::default(),
3083 send_compression_encodings: Default::default(),
3084 max_decoding_message_size: None,
3085 max_encoding_message_size: None,
3086 }
3087 }
3088 pub fn with_interceptor<F>(
3089 inner: T,
3090 interceptor: F,
3091 ) -> InterceptedService<Self, F>
3092 where
3093 F: tonic::service::Interceptor,
3094 {
3095 InterceptedService::new(Self::new(inner), interceptor)
3096 }
3097 #[must_use]
3099 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3100 self.accept_compression_encodings.enable(encoding);
3101 self
3102 }
3103 #[must_use]
3105 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3106 self.send_compression_encodings.enable(encoding);
3107 self
3108 }
3109 #[must_use]
3113 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3114 self.max_decoding_message_size = Some(limit);
3115 self
3116 }
3117 #[must_use]
3121 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3122 self.max_encoding_message_size = Some(limit);
3123 self
3124 }
3125 }
3126 impl<T, B> tonic::codegen::Service<http::Request<B>> for CampaignServiceServer<T>
3127 where
3128 T: CampaignService,
3129 B: Body + std::marker::Send + 'static,
3130 B::Error: Into<StdError> + std::marker::Send + 'static,
3131 {
3132 type Response = http::Response<tonic::body::Body>;
3133 type Error = std::convert::Infallible;
3134 type Future = BoxFuture<Self::Response, Self::Error>;
3135 fn poll_ready(
3136 &mut self,
3137 _cx: &mut Context<'_>,
3138 ) -> Poll<std::result::Result<(), Self::Error>> {
3139 Poll::Ready(Ok(()))
3140 }
3141 fn call(&mut self, req: http::Request<B>) -> Self::Future {
3142 match req.uri().path() {
3143 "/pidgr.v1.CampaignService/CreateCampaign" => {
3144 #[allow(non_camel_case_types)]
3145 struct CreateCampaignSvc<T: CampaignService>(pub Arc<T>);
3146 impl<
3147 T: CampaignService,
3148 > tonic::server::UnaryService<super::CreateCampaignRequest>
3149 for CreateCampaignSvc<T> {
3150 type Response = super::CreateCampaignResponse;
3151 type Future = BoxFuture<
3152 tonic::Response<Self::Response>,
3153 tonic::Status,
3154 >;
3155 fn call(
3156 &mut self,
3157 request: tonic::Request<super::CreateCampaignRequest>,
3158 ) -> Self::Future {
3159 let inner = Arc::clone(&self.0);
3160 let fut = async move {
3161 <T as CampaignService>::create_campaign(&inner, request)
3162 .await
3163 };
3164 Box::pin(fut)
3165 }
3166 }
3167 let accept_compression_encodings = self.accept_compression_encodings;
3168 let send_compression_encodings = self.send_compression_encodings;
3169 let max_decoding_message_size = self.max_decoding_message_size;
3170 let max_encoding_message_size = self.max_encoding_message_size;
3171 let inner = self.inner.clone();
3172 let fut = async move {
3173 let method = CreateCampaignSvc(inner);
3174 let codec = tonic_prost::ProstCodec::default();
3175 let mut grpc = tonic::server::Grpc::new(codec)
3176 .apply_compression_config(
3177 accept_compression_encodings,
3178 send_compression_encodings,
3179 )
3180 .apply_max_message_size_config(
3181 max_decoding_message_size,
3182 max_encoding_message_size,
3183 );
3184 let res = grpc.unary(method, req).await;
3185 Ok(res)
3186 };
3187 Box::pin(fut)
3188 }
3189 "/pidgr.v1.CampaignService/StartCampaign" => {
3190 #[allow(non_camel_case_types)]
3191 struct StartCampaignSvc<T: CampaignService>(pub Arc<T>);
3192 impl<
3193 T: CampaignService,
3194 > tonic::server::UnaryService<super::StartCampaignRequest>
3195 for StartCampaignSvc<T> {
3196 type Response = super::StartCampaignResponse;
3197 type Future = BoxFuture<
3198 tonic::Response<Self::Response>,
3199 tonic::Status,
3200 >;
3201 fn call(
3202 &mut self,
3203 request: tonic::Request<super::StartCampaignRequest>,
3204 ) -> Self::Future {
3205 let inner = Arc::clone(&self.0);
3206 let fut = async move {
3207 <T as CampaignService>::start_campaign(&inner, request)
3208 .await
3209 };
3210 Box::pin(fut)
3211 }
3212 }
3213 let accept_compression_encodings = self.accept_compression_encodings;
3214 let send_compression_encodings = self.send_compression_encodings;
3215 let max_decoding_message_size = self.max_decoding_message_size;
3216 let max_encoding_message_size = self.max_encoding_message_size;
3217 let inner = self.inner.clone();
3218 let fut = async move {
3219 let method = StartCampaignSvc(inner);
3220 let codec = tonic_prost::ProstCodec::default();
3221 let mut grpc = tonic::server::Grpc::new(codec)
3222 .apply_compression_config(
3223 accept_compression_encodings,
3224 send_compression_encodings,
3225 )
3226 .apply_max_message_size_config(
3227 max_decoding_message_size,
3228 max_encoding_message_size,
3229 );
3230 let res = grpc.unary(method, req).await;
3231 Ok(res)
3232 };
3233 Box::pin(fut)
3234 }
3235 "/pidgr.v1.CampaignService/GetCampaign" => {
3236 #[allow(non_camel_case_types)]
3237 struct GetCampaignSvc<T: CampaignService>(pub Arc<T>);
3238 impl<
3239 T: CampaignService,
3240 > tonic::server::UnaryService<super::GetCampaignRequest>
3241 for GetCampaignSvc<T> {
3242 type Response = super::GetCampaignResponse;
3243 type Future = BoxFuture<
3244 tonic::Response<Self::Response>,
3245 tonic::Status,
3246 >;
3247 fn call(
3248 &mut self,
3249 request: tonic::Request<super::GetCampaignRequest>,
3250 ) -> Self::Future {
3251 let inner = Arc::clone(&self.0);
3252 let fut = async move {
3253 <T as CampaignService>::get_campaign(&inner, request).await
3254 };
3255 Box::pin(fut)
3256 }
3257 }
3258 let accept_compression_encodings = self.accept_compression_encodings;
3259 let send_compression_encodings = self.send_compression_encodings;
3260 let max_decoding_message_size = self.max_decoding_message_size;
3261 let max_encoding_message_size = self.max_encoding_message_size;
3262 let inner = self.inner.clone();
3263 let fut = async move {
3264 let method = GetCampaignSvc(inner);
3265 let codec = tonic_prost::ProstCodec::default();
3266 let mut grpc = tonic::server::Grpc::new(codec)
3267 .apply_compression_config(
3268 accept_compression_encodings,
3269 send_compression_encodings,
3270 )
3271 .apply_max_message_size_config(
3272 max_decoding_message_size,
3273 max_encoding_message_size,
3274 );
3275 let res = grpc.unary(method, req).await;
3276 Ok(res)
3277 };
3278 Box::pin(fut)
3279 }
3280 "/pidgr.v1.CampaignService/ListCampaigns" => {
3281 #[allow(non_camel_case_types)]
3282 struct ListCampaignsSvc<T: CampaignService>(pub Arc<T>);
3283 impl<
3284 T: CampaignService,
3285 > tonic::server::UnaryService<super::ListCampaignsRequest>
3286 for ListCampaignsSvc<T> {
3287 type Response = super::ListCampaignsResponse;
3288 type Future = BoxFuture<
3289 tonic::Response<Self::Response>,
3290 tonic::Status,
3291 >;
3292 fn call(
3293 &mut self,
3294 request: tonic::Request<super::ListCampaignsRequest>,
3295 ) -> Self::Future {
3296 let inner = Arc::clone(&self.0);
3297 let fut = async move {
3298 <T as CampaignService>::list_campaigns(&inner, request)
3299 .await
3300 };
3301 Box::pin(fut)
3302 }
3303 }
3304 let accept_compression_encodings = self.accept_compression_encodings;
3305 let send_compression_encodings = self.send_compression_encodings;
3306 let max_decoding_message_size = self.max_decoding_message_size;
3307 let max_encoding_message_size = self.max_encoding_message_size;
3308 let inner = self.inner.clone();
3309 let fut = async move {
3310 let method = ListCampaignsSvc(inner);
3311 let codec = tonic_prost::ProstCodec::default();
3312 let mut grpc = tonic::server::Grpc::new(codec)
3313 .apply_compression_config(
3314 accept_compression_encodings,
3315 send_compression_encodings,
3316 )
3317 .apply_max_message_size_config(
3318 max_decoding_message_size,
3319 max_encoding_message_size,
3320 );
3321 let res = grpc.unary(method, req).await;
3322 Ok(res)
3323 };
3324 Box::pin(fut)
3325 }
3326 "/pidgr.v1.CampaignService/UpdateCampaign" => {
3327 #[allow(non_camel_case_types)]
3328 struct UpdateCampaignSvc<T: CampaignService>(pub Arc<T>);
3329 impl<
3330 T: CampaignService,
3331 > tonic::server::UnaryService<super::UpdateCampaignRequest>
3332 for UpdateCampaignSvc<T> {
3333 type Response = super::UpdateCampaignResponse;
3334 type Future = BoxFuture<
3335 tonic::Response<Self::Response>,
3336 tonic::Status,
3337 >;
3338 fn call(
3339 &mut self,
3340 request: tonic::Request<super::UpdateCampaignRequest>,
3341 ) -> Self::Future {
3342 let inner = Arc::clone(&self.0);
3343 let fut = async move {
3344 <T as CampaignService>::update_campaign(&inner, request)
3345 .await
3346 };
3347 Box::pin(fut)
3348 }
3349 }
3350 let accept_compression_encodings = self.accept_compression_encodings;
3351 let send_compression_encodings = self.send_compression_encodings;
3352 let max_decoding_message_size = self.max_decoding_message_size;
3353 let max_encoding_message_size = self.max_encoding_message_size;
3354 let inner = self.inner.clone();
3355 let fut = async move {
3356 let method = UpdateCampaignSvc(inner);
3357 let codec = tonic_prost::ProstCodec::default();
3358 let mut grpc = tonic::server::Grpc::new(codec)
3359 .apply_compression_config(
3360 accept_compression_encodings,
3361 send_compression_encodings,
3362 )
3363 .apply_max_message_size_config(
3364 max_decoding_message_size,
3365 max_encoding_message_size,
3366 );
3367 let res = grpc.unary(method, req).await;
3368 Ok(res)
3369 };
3370 Box::pin(fut)
3371 }
3372 "/pidgr.v1.CampaignService/CancelCampaign" => {
3373 #[allow(non_camel_case_types)]
3374 struct CancelCampaignSvc<T: CampaignService>(pub Arc<T>);
3375 impl<
3376 T: CampaignService,
3377 > tonic::server::UnaryService<super::CancelCampaignRequest>
3378 for CancelCampaignSvc<T> {
3379 type Response = super::CancelCampaignResponse;
3380 type Future = BoxFuture<
3381 tonic::Response<Self::Response>,
3382 tonic::Status,
3383 >;
3384 fn call(
3385 &mut self,
3386 request: tonic::Request<super::CancelCampaignRequest>,
3387 ) -> Self::Future {
3388 let inner = Arc::clone(&self.0);
3389 let fut = async move {
3390 <T as CampaignService>::cancel_campaign(&inner, request)
3391 .await
3392 };
3393 Box::pin(fut)
3394 }
3395 }
3396 let accept_compression_encodings = self.accept_compression_encodings;
3397 let send_compression_encodings = self.send_compression_encodings;
3398 let max_decoding_message_size = self.max_decoding_message_size;
3399 let max_encoding_message_size = self.max_encoding_message_size;
3400 let inner = self.inner.clone();
3401 let fut = async move {
3402 let method = CancelCampaignSvc(inner);
3403 let codec = tonic_prost::ProstCodec::default();
3404 let mut grpc = tonic::server::Grpc::new(codec)
3405 .apply_compression_config(
3406 accept_compression_encodings,
3407 send_compression_encodings,
3408 )
3409 .apply_max_message_size_config(
3410 max_decoding_message_size,
3411 max_encoding_message_size,
3412 );
3413 let res = grpc.unary(method, req).await;
3414 Ok(res)
3415 };
3416 Box::pin(fut)
3417 }
3418 "/pidgr.v1.CampaignService/ListDeliveries" => {
3419 #[allow(non_camel_case_types)]
3420 struct ListDeliveriesSvc<T: CampaignService>(pub Arc<T>);
3421 impl<
3422 T: CampaignService,
3423 > tonic::server::UnaryService<super::ListDeliveriesRequest>
3424 for ListDeliveriesSvc<T> {
3425 type Response = super::ListDeliveriesResponse;
3426 type Future = BoxFuture<
3427 tonic::Response<Self::Response>,
3428 tonic::Status,
3429 >;
3430 fn call(
3431 &mut self,
3432 request: tonic::Request<super::ListDeliveriesRequest>,
3433 ) -> Self::Future {
3434 let inner = Arc::clone(&self.0);
3435 let fut = async move {
3436 <T as CampaignService>::list_deliveries(&inner, request)
3437 .await
3438 };
3439 Box::pin(fut)
3440 }
3441 }
3442 let accept_compression_encodings = self.accept_compression_encodings;
3443 let send_compression_encodings = self.send_compression_encodings;
3444 let max_decoding_message_size = self.max_decoding_message_size;
3445 let max_encoding_message_size = self.max_encoding_message_size;
3446 let inner = self.inner.clone();
3447 let fut = async move {
3448 let method = ListDeliveriesSvc(inner);
3449 let codec = tonic_prost::ProstCodec::default();
3450 let mut grpc = tonic::server::Grpc::new(codec)
3451 .apply_compression_config(
3452 accept_compression_encodings,
3453 send_compression_encodings,
3454 )
3455 .apply_max_message_size_config(
3456 max_decoding_message_size,
3457 max_encoding_message_size,
3458 );
3459 let res = grpc.unary(method, req).await;
3460 Ok(res)
3461 };
3462 Box::pin(fut)
3463 }
3464 _ => {
3465 Box::pin(async move {
3466 let mut response = http::Response::new(
3467 tonic::body::Body::default(),
3468 );
3469 let headers = response.headers_mut();
3470 headers
3471 .insert(
3472 tonic::Status::GRPC_STATUS,
3473 (tonic::Code::Unimplemented as i32).into(),
3474 );
3475 headers
3476 .insert(
3477 http::header::CONTENT_TYPE,
3478 tonic::metadata::GRPC_CONTENT_TYPE,
3479 );
3480 Ok(response)
3481 })
3482 }
3483 }
3484 }
3485 }
3486 impl<T> Clone for CampaignServiceServer<T> {
3487 fn clone(&self) -> Self {
3488 let inner = self.inner.clone();
3489 Self {
3490 inner,
3491 accept_compression_encodings: self.accept_compression_encodings,
3492 send_compression_encodings: self.send_compression_encodings,
3493 max_decoding_message_size: self.max_decoding_message_size,
3494 max_encoding_message_size: self.max_encoding_message_size,
3495 }
3496 }
3497 }
3498 pub const SERVICE_NAME: &str = "pidgr.v1.CampaignService";
3500 impl<T> tonic::server::NamedService for CampaignServiceServer<T> {
3501 const NAME: &'static str = SERVICE_NAME;
3502 }
3503}
3504pub mod device_service_client {
3506 #![allow(
3507 unused_variables,
3508 dead_code,
3509 missing_docs,
3510 clippy::wildcard_imports,
3511 clippy::let_unit_value,
3512 )]
3513 use tonic::codegen::*;
3514 use tonic::codegen::http::Uri;
3515 #[derive(Debug, Clone)]
3519 pub struct DeviceServiceClient<T> {
3520 inner: tonic::client::Grpc<T>,
3521 }
3522 impl DeviceServiceClient<tonic::transport::Channel> {
3523 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
3525 where
3526 D: TryInto<tonic::transport::Endpoint>,
3527 D::Error: Into<StdError>,
3528 {
3529 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
3530 Ok(Self::new(conn))
3531 }
3532 }
3533 impl<T> DeviceServiceClient<T>
3534 where
3535 T: tonic::client::GrpcService<tonic::body::Body>,
3536 T::Error: Into<StdError>,
3537 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
3538 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
3539 {
3540 pub fn new(inner: T) -> Self {
3541 let inner = tonic::client::Grpc::new(inner);
3542 Self { inner }
3543 }
3544 pub fn with_origin(inner: T, origin: Uri) -> Self {
3545 let inner = tonic::client::Grpc::with_origin(inner, origin);
3546 Self { inner }
3547 }
3548 pub fn with_interceptor<F>(
3549 inner: T,
3550 interceptor: F,
3551 ) -> DeviceServiceClient<InterceptedService<T, F>>
3552 where
3553 F: tonic::service::Interceptor,
3554 T::ResponseBody: Default,
3555 T: tonic::codegen::Service<
3556 http::Request<tonic::body::Body>,
3557 Response = http::Response<
3558 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
3559 >,
3560 >,
3561 <T as tonic::codegen::Service<
3562 http::Request<tonic::body::Body>,
3563 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
3564 {
3565 DeviceServiceClient::new(InterceptedService::new(inner, interceptor))
3566 }
3567 #[must_use]
3572 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3573 self.inner = self.inner.send_compressed(encoding);
3574 self
3575 }
3576 #[must_use]
3578 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3579 self.inner = self.inner.accept_compressed(encoding);
3580 self
3581 }
3582 #[must_use]
3586 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3587 self.inner = self.inner.max_decoding_message_size(limit);
3588 self
3589 }
3590 #[must_use]
3594 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3595 self.inner = self.inner.max_encoding_message_size(limit);
3596 self
3597 }
3598 pub async fn register(
3602 &mut self,
3603 request: impl tonic::IntoRequest<super::RegisterRequest>,
3604 ) -> std::result::Result<
3605 tonic::Response<super::RegisterResponse>,
3606 tonic::Status,
3607 > {
3608 self.inner
3609 .ready()
3610 .await
3611 .map_err(|e| {
3612 tonic::Status::unknown(
3613 format!("Service was not ready: {}", e.into()),
3614 )
3615 })?;
3616 let codec = tonic_prost::ProstCodec::default();
3617 let path = http::uri::PathAndQuery::from_static(
3618 "/pidgr.v1.DeviceService/Register",
3619 );
3620 let mut req = request.into_request();
3621 req.extensions_mut()
3622 .insert(GrpcMethod::new("pidgr.v1.DeviceService", "Register"));
3623 self.inner.unary(req, path, codec).await
3624 }
3625 pub async fn deactivate(
3629 &mut self,
3630 request: impl tonic::IntoRequest<super::DeactivateRequest>,
3631 ) -> std::result::Result<
3632 tonic::Response<super::DeactivateResponse>,
3633 tonic::Status,
3634 > {
3635 self.inner
3636 .ready()
3637 .await
3638 .map_err(|e| {
3639 tonic::Status::unknown(
3640 format!("Service was not ready: {}", e.into()),
3641 )
3642 })?;
3643 let codec = tonic_prost::ProstCodec::default();
3644 let path = http::uri::PathAndQuery::from_static(
3645 "/pidgr.v1.DeviceService/Deactivate",
3646 );
3647 let mut req = request.into_request();
3648 req.extensions_mut()
3649 .insert(GrpcMethod::new("pidgr.v1.DeviceService", "Deactivate"));
3650 self.inner.unary(req, path, codec).await
3651 }
3652 pub async fn list_devices(
3656 &mut self,
3657 request: impl tonic::IntoRequest<super::ListDevicesRequest>,
3658 ) -> std::result::Result<
3659 tonic::Response<super::ListDevicesResponse>,
3660 tonic::Status,
3661 > {
3662 self.inner
3663 .ready()
3664 .await
3665 .map_err(|e| {
3666 tonic::Status::unknown(
3667 format!("Service was not ready: {}", e.into()),
3668 )
3669 })?;
3670 let codec = tonic_prost::ProstCodec::default();
3671 let path = http::uri::PathAndQuery::from_static(
3672 "/pidgr.v1.DeviceService/ListDevices",
3673 );
3674 let mut req = request.into_request();
3675 req.extensions_mut()
3676 .insert(GrpcMethod::new("pidgr.v1.DeviceService", "ListDevices"));
3677 self.inner.unary(req, path, codec).await
3678 }
3679 pub async fn list_member_devices(
3683 &mut self,
3684 request: impl tonic::IntoRequest<super::ListMemberDevicesRequest>,
3685 ) -> std::result::Result<
3686 tonic::Response<super::ListMemberDevicesResponse>,
3687 tonic::Status,
3688 > {
3689 self.inner
3690 .ready()
3691 .await
3692 .map_err(|e| {
3693 tonic::Status::unknown(
3694 format!("Service was not ready: {}", e.into()),
3695 )
3696 })?;
3697 let codec = tonic_prost::ProstCodec::default();
3698 let path = http::uri::PathAndQuery::from_static(
3699 "/pidgr.v1.DeviceService/ListMemberDevices",
3700 );
3701 let mut req = request.into_request();
3702 req.extensions_mut()
3703 .insert(GrpcMethod::new("pidgr.v1.DeviceService", "ListMemberDevices"));
3704 self.inner.unary(req, path, codec).await
3705 }
3706 }
3707}
3708pub mod device_service_server {
3710 #![allow(
3711 unused_variables,
3712 dead_code,
3713 missing_docs,
3714 clippy::wildcard_imports,
3715 clippy::let_unit_value,
3716 )]
3717 use tonic::codegen::*;
3718 #[async_trait]
3720 pub trait DeviceService: std::marker::Send + std::marker::Sync + 'static {
3721 async fn register(
3725 &self,
3726 request: tonic::Request<super::RegisterRequest>,
3727 ) -> std::result::Result<
3728 tonic::Response<super::RegisterResponse>,
3729 tonic::Status,
3730 >;
3731 async fn deactivate(
3735 &self,
3736 request: tonic::Request<super::DeactivateRequest>,
3737 ) -> std::result::Result<
3738 tonic::Response<super::DeactivateResponse>,
3739 tonic::Status,
3740 >;
3741 async fn list_devices(
3745 &self,
3746 request: tonic::Request<super::ListDevicesRequest>,
3747 ) -> std::result::Result<
3748 tonic::Response<super::ListDevicesResponse>,
3749 tonic::Status,
3750 >;
3751 async fn list_member_devices(
3755 &self,
3756 request: tonic::Request<super::ListMemberDevicesRequest>,
3757 ) -> std::result::Result<
3758 tonic::Response<super::ListMemberDevicesResponse>,
3759 tonic::Status,
3760 >;
3761 }
3762 #[derive(Debug)]
3766 pub struct DeviceServiceServer<T> {
3767 inner: Arc<T>,
3768 accept_compression_encodings: EnabledCompressionEncodings,
3769 send_compression_encodings: EnabledCompressionEncodings,
3770 max_decoding_message_size: Option<usize>,
3771 max_encoding_message_size: Option<usize>,
3772 }
3773 impl<T> DeviceServiceServer<T> {
3774 pub fn new(inner: T) -> Self {
3775 Self::from_arc(Arc::new(inner))
3776 }
3777 pub fn from_arc(inner: Arc<T>) -> Self {
3778 Self {
3779 inner,
3780 accept_compression_encodings: Default::default(),
3781 send_compression_encodings: Default::default(),
3782 max_decoding_message_size: None,
3783 max_encoding_message_size: None,
3784 }
3785 }
3786 pub fn with_interceptor<F>(
3787 inner: T,
3788 interceptor: F,
3789 ) -> InterceptedService<Self, F>
3790 where
3791 F: tonic::service::Interceptor,
3792 {
3793 InterceptedService::new(Self::new(inner), interceptor)
3794 }
3795 #[must_use]
3797 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3798 self.accept_compression_encodings.enable(encoding);
3799 self
3800 }
3801 #[must_use]
3803 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3804 self.send_compression_encodings.enable(encoding);
3805 self
3806 }
3807 #[must_use]
3811 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3812 self.max_decoding_message_size = Some(limit);
3813 self
3814 }
3815 #[must_use]
3819 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3820 self.max_encoding_message_size = Some(limit);
3821 self
3822 }
3823 }
3824 impl<T, B> tonic::codegen::Service<http::Request<B>> for DeviceServiceServer<T>
3825 where
3826 T: DeviceService,
3827 B: Body + std::marker::Send + 'static,
3828 B::Error: Into<StdError> + std::marker::Send + 'static,
3829 {
3830 type Response = http::Response<tonic::body::Body>;
3831 type Error = std::convert::Infallible;
3832 type Future = BoxFuture<Self::Response, Self::Error>;
3833 fn poll_ready(
3834 &mut self,
3835 _cx: &mut Context<'_>,
3836 ) -> Poll<std::result::Result<(), Self::Error>> {
3837 Poll::Ready(Ok(()))
3838 }
3839 fn call(&mut self, req: http::Request<B>) -> Self::Future {
3840 match req.uri().path() {
3841 "/pidgr.v1.DeviceService/Register" => {
3842 #[allow(non_camel_case_types)]
3843 struct RegisterSvc<T: DeviceService>(pub Arc<T>);
3844 impl<
3845 T: DeviceService,
3846 > tonic::server::UnaryService<super::RegisterRequest>
3847 for RegisterSvc<T> {
3848 type Response = super::RegisterResponse;
3849 type Future = BoxFuture<
3850 tonic::Response<Self::Response>,
3851 tonic::Status,
3852 >;
3853 fn call(
3854 &mut self,
3855 request: tonic::Request<super::RegisterRequest>,
3856 ) -> Self::Future {
3857 let inner = Arc::clone(&self.0);
3858 let fut = async move {
3859 <T as DeviceService>::register(&inner, request).await
3860 };
3861 Box::pin(fut)
3862 }
3863 }
3864 let accept_compression_encodings = self.accept_compression_encodings;
3865 let send_compression_encodings = self.send_compression_encodings;
3866 let max_decoding_message_size = self.max_decoding_message_size;
3867 let max_encoding_message_size = self.max_encoding_message_size;
3868 let inner = self.inner.clone();
3869 let fut = async move {
3870 let method = RegisterSvc(inner);
3871 let codec = tonic_prost::ProstCodec::default();
3872 let mut grpc = tonic::server::Grpc::new(codec)
3873 .apply_compression_config(
3874 accept_compression_encodings,
3875 send_compression_encodings,
3876 )
3877 .apply_max_message_size_config(
3878 max_decoding_message_size,
3879 max_encoding_message_size,
3880 );
3881 let res = grpc.unary(method, req).await;
3882 Ok(res)
3883 };
3884 Box::pin(fut)
3885 }
3886 "/pidgr.v1.DeviceService/Deactivate" => {
3887 #[allow(non_camel_case_types)]
3888 struct DeactivateSvc<T: DeviceService>(pub Arc<T>);
3889 impl<
3890 T: DeviceService,
3891 > tonic::server::UnaryService<super::DeactivateRequest>
3892 for DeactivateSvc<T> {
3893 type Response = super::DeactivateResponse;
3894 type Future = BoxFuture<
3895 tonic::Response<Self::Response>,
3896 tonic::Status,
3897 >;
3898 fn call(
3899 &mut self,
3900 request: tonic::Request<super::DeactivateRequest>,
3901 ) -> Self::Future {
3902 let inner = Arc::clone(&self.0);
3903 let fut = async move {
3904 <T as DeviceService>::deactivate(&inner, request).await
3905 };
3906 Box::pin(fut)
3907 }
3908 }
3909 let accept_compression_encodings = self.accept_compression_encodings;
3910 let send_compression_encodings = self.send_compression_encodings;
3911 let max_decoding_message_size = self.max_decoding_message_size;
3912 let max_encoding_message_size = self.max_encoding_message_size;
3913 let inner = self.inner.clone();
3914 let fut = async move {
3915 let method = DeactivateSvc(inner);
3916 let codec = tonic_prost::ProstCodec::default();
3917 let mut grpc = tonic::server::Grpc::new(codec)
3918 .apply_compression_config(
3919 accept_compression_encodings,
3920 send_compression_encodings,
3921 )
3922 .apply_max_message_size_config(
3923 max_decoding_message_size,
3924 max_encoding_message_size,
3925 );
3926 let res = grpc.unary(method, req).await;
3927 Ok(res)
3928 };
3929 Box::pin(fut)
3930 }
3931 "/pidgr.v1.DeviceService/ListDevices" => {
3932 #[allow(non_camel_case_types)]
3933 struct ListDevicesSvc<T: DeviceService>(pub Arc<T>);
3934 impl<
3935 T: DeviceService,
3936 > tonic::server::UnaryService<super::ListDevicesRequest>
3937 for ListDevicesSvc<T> {
3938 type Response = super::ListDevicesResponse;
3939 type Future = BoxFuture<
3940 tonic::Response<Self::Response>,
3941 tonic::Status,
3942 >;
3943 fn call(
3944 &mut self,
3945 request: tonic::Request<super::ListDevicesRequest>,
3946 ) -> Self::Future {
3947 let inner = Arc::clone(&self.0);
3948 let fut = async move {
3949 <T as DeviceService>::list_devices(&inner, request).await
3950 };
3951 Box::pin(fut)
3952 }
3953 }
3954 let accept_compression_encodings = self.accept_compression_encodings;
3955 let send_compression_encodings = self.send_compression_encodings;
3956 let max_decoding_message_size = self.max_decoding_message_size;
3957 let max_encoding_message_size = self.max_encoding_message_size;
3958 let inner = self.inner.clone();
3959 let fut = async move {
3960 let method = ListDevicesSvc(inner);
3961 let codec = tonic_prost::ProstCodec::default();
3962 let mut grpc = tonic::server::Grpc::new(codec)
3963 .apply_compression_config(
3964 accept_compression_encodings,
3965 send_compression_encodings,
3966 )
3967 .apply_max_message_size_config(
3968 max_decoding_message_size,
3969 max_encoding_message_size,
3970 );
3971 let res = grpc.unary(method, req).await;
3972 Ok(res)
3973 };
3974 Box::pin(fut)
3975 }
3976 "/pidgr.v1.DeviceService/ListMemberDevices" => {
3977 #[allow(non_camel_case_types)]
3978 struct ListMemberDevicesSvc<T: DeviceService>(pub Arc<T>);
3979 impl<
3980 T: DeviceService,
3981 > tonic::server::UnaryService<super::ListMemberDevicesRequest>
3982 for ListMemberDevicesSvc<T> {
3983 type Response = super::ListMemberDevicesResponse;
3984 type Future = BoxFuture<
3985 tonic::Response<Self::Response>,
3986 tonic::Status,
3987 >;
3988 fn call(
3989 &mut self,
3990 request: tonic::Request<super::ListMemberDevicesRequest>,
3991 ) -> Self::Future {
3992 let inner = Arc::clone(&self.0);
3993 let fut = async move {
3994 <T as DeviceService>::list_member_devices(&inner, request)
3995 .await
3996 };
3997 Box::pin(fut)
3998 }
3999 }
4000 let accept_compression_encodings = self.accept_compression_encodings;
4001 let send_compression_encodings = self.send_compression_encodings;
4002 let max_decoding_message_size = self.max_decoding_message_size;
4003 let max_encoding_message_size = self.max_encoding_message_size;
4004 let inner = self.inner.clone();
4005 let fut = async move {
4006 let method = ListMemberDevicesSvc(inner);
4007 let codec = tonic_prost::ProstCodec::default();
4008 let mut grpc = tonic::server::Grpc::new(codec)
4009 .apply_compression_config(
4010 accept_compression_encodings,
4011 send_compression_encodings,
4012 )
4013 .apply_max_message_size_config(
4014 max_decoding_message_size,
4015 max_encoding_message_size,
4016 );
4017 let res = grpc.unary(method, req).await;
4018 Ok(res)
4019 };
4020 Box::pin(fut)
4021 }
4022 _ => {
4023 Box::pin(async move {
4024 let mut response = http::Response::new(
4025 tonic::body::Body::default(),
4026 );
4027 let headers = response.headers_mut();
4028 headers
4029 .insert(
4030 tonic::Status::GRPC_STATUS,
4031 (tonic::Code::Unimplemented as i32).into(),
4032 );
4033 headers
4034 .insert(
4035 http::header::CONTENT_TYPE,
4036 tonic::metadata::GRPC_CONTENT_TYPE,
4037 );
4038 Ok(response)
4039 })
4040 }
4041 }
4042 }
4043 }
4044 impl<T> Clone for DeviceServiceServer<T> {
4045 fn clone(&self) -> Self {
4046 let inner = self.inner.clone();
4047 Self {
4048 inner,
4049 accept_compression_encodings: self.accept_compression_encodings,
4050 send_compression_encodings: self.send_compression_encodings,
4051 max_decoding_message_size: self.max_decoding_message_size,
4052 max_encoding_message_size: self.max_encoding_message_size,
4053 }
4054 }
4055 }
4056 pub const SERVICE_NAME: &str = "pidgr.v1.DeviceService";
4058 impl<T> tonic::server::NamedService for DeviceServiceServer<T> {
4059 const NAME: &'static str = SERVICE_NAME;
4060 }
4061}
4062pub mod group_service_client {
4064 #![allow(
4065 unused_variables,
4066 dead_code,
4067 missing_docs,
4068 clippy::wildcard_imports,
4069 clippy::let_unit_value,
4070 )]
4071 use tonic::codegen::*;
4072 use tonic::codegen::http::Uri;
4073 #[derive(Debug, Clone)]
4078 pub struct GroupServiceClient<T> {
4079 inner: tonic::client::Grpc<T>,
4080 }
4081 impl GroupServiceClient<tonic::transport::Channel> {
4082 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4084 where
4085 D: TryInto<tonic::transport::Endpoint>,
4086 D::Error: Into<StdError>,
4087 {
4088 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4089 Ok(Self::new(conn))
4090 }
4091 }
4092 impl<T> GroupServiceClient<T>
4093 where
4094 T: tonic::client::GrpcService<tonic::body::Body>,
4095 T::Error: Into<StdError>,
4096 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4097 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4098 {
4099 pub fn new(inner: T) -> Self {
4100 let inner = tonic::client::Grpc::new(inner);
4101 Self { inner }
4102 }
4103 pub fn with_origin(inner: T, origin: Uri) -> Self {
4104 let inner = tonic::client::Grpc::with_origin(inner, origin);
4105 Self { inner }
4106 }
4107 pub fn with_interceptor<F>(
4108 inner: T,
4109 interceptor: F,
4110 ) -> GroupServiceClient<InterceptedService<T, F>>
4111 where
4112 F: tonic::service::Interceptor,
4113 T::ResponseBody: Default,
4114 T: tonic::codegen::Service<
4115 http::Request<tonic::body::Body>,
4116 Response = http::Response<
4117 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4118 >,
4119 >,
4120 <T as tonic::codegen::Service<
4121 http::Request<tonic::body::Body>,
4122 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4123 {
4124 GroupServiceClient::new(InterceptedService::new(inner, interceptor))
4125 }
4126 #[must_use]
4131 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4132 self.inner = self.inner.send_compressed(encoding);
4133 self
4134 }
4135 #[must_use]
4137 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4138 self.inner = self.inner.accept_compressed(encoding);
4139 self
4140 }
4141 #[must_use]
4145 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4146 self.inner = self.inner.max_decoding_message_size(limit);
4147 self
4148 }
4149 #[must_use]
4153 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4154 self.inner = self.inner.max_encoding_message_size(limit);
4155 self
4156 }
4157 pub async fn create_group(
4161 &mut self,
4162 request: impl tonic::IntoRequest<super::CreateGroupRequest>,
4163 ) -> std::result::Result<
4164 tonic::Response<super::CreateGroupResponse>,
4165 tonic::Status,
4166 > {
4167 self.inner
4168 .ready()
4169 .await
4170 .map_err(|e| {
4171 tonic::Status::unknown(
4172 format!("Service was not ready: {}", e.into()),
4173 )
4174 })?;
4175 let codec = tonic_prost::ProstCodec::default();
4176 let path = http::uri::PathAndQuery::from_static(
4177 "/pidgr.v1.GroupService/CreateGroup",
4178 );
4179 let mut req = request.into_request();
4180 req.extensions_mut()
4181 .insert(GrpcMethod::new("pidgr.v1.GroupService", "CreateGroup"));
4182 self.inner.unary(req, path, codec).await
4183 }
4184 pub async fn get_group(
4189 &mut self,
4190 request: impl tonic::IntoRequest<super::GetGroupRequest>,
4191 ) -> std::result::Result<
4192 tonic::Response<super::GetGroupResponse>,
4193 tonic::Status,
4194 > {
4195 self.inner
4196 .ready()
4197 .await
4198 .map_err(|e| {
4199 tonic::Status::unknown(
4200 format!("Service was not ready: {}", e.into()),
4201 )
4202 })?;
4203 let codec = tonic_prost::ProstCodec::default();
4204 let path = http::uri::PathAndQuery::from_static(
4205 "/pidgr.v1.GroupService/GetGroup",
4206 );
4207 let mut req = request.into_request();
4208 req.extensions_mut()
4209 .insert(GrpcMethod::new("pidgr.v1.GroupService", "GetGroup"));
4210 self.inner.unary(req, path, codec).await
4211 }
4212 pub async fn list_groups(
4216 &mut self,
4217 request: impl tonic::IntoRequest<super::ListGroupsRequest>,
4218 ) -> std::result::Result<
4219 tonic::Response<super::ListGroupsResponse>,
4220 tonic::Status,
4221 > {
4222 self.inner
4223 .ready()
4224 .await
4225 .map_err(|e| {
4226 tonic::Status::unknown(
4227 format!("Service was not ready: {}", e.into()),
4228 )
4229 })?;
4230 let codec = tonic_prost::ProstCodec::default();
4231 let path = http::uri::PathAndQuery::from_static(
4232 "/pidgr.v1.GroupService/ListGroups",
4233 );
4234 let mut req = request.into_request();
4235 req.extensions_mut()
4236 .insert(GrpcMethod::new("pidgr.v1.GroupService", "ListGroups"));
4237 self.inner.unary(req, path, codec).await
4238 }
4239 pub async fn update_group(
4243 &mut self,
4244 request: impl tonic::IntoRequest<super::UpdateGroupRequest>,
4245 ) -> std::result::Result<
4246 tonic::Response<super::UpdateGroupResponse>,
4247 tonic::Status,
4248 > {
4249 self.inner
4250 .ready()
4251 .await
4252 .map_err(|e| {
4253 tonic::Status::unknown(
4254 format!("Service was not ready: {}", e.into()),
4255 )
4256 })?;
4257 let codec = tonic_prost::ProstCodec::default();
4258 let path = http::uri::PathAndQuery::from_static(
4259 "/pidgr.v1.GroupService/UpdateGroup",
4260 );
4261 let mut req = request.into_request();
4262 req.extensions_mut()
4263 .insert(GrpcMethod::new("pidgr.v1.GroupService", "UpdateGroup"));
4264 self.inner.unary(req, path, codec).await
4265 }
4266 pub async fn delete_group(
4270 &mut self,
4271 request: impl tonic::IntoRequest<super::DeleteGroupRequest>,
4272 ) -> std::result::Result<
4273 tonic::Response<super::DeleteGroupResponse>,
4274 tonic::Status,
4275 > {
4276 self.inner
4277 .ready()
4278 .await
4279 .map_err(|e| {
4280 tonic::Status::unknown(
4281 format!("Service was not ready: {}", e.into()),
4282 )
4283 })?;
4284 let codec = tonic_prost::ProstCodec::default();
4285 let path = http::uri::PathAndQuery::from_static(
4286 "/pidgr.v1.GroupService/DeleteGroup",
4287 );
4288 let mut req = request.into_request();
4289 req.extensions_mut()
4290 .insert(GrpcMethod::new("pidgr.v1.GroupService", "DeleteGroup"));
4291 self.inner.unary(req, path, codec).await
4292 }
4293 pub async fn add_group_members(
4297 &mut self,
4298 request: impl tonic::IntoRequest<super::AddGroupMembersRequest>,
4299 ) -> std::result::Result<
4300 tonic::Response<super::AddGroupMembersResponse>,
4301 tonic::Status,
4302 > {
4303 self.inner
4304 .ready()
4305 .await
4306 .map_err(|e| {
4307 tonic::Status::unknown(
4308 format!("Service was not ready: {}", e.into()),
4309 )
4310 })?;
4311 let codec = tonic_prost::ProstCodec::default();
4312 let path = http::uri::PathAndQuery::from_static(
4313 "/pidgr.v1.GroupService/AddGroupMembers",
4314 );
4315 let mut req = request.into_request();
4316 req.extensions_mut()
4317 .insert(GrpcMethod::new("pidgr.v1.GroupService", "AddGroupMembers"));
4318 self.inner.unary(req, path, codec).await
4319 }
4320 pub async fn remove_group_members(
4324 &mut self,
4325 request: impl tonic::IntoRequest<super::RemoveGroupMembersRequest>,
4326 ) -> std::result::Result<
4327 tonic::Response<super::RemoveGroupMembersResponse>,
4328 tonic::Status,
4329 > {
4330 self.inner
4331 .ready()
4332 .await
4333 .map_err(|e| {
4334 tonic::Status::unknown(
4335 format!("Service was not ready: {}", e.into()),
4336 )
4337 })?;
4338 let codec = tonic_prost::ProstCodec::default();
4339 let path = http::uri::PathAndQuery::from_static(
4340 "/pidgr.v1.GroupService/RemoveGroupMembers",
4341 );
4342 let mut req = request.into_request();
4343 req.extensions_mut()
4344 .insert(GrpcMethod::new("pidgr.v1.GroupService", "RemoveGroupMembers"));
4345 self.inner.unary(req, path, codec).await
4346 }
4347 pub async fn list_group_members(
4352 &mut self,
4353 request: impl tonic::IntoRequest<super::ListGroupMembersRequest>,
4354 ) -> std::result::Result<
4355 tonic::Response<super::ListGroupMembersResponse>,
4356 tonic::Status,
4357 > {
4358 self.inner
4359 .ready()
4360 .await
4361 .map_err(|e| {
4362 tonic::Status::unknown(
4363 format!("Service was not ready: {}", e.into()),
4364 )
4365 })?;
4366 let codec = tonic_prost::ProstCodec::default();
4367 let path = http::uri::PathAndQuery::from_static(
4368 "/pidgr.v1.GroupService/ListGroupMembers",
4369 );
4370 let mut req = request.into_request();
4371 req.extensions_mut()
4372 .insert(GrpcMethod::new("pidgr.v1.GroupService", "ListGroupMembers"));
4373 self.inner.unary(req, path, codec).await
4374 }
4375 pub async fn get_user_group_memberships(
4380 &mut self,
4381 request: impl tonic::IntoRequest<super::GetUserGroupMembershipsRequest>,
4382 ) -> std::result::Result<
4383 tonic::Response<super::GetUserGroupMembershipsResponse>,
4384 tonic::Status,
4385 > {
4386 self.inner
4387 .ready()
4388 .await
4389 .map_err(|e| {
4390 tonic::Status::unknown(
4391 format!("Service was not ready: {}", e.into()),
4392 )
4393 })?;
4394 let codec = tonic_prost::ProstCodec::default();
4395 let path = http::uri::PathAndQuery::from_static(
4396 "/pidgr.v1.GroupService/GetUserGroupMemberships",
4397 );
4398 let mut req = request.into_request();
4399 req.extensions_mut()
4400 .insert(
4401 GrpcMethod::new("pidgr.v1.GroupService", "GetUserGroupMemberships"),
4402 );
4403 self.inner.unary(req, path, codec).await
4404 }
4405 }
4406}
4407pub mod group_service_server {
4409 #![allow(
4410 unused_variables,
4411 dead_code,
4412 missing_docs,
4413 clippy::wildcard_imports,
4414 clippy::let_unit_value,
4415 )]
4416 use tonic::codegen::*;
4417 #[async_trait]
4419 pub trait GroupService: std::marker::Send + std::marker::Sync + 'static {
4420 async fn create_group(
4424 &self,
4425 request: tonic::Request<super::CreateGroupRequest>,
4426 ) -> std::result::Result<
4427 tonic::Response<super::CreateGroupResponse>,
4428 tonic::Status,
4429 >;
4430 async fn get_group(
4435 &self,
4436 request: tonic::Request<super::GetGroupRequest>,
4437 ) -> std::result::Result<
4438 tonic::Response<super::GetGroupResponse>,
4439 tonic::Status,
4440 >;
4441 async fn list_groups(
4445 &self,
4446 request: tonic::Request<super::ListGroupsRequest>,
4447 ) -> std::result::Result<
4448 tonic::Response<super::ListGroupsResponse>,
4449 tonic::Status,
4450 >;
4451 async fn update_group(
4455 &self,
4456 request: tonic::Request<super::UpdateGroupRequest>,
4457 ) -> std::result::Result<
4458 tonic::Response<super::UpdateGroupResponse>,
4459 tonic::Status,
4460 >;
4461 async fn delete_group(
4465 &self,
4466 request: tonic::Request<super::DeleteGroupRequest>,
4467 ) -> std::result::Result<
4468 tonic::Response<super::DeleteGroupResponse>,
4469 tonic::Status,
4470 >;
4471 async fn add_group_members(
4475 &self,
4476 request: tonic::Request<super::AddGroupMembersRequest>,
4477 ) -> std::result::Result<
4478 tonic::Response<super::AddGroupMembersResponse>,
4479 tonic::Status,
4480 >;
4481 async fn remove_group_members(
4485 &self,
4486 request: tonic::Request<super::RemoveGroupMembersRequest>,
4487 ) -> std::result::Result<
4488 tonic::Response<super::RemoveGroupMembersResponse>,
4489 tonic::Status,
4490 >;
4491 async fn list_group_members(
4496 &self,
4497 request: tonic::Request<super::ListGroupMembersRequest>,
4498 ) -> std::result::Result<
4499 tonic::Response<super::ListGroupMembersResponse>,
4500 tonic::Status,
4501 >;
4502 async fn get_user_group_memberships(
4507 &self,
4508 request: tonic::Request<super::GetUserGroupMembershipsRequest>,
4509 ) -> std::result::Result<
4510 tonic::Response<super::GetUserGroupMembershipsResponse>,
4511 tonic::Status,
4512 >;
4513 }
4514 #[derive(Debug)]
4519 pub struct GroupServiceServer<T> {
4520 inner: Arc<T>,
4521 accept_compression_encodings: EnabledCompressionEncodings,
4522 send_compression_encodings: EnabledCompressionEncodings,
4523 max_decoding_message_size: Option<usize>,
4524 max_encoding_message_size: Option<usize>,
4525 }
4526 impl<T> GroupServiceServer<T> {
4527 pub fn new(inner: T) -> Self {
4528 Self::from_arc(Arc::new(inner))
4529 }
4530 pub fn from_arc(inner: Arc<T>) -> Self {
4531 Self {
4532 inner,
4533 accept_compression_encodings: Default::default(),
4534 send_compression_encodings: Default::default(),
4535 max_decoding_message_size: None,
4536 max_encoding_message_size: None,
4537 }
4538 }
4539 pub fn with_interceptor<F>(
4540 inner: T,
4541 interceptor: F,
4542 ) -> InterceptedService<Self, F>
4543 where
4544 F: tonic::service::Interceptor,
4545 {
4546 InterceptedService::new(Self::new(inner), interceptor)
4547 }
4548 #[must_use]
4550 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4551 self.accept_compression_encodings.enable(encoding);
4552 self
4553 }
4554 #[must_use]
4556 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4557 self.send_compression_encodings.enable(encoding);
4558 self
4559 }
4560 #[must_use]
4564 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4565 self.max_decoding_message_size = Some(limit);
4566 self
4567 }
4568 #[must_use]
4572 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4573 self.max_encoding_message_size = Some(limit);
4574 self
4575 }
4576 }
4577 impl<T, B> tonic::codegen::Service<http::Request<B>> for GroupServiceServer<T>
4578 where
4579 T: GroupService,
4580 B: Body + std::marker::Send + 'static,
4581 B::Error: Into<StdError> + std::marker::Send + 'static,
4582 {
4583 type Response = http::Response<tonic::body::Body>;
4584 type Error = std::convert::Infallible;
4585 type Future = BoxFuture<Self::Response, Self::Error>;
4586 fn poll_ready(
4587 &mut self,
4588 _cx: &mut Context<'_>,
4589 ) -> Poll<std::result::Result<(), Self::Error>> {
4590 Poll::Ready(Ok(()))
4591 }
4592 fn call(&mut self, req: http::Request<B>) -> Self::Future {
4593 match req.uri().path() {
4594 "/pidgr.v1.GroupService/CreateGroup" => {
4595 #[allow(non_camel_case_types)]
4596 struct CreateGroupSvc<T: GroupService>(pub Arc<T>);
4597 impl<
4598 T: GroupService,
4599 > tonic::server::UnaryService<super::CreateGroupRequest>
4600 for CreateGroupSvc<T> {
4601 type Response = super::CreateGroupResponse;
4602 type Future = BoxFuture<
4603 tonic::Response<Self::Response>,
4604 tonic::Status,
4605 >;
4606 fn call(
4607 &mut self,
4608 request: tonic::Request<super::CreateGroupRequest>,
4609 ) -> Self::Future {
4610 let inner = Arc::clone(&self.0);
4611 let fut = async move {
4612 <T as GroupService>::create_group(&inner, request).await
4613 };
4614 Box::pin(fut)
4615 }
4616 }
4617 let accept_compression_encodings = self.accept_compression_encodings;
4618 let send_compression_encodings = self.send_compression_encodings;
4619 let max_decoding_message_size = self.max_decoding_message_size;
4620 let max_encoding_message_size = self.max_encoding_message_size;
4621 let inner = self.inner.clone();
4622 let fut = async move {
4623 let method = CreateGroupSvc(inner);
4624 let codec = tonic_prost::ProstCodec::default();
4625 let mut grpc = tonic::server::Grpc::new(codec)
4626 .apply_compression_config(
4627 accept_compression_encodings,
4628 send_compression_encodings,
4629 )
4630 .apply_max_message_size_config(
4631 max_decoding_message_size,
4632 max_encoding_message_size,
4633 );
4634 let res = grpc.unary(method, req).await;
4635 Ok(res)
4636 };
4637 Box::pin(fut)
4638 }
4639 "/pidgr.v1.GroupService/GetGroup" => {
4640 #[allow(non_camel_case_types)]
4641 struct GetGroupSvc<T: GroupService>(pub Arc<T>);
4642 impl<
4643 T: GroupService,
4644 > tonic::server::UnaryService<super::GetGroupRequest>
4645 for GetGroupSvc<T> {
4646 type Response = super::GetGroupResponse;
4647 type Future = BoxFuture<
4648 tonic::Response<Self::Response>,
4649 tonic::Status,
4650 >;
4651 fn call(
4652 &mut self,
4653 request: tonic::Request<super::GetGroupRequest>,
4654 ) -> Self::Future {
4655 let inner = Arc::clone(&self.0);
4656 let fut = async move {
4657 <T as GroupService>::get_group(&inner, request).await
4658 };
4659 Box::pin(fut)
4660 }
4661 }
4662 let accept_compression_encodings = self.accept_compression_encodings;
4663 let send_compression_encodings = self.send_compression_encodings;
4664 let max_decoding_message_size = self.max_decoding_message_size;
4665 let max_encoding_message_size = self.max_encoding_message_size;
4666 let inner = self.inner.clone();
4667 let fut = async move {
4668 let method = GetGroupSvc(inner);
4669 let codec = tonic_prost::ProstCodec::default();
4670 let mut grpc = tonic::server::Grpc::new(codec)
4671 .apply_compression_config(
4672 accept_compression_encodings,
4673 send_compression_encodings,
4674 )
4675 .apply_max_message_size_config(
4676 max_decoding_message_size,
4677 max_encoding_message_size,
4678 );
4679 let res = grpc.unary(method, req).await;
4680 Ok(res)
4681 };
4682 Box::pin(fut)
4683 }
4684 "/pidgr.v1.GroupService/ListGroups" => {
4685 #[allow(non_camel_case_types)]
4686 struct ListGroupsSvc<T: GroupService>(pub Arc<T>);
4687 impl<
4688 T: GroupService,
4689 > tonic::server::UnaryService<super::ListGroupsRequest>
4690 for ListGroupsSvc<T> {
4691 type Response = super::ListGroupsResponse;
4692 type Future = BoxFuture<
4693 tonic::Response<Self::Response>,
4694 tonic::Status,
4695 >;
4696 fn call(
4697 &mut self,
4698 request: tonic::Request<super::ListGroupsRequest>,
4699 ) -> Self::Future {
4700 let inner = Arc::clone(&self.0);
4701 let fut = async move {
4702 <T as GroupService>::list_groups(&inner, request).await
4703 };
4704 Box::pin(fut)
4705 }
4706 }
4707 let accept_compression_encodings = self.accept_compression_encodings;
4708 let send_compression_encodings = self.send_compression_encodings;
4709 let max_decoding_message_size = self.max_decoding_message_size;
4710 let max_encoding_message_size = self.max_encoding_message_size;
4711 let inner = self.inner.clone();
4712 let fut = async move {
4713 let method = ListGroupsSvc(inner);
4714 let codec = tonic_prost::ProstCodec::default();
4715 let mut grpc = tonic::server::Grpc::new(codec)
4716 .apply_compression_config(
4717 accept_compression_encodings,
4718 send_compression_encodings,
4719 )
4720 .apply_max_message_size_config(
4721 max_decoding_message_size,
4722 max_encoding_message_size,
4723 );
4724 let res = grpc.unary(method, req).await;
4725 Ok(res)
4726 };
4727 Box::pin(fut)
4728 }
4729 "/pidgr.v1.GroupService/UpdateGroup" => {
4730 #[allow(non_camel_case_types)]
4731 struct UpdateGroupSvc<T: GroupService>(pub Arc<T>);
4732 impl<
4733 T: GroupService,
4734 > tonic::server::UnaryService<super::UpdateGroupRequest>
4735 for UpdateGroupSvc<T> {
4736 type Response = super::UpdateGroupResponse;
4737 type Future = BoxFuture<
4738 tonic::Response<Self::Response>,
4739 tonic::Status,
4740 >;
4741 fn call(
4742 &mut self,
4743 request: tonic::Request<super::UpdateGroupRequest>,
4744 ) -> Self::Future {
4745 let inner = Arc::clone(&self.0);
4746 let fut = async move {
4747 <T as GroupService>::update_group(&inner, request).await
4748 };
4749 Box::pin(fut)
4750 }
4751 }
4752 let accept_compression_encodings = self.accept_compression_encodings;
4753 let send_compression_encodings = self.send_compression_encodings;
4754 let max_decoding_message_size = self.max_decoding_message_size;
4755 let max_encoding_message_size = self.max_encoding_message_size;
4756 let inner = self.inner.clone();
4757 let fut = async move {
4758 let method = UpdateGroupSvc(inner);
4759 let codec = tonic_prost::ProstCodec::default();
4760 let mut grpc = tonic::server::Grpc::new(codec)
4761 .apply_compression_config(
4762 accept_compression_encodings,
4763 send_compression_encodings,
4764 )
4765 .apply_max_message_size_config(
4766 max_decoding_message_size,
4767 max_encoding_message_size,
4768 );
4769 let res = grpc.unary(method, req).await;
4770 Ok(res)
4771 };
4772 Box::pin(fut)
4773 }
4774 "/pidgr.v1.GroupService/DeleteGroup" => {
4775 #[allow(non_camel_case_types)]
4776 struct DeleteGroupSvc<T: GroupService>(pub Arc<T>);
4777 impl<
4778 T: GroupService,
4779 > tonic::server::UnaryService<super::DeleteGroupRequest>
4780 for DeleteGroupSvc<T> {
4781 type Response = super::DeleteGroupResponse;
4782 type Future = BoxFuture<
4783 tonic::Response<Self::Response>,
4784 tonic::Status,
4785 >;
4786 fn call(
4787 &mut self,
4788 request: tonic::Request<super::DeleteGroupRequest>,
4789 ) -> Self::Future {
4790 let inner = Arc::clone(&self.0);
4791 let fut = async move {
4792 <T as GroupService>::delete_group(&inner, request).await
4793 };
4794 Box::pin(fut)
4795 }
4796 }
4797 let accept_compression_encodings = self.accept_compression_encodings;
4798 let send_compression_encodings = self.send_compression_encodings;
4799 let max_decoding_message_size = self.max_decoding_message_size;
4800 let max_encoding_message_size = self.max_encoding_message_size;
4801 let inner = self.inner.clone();
4802 let fut = async move {
4803 let method = DeleteGroupSvc(inner);
4804 let codec = tonic_prost::ProstCodec::default();
4805 let mut grpc = tonic::server::Grpc::new(codec)
4806 .apply_compression_config(
4807 accept_compression_encodings,
4808 send_compression_encodings,
4809 )
4810 .apply_max_message_size_config(
4811 max_decoding_message_size,
4812 max_encoding_message_size,
4813 );
4814 let res = grpc.unary(method, req).await;
4815 Ok(res)
4816 };
4817 Box::pin(fut)
4818 }
4819 "/pidgr.v1.GroupService/AddGroupMembers" => {
4820 #[allow(non_camel_case_types)]
4821 struct AddGroupMembersSvc<T: GroupService>(pub Arc<T>);
4822 impl<
4823 T: GroupService,
4824 > tonic::server::UnaryService<super::AddGroupMembersRequest>
4825 for AddGroupMembersSvc<T> {
4826 type Response = super::AddGroupMembersResponse;
4827 type Future = BoxFuture<
4828 tonic::Response<Self::Response>,
4829 tonic::Status,
4830 >;
4831 fn call(
4832 &mut self,
4833 request: tonic::Request<super::AddGroupMembersRequest>,
4834 ) -> Self::Future {
4835 let inner = Arc::clone(&self.0);
4836 let fut = async move {
4837 <T as GroupService>::add_group_members(&inner, request)
4838 .await
4839 };
4840 Box::pin(fut)
4841 }
4842 }
4843 let accept_compression_encodings = self.accept_compression_encodings;
4844 let send_compression_encodings = self.send_compression_encodings;
4845 let max_decoding_message_size = self.max_decoding_message_size;
4846 let max_encoding_message_size = self.max_encoding_message_size;
4847 let inner = self.inner.clone();
4848 let fut = async move {
4849 let method = AddGroupMembersSvc(inner);
4850 let codec = tonic_prost::ProstCodec::default();
4851 let mut grpc = tonic::server::Grpc::new(codec)
4852 .apply_compression_config(
4853 accept_compression_encodings,
4854 send_compression_encodings,
4855 )
4856 .apply_max_message_size_config(
4857 max_decoding_message_size,
4858 max_encoding_message_size,
4859 );
4860 let res = grpc.unary(method, req).await;
4861 Ok(res)
4862 };
4863 Box::pin(fut)
4864 }
4865 "/pidgr.v1.GroupService/RemoveGroupMembers" => {
4866 #[allow(non_camel_case_types)]
4867 struct RemoveGroupMembersSvc<T: GroupService>(pub Arc<T>);
4868 impl<
4869 T: GroupService,
4870 > tonic::server::UnaryService<super::RemoveGroupMembersRequest>
4871 for RemoveGroupMembersSvc<T> {
4872 type Response = super::RemoveGroupMembersResponse;
4873 type Future = BoxFuture<
4874 tonic::Response<Self::Response>,
4875 tonic::Status,
4876 >;
4877 fn call(
4878 &mut self,
4879 request: tonic::Request<super::RemoveGroupMembersRequest>,
4880 ) -> Self::Future {
4881 let inner = Arc::clone(&self.0);
4882 let fut = async move {
4883 <T as GroupService>::remove_group_members(&inner, request)
4884 .await
4885 };
4886 Box::pin(fut)
4887 }
4888 }
4889 let accept_compression_encodings = self.accept_compression_encodings;
4890 let send_compression_encodings = self.send_compression_encodings;
4891 let max_decoding_message_size = self.max_decoding_message_size;
4892 let max_encoding_message_size = self.max_encoding_message_size;
4893 let inner = self.inner.clone();
4894 let fut = async move {
4895 let method = RemoveGroupMembersSvc(inner);
4896 let codec = tonic_prost::ProstCodec::default();
4897 let mut grpc = tonic::server::Grpc::new(codec)
4898 .apply_compression_config(
4899 accept_compression_encodings,
4900 send_compression_encodings,
4901 )
4902 .apply_max_message_size_config(
4903 max_decoding_message_size,
4904 max_encoding_message_size,
4905 );
4906 let res = grpc.unary(method, req).await;
4907 Ok(res)
4908 };
4909 Box::pin(fut)
4910 }
4911 "/pidgr.v1.GroupService/ListGroupMembers" => {
4912 #[allow(non_camel_case_types)]
4913 struct ListGroupMembersSvc<T: GroupService>(pub Arc<T>);
4914 impl<
4915 T: GroupService,
4916 > tonic::server::UnaryService<super::ListGroupMembersRequest>
4917 for ListGroupMembersSvc<T> {
4918 type Response = super::ListGroupMembersResponse;
4919 type Future = BoxFuture<
4920 tonic::Response<Self::Response>,
4921 tonic::Status,
4922 >;
4923 fn call(
4924 &mut self,
4925 request: tonic::Request<super::ListGroupMembersRequest>,
4926 ) -> Self::Future {
4927 let inner = Arc::clone(&self.0);
4928 let fut = async move {
4929 <T as GroupService>::list_group_members(&inner, request)
4930 .await
4931 };
4932 Box::pin(fut)
4933 }
4934 }
4935 let accept_compression_encodings = self.accept_compression_encodings;
4936 let send_compression_encodings = self.send_compression_encodings;
4937 let max_decoding_message_size = self.max_decoding_message_size;
4938 let max_encoding_message_size = self.max_encoding_message_size;
4939 let inner = self.inner.clone();
4940 let fut = async move {
4941 let method = ListGroupMembersSvc(inner);
4942 let codec = tonic_prost::ProstCodec::default();
4943 let mut grpc = tonic::server::Grpc::new(codec)
4944 .apply_compression_config(
4945 accept_compression_encodings,
4946 send_compression_encodings,
4947 )
4948 .apply_max_message_size_config(
4949 max_decoding_message_size,
4950 max_encoding_message_size,
4951 );
4952 let res = grpc.unary(method, req).await;
4953 Ok(res)
4954 };
4955 Box::pin(fut)
4956 }
4957 "/pidgr.v1.GroupService/GetUserGroupMemberships" => {
4958 #[allow(non_camel_case_types)]
4959 struct GetUserGroupMembershipsSvc<T: GroupService>(pub Arc<T>);
4960 impl<
4961 T: GroupService,
4962 > tonic::server::UnaryService<super::GetUserGroupMembershipsRequest>
4963 for GetUserGroupMembershipsSvc<T> {
4964 type Response = super::GetUserGroupMembershipsResponse;
4965 type Future = BoxFuture<
4966 tonic::Response<Self::Response>,
4967 tonic::Status,
4968 >;
4969 fn call(
4970 &mut self,
4971 request: tonic::Request<
4972 super::GetUserGroupMembershipsRequest,
4973 >,
4974 ) -> Self::Future {
4975 let inner = Arc::clone(&self.0);
4976 let fut = async move {
4977 <T as GroupService>::get_user_group_memberships(
4978 &inner,
4979 request,
4980 )
4981 .await
4982 };
4983 Box::pin(fut)
4984 }
4985 }
4986 let accept_compression_encodings = self.accept_compression_encodings;
4987 let send_compression_encodings = self.send_compression_encodings;
4988 let max_decoding_message_size = self.max_decoding_message_size;
4989 let max_encoding_message_size = self.max_encoding_message_size;
4990 let inner = self.inner.clone();
4991 let fut = async move {
4992 let method = GetUserGroupMembershipsSvc(inner);
4993 let codec = tonic_prost::ProstCodec::default();
4994 let mut grpc = tonic::server::Grpc::new(codec)
4995 .apply_compression_config(
4996 accept_compression_encodings,
4997 send_compression_encodings,
4998 )
4999 .apply_max_message_size_config(
5000 max_decoding_message_size,
5001 max_encoding_message_size,
5002 );
5003 let res = grpc.unary(method, req).await;
5004 Ok(res)
5005 };
5006 Box::pin(fut)
5007 }
5008 _ => {
5009 Box::pin(async move {
5010 let mut response = http::Response::new(
5011 tonic::body::Body::default(),
5012 );
5013 let headers = response.headers_mut();
5014 headers
5015 .insert(
5016 tonic::Status::GRPC_STATUS,
5017 (tonic::Code::Unimplemented as i32).into(),
5018 );
5019 headers
5020 .insert(
5021 http::header::CONTENT_TYPE,
5022 tonic::metadata::GRPC_CONTENT_TYPE,
5023 );
5024 Ok(response)
5025 })
5026 }
5027 }
5028 }
5029 }
5030 impl<T> Clone for GroupServiceServer<T> {
5031 fn clone(&self) -> Self {
5032 let inner = self.inner.clone();
5033 Self {
5034 inner,
5035 accept_compression_encodings: self.accept_compression_encodings,
5036 send_compression_encodings: self.send_compression_encodings,
5037 max_decoding_message_size: self.max_decoding_message_size,
5038 max_encoding_message_size: self.max_encoding_message_size,
5039 }
5040 }
5041 }
5042 pub const SERVICE_NAME: &str = "pidgr.v1.GroupService";
5044 impl<T> tonic::server::NamedService for GroupServiceServer<T> {
5045 const NAME: &'static str = SERVICE_NAME;
5046 }
5047}
5048pub mod heatmap_service_client {
5050 #![allow(
5051 unused_variables,
5052 dead_code,
5053 missing_docs,
5054 clippy::wildcard_imports,
5055 clippy::let_unit_value,
5056 )]
5057 use tonic::codegen::*;
5058 use tonic::codegen::http::Uri;
5059 #[derive(Debug, Clone)]
5063 pub struct HeatmapServiceClient<T> {
5064 inner: tonic::client::Grpc<T>,
5065 }
5066 impl HeatmapServiceClient<tonic::transport::Channel> {
5067 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5069 where
5070 D: TryInto<tonic::transport::Endpoint>,
5071 D::Error: Into<StdError>,
5072 {
5073 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5074 Ok(Self::new(conn))
5075 }
5076 }
5077 impl<T> HeatmapServiceClient<T>
5078 where
5079 T: tonic::client::GrpcService<tonic::body::Body>,
5080 T::Error: Into<StdError>,
5081 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5082 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5083 {
5084 pub fn new(inner: T) -> Self {
5085 let inner = tonic::client::Grpc::new(inner);
5086 Self { inner }
5087 }
5088 pub fn with_origin(inner: T, origin: Uri) -> Self {
5089 let inner = tonic::client::Grpc::with_origin(inner, origin);
5090 Self { inner }
5091 }
5092 pub fn with_interceptor<F>(
5093 inner: T,
5094 interceptor: F,
5095 ) -> HeatmapServiceClient<InterceptedService<T, F>>
5096 where
5097 F: tonic::service::Interceptor,
5098 T::ResponseBody: Default,
5099 T: tonic::codegen::Service<
5100 http::Request<tonic::body::Body>,
5101 Response = http::Response<
5102 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
5103 >,
5104 >,
5105 <T as tonic::codegen::Service<
5106 http::Request<tonic::body::Body>,
5107 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
5108 {
5109 HeatmapServiceClient::new(InterceptedService::new(inner, interceptor))
5110 }
5111 #[must_use]
5116 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5117 self.inner = self.inner.send_compressed(encoding);
5118 self
5119 }
5120 #[must_use]
5122 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5123 self.inner = self.inner.accept_compressed(encoding);
5124 self
5125 }
5126 #[must_use]
5130 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5131 self.inner = self.inner.max_decoding_message_size(limit);
5132 self
5133 }
5134 #[must_use]
5138 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5139 self.inner = self.inner.max_encoding_message_size(limit);
5140 self
5141 }
5142 pub async fn ingest_touch_events(
5146 &mut self,
5147 request: impl tonic::IntoRequest<super::IngestTouchEventsRequest>,
5148 ) -> std::result::Result<
5149 tonic::Response<super::IngestTouchEventsResponse>,
5150 tonic::Status,
5151 > {
5152 self.inner
5153 .ready()
5154 .await
5155 .map_err(|e| {
5156 tonic::Status::unknown(
5157 format!("Service was not ready: {}", e.into()),
5158 )
5159 })?;
5160 let codec = tonic_prost::ProstCodec::default();
5161 let path = http::uri::PathAndQuery::from_static(
5162 "/pidgr.v1.HeatmapService/IngestTouchEvents",
5163 );
5164 let mut req = request.into_request();
5165 req.extensions_mut()
5166 .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "IngestTouchEvents"));
5167 self.inner.unary(req, path, codec).await
5168 }
5169 pub async fn query_heatmap_data(
5173 &mut self,
5174 request: impl tonic::IntoRequest<super::QueryHeatmapDataRequest>,
5175 ) -> std::result::Result<
5176 tonic::Response<super::QueryHeatmapDataResponse>,
5177 tonic::Status,
5178 > {
5179 self.inner
5180 .ready()
5181 .await
5182 .map_err(|e| {
5183 tonic::Status::unknown(
5184 format!("Service was not ready: {}", e.into()),
5185 )
5186 })?;
5187 let codec = tonic_prost::ProstCodec::default();
5188 let path = http::uri::PathAndQuery::from_static(
5189 "/pidgr.v1.HeatmapService/QueryHeatmapData",
5190 );
5191 let mut req = request.into_request();
5192 req.extensions_mut()
5193 .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "QueryHeatmapData"));
5194 self.inner.unary(req, path, codec).await
5195 }
5196 pub async fn list_screenshots(
5200 &mut self,
5201 request: impl tonic::IntoRequest<super::ListScreenshotsRequest>,
5202 ) -> std::result::Result<
5203 tonic::Response<super::ListScreenshotsResponse>,
5204 tonic::Status,
5205 > {
5206 self.inner
5207 .ready()
5208 .await
5209 .map_err(|e| {
5210 tonic::Status::unknown(
5211 format!("Service was not ready: {}", e.into()),
5212 )
5213 })?;
5214 let codec = tonic_prost::ProstCodec::default();
5215 let path = http::uri::PathAndQuery::from_static(
5216 "/pidgr.v1.HeatmapService/ListScreenshots",
5217 );
5218 let mut req = request.into_request();
5219 req.extensions_mut()
5220 .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "ListScreenshots"));
5221 self.inner.unary(req, path, codec).await
5222 }
5223 pub async fn upload_screenshot(
5227 &mut self,
5228 request: impl tonic::IntoRequest<super::UploadScreenshotRequest>,
5229 ) -> std::result::Result<
5230 tonic::Response<super::UploadScreenshotResponse>,
5231 tonic::Status,
5232 > {
5233 self.inner
5234 .ready()
5235 .await
5236 .map_err(|e| {
5237 tonic::Status::unknown(
5238 format!("Service was not ready: {}", e.into()),
5239 )
5240 })?;
5241 let codec = tonic_prost::ProstCodec::default();
5242 let path = http::uri::PathAndQuery::from_static(
5243 "/pidgr.v1.HeatmapService/UploadScreenshot",
5244 );
5245 let mut req = request.into_request();
5246 req.extensions_mut()
5247 .insert(GrpcMethod::new("pidgr.v1.HeatmapService", "UploadScreenshot"));
5248 self.inner.unary(req, path, codec).await
5249 }
5250 }
5251}
5252pub mod heatmap_service_server {
5254 #![allow(
5255 unused_variables,
5256 dead_code,
5257 missing_docs,
5258 clippy::wildcard_imports,
5259 clippy::let_unit_value,
5260 )]
5261 use tonic::codegen::*;
5262 #[async_trait]
5264 pub trait HeatmapService: std::marker::Send + std::marker::Sync + 'static {
5265 async fn ingest_touch_events(
5269 &self,
5270 request: tonic::Request<super::IngestTouchEventsRequest>,
5271 ) -> std::result::Result<
5272 tonic::Response<super::IngestTouchEventsResponse>,
5273 tonic::Status,
5274 >;
5275 async fn query_heatmap_data(
5279 &self,
5280 request: tonic::Request<super::QueryHeatmapDataRequest>,
5281 ) -> std::result::Result<
5282 tonic::Response<super::QueryHeatmapDataResponse>,
5283 tonic::Status,
5284 >;
5285 async fn list_screenshots(
5289 &self,
5290 request: tonic::Request<super::ListScreenshotsRequest>,
5291 ) -> std::result::Result<
5292 tonic::Response<super::ListScreenshotsResponse>,
5293 tonic::Status,
5294 >;
5295 async fn upload_screenshot(
5299 &self,
5300 request: tonic::Request<super::UploadScreenshotRequest>,
5301 ) -> std::result::Result<
5302 tonic::Response<super::UploadScreenshotResponse>,
5303 tonic::Status,
5304 >;
5305 }
5306 #[derive(Debug)]
5310 pub struct HeatmapServiceServer<T> {
5311 inner: Arc<T>,
5312 accept_compression_encodings: EnabledCompressionEncodings,
5313 send_compression_encodings: EnabledCompressionEncodings,
5314 max_decoding_message_size: Option<usize>,
5315 max_encoding_message_size: Option<usize>,
5316 }
5317 impl<T> HeatmapServiceServer<T> {
5318 pub fn new(inner: T) -> Self {
5319 Self::from_arc(Arc::new(inner))
5320 }
5321 pub fn from_arc(inner: Arc<T>) -> Self {
5322 Self {
5323 inner,
5324 accept_compression_encodings: Default::default(),
5325 send_compression_encodings: Default::default(),
5326 max_decoding_message_size: None,
5327 max_encoding_message_size: None,
5328 }
5329 }
5330 pub fn with_interceptor<F>(
5331 inner: T,
5332 interceptor: F,
5333 ) -> InterceptedService<Self, F>
5334 where
5335 F: tonic::service::Interceptor,
5336 {
5337 InterceptedService::new(Self::new(inner), interceptor)
5338 }
5339 #[must_use]
5341 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5342 self.accept_compression_encodings.enable(encoding);
5343 self
5344 }
5345 #[must_use]
5347 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5348 self.send_compression_encodings.enable(encoding);
5349 self
5350 }
5351 #[must_use]
5355 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5356 self.max_decoding_message_size = Some(limit);
5357 self
5358 }
5359 #[must_use]
5363 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5364 self.max_encoding_message_size = Some(limit);
5365 self
5366 }
5367 }
5368 impl<T, B> tonic::codegen::Service<http::Request<B>> for HeatmapServiceServer<T>
5369 where
5370 T: HeatmapService,
5371 B: Body + std::marker::Send + 'static,
5372 B::Error: Into<StdError> + std::marker::Send + 'static,
5373 {
5374 type Response = http::Response<tonic::body::Body>;
5375 type Error = std::convert::Infallible;
5376 type Future = BoxFuture<Self::Response, Self::Error>;
5377 fn poll_ready(
5378 &mut self,
5379 _cx: &mut Context<'_>,
5380 ) -> Poll<std::result::Result<(), Self::Error>> {
5381 Poll::Ready(Ok(()))
5382 }
5383 fn call(&mut self, req: http::Request<B>) -> Self::Future {
5384 match req.uri().path() {
5385 "/pidgr.v1.HeatmapService/IngestTouchEvents" => {
5386 #[allow(non_camel_case_types)]
5387 struct IngestTouchEventsSvc<T: HeatmapService>(pub Arc<T>);
5388 impl<
5389 T: HeatmapService,
5390 > tonic::server::UnaryService<super::IngestTouchEventsRequest>
5391 for IngestTouchEventsSvc<T> {
5392 type Response = super::IngestTouchEventsResponse;
5393 type Future = BoxFuture<
5394 tonic::Response<Self::Response>,
5395 tonic::Status,
5396 >;
5397 fn call(
5398 &mut self,
5399 request: tonic::Request<super::IngestTouchEventsRequest>,
5400 ) -> Self::Future {
5401 let inner = Arc::clone(&self.0);
5402 let fut = async move {
5403 <T as HeatmapService>::ingest_touch_events(&inner, request)
5404 .await
5405 };
5406 Box::pin(fut)
5407 }
5408 }
5409 let accept_compression_encodings = self.accept_compression_encodings;
5410 let send_compression_encodings = self.send_compression_encodings;
5411 let max_decoding_message_size = self.max_decoding_message_size;
5412 let max_encoding_message_size = self.max_encoding_message_size;
5413 let inner = self.inner.clone();
5414 let fut = async move {
5415 let method = IngestTouchEventsSvc(inner);
5416 let codec = tonic_prost::ProstCodec::default();
5417 let mut grpc = tonic::server::Grpc::new(codec)
5418 .apply_compression_config(
5419 accept_compression_encodings,
5420 send_compression_encodings,
5421 )
5422 .apply_max_message_size_config(
5423 max_decoding_message_size,
5424 max_encoding_message_size,
5425 );
5426 let res = grpc.unary(method, req).await;
5427 Ok(res)
5428 };
5429 Box::pin(fut)
5430 }
5431 "/pidgr.v1.HeatmapService/QueryHeatmapData" => {
5432 #[allow(non_camel_case_types)]
5433 struct QueryHeatmapDataSvc<T: HeatmapService>(pub Arc<T>);
5434 impl<
5435 T: HeatmapService,
5436 > tonic::server::UnaryService<super::QueryHeatmapDataRequest>
5437 for QueryHeatmapDataSvc<T> {
5438 type Response = super::QueryHeatmapDataResponse;
5439 type Future = BoxFuture<
5440 tonic::Response<Self::Response>,
5441 tonic::Status,
5442 >;
5443 fn call(
5444 &mut self,
5445 request: tonic::Request<super::QueryHeatmapDataRequest>,
5446 ) -> Self::Future {
5447 let inner = Arc::clone(&self.0);
5448 let fut = async move {
5449 <T as HeatmapService>::query_heatmap_data(&inner, request)
5450 .await
5451 };
5452 Box::pin(fut)
5453 }
5454 }
5455 let accept_compression_encodings = self.accept_compression_encodings;
5456 let send_compression_encodings = self.send_compression_encodings;
5457 let max_decoding_message_size = self.max_decoding_message_size;
5458 let max_encoding_message_size = self.max_encoding_message_size;
5459 let inner = self.inner.clone();
5460 let fut = async move {
5461 let method = QueryHeatmapDataSvc(inner);
5462 let codec = tonic_prost::ProstCodec::default();
5463 let mut grpc = tonic::server::Grpc::new(codec)
5464 .apply_compression_config(
5465 accept_compression_encodings,
5466 send_compression_encodings,
5467 )
5468 .apply_max_message_size_config(
5469 max_decoding_message_size,
5470 max_encoding_message_size,
5471 );
5472 let res = grpc.unary(method, req).await;
5473 Ok(res)
5474 };
5475 Box::pin(fut)
5476 }
5477 "/pidgr.v1.HeatmapService/ListScreenshots" => {
5478 #[allow(non_camel_case_types)]
5479 struct ListScreenshotsSvc<T: HeatmapService>(pub Arc<T>);
5480 impl<
5481 T: HeatmapService,
5482 > tonic::server::UnaryService<super::ListScreenshotsRequest>
5483 for ListScreenshotsSvc<T> {
5484 type Response = super::ListScreenshotsResponse;
5485 type Future = BoxFuture<
5486 tonic::Response<Self::Response>,
5487 tonic::Status,
5488 >;
5489 fn call(
5490 &mut self,
5491 request: tonic::Request<super::ListScreenshotsRequest>,
5492 ) -> Self::Future {
5493 let inner = Arc::clone(&self.0);
5494 let fut = async move {
5495 <T as HeatmapService>::list_screenshots(&inner, request)
5496 .await
5497 };
5498 Box::pin(fut)
5499 }
5500 }
5501 let accept_compression_encodings = self.accept_compression_encodings;
5502 let send_compression_encodings = self.send_compression_encodings;
5503 let max_decoding_message_size = self.max_decoding_message_size;
5504 let max_encoding_message_size = self.max_encoding_message_size;
5505 let inner = self.inner.clone();
5506 let fut = async move {
5507 let method = ListScreenshotsSvc(inner);
5508 let codec = tonic_prost::ProstCodec::default();
5509 let mut grpc = tonic::server::Grpc::new(codec)
5510 .apply_compression_config(
5511 accept_compression_encodings,
5512 send_compression_encodings,
5513 )
5514 .apply_max_message_size_config(
5515 max_decoding_message_size,
5516 max_encoding_message_size,
5517 );
5518 let res = grpc.unary(method, req).await;
5519 Ok(res)
5520 };
5521 Box::pin(fut)
5522 }
5523 "/pidgr.v1.HeatmapService/UploadScreenshot" => {
5524 #[allow(non_camel_case_types)]
5525 struct UploadScreenshotSvc<T: HeatmapService>(pub Arc<T>);
5526 impl<
5527 T: HeatmapService,
5528 > tonic::server::UnaryService<super::UploadScreenshotRequest>
5529 for UploadScreenshotSvc<T> {
5530 type Response = super::UploadScreenshotResponse;
5531 type Future = BoxFuture<
5532 tonic::Response<Self::Response>,
5533 tonic::Status,
5534 >;
5535 fn call(
5536 &mut self,
5537 request: tonic::Request<super::UploadScreenshotRequest>,
5538 ) -> Self::Future {
5539 let inner = Arc::clone(&self.0);
5540 let fut = async move {
5541 <T as HeatmapService>::upload_screenshot(&inner, request)
5542 .await
5543 };
5544 Box::pin(fut)
5545 }
5546 }
5547 let accept_compression_encodings = self.accept_compression_encodings;
5548 let send_compression_encodings = self.send_compression_encodings;
5549 let max_decoding_message_size = self.max_decoding_message_size;
5550 let max_encoding_message_size = self.max_encoding_message_size;
5551 let inner = self.inner.clone();
5552 let fut = async move {
5553 let method = UploadScreenshotSvc(inner);
5554 let codec = tonic_prost::ProstCodec::default();
5555 let mut grpc = tonic::server::Grpc::new(codec)
5556 .apply_compression_config(
5557 accept_compression_encodings,
5558 send_compression_encodings,
5559 )
5560 .apply_max_message_size_config(
5561 max_decoding_message_size,
5562 max_encoding_message_size,
5563 );
5564 let res = grpc.unary(method, req).await;
5565 Ok(res)
5566 };
5567 Box::pin(fut)
5568 }
5569 _ => {
5570 Box::pin(async move {
5571 let mut response = http::Response::new(
5572 tonic::body::Body::default(),
5573 );
5574 let headers = response.headers_mut();
5575 headers
5576 .insert(
5577 tonic::Status::GRPC_STATUS,
5578 (tonic::Code::Unimplemented as i32).into(),
5579 );
5580 headers
5581 .insert(
5582 http::header::CONTENT_TYPE,
5583 tonic::metadata::GRPC_CONTENT_TYPE,
5584 );
5585 Ok(response)
5586 })
5587 }
5588 }
5589 }
5590 }
5591 impl<T> Clone for HeatmapServiceServer<T> {
5592 fn clone(&self) -> Self {
5593 let inner = self.inner.clone();
5594 Self {
5595 inner,
5596 accept_compression_encodings: self.accept_compression_encodings,
5597 send_compression_encodings: self.send_compression_encodings,
5598 max_decoding_message_size: self.max_decoding_message_size,
5599 max_encoding_message_size: self.max_encoding_message_size,
5600 }
5601 }
5602 }
5603 pub const SERVICE_NAME: &str = "pidgr.v1.HeatmapService";
5605 impl<T> tonic::server::NamedService for HeatmapServiceServer<T> {
5606 const NAME: &'static str = SERVICE_NAME;
5607 }
5608}
5609pub mod inbox_service_client {
5611 #![allow(
5612 unused_variables,
5613 dead_code,
5614 missing_docs,
5615 clippy::wildcard_imports,
5616 clippy::let_unit_value,
5617 )]
5618 use tonic::codegen::*;
5619 use tonic::codegen::http::Uri;
5620 #[derive(Debug, Clone)]
5624 pub struct InboxServiceClient<T> {
5625 inner: tonic::client::Grpc<T>,
5626 }
5627 impl InboxServiceClient<tonic::transport::Channel> {
5628 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5630 where
5631 D: TryInto<tonic::transport::Endpoint>,
5632 D::Error: Into<StdError>,
5633 {
5634 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5635 Ok(Self::new(conn))
5636 }
5637 }
5638 impl<T> InboxServiceClient<T>
5639 where
5640 T: tonic::client::GrpcService<tonic::body::Body>,
5641 T::Error: Into<StdError>,
5642 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5643 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5644 {
5645 pub fn new(inner: T) -> Self {
5646 let inner = tonic::client::Grpc::new(inner);
5647 Self { inner }
5648 }
5649 pub fn with_origin(inner: T, origin: Uri) -> Self {
5650 let inner = tonic::client::Grpc::with_origin(inner, origin);
5651 Self { inner }
5652 }
5653 pub fn with_interceptor<F>(
5654 inner: T,
5655 interceptor: F,
5656 ) -> InboxServiceClient<InterceptedService<T, F>>
5657 where
5658 F: tonic::service::Interceptor,
5659 T::ResponseBody: Default,
5660 T: tonic::codegen::Service<
5661 http::Request<tonic::body::Body>,
5662 Response = http::Response<
5663 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
5664 >,
5665 >,
5666 <T as tonic::codegen::Service<
5667 http::Request<tonic::body::Body>,
5668 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
5669 {
5670 InboxServiceClient::new(InterceptedService::new(inner, interceptor))
5671 }
5672 #[must_use]
5677 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5678 self.inner = self.inner.send_compressed(encoding);
5679 self
5680 }
5681 #[must_use]
5683 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5684 self.inner = self.inner.accept_compressed(encoding);
5685 self
5686 }
5687 #[must_use]
5691 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5692 self.inner = self.inner.max_decoding_message_size(limit);
5693 self
5694 }
5695 #[must_use]
5699 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5700 self.inner = self.inner.max_encoding_message_size(limit);
5701 self
5702 }
5703 pub async fn sync(
5707 &mut self,
5708 request: impl tonic::IntoRequest<super::SyncRequest>,
5709 ) -> std::result::Result<tonic::Response<super::SyncResponse>, tonic::Status> {
5710 self.inner
5711 .ready()
5712 .await
5713 .map_err(|e| {
5714 tonic::Status::unknown(
5715 format!("Service was not ready: {}", e.into()),
5716 )
5717 })?;
5718 let codec = tonic_prost::ProstCodec::default();
5719 let path = http::uri::PathAndQuery::from_static(
5720 "/pidgr.v1.InboxService/Sync",
5721 );
5722 let mut req = request.into_request();
5723 req.extensions_mut()
5724 .insert(GrpcMethod::new("pidgr.v1.InboxService", "Sync"));
5725 self.inner.unary(req, path, codec).await
5726 }
5727 pub async fn mark_read(
5731 &mut self,
5732 request: impl tonic::IntoRequest<super::MarkReadRequest>,
5733 ) -> std::result::Result<
5734 tonic::Response<super::MarkReadResponse>,
5735 tonic::Status,
5736 > {
5737 self.inner
5738 .ready()
5739 .await
5740 .map_err(|e| {
5741 tonic::Status::unknown(
5742 format!("Service was not ready: {}", e.into()),
5743 )
5744 })?;
5745 let codec = tonic_prost::ProstCodec::default();
5746 let path = http::uri::PathAndQuery::from_static(
5747 "/pidgr.v1.InboxService/MarkRead",
5748 );
5749 let mut req = request.into_request();
5750 req.extensions_mut()
5751 .insert(GrpcMethod::new("pidgr.v1.InboxService", "MarkRead"));
5752 self.inner.unary(req, path, codec).await
5753 }
5754 pub async fn get_message(
5758 &mut self,
5759 request: impl tonic::IntoRequest<super::GetMessageRequest>,
5760 ) -> std::result::Result<
5761 tonic::Response<super::GetMessageResponse>,
5762 tonic::Status,
5763 > {
5764 self.inner
5765 .ready()
5766 .await
5767 .map_err(|e| {
5768 tonic::Status::unknown(
5769 format!("Service was not ready: {}", e.into()),
5770 )
5771 })?;
5772 let codec = tonic_prost::ProstCodec::default();
5773 let path = http::uri::PathAndQuery::from_static(
5774 "/pidgr.v1.InboxService/GetMessage",
5775 );
5776 let mut req = request.into_request();
5777 req.extensions_mut()
5778 .insert(GrpcMethod::new("pidgr.v1.InboxService", "GetMessage"));
5779 self.inner.unary(req, path, codec).await
5780 }
5781 }
5782}
5783pub mod inbox_service_server {
5785 #![allow(
5786 unused_variables,
5787 dead_code,
5788 missing_docs,
5789 clippy::wildcard_imports,
5790 clippy::let_unit_value,
5791 )]
5792 use tonic::codegen::*;
5793 #[async_trait]
5795 pub trait InboxService: std::marker::Send + std::marker::Sync + 'static {
5796 async fn sync(
5800 &self,
5801 request: tonic::Request<super::SyncRequest>,
5802 ) -> std::result::Result<tonic::Response<super::SyncResponse>, tonic::Status>;
5803 async fn mark_read(
5807 &self,
5808 request: tonic::Request<super::MarkReadRequest>,
5809 ) -> std::result::Result<
5810 tonic::Response<super::MarkReadResponse>,
5811 tonic::Status,
5812 >;
5813 async fn get_message(
5817 &self,
5818 request: tonic::Request<super::GetMessageRequest>,
5819 ) -> std::result::Result<
5820 tonic::Response<super::GetMessageResponse>,
5821 tonic::Status,
5822 >;
5823 }
5824 #[derive(Debug)]
5828 pub struct InboxServiceServer<T> {
5829 inner: Arc<T>,
5830 accept_compression_encodings: EnabledCompressionEncodings,
5831 send_compression_encodings: EnabledCompressionEncodings,
5832 max_decoding_message_size: Option<usize>,
5833 max_encoding_message_size: Option<usize>,
5834 }
5835 impl<T> InboxServiceServer<T> {
5836 pub fn new(inner: T) -> Self {
5837 Self::from_arc(Arc::new(inner))
5838 }
5839 pub fn from_arc(inner: Arc<T>) -> Self {
5840 Self {
5841 inner,
5842 accept_compression_encodings: Default::default(),
5843 send_compression_encodings: Default::default(),
5844 max_decoding_message_size: None,
5845 max_encoding_message_size: None,
5846 }
5847 }
5848 pub fn with_interceptor<F>(
5849 inner: T,
5850 interceptor: F,
5851 ) -> InterceptedService<Self, F>
5852 where
5853 F: tonic::service::Interceptor,
5854 {
5855 InterceptedService::new(Self::new(inner), interceptor)
5856 }
5857 #[must_use]
5859 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5860 self.accept_compression_encodings.enable(encoding);
5861 self
5862 }
5863 #[must_use]
5865 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5866 self.send_compression_encodings.enable(encoding);
5867 self
5868 }
5869 #[must_use]
5873 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5874 self.max_decoding_message_size = Some(limit);
5875 self
5876 }
5877 #[must_use]
5881 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5882 self.max_encoding_message_size = Some(limit);
5883 self
5884 }
5885 }
5886 impl<T, B> tonic::codegen::Service<http::Request<B>> for InboxServiceServer<T>
5887 where
5888 T: InboxService,
5889 B: Body + std::marker::Send + 'static,
5890 B::Error: Into<StdError> + std::marker::Send + 'static,
5891 {
5892 type Response = http::Response<tonic::body::Body>;
5893 type Error = std::convert::Infallible;
5894 type Future = BoxFuture<Self::Response, Self::Error>;
5895 fn poll_ready(
5896 &mut self,
5897 _cx: &mut Context<'_>,
5898 ) -> Poll<std::result::Result<(), Self::Error>> {
5899 Poll::Ready(Ok(()))
5900 }
5901 fn call(&mut self, req: http::Request<B>) -> Self::Future {
5902 match req.uri().path() {
5903 "/pidgr.v1.InboxService/Sync" => {
5904 #[allow(non_camel_case_types)]
5905 struct SyncSvc<T: InboxService>(pub Arc<T>);
5906 impl<T: InboxService> tonic::server::UnaryService<super::SyncRequest>
5907 for SyncSvc<T> {
5908 type Response = super::SyncResponse;
5909 type Future = BoxFuture<
5910 tonic::Response<Self::Response>,
5911 tonic::Status,
5912 >;
5913 fn call(
5914 &mut self,
5915 request: tonic::Request<super::SyncRequest>,
5916 ) -> Self::Future {
5917 let inner = Arc::clone(&self.0);
5918 let fut = async move {
5919 <T as InboxService>::sync(&inner, request).await
5920 };
5921 Box::pin(fut)
5922 }
5923 }
5924 let accept_compression_encodings = self.accept_compression_encodings;
5925 let send_compression_encodings = self.send_compression_encodings;
5926 let max_decoding_message_size = self.max_decoding_message_size;
5927 let max_encoding_message_size = self.max_encoding_message_size;
5928 let inner = self.inner.clone();
5929 let fut = async move {
5930 let method = SyncSvc(inner);
5931 let codec = tonic_prost::ProstCodec::default();
5932 let mut grpc = tonic::server::Grpc::new(codec)
5933 .apply_compression_config(
5934 accept_compression_encodings,
5935 send_compression_encodings,
5936 )
5937 .apply_max_message_size_config(
5938 max_decoding_message_size,
5939 max_encoding_message_size,
5940 );
5941 let res = grpc.unary(method, req).await;
5942 Ok(res)
5943 };
5944 Box::pin(fut)
5945 }
5946 "/pidgr.v1.InboxService/MarkRead" => {
5947 #[allow(non_camel_case_types)]
5948 struct MarkReadSvc<T: InboxService>(pub Arc<T>);
5949 impl<
5950 T: InboxService,
5951 > tonic::server::UnaryService<super::MarkReadRequest>
5952 for MarkReadSvc<T> {
5953 type Response = super::MarkReadResponse;
5954 type Future = BoxFuture<
5955 tonic::Response<Self::Response>,
5956 tonic::Status,
5957 >;
5958 fn call(
5959 &mut self,
5960 request: tonic::Request<super::MarkReadRequest>,
5961 ) -> Self::Future {
5962 let inner = Arc::clone(&self.0);
5963 let fut = async move {
5964 <T as InboxService>::mark_read(&inner, request).await
5965 };
5966 Box::pin(fut)
5967 }
5968 }
5969 let accept_compression_encodings = self.accept_compression_encodings;
5970 let send_compression_encodings = self.send_compression_encodings;
5971 let max_decoding_message_size = self.max_decoding_message_size;
5972 let max_encoding_message_size = self.max_encoding_message_size;
5973 let inner = self.inner.clone();
5974 let fut = async move {
5975 let method = MarkReadSvc(inner);
5976 let codec = tonic_prost::ProstCodec::default();
5977 let mut grpc = tonic::server::Grpc::new(codec)
5978 .apply_compression_config(
5979 accept_compression_encodings,
5980 send_compression_encodings,
5981 )
5982 .apply_max_message_size_config(
5983 max_decoding_message_size,
5984 max_encoding_message_size,
5985 );
5986 let res = grpc.unary(method, req).await;
5987 Ok(res)
5988 };
5989 Box::pin(fut)
5990 }
5991 "/pidgr.v1.InboxService/GetMessage" => {
5992 #[allow(non_camel_case_types)]
5993 struct GetMessageSvc<T: InboxService>(pub Arc<T>);
5994 impl<
5995 T: InboxService,
5996 > tonic::server::UnaryService<super::GetMessageRequest>
5997 for GetMessageSvc<T> {
5998 type Response = super::GetMessageResponse;
5999 type Future = BoxFuture<
6000 tonic::Response<Self::Response>,
6001 tonic::Status,
6002 >;
6003 fn call(
6004 &mut self,
6005 request: tonic::Request<super::GetMessageRequest>,
6006 ) -> Self::Future {
6007 let inner = Arc::clone(&self.0);
6008 let fut = async move {
6009 <T as InboxService>::get_message(&inner, request).await
6010 };
6011 Box::pin(fut)
6012 }
6013 }
6014 let accept_compression_encodings = self.accept_compression_encodings;
6015 let send_compression_encodings = self.send_compression_encodings;
6016 let max_decoding_message_size = self.max_decoding_message_size;
6017 let max_encoding_message_size = self.max_encoding_message_size;
6018 let inner = self.inner.clone();
6019 let fut = async move {
6020 let method = GetMessageSvc(inner);
6021 let codec = tonic_prost::ProstCodec::default();
6022 let mut grpc = tonic::server::Grpc::new(codec)
6023 .apply_compression_config(
6024 accept_compression_encodings,
6025 send_compression_encodings,
6026 )
6027 .apply_max_message_size_config(
6028 max_decoding_message_size,
6029 max_encoding_message_size,
6030 );
6031 let res = grpc.unary(method, req).await;
6032 Ok(res)
6033 };
6034 Box::pin(fut)
6035 }
6036 _ => {
6037 Box::pin(async move {
6038 let mut response = http::Response::new(
6039 tonic::body::Body::default(),
6040 );
6041 let headers = response.headers_mut();
6042 headers
6043 .insert(
6044 tonic::Status::GRPC_STATUS,
6045 (tonic::Code::Unimplemented as i32).into(),
6046 );
6047 headers
6048 .insert(
6049 http::header::CONTENT_TYPE,
6050 tonic::metadata::GRPC_CONTENT_TYPE,
6051 );
6052 Ok(response)
6053 })
6054 }
6055 }
6056 }
6057 }
6058 impl<T> Clone for InboxServiceServer<T> {
6059 fn clone(&self) -> Self {
6060 let inner = self.inner.clone();
6061 Self {
6062 inner,
6063 accept_compression_encodings: self.accept_compression_encodings,
6064 send_compression_encodings: self.send_compression_encodings,
6065 max_decoding_message_size: self.max_decoding_message_size,
6066 max_encoding_message_size: self.max_encoding_message_size,
6067 }
6068 }
6069 }
6070 pub const SERVICE_NAME: &str = "pidgr.v1.InboxService";
6072 impl<T> tonic::server::NamedService for InboxServiceServer<T> {
6073 const NAME: &'static str = SERVICE_NAME;
6074 }
6075}
6076pub mod invite_link_service_client {
6078 #![allow(
6079 unused_variables,
6080 dead_code,
6081 missing_docs,
6082 clippy::wildcard_imports,
6083 clippy::let_unit_value,
6084 )]
6085 use tonic::codegen::*;
6086 use tonic::codegen::http::Uri;
6087 #[derive(Debug, Clone)]
6093 pub struct InviteLinkServiceClient<T> {
6094 inner: tonic::client::Grpc<T>,
6095 }
6096 impl InviteLinkServiceClient<tonic::transport::Channel> {
6097 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6099 where
6100 D: TryInto<tonic::transport::Endpoint>,
6101 D::Error: Into<StdError>,
6102 {
6103 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6104 Ok(Self::new(conn))
6105 }
6106 }
6107 impl<T> InviteLinkServiceClient<T>
6108 where
6109 T: tonic::client::GrpcService<tonic::body::Body>,
6110 T::Error: Into<StdError>,
6111 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6112 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6113 {
6114 pub fn new(inner: T) -> Self {
6115 let inner = tonic::client::Grpc::new(inner);
6116 Self { inner }
6117 }
6118 pub fn with_origin(inner: T, origin: Uri) -> Self {
6119 let inner = tonic::client::Grpc::with_origin(inner, origin);
6120 Self { inner }
6121 }
6122 pub fn with_interceptor<F>(
6123 inner: T,
6124 interceptor: F,
6125 ) -> InviteLinkServiceClient<InterceptedService<T, F>>
6126 where
6127 F: tonic::service::Interceptor,
6128 T::ResponseBody: Default,
6129 T: tonic::codegen::Service<
6130 http::Request<tonic::body::Body>,
6131 Response = http::Response<
6132 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6133 >,
6134 >,
6135 <T as tonic::codegen::Service<
6136 http::Request<tonic::body::Body>,
6137 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6138 {
6139 InviteLinkServiceClient::new(InterceptedService::new(inner, interceptor))
6140 }
6141 #[must_use]
6146 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6147 self.inner = self.inner.send_compressed(encoding);
6148 self
6149 }
6150 #[must_use]
6152 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6153 self.inner = self.inner.accept_compressed(encoding);
6154 self
6155 }
6156 #[must_use]
6160 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6161 self.inner = self.inner.max_decoding_message_size(limit);
6162 self
6163 }
6164 #[must_use]
6168 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6169 self.inner = self.inner.max_encoding_message_size(limit);
6170 self
6171 }
6172 pub async fn create_invite_link(
6176 &mut self,
6177 request: impl tonic::IntoRequest<super::CreateInviteLinkRequest>,
6178 ) -> std::result::Result<
6179 tonic::Response<super::CreateInviteLinkResponse>,
6180 tonic::Status,
6181 > {
6182 self.inner
6183 .ready()
6184 .await
6185 .map_err(|e| {
6186 tonic::Status::unknown(
6187 format!("Service was not ready: {}", e.into()),
6188 )
6189 })?;
6190 let codec = tonic_prost::ProstCodec::default();
6191 let path = http::uri::PathAndQuery::from_static(
6192 "/pidgr.v1.InviteLinkService/CreateInviteLink",
6193 );
6194 let mut req = request.into_request();
6195 req.extensions_mut()
6196 .insert(
6197 GrpcMethod::new("pidgr.v1.InviteLinkService", "CreateInviteLink"),
6198 );
6199 self.inner.unary(req, path, codec).await
6200 }
6201 pub async fn list_invite_links(
6205 &mut self,
6206 request: impl tonic::IntoRequest<super::ListInviteLinksRequest>,
6207 ) -> std::result::Result<
6208 tonic::Response<super::ListInviteLinksResponse>,
6209 tonic::Status,
6210 > {
6211 self.inner
6212 .ready()
6213 .await
6214 .map_err(|e| {
6215 tonic::Status::unknown(
6216 format!("Service was not ready: {}", e.into()),
6217 )
6218 })?;
6219 let codec = tonic_prost::ProstCodec::default();
6220 let path = http::uri::PathAndQuery::from_static(
6221 "/pidgr.v1.InviteLinkService/ListInviteLinks",
6222 );
6223 let mut req = request.into_request();
6224 req.extensions_mut()
6225 .insert(
6226 GrpcMethod::new("pidgr.v1.InviteLinkService", "ListInviteLinks"),
6227 );
6228 self.inner.unary(req, path, codec).await
6229 }
6230 pub async fn revoke_invite_link(
6234 &mut self,
6235 request: impl tonic::IntoRequest<super::RevokeInviteLinkRequest>,
6236 ) -> std::result::Result<
6237 tonic::Response<super::RevokeInviteLinkResponse>,
6238 tonic::Status,
6239 > {
6240 self.inner
6241 .ready()
6242 .await
6243 .map_err(|e| {
6244 tonic::Status::unknown(
6245 format!("Service was not ready: {}", e.into()),
6246 )
6247 })?;
6248 let codec = tonic_prost::ProstCodec::default();
6249 let path = http::uri::PathAndQuery::from_static(
6250 "/pidgr.v1.InviteLinkService/RevokeInviteLink",
6251 );
6252 let mut req = request.into_request();
6253 req.extensions_mut()
6254 .insert(
6255 GrpcMethod::new("pidgr.v1.InviteLinkService", "RevokeInviteLink"),
6256 );
6257 self.inner.unary(req, path, codec).await
6258 }
6259 pub async fn validate_invite_link(
6265 &mut self,
6266 request: impl tonic::IntoRequest<super::ValidateInviteLinkRequest>,
6267 ) -> std::result::Result<
6268 tonic::Response<super::ValidateInviteLinkResponse>,
6269 tonic::Status,
6270 > {
6271 self.inner
6272 .ready()
6273 .await
6274 .map_err(|e| {
6275 tonic::Status::unknown(
6276 format!("Service was not ready: {}", e.into()),
6277 )
6278 })?;
6279 let codec = tonic_prost::ProstCodec::default();
6280 let path = http::uri::PathAndQuery::from_static(
6281 "/pidgr.v1.InviteLinkService/ValidateInviteLink",
6282 );
6283 let mut req = request.into_request();
6284 req.extensions_mut()
6285 .insert(
6286 GrpcMethod::new("pidgr.v1.InviteLinkService", "ValidateInviteLink"),
6287 );
6288 self.inner.unary(req, path, codec).await
6289 }
6290 pub async fn redeem_invite_link(
6295 &mut self,
6296 request: impl tonic::IntoRequest<super::RedeemInviteLinkRequest>,
6297 ) -> std::result::Result<
6298 tonic::Response<super::RedeemInviteLinkResponse>,
6299 tonic::Status,
6300 > {
6301 self.inner
6302 .ready()
6303 .await
6304 .map_err(|e| {
6305 tonic::Status::unknown(
6306 format!("Service was not ready: {}", e.into()),
6307 )
6308 })?;
6309 let codec = tonic_prost::ProstCodec::default();
6310 let path = http::uri::PathAndQuery::from_static(
6311 "/pidgr.v1.InviteLinkService/RedeemInviteLink",
6312 );
6313 let mut req = request.into_request();
6314 req.extensions_mut()
6315 .insert(
6316 GrpcMethod::new("pidgr.v1.InviteLinkService", "RedeemInviteLink"),
6317 );
6318 self.inner.unary(req, path, codec).await
6319 }
6320 }
6321}
6322pub mod invite_link_service_server {
6324 #![allow(
6325 unused_variables,
6326 dead_code,
6327 missing_docs,
6328 clippy::wildcard_imports,
6329 clippy::let_unit_value,
6330 )]
6331 use tonic::codegen::*;
6332 #[async_trait]
6334 pub trait InviteLinkService: std::marker::Send + std::marker::Sync + 'static {
6335 async fn create_invite_link(
6339 &self,
6340 request: tonic::Request<super::CreateInviteLinkRequest>,
6341 ) -> std::result::Result<
6342 tonic::Response<super::CreateInviteLinkResponse>,
6343 tonic::Status,
6344 >;
6345 async fn list_invite_links(
6349 &self,
6350 request: tonic::Request<super::ListInviteLinksRequest>,
6351 ) -> std::result::Result<
6352 tonic::Response<super::ListInviteLinksResponse>,
6353 tonic::Status,
6354 >;
6355 async fn revoke_invite_link(
6359 &self,
6360 request: tonic::Request<super::RevokeInviteLinkRequest>,
6361 ) -> std::result::Result<
6362 tonic::Response<super::RevokeInviteLinkResponse>,
6363 tonic::Status,
6364 >;
6365 async fn validate_invite_link(
6371 &self,
6372 request: tonic::Request<super::ValidateInviteLinkRequest>,
6373 ) -> std::result::Result<
6374 tonic::Response<super::ValidateInviteLinkResponse>,
6375 tonic::Status,
6376 >;
6377 async fn redeem_invite_link(
6382 &self,
6383 request: tonic::Request<super::RedeemInviteLinkRequest>,
6384 ) -> std::result::Result<
6385 tonic::Response<super::RedeemInviteLinkResponse>,
6386 tonic::Status,
6387 >;
6388 }
6389 #[derive(Debug)]
6395 pub struct InviteLinkServiceServer<T> {
6396 inner: Arc<T>,
6397 accept_compression_encodings: EnabledCompressionEncodings,
6398 send_compression_encodings: EnabledCompressionEncodings,
6399 max_decoding_message_size: Option<usize>,
6400 max_encoding_message_size: Option<usize>,
6401 }
6402 impl<T> InviteLinkServiceServer<T> {
6403 pub fn new(inner: T) -> Self {
6404 Self::from_arc(Arc::new(inner))
6405 }
6406 pub fn from_arc(inner: Arc<T>) -> Self {
6407 Self {
6408 inner,
6409 accept_compression_encodings: Default::default(),
6410 send_compression_encodings: Default::default(),
6411 max_decoding_message_size: None,
6412 max_encoding_message_size: None,
6413 }
6414 }
6415 pub fn with_interceptor<F>(
6416 inner: T,
6417 interceptor: F,
6418 ) -> InterceptedService<Self, F>
6419 where
6420 F: tonic::service::Interceptor,
6421 {
6422 InterceptedService::new(Self::new(inner), interceptor)
6423 }
6424 #[must_use]
6426 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6427 self.accept_compression_encodings.enable(encoding);
6428 self
6429 }
6430 #[must_use]
6432 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6433 self.send_compression_encodings.enable(encoding);
6434 self
6435 }
6436 #[must_use]
6440 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6441 self.max_decoding_message_size = Some(limit);
6442 self
6443 }
6444 #[must_use]
6448 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6449 self.max_encoding_message_size = Some(limit);
6450 self
6451 }
6452 }
6453 impl<T, B> tonic::codegen::Service<http::Request<B>> for InviteLinkServiceServer<T>
6454 where
6455 T: InviteLinkService,
6456 B: Body + std::marker::Send + 'static,
6457 B::Error: Into<StdError> + std::marker::Send + 'static,
6458 {
6459 type Response = http::Response<tonic::body::Body>;
6460 type Error = std::convert::Infallible;
6461 type Future = BoxFuture<Self::Response, Self::Error>;
6462 fn poll_ready(
6463 &mut self,
6464 _cx: &mut Context<'_>,
6465 ) -> Poll<std::result::Result<(), Self::Error>> {
6466 Poll::Ready(Ok(()))
6467 }
6468 fn call(&mut self, req: http::Request<B>) -> Self::Future {
6469 match req.uri().path() {
6470 "/pidgr.v1.InviteLinkService/CreateInviteLink" => {
6471 #[allow(non_camel_case_types)]
6472 struct CreateInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
6473 impl<
6474 T: InviteLinkService,
6475 > tonic::server::UnaryService<super::CreateInviteLinkRequest>
6476 for CreateInviteLinkSvc<T> {
6477 type Response = super::CreateInviteLinkResponse;
6478 type Future = BoxFuture<
6479 tonic::Response<Self::Response>,
6480 tonic::Status,
6481 >;
6482 fn call(
6483 &mut self,
6484 request: tonic::Request<super::CreateInviteLinkRequest>,
6485 ) -> Self::Future {
6486 let inner = Arc::clone(&self.0);
6487 let fut = async move {
6488 <T as InviteLinkService>::create_invite_link(
6489 &inner,
6490 request,
6491 )
6492 .await
6493 };
6494 Box::pin(fut)
6495 }
6496 }
6497 let accept_compression_encodings = self.accept_compression_encodings;
6498 let send_compression_encodings = self.send_compression_encodings;
6499 let max_decoding_message_size = self.max_decoding_message_size;
6500 let max_encoding_message_size = self.max_encoding_message_size;
6501 let inner = self.inner.clone();
6502 let fut = async move {
6503 let method = CreateInviteLinkSvc(inner);
6504 let codec = tonic_prost::ProstCodec::default();
6505 let mut grpc = tonic::server::Grpc::new(codec)
6506 .apply_compression_config(
6507 accept_compression_encodings,
6508 send_compression_encodings,
6509 )
6510 .apply_max_message_size_config(
6511 max_decoding_message_size,
6512 max_encoding_message_size,
6513 );
6514 let res = grpc.unary(method, req).await;
6515 Ok(res)
6516 };
6517 Box::pin(fut)
6518 }
6519 "/pidgr.v1.InviteLinkService/ListInviteLinks" => {
6520 #[allow(non_camel_case_types)]
6521 struct ListInviteLinksSvc<T: InviteLinkService>(pub Arc<T>);
6522 impl<
6523 T: InviteLinkService,
6524 > tonic::server::UnaryService<super::ListInviteLinksRequest>
6525 for ListInviteLinksSvc<T> {
6526 type Response = super::ListInviteLinksResponse;
6527 type Future = BoxFuture<
6528 tonic::Response<Self::Response>,
6529 tonic::Status,
6530 >;
6531 fn call(
6532 &mut self,
6533 request: tonic::Request<super::ListInviteLinksRequest>,
6534 ) -> Self::Future {
6535 let inner = Arc::clone(&self.0);
6536 let fut = async move {
6537 <T as InviteLinkService>::list_invite_links(&inner, request)
6538 .await
6539 };
6540 Box::pin(fut)
6541 }
6542 }
6543 let accept_compression_encodings = self.accept_compression_encodings;
6544 let send_compression_encodings = self.send_compression_encodings;
6545 let max_decoding_message_size = self.max_decoding_message_size;
6546 let max_encoding_message_size = self.max_encoding_message_size;
6547 let inner = self.inner.clone();
6548 let fut = async move {
6549 let method = ListInviteLinksSvc(inner);
6550 let codec = tonic_prost::ProstCodec::default();
6551 let mut grpc = tonic::server::Grpc::new(codec)
6552 .apply_compression_config(
6553 accept_compression_encodings,
6554 send_compression_encodings,
6555 )
6556 .apply_max_message_size_config(
6557 max_decoding_message_size,
6558 max_encoding_message_size,
6559 );
6560 let res = grpc.unary(method, req).await;
6561 Ok(res)
6562 };
6563 Box::pin(fut)
6564 }
6565 "/pidgr.v1.InviteLinkService/RevokeInviteLink" => {
6566 #[allow(non_camel_case_types)]
6567 struct RevokeInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
6568 impl<
6569 T: InviteLinkService,
6570 > tonic::server::UnaryService<super::RevokeInviteLinkRequest>
6571 for RevokeInviteLinkSvc<T> {
6572 type Response = super::RevokeInviteLinkResponse;
6573 type Future = BoxFuture<
6574 tonic::Response<Self::Response>,
6575 tonic::Status,
6576 >;
6577 fn call(
6578 &mut self,
6579 request: tonic::Request<super::RevokeInviteLinkRequest>,
6580 ) -> Self::Future {
6581 let inner = Arc::clone(&self.0);
6582 let fut = async move {
6583 <T as InviteLinkService>::revoke_invite_link(
6584 &inner,
6585 request,
6586 )
6587 .await
6588 };
6589 Box::pin(fut)
6590 }
6591 }
6592 let accept_compression_encodings = self.accept_compression_encodings;
6593 let send_compression_encodings = self.send_compression_encodings;
6594 let max_decoding_message_size = self.max_decoding_message_size;
6595 let max_encoding_message_size = self.max_encoding_message_size;
6596 let inner = self.inner.clone();
6597 let fut = async move {
6598 let method = RevokeInviteLinkSvc(inner);
6599 let codec = tonic_prost::ProstCodec::default();
6600 let mut grpc = tonic::server::Grpc::new(codec)
6601 .apply_compression_config(
6602 accept_compression_encodings,
6603 send_compression_encodings,
6604 )
6605 .apply_max_message_size_config(
6606 max_decoding_message_size,
6607 max_encoding_message_size,
6608 );
6609 let res = grpc.unary(method, req).await;
6610 Ok(res)
6611 };
6612 Box::pin(fut)
6613 }
6614 "/pidgr.v1.InviteLinkService/ValidateInviteLink" => {
6615 #[allow(non_camel_case_types)]
6616 struct ValidateInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
6617 impl<
6618 T: InviteLinkService,
6619 > tonic::server::UnaryService<super::ValidateInviteLinkRequest>
6620 for ValidateInviteLinkSvc<T> {
6621 type Response = super::ValidateInviteLinkResponse;
6622 type Future = BoxFuture<
6623 tonic::Response<Self::Response>,
6624 tonic::Status,
6625 >;
6626 fn call(
6627 &mut self,
6628 request: tonic::Request<super::ValidateInviteLinkRequest>,
6629 ) -> Self::Future {
6630 let inner = Arc::clone(&self.0);
6631 let fut = async move {
6632 <T as InviteLinkService>::validate_invite_link(
6633 &inner,
6634 request,
6635 )
6636 .await
6637 };
6638 Box::pin(fut)
6639 }
6640 }
6641 let accept_compression_encodings = self.accept_compression_encodings;
6642 let send_compression_encodings = self.send_compression_encodings;
6643 let max_decoding_message_size = self.max_decoding_message_size;
6644 let max_encoding_message_size = self.max_encoding_message_size;
6645 let inner = self.inner.clone();
6646 let fut = async move {
6647 let method = ValidateInviteLinkSvc(inner);
6648 let codec = tonic_prost::ProstCodec::default();
6649 let mut grpc = tonic::server::Grpc::new(codec)
6650 .apply_compression_config(
6651 accept_compression_encodings,
6652 send_compression_encodings,
6653 )
6654 .apply_max_message_size_config(
6655 max_decoding_message_size,
6656 max_encoding_message_size,
6657 );
6658 let res = grpc.unary(method, req).await;
6659 Ok(res)
6660 };
6661 Box::pin(fut)
6662 }
6663 "/pidgr.v1.InviteLinkService/RedeemInviteLink" => {
6664 #[allow(non_camel_case_types)]
6665 struct RedeemInviteLinkSvc<T: InviteLinkService>(pub Arc<T>);
6666 impl<
6667 T: InviteLinkService,
6668 > tonic::server::UnaryService<super::RedeemInviteLinkRequest>
6669 for RedeemInviteLinkSvc<T> {
6670 type Response = super::RedeemInviteLinkResponse;
6671 type Future = BoxFuture<
6672 tonic::Response<Self::Response>,
6673 tonic::Status,
6674 >;
6675 fn call(
6676 &mut self,
6677 request: tonic::Request<super::RedeemInviteLinkRequest>,
6678 ) -> Self::Future {
6679 let inner = Arc::clone(&self.0);
6680 let fut = async move {
6681 <T as InviteLinkService>::redeem_invite_link(
6682 &inner,
6683 request,
6684 )
6685 .await
6686 };
6687 Box::pin(fut)
6688 }
6689 }
6690 let accept_compression_encodings = self.accept_compression_encodings;
6691 let send_compression_encodings = self.send_compression_encodings;
6692 let max_decoding_message_size = self.max_decoding_message_size;
6693 let max_encoding_message_size = self.max_encoding_message_size;
6694 let inner = self.inner.clone();
6695 let fut = async move {
6696 let method = RedeemInviteLinkSvc(inner);
6697 let codec = tonic_prost::ProstCodec::default();
6698 let mut grpc = tonic::server::Grpc::new(codec)
6699 .apply_compression_config(
6700 accept_compression_encodings,
6701 send_compression_encodings,
6702 )
6703 .apply_max_message_size_config(
6704 max_decoding_message_size,
6705 max_encoding_message_size,
6706 );
6707 let res = grpc.unary(method, req).await;
6708 Ok(res)
6709 };
6710 Box::pin(fut)
6711 }
6712 _ => {
6713 Box::pin(async move {
6714 let mut response = http::Response::new(
6715 tonic::body::Body::default(),
6716 );
6717 let headers = response.headers_mut();
6718 headers
6719 .insert(
6720 tonic::Status::GRPC_STATUS,
6721 (tonic::Code::Unimplemented as i32).into(),
6722 );
6723 headers
6724 .insert(
6725 http::header::CONTENT_TYPE,
6726 tonic::metadata::GRPC_CONTENT_TYPE,
6727 );
6728 Ok(response)
6729 })
6730 }
6731 }
6732 }
6733 }
6734 impl<T> Clone for InviteLinkServiceServer<T> {
6735 fn clone(&self) -> Self {
6736 let inner = self.inner.clone();
6737 Self {
6738 inner,
6739 accept_compression_encodings: self.accept_compression_encodings,
6740 send_compression_encodings: self.send_compression_encodings,
6741 max_decoding_message_size: self.max_decoding_message_size,
6742 max_encoding_message_size: self.max_encoding_message_size,
6743 }
6744 }
6745 }
6746 pub const SERVICE_NAME: &str = "pidgr.v1.InviteLinkService";
6748 impl<T> tonic::server::NamedService for InviteLinkServiceServer<T> {
6749 const NAME: &'static str = SERVICE_NAME;
6750 }
6751}
6752pub mod member_service_client {
6754 #![allow(
6755 unused_variables,
6756 dead_code,
6757 missing_docs,
6758 clippy::wildcard_imports,
6759 clippy::let_unit_value,
6760 )]
6761 use tonic::codegen::*;
6762 use tonic::codegen::http::Uri;
6763 #[derive(Debug, Clone)]
6767 pub struct MemberServiceClient<T> {
6768 inner: tonic::client::Grpc<T>,
6769 }
6770 impl MemberServiceClient<tonic::transport::Channel> {
6771 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6773 where
6774 D: TryInto<tonic::transport::Endpoint>,
6775 D::Error: Into<StdError>,
6776 {
6777 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6778 Ok(Self::new(conn))
6779 }
6780 }
6781 impl<T> MemberServiceClient<T>
6782 where
6783 T: tonic::client::GrpcService<tonic::body::Body>,
6784 T::Error: Into<StdError>,
6785 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6786 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6787 {
6788 pub fn new(inner: T) -> Self {
6789 let inner = tonic::client::Grpc::new(inner);
6790 Self { inner }
6791 }
6792 pub fn with_origin(inner: T, origin: Uri) -> Self {
6793 let inner = tonic::client::Grpc::with_origin(inner, origin);
6794 Self { inner }
6795 }
6796 pub fn with_interceptor<F>(
6797 inner: T,
6798 interceptor: F,
6799 ) -> MemberServiceClient<InterceptedService<T, F>>
6800 where
6801 F: tonic::service::Interceptor,
6802 T::ResponseBody: Default,
6803 T: tonic::codegen::Service<
6804 http::Request<tonic::body::Body>,
6805 Response = http::Response<
6806 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6807 >,
6808 >,
6809 <T as tonic::codegen::Service<
6810 http::Request<tonic::body::Body>,
6811 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6812 {
6813 MemberServiceClient::new(InterceptedService::new(inner, interceptor))
6814 }
6815 #[must_use]
6820 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6821 self.inner = self.inner.send_compressed(encoding);
6822 self
6823 }
6824 #[must_use]
6826 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6827 self.inner = self.inner.accept_compressed(encoding);
6828 self
6829 }
6830 #[must_use]
6834 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6835 self.inner = self.inner.max_decoding_message_size(limit);
6836 self
6837 }
6838 #[must_use]
6842 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6843 self.inner = self.inner.max_encoding_message_size(limit);
6844 self
6845 }
6846 pub async fn invite_user(
6850 &mut self,
6851 request: impl tonic::IntoRequest<super::InviteUserRequest>,
6852 ) -> std::result::Result<
6853 tonic::Response<super::InviteUserResponse>,
6854 tonic::Status,
6855 > {
6856 self.inner
6857 .ready()
6858 .await
6859 .map_err(|e| {
6860 tonic::Status::unknown(
6861 format!("Service was not ready: {}", e.into()),
6862 )
6863 })?;
6864 let codec = tonic_prost::ProstCodec::default();
6865 let path = http::uri::PathAndQuery::from_static(
6866 "/pidgr.v1.MemberService/InviteUser",
6867 );
6868 let mut req = request.into_request();
6869 req.extensions_mut()
6870 .insert(GrpcMethod::new("pidgr.v1.MemberService", "InviteUser"));
6871 self.inner.unary(req, path, codec).await
6872 }
6873 pub async fn get_user(
6878 &mut self,
6879 request: impl tonic::IntoRequest<super::GetUserRequest>,
6880 ) -> std::result::Result<
6881 tonic::Response<super::GetUserResponse>,
6882 tonic::Status,
6883 > {
6884 self.inner
6885 .ready()
6886 .await
6887 .map_err(|e| {
6888 tonic::Status::unknown(
6889 format!("Service was not ready: {}", e.into()),
6890 )
6891 })?;
6892 let codec = tonic_prost::ProstCodec::default();
6893 let path = http::uri::PathAndQuery::from_static(
6894 "/pidgr.v1.MemberService/GetUser",
6895 );
6896 let mut req = request.into_request();
6897 req.extensions_mut()
6898 .insert(GrpcMethod::new("pidgr.v1.MemberService", "GetUser"));
6899 self.inner.unary(req, path, codec).await
6900 }
6901 pub async fn list_users(
6905 &mut self,
6906 request: impl tonic::IntoRequest<super::ListUsersRequest>,
6907 ) -> std::result::Result<
6908 tonic::Response<super::ListUsersResponse>,
6909 tonic::Status,
6910 > {
6911 self.inner
6912 .ready()
6913 .await
6914 .map_err(|e| {
6915 tonic::Status::unknown(
6916 format!("Service was not ready: {}", e.into()),
6917 )
6918 })?;
6919 let codec = tonic_prost::ProstCodec::default();
6920 let path = http::uri::PathAndQuery::from_static(
6921 "/pidgr.v1.MemberService/ListUsers",
6922 );
6923 let mut req = request.into_request();
6924 req.extensions_mut()
6925 .insert(GrpcMethod::new("pidgr.v1.MemberService", "ListUsers"));
6926 self.inner.unary(req, path, codec).await
6927 }
6928 pub async fn update_user_role(
6932 &mut self,
6933 request: impl tonic::IntoRequest<super::UpdateUserRoleRequest>,
6934 ) -> std::result::Result<
6935 tonic::Response<super::UpdateUserRoleResponse>,
6936 tonic::Status,
6937 > {
6938 self.inner
6939 .ready()
6940 .await
6941 .map_err(|e| {
6942 tonic::Status::unknown(
6943 format!("Service was not ready: {}", e.into()),
6944 )
6945 })?;
6946 let codec = tonic_prost::ProstCodec::default();
6947 let path = http::uri::PathAndQuery::from_static(
6948 "/pidgr.v1.MemberService/UpdateUserRole",
6949 );
6950 let mut req = request.into_request();
6951 req.extensions_mut()
6952 .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserRole"));
6953 self.inner.unary(req, path, codec).await
6954 }
6955 pub async fn deactivate_user(
6959 &mut self,
6960 request: impl tonic::IntoRequest<super::DeactivateUserRequest>,
6961 ) -> std::result::Result<
6962 tonic::Response<super::DeactivateUserResponse>,
6963 tonic::Status,
6964 > {
6965 self.inner
6966 .ready()
6967 .await
6968 .map_err(|e| {
6969 tonic::Status::unknown(
6970 format!("Service was not ready: {}", e.into()),
6971 )
6972 })?;
6973 let codec = tonic_prost::ProstCodec::default();
6974 let path = http::uri::PathAndQuery::from_static(
6975 "/pidgr.v1.MemberService/DeactivateUser",
6976 );
6977 let mut req = request.into_request();
6978 req.extensions_mut()
6979 .insert(GrpcMethod::new("pidgr.v1.MemberService", "DeactivateUser"));
6980 self.inner.unary(req, path, codec).await
6981 }
6982 pub async fn reactivate_user(
6987 &mut self,
6988 request: impl tonic::IntoRequest<super::ReactivateUserRequest>,
6989 ) -> std::result::Result<
6990 tonic::Response<super::ReactivateUserResponse>,
6991 tonic::Status,
6992 > {
6993 self.inner
6994 .ready()
6995 .await
6996 .map_err(|e| {
6997 tonic::Status::unknown(
6998 format!("Service was not ready: {}", e.into()),
6999 )
7000 })?;
7001 let codec = tonic_prost::ProstCodec::default();
7002 let path = http::uri::PathAndQuery::from_static(
7003 "/pidgr.v1.MemberService/ReactivateUser",
7004 );
7005 let mut req = request.into_request();
7006 req.extensions_mut()
7007 .insert(GrpcMethod::new("pidgr.v1.MemberService", "ReactivateUser"));
7008 self.inner.unary(req, path, codec).await
7009 }
7010 pub async fn revoke_invite(
7015 &mut self,
7016 request: impl tonic::IntoRequest<super::RevokeInviteRequest>,
7017 ) -> std::result::Result<
7018 tonic::Response<super::RevokeInviteResponse>,
7019 tonic::Status,
7020 > {
7021 self.inner
7022 .ready()
7023 .await
7024 .map_err(|e| {
7025 tonic::Status::unknown(
7026 format!("Service was not ready: {}", e.into()),
7027 )
7028 })?;
7029 let codec = tonic_prost::ProstCodec::default();
7030 let path = http::uri::PathAndQuery::from_static(
7031 "/pidgr.v1.MemberService/RevokeInvite",
7032 );
7033 let mut req = request.into_request();
7034 req.extensions_mut()
7035 .insert(GrpcMethod::new("pidgr.v1.MemberService", "RevokeInvite"));
7036 self.inner.unary(req, path, codec).await
7037 }
7038 pub async fn update_user_profile(
7043 &mut self,
7044 request: impl tonic::IntoRequest<super::UpdateUserProfileRequest>,
7045 ) -> std::result::Result<
7046 tonic::Response<super::UpdateUserProfileResponse>,
7047 tonic::Status,
7048 > {
7049 self.inner
7050 .ready()
7051 .await
7052 .map_err(|e| {
7053 tonic::Status::unknown(
7054 format!("Service was not ready: {}", e.into()),
7055 )
7056 })?;
7057 let codec = tonic_prost::ProstCodec::default();
7058 let path = http::uri::PathAndQuery::from_static(
7059 "/pidgr.v1.MemberService/UpdateUserProfile",
7060 );
7061 let mut req = request.into_request();
7062 req.extensions_mut()
7063 .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserProfile"));
7064 self.inner.unary(req, path, codec).await
7065 }
7066 pub async fn get_user_settings(
7070 &mut self,
7071 request: impl tonic::IntoRequest<super::GetUserSettingsRequest>,
7072 ) -> std::result::Result<
7073 tonic::Response<super::GetUserSettingsResponse>,
7074 tonic::Status,
7075 > {
7076 self.inner
7077 .ready()
7078 .await
7079 .map_err(|e| {
7080 tonic::Status::unknown(
7081 format!("Service was not ready: {}", e.into()),
7082 )
7083 })?;
7084 let codec = tonic_prost::ProstCodec::default();
7085 let path = http::uri::PathAndQuery::from_static(
7086 "/pidgr.v1.MemberService/GetUserSettings",
7087 );
7088 let mut req = request.into_request();
7089 req.extensions_mut()
7090 .insert(GrpcMethod::new("pidgr.v1.MemberService", "GetUserSettings"));
7091 self.inner.unary(req, path, codec).await
7092 }
7093 pub async fn update_user_settings(
7098 &mut self,
7099 request: impl tonic::IntoRequest<super::UpdateUserSettingsRequest>,
7100 ) -> std::result::Result<
7101 tonic::Response<super::UpdateUserSettingsResponse>,
7102 tonic::Status,
7103 > {
7104 self.inner
7105 .ready()
7106 .await
7107 .map_err(|e| {
7108 tonic::Status::unknown(
7109 format!("Service was not ready: {}", e.into()),
7110 )
7111 })?;
7112 let codec = tonic_prost::ProstCodec::default();
7113 let path = http::uri::PathAndQuery::from_static(
7114 "/pidgr.v1.MemberService/UpdateUserSettings",
7115 );
7116 let mut req = request.into_request();
7117 req.extensions_mut()
7118 .insert(GrpcMethod::new("pidgr.v1.MemberService", "UpdateUserSettings"));
7119 self.inner.unary(req, path, codec).await
7120 }
7121 pub async fn bulk_invite_users(
7127 &mut self,
7128 request: impl tonic::IntoRequest<super::BulkInviteUsersRequest>,
7129 ) -> std::result::Result<
7130 tonic::Response<super::BulkInviteUsersResponse>,
7131 tonic::Status,
7132 > {
7133 self.inner
7134 .ready()
7135 .await
7136 .map_err(|e| {
7137 tonic::Status::unknown(
7138 format!("Service was not ready: {}", e.into()),
7139 )
7140 })?;
7141 let codec = tonic_prost::ProstCodec::default();
7142 let path = http::uri::PathAndQuery::from_static(
7143 "/pidgr.v1.MemberService/BulkInviteUsers",
7144 );
7145 let mut req = request.into_request();
7146 req.extensions_mut()
7147 .insert(GrpcMethod::new("pidgr.v1.MemberService", "BulkInviteUsers"));
7148 self.inner.unary(req, path, codec).await
7149 }
7150 pub async fn confirm_passkey_enrollment(
7156 &mut self,
7157 request: impl tonic::IntoRequest<super::ConfirmPasskeyEnrollmentRequest>,
7158 ) -> std::result::Result<
7159 tonic::Response<super::ConfirmPasskeyEnrollmentResponse>,
7160 tonic::Status,
7161 > {
7162 self.inner
7163 .ready()
7164 .await
7165 .map_err(|e| {
7166 tonic::Status::unknown(
7167 format!("Service was not ready: {}", e.into()),
7168 )
7169 })?;
7170 let codec = tonic_prost::ProstCodec::default();
7171 let path = http::uri::PathAndQuery::from_static(
7172 "/pidgr.v1.MemberService/ConfirmPasskeyEnrollment",
7173 );
7174 let mut req = request.into_request();
7175 req.extensions_mut()
7176 .insert(
7177 GrpcMethod::new("pidgr.v1.MemberService", "ConfirmPasskeyEnrollment"),
7178 );
7179 self.inner.unary(req, path, codec).await
7180 }
7181 }
7182}
7183pub mod member_service_server {
7185 #![allow(
7186 unused_variables,
7187 dead_code,
7188 missing_docs,
7189 clippy::wildcard_imports,
7190 clippy::let_unit_value,
7191 )]
7192 use tonic::codegen::*;
7193 #[async_trait]
7195 pub trait MemberService: std::marker::Send + std::marker::Sync + 'static {
7196 async fn invite_user(
7200 &self,
7201 request: tonic::Request<super::InviteUserRequest>,
7202 ) -> std::result::Result<
7203 tonic::Response<super::InviteUserResponse>,
7204 tonic::Status,
7205 >;
7206 async fn get_user(
7211 &self,
7212 request: tonic::Request<super::GetUserRequest>,
7213 ) -> std::result::Result<tonic::Response<super::GetUserResponse>, tonic::Status>;
7214 async fn list_users(
7218 &self,
7219 request: tonic::Request<super::ListUsersRequest>,
7220 ) -> std::result::Result<
7221 tonic::Response<super::ListUsersResponse>,
7222 tonic::Status,
7223 >;
7224 async fn update_user_role(
7228 &self,
7229 request: tonic::Request<super::UpdateUserRoleRequest>,
7230 ) -> std::result::Result<
7231 tonic::Response<super::UpdateUserRoleResponse>,
7232 tonic::Status,
7233 >;
7234 async fn deactivate_user(
7238 &self,
7239 request: tonic::Request<super::DeactivateUserRequest>,
7240 ) -> std::result::Result<
7241 tonic::Response<super::DeactivateUserResponse>,
7242 tonic::Status,
7243 >;
7244 async fn reactivate_user(
7249 &self,
7250 request: tonic::Request<super::ReactivateUserRequest>,
7251 ) -> std::result::Result<
7252 tonic::Response<super::ReactivateUserResponse>,
7253 tonic::Status,
7254 >;
7255 async fn revoke_invite(
7260 &self,
7261 request: tonic::Request<super::RevokeInviteRequest>,
7262 ) -> std::result::Result<
7263 tonic::Response<super::RevokeInviteResponse>,
7264 tonic::Status,
7265 >;
7266 async fn update_user_profile(
7271 &self,
7272 request: tonic::Request<super::UpdateUserProfileRequest>,
7273 ) -> std::result::Result<
7274 tonic::Response<super::UpdateUserProfileResponse>,
7275 tonic::Status,
7276 >;
7277 async fn get_user_settings(
7281 &self,
7282 request: tonic::Request<super::GetUserSettingsRequest>,
7283 ) -> std::result::Result<
7284 tonic::Response<super::GetUserSettingsResponse>,
7285 tonic::Status,
7286 >;
7287 async fn update_user_settings(
7292 &self,
7293 request: tonic::Request<super::UpdateUserSettingsRequest>,
7294 ) -> std::result::Result<
7295 tonic::Response<super::UpdateUserSettingsResponse>,
7296 tonic::Status,
7297 >;
7298 async fn bulk_invite_users(
7304 &self,
7305 request: tonic::Request<super::BulkInviteUsersRequest>,
7306 ) -> std::result::Result<
7307 tonic::Response<super::BulkInviteUsersResponse>,
7308 tonic::Status,
7309 >;
7310 async fn confirm_passkey_enrollment(
7316 &self,
7317 request: tonic::Request<super::ConfirmPasskeyEnrollmentRequest>,
7318 ) -> std::result::Result<
7319 tonic::Response<super::ConfirmPasskeyEnrollmentResponse>,
7320 tonic::Status,
7321 >;
7322 }
7323 #[derive(Debug)]
7327 pub struct MemberServiceServer<T> {
7328 inner: Arc<T>,
7329 accept_compression_encodings: EnabledCompressionEncodings,
7330 send_compression_encodings: EnabledCompressionEncodings,
7331 max_decoding_message_size: Option<usize>,
7332 max_encoding_message_size: Option<usize>,
7333 }
7334 impl<T> MemberServiceServer<T> {
7335 pub fn new(inner: T) -> Self {
7336 Self::from_arc(Arc::new(inner))
7337 }
7338 pub fn from_arc(inner: Arc<T>) -> Self {
7339 Self {
7340 inner,
7341 accept_compression_encodings: Default::default(),
7342 send_compression_encodings: Default::default(),
7343 max_decoding_message_size: None,
7344 max_encoding_message_size: None,
7345 }
7346 }
7347 pub fn with_interceptor<F>(
7348 inner: T,
7349 interceptor: F,
7350 ) -> InterceptedService<Self, F>
7351 where
7352 F: tonic::service::Interceptor,
7353 {
7354 InterceptedService::new(Self::new(inner), interceptor)
7355 }
7356 #[must_use]
7358 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7359 self.accept_compression_encodings.enable(encoding);
7360 self
7361 }
7362 #[must_use]
7364 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7365 self.send_compression_encodings.enable(encoding);
7366 self
7367 }
7368 #[must_use]
7372 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7373 self.max_decoding_message_size = Some(limit);
7374 self
7375 }
7376 #[must_use]
7380 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7381 self.max_encoding_message_size = Some(limit);
7382 self
7383 }
7384 }
7385 impl<T, B> tonic::codegen::Service<http::Request<B>> for MemberServiceServer<T>
7386 where
7387 T: MemberService,
7388 B: Body + std::marker::Send + 'static,
7389 B::Error: Into<StdError> + std::marker::Send + 'static,
7390 {
7391 type Response = http::Response<tonic::body::Body>;
7392 type Error = std::convert::Infallible;
7393 type Future = BoxFuture<Self::Response, Self::Error>;
7394 fn poll_ready(
7395 &mut self,
7396 _cx: &mut Context<'_>,
7397 ) -> Poll<std::result::Result<(), Self::Error>> {
7398 Poll::Ready(Ok(()))
7399 }
7400 fn call(&mut self, req: http::Request<B>) -> Self::Future {
7401 match req.uri().path() {
7402 "/pidgr.v1.MemberService/InviteUser" => {
7403 #[allow(non_camel_case_types)]
7404 struct InviteUserSvc<T: MemberService>(pub Arc<T>);
7405 impl<
7406 T: MemberService,
7407 > tonic::server::UnaryService<super::InviteUserRequest>
7408 for InviteUserSvc<T> {
7409 type Response = super::InviteUserResponse;
7410 type Future = BoxFuture<
7411 tonic::Response<Self::Response>,
7412 tonic::Status,
7413 >;
7414 fn call(
7415 &mut self,
7416 request: tonic::Request<super::InviteUserRequest>,
7417 ) -> Self::Future {
7418 let inner = Arc::clone(&self.0);
7419 let fut = async move {
7420 <T as MemberService>::invite_user(&inner, request).await
7421 };
7422 Box::pin(fut)
7423 }
7424 }
7425 let accept_compression_encodings = self.accept_compression_encodings;
7426 let send_compression_encodings = self.send_compression_encodings;
7427 let max_decoding_message_size = self.max_decoding_message_size;
7428 let max_encoding_message_size = self.max_encoding_message_size;
7429 let inner = self.inner.clone();
7430 let fut = async move {
7431 let method = InviteUserSvc(inner);
7432 let codec = tonic_prost::ProstCodec::default();
7433 let mut grpc = tonic::server::Grpc::new(codec)
7434 .apply_compression_config(
7435 accept_compression_encodings,
7436 send_compression_encodings,
7437 )
7438 .apply_max_message_size_config(
7439 max_decoding_message_size,
7440 max_encoding_message_size,
7441 );
7442 let res = grpc.unary(method, req).await;
7443 Ok(res)
7444 };
7445 Box::pin(fut)
7446 }
7447 "/pidgr.v1.MemberService/GetUser" => {
7448 #[allow(non_camel_case_types)]
7449 struct GetUserSvc<T: MemberService>(pub Arc<T>);
7450 impl<
7451 T: MemberService,
7452 > tonic::server::UnaryService<super::GetUserRequest>
7453 for GetUserSvc<T> {
7454 type Response = super::GetUserResponse;
7455 type Future = BoxFuture<
7456 tonic::Response<Self::Response>,
7457 tonic::Status,
7458 >;
7459 fn call(
7460 &mut self,
7461 request: tonic::Request<super::GetUserRequest>,
7462 ) -> Self::Future {
7463 let inner = Arc::clone(&self.0);
7464 let fut = async move {
7465 <T as MemberService>::get_user(&inner, request).await
7466 };
7467 Box::pin(fut)
7468 }
7469 }
7470 let accept_compression_encodings = self.accept_compression_encodings;
7471 let send_compression_encodings = self.send_compression_encodings;
7472 let max_decoding_message_size = self.max_decoding_message_size;
7473 let max_encoding_message_size = self.max_encoding_message_size;
7474 let inner = self.inner.clone();
7475 let fut = async move {
7476 let method = GetUserSvc(inner);
7477 let codec = tonic_prost::ProstCodec::default();
7478 let mut grpc = tonic::server::Grpc::new(codec)
7479 .apply_compression_config(
7480 accept_compression_encodings,
7481 send_compression_encodings,
7482 )
7483 .apply_max_message_size_config(
7484 max_decoding_message_size,
7485 max_encoding_message_size,
7486 );
7487 let res = grpc.unary(method, req).await;
7488 Ok(res)
7489 };
7490 Box::pin(fut)
7491 }
7492 "/pidgr.v1.MemberService/ListUsers" => {
7493 #[allow(non_camel_case_types)]
7494 struct ListUsersSvc<T: MemberService>(pub Arc<T>);
7495 impl<
7496 T: MemberService,
7497 > tonic::server::UnaryService<super::ListUsersRequest>
7498 for ListUsersSvc<T> {
7499 type Response = super::ListUsersResponse;
7500 type Future = BoxFuture<
7501 tonic::Response<Self::Response>,
7502 tonic::Status,
7503 >;
7504 fn call(
7505 &mut self,
7506 request: tonic::Request<super::ListUsersRequest>,
7507 ) -> Self::Future {
7508 let inner = Arc::clone(&self.0);
7509 let fut = async move {
7510 <T as MemberService>::list_users(&inner, request).await
7511 };
7512 Box::pin(fut)
7513 }
7514 }
7515 let accept_compression_encodings = self.accept_compression_encodings;
7516 let send_compression_encodings = self.send_compression_encodings;
7517 let max_decoding_message_size = self.max_decoding_message_size;
7518 let max_encoding_message_size = self.max_encoding_message_size;
7519 let inner = self.inner.clone();
7520 let fut = async move {
7521 let method = ListUsersSvc(inner);
7522 let codec = tonic_prost::ProstCodec::default();
7523 let mut grpc = tonic::server::Grpc::new(codec)
7524 .apply_compression_config(
7525 accept_compression_encodings,
7526 send_compression_encodings,
7527 )
7528 .apply_max_message_size_config(
7529 max_decoding_message_size,
7530 max_encoding_message_size,
7531 );
7532 let res = grpc.unary(method, req).await;
7533 Ok(res)
7534 };
7535 Box::pin(fut)
7536 }
7537 "/pidgr.v1.MemberService/UpdateUserRole" => {
7538 #[allow(non_camel_case_types)]
7539 struct UpdateUserRoleSvc<T: MemberService>(pub Arc<T>);
7540 impl<
7541 T: MemberService,
7542 > tonic::server::UnaryService<super::UpdateUserRoleRequest>
7543 for UpdateUserRoleSvc<T> {
7544 type Response = super::UpdateUserRoleResponse;
7545 type Future = BoxFuture<
7546 tonic::Response<Self::Response>,
7547 tonic::Status,
7548 >;
7549 fn call(
7550 &mut self,
7551 request: tonic::Request<super::UpdateUserRoleRequest>,
7552 ) -> Self::Future {
7553 let inner = Arc::clone(&self.0);
7554 let fut = async move {
7555 <T as MemberService>::update_user_role(&inner, request)
7556 .await
7557 };
7558 Box::pin(fut)
7559 }
7560 }
7561 let accept_compression_encodings = self.accept_compression_encodings;
7562 let send_compression_encodings = self.send_compression_encodings;
7563 let max_decoding_message_size = self.max_decoding_message_size;
7564 let max_encoding_message_size = self.max_encoding_message_size;
7565 let inner = self.inner.clone();
7566 let fut = async move {
7567 let method = UpdateUserRoleSvc(inner);
7568 let codec = tonic_prost::ProstCodec::default();
7569 let mut grpc = tonic::server::Grpc::new(codec)
7570 .apply_compression_config(
7571 accept_compression_encodings,
7572 send_compression_encodings,
7573 )
7574 .apply_max_message_size_config(
7575 max_decoding_message_size,
7576 max_encoding_message_size,
7577 );
7578 let res = grpc.unary(method, req).await;
7579 Ok(res)
7580 };
7581 Box::pin(fut)
7582 }
7583 "/pidgr.v1.MemberService/DeactivateUser" => {
7584 #[allow(non_camel_case_types)]
7585 struct DeactivateUserSvc<T: MemberService>(pub Arc<T>);
7586 impl<
7587 T: MemberService,
7588 > tonic::server::UnaryService<super::DeactivateUserRequest>
7589 for DeactivateUserSvc<T> {
7590 type Response = super::DeactivateUserResponse;
7591 type Future = BoxFuture<
7592 tonic::Response<Self::Response>,
7593 tonic::Status,
7594 >;
7595 fn call(
7596 &mut self,
7597 request: tonic::Request<super::DeactivateUserRequest>,
7598 ) -> Self::Future {
7599 let inner = Arc::clone(&self.0);
7600 let fut = async move {
7601 <T as MemberService>::deactivate_user(&inner, request).await
7602 };
7603 Box::pin(fut)
7604 }
7605 }
7606 let accept_compression_encodings = self.accept_compression_encodings;
7607 let send_compression_encodings = self.send_compression_encodings;
7608 let max_decoding_message_size = self.max_decoding_message_size;
7609 let max_encoding_message_size = self.max_encoding_message_size;
7610 let inner = self.inner.clone();
7611 let fut = async move {
7612 let method = DeactivateUserSvc(inner);
7613 let codec = tonic_prost::ProstCodec::default();
7614 let mut grpc = tonic::server::Grpc::new(codec)
7615 .apply_compression_config(
7616 accept_compression_encodings,
7617 send_compression_encodings,
7618 )
7619 .apply_max_message_size_config(
7620 max_decoding_message_size,
7621 max_encoding_message_size,
7622 );
7623 let res = grpc.unary(method, req).await;
7624 Ok(res)
7625 };
7626 Box::pin(fut)
7627 }
7628 "/pidgr.v1.MemberService/ReactivateUser" => {
7629 #[allow(non_camel_case_types)]
7630 struct ReactivateUserSvc<T: MemberService>(pub Arc<T>);
7631 impl<
7632 T: MemberService,
7633 > tonic::server::UnaryService<super::ReactivateUserRequest>
7634 for ReactivateUserSvc<T> {
7635 type Response = super::ReactivateUserResponse;
7636 type Future = BoxFuture<
7637 tonic::Response<Self::Response>,
7638 tonic::Status,
7639 >;
7640 fn call(
7641 &mut self,
7642 request: tonic::Request<super::ReactivateUserRequest>,
7643 ) -> Self::Future {
7644 let inner = Arc::clone(&self.0);
7645 let fut = async move {
7646 <T as MemberService>::reactivate_user(&inner, request).await
7647 };
7648 Box::pin(fut)
7649 }
7650 }
7651 let accept_compression_encodings = self.accept_compression_encodings;
7652 let send_compression_encodings = self.send_compression_encodings;
7653 let max_decoding_message_size = self.max_decoding_message_size;
7654 let max_encoding_message_size = self.max_encoding_message_size;
7655 let inner = self.inner.clone();
7656 let fut = async move {
7657 let method = ReactivateUserSvc(inner);
7658 let codec = tonic_prost::ProstCodec::default();
7659 let mut grpc = tonic::server::Grpc::new(codec)
7660 .apply_compression_config(
7661 accept_compression_encodings,
7662 send_compression_encodings,
7663 )
7664 .apply_max_message_size_config(
7665 max_decoding_message_size,
7666 max_encoding_message_size,
7667 );
7668 let res = grpc.unary(method, req).await;
7669 Ok(res)
7670 };
7671 Box::pin(fut)
7672 }
7673 "/pidgr.v1.MemberService/RevokeInvite" => {
7674 #[allow(non_camel_case_types)]
7675 struct RevokeInviteSvc<T: MemberService>(pub Arc<T>);
7676 impl<
7677 T: MemberService,
7678 > tonic::server::UnaryService<super::RevokeInviteRequest>
7679 for RevokeInviteSvc<T> {
7680 type Response = super::RevokeInviteResponse;
7681 type Future = BoxFuture<
7682 tonic::Response<Self::Response>,
7683 tonic::Status,
7684 >;
7685 fn call(
7686 &mut self,
7687 request: tonic::Request<super::RevokeInviteRequest>,
7688 ) -> Self::Future {
7689 let inner = Arc::clone(&self.0);
7690 let fut = async move {
7691 <T as MemberService>::revoke_invite(&inner, request).await
7692 };
7693 Box::pin(fut)
7694 }
7695 }
7696 let accept_compression_encodings = self.accept_compression_encodings;
7697 let send_compression_encodings = self.send_compression_encodings;
7698 let max_decoding_message_size = self.max_decoding_message_size;
7699 let max_encoding_message_size = self.max_encoding_message_size;
7700 let inner = self.inner.clone();
7701 let fut = async move {
7702 let method = RevokeInviteSvc(inner);
7703 let codec = tonic_prost::ProstCodec::default();
7704 let mut grpc = tonic::server::Grpc::new(codec)
7705 .apply_compression_config(
7706 accept_compression_encodings,
7707 send_compression_encodings,
7708 )
7709 .apply_max_message_size_config(
7710 max_decoding_message_size,
7711 max_encoding_message_size,
7712 );
7713 let res = grpc.unary(method, req).await;
7714 Ok(res)
7715 };
7716 Box::pin(fut)
7717 }
7718 "/pidgr.v1.MemberService/UpdateUserProfile" => {
7719 #[allow(non_camel_case_types)]
7720 struct UpdateUserProfileSvc<T: MemberService>(pub Arc<T>);
7721 impl<
7722 T: MemberService,
7723 > tonic::server::UnaryService<super::UpdateUserProfileRequest>
7724 for UpdateUserProfileSvc<T> {
7725 type Response = super::UpdateUserProfileResponse;
7726 type Future = BoxFuture<
7727 tonic::Response<Self::Response>,
7728 tonic::Status,
7729 >;
7730 fn call(
7731 &mut self,
7732 request: tonic::Request<super::UpdateUserProfileRequest>,
7733 ) -> Self::Future {
7734 let inner = Arc::clone(&self.0);
7735 let fut = async move {
7736 <T as MemberService>::update_user_profile(&inner, request)
7737 .await
7738 };
7739 Box::pin(fut)
7740 }
7741 }
7742 let accept_compression_encodings = self.accept_compression_encodings;
7743 let send_compression_encodings = self.send_compression_encodings;
7744 let max_decoding_message_size = self.max_decoding_message_size;
7745 let max_encoding_message_size = self.max_encoding_message_size;
7746 let inner = self.inner.clone();
7747 let fut = async move {
7748 let method = UpdateUserProfileSvc(inner);
7749 let codec = tonic_prost::ProstCodec::default();
7750 let mut grpc = tonic::server::Grpc::new(codec)
7751 .apply_compression_config(
7752 accept_compression_encodings,
7753 send_compression_encodings,
7754 )
7755 .apply_max_message_size_config(
7756 max_decoding_message_size,
7757 max_encoding_message_size,
7758 );
7759 let res = grpc.unary(method, req).await;
7760 Ok(res)
7761 };
7762 Box::pin(fut)
7763 }
7764 "/pidgr.v1.MemberService/GetUserSettings" => {
7765 #[allow(non_camel_case_types)]
7766 struct GetUserSettingsSvc<T: MemberService>(pub Arc<T>);
7767 impl<
7768 T: MemberService,
7769 > tonic::server::UnaryService<super::GetUserSettingsRequest>
7770 for GetUserSettingsSvc<T> {
7771 type Response = super::GetUserSettingsResponse;
7772 type Future = BoxFuture<
7773 tonic::Response<Self::Response>,
7774 tonic::Status,
7775 >;
7776 fn call(
7777 &mut self,
7778 request: tonic::Request<super::GetUserSettingsRequest>,
7779 ) -> Self::Future {
7780 let inner = Arc::clone(&self.0);
7781 let fut = async move {
7782 <T as MemberService>::get_user_settings(&inner, request)
7783 .await
7784 };
7785 Box::pin(fut)
7786 }
7787 }
7788 let accept_compression_encodings = self.accept_compression_encodings;
7789 let send_compression_encodings = self.send_compression_encodings;
7790 let max_decoding_message_size = self.max_decoding_message_size;
7791 let max_encoding_message_size = self.max_encoding_message_size;
7792 let inner = self.inner.clone();
7793 let fut = async move {
7794 let method = GetUserSettingsSvc(inner);
7795 let codec = tonic_prost::ProstCodec::default();
7796 let mut grpc = tonic::server::Grpc::new(codec)
7797 .apply_compression_config(
7798 accept_compression_encodings,
7799 send_compression_encodings,
7800 )
7801 .apply_max_message_size_config(
7802 max_decoding_message_size,
7803 max_encoding_message_size,
7804 );
7805 let res = grpc.unary(method, req).await;
7806 Ok(res)
7807 };
7808 Box::pin(fut)
7809 }
7810 "/pidgr.v1.MemberService/UpdateUserSettings" => {
7811 #[allow(non_camel_case_types)]
7812 struct UpdateUserSettingsSvc<T: MemberService>(pub Arc<T>);
7813 impl<
7814 T: MemberService,
7815 > tonic::server::UnaryService<super::UpdateUserSettingsRequest>
7816 for UpdateUserSettingsSvc<T> {
7817 type Response = super::UpdateUserSettingsResponse;
7818 type Future = BoxFuture<
7819 tonic::Response<Self::Response>,
7820 tonic::Status,
7821 >;
7822 fn call(
7823 &mut self,
7824 request: tonic::Request<super::UpdateUserSettingsRequest>,
7825 ) -> Self::Future {
7826 let inner = Arc::clone(&self.0);
7827 let fut = async move {
7828 <T as MemberService>::update_user_settings(&inner, request)
7829 .await
7830 };
7831 Box::pin(fut)
7832 }
7833 }
7834 let accept_compression_encodings = self.accept_compression_encodings;
7835 let send_compression_encodings = self.send_compression_encodings;
7836 let max_decoding_message_size = self.max_decoding_message_size;
7837 let max_encoding_message_size = self.max_encoding_message_size;
7838 let inner = self.inner.clone();
7839 let fut = async move {
7840 let method = UpdateUserSettingsSvc(inner);
7841 let codec = tonic_prost::ProstCodec::default();
7842 let mut grpc = tonic::server::Grpc::new(codec)
7843 .apply_compression_config(
7844 accept_compression_encodings,
7845 send_compression_encodings,
7846 )
7847 .apply_max_message_size_config(
7848 max_decoding_message_size,
7849 max_encoding_message_size,
7850 );
7851 let res = grpc.unary(method, req).await;
7852 Ok(res)
7853 };
7854 Box::pin(fut)
7855 }
7856 "/pidgr.v1.MemberService/BulkInviteUsers" => {
7857 #[allow(non_camel_case_types)]
7858 struct BulkInviteUsersSvc<T: MemberService>(pub Arc<T>);
7859 impl<
7860 T: MemberService,
7861 > tonic::server::UnaryService<super::BulkInviteUsersRequest>
7862 for BulkInviteUsersSvc<T> {
7863 type Response = super::BulkInviteUsersResponse;
7864 type Future = BoxFuture<
7865 tonic::Response<Self::Response>,
7866 tonic::Status,
7867 >;
7868 fn call(
7869 &mut self,
7870 request: tonic::Request<super::BulkInviteUsersRequest>,
7871 ) -> Self::Future {
7872 let inner = Arc::clone(&self.0);
7873 let fut = async move {
7874 <T as MemberService>::bulk_invite_users(&inner, request)
7875 .await
7876 };
7877 Box::pin(fut)
7878 }
7879 }
7880 let accept_compression_encodings = self.accept_compression_encodings;
7881 let send_compression_encodings = self.send_compression_encodings;
7882 let max_decoding_message_size = self.max_decoding_message_size;
7883 let max_encoding_message_size = self.max_encoding_message_size;
7884 let inner = self.inner.clone();
7885 let fut = async move {
7886 let method = BulkInviteUsersSvc(inner);
7887 let codec = tonic_prost::ProstCodec::default();
7888 let mut grpc = tonic::server::Grpc::new(codec)
7889 .apply_compression_config(
7890 accept_compression_encodings,
7891 send_compression_encodings,
7892 )
7893 .apply_max_message_size_config(
7894 max_decoding_message_size,
7895 max_encoding_message_size,
7896 );
7897 let res = grpc.unary(method, req).await;
7898 Ok(res)
7899 };
7900 Box::pin(fut)
7901 }
7902 "/pidgr.v1.MemberService/ConfirmPasskeyEnrollment" => {
7903 #[allow(non_camel_case_types)]
7904 struct ConfirmPasskeyEnrollmentSvc<T: MemberService>(pub Arc<T>);
7905 impl<
7906 T: MemberService,
7907 > tonic::server::UnaryService<super::ConfirmPasskeyEnrollmentRequest>
7908 for ConfirmPasskeyEnrollmentSvc<T> {
7909 type Response = super::ConfirmPasskeyEnrollmentResponse;
7910 type Future = BoxFuture<
7911 tonic::Response<Self::Response>,
7912 tonic::Status,
7913 >;
7914 fn call(
7915 &mut self,
7916 request: tonic::Request<
7917 super::ConfirmPasskeyEnrollmentRequest,
7918 >,
7919 ) -> Self::Future {
7920 let inner = Arc::clone(&self.0);
7921 let fut = async move {
7922 <T as MemberService>::confirm_passkey_enrollment(
7923 &inner,
7924 request,
7925 )
7926 .await
7927 };
7928 Box::pin(fut)
7929 }
7930 }
7931 let accept_compression_encodings = self.accept_compression_encodings;
7932 let send_compression_encodings = self.send_compression_encodings;
7933 let max_decoding_message_size = self.max_decoding_message_size;
7934 let max_encoding_message_size = self.max_encoding_message_size;
7935 let inner = self.inner.clone();
7936 let fut = async move {
7937 let method = ConfirmPasskeyEnrollmentSvc(inner);
7938 let codec = tonic_prost::ProstCodec::default();
7939 let mut grpc = tonic::server::Grpc::new(codec)
7940 .apply_compression_config(
7941 accept_compression_encodings,
7942 send_compression_encodings,
7943 )
7944 .apply_max_message_size_config(
7945 max_decoding_message_size,
7946 max_encoding_message_size,
7947 );
7948 let res = grpc.unary(method, req).await;
7949 Ok(res)
7950 };
7951 Box::pin(fut)
7952 }
7953 _ => {
7954 Box::pin(async move {
7955 let mut response = http::Response::new(
7956 tonic::body::Body::default(),
7957 );
7958 let headers = response.headers_mut();
7959 headers
7960 .insert(
7961 tonic::Status::GRPC_STATUS,
7962 (tonic::Code::Unimplemented as i32).into(),
7963 );
7964 headers
7965 .insert(
7966 http::header::CONTENT_TYPE,
7967 tonic::metadata::GRPC_CONTENT_TYPE,
7968 );
7969 Ok(response)
7970 })
7971 }
7972 }
7973 }
7974 }
7975 impl<T> Clone for MemberServiceServer<T> {
7976 fn clone(&self) -> Self {
7977 let inner = self.inner.clone();
7978 Self {
7979 inner,
7980 accept_compression_encodings: self.accept_compression_encodings,
7981 send_compression_encodings: self.send_compression_encodings,
7982 max_decoding_message_size: self.max_decoding_message_size,
7983 max_encoding_message_size: self.max_encoding_message_size,
7984 }
7985 }
7986 }
7987 pub const SERVICE_NAME: &str = "pidgr.v1.MemberService";
7989 impl<T> tonic::server::NamedService for MemberServiceServer<T> {
7990 const NAME: &'static str = SERVICE_NAME;
7991 }
7992}
7993pub mod organization_service_client {
7995 #![allow(
7996 unused_variables,
7997 dead_code,
7998 missing_docs,
7999 clippy::wildcard_imports,
8000 clippy::let_unit_value,
8001 )]
8002 use tonic::codegen::*;
8003 use tonic::codegen::http::Uri;
8004 #[derive(Debug, Clone)]
8009 pub struct OrganizationServiceClient<T> {
8010 inner: tonic::client::Grpc<T>,
8011 }
8012 impl OrganizationServiceClient<tonic::transport::Channel> {
8013 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
8015 where
8016 D: TryInto<tonic::transport::Endpoint>,
8017 D::Error: Into<StdError>,
8018 {
8019 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
8020 Ok(Self::new(conn))
8021 }
8022 }
8023 impl<T> OrganizationServiceClient<T>
8024 where
8025 T: tonic::client::GrpcService<tonic::body::Body>,
8026 T::Error: Into<StdError>,
8027 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
8028 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
8029 {
8030 pub fn new(inner: T) -> Self {
8031 let inner = tonic::client::Grpc::new(inner);
8032 Self { inner }
8033 }
8034 pub fn with_origin(inner: T, origin: Uri) -> Self {
8035 let inner = tonic::client::Grpc::with_origin(inner, origin);
8036 Self { inner }
8037 }
8038 pub fn with_interceptor<F>(
8039 inner: T,
8040 interceptor: F,
8041 ) -> OrganizationServiceClient<InterceptedService<T, F>>
8042 where
8043 F: tonic::service::Interceptor,
8044 T::ResponseBody: Default,
8045 T: tonic::codegen::Service<
8046 http::Request<tonic::body::Body>,
8047 Response = http::Response<
8048 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
8049 >,
8050 >,
8051 <T as tonic::codegen::Service<
8052 http::Request<tonic::body::Body>,
8053 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
8054 {
8055 OrganizationServiceClient::new(InterceptedService::new(inner, interceptor))
8056 }
8057 #[must_use]
8062 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8063 self.inner = self.inner.send_compressed(encoding);
8064 self
8065 }
8066 #[must_use]
8068 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8069 self.inner = self.inner.accept_compressed(encoding);
8070 self
8071 }
8072 #[must_use]
8076 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8077 self.inner = self.inner.max_decoding_message_size(limit);
8078 self
8079 }
8080 #[must_use]
8084 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8085 self.inner = self.inner.max_encoding_message_size(limit);
8086 self
8087 }
8088 pub async fn create_organization(
8092 &mut self,
8093 request: impl tonic::IntoRequest<super::CreateOrganizationRequest>,
8094 ) -> std::result::Result<
8095 tonic::Response<super::CreateOrganizationResponse>,
8096 tonic::Status,
8097 > {
8098 self.inner
8099 .ready()
8100 .await
8101 .map_err(|e| {
8102 tonic::Status::unknown(
8103 format!("Service was not ready: {}", e.into()),
8104 )
8105 })?;
8106 let codec = tonic_prost::ProstCodec::default();
8107 let path = http::uri::PathAndQuery::from_static(
8108 "/pidgr.v1.OrganizationService/CreateOrganization",
8109 );
8110 let mut req = request.into_request();
8111 req.extensions_mut()
8112 .insert(
8113 GrpcMethod::new("pidgr.v1.OrganizationService", "CreateOrganization"),
8114 );
8115 self.inner.unary(req, path, codec).await
8116 }
8117 pub async fn get_organization(
8121 &mut self,
8122 request: impl tonic::IntoRequest<super::GetOrganizationRequest>,
8123 ) -> std::result::Result<
8124 tonic::Response<super::GetOrganizationResponse>,
8125 tonic::Status,
8126 > {
8127 self.inner
8128 .ready()
8129 .await
8130 .map_err(|e| {
8131 tonic::Status::unknown(
8132 format!("Service was not ready: {}", e.into()),
8133 )
8134 })?;
8135 let codec = tonic_prost::ProstCodec::default();
8136 let path = http::uri::PathAndQuery::from_static(
8137 "/pidgr.v1.OrganizationService/GetOrganization",
8138 );
8139 let mut req = request.into_request();
8140 req.extensions_mut()
8141 .insert(
8142 GrpcMethod::new("pidgr.v1.OrganizationService", "GetOrganization"),
8143 );
8144 self.inner.unary(req, path, codec).await
8145 }
8146 pub async fn update_organization(
8150 &mut self,
8151 request: impl tonic::IntoRequest<super::UpdateOrganizationRequest>,
8152 ) -> std::result::Result<
8153 tonic::Response<super::UpdateOrganizationResponse>,
8154 tonic::Status,
8155 > {
8156 self.inner
8157 .ready()
8158 .await
8159 .map_err(|e| {
8160 tonic::Status::unknown(
8161 format!("Service was not ready: {}", e.into()),
8162 )
8163 })?;
8164 let codec = tonic_prost::ProstCodec::default();
8165 let path = http::uri::PathAndQuery::from_static(
8166 "/pidgr.v1.OrganizationService/UpdateOrganization",
8167 );
8168 let mut req = request.into_request();
8169 req.extensions_mut()
8170 .insert(
8171 GrpcMethod::new("pidgr.v1.OrganizationService", "UpdateOrganization"),
8172 );
8173 self.inner.unary(req, path, codec).await
8174 }
8175 pub async fn update_sso_attribute_mappings(
8179 &mut self,
8180 request: impl tonic::IntoRequest<super::UpdateSsoAttributeMappingsRequest>,
8181 ) -> std::result::Result<
8182 tonic::Response<super::UpdateSsoAttributeMappingsResponse>,
8183 tonic::Status,
8184 > {
8185 self.inner
8186 .ready()
8187 .await
8188 .map_err(|e| {
8189 tonic::Status::unknown(
8190 format!("Service was not ready: {}", e.into()),
8191 )
8192 })?;
8193 let codec = tonic_prost::ProstCodec::default();
8194 let path = http::uri::PathAndQuery::from_static(
8195 "/pidgr.v1.OrganizationService/UpdateSsoAttributeMappings",
8196 );
8197 let mut req = request.into_request();
8198 req.extensions_mut()
8199 .insert(
8200 GrpcMethod::new(
8201 "pidgr.v1.OrganizationService",
8202 "UpdateSsoAttributeMappings",
8203 ),
8204 );
8205 self.inner.unary(req, path, codec).await
8206 }
8207 }
8208}
8209pub mod organization_service_server {
8211 #![allow(
8212 unused_variables,
8213 dead_code,
8214 missing_docs,
8215 clippy::wildcard_imports,
8216 clippy::let_unit_value,
8217 )]
8218 use tonic::codegen::*;
8219 #[async_trait]
8221 pub trait OrganizationService: std::marker::Send + std::marker::Sync + 'static {
8222 async fn create_organization(
8226 &self,
8227 request: tonic::Request<super::CreateOrganizationRequest>,
8228 ) -> std::result::Result<
8229 tonic::Response<super::CreateOrganizationResponse>,
8230 tonic::Status,
8231 >;
8232 async fn get_organization(
8236 &self,
8237 request: tonic::Request<super::GetOrganizationRequest>,
8238 ) -> std::result::Result<
8239 tonic::Response<super::GetOrganizationResponse>,
8240 tonic::Status,
8241 >;
8242 async fn update_organization(
8246 &self,
8247 request: tonic::Request<super::UpdateOrganizationRequest>,
8248 ) -> std::result::Result<
8249 tonic::Response<super::UpdateOrganizationResponse>,
8250 tonic::Status,
8251 >;
8252 async fn update_sso_attribute_mappings(
8256 &self,
8257 request: tonic::Request<super::UpdateSsoAttributeMappingsRequest>,
8258 ) -> std::result::Result<
8259 tonic::Response<super::UpdateSsoAttributeMappingsResponse>,
8260 tonic::Status,
8261 >;
8262 }
8263 #[derive(Debug)]
8268 pub struct OrganizationServiceServer<T> {
8269 inner: Arc<T>,
8270 accept_compression_encodings: EnabledCompressionEncodings,
8271 send_compression_encodings: EnabledCompressionEncodings,
8272 max_decoding_message_size: Option<usize>,
8273 max_encoding_message_size: Option<usize>,
8274 }
8275 impl<T> OrganizationServiceServer<T> {
8276 pub fn new(inner: T) -> Self {
8277 Self::from_arc(Arc::new(inner))
8278 }
8279 pub fn from_arc(inner: Arc<T>) -> Self {
8280 Self {
8281 inner,
8282 accept_compression_encodings: Default::default(),
8283 send_compression_encodings: Default::default(),
8284 max_decoding_message_size: None,
8285 max_encoding_message_size: None,
8286 }
8287 }
8288 pub fn with_interceptor<F>(
8289 inner: T,
8290 interceptor: F,
8291 ) -> InterceptedService<Self, F>
8292 where
8293 F: tonic::service::Interceptor,
8294 {
8295 InterceptedService::new(Self::new(inner), interceptor)
8296 }
8297 #[must_use]
8299 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8300 self.accept_compression_encodings.enable(encoding);
8301 self
8302 }
8303 #[must_use]
8305 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8306 self.send_compression_encodings.enable(encoding);
8307 self
8308 }
8309 #[must_use]
8313 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8314 self.max_decoding_message_size = Some(limit);
8315 self
8316 }
8317 #[must_use]
8321 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8322 self.max_encoding_message_size = Some(limit);
8323 self
8324 }
8325 }
8326 impl<T, B> tonic::codegen::Service<http::Request<B>> for OrganizationServiceServer<T>
8327 where
8328 T: OrganizationService,
8329 B: Body + std::marker::Send + 'static,
8330 B::Error: Into<StdError> + std::marker::Send + 'static,
8331 {
8332 type Response = http::Response<tonic::body::Body>;
8333 type Error = std::convert::Infallible;
8334 type Future = BoxFuture<Self::Response, Self::Error>;
8335 fn poll_ready(
8336 &mut self,
8337 _cx: &mut Context<'_>,
8338 ) -> Poll<std::result::Result<(), Self::Error>> {
8339 Poll::Ready(Ok(()))
8340 }
8341 fn call(&mut self, req: http::Request<B>) -> Self::Future {
8342 match req.uri().path() {
8343 "/pidgr.v1.OrganizationService/CreateOrganization" => {
8344 #[allow(non_camel_case_types)]
8345 struct CreateOrganizationSvc<T: OrganizationService>(pub Arc<T>);
8346 impl<
8347 T: OrganizationService,
8348 > tonic::server::UnaryService<super::CreateOrganizationRequest>
8349 for CreateOrganizationSvc<T> {
8350 type Response = super::CreateOrganizationResponse;
8351 type Future = BoxFuture<
8352 tonic::Response<Self::Response>,
8353 tonic::Status,
8354 >;
8355 fn call(
8356 &mut self,
8357 request: tonic::Request<super::CreateOrganizationRequest>,
8358 ) -> Self::Future {
8359 let inner = Arc::clone(&self.0);
8360 let fut = async move {
8361 <T as OrganizationService>::create_organization(
8362 &inner,
8363 request,
8364 )
8365 .await
8366 };
8367 Box::pin(fut)
8368 }
8369 }
8370 let accept_compression_encodings = self.accept_compression_encodings;
8371 let send_compression_encodings = self.send_compression_encodings;
8372 let max_decoding_message_size = self.max_decoding_message_size;
8373 let max_encoding_message_size = self.max_encoding_message_size;
8374 let inner = self.inner.clone();
8375 let fut = async move {
8376 let method = CreateOrganizationSvc(inner);
8377 let codec = tonic_prost::ProstCodec::default();
8378 let mut grpc = tonic::server::Grpc::new(codec)
8379 .apply_compression_config(
8380 accept_compression_encodings,
8381 send_compression_encodings,
8382 )
8383 .apply_max_message_size_config(
8384 max_decoding_message_size,
8385 max_encoding_message_size,
8386 );
8387 let res = grpc.unary(method, req).await;
8388 Ok(res)
8389 };
8390 Box::pin(fut)
8391 }
8392 "/pidgr.v1.OrganizationService/GetOrganization" => {
8393 #[allow(non_camel_case_types)]
8394 struct GetOrganizationSvc<T: OrganizationService>(pub Arc<T>);
8395 impl<
8396 T: OrganizationService,
8397 > tonic::server::UnaryService<super::GetOrganizationRequest>
8398 for GetOrganizationSvc<T> {
8399 type Response = super::GetOrganizationResponse;
8400 type Future = BoxFuture<
8401 tonic::Response<Self::Response>,
8402 tonic::Status,
8403 >;
8404 fn call(
8405 &mut self,
8406 request: tonic::Request<super::GetOrganizationRequest>,
8407 ) -> Self::Future {
8408 let inner = Arc::clone(&self.0);
8409 let fut = async move {
8410 <T as OrganizationService>::get_organization(
8411 &inner,
8412 request,
8413 )
8414 .await
8415 };
8416 Box::pin(fut)
8417 }
8418 }
8419 let accept_compression_encodings = self.accept_compression_encodings;
8420 let send_compression_encodings = self.send_compression_encodings;
8421 let max_decoding_message_size = self.max_decoding_message_size;
8422 let max_encoding_message_size = self.max_encoding_message_size;
8423 let inner = self.inner.clone();
8424 let fut = async move {
8425 let method = GetOrganizationSvc(inner);
8426 let codec = tonic_prost::ProstCodec::default();
8427 let mut grpc = tonic::server::Grpc::new(codec)
8428 .apply_compression_config(
8429 accept_compression_encodings,
8430 send_compression_encodings,
8431 )
8432 .apply_max_message_size_config(
8433 max_decoding_message_size,
8434 max_encoding_message_size,
8435 );
8436 let res = grpc.unary(method, req).await;
8437 Ok(res)
8438 };
8439 Box::pin(fut)
8440 }
8441 "/pidgr.v1.OrganizationService/UpdateOrganization" => {
8442 #[allow(non_camel_case_types)]
8443 struct UpdateOrganizationSvc<T: OrganizationService>(pub Arc<T>);
8444 impl<
8445 T: OrganizationService,
8446 > tonic::server::UnaryService<super::UpdateOrganizationRequest>
8447 for UpdateOrganizationSvc<T> {
8448 type Response = super::UpdateOrganizationResponse;
8449 type Future = BoxFuture<
8450 tonic::Response<Self::Response>,
8451 tonic::Status,
8452 >;
8453 fn call(
8454 &mut self,
8455 request: tonic::Request<super::UpdateOrganizationRequest>,
8456 ) -> Self::Future {
8457 let inner = Arc::clone(&self.0);
8458 let fut = async move {
8459 <T as OrganizationService>::update_organization(
8460 &inner,
8461 request,
8462 )
8463 .await
8464 };
8465 Box::pin(fut)
8466 }
8467 }
8468 let accept_compression_encodings = self.accept_compression_encodings;
8469 let send_compression_encodings = self.send_compression_encodings;
8470 let max_decoding_message_size = self.max_decoding_message_size;
8471 let max_encoding_message_size = self.max_encoding_message_size;
8472 let inner = self.inner.clone();
8473 let fut = async move {
8474 let method = UpdateOrganizationSvc(inner);
8475 let codec = tonic_prost::ProstCodec::default();
8476 let mut grpc = tonic::server::Grpc::new(codec)
8477 .apply_compression_config(
8478 accept_compression_encodings,
8479 send_compression_encodings,
8480 )
8481 .apply_max_message_size_config(
8482 max_decoding_message_size,
8483 max_encoding_message_size,
8484 );
8485 let res = grpc.unary(method, req).await;
8486 Ok(res)
8487 };
8488 Box::pin(fut)
8489 }
8490 "/pidgr.v1.OrganizationService/UpdateSsoAttributeMappings" => {
8491 #[allow(non_camel_case_types)]
8492 struct UpdateSsoAttributeMappingsSvc<T: OrganizationService>(
8493 pub Arc<T>,
8494 );
8495 impl<
8496 T: OrganizationService,
8497 > tonic::server::UnaryService<
8498 super::UpdateSsoAttributeMappingsRequest,
8499 > for UpdateSsoAttributeMappingsSvc<T> {
8500 type Response = super::UpdateSsoAttributeMappingsResponse;
8501 type Future = BoxFuture<
8502 tonic::Response<Self::Response>,
8503 tonic::Status,
8504 >;
8505 fn call(
8506 &mut self,
8507 request: tonic::Request<
8508 super::UpdateSsoAttributeMappingsRequest,
8509 >,
8510 ) -> Self::Future {
8511 let inner = Arc::clone(&self.0);
8512 let fut = async move {
8513 <T as OrganizationService>::update_sso_attribute_mappings(
8514 &inner,
8515 request,
8516 )
8517 .await
8518 };
8519 Box::pin(fut)
8520 }
8521 }
8522 let accept_compression_encodings = self.accept_compression_encodings;
8523 let send_compression_encodings = self.send_compression_encodings;
8524 let max_decoding_message_size = self.max_decoding_message_size;
8525 let max_encoding_message_size = self.max_encoding_message_size;
8526 let inner = self.inner.clone();
8527 let fut = async move {
8528 let method = UpdateSsoAttributeMappingsSvc(inner);
8529 let codec = tonic_prost::ProstCodec::default();
8530 let mut grpc = tonic::server::Grpc::new(codec)
8531 .apply_compression_config(
8532 accept_compression_encodings,
8533 send_compression_encodings,
8534 )
8535 .apply_max_message_size_config(
8536 max_decoding_message_size,
8537 max_encoding_message_size,
8538 );
8539 let res = grpc.unary(method, req).await;
8540 Ok(res)
8541 };
8542 Box::pin(fut)
8543 }
8544 _ => {
8545 Box::pin(async move {
8546 let mut response = http::Response::new(
8547 tonic::body::Body::default(),
8548 );
8549 let headers = response.headers_mut();
8550 headers
8551 .insert(
8552 tonic::Status::GRPC_STATUS,
8553 (tonic::Code::Unimplemented as i32).into(),
8554 );
8555 headers
8556 .insert(
8557 http::header::CONTENT_TYPE,
8558 tonic::metadata::GRPC_CONTENT_TYPE,
8559 );
8560 Ok(response)
8561 })
8562 }
8563 }
8564 }
8565 }
8566 impl<T> Clone for OrganizationServiceServer<T> {
8567 fn clone(&self) -> Self {
8568 let inner = self.inner.clone();
8569 Self {
8570 inner,
8571 accept_compression_encodings: self.accept_compression_encodings,
8572 send_compression_encodings: self.send_compression_encodings,
8573 max_decoding_message_size: self.max_decoding_message_size,
8574 max_encoding_message_size: self.max_encoding_message_size,
8575 }
8576 }
8577 }
8578 pub const SERVICE_NAME: &str = "pidgr.v1.OrganizationService";
8580 impl<T> tonic::server::NamedService for OrganizationServiceServer<T> {
8581 const NAME: &'static str = SERVICE_NAME;
8582 }
8583}
8584pub mod render_service_client {
8586 #![allow(
8587 unused_variables,
8588 dead_code,
8589 missing_docs,
8590 clippy::wildcard_imports,
8591 clippy::let_unit_value,
8592 )]
8593 use tonic::codegen::*;
8594 use tonic::codegen::http::Uri;
8595 #[derive(Debug, Clone)]
8598 pub struct RenderServiceClient<T> {
8599 inner: tonic::client::Grpc<T>,
8600 }
8601 impl RenderServiceClient<tonic::transport::Channel> {
8602 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
8604 where
8605 D: TryInto<tonic::transport::Endpoint>,
8606 D::Error: Into<StdError>,
8607 {
8608 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
8609 Ok(Self::new(conn))
8610 }
8611 }
8612 impl<T> RenderServiceClient<T>
8613 where
8614 T: tonic::client::GrpcService<tonic::body::Body>,
8615 T::Error: Into<StdError>,
8616 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
8617 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
8618 {
8619 pub fn new(inner: T) -> Self {
8620 let inner = tonic::client::Grpc::new(inner);
8621 Self { inner }
8622 }
8623 pub fn with_origin(inner: T, origin: Uri) -> Self {
8624 let inner = tonic::client::Grpc::with_origin(inner, origin);
8625 Self { inner }
8626 }
8627 pub fn with_interceptor<F>(
8628 inner: T,
8629 interceptor: F,
8630 ) -> RenderServiceClient<InterceptedService<T, F>>
8631 where
8632 F: tonic::service::Interceptor,
8633 T::ResponseBody: Default,
8634 T: tonic::codegen::Service<
8635 http::Request<tonic::body::Body>,
8636 Response = http::Response<
8637 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
8638 >,
8639 >,
8640 <T as tonic::codegen::Service<
8641 http::Request<tonic::body::Body>,
8642 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
8643 {
8644 RenderServiceClient::new(InterceptedService::new(inner, interceptor))
8645 }
8646 #[must_use]
8651 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8652 self.inner = self.inner.send_compressed(encoding);
8653 self
8654 }
8655 #[must_use]
8657 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8658 self.inner = self.inner.accept_compressed(encoding);
8659 self
8660 }
8661 #[must_use]
8665 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8666 self.inner = self.inner.max_decoding_message_size(limit);
8667 self
8668 }
8669 #[must_use]
8673 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8674 self.inner = self.inner.max_encoding_message_size(limit);
8675 self
8676 }
8677 pub async fn render_batch(
8681 &mut self,
8682 request: impl tonic::IntoRequest<super::RenderBatchRequest>,
8683 ) -> std::result::Result<
8684 tonic::Response<tonic::codec::Streaming<super::RenderBatchResponse>>,
8685 tonic::Status,
8686 > {
8687 self.inner
8688 .ready()
8689 .await
8690 .map_err(|e| {
8691 tonic::Status::unknown(
8692 format!("Service was not ready: {}", e.into()),
8693 )
8694 })?;
8695 let codec = tonic_prost::ProstCodec::default();
8696 let path = http::uri::PathAndQuery::from_static(
8697 "/pidgr.v1.RenderService/RenderBatch",
8698 );
8699 let mut req = request.into_request();
8700 req.extensions_mut()
8701 .insert(GrpcMethod::new("pidgr.v1.RenderService", "RenderBatch"));
8702 self.inner.server_streaming(req, path, codec).await
8703 }
8704 }
8705}
8706pub mod render_service_server {
8708 #![allow(
8709 unused_variables,
8710 dead_code,
8711 missing_docs,
8712 clippy::wildcard_imports,
8713 clippy::let_unit_value,
8714 )]
8715 use tonic::codegen::*;
8716 #[async_trait]
8718 pub trait RenderService: std::marker::Send + std::marker::Sync + 'static {
8719 type RenderBatchStream: tonic::codegen::tokio_stream::Stream<
8721 Item = std::result::Result<super::RenderBatchResponse, tonic::Status>,
8722 >
8723 + std::marker::Send
8724 + 'static;
8725 async fn render_batch(
8729 &self,
8730 request: tonic::Request<super::RenderBatchRequest>,
8731 ) -> std::result::Result<
8732 tonic::Response<Self::RenderBatchStream>,
8733 tonic::Status,
8734 >;
8735 }
8736 #[derive(Debug)]
8739 pub struct RenderServiceServer<T> {
8740 inner: Arc<T>,
8741 accept_compression_encodings: EnabledCompressionEncodings,
8742 send_compression_encodings: EnabledCompressionEncodings,
8743 max_decoding_message_size: Option<usize>,
8744 max_encoding_message_size: Option<usize>,
8745 }
8746 impl<T> RenderServiceServer<T> {
8747 pub fn new(inner: T) -> Self {
8748 Self::from_arc(Arc::new(inner))
8749 }
8750 pub fn from_arc(inner: Arc<T>) -> Self {
8751 Self {
8752 inner,
8753 accept_compression_encodings: Default::default(),
8754 send_compression_encodings: Default::default(),
8755 max_decoding_message_size: None,
8756 max_encoding_message_size: None,
8757 }
8758 }
8759 pub fn with_interceptor<F>(
8760 inner: T,
8761 interceptor: F,
8762 ) -> InterceptedService<Self, F>
8763 where
8764 F: tonic::service::Interceptor,
8765 {
8766 InterceptedService::new(Self::new(inner), interceptor)
8767 }
8768 #[must_use]
8770 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8771 self.accept_compression_encodings.enable(encoding);
8772 self
8773 }
8774 #[must_use]
8776 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8777 self.send_compression_encodings.enable(encoding);
8778 self
8779 }
8780 #[must_use]
8784 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8785 self.max_decoding_message_size = Some(limit);
8786 self
8787 }
8788 #[must_use]
8792 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8793 self.max_encoding_message_size = Some(limit);
8794 self
8795 }
8796 }
8797 impl<T, B> tonic::codegen::Service<http::Request<B>> for RenderServiceServer<T>
8798 where
8799 T: RenderService,
8800 B: Body + std::marker::Send + 'static,
8801 B::Error: Into<StdError> + std::marker::Send + 'static,
8802 {
8803 type Response = http::Response<tonic::body::Body>;
8804 type Error = std::convert::Infallible;
8805 type Future = BoxFuture<Self::Response, Self::Error>;
8806 fn poll_ready(
8807 &mut self,
8808 _cx: &mut Context<'_>,
8809 ) -> Poll<std::result::Result<(), Self::Error>> {
8810 Poll::Ready(Ok(()))
8811 }
8812 fn call(&mut self, req: http::Request<B>) -> Self::Future {
8813 match req.uri().path() {
8814 "/pidgr.v1.RenderService/RenderBatch" => {
8815 #[allow(non_camel_case_types)]
8816 struct RenderBatchSvc<T: RenderService>(pub Arc<T>);
8817 impl<
8818 T: RenderService,
8819 > tonic::server::ServerStreamingService<super::RenderBatchRequest>
8820 for RenderBatchSvc<T> {
8821 type Response = super::RenderBatchResponse;
8822 type ResponseStream = T::RenderBatchStream;
8823 type Future = BoxFuture<
8824 tonic::Response<Self::ResponseStream>,
8825 tonic::Status,
8826 >;
8827 fn call(
8828 &mut self,
8829 request: tonic::Request<super::RenderBatchRequest>,
8830 ) -> Self::Future {
8831 let inner = Arc::clone(&self.0);
8832 let fut = async move {
8833 <T as RenderService>::render_batch(&inner, request).await
8834 };
8835 Box::pin(fut)
8836 }
8837 }
8838 let accept_compression_encodings = self.accept_compression_encodings;
8839 let send_compression_encodings = self.send_compression_encodings;
8840 let max_decoding_message_size = self.max_decoding_message_size;
8841 let max_encoding_message_size = self.max_encoding_message_size;
8842 let inner = self.inner.clone();
8843 let fut = async move {
8844 let method = RenderBatchSvc(inner);
8845 let codec = tonic_prost::ProstCodec::default();
8846 let mut grpc = tonic::server::Grpc::new(codec)
8847 .apply_compression_config(
8848 accept_compression_encodings,
8849 send_compression_encodings,
8850 )
8851 .apply_max_message_size_config(
8852 max_decoding_message_size,
8853 max_encoding_message_size,
8854 );
8855 let res = grpc.server_streaming(method, req).await;
8856 Ok(res)
8857 };
8858 Box::pin(fut)
8859 }
8860 _ => {
8861 Box::pin(async move {
8862 let mut response = http::Response::new(
8863 tonic::body::Body::default(),
8864 );
8865 let headers = response.headers_mut();
8866 headers
8867 .insert(
8868 tonic::Status::GRPC_STATUS,
8869 (tonic::Code::Unimplemented as i32).into(),
8870 );
8871 headers
8872 .insert(
8873 http::header::CONTENT_TYPE,
8874 tonic::metadata::GRPC_CONTENT_TYPE,
8875 );
8876 Ok(response)
8877 })
8878 }
8879 }
8880 }
8881 }
8882 impl<T> Clone for RenderServiceServer<T> {
8883 fn clone(&self) -> Self {
8884 let inner = self.inner.clone();
8885 Self {
8886 inner,
8887 accept_compression_encodings: self.accept_compression_encodings,
8888 send_compression_encodings: self.send_compression_encodings,
8889 max_decoding_message_size: self.max_decoding_message_size,
8890 max_encoding_message_size: self.max_encoding_message_size,
8891 }
8892 }
8893 }
8894 pub const SERVICE_NAME: &str = "pidgr.v1.RenderService";
8896 impl<T> tonic::server::NamedService for RenderServiceServer<T> {
8897 const NAME: &'static str = SERVICE_NAME;
8898 }
8899}
8900pub mod replay_service_client {
8902 #![allow(
8903 unused_variables,
8904 dead_code,
8905 missing_docs,
8906 clippy::wildcard_imports,
8907 clippy::let_unit_value,
8908 )]
8909 use tonic::codegen::*;
8910 use tonic::codegen::http::Uri;
8911 #[derive(Debug, Clone)]
8915 pub struct ReplayServiceClient<T> {
8916 inner: tonic::client::Grpc<T>,
8917 }
8918 impl ReplayServiceClient<tonic::transport::Channel> {
8919 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
8921 where
8922 D: TryInto<tonic::transport::Endpoint>,
8923 D::Error: Into<StdError>,
8924 {
8925 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
8926 Ok(Self::new(conn))
8927 }
8928 }
8929 impl<T> ReplayServiceClient<T>
8930 where
8931 T: tonic::client::GrpcService<tonic::body::Body>,
8932 T::Error: Into<StdError>,
8933 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
8934 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
8935 {
8936 pub fn new(inner: T) -> Self {
8937 let inner = tonic::client::Grpc::new(inner);
8938 Self { inner }
8939 }
8940 pub fn with_origin(inner: T, origin: Uri) -> Self {
8941 let inner = tonic::client::Grpc::with_origin(inner, origin);
8942 Self { inner }
8943 }
8944 pub fn with_interceptor<F>(
8945 inner: T,
8946 interceptor: F,
8947 ) -> ReplayServiceClient<InterceptedService<T, F>>
8948 where
8949 F: tonic::service::Interceptor,
8950 T::ResponseBody: Default,
8951 T: tonic::codegen::Service<
8952 http::Request<tonic::body::Body>,
8953 Response = http::Response<
8954 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
8955 >,
8956 >,
8957 <T as tonic::codegen::Service<
8958 http::Request<tonic::body::Body>,
8959 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
8960 {
8961 ReplayServiceClient::new(InterceptedService::new(inner, interceptor))
8962 }
8963 #[must_use]
8968 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8969 self.inner = self.inner.send_compressed(encoding);
8970 self
8971 }
8972 #[must_use]
8974 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8975 self.inner = self.inner.accept_compressed(encoding);
8976 self
8977 }
8978 #[must_use]
8982 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8983 self.inner = self.inner.max_decoding_message_size(limit);
8984 self
8985 }
8986 #[must_use]
8990 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8991 self.inner = self.inner.max_encoding_message_size(limit);
8992 self
8993 }
8994 pub async fn list_session_recordings(
8998 &mut self,
8999 request: impl tonic::IntoRequest<super::ListSessionRecordingsRequest>,
9000 ) -> std::result::Result<
9001 tonic::Response<super::ListSessionRecordingsResponse>,
9002 tonic::Status,
9003 > {
9004 self.inner
9005 .ready()
9006 .await
9007 .map_err(|e| {
9008 tonic::Status::unknown(
9009 format!("Service was not ready: {}", e.into()),
9010 )
9011 })?;
9012 let codec = tonic_prost::ProstCodec::default();
9013 let path = http::uri::PathAndQuery::from_static(
9014 "/pidgr.v1.ReplayService/ListSessionRecordings",
9015 );
9016 let mut req = request.into_request();
9017 req.extensions_mut()
9018 .insert(
9019 GrpcMethod::new("pidgr.v1.ReplayService", "ListSessionRecordings"),
9020 );
9021 self.inner.unary(req, path, codec).await
9022 }
9023 pub async fn get_session_snapshots(
9027 &mut self,
9028 request: impl tonic::IntoRequest<super::GetSessionSnapshotsRequest>,
9029 ) -> std::result::Result<
9030 tonic::Response<super::GetSessionSnapshotsResponse>,
9031 tonic::Status,
9032 > {
9033 self.inner
9034 .ready()
9035 .await
9036 .map_err(|e| {
9037 tonic::Status::unknown(
9038 format!("Service was not ready: {}", e.into()),
9039 )
9040 })?;
9041 let codec = tonic_prost::ProstCodec::default();
9042 let path = http::uri::PathAndQuery::from_static(
9043 "/pidgr.v1.ReplayService/GetSessionSnapshots",
9044 );
9045 let mut req = request.into_request();
9046 req.extensions_mut()
9047 .insert(
9048 GrpcMethod::new("pidgr.v1.ReplayService", "GetSessionSnapshots"),
9049 );
9050 self.inner.unary(req, path, codec).await
9051 }
9052 }
9053}
9054pub mod replay_service_server {
9056 #![allow(
9057 unused_variables,
9058 dead_code,
9059 missing_docs,
9060 clippy::wildcard_imports,
9061 clippy::let_unit_value,
9062 )]
9063 use tonic::codegen::*;
9064 #[async_trait]
9066 pub trait ReplayService: std::marker::Send + std::marker::Sync + 'static {
9067 async fn list_session_recordings(
9071 &self,
9072 request: tonic::Request<super::ListSessionRecordingsRequest>,
9073 ) -> std::result::Result<
9074 tonic::Response<super::ListSessionRecordingsResponse>,
9075 tonic::Status,
9076 >;
9077 async fn get_session_snapshots(
9081 &self,
9082 request: tonic::Request<super::GetSessionSnapshotsRequest>,
9083 ) -> std::result::Result<
9084 tonic::Response<super::GetSessionSnapshotsResponse>,
9085 tonic::Status,
9086 >;
9087 }
9088 #[derive(Debug)]
9092 pub struct ReplayServiceServer<T> {
9093 inner: Arc<T>,
9094 accept_compression_encodings: EnabledCompressionEncodings,
9095 send_compression_encodings: EnabledCompressionEncodings,
9096 max_decoding_message_size: Option<usize>,
9097 max_encoding_message_size: Option<usize>,
9098 }
9099 impl<T> ReplayServiceServer<T> {
9100 pub fn new(inner: T) -> Self {
9101 Self::from_arc(Arc::new(inner))
9102 }
9103 pub fn from_arc(inner: Arc<T>) -> Self {
9104 Self {
9105 inner,
9106 accept_compression_encodings: Default::default(),
9107 send_compression_encodings: Default::default(),
9108 max_decoding_message_size: None,
9109 max_encoding_message_size: None,
9110 }
9111 }
9112 pub fn with_interceptor<F>(
9113 inner: T,
9114 interceptor: F,
9115 ) -> InterceptedService<Self, F>
9116 where
9117 F: tonic::service::Interceptor,
9118 {
9119 InterceptedService::new(Self::new(inner), interceptor)
9120 }
9121 #[must_use]
9123 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9124 self.accept_compression_encodings.enable(encoding);
9125 self
9126 }
9127 #[must_use]
9129 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9130 self.send_compression_encodings.enable(encoding);
9131 self
9132 }
9133 #[must_use]
9137 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9138 self.max_decoding_message_size = Some(limit);
9139 self
9140 }
9141 #[must_use]
9145 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9146 self.max_encoding_message_size = Some(limit);
9147 self
9148 }
9149 }
9150 impl<T, B> tonic::codegen::Service<http::Request<B>> for ReplayServiceServer<T>
9151 where
9152 T: ReplayService,
9153 B: Body + std::marker::Send + 'static,
9154 B::Error: Into<StdError> + std::marker::Send + 'static,
9155 {
9156 type Response = http::Response<tonic::body::Body>;
9157 type Error = std::convert::Infallible;
9158 type Future = BoxFuture<Self::Response, Self::Error>;
9159 fn poll_ready(
9160 &mut self,
9161 _cx: &mut Context<'_>,
9162 ) -> Poll<std::result::Result<(), Self::Error>> {
9163 Poll::Ready(Ok(()))
9164 }
9165 fn call(&mut self, req: http::Request<B>) -> Self::Future {
9166 match req.uri().path() {
9167 "/pidgr.v1.ReplayService/ListSessionRecordings" => {
9168 #[allow(non_camel_case_types)]
9169 struct ListSessionRecordingsSvc<T: ReplayService>(pub Arc<T>);
9170 impl<
9171 T: ReplayService,
9172 > tonic::server::UnaryService<super::ListSessionRecordingsRequest>
9173 for ListSessionRecordingsSvc<T> {
9174 type Response = super::ListSessionRecordingsResponse;
9175 type Future = BoxFuture<
9176 tonic::Response<Self::Response>,
9177 tonic::Status,
9178 >;
9179 fn call(
9180 &mut self,
9181 request: tonic::Request<super::ListSessionRecordingsRequest>,
9182 ) -> Self::Future {
9183 let inner = Arc::clone(&self.0);
9184 let fut = async move {
9185 <T as ReplayService>::list_session_recordings(
9186 &inner,
9187 request,
9188 )
9189 .await
9190 };
9191 Box::pin(fut)
9192 }
9193 }
9194 let accept_compression_encodings = self.accept_compression_encodings;
9195 let send_compression_encodings = self.send_compression_encodings;
9196 let max_decoding_message_size = self.max_decoding_message_size;
9197 let max_encoding_message_size = self.max_encoding_message_size;
9198 let inner = self.inner.clone();
9199 let fut = async move {
9200 let method = ListSessionRecordingsSvc(inner);
9201 let codec = tonic_prost::ProstCodec::default();
9202 let mut grpc = tonic::server::Grpc::new(codec)
9203 .apply_compression_config(
9204 accept_compression_encodings,
9205 send_compression_encodings,
9206 )
9207 .apply_max_message_size_config(
9208 max_decoding_message_size,
9209 max_encoding_message_size,
9210 );
9211 let res = grpc.unary(method, req).await;
9212 Ok(res)
9213 };
9214 Box::pin(fut)
9215 }
9216 "/pidgr.v1.ReplayService/GetSessionSnapshots" => {
9217 #[allow(non_camel_case_types)]
9218 struct GetSessionSnapshotsSvc<T: ReplayService>(pub Arc<T>);
9219 impl<
9220 T: ReplayService,
9221 > tonic::server::UnaryService<super::GetSessionSnapshotsRequest>
9222 for GetSessionSnapshotsSvc<T> {
9223 type Response = super::GetSessionSnapshotsResponse;
9224 type Future = BoxFuture<
9225 tonic::Response<Self::Response>,
9226 tonic::Status,
9227 >;
9228 fn call(
9229 &mut self,
9230 request: tonic::Request<super::GetSessionSnapshotsRequest>,
9231 ) -> Self::Future {
9232 let inner = Arc::clone(&self.0);
9233 let fut = async move {
9234 <T as ReplayService>::get_session_snapshots(&inner, request)
9235 .await
9236 };
9237 Box::pin(fut)
9238 }
9239 }
9240 let accept_compression_encodings = self.accept_compression_encodings;
9241 let send_compression_encodings = self.send_compression_encodings;
9242 let max_decoding_message_size = self.max_decoding_message_size;
9243 let max_encoding_message_size = self.max_encoding_message_size;
9244 let inner = self.inner.clone();
9245 let fut = async move {
9246 let method = GetSessionSnapshotsSvc(inner);
9247 let codec = tonic_prost::ProstCodec::default();
9248 let mut grpc = tonic::server::Grpc::new(codec)
9249 .apply_compression_config(
9250 accept_compression_encodings,
9251 send_compression_encodings,
9252 )
9253 .apply_max_message_size_config(
9254 max_decoding_message_size,
9255 max_encoding_message_size,
9256 );
9257 let res = grpc.unary(method, req).await;
9258 Ok(res)
9259 };
9260 Box::pin(fut)
9261 }
9262 _ => {
9263 Box::pin(async move {
9264 let mut response = http::Response::new(
9265 tonic::body::Body::default(),
9266 );
9267 let headers = response.headers_mut();
9268 headers
9269 .insert(
9270 tonic::Status::GRPC_STATUS,
9271 (tonic::Code::Unimplemented as i32).into(),
9272 );
9273 headers
9274 .insert(
9275 http::header::CONTENT_TYPE,
9276 tonic::metadata::GRPC_CONTENT_TYPE,
9277 );
9278 Ok(response)
9279 })
9280 }
9281 }
9282 }
9283 }
9284 impl<T> Clone for ReplayServiceServer<T> {
9285 fn clone(&self) -> Self {
9286 let inner = self.inner.clone();
9287 Self {
9288 inner,
9289 accept_compression_encodings: self.accept_compression_encodings,
9290 send_compression_encodings: self.send_compression_encodings,
9291 max_decoding_message_size: self.max_decoding_message_size,
9292 max_encoding_message_size: self.max_encoding_message_size,
9293 }
9294 }
9295 }
9296 pub const SERVICE_NAME: &str = "pidgr.v1.ReplayService";
9298 impl<T> tonic::server::NamedService for ReplayServiceServer<T> {
9299 const NAME: &'static str = SERVICE_NAME;
9300 }
9301}
9302pub mod role_service_client {
9304 #![allow(
9305 unused_variables,
9306 dead_code,
9307 missing_docs,
9308 clippy::wildcard_imports,
9309 clippy::let_unit_value,
9310 )]
9311 use tonic::codegen::*;
9312 use tonic::codegen::http::Uri;
9313 #[derive(Debug, Clone)]
9317 pub struct RoleServiceClient<T> {
9318 inner: tonic::client::Grpc<T>,
9319 }
9320 impl RoleServiceClient<tonic::transport::Channel> {
9321 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
9323 where
9324 D: TryInto<tonic::transport::Endpoint>,
9325 D::Error: Into<StdError>,
9326 {
9327 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
9328 Ok(Self::new(conn))
9329 }
9330 }
9331 impl<T> RoleServiceClient<T>
9332 where
9333 T: tonic::client::GrpcService<tonic::body::Body>,
9334 T::Error: Into<StdError>,
9335 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
9336 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
9337 {
9338 pub fn new(inner: T) -> Self {
9339 let inner = tonic::client::Grpc::new(inner);
9340 Self { inner }
9341 }
9342 pub fn with_origin(inner: T, origin: Uri) -> Self {
9343 let inner = tonic::client::Grpc::with_origin(inner, origin);
9344 Self { inner }
9345 }
9346 pub fn with_interceptor<F>(
9347 inner: T,
9348 interceptor: F,
9349 ) -> RoleServiceClient<InterceptedService<T, F>>
9350 where
9351 F: tonic::service::Interceptor,
9352 T::ResponseBody: Default,
9353 T: tonic::codegen::Service<
9354 http::Request<tonic::body::Body>,
9355 Response = http::Response<
9356 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
9357 >,
9358 >,
9359 <T as tonic::codegen::Service<
9360 http::Request<tonic::body::Body>,
9361 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
9362 {
9363 RoleServiceClient::new(InterceptedService::new(inner, interceptor))
9364 }
9365 #[must_use]
9370 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9371 self.inner = self.inner.send_compressed(encoding);
9372 self
9373 }
9374 #[must_use]
9376 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9377 self.inner = self.inner.accept_compressed(encoding);
9378 self
9379 }
9380 #[must_use]
9384 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9385 self.inner = self.inner.max_decoding_message_size(limit);
9386 self
9387 }
9388 #[must_use]
9392 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9393 self.inner = self.inner.max_encoding_message_size(limit);
9394 self
9395 }
9396 pub async fn list_roles(
9400 &mut self,
9401 request: impl tonic::IntoRequest<super::ListRolesRequest>,
9402 ) -> std::result::Result<
9403 tonic::Response<super::ListRolesResponse>,
9404 tonic::Status,
9405 > {
9406 self.inner
9407 .ready()
9408 .await
9409 .map_err(|e| {
9410 tonic::Status::unknown(
9411 format!("Service was not ready: {}", e.into()),
9412 )
9413 })?;
9414 let codec = tonic_prost::ProstCodec::default();
9415 let path = http::uri::PathAndQuery::from_static(
9416 "/pidgr.v1.RoleService/ListRoles",
9417 );
9418 let mut req = request.into_request();
9419 req.extensions_mut()
9420 .insert(GrpcMethod::new("pidgr.v1.RoleService", "ListRoles"));
9421 self.inner.unary(req, path, codec).await
9422 }
9423 pub async fn create_role(
9428 &mut self,
9429 request: impl tonic::IntoRequest<super::CreateRoleRequest>,
9430 ) -> std::result::Result<
9431 tonic::Response<super::CreateRoleResponse>,
9432 tonic::Status,
9433 > {
9434 self.inner
9435 .ready()
9436 .await
9437 .map_err(|e| {
9438 tonic::Status::unknown(
9439 format!("Service was not ready: {}", e.into()),
9440 )
9441 })?;
9442 let codec = tonic_prost::ProstCodec::default();
9443 let path = http::uri::PathAndQuery::from_static(
9444 "/pidgr.v1.RoleService/CreateRole",
9445 );
9446 let mut req = request.into_request();
9447 req.extensions_mut()
9448 .insert(GrpcMethod::new("pidgr.v1.RoleService", "CreateRole"));
9449 self.inner.unary(req, path, codec).await
9450 }
9451 pub async fn update_role(
9456 &mut self,
9457 request: impl tonic::IntoRequest<super::UpdateRoleRequest>,
9458 ) -> std::result::Result<
9459 tonic::Response<super::UpdateRoleResponse>,
9460 tonic::Status,
9461 > {
9462 self.inner
9463 .ready()
9464 .await
9465 .map_err(|e| {
9466 tonic::Status::unknown(
9467 format!("Service was not ready: {}", e.into()),
9468 )
9469 })?;
9470 let codec = tonic_prost::ProstCodec::default();
9471 let path = http::uri::PathAndQuery::from_static(
9472 "/pidgr.v1.RoleService/UpdateRole",
9473 );
9474 let mut req = request.into_request();
9475 req.extensions_mut()
9476 .insert(GrpcMethod::new("pidgr.v1.RoleService", "UpdateRole"));
9477 self.inner.unary(req, path, codec).await
9478 }
9479 pub async fn delete_role(
9484 &mut self,
9485 request: impl tonic::IntoRequest<super::DeleteRoleRequest>,
9486 ) -> std::result::Result<
9487 tonic::Response<super::DeleteRoleResponse>,
9488 tonic::Status,
9489 > {
9490 self.inner
9491 .ready()
9492 .await
9493 .map_err(|e| {
9494 tonic::Status::unknown(
9495 format!("Service was not ready: {}", e.into()),
9496 )
9497 })?;
9498 let codec = tonic_prost::ProstCodec::default();
9499 let path = http::uri::PathAndQuery::from_static(
9500 "/pidgr.v1.RoleService/DeleteRole",
9501 );
9502 let mut req = request.into_request();
9503 req.extensions_mut()
9504 .insert(GrpcMethod::new("pidgr.v1.RoleService", "DeleteRole"));
9505 self.inner.unary(req, path, codec).await
9506 }
9507 }
9508}
9509pub mod role_service_server {
9511 #![allow(
9512 unused_variables,
9513 dead_code,
9514 missing_docs,
9515 clippy::wildcard_imports,
9516 clippy::let_unit_value,
9517 )]
9518 use tonic::codegen::*;
9519 #[async_trait]
9521 pub trait RoleService: std::marker::Send + std::marker::Sync + 'static {
9522 async fn list_roles(
9526 &self,
9527 request: tonic::Request<super::ListRolesRequest>,
9528 ) -> std::result::Result<
9529 tonic::Response<super::ListRolesResponse>,
9530 tonic::Status,
9531 >;
9532 async fn create_role(
9537 &self,
9538 request: tonic::Request<super::CreateRoleRequest>,
9539 ) -> std::result::Result<
9540 tonic::Response<super::CreateRoleResponse>,
9541 tonic::Status,
9542 >;
9543 async fn update_role(
9548 &self,
9549 request: tonic::Request<super::UpdateRoleRequest>,
9550 ) -> std::result::Result<
9551 tonic::Response<super::UpdateRoleResponse>,
9552 tonic::Status,
9553 >;
9554 async fn delete_role(
9559 &self,
9560 request: tonic::Request<super::DeleteRoleRequest>,
9561 ) -> std::result::Result<
9562 tonic::Response<super::DeleteRoleResponse>,
9563 tonic::Status,
9564 >;
9565 }
9566 #[derive(Debug)]
9570 pub struct RoleServiceServer<T> {
9571 inner: Arc<T>,
9572 accept_compression_encodings: EnabledCompressionEncodings,
9573 send_compression_encodings: EnabledCompressionEncodings,
9574 max_decoding_message_size: Option<usize>,
9575 max_encoding_message_size: Option<usize>,
9576 }
9577 impl<T> RoleServiceServer<T> {
9578 pub fn new(inner: T) -> Self {
9579 Self::from_arc(Arc::new(inner))
9580 }
9581 pub fn from_arc(inner: Arc<T>) -> Self {
9582 Self {
9583 inner,
9584 accept_compression_encodings: Default::default(),
9585 send_compression_encodings: Default::default(),
9586 max_decoding_message_size: None,
9587 max_encoding_message_size: None,
9588 }
9589 }
9590 pub fn with_interceptor<F>(
9591 inner: T,
9592 interceptor: F,
9593 ) -> InterceptedService<Self, F>
9594 where
9595 F: tonic::service::Interceptor,
9596 {
9597 InterceptedService::new(Self::new(inner), interceptor)
9598 }
9599 #[must_use]
9601 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9602 self.accept_compression_encodings.enable(encoding);
9603 self
9604 }
9605 #[must_use]
9607 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9608 self.send_compression_encodings.enable(encoding);
9609 self
9610 }
9611 #[must_use]
9615 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9616 self.max_decoding_message_size = Some(limit);
9617 self
9618 }
9619 #[must_use]
9623 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9624 self.max_encoding_message_size = Some(limit);
9625 self
9626 }
9627 }
9628 impl<T, B> tonic::codegen::Service<http::Request<B>> for RoleServiceServer<T>
9629 where
9630 T: RoleService,
9631 B: Body + std::marker::Send + 'static,
9632 B::Error: Into<StdError> + std::marker::Send + 'static,
9633 {
9634 type Response = http::Response<tonic::body::Body>;
9635 type Error = std::convert::Infallible;
9636 type Future = BoxFuture<Self::Response, Self::Error>;
9637 fn poll_ready(
9638 &mut self,
9639 _cx: &mut Context<'_>,
9640 ) -> Poll<std::result::Result<(), Self::Error>> {
9641 Poll::Ready(Ok(()))
9642 }
9643 fn call(&mut self, req: http::Request<B>) -> Self::Future {
9644 match req.uri().path() {
9645 "/pidgr.v1.RoleService/ListRoles" => {
9646 #[allow(non_camel_case_types)]
9647 struct ListRolesSvc<T: RoleService>(pub Arc<T>);
9648 impl<
9649 T: RoleService,
9650 > tonic::server::UnaryService<super::ListRolesRequest>
9651 for ListRolesSvc<T> {
9652 type Response = super::ListRolesResponse;
9653 type Future = BoxFuture<
9654 tonic::Response<Self::Response>,
9655 tonic::Status,
9656 >;
9657 fn call(
9658 &mut self,
9659 request: tonic::Request<super::ListRolesRequest>,
9660 ) -> Self::Future {
9661 let inner = Arc::clone(&self.0);
9662 let fut = async move {
9663 <T as RoleService>::list_roles(&inner, request).await
9664 };
9665 Box::pin(fut)
9666 }
9667 }
9668 let accept_compression_encodings = self.accept_compression_encodings;
9669 let send_compression_encodings = self.send_compression_encodings;
9670 let max_decoding_message_size = self.max_decoding_message_size;
9671 let max_encoding_message_size = self.max_encoding_message_size;
9672 let inner = self.inner.clone();
9673 let fut = async move {
9674 let method = ListRolesSvc(inner);
9675 let codec = tonic_prost::ProstCodec::default();
9676 let mut grpc = tonic::server::Grpc::new(codec)
9677 .apply_compression_config(
9678 accept_compression_encodings,
9679 send_compression_encodings,
9680 )
9681 .apply_max_message_size_config(
9682 max_decoding_message_size,
9683 max_encoding_message_size,
9684 );
9685 let res = grpc.unary(method, req).await;
9686 Ok(res)
9687 };
9688 Box::pin(fut)
9689 }
9690 "/pidgr.v1.RoleService/CreateRole" => {
9691 #[allow(non_camel_case_types)]
9692 struct CreateRoleSvc<T: RoleService>(pub Arc<T>);
9693 impl<
9694 T: RoleService,
9695 > tonic::server::UnaryService<super::CreateRoleRequest>
9696 for CreateRoleSvc<T> {
9697 type Response = super::CreateRoleResponse;
9698 type Future = BoxFuture<
9699 tonic::Response<Self::Response>,
9700 tonic::Status,
9701 >;
9702 fn call(
9703 &mut self,
9704 request: tonic::Request<super::CreateRoleRequest>,
9705 ) -> Self::Future {
9706 let inner = Arc::clone(&self.0);
9707 let fut = async move {
9708 <T as RoleService>::create_role(&inner, request).await
9709 };
9710 Box::pin(fut)
9711 }
9712 }
9713 let accept_compression_encodings = self.accept_compression_encodings;
9714 let send_compression_encodings = self.send_compression_encodings;
9715 let max_decoding_message_size = self.max_decoding_message_size;
9716 let max_encoding_message_size = self.max_encoding_message_size;
9717 let inner = self.inner.clone();
9718 let fut = async move {
9719 let method = CreateRoleSvc(inner);
9720 let codec = tonic_prost::ProstCodec::default();
9721 let mut grpc = tonic::server::Grpc::new(codec)
9722 .apply_compression_config(
9723 accept_compression_encodings,
9724 send_compression_encodings,
9725 )
9726 .apply_max_message_size_config(
9727 max_decoding_message_size,
9728 max_encoding_message_size,
9729 );
9730 let res = grpc.unary(method, req).await;
9731 Ok(res)
9732 };
9733 Box::pin(fut)
9734 }
9735 "/pidgr.v1.RoleService/UpdateRole" => {
9736 #[allow(non_camel_case_types)]
9737 struct UpdateRoleSvc<T: RoleService>(pub Arc<T>);
9738 impl<
9739 T: RoleService,
9740 > tonic::server::UnaryService<super::UpdateRoleRequest>
9741 for UpdateRoleSvc<T> {
9742 type Response = super::UpdateRoleResponse;
9743 type Future = BoxFuture<
9744 tonic::Response<Self::Response>,
9745 tonic::Status,
9746 >;
9747 fn call(
9748 &mut self,
9749 request: tonic::Request<super::UpdateRoleRequest>,
9750 ) -> Self::Future {
9751 let inner = Arc::clone(&self.0);
9752 let fut = async move {
9753 <T as RoleService>::update_role(&inner, request).await
9754 };
9755 Box::pin(fut)
9756 }
9757 }
9758 let accept_compression_encodings = self.accept_compression_encodings;
9759 let send_compression_encodings = self.send_compression_encodings;
9760 let max_decoding_message_size = self.max_decoding_message_size;
9761 let max_encoding_message_size = self.max_encoding_message_size;
9762 let inner = self.inner.clone();
9763 let fut = async move {
9764 let method = UpdateRoleSvc(inner);
9765 let codec = tonic_prost::ProstCodec::default();
9766 let mut grpc = tonic::server::Grpc::new(codec)
9767 .apply_compression_config(
9768 accept_compression_encodings,
9769 send_compression_encodings,
9770 )
9771 .apply_max_message_size_config(
9772 max_decoding_message_size,
9773 max_encoding_message_size,
9774 );
9775 let res = grpc.unary(method, req).await;
9776 Ok(res)
9777 };
9778 Box::pin(fut)
9779 }
9780 "/pidgr.v1.RoleService/DeleteRole" => {
9781 #[allow(non_camel_case_types)]
9782 struct DeleteRoleSvc<T: RoleService>(pub Arc<T>);
9783 impl<
9784 T: RoleService,
9785 > tonic::server::UnaryService<super::DeleteRoleRequest>
9786 for DeleteRoleSvc<T> {
9787 type Response = super::DeleteRoleResponse;
9788 type Future = BoxFuture<
9789 tonic::Response<Self::Response>,
9790 tonic::Status,
9791 >;
9792 fn call(
9793 &mut self,
9794 request: tonic::Request<super::DeleteRoleRequest>,
9795 ) -> Self::Future {
9796 let inner = Arc::clone(&self.0);
9797 let fut = async move {
9798 <T as RoleService>::delete_role(&inner, request).await
9799 };
9800 Box::pin(fut)
9801 }
9802 }
9803 let accept_compression_encodings = self.accept_compression_encodings;
9804 let send_compression_encodings = self.send_compression_encodings;
9805 let max_decoding_message_size = self.max_decoding_message_size;
9806 let max_encoding_message_size = self.max_encoding_message_size;
9807 let inner = self.inner.clone();
9808 let fut = async move {
9809 let method = DeleteRoleSvc(inner);
9810 let codec = tonic_prost::ProstCodec::default();
9811 let mut grpc = tonic::server::Grpc::new(codec)
9812 .apply_compression_config(
9813 accept_compression_encodings,
9814 send_compression_encodings,
9815 )
9816 .apply_max_message_size_config(
9817 max_decoding_message_size,
9818 max_encoding_message_size,
9819 );
9820 let res = grpc.unary(method, req).await;
9821 Ok(res)
9822 };
9823 Box::pin(fut)
9824 }
9825 _ => {
9826 Box::pin(async move {
9827 let mut response = http::Response::new(
9828 tonic::body::Body::default(),
9829 );
9830 let headers = response.headers_mut();
9831 headers
9832 .insert(
9833 tonic::Status::GRPC_STATUS,
9834 (tonic::Code::Unimplemented as i32).into(),
9835 );
9836 headers
9837 .insert(
9838 http::header::CONTENT_TYPE,
9839 tonic::metadata::GRPC_CONTENT_TYPE,
9840 );
9841 Ok(response)
9842 })
9843 }
9844 }
9845 }
9846 }
9847 impl<T> Clone for RoleServiceServer<T> {
9848 fn clone(&self) -> Self {
9849 let inner = self.inner.clone();
9850 Self {
9851 inner,
9852 accept_compression_encodings: self.accept_compression_encodings,
9853 send_compression_encodings: self.send_compression_encodings,
9854 max_decoding_message_size: self.max_decoding_message_size,
9855 max_encoding_message_size: self.max_encoding_message_size,
9856 }
9857 }
9858 }
9859 pub const SERVICE_NAME: &str = "pidgr.v1.RoleService";
9861 impl<T> tonic::server::NamedService for RoleServiceServer<T> {
9862 const NAME: &'static str = SERVICE_NAME;
9863 }
9864}
9865pub mod sso_service_client {
9867 #![allow(
9868 unused_variables,
9869 dead_code,
9870 missing_docs,
9871 clippy::wildcard_imports,
9872 clippy::let_unit_value,
9873 )]
9874 use tonic::codegen::*;
9875 use tonic::codegen::http::Uri;
9876 #[derive(Debug, Clone)]
9879 pub struct SsoServiceClient<T> {
9880 inner: tonic::client::Grpc<T>,
9881 }
9882 impl SsoServiceClient<tonic::transport::Channel> {
9883 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
9885 where
9886 D: TryInto<tonic::transport::Endpoint>,
9887 D::Error: Into<StdError>,
9888 {
9889 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
9890 Ok(Self::new(conn))
9891 }
9892 }
9893 impl<T> SsoServiceClient<T>
9894 where
9895 T: tonic::client::GrpcService<tonic::body::Body>,
9896 T::Error: Into<StdError>,
9897 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
9898 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
9899 {
9900 pub fn new(inner: T) -> Self {
9901 let inner = tonic::client::Grpc::new(inner);
9902 Self { inner }
9903 }
9904 pub fn with_origin(inner: T, origin: Uri) -> Self {
9905 let inner = tonic::client::Grpc::with_origin(inner, origin);
9906 Self { inner }
9907 }
9908 pub fn with_interceptor<F>(
9909 inner: T,
9910 interceptor: F,
9911 ) -> SsoServiceClient<InterceptedService<T, F>>
9912 where
9913 F: tonic::service::Interceptor,
9914 T::ResponseBody: Default,
9915 T: tonic::codegen::Service<
9916 http::Request<tonic::body::Body>,
9917 Response = http::Response<
9918 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
9919 >,
9920 >,
9921 <T as tonic::codegen::Service<
9922 http::Request<tonic::body::Body>,
9923 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
9924 {
9925 SsoServiceClient::new(InterceptedService::new(inner, interceptor))
9926 }
9927 #[must_use]
9932 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9933 self.inner = self.inner.send_compressed(encoding);
9934 self
9935 }
9936 #[must_use]
9938 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9939 self.inner = self.inner.accept_compressed(encoding);
9940 self
9941 }
9942 #[must_use]
9946 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9947 self.inner = self.inner.max_decoding_message_size(limit);
9948 self
9949 }
9950 #[must_use]
9954 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9955 self.inner = self.inner.max_encoding_message_size(limit);
9956 self
9957 }
9958 pub async fn check_sso_by_domain(
9963 &mut self,
9964 request: impl tonic::IntoRequest<super::CheckSsoByDomainRequest>,
9965 ) -> std::result::Result<
9966 tonic::Response<super::CheckSsoByDomainResponse>,
9967 tonic::Status,
9968 > {
9969 self.inner
9970 .ready()
9971 .await
9972 .map_err(|e| {
9973 tonic::Status::unknown(
9974 format!("Service was not ready: {}", e.into()),
9975 )
9976 })?;
9977 let codec = tonic_prost::ProstCodec::default();
9978 let path = http::uri::PathAndQuery::from_static(
9979 "/pidgr.v1.SSOService/CheckSSOByDomain",
9980 );
9981 let mut req = request.into_request();
9982 req.extensions_mut()
9983 .insert(GrpcMethod::new("pidgr.v1.SSOService", "CheckSSOByDomain"));
9984 self.inner.unary(req, path, codec).await
9985 }
9986 pub async fn create_sso_provider(
9992 &mut self,
9993 request: impl tonic::IntoRequest<super::CreateSsoProviderRequest>,
9994 ) -> std::result::Result<
9995 tonic::Response<super::CreateSsoProviderResponse>,
9996 tonic::Status,
9997 > {
9998 self.inner
9999 .ready()
10000 .await
10001 .map_err(|e| {
10002 tonic::Status::unknown(
10003 format!("Service was not ready: {}", e.into()),
10004 )
10005 })?;
10006 let codec = tonic_prost::ProstCodec::default();
10007 let path = http::uri::PathAndQuery::from_static(
10008 "/pidgr.v1.SSOService/CreateSSOProvider",
10009 );
10010 let mut req = request.into_request();
10011 req.extensions_mut()
10012 .insert(GrpcMethod::new("pidgr.v1.SSOService", "CreateSSOProvider"));
10013 self.inner.unary(req, path, codec).await
10014 }
10015 pub async fn get_sso_provider(
10019 &mut self,
10020 request: impl tonic::IntoRequest<super::GetSsoProviderRequest>,
10021 ) -> std::result::Result<
10022 tonic::Response<super::GetSsoProviderResponse>,
10023 tonic::Status,
10024 > {
10025 self.inner
10026 .ready()
10027 .await
10028 .map_err(|e| {
10029 tonic::Status::unknown(
10030 format!("Service was not ready: {}", e.into()),
10031 )
10032 })?;
10033 let codec = tonic_prost::ProstCodec::default();
10034 let path = http::uri::PathAndQuery::from_static(
10035 "/pidgr.v1.SSOService/GetSSOProvider",
10036 );
10037 let mut req = request.into_request();
10038 req.extensions_mut()
10039 .insert(GrpcMethod::new("pidgr.v1.SSOService", "GetSSOProvider"));
10040 self.inner.unary(req, path, codec).await
10041 }
10042 pub async fn delete_sso_provider(
10048 &mut self,
10049 request: impl tonic::IntoRequest<super::DeleteSsoProviderRequest>,
10050 ) -> std::result::Result<
10051 tonic::Response<super::DeleteSsoProviderResponse>,
10052 tonic::Status,
10053 > {
10054 self.inner
10055 .ready()
10056 .await
10057 .map_err(|e| {
10058 tonic::Status::unknown(
10059 format!("Service was not ready: {}", e.into()),
10060 )
10061 })?;
10062 let codec = tonic_prost::ProstCodec::default();
10063 let path = http::uri::PathAndQuery::from_static(
10064 "/pidgr.v1.SSOService/DeleteSSOProvider",
10065 );
10066 let mut req = request.into_request();
10067 req.extensions_mut()
10068 .insert(GrpcMethod::new("pidgr.v1.SSOService", "DeleteSSOProvider"));
10069 self.inner.unary(req, path, codec).await
10070 }
10071 }
10072}
10073pub mod sso_service_server {
10075 #![allow(
10076 unused_variables,
10077 dead_code,
10078 missing_docs,
10079 clippy::wildcard_imports,
10080 clippy::let_unit_value,
10081 )]
10082 use tonic::codegen::*;
10083 #[async_trait]
10085 pub trait SsoService: std::marker::Send + std::marker::Sync + 'static {
10086 async fn check_sso_by_domain(
10091 &self,
10092 request: tonic::Request<super::CheckSsoByDomainRequest>,
10093 ) -> std::result::Result<
10094 tonic::Response<super::CheckSsoByDomainResponse>,
10095 tonic::Status,
10096 >;
10097 async fn create_sso_provider(
10103 &self,
10104 request: tonic::Request<super::CreateSsoProviderRequest>,
10105 ) -> std::result::Result<
10106 tonic::Response<super::CreateSsoProviderResponse>,
10107 tonic::Status,
10108 >;
10109 async fn get_sso_provider(
10113 &self,
10114 request: tonic::Request<super::GetSsoProviderRequest>,
10115 ) -> std::result::Result<
10116 tonic::Response<super::GetSsoProviderResponse>,
10117 tonic::Status,
10118 >;
10119 async fn delete_sso_provider(
10125 &self,
10126 request: tonic::Request<super::DeleteSsoProviderRequest>,
10127 ) -> std::result::Result<
10128 tonic::Response<super::DeleteSsoProviderResponse>,
10129 tonic::Status,
10130 >;
10131 }
10132 #[derive(Debug)]
10135 pub struct SsoServiceServer<T> {
10136 inner: Arc<T>,
10137 accept_compression_encodings: EnabledCompressionEncodings,
10138 send_compression_encodings: EnabledCompressionEncodings,
10139 max_decoding_message_size: Option<usize>,
10140 max_encoding_message_size: Option<usize>,
10141 }
10142 impl<T> SsoServiceServer<T> {
10143 pub fn new(inner: T) -> Self {
10144 Self::from_arc(Arc::new(inner))
10145 }
10146 pub fn from_arc(inner: Arc<T>) -> Self {
10147 Self {
10148 inner,
10149 accept_compression_encodings: Default::default(),
10150 send_compression_encodings: Default::default(),
10151 max_decoding_message_size: None,
10152 max_encoding_message_size: None,
10153 }
10154 }
10155 pub fn with_interceptor<F>(
10156 inner: T,
10157 interceptor: F,
10158 ) -> InterceptedService<Self, F>
10159 where
10160 F: tonic::service::Interceptor,
10161 {
10162 InterceptedService::new(Self::new(inner), interceptor)
10163 }
10164 #[must_use]
10166 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10167 self.accept_compression_encodings.enable(encoding);
10168 self
10169 }
10170 #[must_use]
10172 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10173 self.send_compression_encodings.enable(encoding);
10174 self
10175 }
10176 #[must_use]
10180 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10181 self.max_decoding_message_size = Some(limit);
10182 self
10183 }
10184 #[must_use]
10188 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10189 self.max_encoding_message_size = Some(limit);
10190 self
10191 }
10192 }
10193 impl<T, B> tonic::codegen::Service<http::Request<B>> for SsoServiceServer<T>
10194 where
10195 T: SsoService,
10196 B: Body + std::marker::Send + 'static,
10197 B::Error: Into<StdError> + std::marker::Send + 'static,
10198 {
10199 type Response = http::Response<tonic::body::Body>;
10200 type Error = std::convert::Infallible;
10201 type Future = BoxFuture<Self::Response, Self::Error>;
10202 fn poll_ready(
10203 &mut self,
10204 _cx: &mut Context<'_>,
10205 ) -> Poll<std::result::Result<(), Self::Error>> {
10206 Poll::Ready(Ok(()))
10207 }
10208 fn call(&mut self, req: http::Request<B>) -> Self::Future {
10209 match req.uri().path() {
10210 "/pidgr.v1.SSOService/CheckSSOByDomain" => {
10211 #[allow(non_camel_case_types)]
10212 struct CheckSSOByDomainSvc<T: SsoService>(pub Arc<T>);
10213 impl<
10214 T: SsoService,
10215 > tonic::server::UnaryService<super::CheckSsoByDomainRequest>
10216 for CheckSSOByDomainSvc<T> {
10217 type Response = super::CheckSsoByDomainResponse;
10218 type Future = BoxFuture<
10219 tonic::Response<Self::Response>,
10220 tonic::Status,
10221 >;
10222 fn call(
10223 &mut self,
10224 request: tonic::Request<super::CheckSsoByDomainRequest>,
10225 ) -> Self::Future {
10226 let inner = Arc::clone(&self.0);
10227 let fut = async move {
10228 <T as SsoService>::check_sso_by_domain(&inner, request)
10229 .await
10230 };
10231 Box::pin(fut)
10232 }
10233 }
10234 let accept_compression_encodings = self.accept_compression_encodings;
10235 let send_compression_encodings = self.send_compression_encodings;
10236 let max_decoding_message_size = self.max_decoding_message_size;
10237 let max_encoding_message_size = self.max_encoding_message_size;
10238 let inner = self.inner.clone();
10239 let fut = async move {
10240 let method = CheckSSOByDomainSvc(inner);
10241 let codec = tonic_prost::ProstCodec::default();
10242 let mut grpc = tonic::server::Grpc::new(codec)
10243 .apply_compression_config(
10244 accept_compression_encodings,
10245 send_compression_encodings,
10246 )
10247 .apply_max_message_size_config(
10248 max_decoding_message_size,
10249 max_encoding_message_size,
10250 );
10251 let res = grpc.unary(method, req).await;
10252 Ok(res)
10253 };
10254 Box::pin(fut)
10255 }
10256 "/pidgr.v1.SSOService/CreateSSOProvider" => {
10257 #[allow(non_camel_case_types)]
10258 struct CreateSSOProviderSvc<T: SsoService>(pub Arc<T>);
10259 impl<
10260 T: SsoService,
10261 > tonic::server::UnaryService<super::CreateSsoProviderRequest>
10262 for CreateSSOProviderSvc<T> {
10263 type Response = super::CreateSsoProviderResponse;
10264 type Future = BoxFuture<
10265 tonic::Response<Self::Response>,
10266 tonic::Status,
10267 >;
10268 fn call(
10269 &mut self,
10270 request: tonic::Request<super::CreateSsoProviderRequest>,
10271 ) -> Self::Future {
10272 let inner = Arc::clone(&self.0);
10273 let fut = async move {
10274 <T as SsoService>::create_sso_provider(&inner, request)
10275 .await
10276 };
10277 Box::pin(fut)
10278 }
10279 }
10280 let accept_compression_encodings = self.accept_compression_encodings;
10281 let send_compression_encodings = self.send_compression_encodings;
10282 let max_decoding_message_size = self.max_decoding_message_size;
10283 let max_encoding_message_size = self.max_encoding_message_size;
10284 let inner = self.inner.clone();
10285 let fut = async move {
10286 let method = CreateSSOProviderSvc(inner);
10287 let codec = tonic_prost::ProstCodec::default();
10288 let mut grpc = tonic::server::Grpc::new(codec)
10289 .apply_compression_config(
10290 accept_compression_encodings,
10291 send_compression_encodings,
10292 )
10293 .apply_max_message_size_config(
10294 max_decoding_message_size,
10295 max_encoding_message_size,
10296 );
10297 let res = grpc.unary(method, req).await;
10298 Ok(res)
10299 };
10300 Box::pin(fut)
10301 }
10302 "/pidgr.v1.SSOService/GetSSOProvider" => {
10303 #[allow(non_camel_case_types)]
10304 struct GetSSOProviderSvc<T: SsoService>(pub Arc<T>);
10305 impl<
10306 T: SsoService,
10307 > tonic::server::UnaryService<super::GetSsoProviderRequest>
10308 for GetSSOProviderSvc<T> {
10309 type Response = super::GetSsoProviderResponse;
10310 type Future = BoxFuture<
10311 tonic::Response<Self::Response>,
10312 tonic::Status,
10313 >;
10314 fn call(
10315 &mut self,
10316 request: tonic::Request<super::GetSsoProviderRequest>,
10317 ) -> Self::Future {
10318 let inner = Arc::clone(&self.0);
10319 let fut = async move {
10320 <T as SsoService>::get_sso_provider(&inner, request).await
10321 };
10322 Box::pin(fut)
10323 }
10324 }
10325 let accept_compression_encodings = self.accept_compression_encodings;
10326 let send_compression_encodings = self.send_compression_encodings;
10327 let max_decoding_message_size = self.max_decoding_message_size;
10328 let max_encoding_message_size = self.max_encoding_message_size;
10329 let inner = self.inner.clone();
10330 let fut = async move {
10331 let method = GetSSOProviderSvc(inner);
10332 let codec = tonic_prost::ProstCodec::default();
10333 let mut grpc = tonic::server::Grpc::new(codec)
10334 .apply_compression_config(
10335 accept_compression_encodings,
10336 send_compression_encodings,
10337 )
10338 .apply_max_message_size_config(
10339 max_decoding_message_size,
10340 max_encoding_message_size,
10341 );
10342 let res = grpc.unary(method, req).await;
10343 Ok(res)
10344 };
10345 Box::pin(fut)
10346 }
10347 "/pidgr.v1.SSOService/DeleteSSOProvider" => {
10348 #[allow(non_camel_case_types)]
10349 struct DeleteSSOProviderSvc<T: SsoService>(pub Arc<T>);
10350 impl<
10351 T: SsoService,
10352 > tonic::server::UnaryService<super::DeleteSsoProviderRequest>
10353 for DeleteSSOProviderSvc<T> {
10354 type Response = super::DeleteSsoProviderResponse;
10355 type Future = BoxFuture<
10356 tonic::Response<Self::Response>,
10357 tonic::Status,
10358 >;
10359 fn call(
10360 &mut self,
10361 request: tonic::Request<super::DeleteSsoProviderRequest>,
10362 ) -> Self::Future {
10363 let inner = Arc::clone(&self.0);
10364 let fut = async move {
10365 <T as SsoService>::delete_sso_provider(&inner, request)
10366 .await
10367 };
10368 Box::pin(fut)
10369 }
10370 }
10371 let accept_compression_encodings = self.accept_compression_encodings;
10372 let send_compression_encodings = self.send_compression_encodings;
10373 let max_decoding_message_size = self.max_decoding_message_size;
10374 let max_encoding_message_size = self.max_encoding_message_size;
10375 let inner = self.inner.clone();
10376 let fut = async move {
10377 let method = DeleteSSOProviderSvc(inner);
10378 let codec = tonic_prost::ProstCodec::default();
10379 let mut grpc = tonic::server::Grpc::new(codec)
10380 .apply_compression_config(
10381 accept_compression_encodings,
10382 send_compression_encodings,
10383 )
10384 .apply_max_message_size_config(
10385 max_decoding_message_size,
10386 max_encoding_message_size,
10387 );
10388 let res = grpc.unary(method, req).await;
10389 Ok(res)
10390 };
10391 Box::pin(fut)
10392 }
10393 _ => {
10394 Box::pin(async move {
10395 let mut response = http::Response::new(
10396 tonic::body::Body::default(),
10397 );
10398 let headers = response.headers_mut();
10399 headers
10400 .insert(
10401 tonic::Status::GRPC_STATUS,
10402 (tonic::Code::Unimplemented as i32).into(),
10403 );
10404 headers
10405 .insert(
10406 http::header::CONTENT_TYPE,
10407 tonic::metadata::GRPC_CONTENT_TYPE,
10408 );
10409 Ok(response)
10410 })
10411 }
10412 }
10413 }
10414 }
10415 impl<T> Clone for SsoServiceServer<T> {
10416 fn clone(&self) -> Self {
10417 let inner = self.inner.clone();
10418 Self {
10419 inner,
10420 accept_compression_encodings: self.accept_compression_encodings,
10421 send_compression_encodings: self.send_compression_encodings,
10422 max_decoding_message_size: self.max_decoding_message_size,
10423 max_encoding_message_size: self.max_encoding_message_size,
10424 }
10425 }
10426 }
10427 pub const SERVICE_NAME: &str = "pidgr.v1.SSOService";
10429 impl<T> tonic::server::NamedService for SsoServiceServer<T> {
10430 const NAME: &'static str = SERVICE_NAME;
10431 }
10432}
10433pub mod team_service_client {
10435 #![allow(
10436 unused_variables,
10437 dead_code,
10438 missing_docs,
10439 clippy::wildcard_imports,
10440 clippy::let_unit_value,
10441 )]
10442 use tonic::codegen::*;
10443 use tonic::codegen::http::Uri;
10444 #[derive(Debug, Clone)]
10449 pub struct TeamServiceClient<T> {
10450 inner: tonic::client::Grpc<T>,
10451 }
10452 impl TeamServiceClient<tonic::transport::Channel> {
10453 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
10455 where
10456 D: TryInto<tonic::transport::Endpoint>,
10457 D::Error: Into<StdError>,
10458 {
10459 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
10460 Ok(Self::new(conn))
10461 }
10462 }
10463 impl<T> TeamServiceClient<T>
10464 where
10465 T: tonic::client::GrpcService<tonic::body::Body>,
10466 T::Error: Into<StdError>,
10467 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
10468 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
10469 {
10470 pub fn new(inner: T) -> Self {
10471 let inner = tonic::client::Grpc::new(inner);
10472 Self { inner }
10473 }
10474 pub fn with_origin(inner: T, origin: Uri) -> Self {
10475 let inner = tonic::client::Grpc::with_origin(inner, origin);
10476 Self { inner }
10477 }
10478 pub fn with_interceptor<F>(
10479 inner: T,
10480 interceptor: F,
10481 ) -> TeamServiceClient<InterceptedService<T, F>>
10482 where
10483 F: tonic::service::Interceptor,
10484 T::ResponseBody: Default,
10485 T: tonic::codegen::Service<
10486 http::Request<tonic::body::Body>,
10487 Response = http::Response<
10488 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
10489 >,
10490 >,
10491 <T as tonic::codegen::Service<
10492 http::Request<tonic::body::Body>,
10493 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
10494 {
10495 TeamServiceClient::new(InterceptedService::new(inner, interceptor))
10496 }
10497 #[must_use]
10502 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10503 self.inner = self.inner.send_compressed(encoding);
10504 self
10505 }
10506 #[must_use]
10508 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10509 self.inner = self.inner.accept_compressed(encoding);
10510 self
10511 }
10512 #[must_use]
10516 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10517 self.inner = self.inner.max_decoding_message_size(limit);
10518 self
10519 }
10520 #[must_use]
10524 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10525 self.inner = self.inner.max_encoding_message_size(limit);
10526 self
10527 }
10528 pub async fn create_team(
10532 &mut self,
10533 request: impl tonic::IntoRequest<super::CreateTeamRequest>,
10534 ) -> std::result::Result<
10535 tonic::Response<super::CreateTeamResponse>,
10536 tonic::Status,
10537 > {
10538 self.inner
10539 .ready()
10540 .await
10541 .map_err(|e| {
10542 tonic::Status::unknown(
10543 format!("Service was not ready: {}", e.into()),
10544 )
10545 })?;
10546 let codec = tonic_prost::ProstCodec::default();
10547 let path = http::uri::PathAndQuery::from_static(
10548 "/pidgr.v1.TeamService/CreateTeam",
10549 );
10550 let mut req = request.into_request();
10551 req.extensions_mut()
10552 .insert(GrpcMethod::new("pidgr.v1.TeamService", "CreateTeam"));
10553 self.inner.unary(req, path, codec).await
10554 }
10555 pub async fn get_team(
10560 &mut self,
10561 request: impl tonic::IntoRequest<super::GetTeamRequest>,
10562 ) -> std::result::Result<
10563 tonic::Response<super::GetTeamResponse>,
10564 tonic::Status,
10565 > {
10566 self.inner
10567 .ready()
10568 .await
10569 .map_err(|e| {
10570 tonic::Status::unknown(
10571 format!("Service was not ready: {}", e.into()),
10572 )
10573 })?;
10574 let codec = tonic_prost::ProstCodec::default();
10575 let path = http::uri::PathAndQuery::from_static(
10576 "/pidgr.v1.TeamService/GetTeam",
10577 );
10578 let mut req = request.into_request();
10579 req.extensions_mut()
10580 .insert(GrpcMethod::new("pidgr.v1.TeamService", "GetTeam"));
10581 self.inner.unary(req, path, codec).await
10582 }
10583 pub async fn list_teams(
10587 &mut self,
10588 request: impl tonic::IntoRequest<super::ListTeamsRequest>,
10589 ) -> std::result::Result<
10590 tonic::Response<super::ListTeamsResponse>,
10591 tonic::Status,
10592 > {
10593 self.inner
10594 .ready()
10595 .await
10596 .map_err(|e| {
10597 tonic::Status::unknown(
10598 format!("Service was not ready: {}", e.into()),
10599 )
10600 })?;
10601 let codec = tonic_prost::ProstCodec::default();
10602 let path = http::uri::PathAndQuery::from_static(
10603 "/pidgr.v1.TeamService/ListTeams",
10604 );
10605 let mut req = request.into_request();
10606 req.extensions_mut()
10607 .insert(GrpcMethod::new("pidgr.v1.TeamService", "ListTeams"));
10608 self.inner.unary(req, path, codec).await
10609 }
10610 pub async fn update_team(
10614 &mut self,
10615 request: impl tonic::IntoRequest<super::UpdateTeamRequest>,
10616 ) -> std::result::Result<
10617 tonic::Response<super::UpdateTeamResponse>,
10618 tonic::Status,
10619 > {
10620 self.inner
10621 .ready()
10622 .await
10623 .map_err(|e| {
10624 tonic::Status::unknown(
10625 format!("Service was not ready: {}", e.into()),
10626 )
10627 })?;
10628 let codec = tonic_prost::ProstCodec::default();
10629 let path = http::uri::PathAndQuery::from_static(
10630 "/pidgr.v1.TeamService/UpdateTeam",
10631 );
10632 let mut req = request.into_request();
10633 req.extensions_mut()
10634 .insert(GrpcMethod::new("pidgr.v1.TeamService", "UpdateTeam"));
10635 self.inner.unary(req, path, codec).await
10636 }
10637 pub async fn delete_team(
10641 &mut self,
10642 request: impl tonic::IntoRequest<super::DeleteTeamRequest>,
10643 ) -> std::result::Result<
10644 tonic::Response<super::DeleteTeamResponse>,
10645 tonic::Status,
10646 > {
10647 self.inner
10648 .ready()
10649 .await
10650 .map_err(|e| {
10651 tonic::Status::unknown(
10652 format!("Service was not ready: {}", e.into()),
10653 )
10654 })?;
10655 let codec = tonic_prost::ProstCodec::default();
10656 let path = http::uri::PathAndQuery::from_static(
10657 "/pidgr.v1.TeamService/DeleteTeam",
10658 );
10659 let mut req = request.into_request();
10660 req.extensions_mut()
10661 .insert(GrpcMethod::new("pidgr.v1.TeamService", "DeleteTeam"));
10662 self.inner.unary(req, path, codec).await
10663 }
10664 pub async fn add_team_members(
10668 &mut self,
10669 request: impl tonic::IntoRequest<super::AddTeamMembersRequest>,
10670 ) -> std::result::Result<
10671 tonic::Response<super::AddTeamMembersResponse>,
10672 tonic::Status,
10673 > {
10674 self.inner
10675 .ready()
10676 .await
10677 .map_err(|e| {
10678 tonic::Status::unknown(
10679 format!("Service was not ready: {}", e.into()),
10680 )
10681 })?;
10682 let codec = tonic_prost::ProstCodec::default();
10683 let path = http::uri::PathAndQuery::from_static(
10684 "/pidgr.v1.TeamService/AddTeamMembers",
10685 );
10686 let mut req = request.into_request();
10687 req.extensions_mut()
10688 .insert(GrpcMethod::new("pidgr.v1.TeamService", "AddTeamMembers"));
10689 self.inner.unary(req, path, codec).await
10690 }
10691 pub async fn remove_team_members(
10695 &mut self,
10696 request: impl tonic::IntoRequest<super::RemoveTeamMembersRequest>,
10697 ) -> std::result::Result<
10698 tonic::Response<super::RemoveTeamMembersResponse>,
10699 tonic::Status,
10700 > {
10701 self.inner
10702 .ready()
10703 .await
10704 .map_err(|e| {
10705 tonic::Status::unknown(
10706 format!("Service was not ready: {}", e.into()),
10707 )
10708 })?;
10709 let codec = tonic_prost::ProstCodec::default();
10710 let path = http::uri::PathAndQuery::from_static(
10711 "/pidgr.v1.TeamService/RemoveTeamMembers",
10712 );
10713 let mut req = request.into_request();
10714 req.extensions_mut()
10715 .insert(GrpcMethod::new("pidgr.v1.TeamService", "RemoveTeamMembers"));
10716 self.inner.unary(req, path, codec).await
10717 }
10718 pub async fn list_team_members(
10723 &mut self,
10724 request: impl tonic::IntoRequest<super::ListTeamMembersRequest>,
10725 ) -> std::result::Result<
10726 tonic::Response<super::ListTeamMembersResponse>,
10727 tonic::Status,
10728 > {
10729 self.inner
10730 .ready()
10731 .await
10732 .map_err(|e| {
10733 tonic::Status::unknown(
10734 format!("Service was not ready: {}", e.into()),
10735 )
10736 })?;
10737 let codec = tonic_prost::ProstCodec::default();
10738 let path = http::uri::PathAndQuery::from_static(
10739 "/pidgr.v1.TeamService/ListTeamMembers",
10740 );
10741 let mut req = request.into_request();
10742 req.extensions_mut()
10743 .insert(GrpcMethod::new("pidgr.v1.TeamService", "ListTeamMembers"));
10744 self.inner.unary(req, path, codec).await
10745 }
10746 }
10747}
10748pub mod team_service_server {
10750 #![allow(
10751 unused_variables,
10752 dead_code,
10753 missing_docs,
10754 clippy::wildcard_imports,
10755 clippy::let_unit_value,
10756 )]
10757 use tonic::codegen::*;
10758 #[async_trait]
10760 pub trait TeamService: std::marker::Send + std::marker::Sync + 'static {
10761 async fn create_team(
10765 &self,
10766 request: tonic::Request<super::CreateTeamRequest>,
10767 ) -> std::result::Result<
10768 tonic::Response<super::CreateTeamResponse>,
10769 tonic::Status,
10770 >;
10771 async fn get_team(
10776 &self,
10777 request: tonic::Request<super::GetTeamRequest>,
10778 ) -> std::result::Result<tonic::Response<super::GetTeamResponse>, tonic::Status>;
10779 async fn list_teams(
10783 &self,
10784 request: tonic::Request<super::ListTeamsRequest>,
10785 ) -> std::result::Result<
10786 tonic::Response<super::ListTeamsResponse>,
10787 tonic::Status,
10788 >;
10789 async fn update_team(
10793 &self,
10794 request: tonic::Request<super::UpdateTeamRequest>,
10795 ) -> std::result::Result<
10796 tonic::Response<super::UpdateTeamResponse>,
10797 tonic::Status,
10798 >;
10799 async fn delete_team(
10803 &self,
10804 request: tonic::Request<super::DeleteTeamRequest>,
10805 ) -> std::result::Result<
10806 tonic::Response<super::DeleteTeamResponse>,
10807 tonic::Status,
10808 >;
10809 async fn add_team_members(
10813 &self,
10814 request: tonic::Request<super::AddTeamMembersRequest>,
10815 ) -> std::result::Result<
10816 tonic::Response<super::AddTeamMembersResponse>,
10817 tonic::Status,
10818 >;
10819 async fn remove_team_members(
10823 &self,
10824 request: tonic::Request<super::RemoveTeamMembersRequest>,
10825 ) -> std::result::Result<
10826 tonic::Response<super::RemoveTeamMembersResponse>,
10827 tonic::Status,
10828 >;
10829 async fn list_team_members(
10834 &self,
10835 request: tonic::Request<super::ListTeamMembersRequest>,
10836 ) -> std::result::Result<
10837 tonic::Response<super::ListTeamMembersResponse>,
10838 tonic::Status,
10839 >;
10840 }
10841 #[derive(Debug)]
10846 pub struct TeamServiceServer<T> {
10847 inner: Arc<T>,
10848 accept_compression_encodings: EnabledCompressionEncodings,
10849 send_compression_encodings: EnabledCompressionEncodings,
10850 max_decoding_message_size: Option<usize>,
10851 max_encoding_message_size: Option<usize>,
10852 }
10853 impl<T> TeamServiceServer<T> {
10854 pub fn new(inner: T) -> Self {
10855 Self::from_arc(Arc::new(inner))
10856 }
10857 pub fn from_arc(inner: Arc<T>) -> Self {
10858 Self {
10859 inner,
10860 accept_compression_encodings: Default::default(),
10861 send_compression_encodings: Default::default(),
10862 max_decoding_message_size: None,
10863 max_encoding_message_size: None,
10864 }
10865 }
10866 pub fn with_interceptor<F>(
10867 inner: T,
10868 interceptor: F,
10869 ) -> InterceptedService<Self, F>
10870 where
10871 F: tonic::service::Interceptor,
10872 {
10873 InterceptedService::new(Self::new(inner), interceptor)
10874 }
10875 #[must_use]
10877 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10878 self.accept_compression_encodings.enable(encoding);
10879 self
10880 }
10881 #[must_use]
10883 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10884 self.send_compression_encodings.enable(encoding);
10885 self
10886 }
10887 #[must_use]
10891 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10892 self.max_decoding_message_size = Some(limit);
10893 self
10894 }
10895 #[must_use]
10899 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10900 self.max_encoding_message_size = Some(limit);
10901 self
10902 }
10903 }
10904 impl<T, B> tonic::codegen::Service<http::Request<B>> for TeamServiceServer<T>
10905 where
10906 T: TeamService,
10907 B: Body + std::marker::Send + 'static,
10908 B::Error: Into<StdError> + std::marker::Send + 'static,
10909 {
10910 type Response = http::Response<tonic::body::Body>;
10911 type Error = std::convert::Infallible;
10912 type Future = BoxFuture<Self::Response, Self::Error>;
10913 fn poll_ready(
10914 &mut self,
10915 _cx: &mut Context<'_>,
10916 ) -> Poll<std::result::Result<(), Self::Error>> {
10917 Poll::Ready(Ok(()))
10918 }
10919 fn call(&mut self, req: http::Request<B>) -> Self::Future {
10920 match req.uri().path() {
10921 "/pidgr.v1.TeamService/CreateTeam" => {
10922 #[allow(non_camel_case_types)]
10923 struct CreateTeamSvc<T: TeamService>(pub Arc<T>);
10924 impl<
10925 T: TeamService,
10926 > tonic::server::UnaryService<super::CreateTeamRequest>
10927 for CreateTeamSvc<T> {
10928 type Response = super::CreateTeamResponse;
10929 type Future = BoxFuture<
10930 tonic::Response<Self::Response>,
10931 tonic::Status,
10932 >;
10933 fn call(
10934 &mut self,
10935 request: tonic::Request<super::CreateTeamRequest>,
10936 ) -> Self::Future {
10937 let inner = Arc::clone(&self.0);
10938 let fut = async move {
10939 <T as TeamService>::create_team(&inner, request).await
10940 };
10941 Box::pin(fut)
10942 }
10943 }
10944 let accept_compression_encodings = self.accept_compression_encodings;
10945 let send_compression_encodings = self.send_compression_encodings;
10946 let max_decoding_message_size = self.max_decoding_message_size;
10947 let max_encoding_message_size = self.max_encoding_message_size;
10948 let inner = self.inner.clone();
10949 let fut = async move {
10950 let method = CreateTeamSvc(inner);
10951 let codec = tonic_prost::ProstCodec::default();
10952 let mut grpc = tonic::server::Grpc::new(codec)
10953 .apply_compression_config(
10954 accept_compression_encodings,
10955 send_compression_encodings,
10956 )
10957 .apply_max_message_size_config(
10958 max_decoding_message_size,
10959 max_encoding_message_size,
10960 );
10961 let res = grpc.unary(method, req).await;
10962 Ok(res)
10963 };
10964 Box::pin(fut)
10965 }
10966 "/pidgr.v1.TeamService/GetTeam" => {
10967 #[allow(non_camel_case_types)]
10968 struct GetTeamSvc<T: TeamService>(pub Arc<T>);
10969 impl<
10970 T: TeamService,
10971 > tonic::server::UnaryService<super::GetTeamRequest>
10972 for GetTeamSvc<T> {
10973 type Response = super::GetTeamResponse;
10974 type Future = BoxFuture<
10975 tonic::Response<Self::Response>,
10976 tonic::Status,
10977 >;
10978 fn call(
10979 &mut self,
10980 request: tonic::Request<super::GetTeamRequest>,
10981 ) -> Self::Future {
10982 let inner = Arc::clone(&self.0);
10983 let fut = async move {
10984 <T as TeamService>::get_team(&inner, request).await
10985 };
10986 Box::pin(fut)
10987 }
10988 }
10989 let accept_compression_encodings = self.accept_compression_encodings;
10990 let send_compression_encodings = self.send_compression_encodings;
10991 let max_decoding_message_size = self.max_decoding_message_size;
10992 let max_encoding_message_size = self.max_encoding_message_size;
10993 let inner = self.inner.clone();
10994 let fut = async move {
10995 let method = GetTeamSvc(inner);
10996 let codec = tonic_prost::ProstCodec::default();
10997 let mut grpc = tonic::server::Grpc::new(codec)
10998 .apply_compression_config(
10999 accept_compression_encodings,
11000 send_compression_encodings,
11001 )
11002 .apply_max_message_size_config(
11003 max_decoding_message_size,
11004 max_encoding_message_size,
11005 );
11006 let res = grpc.unary(method, req).await;
11007 Ok(res)
11008 };
11009 Box::pin(fut)
11010 }
11011 "/pidgr.v1.TeamService/ListTeams" => {
11012 #[allow(non_camel_case_types)]
11013 struct ListTeamsSvc<T: TeamService>(pub Arc<T>);
11014 impl<
11015 T: TeamService,
11016 > tonic::server::UnaryService<super::ListTeamsRequest>
11017 for ListTeamsSvc<T> {
11018 type Response = super::ListTeamsResponse;
11019 type Future = BoxFuture<
11020 tonic::Response<Self::Response>,
11021 tonic::Status,
11022 >;
11023 fn call(
11024 &mut self,
11025 request: tonic::Request<super::ListTeamsRequest>,
11026 ) -> Self::Future {
11027 let inner = Arc::clone(&self.0);
11028 let fut = async move {
11029 <T as TeamService>::list_teams(&inner, request).await
11030 };
11031 Box::pin(fut)
11032 }
11033 }
11034 let accept_compression_encodings = self.accept_compression_encodings;
11035 let send_compression_encodings = self.send_compression_encodings;
11036 let max_decoding_message_size = self.max_decoding_message_size;
11037 let max_encoding_message_size = self.max_encoding_message_size;
11038 let inner = self.inner.clone();
11039 let fut = async move {
11040 let method = ListTeamsSvc(inner);
11041 let codec = tonic_prost::ProstCodec::default();
11042 let mut grpc = tonic::server::Grpc::new(codec)
11043 .apply_compression_config(
11044 accept_compression_encodings,
11045 send_compression_encodings,
11046 )
11047 .apply_max_message_size_config(
11048 max_decoding_message_size,
11049 max_encoding_message_size,
11050 );
11051 let res = grpc.unary(method, req).await;
11052 Ok(res)
11053 };
11054 Box::pin(fut)
11055 }
11056 "/pidgr.v1.TeamService/UpdateTeam" => {
11057 #[allow(non_camel_case_types)]
11058 struct UpdateTeamSvc<T: TeamService>(pub Arc<T>);
11059 impl<
11060 T: TeamService,
11061 > tonic::server::UnaryService<super::UpdateTeamRequest>
11062 for UpdateTeamSvc<T> {
11063 type Response = super::UpdateTeamResponse;
11064 type Future = BoxFuture<
11065 tonic::Response<Self::Response>,
11066 tonic::Status,
11067 >;
11068 fn call(
11069 &mut self,
11070 request: tonic::Request<super::UpdateTeamRequest>,
11071 ) -> Self::Future {
11072 let inner = Arc::clone(&self.0);
11073 let fut = async move {
11074 <T as TeamService>::update_team(&inner, request).await
11075 };
11076 Box::pin(fut)
11077 }
11078 }
11079 let accept_compression_encodings = self.accept_compression_encodings;
11080 let send_compression_encodings = self.send_compression_encodings;
11081 let max_decoding_message_size = self.max_decoding_message_size;
11082 let max_encoding_message_size = self.max_encoding_message_size;
11083 let inner = self.inner.clone();
11084 let fut = async move {
11085 let method = UpdateTeamSvc(inner);
11086 let codec = tonic_prost::ProstCodec::default();
11087 let mut grpc = tonic::server::Grpc::new(codec)
11088 .apply_compression_config(
11089 accept_compression_encodings,
11090 send_compression_encodings,
11091 )
11092 .apply_max_message_size_config(
11093 max_decoding_message_size,
11094 max_encoding_message_size,
11095 );
11096 let res = grpc.unary(method, req).await;
11097 Ok(res)
11098 };
11099 Box::pin(fut)
11100 }
11101 "/pidgr.v1.TeamService/DeleteTeam" => {
11102 #[allow(non_camel_case_types)]
11103 struct DeleteTeamSvc<T: TeamService>(pub Arc<T>);
11104 impl<
11105 T: TeamService,
11106 > tonic::server::UnaryService<super::DeleteTeamRequest>
11107 for DeleteTeamSvc<T> {
11108 type Response = super::DeleteTeamResponse;
11109 type Future = BoxFuture<
11110 tonic::Response<Self::Response>,
11111 tonic::Status,
11112 >;
11113 fn call(
11114 &mut self,
11115 request: tonic::Request<super::DeleteTeamRequest>,
11116 ) -> Self::Future {
11117 let inner = Arc::clone(&self.0);
11118 let fut = async move {
11119 <T as TeamService>::delete_team(&inner, request).await
11120 };
11121 Box::pin(fut)
11122 }
11123 }
11124 let accept_compression_encodings = self.accept_compression_encodings;
11125 let send_compression_encodings = self.send_compression_encodings;
11126 let max_decoding_message_size = self.max_decoding_message_size;
11127 let max_encoding_message_size = self.max_encoding_message_size;
11128 let inner = self.inner.clone();
11129 let fut = async move {
11130 let method = DeleteTeamSvc(inner);
11131 let codec = tonic_prost::ProstCodec::default();
11132 let mut grpc = tonic::server::Grpc::new(codec)
11133 .apply_compression_config(
11134 accept_compression_encodings,
11135 send_compression_encodings,
11136 )
11137 .apply_max_message_size_config(
11138 max_decoding_message_size,
11139 max_encoding_message_size,
11140 );
11141 let res = grpc.unary(method, req).await;
11142 Ok(res)
11143 };
11144 Box::pin(fut)
11145 }
11146 "/pidgr.v1.TeamService/AddTeamMembers" => {
11147 #[allow(non_camel_case_types)]
11148 struct AddTeamMembersSvc<T: TeamService>(pub Arc<T>);
11149 impl<
11150 T: TeamService,
11151 > tonic::server::UnaryService<super::AddTeamMembersRequest>
11152 for AddTeamMembersSvc<T> {
11153 type Response = super::AddTeamMembersResponse;
11154 type Future = BoxFuture<
11155 tonic::Response<Self::Response>,
11156 tonic::Status,
11157 >;
11158 fn call(
11159 &mut self,
11160 request: tonic::Request<super::AddTeamMembersRequest>,
11161 ) -> Self::Future {
11162 let inner = Arc::clone(&self.0);
11163 let fut = async move {
11164 <T as TeamService>::add_team_members(&inner, request).await
11165 };
11166 Box::pin(fut)
11167 }
11168 }
11169 let accept_compression_encodings = self.accept_compression_encodings;
11170 let send_compression_encodings = self.send_compression_encodings;
11171 let max_decoding_message_size = self.max_decoding_message_size;
11172 let max_encoding_message_size = self.max_encoding_message_size;
11173 let inner = self.inner.clone();
11174 let fut = async move {
11175 let method = AddTeamMembersSvc(inner);
11176 let codec = tonic_prost::ProstCodec::default();
11177 let mut grpc = tonic::server::Grpc::new(codec)
11178 .apply_compression_config(
11179 accept_compression_encodings,
11180 send_compression_encodings,
11181 )
11182 .apply_max_message_size_config(
11183 max_decoding_message_size,
11184 max_encoding_message_size,
11185 );
11186 let res = grpc.unary(method, req).await;
11187 Ok(res)
11188 };
11189 Box::pin(fut)
11190 }
11191 "/pidgr.v1.TeamService/RemoveTeamMembers" => {
11192 #[allow(non_camel_case_types)]
11193 struct RemoveTeamMembersSvc<T: TeamService>(pub Arc<T>);
11194 impl<
11195 T: TeamService,
11196 > tonic::server::UnaryService<super::RemoveTeamMembersRequest>
11197 for RemoveTeamMembersSvc<T> {
11198 type Response = super::RemoveTeamMembersResponse;
11199 type Future = BoxFuture<
11200 tonic::Response<Self::Response>,
11201 tonic::Status,
11202 >;
11203 fn call(
11204 &mut self,
11205 request: tonic::Request<super::RemoveTeamMembersRequest>,
11206 ) -> Self::Future {
11207 let inner = Arc::clone(&self.0);
11208 let fut = async move {
11209 <T as TeamService>::remove_team_members(&inner, request)
11210 .await
11211 };
11212 Box::pin(fut)
11213 }
11214 }
11215 let accept_compression_encodings = self.accept_compression_encodings;
11216 let send_compression_encodings = self.send_compression_encodings;
11217 let max_decoding_message_size = self.max_decoding_message_size;
11218 let max_encoding_message_size = self.max_encoding_message_size;
11219 let inner = self.inner.clone();
11220 let fut = async move {
11221 let method = RemoveTeamMembersSvc(inner);
11222 let codec = tonic_prost::ProstCodec::default();
11223 let mut grpc = tonic::server::Grpc::new(codec)
11224 .apply_compression_config(
11225 accept_compression_encodings,
11226 send_compression_encodings,
11227 )
11228 .apply_max_message_size_config(
11229 max_decoding_message_size,
11230 max_encoding_message_size,
11231 );
11232 let res = grpc.unary(method, req).await;
11233 Ok(res)
11234 };
11235 Box::pin(fut)
11236 }
11237 "/pidgr.v1.TeamService/ListTeamMembers" => {
11238 #[allow(non_camel_case_types)]
11239 struct ListTeamMembersSvc<T: TeamService>(pub Arc<T>);
11240 impl<
11241 T: TeamService,
11242 > tonic::server::UnaryService<super::ListTeamMembersRequest>
11243 for ListTeamMembersSvc<T> {
11244 type Response = super::ListTeamMembersResponse;
11245 type Future = BoxFuture<
11246 tonic::Response<Self::Response>,
11247 tonic::Status,
11248 >;
11249 fn call(
11250 &mut self,
11251 request: tonic::Request<super::ListTeamMembersRequest>,
11252 ) -> Self::Future {
11253 let inner = Arc::clone(&self.0);
11254 let fut = async move {
11255 <T as TeamService>::list_team_members(&inner, request).await
11256 };
11257 Box::pin(fut)
11258 }
11259 }
11260 let accept_compression_encodings = self.accept_compression_encodings;
11261 let send_compression_encodings = self.send_compression_encodings;
11262 let max_decoding_message_size = self.max_decoding_message_size;
11263 let max_encoding_message_size = self.max_encoding_message_size;
11264 let inner = self.inner.clone();
11265 let fut = async move {
11266 let method = ListTeamMembersSvc(inner);
11267 let codec = tonic_prost::ProstCodec::default();
11268 let mut grpc = tonic::server::Grpc::new(codec)
11269 .apply_compression_config(
11270 accept_compression_encodings,
11271 send_compression_encodings,
11272 )
11273 .apply_max_message_size_config(
11274 max_decoding_message_size,
11275 max_encoding_message_size,
11276 );
11277 let res = grpc.unary(method, req).await;
11278 Ok(res)
11279 };
11280 Box::pin(fut)
11281 }
11282 _ => {
11283 Box::pin(async move {
11284 let mut response = http::Response::new(
11285 tonic::body::Body::default(),
11286 );
11287 let headers = response.headers_mut();
11288 headers
11289 .insert(
11290 tonic::Status::GRPC_STATUS,
11291 (tonic::Code::Unimplemented as i32).into(),
11292 );
11293 headers
11294 .insert(
11295 http::header::CONTENT_TYPE,
11296 tonic::metadata::GRPC_CONTENT_TYPE,
11297 );
11298 Ok(response)
11299 })
11300 }
11301 }
11302 }
11303 }
11304 impl<T> Clone for TeamServiceServer<T> {
11305 fn clone(&self) -> Self {
11306 let inner = self.inner.clone();
11307 Self {
11308 inner,
11309 accept_compression_encodings: self.accept_compression_encodings,
11310 send_compression_encodings: self.send_compression_encodings,
11311 max_decoding_message_size: self.max_decoding_message_size,
11312 max_encoding_message_size: self.max_encoding_message_size,
11313 }
11314 }
11315 }
11316 pub const SERVICE_NAME: &str = "pidgr.v1.TeamService";
11318 impl<T> tonic::server::NamedService for TeamServiceServer<T> {
11319 const NAME: &'static str = SERVICE_NAME;
11320 }
11321}
11322pub mod template_service_client {
11324 #![allow(
11325 unused_variables,
11326 dead_code,
11327 missing_docs,
11328 clippy::wildcard_imports,
11329 clippy::let_unit_value,
11330 )]
11331 use tonic::codegen::*;
11332 use tonic::codegen::http::Uri;
11333 #[derive(Debug, Clone)]
11337 pub struct TemplateServiceClient<T> {
11338 inner: tonic::client::Grpc<T>,
11339 }
11340 impl TemplateServiceClient<tonic::transport::Channel> {
11341 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
11343 where
11344 D: TryInto<tonic::transport::Endpoint>,
11345 D::Error: Into<StdError>,
11346 {
11347 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
11348 Ok(Self::new(conn))
11349 }
11350 }
11351 impl<T> TemplateServiceClient<T>
11352 where
11353 T: tonic::client::GrpcService<tonic::body::Body>,
11354 T::Error: Into<StdError>,
11355 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
11356 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
11357 {
11358 pub fn new(inner: T) -> Self {
11359 let inner = tonic::client::Grpc::new(inner);
11360 Self { inner }
11361 }
11362 pub fn with_origin(inner: T, origin: Uri) -> Self {
11363 let inner = tonic::client::Grpc::with_origin(inner, origin);
11364 Self { inner }
11365 }
11366 pub fn with_interceptor<F>(
11367 inner: T,
11368 interceptor: F,
11369 ) -> TemplateServiceClient<InterceptedService<T, F>>
11370 where
11371 F: tonic::service::Interceptor,
11372 T::ResponseBody: Default,
11373 T: tonic::codegen::Service<
11374 http::Request<tonic::body::Body>,
11375 Response = http::Response<
11376 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
11377 >,
11378 >,
11379 <T as tonic::codegen::Service<
11380 http::Request<tonic::body::Body>,
11381 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
11382 {
11383 TemplateServiceClient::new(InterceptedService::new(inner, interceptor))
11384 }
11385 #[must_use]
11390 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11391 self.inner = self.inner.send_compressed(encoding);
11392 self
11393 }
11394 #[must_use]
11396 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11397 self.inner = self.inner.accept_compressed(encoding);
11398 self
11399 }
11400 #[must_use]
11404 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11405 self.inner = self.inner.max_decoding_message_size(limit);
11406 self
11407 }
11408 #[must_use]
11412 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11413 self.inner = self.inner.max_encoding_message_size(limit);
11414 self
11415 }
11416 pub async fn create_template(
11420 &mut self,
11421 request: impl tonic::IntoRequest<super::CreateTemplateRequest>,
11422 ) -> std::result::Result<
11423 tonic::Response<super::CreateTemplateResponse>,
11424 tonic::Status,
11425 > {
11426 self.inner
11427 .ready()
11428 .await
11429 .map_err(|e| {
11430 tonic::Status::unknown(
11431 format!("Service was not ready: {}", e.into()),
11432 )
11433 })?;
11434 let codec = tonic_prost::ProstCodec::default();
11435 let path = http::uri::PathAndQuery::from_static(
11436 "/pidgr.v1.TemplateService/CreateTemplate",
11437 );
11438 let mut req = request.into_request();
11439 req.extensions_mut()
11440 .insert(GrpcMethod::new("pidgr.v1.TemplateService", "CreateTemplate"));
11441 self.inner.unary(req, path, codec).await
11442 }
11443 pub async fn update_template(
11447 &mut self,
11448 request: impl tonic::IntoRequest<super::UpdateTemplateRequest>,
11449 ) -> std::result::Result<
11450 tonic::Response<super::UpdateTemplateResponse>,
11451 tonic::Status,
11452 > {
11453 self.inner
11454 .ready()
11455 .await
11456 .map_err(|e| {
11457 tonic::Status::unknown(
11458 format!("Service was not ready: {}", e.into()),
11459 )
11460 })?;
11461 let codec = tonic_prost::ProstCodec::default();
11462 let path = http::uri::PathAndQuery::from_static(
11463 "/pidgr.v1.TemplateService/UpdateTemplate",
11464 );
11465 let mut req = request.into_request();
11466 req.extensions_mut()
11467 .insert(GrpcMethod::new("pidgr.v1.TemplateService", "UpdateTemplate"));
11468 self.inner.unary(req, path, codec).await
11469 }
11470 pub async fn get_template(
11474 &mut self,
11475 request: impl tonic::IntoRequest<super::GetTemplateRequest>,
11476 ) -> std::result::Result<
11477 tonic::Response<super::GetTemplateResponse>,
11478 tonic::Status,
11479 > {
11480 self.inner
11481 .ready()
11482 .await
11483 .map_err(|e| {
11484 tonic::Status::unknown(
11485 format!("Service was not ready: {}", e.into()),
11486 )
11487 })?;
11488 let codec = tonic_prost::ProstCodec::default();
11489 let path = http::uri::PathAndQuery::from_static(
11490 "/pidgr.v1.TemplateService/GetTemplate",
11491 );
11492 let mut req = request.into_request();
11493 req.extensions_mut()
11494 .insert(GrpcMethod::new("pidgr.v1.TemplateService", "GetTemplate"));
11495 self.inner.unary(req, path, codec).await
11496 }
11497 pub async fn list_templates(
11501 &mut self,
11502 request: impl tonic::IntoRequest<super::ListTemplatesRequest>,
11503 ) -> std::result::Result<
11504 tonic::Response<super::ListTemplatesResponse>,
11505 tonic::Status,
11506 > {
11507 self.inner
11508 .ready()
11509 .await
11510 .map_err(|e| {
11511 tonic::Status::unknown(
11512 format!("Service was not ready: {}", e.into()),
11513 )
11514 })?;
11515 let codec = tonic_prost::ProstCodec::default();
11516 let path = http::uri::PathAndQuery::from_static(
11517 "/pidgr.v1.TemplateService/ListTemplates",
11518 );
11519 let mut req = request.into_request();
11520 req.extensions_mut()
11521 .insert(GrpcMethod::new("pidgr.v1.TemplateService", "ListTemplates"));
11522 self.inner.unary(req, path, codec).await
11523 }
11524 }
11525}
11526pub mod template_service_server {
11528 #![allow(
11529 unused_variables,
11530 dead_code,
11531 missing_docs,
11532 clippy::wildcard_imports,
11533 clippy::let_unit_value,
11534 )]
11535 use tonic::codegen::*;
11536 #[async_trait]
11538 pub trait TemplateService: std::marker::Send + std::marker::Sync + 'static {
11539 async fn create_template(
11543 &self,
11544 request: tonic::Request<super::CreateTemplateRequest>,
11545 ) -> std::result::Result<
11546 tonic::Response<super::CreateTemplateResponse>,
11547 tonic::Status,
11548 >;
11549 async fn update_template(
11553 &self,
11554 request: tonic::Request<super::UpdateTemplateRequest>,
11555 ) -> std::result::Result<
11556 tonic::Response<super::UpdateTemplateResponse>,
11557 tonic::Status,
11558 >;
11559 async fn get_template(
11563 &self,
11564 request: tonic::Request<super::GetTemplateRequest>,
11565 ) -> std::result::Result<
11566 tonic::Response<super::GetTemplateResponse>,
11567 tonic::Status,
11568 >;
11569 async fn list_templates(
11573 &self,
11574 request: tonic::Request<super::ListTemplatesRequest>,
11575 ) -> std::result::Result<
11576 tonic::Response<super::ListTemplatesResponse>,
11577 tonic::Status,
11578 >;
11579 }
11580 #[derive(Debug)]
11584 pub struct TemplateServiceServer<T> {
11585 inner: Arc<T>,
11586 accept_compression_encodings: EnabledCompressionEncodings,
11587 send_compression_encodings: EnabledCompressionEncodings,
11588 max_decoding_message_size: Option<usize>,
11589 max_encoding_message_size: Option<usize>,
11590 }
11591 impl<T> TemplateServiceServer<T> {
11592 pub fn new(inner: T) -> Self {
11593 Self::from_arc(Arc::new(inner))
11594 }
11595 pub fn from_arc(inner: Arc<T>) -> Self {
11596 Self {
11597 inner,
11598 accept_compression_encodings: Default::default(),
11599 send_compression_encodings: Default::default(),
11600 max_decoding_message_size: None,
11601 max_encoding_message_size: None,
11602 }
11603 }
11604 pub fn with_interceptor<F>(
11605 inner: T,
11606 interceptor: F,
11607 ) -> InterceptedService<Self, F>
11608 where
11609 F: tonic::service::Interceptor,
11610 {
11611 InterceptedService::new(Self::new(inner), interceptor)
11612 }
11613 #[must_use]
11615 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
11616 self.accept_compression_encodings.enable(encoding);
11617 self
11618 }
11619 #[must_use]
11621 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
11622 self.send_compression_encodings.enable(encoding);
11623 self
11624 }
11625 #[must_use]
11629 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
11630 self.max_decoding_message_size = Some(limit);
11631 self
11632 }
11633 #[must_use]
11637 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11638 self.max_encoding_message_size = Some(limit);
11639 self
11640 }
11641 }
11642 impl<T, B> tonic::codegen::Service<http::Request<B>> for TemplateServiceServer<T>
11643 where
11644 T: TemplateService,
11645 B: Body + std::marker::Send + 'static,
11646 B::Error: Into<StdError> + std::marker::Send + 'static,
11647 {
11648 type Response = http::Response<tonic::body::Body>;
11649 type Error = std::convert::Infallible;
11650 type Future = BoxFuture<Self::Response, Self::Error>;
11651 fn poll_ready(
11652 &mut self,
11653 _cx: &mut Context<'_>,
11654 ) -> Poll<std::result::Result<(), Self::Error>> {
11655 Poll::Ready(Ok(()))
11656 }
11657 fn call(&mut self, req: http::Request<B>) -> Self::Future {
11658 match req.uri().path() {
11659 "/pidgr.v1.TemplateService/CreateTemplate" => {
11660 #[allow(non_camel_case_types)]
11661 struct CreateTemplateSvc<T: TemplateService>(pub Arc<T>);
11662 impl<
11663 T: TemplateService,
11664 > tonic::server::UnaryService<super::CreateTemplateRequest>
11665 for CreateTemplateSvc<T> {
11666 type Response = super::CreateTemplateResponse;
11667 type Future = BoxFuture<
11668 tonic::Response<Self::Response>,
11669 tonic::Status,
11670 >;
11671 fn call(
11672 &mut self,
11673 request: tonic::Request<super::CreateTemplateRequest>,
11674 ) -> Self::Future {
11675 let inner = Arc::clone(&self.0);
11676 let fut = async move {
11677 <T as TemplateService>::create_template(&inner, request)
11678 .await
11679 };
11680 Box::pin(fut)
11681 }
11682 }
11683 let accept_compression_encodings = self.accept_compression_encodings;
11684 let send_compression_encodings = self.send_compression_encodings;
11685 let max_decoding_message_size = self.max_decoding_message_size;
11686 let max_encoding_message_size = self.max_encoding_message_size;
11687 let inner = self.inner.clone();
11688 let fut = async move {
11689 let method = CreateTemplateSvc(inner);
11690 let codec = tonic_prost::ProstCodec::default();
11691 let mut grpc = tonic::server::Grpc::new(codec)
11692 .apply_compression_config(
11693 accept_compression_encodings,
11694 send_compression_encodings,
11695 )
11696 .apply_max_message_size_config(
11697 max_decoding_message_size,
11698 max_encoding_message_size,
11699 );
11700 let res = grpc.unary(method, req).await;
11701 Ok(res)
11702 };
11703 Box::pin(fut)
11704 }
11705 "/pidgr.v1.TemplateService/UpdateTemplate" => {
11706 #[allow(non_camel_case_types)]
11707 struct UpdateTemplateSvc<T: TemplateService>(pub Arc<T>);
11708 impl<
11709 T: TemplateService,
11710 > tonic::server::UnaryService<super::UpdateTemplateRequest>
11711 for UpdateTemplateSvc<T> {
11712 type Response = super::UpdateTemplateResponse;
11713 type Future = BoxFuture<
11714 tonic::Response<Self::Response>,
11715 tonic::Status,
11716 >;
11717 fn call(
11718 &mut self,
11719 request: tonic::Request<super::UpdateTemplateRequest>,
11720 ) -> Self::Future {
11721 let inner = Arc::clone(&self.0);
11722 let fut = async move {
11723 <T as TemplateService>::update_template(&inner, request)
11724 .await
11725 };
11726 Box::pin(fut)
11727 }
11728 }
11729 let accept_compression_encodings = self.accept_compression_encodings;
11730 let send_compression_encodings = self.send_compression_encodings;
11731 let max_decoding_message_size = self.max_decoding_message_size;
11732 let max_encoding_message_size = self.max_encoding_message_size;
11733 let inner = self.inner.clone();
11734 let fut = async move {
11735 let method = UpdateTemplateSvc(inner);
11736 let codec = tonic_prost::ProstCodec::default();
11737 let mut grpc = tonic::server::Grpc::new(codec)
11738 .apply_compression_config(
11739 accept_compression_encodings,
11740 send_compression_encodings,
11741 )
11742 .apply_max_message_size_config(
11743 max_decoding_message_size,
11744 max_encoding_message_size,
11745 );
11746 let res = grpc.unary(method, req).await;
11747 Ok(res)
11748 };
11749 Box::pin(fut)
11750 }
11751 "/pidgr.v1.TemplateService/GetTemplate" => {
11752 #[allow(non_camel_case_types)]
11753 struct GetTemplateSvc<T: TemplateService>(pub Arc<T>);
11754 impl<
11755 T: TemplateService,
11756 > tonic::server::UnaryService<super::GetTemplateRequest>
11757 for GetTemplateSvc<T> {
11758 type Response = super::GetTemplateResponse;
11759 type Future = BoxFuture<
11760 tonic::Response<Self::Response>,
11761 tonic::Status,
11762 >;
11763 fn call(
11764 &mut self,
11765 request: tonic::Request<super::GetTemplateRequest>,
11766 ) -> Self::Future {
11767 let inner = Arc::clone(&self.0);
11768 let fut = async move {
11769 <T as TemplateService>::get_template(&inner, request).await
11770 };
11771 Box::pin(fut)
11772 }
11773 }
11774 let accept_compression_encodings = self.accept_compression_encodings;
11775 let send_compression_encodings = self.send_compression_encodings;
11776 let max_decoding_message_size = self.max_decoding_message_size;
11777 let max_encoding_message_size = self.max_encoding_message_size;
11778 let inner = self.inner.clone();
11779 let fut = async move {
11780 let method = GetTemplateSvc(inner);
11781 let codec = tonic_prost::ProstCodec::default();
11782 let mut grpc = tonic::server::Grpc::new(codec)
11783 .apply_compression_config(
11784 accept_compression_encodings,
11785 send_compression_encodings,
11786 )
11787 .apply_max_message_size_config(
11788 max_decoding_message_size,
11789 max_encoding_message_size,
11790 );
11791 let res = grpc.unary(method, req).await;
11792 Ok(res)
11793 };
11794 Box::pin(fut)
11795 }
11796 "/pidgr.v1.TemplateService/ListTemplates" => {
11797 #[allow(non_camel_case_types)]
11798 struct ListTemplatesSvc<T: TemplateService>(pub Arc<T>);
11799 impl<
11800 T: TemplateService,
11801 > tonic::server::UnaryService<super::ListTemplatesRequest>
11802 for ListTemplatesSvc<T> {
11803 type Response = super::ListTemplatesResponse;
11804 type Future = BoxFuture<
11805 tonic::Response<Self::Response>,
11806 tonic::Status,
11807 >;
11808 fn call(
11809 &mut self,
11810 request: tonic::Request<super::ListTemplatesRequest>,
11811 ) -> Self::Future {
11812 let inner = Arc::clone(&self.0);
11813 let fut = async move {
11814 <T as TemplateService>::list_templates(&inner, request)
11815 .await
11816 };
11817 Box::pin(fut)
11818 }
11819 }
11820 let accept_compression_encodings = self.accept_compression_encodings;
11821 let send_compression_encodings = self.send_compression_encodings;
11822 let max_decoding_message_size = self.max_decoding_message_size;
11823 let max_encoding_message_size = self.max_encoding_message_size;
11824 let inner = self.inner.clone();
11825 let fut = async move {
11826 let method = ListTemplatesSvc(inner);
11827 let codec = tonic_prost::ProstCodec::default();
11828 let mut grpc = tonic::server::Grpc::new(codec)
11829 .apply_compression_config(
11830 accept_compression_encodings,
11831 send_compression_encodings,
11832 )
11833 .apply_max_message_size_config(
11834 max_decoding_message_size,
11835 max_encoding_message_size,
11836 );
11837 let res = grpc.unary(method, req).await;
11838 Ok(res)
11839 };
11840 Box::pin(fut)
11841 }
11842 _ => {
11843 Box::pin(async move {
11844 let mut response = http::Response::new(
11845 tonic::body::Body::default(),
11846 );
11847 let headers = response.headers_mut();
11848 headers
11849 .insert(
11850 tonic::Status::GRPC_STATUS,
11851 (tonic::Code::Unimplemented as i32).into(),
11852 );
11853 headers
11854 .insert(
11855 http::header::CONTENT_TYPE,
11856 tonic::metadata::GRPC_CONTENT_TYPE,
11857 );
11858 Ok(response)
11859 })
11860 }
11861 }
11862 }
11863 }
11864 impl<T> Clone for TemplateServiceServer<T> {
11865 fn clone(&self) -> Self {
11866 let inner = self.inner.clone();
11867 Self {
11868 inner,
11869 accept_compression_encodings: self.accept_compression_encodings,
11870 send_compression_encodings: self.send_compression_encodings,
11871 max_decoding_message_size: self.max_decoding_message_size,
11872 max_encoding_message_size: self.max_encoding_message_size,
11873 }
11874 }
11875 }
11876 pub const SERVICE_NAME: &str = "pidgr.v1.TemplateService";
11878 impl<T> tonic::server::NamedService for TemplateServiceServer<T> {
11879 const NAME: &'static str = SERVICE_NAME;
11880 }
11881}