qcs_api_client_grpc/gen/
services.controller.rs

1// Copyright 2023 Rigetti Computing
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15
16// This file is @generated by prost-build.
17/// A request to execute multiple ControllerJobs as if they were sent as separate requests.
18/// Note that the job execution IDs will be returned in the same order as the requests,
19/// but execution itself may occur out of that order depending on executor configuration.
20#[derive(Clone, PartialEq, ::prost::Message)]
21pub struct BatchExecuteControllerJobsRequest {
22    #[prost(message, repeated, tag = "1")]
23    pub requests: ::prost::alloc::vec::Vec<ExecuteControllerJobRequest>,
24}
25#[derive(Clone, PartialEq, ::prost::Message)]
26pub struct BatchExecuteControllerJobsResponse {
27    #[prost(message, repeated, tag = "1")]
28    pub responses: ::prost::alloc::vec::Vec<ExecuteControllerJobResponse>,
29}
30/// A request to execute a given ControllerJob on a specific target with one or more configurations.
31///
32/// This action is *atomic* in that a job for each configuration will be queued, or none of them will.
33/// On success, the response will contain a sequence of job IDs where the number and order of IDs returned
34/// will correspond to the number and order of configurations given. However, note that execution in the
35/// order of the given configurations is not guaranteed. If there is a failure to queue any of the jobs,
36/// then none will be queued. A request must have at least one configuration, otherwise an error will be
37/// returned.
38#[derive(Clone, PartialEq, ::prost::Message)]
39pub struct ExecuteControllerJobRequest {
40    /// One or more configurations against which to execute the provided job.
41    ///
42    /// The response will include one `job_execution_id` for each entry in this list,
43    /// each corresponding to its configuration in the same order.
44    #[prost(message, repeated, tag = "3")]
45    pub execution_configurations: ::prost::alloc::vec::Vec<
46        super::super::models::controller::JobExecutionConfiguration,
47    >,
48    #[prost(message, optional, tag = "4")]
49    pub options: ::core::option::Option<ExecutionOptions>,
50    #[prost(oneof = "execute_controller_job_request::Job", tags = "201")]
51    pub job: ::core::option::Option<execute_controller_job_request::Job>,
52    /// Required by the gateway to forward requests to the correct execution host.
53    #[prost(oneof = "execute_controller_job_request::Target", tags = "101, 102")]
54    pub target: ::core::option::Option<execute_controller_job_request::Target>,
55}
56/// Nested message and enum types in `ExecuteControllerJobRequest`.
57pub mod execute_controller_job_request {
58    #[derive(serde::Deserialize)]
59    #[derive(Clone, PartialEq, ::prost::Oneof)]
60    pub enum Job {
61        #[prost(message, tag = "201")]
62        Encrypted(super::super::super::models::controller::EncryptedControllerJob),
63    }
64    /// Required by the gateway to forward requests to the correct execution host.
65    #[derive(Clone, PartialEq, ::prost::Oneof)]
66    pub enum Target {
67        #[prost(string, tag = "101")]
68        QuantumProcessorId(::prost::alloc::string::String),
69        #[prost(string, tag = "102")]
70        EndpointId(::prost::alloc::string::String),
71    }
72}
73/// Options specified on execution requests describing any features or processes requested before or after job execution.
74#[derive(Clone, Copy, PartialEq, ::prost::Message)]
75pub struct ExecutionOptions {
76    /// If jobs contain settings that would cause managed settings to change values,
77    /// that job will be rejected unless this field is set to true and the submitter has the appropriate authorization.
78    #[prost(bool, tag = "3")]
79    pub bypass_settings_protection: bool,
80    /// The timeout while running a job; the job will be evicted from the hardware
81    /// once this time has elapsed.
82    ///
83    /// If unset, the job's estimated duration will be used;
84    /// if the job does not have an estimated duration, the default
85    /// timeout is selected by the service.
86    ///
87    /// The service may also enforce a maximum value for this field.
88    #[prost(message, optional, tag = "4")]
89    pub timeout: ::core::option::Option<::pbjson_types::Duration>,
90}
91#[derive(Clone, PartialEq, ::prost::Message)]
92pub struct ExecuteControllerJobResponse {
93    /// One execution ID per input JobExecutionConfiguration, in the same order as the input.
94    #[prost(string, repeated, tag = "1")]
95    pub job_execution_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
96}
97#[derive(Clone, PartialEq, ::prost::Message)]
98pub struct GetControllerJobResultsRequest {
99    /// Which Controller Job execution to query for results
100    #[prost(string, tag = "1")]
101    pub job_execution_id: ::prost::alloc::string::String,
102    /// Required by the gateway to forward requests to the correct execution host.
103    #[prost(oneof = "get_controller_job_results_request::Target", tags = "101, 102")]
104    pub target: ::core::option::Option<get_controller_job_results_request::Target>,
105}
106/// Nested message and enum types in `GetControllerJobResultsRequest`.
107pub mod get_controller_job_results_request {
108    /// Required by the gateway to forward requests to the correct execution host.
109    #[derive(Clone, PartialEq, ::prost::Oneof)]
110    pub enum Target {
111        #[prost(string, tag = "101")]
112        QuantumProcessorId(::prost::alloc::string::String),
113        #[prost(string, tag = "102")]
114        EndpointId(::prost::alloc::string::String),
115    }
116}
117#[derive(Clone, PartialEq, ::prost::Message)]
118pub struct GetControllerJobResultsResponse {
119    #[prost(message, optional, tag = "1")]
120    pub result: ::core::option::Option<
121        super::super::models::controller::ControllerJobExecutionResult,
122    >,
123}
124/// Cancel all given jobs that have yet to begin executing.
125/// This endpoint is *not* atomic, and will attempt to cancel every job even
126/// when some jobs cannot be canceled. A job can be canceled only if it
127/// has not yet started executing.
128///
129/// Success response indicates only that the request was received. Cancellation
130/// is not guaranteed, as it is based on job state at time of cancellation, and is
131/// completed on a best-effort basis.
132#[derive(Clone, PartialEq, ::prost::Message)]
133pub struct CancelControllerJobsRequest {
134    #[prost(string, repeated, tag = "1")]
135    pub job_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
136    /// Required by ConServ gateway to forward requests to the correct rackhost.
137    #[prost(oneof = "cancel_controller_jobs_request::Target", tags = "101, 102")]
138    pub target: ::core::option::Option<cancel_controller_jobs_request::Target>,
139}
140/// Nested message and enum types in `CancelControllerJobsRequest`.
141pub mod cancel_controller_jobs_request {
142    /// Required by ConServ gateway to forward requests to the correct rackhost.
143    #[derive(Clone, PartialEq, ::prost::Oneof)]
144    pub enum Target {
145        #[prost(string, tag = "101")]
146        QuantumProcessorId(::prost::alloc::string::String),
147        #[prost(string, tag = "102")]
148        EndpointId(::prost::alloc::string::String),
149    }
150}
151#[derive(Clone, Copy, PartialEq, ::prost::Message)]
152pub struct CancelControllerJobsResponse {}
153#[derive(Clone, PartialEq, ::prost::Message)]
154pub struct GetControllerJobStatusRequest {
155    #[prost(string, tag = "1")]
156    pub job_id: ::prost::alloc::string::String,
157    /// Required by ConServ gateway to forward requests to the correct rackhost.
158    #[prost(oneof = "get_controller_job_status_request::Target", tags = "101, 102")]
159    pub target: ::core::option::Option<get_controller_job_status_request::Target>,
160}
161/// Nested message and enum types in `GetControllerJobStatusRequest`.
162pub mod get_controller_job_status_request {
163    /// Required by ConServ gateway to forward requests to the correct rackhost.
164    #[derive(Clone, PartialEq, ::prost::Oneof)]
165    pub enum Target {
166        #[prost(string, tag = "101")]
167        QuantumProcessorId(::prost::alloc::string::String),
168        #[prost(string, tag = "102")]
169        EndpointId(::prost::alloc::string::String),
170    }
171}
172#[derive(Clone, Copy, PartialEq, ::prost::Message)]
173pub struct GetControllerJobStatusResponse {
174    #[prost(enumeration = "get_controller_job_status_response::Status", tag = "1")]
175    pub status: i32,
176    /// Best-effort estimate of how long it will be (from the time the response is
177    /// generated) until the job is finished executing.
178    /// This will not attempt to account for future schedule modifications, such as
179    /// the arrival of a higher-priority job or a maintenance reservation being
180    /// scheduled.
181    /// The minimum estimate uses each job's estimated duration, if available; the
182    /// maximum estimate uses the execution timeout enforced by the controller
183    /// service.
184    #[prost(message, optional, tag = "2")]
185    pub estimated_job_completion_delay: ::core::option::Option<EstimatedDelay>,
186}
187/// Nested message and enum types in `GetControllerJobStatusResponse`.
188pub mod get_controller_job_status_response {
189    #[derive(
190        Clone,
191        Copy,
192        Debug,
193        PartialEq,
194        Eq,
195        Hash,
196        PartialOrd,
197        Ord,
198        ::prost::Enumeration
199    )]
200    #[repr(i32)]
201    pub enum Status {
202        Unknown = 0,
203        Queued = 1,
204        Running = 2,
205        Succeeded = 3,
206        Failed = 4,
207        Canceled = 5,
208        PostProcessing = 6,
209    }
210    impl Status {
211        /// String value of the enum field names used in the ProtoBuf definition.
212        ///
213        /// The values are not transformed in any way and thus are considered stable
214        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
215        pub fn as_str_name(&self) -> &'static str {
216            match self {
217                Self::Unknown => "UNKNOWN",
218                Self::Queued => "QUEUED",
219                Self::Running => "RUNNING",
220                Self::Succeeded => "SUCCEEDED",
221                Self::Failed => "FAILED",
222                Self::Canceled => "CANCELED",
223                Self::PostProcessing => "POST_PROCESSING",
224            }
225        }
226        /// Creates an enum from field names used in the ProtoBuf definition.
227        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
228            match value {
229                "UNKNOWN" => Some(Self::Unknown),
230                "QUEUED" => Some(Self::Queued),
231                "RUNNING" => Some(Self::Running),
232                "SUCCEEDED" => Some(Self::Succeeded),
233                "FAILED" => Some(Self::Failed),
234                "CANCELED" => Some(Self::Canceled),
235                "POST_PROCESSING" => Some(Self::PostProcessing),
236                _ => None,
237            }
238        }
239    }
240}
241/// An estimation of the delay before a specific event, such as when a queued job
242/// is expected to be dequeued and run.
243#[derive(Clone, Copy, PartialEq, ::prost::Message)]
244pub struct EstimatedDelay {
245    /// Our most optimistic estimate of the delay before the event (will always be the lowest duration in
246    /// this message)
247    #[prost(message, optional, tag = "1")]
248    pub minimum: ::core::option::Option<::pbjson_types::Duration>,
249    /// Our most pessimistic estimate of the delay (will always be the highest duration in this
250    /// message)
251    #[prost(message, optional, tag = "2")]
252    pub maximum: ::core::option::Option<::pbjson_types::Duration>,
253    /// When these estimates were calculated
254    #[prost(message, optional, tag = "3")]
255    pub now: ::core::option::Option<::pbjson_types::Timestamp>,
256}
257/// Generated client implementations.
258pub mod controller_client {
259    #![allow(
260        unused_variables,
261        dead_code,
262        missing_docs,
263        clippy::wildcard_imports,
264        clippy::let_unit_value,
265    )]
266    use tonic::codegen::*;
267    use tonic::codegen::http::Uri;
268    #[derive(Debug, Clone)]
269    pub struct ControllerClient<T> {
270        inner: tonic::client::Grpc<T>,
271    }
272    impl ControllerClient<tonic::transport::Channel> {
273        /// Attempt to create a new client by connecting to a given endpoint.
274        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
275        where
276            D: TryInto<tonic::transport::Endpoint>,
277            D::Error: Into<StdError>,
278        {
279            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
280            Ok(Self::new(conn))
281        }
282    }
283    impl<T> ControllerClient<T>
284    where
285        T: tonic::client::GrpcService<tonic::body::BoxBody>,
286        T::Error: Into<StdError>,
287        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
288        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
289    {
290        pub fn new(inner: T) -> Self {
291            let inner = tonic::client::Grpc::new(inner);
292            Self { inner }
293        }
294        pub fn with_origin(inner: T, origin: Uri) -> Self {
295            let inner = tonic::client::Grpc::with_origin(inner, origin);
296            Self { inner }
297        }
298        pub fn with_interceptor<F>(
299            inner: T,
300            interceptor: F,
301        ) -> ControllerClient<InterceptedService<T, F>>
302        where
303            F: tonic::service::Interceptor,
304            T::ResponseBody: Default,
305            T: tonic::codegen::Service<
306                http::Request<tonic::body::BoxBody>,
307                Response = http::Response<
308                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
309                >,
310            >,
311            <T as tonic::codegen::Service<
312                http::Request<tonic::body::BoxBody>,
313            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
314        {
315            ControllerClient::new(InterceptedService::new(inner, interceptor))
316        }
317        /// Compress requests with the given encoding.
318        ///
319        /// This requires the server to support it otherwise it might respond with an
320        /// error.
321        #[must_use]
322        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
323            self.inner = self.inner.send_compressed(encoding);
324            self
325        }
326        /// Enable decompressing responses.
327        #[must_use]
328        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
329            self.inner = self.inner.accept_compressed(encoding);
330            self
331        }
332        /// Limits the maximum size of a decoded message.
333        ///
334        /// Default: `4MB`
335        #[must_use]
336        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
337            self.inner = self.inner.max_decoding_message_size(limit);
338            self
339        }
340        /// Limits the maximum size of an encoded message.
341        ///
342        /// Default: `usize::MAX`
343        #[must_use]
344        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
345            self.inner = self.inner.max_encoding_message_size(limit);
346            self
347        }
348        pub async fn execute_controller_job(
349            &mut self,
350            request: impl tonic::IntoRequest<super::ExecuteControllerJobRequest>,
351        ) -> std::result::Result<
352            tonic::Response<super::ExecuteControllerJobResponse>,
353            tonic::Status,
354        > {
355            self.inner
356                .ready()
357                .await
358                .map_err(|e| {
359                    tonic::Status::unknown(
360                        format!("Service was not ready: {}", e.into()),
361                    )
362                })?;
363            let codec = tonic::codec::ProstCodec::default();
364            let path = http::uri::PathAndQuery::from_static(
365                "/services.controller.Controller/ExecuteControllerJob",
366            );
367            let mut req = request.into_request();
368            req.extensions_mut()
369                .insert(
370                    GrpcMethod::new(
371                        "services.controller.Controller",
372                        "ExecuteControllerJob",
373                    ),
374                );
375            self.inner.unary(req, path, codec).await
376        }
377        pub async fn batch_execute_controller_jobs(
378            &mut self,
379            request: impl tonic::IntoRequest<super::BatchExecuteControllerJobsRequest>,
380        ) -> std::result::Result<
381            tonic::Response<super::BatchExecuteControllerJobsResponse>,
382            tonic::Status,
383        > {
384            self.inner
385                .ready()
386                .await
387                .map_err(|e| {
388                    tonic::Status::unknown(
389                        format!("Service was not ready: {}", e.into()),
390                    )
391                })?;
392            let codec = tonic::codec::ProstCodec::default();
393            let path = http::uri::PathAndQuery::from_static(
394                "/services.controller.Controller/BatchExecuteControllerJobs",
395            );
396            let mut req = request.into_request();
397            req.extensions_mut()
398                .insert(
399                    GrpcMethod::new(
400                        "services.controller.Controller",
401                        "BatchExecuteControllerJobs",
402                    ),
403                );
404            self.inner.unary(req, path, codec).await
405        }
406        pub async fn get_controller_job_results(
407            &mut self,
408            request: impl tonic::IntoRequest<super::GetControllerJobResultsRequest>,
409        ) -> std::result::Result<
410            tonic::Response<super::GetControllerJobResultsResponse>,
411            tonic::Status,
412        > {
413            self.inner
414                .ready()
415                .await
416                .map_err(|e| {
417                    tonic::Status::unknown(
418                        format!("Service was not ready: {}", e.into()),
419                    )
420                })?;
421            let codec = tonic::codec::ProstCodec::default();
422            let path = http::uri::PathAndQuery::from_static(
423                "/services.controller.Controller/GetControllerJobResults",
424            );
425            let mut req = request.into_request();
426            req.extensions_mut()
427                .insert(
428                    GrpcMethod::new(
429                        "services.controller.Controller",
430                        "GetControllerJobResults",
431                    ),
432                );
433            self.inner.unary(req, path, codec).await
434        }
435        pub async fn cancel_controller_jobs(
436            &mut self,
437            request: impl tonic::IntoRequest<super::CancelControllerJobsRequest>,
438        ) -> std::result::Result<
439            tonic::Response<super::CancelControllerJobsResponse>,
440            tonic::Status,
441        > {
442            self.inner
443                .ready()
444                .await
445                .map_err(|e| {
446                    tonic::Status::unknown(
447                        format!("Service was not ready: {}", e.into()),
448                    )
449                })?;
450            let codec = tonic::codec::ProstCodec::default();
451            let path = http::uri::PathAndQuery::from_static(
452                "/services.controller.Controller/CancelControllerJobs",
453            );
454            let mut req = request.into_request();
455            req.extensions_mut()
456                .insert(
457                    GrpcMethod::new(
458                        "services.controller.Controller",
459                        "CancelControllerJobs",
460                    ),
461                );
462            self.inner.unary(req, path, codec).await
463        }
464        pub async fn get_controller_job_status(
465            &mut self,
466            request: impl tonic::IntoRequest<super::GetControllerJobStatusRequest>,
467        ) -> std::result::Result<
468            tonic::Response<super::GetControllerJobStatusResponse>,
469            tonic::Status,
470        > {
471            self.inner
472                .ready()
473                .await
474                .map_err(|e| {
475                    tonic::Status::unknown(
476                        format!("Service was not ready: {}", e.into()),
477                    )
478                })?;
479            let codec = tonic::codec::ProstCodec::default();
480            let path = http::uri::PathAndQuery::from_static(
481                "/services.controller.Controller/GetControllerJobStatus",
482            );
483            let mut req = request.into_request();
484            req.extensions_mut()
485                .insert(
486                    GrpcMethod::new(
487                        "services.controller.Controller",
488                        "GetControllerJobStatus",
489                    ),
490                );
491            self.inner.unary(req, path, codec).await
492        }
493    }
494}
495/// Generated server implementations.
496#[cfg(feature = "server")]
497pub mod controller_server {
498    #![allow(
499        unused_variables,
500        dead_code,
501        missing_docs,
502        clippy::wildcard_imports,
503        clippy::let_unit_value,
504    )]
505    use tonic::codegen::*;
506    /// Generated trait containing gRPC methods that should be implemented for use with ControllerServer.
507    #[async_trait]
508    pub trait Controller: std::marker::Send + std::marker::Sync + 'static {
509        async fn execute_controller_job(
510            &self,
511            request: tonic::Request<super::ExecuteControllerJobRequest>,
512        ) -> std::result::Result<
513            tonic::Response<super::ExecuteControllerJobResponse>,
514            tonic::Status,
515        >;
516        async fn batch_execute_controller_jobs(
517            &self,
518            request: tonic::Request<super::BatchExecuteControllerJobsRequest>,
519        ) -> std::result::Result<
520            tonic::Response<super::BatchExecuteControllerJobsResponse>,
521            tonic::Status,
522        >;
523        async fn get_controller_job_results(
524            &self,
525            request: tonic::Request<super::GetControllerJobResultsRequest>,
526        ) -> std::result::Result<
527            tonic::Response<super::GetControllerJobResultsResponse>,
528            tonic::Status,
529        >;
530        async fn cancel_controller_jobs(
531            &self,
532            request: tonic::Request<super::CancelControllerJobsRequest>,
533        ) -> std::result::Result<
534            tonic::Response<super::CancelControllerJobsResponse>,
535            tonic::Status,
536        >;
537        async fn get_controller_job_status(
538            &self,
539            request: tonic::Request<super::GetControllerJobStatusRequest>,
540        ) -> std::result::Result<
541            tonic::Response<super::GetControllerJobStatusResponse>,
542            tonic::Status,
543        >;
544    }
545    #[derive(Debug)]
546    pub struct ControllerServer<T> {
547        inner: Arc<T>,
548        accept_compression_encodings: EnabledCompressionEncodings,
549        send_compression_encodings: EnabledCompressionEncodings,
550        max_decoding_message_size: Option<usize>,
551        max_encoding_message_size: Option<usize>,
552    }
553    impl<T> ControllerServer<T> {
554        pub fn new(inner: T) -> Self {
555            Self::from_arc(Arc::new(inner))
556        }
557        pub fn from_arc(inner: Arc<T>) -> Self {
558            Self {
559                inner,
560                accept_compression_encodings: Default::default(),
561                send_compression_encodings: Default::default(),
562                max_decoding_message_size: None,
563                max_encoding_message_size: None,
564            }
565        }
566        pub fn with_interceptor<F>(
567            inner: T,
568            interceptor: F,
569        ) -> InterceptedService<Self, F>
570        where
571            F: tonic::service::Interceptor,
572        {
573            InterceptedService::new(Self::new(inner), interceptor)
574        }
575        /// Enable decompressing requests with the given encoding.
576        #[must_use]
577        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
578            self.accept_compression_encodings.enable(encoding);
579            self
580        }
581        /// Compress responses with the given encoding, if the client supports it.
582        #[must_use]
583        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
584            self.send_compression_encodings.enable(encoding);
585            self
586        }
587        /// Limits the maximum size of a decoded message.
588        ///
589        /// Default: `4MB`
590        #[must_use]
591        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
592            self.max_decoding_message_size = Some(limit);
593            self
594        }
595        /// Limits the maximum size of an encoded message.
596        ///
597        /// Default: `usize::MAX`
598        #[must_use]
599        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
600            self.max_encoding_message_size = Some(limit);
601            self
602        }
603    }
604    impl<T, B> tonic::codegen::Service<http::Request<B>> for ControllerServer<T>
605    where
606        T: Controller,
607        B: Body + std::marker::Send + 'static,
608        B::Error: Into<StdError> + std::marker::Send + 'static,
609    {
610        type Response = http::Response<tonic::body::BoxBody>;
611        type Error = std::convert::Infallible;
612        type Future = BoxFuture<Self::Response, Self::Error>;
613        fn poll_ready(
614            &mut self,
615            _cx: &mut Context<'_>,
616        ) -> Poll<std::result::Result<(), Self::Error>> {
617            Poll::Ready(Ok(()))
618        }
619        fn call(&mut self, req: http::Request<B>) -> Self::Future {
620            match req.uri().path() {
621                "/services.controller.Controller/ExecuteControllerJob" => {
622                    #[allow(non_camel_case_types)]
623                    struct ExecuteControllerJobSvc<T: Controller>(pub Arc<T>);
624                    impl<
625                        T: Controller,
626                    > tonic::server::UnaryService<super::ExecuteControllerJobRequest>
627                    for ExecuteControllerJobSvc<T> {
628                        type Response = super::ExecuteControllerJobResponse;
629                        type Future = BoxFuture<
630                            tonic::Response<Self::Response>,
631                            tonic::Status,
632                        >;
633                        fn call(
634                            &mut self,
635                            request: tonic::Request<super::ExecuteControllerJobRequest>,
636                        ) -> Self::Future {
637                            let inner = Arc::clone(&self.0);
638                            let fut = async move {
639                                <T as Controller>::execute_controller_job(&inner, request)
640                                    .await
641                            };
642                            Box::pin(fut)
643                        }
644                    }
645                    let accept_compression_encodings = self.accept_compression_encodings;
646                    let send_compression_encodings = self.send_compression_encodings;
647                    let max_decoding_message_size = self.max_decoding_message_size;
648                    let max_encoding_message_size = self.max_encoding_message_size;
649                    let inner = self.inner.clone();
650                    let fut = async move {
651                        let method = ExecuteControllerJobSvc(inner);
652                        let codec = tonic::codec::ProstCodec::default();
653                        let mut grpc = tonic::server::Grpc::new(codec)
654                            .apply_compression_config(
655                                accept_compression_encodings,
656                                send_compression_encodings,
657                            )
658                            .apply_max_message_size_config(
659                                max_decoding_message_size,
660                                max_encoding_message_size,
661                            );
662                        let res = grpc.unary(method, req).await;
663                        Ok(res)
664                    };
665                    Box::pin(fut)
666                }
667                "/services.controller.Controller/BatchExecuteControllerJobs" => {
668                    #[allow(non_camel_case_types)]
669                    struct BatchExecuteControllerJobsSvc<T: Controller>(pub Arc<T>);
670                    impl<
671                        T: Controller,
672                    > tonic::server::UnaryService<
673                        super::BatchExecuteControllerJobsRequest,
674                    > for BatchExecuteControllerJobsSvc<T> {
675                        type Response = super::BatchExecuteControllerJobsResponse;
676                        type Future = BoxFuture<
677                            tonic::Response<Self::Response>,
678                            tonic::Status,
679                        >;
680                        fn call(
681                            &mut self,
682                            request: tonic::Request<
683                                super::BatchExecuteControllerJobsRequest,
684                            >,
685                        ) -> Self::Future {
686                            let inner = Arc::clone(&self.0);
687                            let fut = async move {
688                                <T as Controller>::batch_execute_controller_jobs(
689                                        &inner,
690                                        request,
691                                    )
692                                    .await
693                            };
694                            Box::pin(fut)
695                        }
696                    }
697                    let accept_compression_encodings = self.accept_compression_encodings;
698                    let send_compression_encodings = self.send_compression_encodings;
699                    let max_decoding_message_size = self.max_decoding_message_size;
700                    let max_encoding_message_size = self.max_encoding_message_size;
701                    let inner = self.inner.clone();
702                    let fut = async move {
703                        let method = BatchExecuteControllerJobsSvc(inner);
704                        let codec = tonic::codec::ProstCodec::default();
705                        let mut grpc = tonic::server::Grpc::new(codec)
706                            .apply_compression_config(
707                                accept_compression_encodings,
708                                send_compression_encodings,
709                            )
710                            .apply_max_message_size_config(
711                                max_decoding_message_size,
712                                max_encoding_message_size,
713                            );
714                        let res = grpc.unary(method, req).await;
715                        Ok(res)
716                    };
717                    Box::pin(fut)
718                }
719                "/services.controller.Controller/GetControllerJobResults" => {
720                    #[allow(non_camel_case_types)]
721                    struct GetControllerJobResultsSvc<T: Controller>(pub Arc<T>);
722                    impl<
723                        T: Controller,
724                    > tonic::server::UnaryService<super::GetControllerJobResultsRequest>
725                    for GetControllerJobResultsSvc<T> {
726                        type Response = super::GetControllerJobResultsResponse;
727                        type Future = BoxFuture<
728                            tonic::Response<Self::Response>,
729                            tonic::Status,
730                        >;
731                        fn call(
732                            &mut self,
733                            request: tonic::Request<
734                                super::GetControllerJobResultsRequest,
735                            >,
736                        ) -> Self::Future {
737                            let inner = Arc::clone(&self.0);
738                            let fut = async move {
739                                <T as Controller>::get_controller_job_results(
740                                        &inner,
741                                        request,
742                                    )
743                                    .await
744                            };
745                            Box::pin(fut)
746                        }
747                    }
748                    let accept_compression_encodings = self.accept_compression_encodings;
749                    let send_compression_encodings = self.send_compression_encodings;
750                    let max_decoding_message_size = self.max_decoding_message_size;
751                    let max_encoding_message_size = self.max_encoding_message_size;
752                    let inner = self.inner.clone();
753                    let fut = async move {
754                        let method = GetControllerJobResultsSvc(inner);
755                        let codec = tonic::codec::ProstCodec::default();
756                        let mut grpc = tonic::server::Grpc::new(codec)
757                            .apply_compression_config(
758                                accept_compression_encodings,
759                                send_compression_encodings,
760                            )
761                            .apply_max_message_size_config(
762                                max_decoding_message_size,
763                                max_encoding_message_size,
764                            );
765                        let res = grpc.unary(method, req).await;
766                        Ok(res)
767                    };
768                    Box::pin(fut)
769                }
770                "/services.controller.Controller/CancelControllerJobs" => {
771                    #[allow(non_camel_case_types)]
772                    struct CancelControllerJobsSvc<T: Controller>(pub Arc<T>);
773                    impl<
774                        T: Controller,
775                    > tonic::server::UnaryService<super::CancelControllerJobsRequest>
776                    for CancelControllerJobsSvc<T> {
777                        type Response = super::CancelControllerJobsResponse;
778                        type Future = BoxFuture<
779                            tonic::Response<Self::Response>,
780                            tonic::Status,
781                        >;
782                        fn call(
783                            &mut self,
784                            request: tonic::Request<super::CancelControllerJobsRequest>,
785                        ) -> Self::Future {
786                            let inner = Arc::clone(&self.0);
787                            let fut = async move {
788                                <T as Controller>::cancel_controller_jobs(&inner, request)
789                                    .await
790                            };
791                            Box::pin(fut)
792                        }
793                    }
794                    let accept_compression_encodings = self.accept_compression_encodings;
795                    let send_compression_encodings = self.send_compression_encodings;
796                    let max_decoding_message_size = self.max_decoding_message_size;
797                    let max_encoding_message_size = self.max_encoding_message_size;
798                    let inner = self.inner.clone();
799                    let fut = async move {
800                        let method = CancelControllerJobsSvc(inner);
801                        let codec = tonic::codec::ProstCodec::default();
802                        let mut grpc = tonic::server::Grpc::new(codec)
803                            .apply_compression_config(
804                                accept_compression_encodings,
805                                send_compression_encodings,
806                            )
807                            .apply_max_message_size_config(
808                                max_decoding_message_size,
809                                max_encoding_message_size,
810                            );
811                        let res = grpc.unary(method, req).await;
812                        Ok(res)
813                    };
814                    Box::pin(fut)
815                }
816                "/services.controller.Controller/GetControllerJobStatus" => {
817                    #[allow(non_camel_case_types)]
818                    struct GetControllerJobStatusSvc<T: Controller>(pub Arc<T>);
819                    impl<
820                        T: Controller,
821                    > tonic::server::UnaryService<super::GetControllerJobStatusRequest>
822                    for GetControllerJobStatusSvc<T> {
823                        type Response = super::GetControllerJobStatusResponse;
824                        type Future = BoxFuture<
825                            tonic::Response<Self::Response>,
826                            tonic::Status,
827                        >;
828                        fn call(
829                            &mut self,
830                            request: tonic::Request<super::GetControllerJobStatusRequest>,
831                        ) -> Self::Future {
832                            let inner = Arc::clone(&self.0);
833                            let fut = async move {
834                                <T as Controller>::get_controller_job_status(
835                                        &inner,
836                                        request,
837                                    )
838                                    .await
839                            };
840                            Box::pin(fut)
841                        }
842                    }
843                    let accept_compression_encodings = self.accept_compression_encodings;
844                    let send_compression_encodings = self.send_compression_encodings;
845                    let max_decoding_message_size = self.max_decoding_message_size;
846                    let max_encoding_message_size = self.max_encoding_message_size;
847                    let inner = self.inner.clone();
848                    let fut = async move {
849                        let method = GetControllerJobStatusSvc(inner);
850                        let codec = tonic::codec::ProstCodec::default();
851                        let mut grpc = tonic::server::Grpc::new(codec)
852                            .apply_compression_config(
853                                accept_compression_encodings,
854                                send_compression_encodings,
855                            )
856                            .apply_max_message_size_config(
857                                max_decoding_message_size,
858                                max_encoding_message_size,
859                            );
860                        let res = grpc.unary(method, req).await;
861                        Ok(res)
862                    };
863                    Box::pin(fut)
864                }
865                _ => {
866                    Box::pin(async move {
867                        let mut response = http::Response::new(empty_body());
868                        let headers = response.headers_mut();
869                        headers
870                            .insert(
871                                tonic::Status::GRPC_STATUS,
872                                (tonic::Code::Unimplemented as i32).into(),
873                            );
874                        headers
875                            .insert(
876                                http::header::CONTENT_TYPE,
877                                tonic::metadata::GRPC_CONTENT_TYPE,
878                            );
879                        Ok(response)
880                    })
881                }
882            }
883        }
884    }
885    impl<T> Clone for ControllerServer<T> {
886        fn clone(&self) -> Self {
887            let inner = self.inner.clone();
888            Self {
889                inner,
890                accept_compression_encodings: self.accept_compression_encodings,
891                send_compression_encodings: self.send_compression_encodings,
892                max_decoding_message_size: self.max_decoding_message_size,
893                max_encoding_message_size: self.max_encoding_message_size,
894            }
895        }
896    }
897    /// Generated gRPC service name
898    pub const SERVICE_NAME: &str = "services.controller.Controller";
899    impl<T> tonic::server::NamedService for ControllerServer<T> {
900        const NAME: &'static str = SERVICE_NAME;
901    }
902}
903