1#[derive(Clone, Copy, PartialEq, Eq, Hash, ::qcs_dependencies_client::prost::Message)]
21#[prost(prost_path = "::qcs_dependencies_client::prost")]
22pub struct Uuid {}
23#[derive(Clone, Copy, PartialEq, Eq, Hash, ::qcs_dependencies_client::prost::Message)]
24#[prost(prost_path = "::qcs_dependencies_client::prost")]
25pub struct CloseExecutionSessionResponse {}
26#[derive(Clone, PartialEq, ::qcs_dependencies_client::prost::Message)]
30#[prost(prost_path = "::qcs_dependencies_client::prost")]
31pub struct BatchExecuteControllerJobsRequest {
32 #[prost(message, repeated, tag = "1")]
33 pub requests: ::qcs_dependencies_client::prost::alloc::vec::Vec<
34 ExecuteControllerJobRequest,
35 >,
36 #[prost(message, optional, tag = "2")]
38 pub idempotency_key: ::core::option::Option<Uuid>,
39}
40#[derive(Clone, PartialEq, ::qcs_dependencies_client::prost::Message)]
41#[prost(prost_path = "::qcs_dependencies_client::prost")]
42pub struct BatchExecuteControllerJobsResponse {
43 #[prost(message, repeated, tag = "1")]
44 pub responses: ::qcs_dependencies_client::prost::alloc::vec::Vec<
45 ExecuteControllerJobResponse,
46 >,
47}
48#[derive(Clone, PartialEq, ::qcs_dependencies_client::prost::Message)]
57#[prost(prost_path = "::qcs_dependencies_client::prost")]
58pub struct ExecuteControllerJobRequest {
59 #[prost(message, repeated, tag = "3")]
64 pub execution_configurations: ::qcs_dependencies_client::prost::alloc::vec::Vec<
65 super::super::models::controller::JobExecutionConfiguration,
66 >,
67 #[prost(message, optional, tag = "4")]
68 pub options: ::core::option::Option<ExecutionOptions>,
69 #[prost(message, optional, tag = "5")]
95 pub idempotency_key: ::core::option::Option<Uuid>,
96 #[prost(oneof = "execute_controller_job_request::Job", tags = "201")]
97 pub job: ::core::option::Option<execute_controller_job_request::Job>,
98 #[prost(oneof = "execute_controller_job_request::Target", tags = "101, 102")]
100 pub target: ::core::option::Option<execute_controller_job_request::Target>,
101}
102pub mod execute_controller_job_request {
104 #[derive(serde::Deserialize)]
105 #[derive(Clone, PartialEq, Eq, Hash, ::qcs_dependencies_client::prost::Oneof)]
106 #[prost(prost_path = "::qcs_dependencies_client::prost")]
107 pub enum Job {
108 #[prost(message, tag = "201")]
109 Encrypted(super::super::super::models::controller::EncryptedControllerJob),
110 }
111 #[derive(Clone, PartialEq, Eq, Hash, ::qcs_dependencies_client::prost::Oneof)]
113 #[prost(prost_path = "::qcs_dependencies_client::prost")]
114 pub enum Target {
115 #[prost(string, tag = "101")]
116 QuantumProcessorId(::qcs_dependencies_client::prost::alloc::string::String),
117 #[prost(string, tag = "102")]
118 EndpointId(::qcs_dependencies_client::prost::alloc::string::String),
119 }
120}
121#[derive(Clone, Copy, PartialEq, Eq, Hash, ::qcs_dependencies_client::prost::Message)]
123#[prost(prost_path = "::qcs_dependencies_client::prost")]
124pub struct ExecutionOptions {
125 #[prost(bool, tag = "3")]
128 pub bypass_settings_protection: bool,
129 #[prost(message, optional, tag = "4")]
138 pub timeout: ::core::option::Option<qcs_dependencies_client::pbjson_types::Duration>,
139}
140#[derive(Clone, PartialEq, Eq, Hash, ::qcs_dependencies_client::prost::Message)]
141#[prost(prost_path = "::qcs_dependencies_client::prost")]
142pub struct ExecuteControllerJobResponse {
143 #[prost(string, repeated, tag = "1")]
145 pub job_execution_ids: ::qcs_dependencies_client::prost::alloc::vec::Vec<
146 ::qcs_dependencies_client::prost::alloc::string::String,
147 >,
148}
149#[derive(Clone, PartialEq, Eq, Hash, ::qcs_dependencies_client::prost::Message)]
150#[prost(prost_path = "::qcs_dependencies_client::prost")]
151pub struct GetControllerJobResultsRequest {
152 #[prost(string, tag = "1")]
154 pub job_execution_id: ::qcs_dependencies_client::prost::alloc::string::String,
155 #[prost(oneof = "get_controller_job_results_request::Target", tags = "101, 102")]
157 pub target: ::core::option::Option<get_controller_job_results_request::Target>,
158}
159pub mod get_controller_job_results_request {
161 #[derive(Clone, PartialEq, Eq, Hash, ::qcs_dependencies_client::prost::Oneof)]
163 #[prost(prost_path = "::qcs_dependencies_client::prost")]
164 pub enum Target {
165 #[prost(string, tag = "101")]
166 QuantumProcessorId(::qcs_dependencies_client::prost::alloc::string::String),
167 #[prost(string, tag = "102")]
168 EndpointId(::qcs_dependencies_client::prost::alloc::string::String),
169 }
170}
171#[derive(Clone, PartialEq, ::qcs_dependencies_client::prost::Message)]
172#[prost(prost_path = "::qcs_dependencies_client::prost")]
173pub struct GetControllerJobResultsResponse {
174 #[prost(message, optional, tag = "1")]
175 pub result: ::core::option::Option<
176 super::super::models::controller::ControllerJobExecutionResult,
177 >,
178}
179#[derive(Clone, PartialEq, Eq, Hash, ::qcs_dependencies_client::prost::Message)]
188#[prost(prost_path = "::qcs_dependencies_client::prost")]
189pub struct CancelControllerJobsRequest {
190 #[prost(string, repeated, tag = "1")]
191 pub job_ids: ::qcs_dependencies_client::prost::alloc::vec::Vec<
192 ::qcs_dependencies_client::prost::alloc::string::String,
193 >,
194 #[prost(oneof = "cancel_controller_jobs_request::Target", tags = "101, 102")]
196 pub target: ::core::option::Option<cancel_controller_jobs_request::Target>,
197}
198pub mod cancel_controller_jobs_request {
200 #[derive(Clone, PartialEq, Eq, Hash, ::qcs_dependencies_client::prost::Oneof)]
202 #[prost(prost_path = "::qcs_dependencies_client::prost")]
203 pub enum Target {
204 #[prost(string, tag = "101")]
205 QuantumProcessorId(::qcs_dependencies_client::prost::alloc::string::String),
206 #[prost(string, tag = "102")]
207 EndpointId(::qcs_dependencies_client::prost::alloc::string::String),
208 }
209}
210#[derive(Clone, Copy, PartialEq, Eq, Hash, ::qcs_dependencies_client::prost::Message)]
211#[prost(prost_path = "::qcs_dependencies_client::prost")]
212pub struct CancelControllerJobsResponse {}
213#[derive(Clone, Copy, PartialEq, Eq, Hash, ::qcs_dependencies_client::prost::Message)]
214#[prost(prost_path = "::qcs_dependencies_client::prost")]
215pub struct CancelExecutionSessionResponse {}
216#[derive(Clone, PartialEq, Eq, Hash, ::qcs_dependencies_client::prost::Message)]
217#[prost(prost_path = "::qcs_dependencies_client::prost")]
218pub struct GetControllerJobStatusRequest {
219 #[prost(string, tag = "1")]
220 pub job_id: ::qcs_dependencies_client::prost::alloc::string::String,
221 #[prost(oneof = "get_controller_job_status_request::Target", tags = "101, 102")]
223 pub target: ::core::option::Option<get_controller_job_status_request::Target>,
224}
225pub mod get_controller_job_status_request {
227 #[derive(Clone, PartialEq, Eq, Hash, ::qcs_dependencies_client::prost::Oneof)]
229 #[prost(prost_path = "::qcs_dependencies_client::prost")]
230 pub enum Target {
231 #[prost(string, tag = "101")]
232 QuantumProcessorId(::qcs_dependencies_client::prost::alloc::string::String),
233 #[prost(string, tag = "102")]
234 EndpointId(::qcs_dependencies_client::prost::alloc::string::String),
235 }
236}
237#[derive(Clone, Copy, PartialEq, Eq, Hash, ::qcs_dependencies_client::prost::Message)]
238#[prost(prost_path = "::qcs_dependencies_client::prost")]
239pub struct GetControllerJobStatusResponse {
240 #[prost(enumeration = "get_controller_job_status_response::Status", tag = "1")]
241 pub status: i32,
242 #[prost(message, optional, tag = "2")]
251 pub estimated_job_completion_delay: ::core::option::Option<EstimatedDelay>,
252}
253pub mod get_controller_job_status_response {
255 #[derive(
256 Clone,
257 Copy,
258 Debug,
259 PartialEq,
260 Eq,
261 Hash,
262 PartialOrd,
263 Ord,
264 ::qcs_dependencies_client::prost::Enumeration
265 )]
266 #[prost(prost_path = "::qcs_dependencies_client::prost")]
267 #[repr(i32)]
268 pub enum Status {
269 Unknown = 0,
270 Queued = 1,
271 Running = 2,
272 Succeeded = 3,
273 Failed = 4,
274 Canceled = 5,
275 PostProcessing = 6,
276 }
277 impl Status {
278 pub fn as_str_name(&self) -> &'static str {
283 match self {
284 Self::Unknown => "UNKNOWN",
285 Self::Queued => "QUEUED",
286 Self::Running => "RUNNING",
287 Self::Succeeded => "SUCCEEDED",
288 Self::Failed => "FAILED",
289 Self::Canceled => "CANCELED",
290 Self::PostProcessing => "POST_PROCESSING",
291 }
292 }
293 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
295 match value {
296 "UNKNOWN" => Some(Self::Unknown),
297 "QUEUED" => Some(Self::Queued),
298 "RUNNING" => Some(Self::Running),
299 "SUCCEEDED" => Some(Self::Succeeded),
300 "FAILED" => Some(Self::Failed),
301 "CANCELED" => Some(Self::Canceled),
302 "POST_PROCESSING" => Some(Self::PostProcessing),
303 _ => None,
304 }
305 }
306 }
307}
308#[derive(Clone, Copy, PartialEq, Eq, Hash, ::qcs_dependencies_client::prost::Message)]
311#[prost(prost_path = "::qcs_dependencies_client::prost")]
312pub struct EstimatedDelay {
313 #[prost(message, optional, tag = "1")]
316 pub minimum: ::core::option::Option<qcs_dependencies_client::pbjson_types::Duration>,
317 #[prost(message, optional, tag = "2")]
320 pub maximum: ::core::option::Option<qcs_dependencies_client::pbjson_types::Duration>,
321 #[prost(message, optional, tag = "3")]
323 pub now: ::core::option::Option<qcs_dependencies_client::pbjson_types::Timestamp>,
324}
325pub mod controller_client {
327 #![allow(
328 unused_variables,
329 dead_code,
330 missing_docs,
331 clippy::wildcard_imports,
332 clippy::let_unit_value,
333 )]
334 use qcs_dependencies_client::tonic;
335 use qcs_dependencies_client::tonic_prost;
336 use qcs_dependencies_client::tonic::codegen::*;
337 use qcs_dependencies_client::tonic::codegen::http::Uri;
338 #[derive(Debug, Clone)]
339 pub struct ControllerClient<T> {
340 inner: tonic::client::Grpc<T>,
341 }
342 impl ControllerClient<tonic::transport::Channel> {
343 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
345 where
346 D: TryInto<tonic::transport::Endpoint>,
347 D::Error: Into<StdError>,
348 {
349 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
350 Ok(Self::new(conn))
351 }
352 }
353 impl<T> ControllerClient<T>
354 where
355 T: tonic::client::GrpcService<tonic::body::Body>,
356 T::Error: Into<StdError>,
357 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
358 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
359 {
360 pub fn new(inner: T) -> Self {
361 let inner = tonic::client::Grpc::new(inner);
362 Self { inner }
363 }
364 pub fn with_origin(inner: T, origin: Uri) -> Self {
365 let inner = tonic::client::Grpc::with_origin(inner, origin);
366 Self { inner }
367 }
368 pub fn with_interceptor<F>(
369 inner: T,
370 interceptor: F,
371 ) -> ControllerClient<InterceptedService<T, F>>
372 where
373 F: tonic::service::Interceptor,
374 T::ResponseBody: Default,
375 T: tonic::codegen::Service<
376 http::Request<tonic::body::Body>,
377 Response = http::Response<
378 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
379 >,
380 >,
381 <T as tonic::codegen::Service<
382 http::Request<tonic::body::Body>,
383 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
384 {
385 ControllerClient::new(InterceptedService::new(inner, interceptor))
386 }
387 #[must_use]
392 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
393 self.inner = self.inner.send_compressed(encoding);
394 self
395 }
396 #[must_use]
398 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
399 self.inner = self.inner.accept_compressed(encoding);
400 self
401 }
402 #[must_use]
406 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
407 self.inner = self.inner.max_decoding_message_size(limit);
408 self
409 }
410 #[must_use]
414 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
415 self.inner = self.inner.max_encoding_message_size(limit);
416 self
417 }
418 pub async fn execute_controller_job(
419 &mut self,
420 request: impl tonic::IntoRequest<super::ExecuteControllerJobRequest>,
421 ) -> std::result::Result<
422 tonic::Response<super::ExecuteControllerJobResponse>,
423 tonic::Status,
424 > {
425 self.inner
426 .ready()
427 .await
428 .map_err(|e| {
429 tonic::Status::unknown(
430 format!("Service was not ready: {}", e.into()),
431 )
432 })?;
433 let codec = tonic_prost::ProstCodec::default();
434 let path = http::uri::PathAndQuery::from_static(
435 "/services.controller.Controller/ExecuteControllerJob",
436 );
437 let mut req = request.into_request();
438 req.extensions_mut()
439 .insert(
440 GrpcMethod::new(
441 "services.controller.Controller",
442 "ExecuteControllerJob",
443 ),
444 );
445 self.inner.unary(req, path, codec).await
446 }
447 pub async fn batch_execute_controller_jobs(
448 &mut self,
449 request: impl tonic::IntoRequest<super::BatchExecuteControllerJobsRequest>,
450 ) -> std::result::Result<
451 tonic::Response<super::BatchExecuteControllerJobsResponse>,
452 tonic::Status,
453 > {
454 self.inner
455 .ready()
456 .await
457 .map_err(|e| {
458 tonic::Status::unknown(
459 format!("Service was not ready: {}", e.into()),
460 )
461 })?;
462 let codec = tonic_prost::ProstCodec::default();
463 let path = http::uri::PathAndQuery::from_static(
464 "/services.controller.Controller/BatchExecuteControllerJobs",
465 );
466 let mut req = request.into_request();
467 req.extensions_mut()
468 .insert(
469 GrpcMethod::new(
470 "services.controller.Controller",
471 "BatchExecuteControllerJobs",
472 ),
473 );
474 self.inner.unary(req, path, codec).await
475 }
476 pub async fn get_controller_job_results(
477 &mut self,
478 request: impl tonic::IntoRequest<super::GetControllerJobResultsRequest>,
479 ) -> std::result::Result<
480 tonic::Response<super::GetControllerJobResultsResponse>,
481 tonic::Status,
482 > {
483 self.inner
484 .ready()
485 .await
486 .map_err(|e| {
487 tonic::Status::unknown(
488 format!("Service was not ready: {}", e.into()),
489 )
490 })?;
491 let codec = tonic_prost::ProstCodec::default();
492 let path = http::uri::PathAndQuery::from_static(
493 "/services.controller.Controller/GetControllerJobResults",
494 );
495 let mut req = request.into_request();
496 req.extensions_mut()
497 .insert(
498 GrpcMethod::new(
499 "services.controller.Controller",
500 "GetControllerJobResults",
501 ),
502 );
503 self.inner.unary(req, path, codec).await
504 }
505 pub async fn cancel_controller_jobs(
506 &mut self,
507 request: impl tonic::IntoRequest<super::CancelControllerJobsRequest>,
508 ) -> std::result::Result<
509 tonic::Response<super::CancelControllerJobsResponse>,
510 tonic::Status,
511 > {
512 self.inner
513 .ready()
514 .await
515 .map_err(|e| {
516 tonic::Status::unknown(
517 format!("Service was not ready: {}", e.into()),
518 )
519 })?;
520 let codec = tonic_prost::ProstCodec::default();
521 let path = http::uri::PathAndQuery::from_static(
522 "/services.controller.Controller/CancelControllerJobs",
523 );
524 let mut req = request.into_request();
525 req.extensions_mut()
526 .insert(
527 GrpcMethod::new(
528 "services.controller.Controller",
529 "CancelControllerJobs",
530 ),
531 );
532 self.inner.unary(req, path, codec).await
533 }
534 pub async fn get_controller_job_status(
535 &mut self,
536 request: impl tonic::IntoRequest<super::GetControllerJobStatusRequest>,
537 ) -> std::result::Result<
538 tonic::Response<super::GetControllerJobStatusResponse>,
539 tonic::Status,
540 > {
541 self.inner
542 .ready()
543 .await
544 .map_err(|e| {
545 tonic::Status::unknown(
546 format!("Service was not ready: {}", e.into()),
547 )
548 })?;
549 let codec = tonic_prost::ProstCodec::default();
550 let path = http::uri::PathAndQuery::from_static(
551 "/services.controller.Controller/GetControllerJobStatus",
552 );
553 let mut req = request.into_request();
554 req.extensions_mut()
555 .insert(
556 GrpcMethod::new(
557 "services.controller.Controller",
558 "GetControllerJobStatus",
559 ),
560 );
561 self.inner.unary(req, path, codec).await
562 }
563 }
564}
565#[cfg(feature = "server")]
567pub mod controller_server {
568 #![allow(
569 unused_variables,
570 dead_code,
571 missing_docs,
572 clippy::wildcard_imports,
573 clippy::let_unit_value,
574 )]
575 use qcs_dependencies_client::tonic;
576 use qcs_dependencies_client::tonic_prost;
577 use qcs_dependencies_client::tonic::codegen::*;
578 #[async_trait]
580 pub trait Controller: std::marker::Send + std::marker::Sync + 'static {
581 async fn execute_controller_job(
582 &self,
583 request: tonic::Request<super::ExecuteControllerJobRequest>,
584 ) -> std::result::Result<
585 tonic::Response<super::ExecuteControllerJobResponse>,
586 tonic::Status,
587 >;
588 async fn batch_execute_controller_jobs(
589 &self,
590 request: tonic::Request<super::BatchExecuteControllerJobsRequest>,
591 ) -> std::result::Result<
592 tonic::Response<super::BatchExecuteControllerJobsResponse>,
593 tonic::Status,
594 >;
595 async fn get_controller_job_results(
596 &self,
597 request: tonic::Request<super::GetControllerJobResultsRequest>,
598 ) -> std::result::Result<
599 tonic::Response<super::GetControllerJobResultsResponse>,
600 tonic::Status,
601 >;
602 async fn cancel_controller_jobs(
603 &self,
604 request: tonic::Request<super::CancelControllerJobsRequest>,
605 ) -> std::result::Result<
606 tonic::Response<super::CancelControllerJobsResponse>,
607 tonic::Status,
608 >;
609 async fn get_controller_job_status(
610 &self,
611 request: tonic::Request<super::GetControllerJobStatusRequest>,
612 ) -> std::result::Result<
613 tonic::Response<super::GetControllerJobStatusResponse>,
614 tonic::Status,
615 >;
616 }
617 #[derive(Debug)]
618 pub struct ControllerServer<T> {
619 inner: Arc<T>,
620 accept_compression_encodings: EnabledCompressionEncodings,
621 send_compression_encodings: EnabledCompressionEncodings,
622 max_decoding_message_size: Option<usize>,
623 max_encoding_message_size: Option<usize>,
624 }
625 impl<T> ControllerServer<T> {
626 pub fn new(inner: T) -> Self {
627 Self::from_arc(Arc::new(inner))
628 }
629 pub fn from_arc(inner: Arc<T>) -> Self {
630 Self {
631 inner,
632 accept_compression_encodings: Default::default(),
633 send_compression_encodings: Default::default(),
634 max_decoding_message_size: None,
635 max_encoding_message_size: None,
636 }
637 }
638 pub fn with_interceptor<F>(
639 inner: T,
640 interceptor: F,
641 ) -> InterceptedService<Self, F>
642 where
643 F: tonic::service::Interceptor,
644 {
645 InterceptedService::new(Self::new(inner), interceptor)
646 }
647 #[must_use]
649 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
650 self.accept_compression_encodings.enable(encoding);
651 self
652 }
653 #[must_use]
655 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
656 self.send_compression_encodings.enable(encoding);
657 self
658 }
659 #[must_use]
663 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
664 self.max_decoding_message_size = Some(limit);
665 self
666 }
667 #[must_use]
671 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
672 self.max_encoding_message_size = Some(limit);
673 self
674 }
675 }
676 impl<T, B> tonic::codegen::Service<http::Request<B>> for ControllerServer<T>
677 where
678 T: Controller,
679 B: Body + std::marker::Send + 'static,
680 B::Error: Into<StdError> + std::marker::Send + 'static,
681 {
682 type Response = http::Response<tonic::body::Body>;
683 type Error = std::convert::Infallible;
684 type Future = BoxFuture<Self::Response, Self::Error>;
685 fn poll_ready(
686 &mut self,
687 _cx: &mut Context<'_>,
688 ) -> Poll<std::result::Result<(), Self::Error>> {
689 Poll::Ready(Ok(()))
690 }
691 fn call(&mut self, req: http::Request<B>) -> Self::Future {
692 match req.uri().path() {
693 "/services.controller.Controller/ExecuteControllerJob" => {
694 #[allow(non_camel_case_types)]
695 struct ExecuteControllerJobSvc<T: Controller>(pub Arc<T>);
696 impl<
697 T: Controller,
698 > tonic::server::UnaryService<super::ExecuteControllerJobRequest>
699 for ExecuteControllerJobSvc<T> {
700 type Response = super::ExecuteControllerJobResponse;
701 type Future = BoxFuture<
702 tonic::Response<Self::Response>,
703 tonic::Status,
704 >;
705 fn call(
706 &mut self,
707 request: tonic::Request<super::ExecuteControllerJobRequest>,
708 ) -> Self::Future {
709 let inner = Arc::clone(&self.0);
710 let fut = async move {
711 <T as Controller>::execute_controller_job(&inner, request)
712 .await
713 };
714 Box::pin(fut)
715 }
716 }
717 let accept_compression_encodings = self.accept_compression_encodings;
718 let send_compression_encodings = self.send_compression_encodings;
719 let max_decoding_message_size = self.max_decoding_message_size;
720 let max_encoding_message_size = self.max_encoding_message_size;
721 let inner = self.inner.clone();
722 let fut = async move {
723 let method = ExecuteControllerJobSvc(inner);
724 let codec = tonic_prost::ProstCodec::default();
725 let mut grpc = tonic::server::Grpc::new(codec)
726 .apply_compression_config(
727 accept_compression_encodings,
728 send_compression_encodings,
729 )
730 .apply_max_message_size_config(
731 max_decoding_message_size,
732 max_encoding_message_size,
733 );
734 let res = grpc.unary(method, req).await;
735 Ok(res)
736 };
737 Box::pin(fut)
738 }
739 "/services.controller.Controller/BatchExecuteControllerJobs" => {
740 #[allow(non_camel_case_types)]
741 struct BatchExecuteControllerJobsSvc<T: Controller>(pub Arc<T>);
742 impl<
743 T: Controller,
744 > tonic::server::UnaryService<
745 super::BatchExecuteControllerJobsRequest,
746 > for BatchExecuteControllerJobsSvc<T> {
747 type Response = super::BatchExecuteControllerJobsResponse;
748 type Future = BoxFuture<
749 tonic::Response<Self::Response>,
750 tonic::Status,
751 >;
752 fn call(
753 &mut self,
754 request: tonic::Request<
755 super::BatchExecuteControllerJobsRequest,
756 >,
757 ) -> Self::Future {
758 let inner = Arc::clone(&self.0);
759 let fut = async move {
760 <T as Controller>::batch_execute_controller_jobs(
761 &inner,
762 request,
763 )
764 .await
765 };
766 Box::pin(fut)
767 }
768 }
769 let accept_compression_encodings = self.accept_compression_encodings;
770 let send_compression_encodings = self.send_compression_encodings;
771 let max_decoding_message_size = self.max_decoding_message_size;
772 let max_encoding_message_size = self.max_encoding_message_size;
773 let inner = self.inner.clone();
774 let fut = async move {
775 let method = BatchExecuteControllerJobsSvc(inner);
776 let codec = tonic_prost::ProstCodec::default();
777 let mut grpc = tonic::server::Grpc::new(codec)
778 .apply_compression_config(
779 accept_compression_encodings,
780 send_compression_encodings,
781 )
782 .apply_max_message_size_config(
783 max_decoding_message_size,
784 max_encoding_message_size,
785 );
786 let res = grpc.unary(method, req).await;
787 Ok(res)
788 };
789 Box::pin(fut)
790 }
791 "/services.controller.Controller/GetControllerJobResults" => {
792 #[allow(non_camel_case_types)]
793 struct GetControllerJobResultsSvc<T: Controller>(pub Arc<T>);
794 impl<
795 T: Controller,
796 > tonic::server::UnaryService<super::GetControllerJobResultsRequest>
797 for GetControllerJobResultsSvc<T> {
798 type Response = super::GetControllerJobResultsResponse;
799 type Future = BoxFuture<
800 tonic::Response<Self::Response>,
801 tonic::Status,
802 >;
803 fn call(
804 &mut self,
805 request: tonic::Request<
806 super::GetControllerJobResultsRequest,
807 >,
808 ) -> Self::Future {
809 let inner = Arc::clone(&self.0);
810 let fut = async move {
811 <T as Controller>::get_controller_job_results(
812 &inner,
813 request,
814 )
815 .await
816 };
817 Box::pin(fut)
818 }
819 }
820 let accept_compression_encodings = self.accept_compression_encodings;
821 let send_compression_encodings = self.send_compression_encodings;
822 let max_decoding_message_size = self.max_decoding_message_size;
823 let max_encoding_message_size = self.max_encoding_message_size;
824 let inner = self.inner.clone();
825 let fut = async move {
826 let method = GetControllerJobResultsSvc(inner);
827 let codec = tonic_prost::ProstCodec::default();
828 let mut grpc = tonic::server::Grpc::new(codec)
829 .apply_compression_config(
830 accept_compression_encodings,
831 send_compression_encodings,
832 )
833 .apply_max_message_size_config(
834 max_decoding_message_size,
835 max_encoding_message_size,
836 );
837 let res = grpc.unary(method, req).await;
838 Ok(res)
839 };
840 Box::pin(fut)
841 }
842 "/services.controller.Controller/CancelControllerJobs" => {
843 #[allow(non_camel_case_types)]
844 struct CancelControllerJobsSvc<T: Controller>(pub Arc<T>);
845 impl<
846 T: Controller,
847 > tonic::server::UnaryService<super::CancelControllerJobsRequest>
848 for CancelControllerJobsSvc<T> {
849 type Response = super::CancelControllerJobsResponse;
850 type Future = BoxFuture<
851 tonic::Response<Self::Response>,
852 tonic::Status,
853 >;
854 fn call(
855 &mut self,
856 request: tonic::Request<super::CancelControllerJobsRequest>,
857 ) -> Self::Future {
858 let inner = Arc::clone(&self.0);
859 let fut = async move {
860 <T as Controller>::cancel_controller_jobs(&inner, request)
861 .await
862 };
863 Box::pin(fut)
864 }
865 }
866 let accept_compression_encodings = self.accept_compression_encodings;
867 let send_compression_encodings = self.send_compression_encodings;
868 let max_decoding_message_size = self.max_decoding_message_size;
869 let max_encoding_message_size = self.max_encoding_message_size;
870 let inner = self.inner.clone();
871 let fut = async move {
872 let method = CancelControllerJobsSvc(inner);
873 let codec = tonic_prost::ProstCodec::default();
874 let mut grpc = tonic::server::Grpc::new(codec)
875 .apply_compression_config(
876 accept_compression_encodings,
877 send_compression_encodings,
878 )
879 .apply_max_message_size_config(
880 max_decoding_message_size,
881 max_encoding_message_size,
882 );
883 let res = grpc.unary(method, req).await;
884 Ok(res)
885 };
886 Box::pin(fut)
887 }
888 "/services.controller.Controller/GetControllerJobStatus" => {
889 #[allow(non_camel_case_types)]
890 struct GetControllerJobStatusSvc<T: Controller>(pub Arc<T>);
891 impl<
892 T: Controller,
893 > tonic::server::UnaryService<super::GetControllerJobStatusRequest>
894 for GetControllerJobStatusSvc<T> {
895 type Response = super::GetControllerJobStatusResponse;
896 type Future = BoxFuture<
897 tonic::Response<Self::Response>,
898 tonic::Status,
899 >;
900 fn call(
901 &mut self,
902 request: tonic::Request<super::GetControllerJobStatusRequest>,
903 ) -> Self::Future {
904 let inner = Arc::clone(&self.0);
905 let fut = async move {
906 <T as Controller>::get_controller_job_status(
907 &inner,
908 request,
909 )
910 .await
911 };
912 Box::pin(fut)
913 }
914 }
915 let accept_compression_encodings = self.accept_compression_encodings;
916 let send_compression_encodings = self.send_compression_encodings;
917 let max_decoding_message_size = self.max_decoding_message_size;
918 let max_encoding_message_size = self.max_encoding_message_size;
919 let inner = self.inner.clone();
920 let fut = async move {
921 let method = GetControllerJobStatusSvc(inner);
922 let codec = tonic_prost::ProstCodec::default();
923 let mut grpc = tonic::server::Grpc::new(codec)
924 .apply_compression_config(
925 accept_compression_encodings,
926 send_compression_encodings,
927 )
928 .apply_max_message_size_config(
929 max_decoding_message_size,
930 max_encoding_message_size,
931 );
932 let res = grpc.unary(method, req).await;
933 Ok(res)
934 };
935 Box::pin(fut)
936 }
937 _ => {
938 Box::pin(async move {
939 let mut response = http::Response::new(
940 tonic::body::Body::default(),
941 );
942 let headers = response.headers_mut();
943 headers
944 .insert(
945 tonic::Status::GRPC_STATUS,
946 (tonic::Code::Unimplemented as i32).into(),
947 );
948 headers
949 .insert(
950 http::header::CONTENT_TYPE,
951 tonic::metadata::GRPC_CONTENT_TYPE,
952 );
953 Ok(response)
954 })
955 }
956 }
957 }
958 }
959 impl<T> Clone for ControllerServer<T> {
960 fn clone(&self) -> Self {
961 let inner = self.inner.clone();
962 Self {
963 inner,
964 accept_compression_encodings: self.accept_compression_encodings,
965 send_compression_encodings: self.send_compression_encodings,
966 max_decoding_message_size: self.max_decoding_message_size,
967 max_encoding_message_size: self.max_encoding_message_size,
968 }
969 }
970 }
971 pub const SERVICE_NAME: &str = "services.controller.Controller";
973 impl<T> tonic::server::NamedService for ControllerServer<T> {
974 const NAME: &'static str = SERVICE_NAME;
975 }
976}
977