Skip to main content

nominal_api_proto/proto/
nominal.iceberg.v1.rs

1// This file is @generated by prost-build.
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct Namespace {
4    #[prost(string, repeated, tag = "1")]
5    pub levels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
6}
7#[derive(Clone, PartialEq, ::prost::Message)]
8pub struct TableName {
9    #[prost(string, tag = "1")]
10    pub name: ::prost::alloc::string::String,
11}
12#[derive(Clone, PartialEq, ::prost::Message)]
13pub struct TableTarget {
14    #[prost(message, optional, tag = "1")]
15    pub namespace: ::core::option::Option<Namespace>,
16    #[prost(message, optional, tag = "2")]
17    pub table_name: ::core::option::Option<TableName>,
18}
19#[derive(Clone, PartialEq, ::prost::Message)]
20pub struct MaintenanceAction {
21    #[prost(message, optional, tag = "1")]
22    pub target: ::core::option::Option<TableTarget>,
23    #[prost(oneof = "maintenance_action::Action", tags = "2, 3, 4, 5")]
24    pub action: ::core::option::Option<maintenance_action::Action>,
25}
26/// Nested message and enum types in `MaintenanceAction`.
27pub mod maintenance_action {
28    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
29    pub enum Action {
30        #[prost(message, tag = "2")]
31        RewriteDataFiles(super::RewriteDataFiles),
32        #[prost(message, tag = "3")]
33        RewriteManifests(super::RewriteManifests),
34        #[prost(message, tag = "4")]
35        ExpireSnapshots(super::ExpireSnapshots),
36        #[prost(message, tag = "5")]
37        RemoveOrphanFiles(super::RemoveOrphanFiles),
38    }
39}
40#[derive(Clone, Copy, PartialEq, ::prost::Message)]
41pub struct RewriteDataFiles {
42    #[prost(uint64, optional, tag = "1")]
43    pub target_file_size_bytes: ::core::option::Option<u64>,
44}
45#[derive(Clone, Copy, PartialEq, ::prost::Message)]
46pub struct RewriteManifests {}
47#[derive(Clone, Copy, PartialEq, ::prost::Message)]
48pub struct ExpireSnapshots {}
49#[derive(Clone, Copy, PartialEq, ::prost::Message)]
50pub struct RemoveOrphanFiles {}
51#[derive(Clone, PartialEq, ::prost::Message)]
52pub struct GetMaintenanceRunResponse {
53    #[prost(string, tag = "1")]
54    pub run_id: ::prost::alloc::string::String,
55    #[prost(message, repeated, tag = "2")]
56    pub actions: ::prost::alloc::vec::Vec<MaintenanceAction>,
57    #[prost(enumeration = "MaintenanceRunStatus", tag = "3")]
58    pub status: i32,
59    #[prost(message, optional, tag = "4")]
60    pub started_at: ::core::option::Option<
61        super::super::super::google::protobuf::Timestamp,
62    >,
63    #[prost(message, optional, tag = "5")]
64    pub finished_at: ::core::option::Option<
65        super::super::super::google::protobuf::Timestamp,
66    >,
67}
68#[derive(Clone, PartialEq, ::prost::Message)]
69pub struct RunMaintenanceRequest {
70    #[prost(message, repeated, tag = "1")]
71    pub actions: ::prost::alloc::vec::Vec<MaintenanceAction>,
72    #[prost(string, optional, tag = "2")]
73    pub image_override: ::core::option::Option<::prost::alloc::string::String>,
74}
75#[derive(Clone, PartialEq, ::prost::Message)]
76pub struct RunMaintenanceResponse {
77    #[prost(string, tag = "1")]
78    pub run_id: ::prost::alloc::string::String,
79}
80#[derive(Clone, PartialEq, ::prost::Message)]
81pub struct GetMaintenanceRunRequest {
82    #[prost(string, tag = "1")]
83    pub run_id: ::prost::alloc::string::String,
84}
85#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
86#[repr(i32)]
87pub enum MaintenanceRunStatus {
88    Unspecified = 0,
89    Pending = 1,
90    Running = 2,
91    Succeeded = 3,
92    Failed = 4,
93}
94impl MaintenanceRunStatus {
95    /// String value of the enum field names used in the ProtoBuf definition.
96    ///
97    /// The values are not transformed in any way and thus are considered stable
98    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
99    pub fn as_str_name(&self) -> &'static str {
100        match self {
101            Self::Unspecified => "MAINTENANCE_RUN_STATUS_UNSPECIFIED",
102            Self::Pending => "MAINTENANCE_RUN_STATUS_PENDING",
103            Self::Running => "MAINTENANCE_RUN_STATUS_RUNNING",
104            Self::Succeeded => "MAINTENANCE_RUN_STATUS_SUCCEEDED",
105            Self::Failed => "MAINTENANCE_RUN_STATUS_FAILED",
106        }
107    }
108    /// Creates an enum from field names used in the ProtoBuf definition.
109    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
110        match value {
111            "MAINTENANCE_RUN_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
112            "MAINTENANCE_RUN_STATUS_PENDING" => Some(Self::Pending),
113            "MAINTENANCE_RUN_STATUS_RUNNING" => Some(Self::Running),
114            "MAINTENANCE_RUN_STATUS_SUCCEEDED" => Some(Self::Succeeded),
115            "MAINTENANCE_RUN_STATUS_FAILED" => Some(Self::Failed),
116            _ => None,
117        }
118    }
119}
120#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
121#[repr(i32)]
122pub enum TableMaintenanceErrors {
123    Unspecified = 0,
124    TableNotFound = 1,
125}
126impl TableMaintenanceErrors {
127    /// String value of the enum field names used in the ProtoBuf definition.
128    ///
129    /// The values are not transformed in any way and thus are considered stable
130    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
131    pub fn as_str_name(&self) -> &'static str {
132        match self {
133            Self::Unspecified => "TABLE_MAINTENANCE_ERRORS_UNSPECIFIED",
134            Self::TableNotFound => "TABLE_MAINTENANCE_ERRORS_TABLE_NOT_FOUND",
135        }
136    }
137    /// Creates an enum from field names used in the ProtoBuf definition.
138    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
139        match value {
140            "TABLE_MAINTENANCE_ERRORS_UNSPECIFIED" => Some(Self::Unspecified),
141            "TABLE_MAINTENANCE_ERRORS_TABLE_NOT_FOUND" => Some(Self::TableNotFound),
142            _ => None,
143        }
144    }
145}
146/// Generated client implementations.
147pub mod iceberg_table_maintenance_service_client {
148    #![allow(
149        unused_variables,
150        dead_code,
151        missing_docs,
152        clippy::wildcard_imports,
153        clippy::let_unit_value,
154    )]
155    use tonic::codegen::*;
156    use tonic::codegen::http::Uri;
157    #[derive(Debug, Clone)]
158    pub struct IcebergTableMaintenanceServiceClient<T> {
159        inner: tonic::client::Grpc<T>,
160    }
161    impl IcebergTableMaintenanceServiceClient<tonic::transport::Channel> {
162        /// Attempt to create a new client by connecting to a given endpoint.
163        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
164        where
165            D: TryInto<tonic::transport::Endpoint>,
166            D::Error: Into<StdError>,
167        {
168            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
169            Ok(Self::new(conn))
170        }
171    }
172    impl<T> IcebergTableMaintenanceServiceClient<T>
173    where
174        T: tonic::client::GrpcService<tonic::body::Body>,
175        T::Error: Into<StdError>,
176        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
177        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
178    {
179        pub fn new(inner: T) -> Self {
180            let inner = tonic::client::Grpc::new(inner);
181            Self { inner }
182        }
183        pub fn with_origin(inner: T, origin: Uri) -> Self {
184            let inner = tonic::client::Grpc::with_origin(inner, origin);
185            Self { inner }
186        }
187        pub fn with_interceptor<F>(
188            inner: T,
189            interceptor: F,
190        ) -> IcebergTableMaintenanceServiceClient<InterceptedService<T, F>>
191        where
192            F: tonic::service::Interceptor,
193            T::ResponseBody: Default,
194            T: tonic::codegen::Service<
195                http::Request<tonic::body::Body>,
196                Response = http::Response<
197                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
198                >,
199            >,
200            <T as tonic::codegen::Service<
201                http::Request<tonic::body::Body>,
202            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
203        {
204            IcebergTableMaintenanceServiceClient::new(
205                InterceptedService::new(inner, interceptor),
206            )
207        }
208        /// Compress requests with the given encoding.
209        ///
210        /// This requires the server to support it otherwise it might respond with an
211        /// error.
212        #[must_use]
213        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
214            self.inner = self.inner.send_compressed(encoding);
215            self
216        }
217        /// Enable decompressing responses.
218        #[must_use]
219        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
220            self.inner = self.inner.accept_compressed(encoding);
221            self
222        }
223        /// Limits the maximum size of a decoded message.
224        ///
225        /// Default: `4MB`
226        #[must_use]
227        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
228            self.inner = self.inner.max_decoding_message_size(limit);
229            self
230        }
231        /// Limits the maximum size of an encoded message.
232        ///
233        /// Default: `usize::MAX`
234        #[must_use]
235        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
236            self.inner = self.inner.max_encoding_message_size(limit);
237            self
238        }
239        pub async fn run_maintenance(
240            &mut self,
241            request: impl tonic::IntoRequest<super::RunMaintenanceRequest>,
242        ) -> std::result::Result<
243            tonic::Response<super::RunMaintenanceResponse>,
244            tonic::Status,
245        > {
246            self.inner
247                .ready()
248                .await
249                .map_err(|e| {
250                    tonic::Status::unknown(
251                        format!("Service was not ready: {}", e.into()),
252                    )
253                })?;
254            let codec = tonic::codec::ProstCodec::default();
255            let path = http::uri::PathAndQuery::from_static(
256                "/nominal.iceberg.v1.IcebergTableMaintenanceService/RunMaintenance",
257            );
258            let mut req = request.into_request();
259            req.extensions_mut()
260                .insert(
261                    GrpcMethod::new(
262                        "nominal.iceberg.v1.IcebergTableMaintenanceService",
263                        "RunMaintenance",
264                    ),
265                );
266            self.inner.unary(req, path, codec).await
267        }
268        pub async fn get_maintenance_run(
269            &mut self,
270            request: impl tonic::IntoRequest<super::GetMaintenanceRunRequest>,
271        ) -> std::result::Result<
272            tonic::Response<super::GetMaintenanceRunResponse>,
273            tonic::Status,
274        > {
275            self.inner
276                .ready()
277                .await
278                .map_err(|e| {
279                    tonic::Status::unknown(
280                        format!("Service was not ready: {}", e.into()),
281                    )
282                })?;
283            let codec = tonic::codec::ProstCodec::default();
284            let path = http::uri::PathAndQuery::from_static(
285                "/nominal.iceberg.v1.IcebergTableMaintenanceService/GetMaintenanceRun",
286            );
287            let mut req = request.into_request();
288            req.extensions_mut()
289                .insert(
290                    GrpcMethod::new(
291                        "nominal.iceberg.v1.IcebergTableMaintenanceService",
292                        "GetMaintenanceRun",
293                    ),
294                );
295            self.inner.unary(req, path, codec).await
296        }
297    }
298}
299#[derive(Clone, PartialEq, ::prost::Message)]
300pub struct IcebergFileWrittenEvent {
301    #[prost(message, optional, tag = "1")]
302    pub table: ::core::option::Option<TableTarget>,
303    #[prost(int32, tag = "2")]
304    pub partition_value: i32,
305    #[prost(string, tag = "3")]
306    pub object_key: ::prost::alloc::string::String,
307    #[prost(message, optional, tag = "4")]
308    pub ingested_at: ::core::option::Option<
309        super::super::super::google::protobuf::Timestamp,
310    >,
311}