Skip to main content

nominal_api_proto/proto/
nominal.internalnominaldatasource.v1.rs

1// This file is @generated by prost-build.
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct UpdateDataLastWrittenAtRequest {
4    #[prost(string, tag = "1")]
5    pub nominal_data_source_rid: ::prost::alloc::string::String,
6    #[prost(message, optional, tag = "2")]
7    pub data_last_written_at: ::core::option::Option<
8        super::super::super::google::protobuf::Timestamp,
9    >,
10}
11#[derive(Clone, Copy, PartialEq, ::prost::Message)]
12pub struct UpdateDataLastWrittenAtResponse {}
13#[derive(Clone, PartialEq, ::prost::Message)]
14pub struct CreateNominalDataSourceDatasetRequest {
15    #[prost(string, tag = "1")]
16    pub nominal_data_source_rid: ::prost::alloc::string::String,
17}
18#[derive(Clone, PartialEq, ::prost::Message)]
19pub struct CreateNominalDataSourceDatasetResponse {
20    #[prost(string, tag = "1")]
21    pub dataset_rid: ::prost::alloc::string::String,
22}
23#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
24#[repr(i32)]
25pub enum InternalNominalDataSourceError {
26    Unspecified = 0,
27    InvalidRequest = 1,
28}
29impl InternalNominalDataSourceError {
30    /// String value of the enum field names used in the ProtoBuf definition.
31    ///
32    /// The values are not transformed in any way and thus are considered stable
33    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
34    pub fn as_str_name(&self) -> &'static str {
35        match self {
36            Self::Unspecified => "INTERNAL_NOMINAL_DATA_SOURCE_ERROR_UNSPECIFIED",
37            Self::InvalidRequest => "INTERNAL_NOMINAL_DATA_SOURCE_ERROR_INVALID_REQUEST",
38        }
39    }
40    /// Creates an enum from field names used in the ProtoBuf definition.
41    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
42        match value {
43            "INTERNAL_NOMINAL_DATA_SOURCE_ERROR_UNSPECIFIED" => Some(Self::Unspecified),
44            "INTERNAL_NOMINAL_DATA_SOURCE_ERROR_INVALID_REQUEST" => {
45                Some(Self::InvalidRequest)
46            }
47            _ => None,
48        }
49    }
50}
51/// Generated client implementations.
52pub mod internal_nominal_data_source_service_client {
53    #![allow(
54        unused_variables,
55        dead_code,
56        missing_docs,
57        clippy::wildcard_imports,
58        clippy::let_unit_value,
59    )]
60    use tonic::codegen::*;
61    use tonic::codegen::http::Uri;
62    #[derive(Debug, Clone)]
63    pub struct InternalNominalDataSourceServiceClient<T> {
64        inner: tonic::client::Grpc<T>,
65    }
66    impl InternalNominalDataSourceServiceClient<tonic::transport::Channel> {
67        /// Attempt to create a new client by connecting to a given endpoint.
68        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
69        where
70            D: TryInto<tonic::transport::Endpoint>,
71            D::Error: Into<StdError>,
72        {
73            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
74            Ok(Self::new(conn))
75        }
76    }
77    impl<T> InternalNominalDataSourceServiceClient<T>
78    where
79        T: tonic::client::GrpcService<tonic::body::Body>,
80        T::Error: Into<StdError>,
81        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
82        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
83    {
84        pub fn new(inner: T) -> Self {
85            let inner = tonic::client::Grpc::new(inner);
86            Self { inner }
87        }
88        pub fn with_origin(inner: T, origin: Uri) -> Self {
89            let inner = tonic::client::Grpc::with_origin(inner, origin);
90            Self { inner }
91        }
92        pub fn with_interceptor<F>(
93            inner: T,
94            interceptor: F,
95        ) -> InternalNominalDataSourceServiceClient<InterceptedService<T, F>>
96        where
97            F: tonic::service::Interceptor,
98            T::ResponseBody: Default,
99            T: tonic::codegen::Service<
100                http::Request<tonic::body::Body>,
101                Response = http::Response<
102                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
103                >,
104            >,
105            <T as tonic::codegen::Service<
106                http::Request<tonic::body::Body>,
107            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
108        {
109            InternalNominalDataSourceServiceClient::new(
110                InterceptedService::new(inner, interceptor),
111            )
112        }
113        /// Compress requests with the given encoding.
114        ///
115        /// This requires the server to support it otherwise it might respond with an
116        /// error.
117        #[must_use]
118        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
119            self.inner = self.inner.send_compressed(encoding);
120            self
121        }
122        /// Enable decompressing responses.
123        #[must_use]
124        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
125            self.inner = self.inner.accept_compressed(encoding);
126            self
127        }
128        /// Limits the maximum size of a decoded message.
129        ///
130        /// Default: `4MB`
131        #[must_use]
132        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
133            self.inner = self.inner.max_decoding_message_size(limit);
134            self
135        }
136        /// Limits the maximum size of an encoded message.
137        ///
138        /// Default: `usize::MAX`
139        #[must_use]
140        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
141            self.inner = self.inner.max_encoding_message_size(limit);
142            self
143        }
144        pub async fn update_data_last_written_at(
145            &mut self,
146            request: impl tonic::IntoRequest<super::UpdateDataLastWrittenAtRequest>,
147        ) -> std::result::Result<
148            tonic::Response<super::UpdateDataLastWrittenAtResponse>,
149            tonic::Status,
150        > {
151            self.inner
152                .ready()
153                .await
154                .map_err(|e| {
155                    tonic::Status::unknown(
156                        format!("Service was not ready: {}", e.into()),
157                    )
158                })?;
159            let codec = tonic::codec::ProstCodec::default();
160            let path = http::uri::PathAndQuery::from_static(
161                "/nominal.internalnominaldatasource.v1.InternalNominalDataSourceService/UpdateDataLastWrittenAt",
162            );
163            let mut req = request.into_request();
164            req.extensions_mut()
165                .insert(
166                    GrpcMethod::new(
167                        "nominal.internalnominaldatasource.v1.InternalNominalDataSourceService",
168                        "UpdateDataLastWrittenAt",
169                    ),
170                );
171            self.inner.unary(req, path, codec).await
172        }
173        pub async fn create_nominal_data_source_dataset(
174            &mut self,
175            request: impl tonic::IntoRequest<
176                super::CreateNominalDataSourceDatasetRequest,
177            >,
178        ) -> std::result::Result<
179            tonic::Response<super::CreateNominalDataSourceDatasetResponse>,
180            tonic::Status,
181        > {
182            self.inner
183                .ready()
184                .await
185                .map_err(|e| {
186                    tonic::Status::unknown(
187                        format!("Service was not ready: {}", e.into()),
188                    )
189                })?;
190            let codec = tonic::codec::ProstCodec::default();
191            let path = http::uri::PathAndQuery::from_static(
192                "/nominal.internalnominaldatasource.v1.InternalNominalDataSourceService/CreateNominalDataSourceDataset",
193            );
194            let mut req = request.into_request();
195            req.extensions_mut()
196                .insert(
197                    GrpcMethod::new(
198                        "nominal.internalnominaldatasource.v1.InternalNominalDataSourceService",
199                        "CreateNominalDataSourceDataset",
200                    ),
201                );
202            self.inner.unary(req, path, codec).await
203        }
204    }
205}