1#[derive(prost_helpers::AnyPB)]
4#[derive(Clone, Copy, PartialEq, ::prost::Message)]
5pub struct ProvisionRequest {}
6#[derive(prost_helpers::AnyPB)]
7#[derive(Clone, PartialEq, ::prost::Message)]
8pub struct ProvisionResponse {
9 #[prost(string, tag = "1")]
10 pub resource_group: ::prost::alloc::string::String,
11}
12pub mod node_group_controller_service_client {
14 #![allow(
15 unused_variables,
16 dead_code,
17 missing_docs,
18 clippy::wildcard_imports,
19 clippy::let_unit_value,
20 )]
21 use tonic::codegen::*;
22 use tonic::codegen::http::Uri;
23 #[derive(Debug, Clone)]
24 pub struct NodeGroupControllerServiceClient<T> {
25 inner: tonic::client::Grpc<T>,
26 }
27 impl NodeGroupControllerServiceClient<tonic::transport::Channel> {
28 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
30 where
31 D: TryInto<tonic::transport::Endpoint>,
32 D::Error: Into<StdError>,
33 {
34 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
35 Ok(Self::new(conn))
36 }
37 }
38 impl<T> NodeGroupControllerServiceClient<T>
39 where
40 T: tonic::client::GrpcService<tonic::body::BoxBody>,
41 T::Error: Into<StdError>,
42 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
43 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
44 {
45 pub fn new(inner: T) -> Self {
46 let inner = tonic::client::Grpc::new(inner);
47 Self { inner }
48 }
49 pub fn with_origin(inner: T, origin: Uri) -> Self {
50 let inner = tonic::client::Grpc::with_origin(inner, origin);
51 Self { inner }
52 }
53 pub fn with_interceptor<F>(
54 inner: T,
55 interceptor: F,
56 ) -> NodeGroupControllerServiceClient<InterceptedService<T, F>>
57 where
58 F: tonic::service::Interceptor,
59 T::ResponseBody: Default,
60 T: tonic::codegen::Service<
61 http::Request<tonic::body::BoxBody>,
62 Response = http::Response<
63 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
64 >,
65 >,
66 <T as tonic::codegen::Service<
67 http::Request<tonic::body::BoxBody>,
68 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
69 {
70 NodeGroupControllerServiceClient::new(
71 InterceptedService::new(inner, interceptor),
72 )
73 }
74 #[must_use]
79 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
80 self.inner = self.inner.send_compressed(encoding);
81 self
82 }
83 #[must_use]
85 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
86 self.inner = self.inner.accept_compressed(encoding);
87 self
88 }
89 #[must_use]
93 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
94 self.inner = self.inner.max_decoding_message_size(limit);
95 self
96 }
97 #[must_use]
101 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
102 self.inner = self.inner.max_encoding_message_size(limit);
103 self
104 }
105 pub async fn provision(
112 &mut self,
113 request: impl tonic::IntoRequest<super::ProvisionRequest>,
114 ) -> std::result::Result<
115 tonic::Response<super::ProvisionResponse>,
116 tonic::Status,
117 > {
118 self.inner
119 .ready()
120 .await
121 .map_err(|e| {
122 tonic::Status::unknown(
123 format!("Service was not ready: {}", e.into()),
124 )
125 })?;
126 let codec = tonic::codec::ProstCodec::default();
127 let path = http::uri::PathAndQuery::from_static(
128 "/serverless_backfill_controller.NodeGroupControllerService/Provision",
129 );
130 let mut req = request.into_request();
131 req.extensions_mut()
132 .insert(
133 GrpcMethod::new(
134 "serverless_backfill_controller.NodeGroupControllerService",
135 "Provision",
136 ),
137 );
138 self.inner.unary(req, path, codec).await
139 }
140 }
141}
142pub mod node_group_controller_service_server {
144 #![allow(
145 unused_variables,
146 dead_code,
147 missing_docs,
148 clippy::wildcard_imports,
149 clippy::let_unit_value,
150 )]
151 use tonic::codegen::*;
152 #[async_trait]
154 pub trait NodeGroupControllerService: std::marker::Send + std::marker::Sync + 'static {
155 async fn provision(
162 &self,
163 request: tonic::Request<super::ProvisionRequest>,
164 ) -> std::result::Result<
165 tonic::Response<super::ProvisionResponse>,
166 tonic::Status,
167 >;
168 }
169 #[derive(Debug)]
170 pub struct NodeGroupControllerServiceServer<T> {
171 inner: Arc<T>,
172 accept_compression_encodings: EnabledCompressionEncodings,
173 send_compression_encodings: EnabledCompressionEncodings,
174 max_decoding_message_size: Option<usize>,
175 max_encoding_message_size: Option<usize>,
176 }
177 impl<T> NodeGroupControllerServiceServer<T> {
178 pub fn new(inner: T) -> Self {
179 Self::from_arc(Arc::new(inner))
180 }
181 pub fn from_arc(inner: Arc<T>) -> Self {
182 Self {
183 inner,
184 accept_compression_encodings: Default::default(),
185 send_compression_encodings: Default::default(),
186 max_decoding_message_size: None,
187 max_encoding_message_size: None,
188 }
189 }
190 pub fn with_interceptor<F>(
191 inner: T,
192 interceptor: F,
193 ) -> InterceptedService<Self, F>
194 where
195 F: tonic::service::Interceptor,
196 {
197 InterceptedService::new(Self::new(inner), interceptor)
198 }
199 #[must_use]
201 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
202 self.accept_compression_encodings.enable(encoding);
203 self
204 }
205 #[must_use]
207 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
208 self.send_compression_encodings.enable(encoding);
209 self
210 }
211 #[must_use]
215 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
216 self.max_decoding_message_size = Some(limit);
217 self
218 }
219 #[must_use]
223 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
224 self.max_encoding_message_size = Some(limit);
225 self
226 }
227 }
228 impl<T, B> tonic::codegen::Service<http::Request<B>>
229 for NodeGroupControllerServiceServer<T>
230 where
231 T: NodeGroupControllerService,
232 B: Body + std::marker::Send + 'static,
233 B::Error: Into<StdError> + std::marker::Send + 'static,
234 {
235 type Response = http::Response<tonic::body::BoxBody>;
236 type Error = std::convert::Infallible;
237 type Future = BoxFuture<Self::Response, Self::Error>;
238 fn poll_ready(
239 &mut self,
240 _cx: &mut Context<'_>,
241 ) -> Poll<std::result::Result<(), Self::Error>> {
242 Poll::Ready(Ok(()))
243 }
244 fn call(&mut self, req: http::Request<B>) -> Self::Future {
245 match req.uri().path() {
246 "/serverless_backfill_controller.NodeGroupControllerService/Provision" => {
247 #[allow(non_camel_case_types)]
248 struct ProvisionSvc<T: NodeGroupControllerService>(pub Arc<T>);
249 impl<
250 T: NodeGroupControllerService,
251 > tonic::server::UnaryService<super::ProvisionRequest>
252 for ProvisionSvc<T> {
253 type Response = super::ProvisionResponse;
254 type Future = BoxFuture<
255 tonic::Response<Self::Response>,
256 tonic::Status,
257 >;
258 fn call(
259 &mut self,
260 request: tonic::Request<super::ProvisionRequest>,
261 ) -> Self::Future {
262 let inner = Arc::clone(&self.0);
263 let fut = async move {
264 <T as NodeGroupControllerService>::provision(
265 &inner,
266 request,
267 )
268 .await
269 };
270 Box::pin(fut)
271 }
272 }
273 let accept_compression_encodings = self.accept_compression_encodings;
274 let send_compression_encodings = self.send_compression_encodings;
275 let max_decoding_message_size = self.max_decoding_message_size;
276 let max_encoding_message_size = self.max_encoding_message_size;
277 let inner = self.inner.clone();
278 let fut = async move {
279 let method = ProvisionSvc(inner);
280 let codec = tonic::codec::ProstCodec::default();
281 let mut grpc = tonic::server::Grpc::new(codec)
282 .apply_compression_config(
283 accept_compression_encodings,
284 send_compression_encodings,
285 )
286 .apply_max_message_size_config(
287 max_decoding_message_size,
288 max_encoding_message_size,
289 );
290 let res = grpc.unary(method, req).await;
291 Ok(res)
292 };
293 Box::pin(fut)
294 }
295 _ => {
296 Box::pin(async move {
297 let mut response = http::Response::new(empty_body());
298 let headers = response.headers_mut();
299 headers
300 .insert(
301 tonic::Status::GRPC_STATUS,
302 (tonic::Code::Unimplemented as i32).into(),
303 );
304 headers
305 .insert(
306 http::header::CONTENT_TYPE,
307 tonic::metadata::GRPC_CONTENT_TYPE,
308 );
309 Ok(response)
310 })
311 }
312 }
313 }
314 }
315 impl<T> Clone for NodeGroupControllerServiceServer<T> {
316 fn clone(&self) -> Self {
317 let inner = self.inner.clone();
318 Self {
319 inner,
320 accept_compression_encodings: self.accept_compression_encodings,
321 send_compression_encodings: self.send_compression_encodings,
322 max_decoding_message_size: self.max_decoding_message_size,
323 max_encoding_message_size: self.max_encoding_message_size,
324 }
325 }
326 }
327 pub const SERVICE_NAME: &str = "serverless_backfill_controller.NodeGroupControllerService";
329 impl<T> tonic::server::NamedService for NodeGroupControllerServiceServer<T> {
330 const NAME: &'static str = SERVICE_NAME;
331 }
332}