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