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/// Generated client implementations.
30pub mod data_deletion_service_client {
31    #![allow(
32        unused_variables,
33        dead_code,
34        missing_docs,
35        clippy::wildcard_imports,
36        clippy::let_unit_value,
37    )]
38    use tonic::codegen::*;
39    use tonic::codegen::http::Uri;
40    /// Data Deletion Service manages deletion of stored data.
41    #[derive(Debug, Clone)]
42    pub struct DataDeletionServiceClient<T> {
43        inner: tonic::client::Grpc<T>,
44    }
45    impl DataDeletionServiceClient<tonic::transport::Channel> {
46        /// Attempt to create a new client by connecting to a given endpoint.
47        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
48        where
49            D: TryInto<tonic::transport::Endpoint>,
50            D::Error: Into<StdError>,
51        {
52            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
53            Ok(Self::new(conn))
54        }
55    }
56    impl<T> DataDeletionServiceClient<T>
57    where
58        T: tonic::client::GrpcService<tonic::body::Body>,
59        T::Error: Into<StdError>,
60        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
61        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
62    {
63        pub fn new(inner: T) -> Self {
64            let inner = tonic::client::Grpc::new(inner);
65            Self { inner }
66        }
67        pub fn with_origin(inner: T, origin: Uri) -> Self {
68            let inner = tonic::client::Grpc::with_origin(inner, origin);
69            Self { inner }
70        }
71        pub fn with_interceptor<F>(
72            inner: T,
73            interceptor: F,
74        ) -> DataDeletionServiceClient<InterceptedService<T, F>>
75        where
76            F: tonic::service::Interceptor,
77            T::ResponseBody: Default,
78            T: tonic::codegen::Service<
79                http::Request<tonic::body::Body>,
80                Response = http::Response<
81                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
82                >,
83            >,
84            <T as tonic::codegen::Service<
85                http::Request<tonic::body::Body>,
86            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
87        {
88            DataDeletionServiceClient::new(InterceptedService::new(inner, interceptor))
89        }
90        /// Compress requests with the given encoding.
91        ///
92        /// This requires the server to support it otherwise it might respond with an
93        /// error.
94        #[must_use]
95        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
96            self.inner = self.inner.send_compressed(encoding);
97            self
98        }
99        /// Enable decompressing responses.
100        #[must_use]
101        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
102            self.inner = self.inner.accept_compressed(encoding);
103            self
104        }
105        /// Limits the maximum size of a decoded message.
106        ///
107        /// Default: `4MB`
108        #[must_use]
109        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
110            self.inner = self.inner.max_decoding_message_size(limit);
111            self
112        }
113        /// Limits the maximum size of an encoded message.
114        ///
115        /// Default: `usize::MAX`
116        #[must_use]
117        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
118            self.inner = self.inner.max_encoding_message_size(limit);
119            self
120        }
121        /// Deletes stored data. This is an irreversible operation so be careful about specified
122        /// time range, channel names, and tag scope. requires the user to be an admin for the organization.
123        pub async fn delete_data(
124            &mut self,
125            request: impl tonic::IntoRequest<super::DeleteDataRequest>,
126        ) -> std::result::Result<
127            tonic::Response<super::DeleteDataResponse>,
128            tonic::Status,
129        > {
130            self.inner
131                .ready()
132                .await
133                .map_err(|e| {
134                    tonic::Status::unknown(
135                        format!("Service was not ready: {}", e.into()),
136                    )
137                })?;
138            let codec = tonic::codec::ProstCodec::default();
139            let path = http::uri::PathAndQuery::from_static(
140                "/nominal.storage.v1.DataDeletionService/DeleteData",
141            );
142            let mut req = request.into_request();
143            req.extensions_mut()
144                .insert(
145                    GrpcMethod::new(
146                        "nominal.storage.v1.DataDeletionService",
147                        "DeleteData",
148                    ),
149                );
150            self.inner.unary(req, path, codec).await
151        }
152    }
153}