Skip to main content

nominal_api/proto/
nominal.ingest.v2.rs

1// This file is @generated by prost-build.
2/// A containerized extractor that processes input files using a self-hosted container image.
3///
4/// Schema fields (inputs, parameters, output format, timestamp metadata) live on the underlying
5/// ContainerImage rows; clients should read them off `active_container_image`. The extractor
6/// itself carries only identity, workspace ownership, and lifecycle state.
7#[derive(Clone, PartialEq, ::prost::Message)]
8pub struct ContainerizedExtractor {
9    /// Unique resource identifier for this extractor.
10    #[prost(string, tag = "1")]
11    pub rid: ::prost::alloc::string::String,
12    /// Workspace that owns this extractor.
13    #[prost(string, tag = "2")]
14    pub workspace_rid: ::prost::alloc::string::String,
15    /// User-supplied name. Need not be unique within a workspace.
16    #[prost(string, tag = "3")]
17    pub name: ::prost::alloc::string::String,
18    /// Free-form description shown in the UI.
19    #[prost(string, optional, tag = "4")]
20    pub description: ::core::option::Option<::prost::alloc::string::String>,
21    /// Timestamp at which this extractor was first registered.
22    #[prost(message, optional, tag = "5")]
23    pub created_at: ::core::option::Option<
24        super::super::super::google::protobuf::Timestamp,
25    >,
26    /// True once the extractor has been archived. Archived extractors are hidden from default search
27    /// results and reject new ingests; flip back to false on UpdateContainerizedExtractor to restore.
28    #[prost(bool, tag = "6")]
29    pub is_archived: bool,
30    /// The container image currently selected to run this extractor. Unset until the first image
31    /// for this extractor reaches READY status; ingest requests that arrive before then will fail.
32    /// The schema fields (inputs, parameters, output_file_format, default_timestamp_metadata) live
33    /// on this nested image.
34    #[prost(message, optional, tag = "7")]
35    pub active_container_image: ::core::option::Option<
36        super::super::registry::v1::ContainerImage,
37    >,
38}
39/// Request to create a new self-hosted containerized extractor in a workspace. Schema fields
40/// (inputs / parameters / output format / timestamp metadata) are supplied with each container
41/// image via RegistryService.CreateImage and not on the extractor itself.
42#[derive(Clone, PartialEq, ::prost::Message)]
43pub struct CreateContainerizedExtractorRequest {
44    #[prost(string, tag = "1")]
45    pub workspace_rid: ::prost::alloc::string::String,
46    #[prost(string, tag = "2")]
47    pub name: ::prost::alloc::string::String,
48    #[prost(string, optional, tag = "3")]
49    pub description: ::core::option::Option<::prost::alloc::string::String>,
50}
51#[derive(Clone, PartialEq, ::prost::Message)]
52pub struct CreateContainerizedExtractorResponse {
53    #[prost(message, optional, tag = "1")]
54    pub extractor: ::core::option::Option<ContainerizedExtractor>,
55}
56#[derive(Clone, PartialEq, ::prost::Message)]
57pub struct GetContainerizedExtractorRequest {
58    #[prost(string, tag = "1")]
59    pub rid: ::prost::alloc::string::String,
60    #[prost(string, tag = "2")]
61    pub workspace_rid: ::prost::alloc::string::String,
62}
63#[derive(Clone, PartialEq, ::prost::Message)]
64pub struct GetContainerizedExtractorResponse {
65    #[prost(message, optional, tag = "1")]
66    pub extractor: ::core::option::Option<ContainerizedExtractor>,
67}
68/// Partial update. Only fields explicitly set on the request are modified; unset fields are left
69/// unchanged on the existing extractor. Archive / unarchive are expressed through this request by
70/// setting `is_archived`. The active container image is selected by setting
71/// `active_container_image_rid`.
72#[derive(Clone, PartialEq, ::prost::Message)]
73pub struct UpdateContainerizedExtractorRequest {
74    #[prost(string, tag = "1")]
75    pub rid: ::prost::alloc::string::String,
76    #[prost(string, tag = "2")]
77    pub workspace_rid: ::prost::alloc::string::String,
78    #[prost(string, optional, tag = "3")]
79    pub name: ::core::option::Option<::prost::alloc::string::String>,
80    #[prost(string, optional, tag = "4")]
81    pub description: ::core::option::Option<::prost::alloc::string::String>,
82    /// Set to true to archive, false to unarchive. Leave unset to leave archive state unchanged.
83    #[prost(bool, optional, tag = "5")]
84    pub is_archived: ::core::option::Option<bool>,
85    /// RID of the container image to set as the active one for this extractor. Must reference a
86    /// ContainerImage that is owned by the same workspace, was built for this extractor, and has
87    /// reached READY status. Leave unset to leave the active image unchanged.
88    #[prost(string, optional, tag = "6")]
89    pub active_container_image_rid: ::core::option::Option<
90        ::prost::alloc::string::String,
91    >,
92}
93#[derive(Clone, PartialEq, ::prost::Message)]
94pub struct UpdateContainerizedExtractorResponse {
95    #[prost(message, optional, tag = "1")]
96    pub extractor: ::core::option::Option<ContainerizedExtractor>,
97}
98/// Search extractors within a workspace, with cursor-based pagination. Filter fields are intended
99/// to be added here over time; calling with only the workspace_rid set returns the default listing.
100#[derive(Clone, PartialEq, ::prost::Message)]
101pub struct SearchContainerizedExtractorsRequest {
102    #[prost(string, tag = "1")]
103    pub workspace_rid: ::prost::alloc::string::String,
104    /// When true, archived extractors are also returned.
105    #[prost(bool, tag = "2")]
106    pub include_archived: bool,
107    #[prost(int32, tag = "3")]
108    pub page_size: i32,
109    #[prost(string, optional, tag = "4")]
110    pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
111}
112#[derive(Clone, PartialEq, ::prost::Message)]
113pub struct SearchContainerizedExtractorsResponse {
114    #[prost(message, repeated, tag = "1")]
115    pub extractors: ::prost::alloc::vec::Vec<ContainerizedExtractor>,
116    #[prost(string, optional, tag = "2")]
117    pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
118}
119/// Generated client implementations.
120pub mod containerized_extractor_service_client {
121    #![allow(
122        unused_variables,
123        dead_code,
124        missing_docs,
125        clippy::wildcard_imports,
126        clippy::let_unit_value,
127    )]
128    use tonic::codegen::*;
129    use tonic::codegen::http::Uri;
130    /// Manages containerized extractors backed by self-hosted images in the internal registry.
131    #[derive(Debug, Clone)]
132    pub struct ContainerizedExtractorServiceClient<T> {
133        inner: tonic::client::Grpc<T>,
134    }
135    impl ContainerizedExtractorServiceClient<tonic::transport::Channel> {
136        /// Attempt to create a new client by connecting to a given endpoint.
137        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
138        where
139            D: TryInto<tonic::transport::Endpoint>,
140            D::Error: Into<StdError>,
141        {
142            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
143            Ok(Self::new(conn))
144        }
145    }
146    impl<T> ContainerizedExtractorServiceClient<T>
147    where
148        T: tonic::client::GrpcService<tonic::body::Body>,
149        T::Error: Into<StdError>,
150        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
151        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
152    {
153        pub fn new(inner: T) -> Self {
154            let inner = tonic::client::Grpc::new(inner);
155            Self { inner }
156        }
157        pub fn with_origin(inner: T, origin: Uri) -> Self {
158            let inner = tonic::client::Grpc::with_origin(inner, origin);
159            Self { inner }
160        }
161        pub fn with_interceptor<F>(
162            inner: T,
163            interceptor: F,
164        ) -> ContainerizedExtractorServiceClient<InterceptedService<T, F>>
165        where
166            F: tonic::service::Interceptor,
167            T::ResponseBody: Default,
168            T: tonic::codegen::Service<
169                http::Request<tonic::body::Body>,
170                Response = http::Response<
171                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
172                >,
173            >,
174            <T as tonic::codegen::Service<
175                http::Request<tonic::body::Body>,
176            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
177        {
178            ContainerizedExtractorServiceClient::new(
179                InterceptedService::new(inner, interceptor),
180            )
181        }
182        /// Compress requests with the given encoding.
183        ///
184        /// This requires the server to support it otherwise it might respond with an
185        /// error.
186        #[must_use]
187        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
188            self.inner = self.inner.send_compressed(encoding);
189            self
190        }
191        /// Enable decompressing responses.
192        #[must_use]
193        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
194            self.inner = self.inner.accept_compressed(encoding);
195            self
196        }
197        /// Limits the maximum size of a decoded message.
198        ///
199        /// Default: `4MB`
200        #[must_use]
201        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
202            self.inner = self.inner.max_decoding_message_size(limit);
203            self
204        }
205        /// Limits the maximum size of an encoded message.
206        ///
207        /// Default: `usize::MAX`
208        #[must_use]
209        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
210            self.inner = self.inner.max_encoding_message_size(limit);
211            self
212        }
213        /// Create a new extractor in a workspace. Container images are attached separately via
214        /// RegistryService.CreateImage.
215        pub async fn create_containerized_extractor(
216            &mut self,
217            request: impl tonic::IntoRequest<super::CreateContainerizedExtractorRequest>,
218        ) -> std::result::Result<
219            tonic::Response<super::CreateContainerizedExtractorResponse>,
220            tonic::Status,
221        > {
222            self.inner
223                .ready()
224                .await
225                .map_err(|e| {
226                    tonic::Status::unknown(
227                        format!("Service was not ready: {}", e.into()),
228                    )
229                })?;
230            let codec = tonic::codec::ProstCodec::default();
231            let path = http::uri::PathAndQuery::from_static(
232                "/nominal.ingest.v2.ContainerizedExtractorService/CreateContainerizedExtractor",
233            );
234            let mut req = request.into_request();
235            req.extensions_mut()
236                .insert(
237                    GrpcMethod::new(
238                        "nominal.ingest.v2.ContainerizedExtractorService",
239                        "CreateContainerizedExtractor",
240                    ),
241                );
242            self.inner.unary(req, path, codec).await
243        }
244        /// Fetch a single extractor by RID.
245        pub async fn get_containerized_extractor(
246            &mut self,
247            request: impl tonic::IntoRequest<super::GetContainerizedExtractorRequest>,
248        ) -> std::result::Result<
249            tonic::Response<super::GetContainerizedExtractorResponse>,
250            tonic::Status,
251        > {
252            self.inner
253                .ready()
254                .await
255                .map_err(|e| {
256                    tonic::Status::unknown(
257                        format!("Service was not ready: {}", e.into()),
258                    )
259                })?;
260            let codec = tonic::codec::ProstCodec::default();
261            let path = http::uri::PathAndQuery::from_static(
262                "/nominal.ingest.v2.ContainerizedExtractorService/GetContainerizedExtractor",
263            );
264            let mut req = request.into_request();
265            req.extensions_mut()
266                .insert(
267                    GrpcMethod::new(
268                        "nominal.ingest.v2.ContainerizedExtractorService",
269                        "GetContainerizedExtractor",
270                    ),
271                );
272            self.inner.unary(req, path, codec).await
273        }
274        /// Partial update of an existing extractor. Use the `is_archived` field to archive / unarchive.
275        pub async fn update_containerized_extractor(
276            &mut self,
277            request: impl tonic::IntoRequest<super::UpdateContainerizedExtractorRequest>,
278        ) -> std::result::Result<
279            tonic::Response<super::UpdateContainerizedExtractorResponse>,
280            tonic::Status,
281        > {
282            self.inner
283                .ready()
284                .await
285                .map_err(|e| {
286                    tonic::Status::unknown(
287                        format!("Service was not ready: {}", e.into()),
288                    )
289                })?;
290            let codec = tonic::codec::ProstCodec::default();
291            let path = http::uri::PathAndQuery::from_static(
292                "/nominal.ingest.v2.ContainerizedExtractorService/UpdateContainerizedExtractor",
293            );
294            let mut req = request.into_request();
295            req.extensions_mut()
296                .insert(
297                    GrpcMethod::new(
298                        "nominal.ingest.v2.ContainerizedExtractorService",
299                        "UpdateContainerizedExtractor",
300                    ),
301                );
302            self.inner.unary(req, path, codec).await
303        }
304        /// Search extractors within a workspace, with cursor-based pagination.
305        pub async fn search_containerized_extractors(
306            &mut self,
307            request: impl tonic::IntoRequest<super::SearchContainerizedExtractorsRequest>,
308        ) -> std::result::Result<
309            tonic::Response<super::SearchContainerizedExtractorsResponse>,
310            tonic::Status,
311        > {
312            self.inner
313                .ready()
314                .await
315                .map_err(|e| {
316                    tonic::Status::unknown(
317                        format!("Service was not ready: {}", e.into()),
318                    )
319                })?;
320            let codec = tonic::codec::ProstCodec::default();
321            let path = http::uri::PathAndQuery::from_static(
322                "/nominal.ingest.v2.ContainerizedExtractorService/SearchContainerizedExtractors",
323            );
324            let mut req = request.into_request();
325            req.extensions_mut()
326                .insert(
327                    GrpcMethod::new(
328                        "nominal.ingest.v2.ContainerizedExtractorService",
329                        "SearchContainerizedExtractors",
330                    ),
331                );
332            self.inner.unary(req, path, codec).await
333        }
334    }
335}