1#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct FileSuffix {
4 #[prost(string, tag = "1")]
5 pub suffix: ::prost::alloc::string::String,
6}
7#[derive(Clone, PartialEq, ::prost::Message)]
8pub struct FileFilter {
9 #[prost(oneof = "file_filter::Filter", tags = "1")]
10 pub filter: ::core::option::Option<file_filter::Filter>,
11}
12pub mod file_filter {
14 #[derive(Clone, PartialEq, ::prost::Oneof)]
15 pub enum Filter {
16 #[prost(message, tag = "1")]
17 Suffix(super::FileSuffix),
18 }
19}
20#[derive(Clone, PartialEq, ::prost::Message)]
21pub struct FileExtractionInput {
22 #[prost(string, tag = "1")]
23 pub environment_variable: ::prost::alloc::string::String,
24 #[prost(string, tag = "2")]
25 pub name: ::prost::alloc::string::String,
26 #[prost(string, optional, tag = "3")]
27 pub description: ::core::option::Option<::prost::alloc::string::String>,
28 #[prost(message, repeated, tag = "4")]
29 pub file_filters: ::prost::alloc::vec::Vec<FileFilter>,
30 #[prost(bool, optional, tag = "5")]
31 pub required: ::core::option::Option<bool>,
32}
33#[derive(Clone, PartialEq, ::prost::Message)]
34pub struct FileExtractionParameter {
35 #[prost(string, tag = "1")]
36 pub environment_variable: ::prost::alloc::string::String,
37 #[prost(string, tag = "2")]
38 pub name: ::prost::alloc::string::String,
39 #[prost(string, optional, tag = "3")]
40 pub description: ::core::option::Option<::prost::alloc::string::String>,
41 #[prost(bool, optional, tag = "4")]
42 pub required: ::core::option::Option<bool>,
43}
44#[derive(Clone, PartialEq, ::prost::Message)]
45pub struct TimestampMetadata {
46 #[prost(string, tag = "1")]
47 pub series_name: ::prost::alloc::string::String,
48 #[prost(message, optional, tag = "2")]
49 pub timestamp_type: ::core::option::Option<super::super::types::time::TimestampType>,
50}
51#[derive(Clone, PartialEq, ::prost::Message)]
52pub struct ContainerImage {
53 #[prost(string, tag = "1")]
54 pub rid: ::prost::alloc::string::String,
55 #[prost(string, tag = "2")]
56 pub tag: ::prost::alloc::string::String,
57 #[prost(int64, optional, tag = "3")]
58 pub size_bytes: ::core::option::Option<i64>,
59 #[prost(enumeration = "ContainerImageStatus", tag = "4")]
60 pub status: i32,
61 #[prost(message, optional, tag = "5")]
62 pub created_at: ::core::option::Option<
63 super::super::super::google::protobuf::Timestamp,
64 >,
65 #[prost(string, tag = "6")]
66 pub extractor_rid: ::prost::alloc::string::String,
67 #[prost(message, repeated, tag = "7")]
68 pub inputs: ::prost::alloc::vec::Vec<FileExtractionInput>,
69 #[prost(message, repeated, tag = "8")]
70 pub parameters: ::prost::alloc::vec::Vec<FileExtractionParameter>,
71 #[prost(enumeration = "FileOutputFormat", tag = "9")]
72 pub file_output_format: i32,
73 #[prost(message, optional, tag = "10")]
74 pub default_timestamp_metadata: ::core::option::Option<TimestampMetadata>,
75 #[prost(message, repeated, tag = "11")]
76 pub exit_code_mappings: ::prost::alloc::vec::Vec<ExitCodeMapping>,
77}
78#[derive(Clone, PartialEq, ::prost::Message)]
79pub struct ExitCodeMapping {
80 #[prost(int32, tag = "1")]
81 pub exit_code: i32,
82 #[prost(string, tag = "2")]
83 pub code: ::prost::alloc::string::String,
84 #[prost(string, tag = "3")]
85 pub message: ::prost::alloc::string::String,
86 #[prost(bool, tag = "4")]
87 pub retryable: bool,
88}
89#[derive(Clone, PartialEq, ::prost::Message)]
90pub struct CreateImageRequest {
91 #[prost(string, tag = "1")]
92 pub workspace_rid: ::prost::alloc::string::String,
93 #[prost(string, tag = "2")]
94 pub tag: ::prost::alloc::string::String,
95 #[prost(string, tag = "3")]
96 pub object_path: ::prost::alloc::string::String,
97 #[prost(string, tag = "4")]
98 pub extractor_rid: ::prost::alloc::string::String,
99 #[prost(message, repeated, tag = "5")]
100 pub inputs: ::prost::alloc::vec::Vec<FileExtractionInput>,
101 #[prost(message, repeated, tag = "6")]
102 pub parameters: ::prost::alloc::vec::Vec<FileExtractionParameter>,
103 #[prost(enumeration = "FileOutputFormat", tag = "7")]
104 pub file_output_format: i32,
105 #[prost(message, optional, tag = "8")]
106 pub default_timestamp_metadata: ::core::option::Option<TimestampMetadata>,
107 #[prost(string, optional, tag = "9")]
108 pub source_image_rid: ::core::option::Option<::prost::alloc::string::String>,
109 #[prost(message, repeated, tag = "10")]
110 pub exit_code_mappings: ::prost::alloc::vec::Vec<ExitCodeMapping>,
111}
112#[derive(Clone, PartialEq, ::prost::Message)]
113pub struct CreateImageResponse {
114 #[prost(message, optional, tag = "1")]
115 pub image: ::core::option::Option<ContainerImage>,
116}
117#[derive(Clone, PartialEq, ::prost::Message)]
118pub struct GetImageRequest {
119 #[prost(string, tag = "1")]
120 pub rid: ::prost::alloc::string::String,
121 #[prost(string, tag = "2")]
122 pub workspace_rid: ::prost::alloc::string::String,
123}
124#[derive(Clone, PartialEq, ::prost::Message)]
125pub struct GetImageResponse {
126 #[prost(message, optional, tag = "1")]
127 pub image: ::core::option::Option<ContainerImage>,
128}
129#[derive(Clone, PartialEq, ::prost::Message)]
130pub struct DeleteImageRequest {
131 #[prost(string, tag = "1")]
132 pub rid: ::prost::alloc::string::String,
133 #[prost(string, tag = "2")]
134 pub workspace_rid: ::prost::alloc::string::String,
135}
136#[derive(Clone, Copy, PartialEq, ::prost::Message)]
137pub struct DeleteImageResponse {}
138#[derive(Clone, PartialEq, ::prost::Message)]
139pub struct TagFilter {
140 #[prost(string, tag = "1")]
141 pub tag: ::prost::alloc::string::String,
142}
143#[derive(Clone, Copy, PartialEq, ::prost::Message)]
144pub struct StatusFilter {
145 #[prost(enumeration = "ContainerImageStatus", tag = "1")]
146 pub status: i32,
147}
148#[derive(Clone, PartialEq, ::prost::Message)]
149pub struct ExtractorFilter {
150 #[prost(string, tag = "1")]
151 pub extractor_rid: ::prost::alloc::string::String,
152}
153#[derive(Clone, PartialEq, ::prost::Message)]
154pub struct AndFilter {
155 #[prost(message, repeated, tag = "1")]
156 pub clauses: ::prost::alloc::vec::Vec<SearchFilter>,
157}
158#[derive(Clone, PartialEq, ::prost::Message)]
159pub struct SearchFilter {
160 #[prost(oneof = "search_filter::Filter", tags = "1, 2, 3, 4")]
161 pub filter: ::core::option::Option<search_filter::Filter>,
162}
163pub mod search_filter {
165 #[derive(Clone, PartialEq, ::prost::Oneof)]
166 pub enum Filter {
167 #[prost(message, tag = "1")]
168 Tag(super::TagFilter),
169 #[prost(message, tag = "2")]
170 Status(super::StatusFilter),
171 #[prost(message, tag = "3")]
172 And(super::AndFilter),
173 #[prost(message, tag = "4")]
174 Extractor(super::ExtractorFilter),
175 }
176}
177#[derive(Clone, PartialEq, ::prost::Message)]
178pub struct SearchImagesRequest {
179 #[prost(string, tag = "1")]
180 pub workspace_rid: ::prost::alloc::string::String,
181 #[prost(message, optional, tag = "2")]
182 pub filter: ::core::option::Option<SearchFilter>,
183 #[prost(int32, optional, tag = "3")]
184 pub page_size: ::core::option::Option<i32>,
185 #[prost(string, optional, tag = "4")]
186 pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
187}
188#[derive(Clone, PartialEq, ::prost::Message)]
189pub struct SearchImagesResponse {
190 #[prost(message, repeated, tag = "1")]
191 pub images: ::prost::alloc::vec::Vec<ContainerImage>,
192 #[prost(string, optional, tag = "2")]
193 pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
194}
195#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
196#[repr(i32)]
197pub enum ContainerImageStatus {
198 Unspecified = 0,
199 Pending = 1,
200 Ready = 2,
201 Failed = 3,
202}
203impl ContainerImageStatus {
204 pub fn as_str_name(&self) -> &'static str {
209 match self {
210 Self::Unspecified => "CONTAINER_IMAGE_STATUS_UNSPECIFIED",
211 Self::Pending => "CONTAINER_IMAGE_STATUS_PENDING",
212 Self::Ready => "CONTAINER_IMAGE_STATUS_READY",
213 Self::Failed => "CONTAINER_IMAGE_STATUS_FAILED",
214 }
215 }
216 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
218 match value {
219 "CONTAINER_IMAGE_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
220 "CONTAINER_IMAGE_STATUS_PENDING" => Some(Self::Pending),
221 "CONTAINER_IMAGE_STATUS_READY" => Some(Self::Ready),
222 "CONTAINER_IMAGE_STATUS_FAILED" => Some(Self::Failed),
223 _ => None,
224 }
225 }
226}
227#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
228#[repr(i32)]
229pub enum FileOutputFormat {
230 Unspecified = 0,
231 Parquet = 1,
232 Csv = 2,
233 ParquetTar = 3,
234 AvroStream = 4,
235 JsonL = 5,
236 Manifest = 6,
237}
238impl FileOutputFormat {
239 pub fn as_str_name(&self) -> &'static str {
244 match self {
245 Self::Unspecified => "FILE_OUTPUT_FORMAT_UNSPECIFIED",
246 Self::Parquet => "FILE_OUTPUT_FORMAT_PARQUET",
247 Self::Csv => "FILE_OUTPUT_FORMAT_CSV",
248 Self::ParquetTar => "FILE_OUTPUT_FORMAT_PARQUET_TAR",
249 Self::AvroStream => "FILE_OUTPUT_FORMAT_AVRO_STREAM",
250 Self::JsonL => "FILE_OUTPUT_FORMAT_JSON_L",
251 Self::Manifest => "FILE_OUTPUT_FORMAT_MANIFEST",
252 }
253 }
254 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
256 match value {
257 "FILE_OUTPUT_FORMAT_UNSPECIFIED" => Some(Self::Unspecified),
258 "FILE_OUTPUT_FORMAT_PARQUET" => Some(Self::Parquet),
259 "FILE_OUTPUT_FORMAT_CSV" => Some(Self::Csv),
260 "FILE_OUTPUT_FORMAT_PARQUET_TAR" => Some(Self::ParquetTar),
261 "FILE_OUTPUT_FORMAT_AVRO_STREAM" => Some(Self::AvroStream),
262 "FILE_OUTPUT_FORMAT_JSON_L" => Some(Self::JsonL),
263 "FILE_OUTPUT_FORMAT_MANIFEST" => Some(Self::Manifest),
264 _ => None,
265 }
266 }
267}
268pub mod registry_service_client {
270 #![allow(
271 unused_variables,
272 dead_code,
273 missing_docs,
274 clippy::wildcard_imports,
275 clippy::let_unit_value,
276 )]
277 use tonic::codegen::*;
278 use tonic::codegen::http::Uri;
279 #[derive(Debug, Clone)]
280 pub struct RegistryServiceClient<T> {
281 inner: tonic::client::Grpc<T>,
282 }
283 impl RegistryServiceClient<tonic::transport::Channel> {
284 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
286 where
287 D: TryInto<tonic::transport::Endpoint>,
288 D::Error: Into<StdError>,
289 {
290 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
291 Ok(Self::new(conn))
292 }
293 }
294 impl<T> RegistryServiceClient<T>
295 where
296 T: tonic::client::GrpcService<tonic::body::Body>,
297 T::Error: Into<StdError>,
298 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
299 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
300 {
301 pub fn new(inner: T) -> Self {
302 let inner = tonic::client::Grpc::new(inner);
303 Self { inner }
304 }
305 pub fn with_origin(inner: T, origin: Uri) -> Self {
306 let inner = tonic::client::Grpc::with_origin(inner, origin);
307 Self { inner }
308 }
309 pub fn with_interceptor<F>(
310 inner: T,
311 interceptor: F,
312 ) -> RegistryServiceClient<InterceptedService<T, F>>
313 where
314 F: tonic::service::Interceptor,
315 T::ResponseBody: Default,
316 T: tonic::codegen::Service<
317 http::Request<tonic::body::Body>,
318 Response = http::Response<
319 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
320 >,
321 >,
322 <T as tonic::codegen::Service<
323 http::Request<tonic::body::Body>,
324 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
325 {
326 RegistryServiceClient::new(InterceptedService::new(inner, interceptor))
327 }
328 #[must_use]
333 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
334 self.inner = self.inner.send_compressed(encoding);
335 self
336 }
337 #[must_use]
339 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
340 self.inner = self.inner.accept_compressed(encoding);
341 self
342 }
343 #[must_use]
347 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
348 self.inner = self.inner.max_decoding_message_size(limit);
349 self
350 }
351 #[must_use]
355 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
356 self.inner = self.inner.max_encoding_message_size(limit);
357 self
358 }
359 pub async fn create_image(
360 &mut self,
361 request: impl tonic::IntoRequest<super::CreateImageRequest>,
362 ) -> std::result::Result<
363 tonic::Response<super::CreateImageResponse>,
364 tonic::Status,
365 > {
366 self.inner
367 .ready()
368 .await
369 .map_err(|e| {
370 tonic::Status::unknown(
371 format!("Service was not ready: {}", e.into()),
372 )
373 })?;
374 let codec = tonic::codec::ProstCodec::default();
375 let path = http::uri::PathAndQuery::from_static(
376 "/nominal.registry.v2.RegistryService/CreateImage",
377 );
378 let mut req = request.into_request();
379 req.extensions_mut()
380 .insert(
381 GrpcMethod::new("nominal.registry.v2.RegistryService", "CreateImage"),
382 );
383 self.inner.unary(req, path, codec).await
384 }
385 pub async fn get_image(
386 &mut self,
387 request: impl tonic::IntoRequest<super::GetImageRequest>,
388 ) -> std::result::Result<
389 tonic::Response<super::GetImageResponse>,
390 tonic::Status,
391 > {
392 self.inner
393 .ready()
394 .await
395 .map_err(|e| {
396 tonic::Status::unknown(
397 format!("Service was not ready: {}", e.into()),
398 )
399 })?;
400 let codec = tonic::codec::ProstCodec::default();
401 let path = http::uri::PathAndQuery::from_static(
402 "/nominal.registry.v2.RegistryService/GetImage",
403 );
404 let mut req = request.into_request();
405 req.extensions_mut()
406 .insert(
407 GrpcMethod::new("nominal.registry.v2.RegistryService", "GetImage"),
408 );
409 self.inner.unary(req, path, codec).await
410 }
411 pub async fn delete_image(
412 &mut self,
413 request: impl tonic::IntoRequest<super::DeleteImageRequest>,
414 ) -> std::result::Result<
415 tonic::Response<super::DeleteImageResponse>,
416 tonic::Status,
417 > {
418 self.inner
419 .ready()
420 .await
421 .map_err(|e| {
422 tonic::Status::unknown(
423 format!("Service was not ready: {}", e.into()),
424 )
425 })?;
426 let codec = tonic::codec::ProstCodec::default();
427 let path = http::uri::PathAndQuery::from_static(
428 "/nominal.registry.v2.RegistryService/DeleteImage",
429 );
430 let mut req = request.into_request();
431 req.extensions_mut()
432 .insert(
433 GrpcMethod::new("nominal.registry.v2.RegistryService", "DeleteImage"),
434 );
435 self.inner.unary(req, path, codec).await
436 }
437 pub async fn search_images(
438 &mut self,
439 request: impl tonic::IntoRequest<super::SearchImagesRequest>,
440 ) -> std::result::Result<
441 tonic::Response<super::SearchImagesResponse>,
442 tonic::Status,
443 > {
444 self.inner
445 .ready()
446 .await
447 .map_err(|e| {
448 tonic::Status::unknown(
449 format!("Service was not ready: {}", e.into()),
450 )
451 })?;
452 let codec = tonic::codec::ProstCodec::default();
453 let path = http::uri::PathAndQuery::from_static(
454 "/nominal.registry.v2.RegistryService/SearchImages",
455 );
456 let mut req = request.into_request();
457 req.extensions_mut()
458 .insert(
459 GrpcMethod::new(
460 "nominal.registry.v2.RegistryService",
461 "SearchImages",
462 ),
463 );
464 self.inner.unary(req, path, codec).await
465 }
466 }
467}