Skip to main content

qcs_api_client_grpc/gen/
services.controller.rs

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