#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ExportRequest {}
impl ::prost::Name for ExportRequest {
const NAME: &'static str = "ExportRequest";
const PACKAGE: &'static str = "ora.snapshot.v1";
fn full_name() -> ::prost::alloc::string::String {
"ora.snapshot.v1.ExportRequest".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ora.snapshot.v1.ExportRequest".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExportResponse {
#[prost(message, optional, tag = "1")]
pub data: ::core::option::Option<SnapshotData>,
}
impl ::prost::Name for ExportResponse {
const NAME: &'static str = "ExportResponse";
const PACKAGE: &'static str = "ora.snapshot.v1";
fn full_name() -> ::prost::alloc::string::String {
"ora.snapshot.v1.ExportResponse".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ora.snapshot.v1.ExportResponse".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ImportRequest {
#[prost(message, optional, tag = "1")]
pub data: ::core::option::Option<SnapshotData>,
}
impl ::prost::Name for ImportRequest {
const NAME: &'static str = "ImportRequest";
const PACKAGE: &'static str = "ora.snapshot.v1";
fn full_name() -> ::prost::alloc::string::String {
"ora.snapshot.v1.ImportRequest".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ora.snapshot.v1.ImportRequest".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ImportResponse {}
impl ::prost::Name for ImportResponse {
const NAME: &'static str = "ImportResponse";
const PACKAGE: &'static str = "ora.snapshot.v1";
fn full_name() -> ::prost::alloc::string::String {
"ora.snapshot.v1.ImportResponse".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ora.snapshot.v1.ImportResponse".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SnapshotData {
#[prost(message, repeated, tag = "1")]
pub jobs: ::prost::alloc::vec::Vec<ExportedJob>,
#[prost(message, repeated, tag = "2")]
pub executions: ::prost::alloc::vec::Vec<ExportedExecution>,
#[prost(message, repeated, tag = "3")]
pub schedules: ::prost::alloc::vec::Vec<ExportedSchedule>,
#[prost(message, repeated, tag = "4")]
pub job_types: ::prost::alloc::vec::Vec<ExportedJobType>,
}
impl ::prost::Name for SnapshotData {
const NAME: &'static str = "SnapshotData";
const PACKAGE: &'static str = "ora.snapshot.v1";
fn full_name() -> ::prost::alloc::string::String {
"ora.snapshot.v1.SnapshotData".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ora.snapshot.v1.SnapshotData".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExportedJob {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, optional, tag = "2")]
pub schedule_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub created_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "4")]
pub job_type_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "5")]
pub target_execution_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "6")]
pub retry_policy: ::core::option::Option<super::super::common::v1::JobRetryPolicy>,
#[prost(message, optional, tag = "7")]
pub timeout_policy: ::core::option::Option<super::super::common::v1::JobTimeoutPolicy>,
#[prost(message, repeated, tag = "8")]
pub labels: ::prost::alloc::vec::Vec<super::super::common::v1::JobLabel>,
#[prost(message, optional, tag = "9")]
pub marked_unschedulable_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "10")]
pub cancelled_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "11")]
pub input_payload_json: ::prost::alloc::string::String,
#[prost(string, optional, tag = "12")]
pub metadata_json: ::core::option::Option<::prost::alloc::string::String>,
}
impl ::prost::Name for ExportedJob {
const NAME: &'static str = "ExportedJob";
const PACKAGE: &'static str = "ora.snapshot.v1";
fn full_name() -> ::prost::alloc::string::String {
"ora.snapshot.v1.ExportedJob".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ora.snapshot.v1.ExportedJob".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExportedExecution {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub job_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub target_execution_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, optional, tag = "4")]
pub executor_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "5")]
pub created_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "6")]
pub ready_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "7")]
pub assigned_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "8")]
pub started_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "9")]
pub succeeded_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "10")]
pub failed_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, optional, tag = "11")]
pub output_payload_json: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "12")]
pub failure_reason: ::core::option::Option<::prost::alloc::string::String>,
}
impl ::prost::Name for ExportedExecution {
const NAME: &'static str = "ExportedExecution";
const PACKAGE: &'static str = "ora.snapshot.v1";
fn full_name() -> ::prost::alloc::string::String {
"ora.snapshot.v1.ExportedExecution".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ora.snapshot.v1.ExportedExecution".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExportedSchedule {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub created_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, optional, tag = "3")]
pub job_type_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "4")]
pub labels: ::prost::alloc::vec::Vec<super::super::common::v1::ScheduleLabel>,
#[prost(message, optional, tag = "5")]
pub marked_unschedulable_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "6")]
pub cancelled_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "7")]
pub job_timing_policy:
::core::option::Option<super::super::common::v1::ScheduleJobTimingPolicy>,
#[prost(message, optional, tag = "8")]
pub job_creation_policy:
::core::option::Option<super::super::common::v1::ScheduleJobCreationPolicy>,
#[prost(message, optional, tag = "10")]
pub time_range: ::core::option::Option<super::super::common::v1::TimeRange>,
#[prost(string, optional, tag = "11")]
pub metadata_json: ::core::option::Option<::prost::alloc::string::String>,
}
impl ::prost::Name for ExportedSchedule {
const NAME: &'static str = "ExportedSchedule";
const PACKAGE: &'static str = "ora.snapshot.v1";
fn full_name() -> ::prost::alloc::string::String {
"ora.snapshot.v1.ExportedSchedule".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ora.snapshot.v1.ExportedSchedule".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExportedJobType {
#[prost(message, optional, tag = "1")]
pub job_type: ::core::option::Option<super::super::common::v1::JobType>,
}
impl ::prost::Name for ExportedJobType {
const NAME: &'static str = "ExportedJobType";
const PACKAGE: &'static str = "ora.snapshot.v1";
fn full_name() -> ::prost::alloc::string::String {
"ora.snapshot.v1.ExportedJobType".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ora.snapshot.v1.ExportedJobType".into()
}
}
pub mod snapshot_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value
)]
use tonic::codegen::http::Uri;
use tonic::codegen::*;
#[derive(Debug, Clone)]
pub struct SnapshotServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl SnapshotServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> SnapshotServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> SnapshotServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
Into<StdError> + std::marker::Send + std::marker::Sync,
{
SnapshotServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn export(
&mut self,
request: impl tonic::IntoRequest<super::ExportRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::ExportResponse>>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
})?;
let codec = tonic::codec::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/ora.snapshot.v1.SnapshotService/Export");
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("ora.snapshot.v1.SnapshotService", "Export"));
self.inner.server_streaming(req, path, codec).await
}
pub async fn import(
&mut self,
request: impl tonic::IntoStreamingRequest<Message = super::ImportRequest>,
) -> std::result::Result<tonic::Response<super::ImportResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
})?;
let codec = tonic::codec::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/ora.snapshot.v1.SnapshotService/Import");
let mut req = request.into_streaming_request();
req.extensions_mut()
.insert(GrpcMethod::new("ora.snapshot.v1.SnapshotService", "Import"));
self.inner.client_streaming(req, path, codec).await
}
}
}
pub mod snapshot_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value
)]
use tonic::codegen::*;
#[async_trait]
pub trait SnapshotService: std::marker::Send + std::marker::Sync + 'static {
async fn export(
&self,
request: tonic::Request<super::ExportRequest>,
) -> std::result::Result<tonic::Response<BoxStream<super::ExportResponse>>, tonic::Status>
{
Err(tonic::Status::unimplemented("Not yet implemented"))
}
async fn import(
&self,
request: tonic::Request<tonic::Streaming<super::ImportRequest>>,
) -> std::result::Result<tonic::Response<super::ImportResponse>, tonic::Status> {
Err(tonic::Status::unimplemented("Not yet implemented"))
}
}
#[derive(Debug)]
pub struct SnapshotServiceServer<T> {
inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
impl<T> SnapshotServiceServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for SnapshotServiceServer<T>
where
T: SnapshotService,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/ora.snapshot.v1.SnapshotService/Export" => {
#[allow(non_camel_case_types)]
struct ExportSvc<T: SnapshotService>(pub Arc<T>);
impl<T: SnapshotService>
tonic::server::ServerStreamingService<super::ExportRequest>
for ExportSvc<T>
{
type Response = super::ExportResponse;
type ResponseStream = BoxStream<super::ExportResponse>;
type Future =
BoxFuture<tonic::Response<Self::ResponseStream>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::ExportRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as SnapshotService>::export(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ExportSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.server_streaming(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/ora.snapshot.v1.SnapshotService/Import" => {
#[allow(non_camel_case_types)]
struct ImportSvc<T: SnapshotService>(pub Arc<T>);
impl<T: SnapshotService>
tonic::server::ClientStreamingService<super::ImportRequest>
for ImportSvc<T>
{
type Response = super::ImportResponse;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<tonic::Streaming<super::ImportRequest>>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as SnapshotService>::import(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ImportSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.client_streaming(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => Box::pin(async move {
let mut response = http::Response::new(empty_body());
let headers = response.headers_mut();
headers.insert(
tonic::Status::GRPC_STATUS,
(tonic::Code::Unimplemented as i32).into(),
);
headers.insert(
http::header::CONTENT_TYPE,
tonic::metadata::GRPC_CONTENT_TYPE,
);
Ok(response)
}),
}
}
}
impl<T> Clone for SnapshotServiceServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
pub const SERVICE_NAME: &str = "ora.snapshot.v1.SnapshotService";
impl<T> tonic::server::NamedService for SnapshotServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}