Skip to main content

nominal_api_proto/proto/
nominal.registry.v2.rs

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