1#[derive(Clone, Copy, PartialEq, ::prost::Message)]
4pub struct ExportRequest {}
5impl ::prost::Name for ExportRequest {
6 const NAME: &'static str = "ExportRequest";
7 const PACKAGE: &'static str = "ora.snapshot.v1";
8 fn full_name() -> ::prost::alloc::string::String {
9 "ora.snapshot.v1.ExportRequest".into()
10 }
11 fn type_url() -> ::prost::alloc::string::String {
12 "/ora.snapshot.v1.ExportRequest".into()
13 }
14}
15#[derive(Clone, PartialEq, ::prost::Message)]
17pub struct ExportResponse {
18 #[prost(message, optional, tag = "1")]
20 pub data: ::core::option::Option<SnapshotData>,
21}
22impl ::prost::Name for ExportResponse {
23 const NAME: &'static str = "ExportResponse";
24 const PACKAGE: &'static str = "ora.snapshot.v1";
25 fn full_name() -> ::prost::alloc::string::String {
26 "ora.snapshot.v1.ExportResponse".into()
27 }
28 fn type_url() -> ::prost::alloc::string::String {
29 "/ora.snapshot.v1.ExportResponse".into()
30 }
31}
32#[derive(Clone, PartialEq, ::prost::Message)]
34pub struct ImportRequest {
35 #[prost(message, optional, tag = "1")]
37 pub data: ::core::option::Option<SnapshotData>,
38}
39impl ::prost::Name for ImportRequest {
40 const NAME: &'static str = "ImportRequest";
41 const PACKAGE: &'static str = "ora.snapshot.v1";
42 fn full_name() -> ::prost::alloc::string::String {
43 "ora.snapshot.v1.ImportRequest".into()
44 }
45 fn type_url() -> ::prost::alloc::string::String {
46 "/ora.snapshot.v1.ImportRequest".into()
47 }
48}
49#[derive(Clone, Copy, PartialEq, ::prost::Message)]
51pub struct ImportResponse {}
52impl ::prost::Name for ImportResponse {
53 const NAME: &'static str = "ImportResponse";
54 const PACKAGE: &'static str = "ora.snapshot.v1";
55 fn full_name() -> ::prost::alloc::string::String {
56 "ora.snapshot.v1.ImportResponse".into()
57 }
58 fn type_url() -> ::prost::alloc::string::String {
59 "/ora.snapshot.v1.ImportResponse".into()
60 }
61}
62#[derive(Clone, PartialEq, ::prost::Message)]
64pub struct SnapshotData {
65 #[prost(message, repeated, tag = "1")]
67 pub jobs: ::prost::alloc::vec::Vec<ExportedJob>,
68 #[prost(message, repeated, tag = "2")]
70 pub executions: ::prost::alloc::vec::Vec<ExportedExecution>,
71 #[prost(message, repeated, tag = "3")]
73 pub schedules: ::prost::alloc::vec::Vec<ExportedSchedule>,
74 #[prost(message, repeated, tag = "4")]
76 pub job_types: ::prost::alloc::vec::Vec<ExportedJobType>,
77}
78impl ::prost::Name for SnapshotData {
79 const NAME: &'static str = "SnapshotData";
80 const PACKAGE: &'static str = "ora.snapshot.v1";
81 fn full_name() -> ::prost::alloc::string::String {
82 "ora.snapshot.v1.SnapshotData".into()
83 }
84 fn type_url() -> ::prost::alloc::string::String {
85 "/ora.snapshot.v1.SnapshotData".into()
86 }
87}
88#[derive(Clone, PartialEq, ::prost::Message)]
90pub struct ExportedJob {
91 #[prost(string, tag = "1")]
93 pub id: ::prost::alloc::string::String,
94 #[prost(string, optional, tag = "2")]
96 pub schedule_id: ::core::option::Option<::prost::alloc::string::String>,
97 #[prost(message, optional, tag = "3")]
99 pub created_at: ::core::option::Option<::prost_types::Timestamp>,
100 #[prost(string, tag = "4")]
102 pub job_type_id: ::prost::alloc::string::String,
103 #[prost(message, optional, tag = "5")]
105 pub target_execution_time: ::core::option::Option<::prost_types::Timestamp>,
106 #[prost(message, optional, tag = "6")]
108 pub retry_policy: ::core::option::Option<super::super::common::v1::JobRetryPolicy>,
109 #[prost(message, optional, tag = "7")]
111 pub timeout_policy: ::core::option::Option<super::super::common::v1::JobTimeoutPolicy>,
112 #[prost(message, repeated, tag = "8")]
114 pub labels: ::prost::alloc::vec::Vec<super::super::common::v1::JobLabel>,
115 #[prost(message, optional, tag = "9")]
117 pub marked_unschedulable_at: ::core::option::Option<::prost_types::Timestamp>,
118 #[prost(message, optional, tag = "10")]
120 pub cancelled_at: ::core::option::Option<::prost_types::Timestamp>,
121 #[prost(string, tag = "11")]
123 pub input_payload_json: ::prost::alloc::string::String,
124 #[prost(string, optional, tag = "12")]
126 pub metadata_json: ::core::option::Option<::prost::alloc::string::String>,
127}
128impl ::prost::Name for ExportedJob {
129 const NAME: &'static str = "ExportedJob";
130 const PACKAGE: &'static str = "ora.snapshot.v1";
131 fn full_name() -> ::prost::alloc::string::String {
132 "ora.snapshot.v1.ExportedJob".into()
133 }
134 fn type_url() -> ::prost::alloc::string::String {
135 "/ora.snapshot.v1.ExportedJob".into()
136 }
137}
138#[derive(Clone, PartialEq, ::prost::Message)]
140pub struct ExportedExecution {
141 #[prost(string, tag = "1")]
143 pub id: ::prost::alloc::string::String,
144 #[prost(string, tag = "2")]
146 pub job_id: ::prost::alloc::string::String,
147 #[prost(message, optional, tag = "3")]
149 pub target_execution_time: ::core::option::Option<::prost_types::Timestamp>,
150 #[prost(string, optional, tag = "4")]
152 pub executor_id: ::core::option::Option<::prost::alloc::string::String>,
153 #[prost(message, optional, tag = "5")]
155 pub created_at: ::core::option::Option<::prost_types::Timestamp>,
156 #[prost(message, optional, tag = "6")]
159 pub ready_at: ::core::option::Option<::prost_types::Timestamp>,
160 #[prost(message, optional, tag = "7")]
163 pub assigned_at: ::core::option::Option<::prost_types::Timestamp>,
164 #[prost(message, optional, tag = "8")]
167 pub started_at: ::core::option::Option<::prost_types::Timestamp>,
168 #[prost(message, optional, tag = "9")]
170 pub succeeded_at: ::core::option::Option<::prost_types::Timestamp>,
171 #[prost(message, optional, tag = "10")]
173 pub failed_at: ::core::option::Option<::prost_types::Timestamp>,
174 #[prost(string, optional, tag = "11")]
176 pub output_payload_json: ::core::option::Option<::prost::alloc::string::String>,
177 #[prost(string, optional, tag = "12")]
179 pub failure_reason: ::core::option::Option<::prost::alloc::string::String>,
180}
181impl ::prost::Name for ExportedExecution {
182 const NAME: &'static str = "ExportedExecution";
183 const PACKAGE: &'static str = "ora.snapshot.v1";
184 fn full_name() -> ::prost::alloc::string::String {
185 "ora.snapshot.v1.ExportedExecution".into()
186 }
187 fn type_url() -> ::prost::alloc::string::String {
188 "/ora.snapshot.v1.ExportedExecution".into()
189 }
190}
191#[derive(Clone, PartialEq, ::prost::Message)]
193pub struct ExportedSchedule {
194 #[prost(string, tag = "1")]
196 pub id: ::prost::alloc::string::String,
197 #[prost(message, optional, tag = "2")]
199 pub created_at: ::core::option::Option<::prost_types::Timestamp>,
200 #[prost(string, optional, tag = "3")]
202 pub job_type_id: ::core::option::Option<::prost::alloc::string::String>,
203 #[prost(message, repeated, tag = "4")]
205 pub labels: ::prost::alloc::vec::Vec<super::super::common::v1::ScheduleLabel>,
206 #[prost(message, optional, tag = "5")]
208 pub marked_unschedulable_at: ::core::option::Option<::prost_types::Timestamp>,
209 #[prost(message, optional, tag = "6")]
211 pub cancelled_at: ::core::option::Option<::prost_types::Timestamp>,
212 #[prost(message, optional, tag = "7")]
214 pub job_timing_policy:
215 ::core::option::Option<super::super::common::v1::ScheduleJobTimingPolicy>,
216 #[prost(message, optional, tag = "8")]
218 pub job_creation_policy:
219 ::core::option::Option<super::super::common::v1::ScheduleJobCreationPolicy>,
220 #[prost(message, optional, tag = "10")]
222 pub time_range: ::core::option::Option<super::super::common::v1::TimeRange>,
223 #[prost(string, optional, tag = "11")]
225 pub metadata_json: ::core::option::Option<::prost::alloc::string::String>,
226}
227impl ::prost::Name for ExportedSchedule {
228 const NAME: &'static str = "ExportedSchedule";
229 const PACKAGE: &'static str = "ora.snapshot.v1";
230 fn full_name() -> ::prost::alloc::string::String {
231 "ora.snapshot.v1.ExportedSchedule".into()
232 }
233 fn type_url() -> ::prost::alloc::string::String {
234 "/ora.snapshot.v1.ExportedSchedule".into()
235 }
236}
237#[derive(Clone, PartialEq, ::prost::Message)]
239pub struct ExportedJobType {
240 #[prost(message, optional, tag = "1")]
241 pub job_type: ::core::option::Option<super::super::common::v1::JobType>,
242}
243impl ::prost::Name for ExportedJobType {
244 const NAME: &'static str = "ExportedJobType";
245 const PACKAGE: &'static str = "ora.snapshot.v1";
246 fn full_name() -> ::prost::alloc::string::String {
247 "ora.snapshot.v1.ExportedJobType".into()
248 }
249 fn type_url() -> ::prost::alloc::string::String {
250 "/ora.snapshot.v1.ExportedJobType".into()
251 }
252}
253pub mod snapshot_service_client {
255 #![allow(
256 unused_variables,
257 dead_code,
258 missing_docs,
259 clippy::wildcard_imports,
260 clippy::let_unit_value
261 )]
262 use tonic::codegen::http::Uri;
263 use tonic::codegen::*;
264 #[derive(Debug, Clone)]
273 pub struct SnapshotServiceClient<T> {
274 inner: tonic::client::Grpc<T>,
275 }
276 impl SnapshotServiceClient<tonic::transport::Channel> {
277 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
279 where
280 D: TryInto<tonic::transport::Endpoint>,
281 D::Error: Into<StdError>,
282 {
283 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
284 Ok(Self::new(conn))
285 }
286 }
287 impl<T> SnapshotServiceClient<T>
288 where
289 T: tonic::client::GrpcService<tonic::body::BoxBody>,
290 T::Error: Into<StdError>,
291 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
292 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
293 {
294 pub fn new(inner: T) -> Self {
295 let inner = tonic::client::Grpc::new(inner);
296 Self { inner }
297 }
298 pub fn with_origin(inner: T, origin: Uri) -> Self {
299 let inner = tonic::client::Grpc::with_origin(inner, origin);
300 Self { inner }
301 }
302 pub fn with_interceptor<F>(
303 inner: T,
304 interceptor: F,
305 ) -> SnapshotServiceClient<InterceptedService<T, F>>
306 where
307 F: tonic::service::Interceptor,
308 T::ResponseBody: Default,
309 T: tonic::codegen::Service<
310 http::Request<tonic::body::BoxBody>,
311 Response = http::Response<
312 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
313 >,
314 >,
315 <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
316 Into<StdError> + std::marker::Send + std::marker::Sync,
317 {
318 SnapshotServiceClient::new(InterceptedService::new(inner, interceptor))
319 }
320 #[must_use]
325 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
326 self.inner = self.inner.send_compressed(encoding);
327 self
328 }
329 #[must_use]
331 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
332 self.inner = self.inner.accept_compressed(encoding);
333 self
334 }
335 #[must_use]
339 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
340 self.inner = self.inner.max_decoding_message_size(limit);
341 self
342 }
343 #[must_use]
347 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
348 self.inner = self.inner.max_encoding_message_size(limit);
349 self
350 }
351 pub async fn export(
353 &mut self,
354 request: impl tonic::IntoRequest<super::ExportRequest>,
355 ) -> std::result::Result<
356 tonic::Response<tonic::codec::Streaming<super::ExportResponse>>,
357 tonic::Status,
358 > {
359 self.inner.ready().await.map_err(|e| {
360 tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
361 })?;
362 let codec = tonic::codec::ProstCodec::default();
363 let path =
364 http::uri::PathAndQuery::from_static("/ora.snapshot.v1.SnapshotService/Export");
365 let mut req = request.into_request();
366 req.extensions_mut()
367 .insert(GrpcMethod::new("ora.snapshot.v1.SnapshotService", "Export"));
368 self.inner.server_streaming(req, path, codec).await
369 }
370 pub async fn import(
375 &mut self,
376 request: impl tonic::IntoStreamingRequest<Message = super::ImportRequest>,
377 ) -> std::result::Result<tonic::Response<super::ImportResponse>, tonic::Status> {
378 self.inner.ready().await.map_err(|e| {
379 tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
380 })?;
381 let codec = tonic::codec::ProstCodec::default();
382 let path =
383 http::uri::PathAndQuery::from_static("/ora.snapshot.v1.SnapshotService/Import");
384 let mut req = request.into_streaming_request();
385 req.extensions_mut()
386 .insert(GrpcMethod::new("ora.snapshot.v1.SnapshotService", "Import"));
387 self.inner.client_streaming(req, path, codec).await
388 }
389 }
390}
391pub mod snapshot_service_server {
393 #![allow(
394 unused_variables,
395 dead_code,
396 missing_docs,
397 clippy::wildcard_imports,
398 clippy::let_unit_value
399 )]
400 use tonic::codegen::*;
401 #[async_trait]
403 pub trait SnapshotService: std::marker::Send + std::marker::Sync + 'static {
404 async fn export(
406 &self,
407 request: tonic::Request<super::ExportRequest>,
408 ) -> std::result::Result<tonic::Response<BoxStream<super::ExportResponse>>, tonic::Status>
409 {
410 Err(tonic::Status::unimplemented("Not yet implemented"))
411 }
412 async fn import(
417 &self,
418 request: tonic::Request<tonic::Streaming<super::ImportRequest>>,
419 ) -> std::result::Result<tonic::Response<super::ImportResponse>, tonic::Status> {
420 Err(tonic::Status::unimplemented("Not yet implemented"))
421 }
422 }
423 #[derive(Debug)]
432 pub struct SnapshotServiceServer<T> {
433 inner: Arc<T>,
434 accept_compression_encodings: EnabledCompressionEncodings,
435 send_compression_encodings: EnabledCompressionEncodings,
436 max_decoding_message_size: Option<usize>,
437 max_encoding_message_size: Option<usize>,
438 }
439 impl<T> SnapshotServiceServer<T> {
440 pub fn new(inner: T) -> Self {
441 Self::from_arc(Arc::new(inner))
442 }
443 pub fn from_arc(inner: Arc<T>) -> Self {
444 Self {
445 inner,
446 accept_compression_encodings: Default::default(),
447 send_compression_encodings: Default::default(),
448 max_decoding_message_size: None,
449 max_encoding_message_size: None,
450 }
451 }
452 pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F>
453 where
454 F: tonic::service::Interceptor,
455 {
456 InterceptedService::new(Self::new(inner), interceptor)
457 }
458 #[must_use]
460 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
461 self.accept_compression_encodings.enable(encoding);
462 self
463 }
464 #[must_use]
466 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
467 self.send_compression_encodings.enable(encoding);
468 self
469 }
470 #[must_use]
474 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
475 self.max_decoding_message_size = Some(limit);
476 self
477 }
478 #[must_use]
482 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
483 self.max_encoding_message_size = Some(limit);
484 self
485 }
486 }
487 impl<T, B> tonic::codegen::Service<http::Request<B>> for SnapshotServiceServer<T>
488 where
489 T: SnapshotService,
490 B: Body + std::marker::Send + 'static,
491 B::Error: Into<StdError> + std::marker::Send + 'static,
492 {
493 type Response = http::Response<tonic::body::BoxBody>;
494 type Error = std::convert::Infallible;
495 type Future = BoxFuture<Self::Response, Self::Error>;
496 fn poll_ready(
497 &mut self,
498 _cx: &mut Context<'_>,
499 ) -> Poll<std::result::Result<(), Self::Error>> {
500 Poll::Ready(Ok(()))
501 }
502 fn call(&mut self, req: http::Request<B>) -> Self::Future {
503 match req.uri().path() {
504 "/ora.snapshot.v1.SnapshotService/Export" => {
505 #[allow(non_camel_case_types)]
506 struct ExportSvc<T: SnapshotService>(pub Arc<T>);
507 impl<T: SnapshotService>
508 tonic::server::ServerStreamingService<super::ExportRequest>
509 for ExportSvc<T>
510 {
511 type Response = super::ExportResponse;
512 type ResponseStream = BoxStream<super::ExportResponse>;
513 type Future =
514 BoxFuture<tonic::Response<Self::ResponseStream>, tonic::Status>;
515 fn call(
516 &mut self,
517 request: tonic::Request<super::ExportRequest>,
518 ) -> Self::Future {
519 let inner = Arc::clone(&self.0);
520 let fut = async move {
521 <T as SnapshotService>::export(&inner, request).await
522 };
523 Box::pin(fut)
524 }
525 }
526 let accept_compression_encodings = self.accept_compression_encodings;
527 let send_compression_encodings = self.send_compression_encodings;
528 let max_decoding_message_size = self.max_decoding_message_size;
529 let max_encoding_message_size = self.max_encoding_message_size;
530 let inner = self.inner.clone();
531 let fut = async move {
532 let method = ExportSvc(inner);
533 let codec = tonic::codec::ProstCodec::default();
534 let mut grpc = tonic::server::Grpc::new(codec)
535 .apply_compression_config(
536 accept_compression_encodings,
537 send_compression_encodings,
538 )
539 .apply_max_message_size_config(
540 max_decoding_message_size,
541 max_encoding_message_size,
542 );
543 let res = grpc.server_streaming(method, req).await;
544 Ok(res)
545 };
546 Box::pin(fut)
547 }
548 "/ora.snapshot.v1.SnapshotService/Import" => {
549 #[allow(non_camel_case_types)]
550 struct ImportSvc<T: SnapshotService>(pub Arc<T>);
551 impl<T: SnapshotService>
552 tonic::server::ClientStreamingService<super::ImportRequest>
553 for ImportSvc<T>
554 {
555 type Response = super::ImportResponse;
556 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
557 fn call(
558 &mut self,
559 request: tonic::Request<tonic::Streaming<super::ImportRequest>>,
560 ) -> Self::Future {
561 let inner = Arc::clone(&self.0);
562 let fut = async move {
563 <T as SnapshotService>::import(&inner, request).await
564 };
565 Box::pin(fut)
566 }
567 }
568 let accept_compression_encodings = self.accept_compression_encodings;
569 let send_compression_encodings = self.send_compression_encodings;
570 let max_decoding_message_size = self.max_decoding_message_size;
571 let max_encoding_message_size = self.max_encoding_message_size;
572 let inner = self.inner.clone();
573 let fut = async move {
574 let method = ImportSvc(inner);
575 let codec = tonic::codec::ProstCodec::default();
576 let mut grpc = tonic::server::Grpc::new(codec)
577 .apply_compression_config(
578 accept_compression_encodings,
579 send_compression_encodings,
580 )
581 .apply_max_message_size_config(
582 max_decoding_message_size,
583 max_encoding_message_size,
584 );
585 let res = grpc.client_streaming(method, req).await;
586 Ok(res)
587 };
588 Box::pin(fut)
589 }
590 _ => Box::pin(async move {
591 let mut response = http::Response::new(empty_body());
592 let headers = response.headers_mut();
593 headers.insert(
594 tonic::Status::GRPC_STATUS,
595 (tonic::Code::Unimplemented as i32).into(),
596 );
597 headers.insert(
598 http::header::CONTENT_TYPE,
599 tonic::metadata::GRPC_CONTENT_TYPE,
600 );
601 Ok(response)
602 }),
603 }
604 }
605 }
606 impl<T> Clone for SnapshotServiceServer<T> {
607 fn clone(&self) -> Self {
608 let inner = self.inner.clone();
609 Self {
610 inner,
611 accept_compression_encodings: self.accept_compression_encodings,
612 send_compression_encodings: self.send_compression_encodings,
613 max_decoding_message_size: self.max_decoding_message_size,
614 max_encoding_message_size: self.max_encoding_message_size,
615 }
616 }
617 }
618 pub const SERVICE_NAME: &str = "ora.snapshot.v1.SnapshotService";
620 impl<T> tonic::server::NamedService for SnapshotServiceServer<T> {
621 const NAME: &'static str = SERVICE_NAME;
622 }
623}