Skip to main content

nominal_api/proto/
nominal.storage.v1.rs

1// This file is @generated by prost-build.
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct DeleteDataRequest {
4    #[prost(string, tag = "1")]
5    pub data_source_rid: ::prost::alloc::string::String,
6    /// If specified, will only delete data within the given time range.
7    /// If not specified, will delete data across all time.
8    #[prost(message, optional, tag = "2")]
9    pub time_range: ::core::option::Option<super::super::types::time::Range>,
10    /// If specified, will only delete data that fully matches the given tags.
11    /// If not specified, will delete data across all tags.
12    #[prost(map = "string, string", tag = "3")]
13    pub tags: ::std::collections::HashMap<
14        ::prost::alloc::string::String,
15        ::prost::alloc::string::String,
16    >,
17    /// If specified, will only delete data that has an exact channel name match with the given names.
18    /// If not specified, will delete data across all channels.
19    #[prost(string, repeated, tag = "4")]
20    pub channel_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
21    /// If true and tags, channelNames, and timeRange are empty, will also delete associated channel metadata.
22    /// Otherwise, will only delete raw data. This is to guarantee that you are not orphaning data unintentionally
23    /// by deleting the metadata.
24    #[prost(bool, tag = "5")]
25    pub delete_metadata: bool,
26}
27#[derive(Clone, Copy, PartialEq, ::prost::Message)]
28pub struct DeleteDataResponse {}
29/// Identifies a channel with its associated tags.
30#[derive(Clone, PartialEq, ::prost::Message)]
31pub struct ChannelWithTags {
32    #[prost(string, tag = "1")]
33    pub channel: ::prost::alloc::string::String,
34    #[prost(map = "string, string", tag = "2")]
35    pub tags: ::std::collections::HashMap<
36        ::prost::alloc::string::String,
37        ::prost::alloc::string::String,
38    >,
39}
40#[derive(Clone, PartialEq, ::prost::Message)]
41pub struct DeleteChannelWithTagsRequest {
42    #[prost(string, tag = "1")]
43    pub data_source_rid: ::prost::alloc::string::String,
44    /// If channel is provided, only channels with tags matching that channel will be deleted.
45    #[prost(string, optional, tag = "2")]
46    pub channel: ::core::option::Option<::prost::alloc::string::String>,
47    /// At least one tag must be specified in the request. Deletes all data containing the specified tags.
48    #[prost(map = "string, string", tag = "3")]
49    pub tags: ::std::collections::HashMap<
50        ::prost::alloc::string::String,
51        ::prost::alloc::string::String,
52    >,
53    /// When false, the request does not apply the deletions and instead returns the list of channels with tags
54    /// that would be deleted. When true, the deletions are applied.
55    #[prost(bool, tag = "4")]
56    pub apply: bool,
57    /// !!! WARNING !!!
58    /// When true, skips the soft-delete queue and permanently makes the channel and tags combinations unviewable.
59    /// This effect is IMMEDIATE and CANNOT be undone.
60    /// Requires apply to be true to have any effect.
61    #[prost(bool, tag = "5")]
62    pub skip_hard_delete: bool,
63}
64#[derive(Clone, PartialEq, ::prost::Message)]
65pub struct DeleteChannelWithTagsResponse {
66    /// The list of ChannelWithTags that were deleted or would be deleted (when apply is false).
67    #[prost(message, repeated, tag = "1")]
68    pub channel_with_tags: ::prost::alloc::vec::Vec<ChannelWithTags>,
69}
70#[derive(Clone, PartialEq, ::prost::Message)]
71pub struct UndeleteChannelWithTagsRequest {
72    #[prost(string, tag = "1")]
73    pub data_source_rid: ::prost::alloc::string::String,
74    #[prost(message, repeated, tag = "2")]
75    pub channel_with_tags: ::prost::alloc::vec::Vec<ChannelWithTags>,
76}
77#[derive(Clone, Copy, PartialEq, ::prost::Message)]
78pub struct UndeleteChannelWithTagsResponse {}
79/// Generated client implementations.
80pub mod data_deletion_service_client {
81    #![allow(
82        unused_variables,
83        dead_code,
84        missing_docs,
85        clippy::wildcard_imports,
86        clippy::let_unit_value,
87    )]
88    use tonic::codegen::*;
89    use tonic::codegen::http::Uri;
90    /// Data Deletion Service manages deletion of stored data.
91    #[derive(Debug, Clone)]
92    pub struct DataDeletionServiceClient<T> {
93        inner: tonic::client::Grpc<T>,
94    }
95    impl DataDeletionServiceClient<tonic::transport::Channel> {
96        /// Attempt to create a new client by connecting to a given endpoint.
97        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
98        where
99            D: TryInto<tonic::transport::Endpoint>,
100            D::Error: Into<StdError>,
101        {
102            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
103            Ok(Self::new(conn))
104        }
105    }
106    impl<T> DataDeletionServiceClient<T>
107    where
108        T: tonic::client::GrpcService<tonic::body::Body>,
109        T::Error: Into<StdError>,
110        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
111        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
112    {
113        pub fn new(inner: T) -> Self {
114            let inner = tonic::client::Grpc::new(inner);
115            Self { inner }
116        }
117        pub fn with_origin(inner: T, origin: Uri) -> Self {
118            let inner = tonic::client::Grpc::with_origin(inner, origin);
119            Self { inner }
120        }
121        pub fn with_interceptor<F>(
122            inner: T,
123            interceptor: F,
124        ) -> DataDeletionServiceClient<InterceptedService<T, F>>
125        where
126            F: tonic::service::Interceptor,
127            T::ResponseBody: Default,
128            T: tonic::codegen::Service<
129                http::Request<tonic::body::Body>,
130                Response = http::Response<
131                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
132                >,
133            >,
134            <T as tonic::codegen::Service<
135                http::Request<tonic::body::Body>,
136            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
137        {
138            DataDeletionServiceClient::new(InterceptedService::new(inner, interceptor))
139        }
140        /// Compress requests with the given encoding.
141        ///
142        /// This requires the server to support it otherwise it might respond with an
143        /// error.
144        #[must_use]
145        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
146            self.inner = self.inner.send_compressed(encoding);
147            self
148        }
149        /// Enable decompressing responses.
150        #[must_use]
151        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
152            self.inner = self.inner.accept_compressed(encoding);
153            self
154        }
155        /// Limits the maximum size of a decoded message.
156        ///
157        /// Default: `4MB`
158        #[must_use]
159        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
160            self.inner = self.inner.max_decoding_message_size(limit);
161            self
162        }
163        /// Limits the maximum size of an encoded message.
164        ///
165        /// Default: `usize::MAX`
166        #[must_use]
167        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
168            self.inner = self.inner.max_encoding_message_size(limit);
169            self
170        }
171        /// Deletes stored data. This is an irreversible operation so be careful about specified
172        /// time range, channel names, and tag scope. requires the user to be an admin for the organization.
173        pub async fn delete_data(
174            &mut self,
175            request: impl tonic::IntoRequest<super::DeleteDataRequest>,
176        ) -> std::result::Result<
177            tonic::Response<super::DeleteDataResponse>,
178            tonic::Status,
179        > {
180            self.inner
181                .ready()
182                .await
183                .map_err(|e| {
184                    tonic::Status::unknown(
185                        format!("Service was not ready: {}", e.into()),
186                    )
187                })?;
188            let codec = tonic::codec::ProstCodec::default();
189            let path = http::uri::PathAndQuery::from_static(
190                "/nominal.storage.v1.DataDeletionService/DeleteData",
191            );
192            let mut req = request.into_request();
193            req.extensions_mut()
194                .insert(
195                    GrpcMethod::new(
196                        "nominal.storage.v1.DataDeletionService",
197                        "DeleteData",
198                    ),
199                );
200            self.inner.unary(req, path, codec).await
201        }
202        /// Deletes channels with tags within a data source.
203        /// Requires DATASOURCE__DELETE_DATA permission on the data source.
204        /// Deletions are soft — deleted channels with tags are marked for deletion and will eventually be hard deleted.
205        /// The request will be rejected if there are too many pending deletions for the data source.
206        /// Throws if the request matches too many channels with tags.
207        pub async fn delete_channel_with_tags(
208            &mut self,
209            request: impl tonic::IntoRequest<super::DeleteChannelWithTagsRequest>,
210        ) -> std::result::Result<
211            tonic::Response<super::DeleteChannelWithTagsResponse>,
212            tonic::Status,
213        > {
214            self.inner
215                .ready()
216                .await
217                .map_err(|e| {
218                    tonic::Status::unknown(
219                        format!("Service was not ready: {}", e.into()),
220                    )
221                })?;
222            let codec = tonic::codec::ProstCodec::default();
223            let path = http::uri::PathAndQuery::from_static(
224                "/nominal.storage.v1.DataDeletionService/DeleteChannelWithTags",
225            );
226            let mut req = request.into_request();
227            req.extensions_mut()
228                .insert(
229                    GrpcMethod::new(
230                        "nominal.storage.v1.DataDeletionService",
231                        "DeleteChannelWithTags",
232                    ),
233                );
234            self.inner.unary(req, path, codec).await
235        }
236        /// Best effort to undelete channels with tags within a data source.
237        /// Requires DATASOURCE__DELETE_DATA permission on the data source.
238        /// The batch size of channels with tags in the request must be <= 1000.
239        pub async fn undelete_channel_with_tags(
240            &mut self,
241            request: impl tonic::IntoRequest<super::UndeleteChannelWithTagsRequest>,
242        ) -> std::result::Result<
243            tonic::Response<super::UndeleteChannelWithTagsResponse>,
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.storage.v1.DataDeletionService/UndeleteChannelWithTags",
257            );
258            let mut req = request.into_request();
259            req.extensions_mut()
260                .insert(
261                    GrpcMethod::new(
262                        "nominal.storage.v1.DataDeletionService",
263                        "UndeleteChannelWithTags",
264                    ),
265                );
266            self.inner.unary(req, path, codec).await
267        }
268    }
269}
270/// A retention exemption for a dataset, representing a time range that should be preserved
271/// regardless of the dataset's retention policy.
272#[derive(Clone, PartialEq, ::prost::Message)]
273pub struct DatasetRetentionExemption {
274    /// The dataset this exemption applies to.
275    #[prost(string, tag = "1")]
276    pub dataset_rid: ::prost::alloc::string::String,
277    /// Identifier for the source of this exemption (e.g. run RID).
278    #[prost(string, tag = "2")]
279    pub source_id: ::prost::alloc::string::String,
280    /// Inclusive time range to exempt from retention.
281    #[prost(message, optional, tag = "3")]
282    pub bounds: ::core::option::Option<super::super::types::time::Range>,
283    #[prost(string, optional, tag = "4")]
284    pub description: ::core::option::Option<::prost::alloc::string::String>,
285}
286#[derive(Clone, PartialEq, ::prost::Message)]
287pub struct UpsertDatasetRetentionExemptionRequest {
288    #[prost(string, tag = "1")]
289    pub dataset_rid: ::prost::alloc::string::String,
290    #[prost(string, tag = "2")]
291    pub source_id: ::prost::alloc::string::String,
292    /// Inclusive time range to exempt from retention.
293    #[prost(message, optional, tag = "3")]
294    pub bounds: ::core::option::Option<super::super::types::time::Range>,
295    #[prost(string, optional, tag = "4")]
296    pub description: ::core::option::Option<::prost::alloc::string::String>,
297}
298#[derive(Clone, PartialEq, ::prost::Message)]
299pub struct UpsertDatasetRetentionExemptionResponse {
300    #[prost(message, optional, tag = "1")]
301    pub exemption: ::core::option::Option<DatasetRetentionExemption>,
302}
303#[derive(Clone, PartialEq, ::prost::Message)]
304pub struct DeleteDatasetRetentionExemptionRequest {
305    #[prost(string, tag = "1")]
306    pub dataset_rid: ::prost::alloc::string::String,
307    #[prost(string, tag = "2")]
308    pub source_id: ::prost::alloc::string::String,
309}
310#[derive(Clone, Copy, PartialEq, ::prost::Message)]
311pub struct DeleteDatasetRetentionExemptionResponse {}
312#[derive(Clone, PartialEq, ::prost::Message)]
313pub struct ListDatasetRetentionExemptionsRequest {
314    #[prost(string, tag = "1")]
315    pub dataset_rid: ::prost::alloc::string::String,
316    /// Filter exemptions that overlap with this time range.
317    #[prost(message, optional, tag = "2")]
318    pub bounds: ::core::option::Option<super::super::types::time::Range>,
319    #[prost(int32, optional, tag = "3")]
320    pub page_size: ::core::option::Option<i32>,
321    #[prost(string, optional, tag = "4")]
322    pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
323}
324#[derive(Clone, PartialEq, ::prost::Message)]
325pub struct ListDatasetRetentionExemptionsResponse {
326    #[prost(message, repeated, tag = "1")]
327    pub exemptions: ::prost::alloc::vec::Vec<DatasetRetentionExemption>,
328    #[prost(string, optional, tag = "2")]
329    pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
330}
331#[derive(Clone, Copy, PartialEq, ::prost::Message)]
332pub struct KeepForever {}
333#[derive(Clone, Copy, PartialEq, ::prost::Message)]
334pub struct KeepUntilExpiry {
335    #[prost(int32, tag = "1")]
336    pub expiry_days: i32,
337}
338#[derive(Clone, Copy, PartialEq, ::prost::Message)]
339pub struct RetentionPolicy {
340    #[prost(oneof = "retention_policy::Policy", tags = "1, 2")]
341    pub policy: ::core::option::Option<retention_policy::Policy>,
342}
343/// Nested message and enum types in `RetentionPolicy`.
344pub mod retention_policy {
345    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
346    pub enum Policy {
347        #[prost(message, tag = "1")]
348        KeepForever(super::KeepForever),
349        #[prost(message, tag = "2")]
350        KeepUntilExpiry(super::KeepUntilExpiry),
351    }
352}
353#[derive(Clone, PartialEq, ::prost::Message)]
354pub struct UpdateRetentionPolicyRequest {
355    #[prost(string, tag = "1")]
356    pub dataset_rid: ::prost::alloc::string::String,
357    /// If absent, the retention policy is removed (reverts to default/keep-forever).
358    #[prost(message, optional, tag = "2")]
359    pub retention_policy: ::core::option::Option<RetentionPolicy>,
360}
361#[derive(Clone, Copy, PartialEq, ::prost::Message)]
362pub struct UpdateRetentionPolicyResponse {}
363/// Generated client implementations.
364pub mod dataset_retention_service_client {
365    #![allow(
366        unused_variables,
367        dead_code,
368        missing_docs,
369        clippy::wildcard_imports,
370        clippy::let_unit_value,
371    )]
372    use tonic::codegen::*;
373    use tonic::codegen::http::Uri;
374    /// Manages retention policies and exemptions for datasets.
375    #[derive(Debug, Clone)]
376    pub struct DatasetRetentionServiceClient<T> {
377        inner: tonic::client::Grpc<T>,
378    }
379    impl DatasetRetentionServiceClient<tonic::transport::Channel> {
380        /// Attempt to create a new client by connecting to a given endpoint.
381        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
382        where
383            D: TryInto<tonic::transport::Endpoint>,
384            D::Error: Into<StdError>,
385        {
386            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
387            Ok(Self::new(conn))
388        }
389    }
390    impl<T> DatasetRetentionServiceClient<T>
391    where
392        T: tonic::client::GrpcService<tonic::body::Body>,
393        T::Error: Into<StdError>,
394        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
395        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
396    {
397        pub fn new(inner: T) -> Self {
398            let inner = tonic::client::Grpc::new(inner);
399            Self { inner }
400        }
401        pub fn with_origin(inner: T, origin: Uri) -> Self {
402            let inner = tonic::client::Grpc::with_origin(inner, origin);
403            Self { inner }
404        }
405        pub fn with_interceptor<F>(
406            inner: T,
407            interceptor: F,
408        ) -> DatasetRetentionServiceClient<InterceptedService<T, F>>
409        where
410            F: tonic::service::Interceptor,
411            T::ResponseBody: Default,
412            T: tonic::codegen::Service<
413                http::Request<tonic::body::Body>,
414                Response = http::Response<
415                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
416                >,
417            >,
418            <T as tonic::codegen::Service<
419                http::Request<tonic::body::Body>,
420            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
421        {
422            DatasetRetentionServiceClient::new(
423                InterceptedService::new(inner, interceptor),
424            )
425        }
426        /// Compress requests with the given encoding.
427        ///
428        /// This requires the server to support it otherwise it might respond with an
429        /// error.
430        #[must_use]
431        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
432            self.inner = self.inner.send_compressed(encoding);
433            self
434        }
435        /// Enable decompressing responses.
436        #[must_use]
437        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
438            self.inner = self.inner.accept_compressed(encoding);
439            self
440        }
441        /// Limits the maximum size of a decoded message.
442        ///
443        /// Default: `4MB`
444        #[must_use]
445        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
446            self.inner = self.inner.max_decoding_message_size(limit);
447            self
448        }
449        /// Limits the maximum size of an encoded message.
450        ///
451        /// Default: `usize::MAX`
452        #[must_use]
453        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
454            self.inner = self.inner.max_encoding_message_size(limit);
455            self
456        }
457        /// Update or remove the retention policy for a dataset. When a policy is set,
458        /// data older than the policy's expiry will be deleted.
459        pub async fn update_retention_policy(
460            &mut self,
461            request: impl tonic::IntoRequest<super::UpdateRetentionPolicyRequest>,
462        ) -> std::result::Result<
463            tonic::Response<super::UpdateRetentionPolicyResponse>,
464            tonic::Status,
465        > {
466            self.inner
467                .ready()
468                .await
469                .map_err(|e| {
470                    tonic::Status::unknown(
471                        format!("Service was not ready: {}", e.into()),
472                    )
473                })?;
474            let codec = tonic::codec::ProstCodec::default();
475            let path = http::uri::PathAndQuery::from_static(
476                "/nominal.storage.v1.DatasetRetentionService/UpdateRetentionPolicy",
477            );
478            let mut req = request.into_request();
479            req.extensions_mut()
480                .insert(
481                    GrpcMethod::new(
482                        "nominal.storage.v1.DatasetRetentionService",
483                        "UpdateRetentionPolicy",
484                    ),
485                );
486            self.inner.unary(req, path, codec).await
487        }
488        /// Create or update a retention exemption for a dataset. The exemption is keyed by
489        /// (dataset_rid, source_id) — upserting with the same key updates the time range.
490        pub async fn upsert_dataset_retention_exemption(
491            &mut self,
492            request: impl tonic::IntoRequest<
493                super::UpsertDatasetRetentionExemptionRequest,
494            >,
495        ) -> std::result::Result<
496            tonic::Response<super::UpsertDatasetRetentionExemptionResponse>,
497            tonic::Status,
498        > {
499            self.inner
500                .ready()
501                .await
502                .map_err(|e| {
503                    tonic::Status::unknown(
504                        format!("Service was not ready: {}", e.into()),
505                    )
506                })?;
507            let codec = tonic::codec::ProstCodec::default();
508            let path = http::uri::PathAndQuery::from_static(
509                "/nominal.storage.v1.DatasetRetentionService/UpsertDatasetRetentionExemption",
510            );
511            let mut req = request.into_request();
512            req.extensions_mut()
513                .insert(
514                    GrpcMethod::new(
515                        "nominal.storage.v1.DatasetRetentionService",
516                        "UpsertDatasetRetentionExemption",
517                    ),
518                );
519            self.inner.unary(req, path, codec).await
520        }
521        /// Delete a retention exemption for a dataset.
522        pub async fn delete_dataset_retention_exemption(
523            &mut self,
524            request: impl tonic::IntoRequest<
525                super::DeleteDatasetRetentionExemptionRequest,
526            >,
527        ) -> std::result::Result<
528            tonic::Response<super::DeleteDatasetRetentionExemptionResponse>,
529            tonic::Status,
530        > {
531            self.inner
532                .ready()
533                .await
534                .map_err(|e| {
535                    tonic::Status::unknown(
536                        format!("Service was not ready: {}", e.into()),
537                    )
538                })?;
539            let codec = tonic::codec::ProstCodec::default();
540            let path = http::uri::PathAndQuery::from_static(
541                "/nominal.storage.v1.DatasetRetentionService/DeleteDatasetRetentionExemption",
542            );
543            let mut req = request.into_request();
544            req.extensions_mut()
545                .insert(
546                    GrpcMethod::new(
547                        "nominal.storage.v1.DatasetRetentionService",
548                        "DeleteDatasetRetentionExemption",
549                    ),
550                );
551            self.inner.unary(req, path, codec).await
552        }
553        /// List retention exemptions for a dataset, filtered to those overlapping the given time range.
554        pub async fn list_dataset_retention_exemptions(
555            &mut self,
556            request: impl tonic::IntoRequest<
557                super::ListDatasetRetentionExemptionsRequest,
558            >,
559        ) -> std::result::Result<
560            tonic::Response<super::ListDatasetRetentionExemptionsResponse>,
561            tonic::Status,
562        > {
563            self.inner
564                .ready()
565                .await
566                .map_err(|e| {
567                    tonic::Status::unknown(
568                        format!("Service was not ready: {}", e.into()),
569                    )
570                })?;
571            let codec = tonic::codec::ProstCodec::default();
572            let path = http::uri::PathAndQuery::from_static(
573                "/nominal.storage.v1.DatasetRetentionService/ListDatasetRetentionExemptions",
574            );
575            let mut req = request.into_request();
576            req.extensions_mut()
577                .insert(
578                    GrpcMethod::new(
579                        "nominal.storage.v1.DatasetRetentionService",
580                        "ListDatasetRetentionExemptions",
581                    ),
582                );
583            self.inner.unary(req, path, codec).await
584        }
585    }
586}