Skip to main content

nominal_api_proto/proto/
nominal.ingest.v1.internal.rs

1// This file is @generated by prost-build.
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct MarkBatchesCompletedRequest {
4    #[prost(string, tag = "1")]
5    pub ingest_job_rid: ::prost::alloc::string::String,
6    #[prost(string, tag = "2")]
7    pub dataset_file_id: ::prost::alloc::string::String,
8    #[prost(message, repeated, tag = "3")]
9    pub batches: ::prost::alloc::vec::Vec<CompletedBatch>,
10}
11#[derive(Clone, PartialEq, ::prost::Message)]
12pub struct CompletedBatch {
13    #[prost(int32, tag = "1")]
14    pub batch_id: i32,
15    #[prost(message, optional, tag = "2")]
16    pub handle: ::core::option::Option<
17        super::super::super::types::object_storage::Handle,
18    >,
19}
20#[derive(Clone, Copy, PartialEq, ::prost::Message)]
21pub struct MarkBatchesCompletedResponse {}
22#[derive(Clone, PartialEq, ::prost::Message)]
23pub struct CreatePendingBatchesRequest {
24    #[prost(string, tag = "1")]
25    pub ingest_job_rid: ::prost::alloc::string::String,
26    #[prost(string, tag = "2")]
27    pub dataset_file_id: ::prost::alloc::string::String,
28    #[prost(int32, tag = "3")]
29    pub num_batches: i32,
30}
31#[derive(Clone, Copy, PartialEq, ::prost::Message)]
32pub struct CreatePendingBatchesResponse {}
33#[derive(Clone, PartialEq, ::prost::Message)]
34pub struct SetDatasetFileIngestStatusRequest {
35    #[prost(string, tag = "1")]
36    pub ingest_job_rid: ::prost::alloc::string::String,
37    #[prost(string, tag = "2")]
38    pub dataset_file_id: ::prost::alloc::string::String,
39    #[prost(oneof = "set_dataset_file_ingest_status_request::Status", tags = "3, 4, 5")]
40    pub status: ::core::option::Option<set_dataset_file_ingest_status_request::Status>,
41}
42/// Nested message and enum types in `SetDatasetFileIngestStatusRequest`.
43pub mod set_dataset_file_ingest_status_request {
44    #[derive(Clone, PartialEq, ::prost::Oneof)]
45    pub enum Status {
46        #[prost(message, tag = "3")]
47        Parsing(super::Parsing),
48        #[prost(message, tag = "4")]
49        Ingesting(super::Ingesting),
50        #[prost(message, tag = "5")]
51        Error(super::Error),
52    }
53}
54#[derive(Clone, Copy, PartialEq, ::prost::Message)]
55pub struct SetDatasetFileIngestStatusResponse {}
56#[derive(Clone, Copy, PartialEq, ::prost::Message)]
57pub struct Parsing {}
58#[derive(Clone, Copy, PartialEq, ::prost::Message)]
59pub struct Ingesting {
60    #[prost(message, optional, tag = "1")]
61    pub bounds: ::core::option::Option<super::super::super::types::time::Range>,
62}
63#[derive(Clone, PartialEq, ::prost::Message)]
64pub struct Error {
65    #[prost(string, tag = "1")]
66    pub error_type: ::prost::alloc::string::String,
67    #[prost(string, tag = "2")]
68    pub message: ::prost::alloc::string::String,
69}
70/// Generated client implementations.
71pub mod internal_ingest_batch_service_client {
72    #![allow(
73        unused_variables,
74        dead_code,
75        missing_docs,
76        clippy::wildcard_imports,
77        clippy::let_unit_value,
78    )]
79    use tonic::codegen::*;
80    use tonic::codegen::http::Uri;
81    #[derive(Debug, Clone)]
82    pub struct InternalIngestBatchServiceClient<T> {
83        inner: tonic::client::Grpc<T>,
84    }
85    impl InternalIngestBatchServiceClient<tonic::transport::Channel> {
86        /// Attempt to create a new client by connecting to a given endpoint.
87        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
88        where
89            D: TryInto<tonic::transport::Endpoint>,
90            D::Error: Into<StdError>,
91        {
92            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
93            Ok(Self::new(conn))
94        }
95    }
96    impl<T> InternalIngestBatchServiceClient<T>
97    where
98        T: tonic::client::GrpcService<tonic::body::Body>,
99        T::Error: Into<StdError>,
100        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
101        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
102    {
103        pub fn new(inner: T) -> Self {
104            let inner = tonic::client::Grpc::new(inner);
105            Self { inner }
106        }
107        pub fn with_origin(inner: T, origin: Uri) -> Self {
108            let inner = tonic::client::Grpc::with_origin(inner, origin);
109            Self { inner }
110        }
111        pub fn with_interceptor<F>(
112            inner: T,
113            interceptor: F,
114        ) -> InternalIngestBatchServiceClient<InterceptedService<T, F>>
115        where
116            F: tonic::service::Interceptor,
117            T::ResponseBody: Default,
118            T: tonic::codegen::Service<
119                http::Request<tonic::body::Body>,
120                Response = http::Response<
121                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
122                >,
123            >,
124            <T as tonic::codegen::Service<
125                http::Request<tonic::body::Body>,
126            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
127        {
128            InternalIngestBatchServiceClient::new(
129                InterceptedService::new(inner, interceptor),
130            )
131        }
132        /// Compress requests with the given encoding.
133        ///
134        /// This requires the server to support it otherwise it might respond with an
135        /// error.
136        #[must_use]
137        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
138            self.inner = self.inner.send_compressed(encoding);
139            self
140        }
141        /// Enable decompressing responses.
142        #[must_use]
143        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
144            self.inner = self.inner.accept_compressed(encoding);
145            self
146        }
147        /// Limits the maximum size of a decoded message.
148        ///
149        /// Default: `4MB`
150        #[must_use]
151        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
152            self.inner = self.inner.max_decoding_message_size(limit);
153            self
154        }
155        /// Limits the maximum size of an encoded message.
156        ///
157        /// Default: `usize::MAX`
158        #[must_use]
159        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
160            self.inner = self.inner.max_encoding_message_size(limit);
161            self
162        }
163        pub async fn mark_batches_completed(
164            &mut self,
165            request: impl tonic::IntoRequest<super::MarkBatchesCompletedRequest>,
166        ) -> std::result::Result<
167            tonic::Response<super::MarkBatchesCompletedResponse>,
168            tonic::Status,
169        > {
170            self.inner
171                .ready()
172                .await
173                .map_err(|e| {
174                    tonic::Status::unknown(
175                        format!("Service was not ready: {}", e.into()),
176                    )
177                })?;
178            let codec = tonic::codec::ProstCodec::default();
179            let path = http::uri::PathAndQuery::from_static(
180                "/nominal.ingest.v1.internal.InternalIngestBatchService/MarkBatchesCompleted",
181            );
182            let mut req = request.into_request();
183            req.extensions_mut()
184                .insert(
185                    GrpcMethod::new(
186                        "nominal.ingest.v1.internal.InternalIngestBatchService",
187                        "MarkBatchesCompleted",
188                    ),
189                );
190            self.inner.unary(req, path, codec).await
191        }
192        pub async fn set_dataset_file_ingest_status(
193            &mut self,
194            request: impl tonic::IntoRequest<super::SetDatasetFileIngestStatusRequest>,
195        ) -> std::result::Result<
196            tonic::Response<super::SetDatasetFileIngestStatusResponse>,
197            tonic::Status,
198        > {
199            self.inner
200                .ready()
201                .await
202                .map_err(|e| {
203                    tonic::Status::unknown(
204                        format!("Service was not ready: {}", e.into()),
205                    )
206                })?;
207            let codec = tonic::codec::ProstCodec::default();
208            let path = http::uri::PathAndQuery::from_static(
209                "/nominal.ingest.v1.internal.InternalIngestBatchService/SetDatasetFileIngestStatus",
210            );
211            let mut req = request.into_request();
212            req.extensions_mut()
213                .insert(
214                    GrpcMethod::new(
215                        "nominal.ingest.v1.internal.InternalIngestBatchService",
216                        "SetDatasetFileIngestStatus",
217                    ),
218                );
219            self.inner.unary(req, path, codec).await
220        }
221        pub async fn create_pending_batches(
222            &mut self,
223            request: impl tonic::IntoRequest<super::CreatePendingBatchesRequest>,
224        ) -> std::result::Result<
225            tonic::Response<super::CreatePendingBatchesResponse>,
226            tonic::Status,
227        > {
228            self.inner
229                .ready()
230                .await
231                .map_err(|e| {
232                    tonic::Status::unknown(
233                        format!("Service was not ready: {}", e.into()),
234                    )
235                })?;
236            let codec = tonic::codec::ProstCodec::default();
237            let path = http::uri::PathAndQuery::from_static(
238                "/nominal.ingest.v1.internal.InternalIngestBatchService/CreatePendingBatches",
239            );
240            let mut req = request.into_request();
241            req.extensions_mut()
242                .insert(
243                    GrpcMethod::new(
244                        "nominal.ingest.v1.internal.InternalIngestBatchService",
245                        "CreatePendingBatches",
246                    ),
247                );
248            self.inner.unary(req, path, codec).await
249        }
250    }
251}