Skip to main content

nominal_api_proto/proto/
nominal.storage.datasource.v2.rs

1// This file is @generated by prost-build.
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct NominalDataSource {
4    #[prost(string, tag = "1")]
5    pub rid: ::prost::alloc::string::String,
6    #[prost(string, tag = "2")]
7    pub id: ::prost::alloc::string::String,
8    #[prost(string, optional, tag = "3")]
9    pub description: ::core::option::Option<::prost::alloc::string::String>,
10    #[prost(message, optional, tag = "4")]
11    pub data_last_written_at: ::core::option::Option<
12        super::super::super::super::google::protobuf::Timestamp,
13    >,
14    #[prost(enumeration = "super::super::super::types::Granularity", tag = "5")]
15    pub granularity: i32,
16    #[prost(bool, tag = "6")]
17    pub in_memory_streaming_enabled: bool,
18}
19#[derive(Clone, PartialEq, ::prost::Message)]
20pub struct CreateNominalDataSourceRequest {
21    #[prost(message, optional, tag = "1")]
22    pub nominal_data_source: ::core::option::Option<NominalDataSource>,
23    #[prost(string, optional, tag = "2")]
24    pub workspace_rid: ::core::option::Option<::prost::alloc::string::String>,
25}
26#[derive(Clone, PartialEq, ::prost::Message)]
27pub struct CreateNominalDataSourceResponse {
28    #[prost(message, optional, tag = "1")]
29    pub nominal_data_source: ::core::option::Option<NominalDataSource>,
30}
31#[derive(Clone, PartialEq, ::prost::Message)]
32pub struct BatchGetNominalDataSourcesRequest {
33    #[prost(string, repeated, tag = "1")]
34    pub nominal_data_source_rids: ::prost::alloc::vec::Vec<
35        ::prost::alloc::string::String,
36    >,
37}
38#[derive(Clone, PartialEq, ::prost::Message)]
39pub struct BatchGetNominalDataSourcesResponse {
40    #[prost(message, repeated, tag = "1")]
41    pub nominal_data_sources: ::prost::alloc::vec::Vec<NominalDataSource>,
42}
43#[derive(Clone, PartialEq, ::prost::Message)]
44pub struct UpdateNominalDataSourceRequest {
45    #[prost(message, optional, tag = "1")]
46    pub nominal_data_source: ::core::option::Option<NominalDataSource>,
47    #[prost(message, optional, tag = "2")]
48    pub update_mask: ::core::option::Option<
49        super::super::super::super::google::protobuf::FieldMask,
50    >,
51}
52#[derive(Clone, PartialEq, ::prost::Message)]
53pub struct UpdateNominalDataSourceResponse {
54    #[prost(message, optional, tag = "1")]
55    pub nominal_data_source: ::core::option::Option<NominalDataSource>,
56}
57#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
58#[repr(i32)]
59pub enum NominalDataSourceError {
60    Unspecified = 0,
61    InvalidRequest = 1,
62}
63impl NominalDataSourceError {
64    /// String value of the enum field names used in the ProtoBuf definition.
65    ///
66    /// The values are not transformed in any way and thus are considered stable
67    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
68    pub fn as_str_name(&self) -> &'static str {
69        match self {
70            Self::Unspecified => "NOMINAL_DATA_SOURCE_ERROR_UNSPECIFIED",
71            Self::InvalidRequest => "NOMINAL_DATA_SOURCE_ERROR_INVALID_REQUEST",
72        }
73    }
74    /// Creates an enum from field names used in the ProtoBuf definition.
75    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
76        match value {
77            "NOMINAL_DATA_SOURCE_ERROR_UNSPECIFIED" => Some(Self::Unspecified),
78            "NOMINAL_DATA_SOURCE_ERROR_INVALID_REQUEST" => Some(Self::InvalidRequest),
79            _ => None,
80        }
81    }
82}
83/// Generated client implementations.
84pub mod nominal_data_source_service_client {
85    #![allow(
86        unused_variables,
87        dead_code,
88        missing_docs,
89        clippy::wildcard_imports,
90        clippy::let_unit_value,
91    )]
92    use tonic::codegen::*;
93    use tonic::codegen::http::Uri;
94    #[derive(Debug, Clone)]
95    pub struct NominalDataSourceServiceClient<T> {
96        inner: tonic::client::Grpc<T>,
97    }
98    impl NominalDataSourceServiceClient<tonic::transport::Channel> {
99        /// Attempt to create a new client by connecting to a given endpoint.
100        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
101        where
102            D: TryInto<tonic::transport::Endpoint>,
103            D::Error: Into<StdError>,
104        {
105            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
106            Ok(Self::new(conn))
107        }
108    }
109    impl<T> NominalDataSourceServiceClient<T>
110    where
111        T: tonic::client::GrpcService<tonic::body::Body>,
112        T::Error: Into<StdError>,
113        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
114        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
115    {
116        pub fn new(inner: T) -> Self {
117            let inner = tonic::client::Grpc::new(inner);
118            Self { inner }
119        }
120        pub fn with_origin(inner: T, origin: Uri) -> Self {
121            let inner = tonic::client::Grpc::with_origin(inner, origin);
122            Self { inner }
123        }
124        pub fn with_interceptor<F>(
125            inner: T,
126            interceptor: F,
127        ) -> NominalDataSourceServiceClient<InterceptedService<T, F>>
128        where
129            F: tonic::service::Interceptor,
130            T::ResponseBody: Default,
131            T: tonic::codegen::Service<
132                http::Request<tonic::body::Body>,
133                Response = http::Response<
134                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
135                >,
136            >,
137            <T as tonic::codegen::Service<
138                http::Request<tonic::body::Body>,
139            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
140        {
141            NominalDataSourceServiceClient::new(
142                InterceptedService::new(inner, interceptor),
143            )
144        }
145        /// Compress requests with the given encoding.
146        ///
147        /// This requires the server to support it otherwise it might respond with an
148        /// error.
149        #[must_use]
150        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
151            self.inner = self.inner.send_compressed(encoding);
152            self
153        }
154        /// Enable decompressing responses.
155        #[must_use]
156        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
157            self.inner = self.inner.accept_compressed(encoding);
158            self
159        }
160        /// Limits the maximum size of a decoded message.
161        ///
162        /// Default: `4MB`
163        #[must_use]
164        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
165            self.inner = self.inner.max_decoding_message_size(limit);
166            self
167        }
168        /// Limits the maximum size of an encoded message.
169        ///
170        /// Default: `usize::MAX`
171        #[must_use]
172        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
173            self.inner = self.inner.max_encoding_message_size(limit);
174            self
175        }
176        #[deprecated]
177        pub async fn create_nominal_data_source(
178            &mut self,
179            request: impl tonic::IntoRequest<super::CreateNominalDataSourceRequest>,
180        ) -> std::result::Result<
181            tonic::Response<super::CreateNominalDataSourceResponse>,
182            tonic::Status,
183        > {
184            self.inner
185                .ready()
186                .await
187                .map_err(|e| {
188                    tonic::Status::unknown(
189                        format!("Service was not ready: {}", e.into()),
190                    )
191                })?;
192            let codec = tonic::codec::ProstCodec::default();
193            let path = http::uri::PathAndQuery::from_static(
194                "/nominal.storage.datasource.v2.NominalDataSourceService/CreateNominalDataSource",
195            );
196            let mut req = request.into_request();
197            req.extensions_mut()
198                .insert(
199                    GrpcMethod::new(
200                        "nominal.storage.datasource.v2.NominalDataSourceService",
201                        "CreateNominalDataSource",
202                    ),
203                );
204            self.inner.unary(req, path, codec).await
205        }
206        pub async fn batch_get_nominal_data_sources(
207            &mut self,
208            request: impl tonic::IntoRequest<super::BatchGetNominalDataSourcesRequest>,
209        ) -> std::result::Result<
210            tonic::Response<super::BatchGetNominalDataSourcesResponse>,
211            tonic::Status,
212        > {
213            self.inner
214                .ready()
215                .await
216                .map_err(|e| {
217                    tonic::Status::unknown(
218                        format!("Service was not ready: {}", e.into()),
219                    )
220                })?;
221            let codec = tonic::codec::ProstCodec::default();
222            let path = http::uri::PathAndQuery::from_static(
223                "/nominal.storage.datasource.v2.NominalDataSourceService/BatchGetNominalDataSources",
224            );
225            let mut req = request.into_request();
226            req.extensions_mut()
227                .insert(
228                    GrpcMethod::new(
229                        "nominal.storage.datasource.v2.NominalDataSourceService",
230                        "BatchGetNominalDataSources",
231                    ),
232                );
233            self.inner.unary(req, path, codec).await
234        }
235        pub async fn update_nominal_data_source(
236            &mut self,
237            request: impl tonic::IntoRequest<super::UpdateNominalDataSourceRequest>,
238        ) -> std::result::Result<
239            tonic::Response<super::UpdateNominalDataSourceResponse>,
240            tonic::Status,
241        > {
242            self.inner
243                .ready()
244                .await
245                .map_err(|e| {
246                    tonic::Status::unknown(
247                        format!("Service was not ready: {}", e.into()),
248                    )
249                })?;
250            let codec = tonic::codec::ProstCodec::default();
251            let path = http::uri::PathAndQuery::from_static(
252                "/nominal.storage.datasource.v2.NominalDataSourceService/UpdateNominalDataSource",
253            );
254            let mut req = request.into_request();
255            req.extensions_mut()
256                .insert(
257                    GrpcMethod::new(
258                        "nominal.storage.datasource.v2.NominalDataSourceService",
259                        "UpdateNominalDataSource",
260                    ),
261                );
262            self.inner.unary(req, path, codec).await
263        }
264    }
265}