Skip to main content

nominal_api_proto/proto/
nominal.dataexports.v1.rs

1// This file is @generated by prost-build.
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct ExportDefinition {
4    #[prost(message, optional, tag = "1")]
5    pub format: ::core::option::Option<ExportFileFormat>,
6    #[prost(enumeration = "ExportCompression", tag = "2")]
7    pub compression: i32,
8    #[prost(message, optional, tag = "3")]
9    pub start_time: ::core::option::Option<
10        super::super::super::google::protobuf::Timestamp,
11    >,
12    #[prost(message, optional, tag = "4")]
13    pub end_time: ::core::option::Option<
14        super::super::super::google::protobuf::Timestamp,
15    >,
16    #[prost(message, optional, tag = "5")]
17    pub resolution: ::core::option::Option<ExportResolution>,
18    #[prost(message, optional, tag = "7")]
19    pub context: ::core::option::Option<super::super::compute::v1::ComputeContext>,
20    #[prost(oneof = "export_definition::Channels", tags = "6")]
21    pub channels: ::core::option::Option<export_definition::Channels>,
22}
23/// Nested message and enum types in `ExportDefinition`.
24pub mod export_definition {
25    #[derive(Clone, PartialEq, ::prost::Oneof)]
26    pub enum Channels {
27        #[prost(message, tag = "6")]
28        TimeDomain(super::TimeDomainColumns),
29    }
30}
31#[derive(Clone, PartialEq, ::prost::Message)]
32pub struct ExportFileFormat {
33    #[prost(oneof = "export_file_format::Format", tags = "1, 2, 3")]
34    pub format: ::core::option::Option<export_file_format::Format>,
35}
36/// Nested message and enum types in `ExportFileFormat`.
37pub mod export_file_format {
38    #[derive(Clone, PartialEq, ::prost::Oneof)]
39    pub enum Format {
40        #[prost(message, tag = "1")]
41        Csv(super::CsvFormat),
42        #[prost(message, tag = "2")]
43        Arrow(super::ArrowFormat),
44        #[prost(message, tag = "3")]
45        Matfile(super::MatfileFormat),
46    }
47}
48#[derive(Clone, Copy, PartialEq, ::prost::Message)]
49pub struct CsvFormat {}
50#[derive(Clone, Copy, PartialEq, ::prost::Message)]
51pub struct ArrowFormat {}
52#[derive(Clone, PartialEq, ::prost::Message)]
53pub struct MatfileFormat {
54    #[prost(string, optional, tag = "1")]
55    pub struct_hierarchical_delimiter: ::core::option::Option<
56        ::prost::alloc::string::String,
57    >,
58}
59#[derive(Clone, Copy, PartialEq, ::prost::Message)]
60pub struct ExportResolution {
61    #[prost(oneof = "export_resolution::Resolution", tags = "1, 2, 3")]
62    pub resolution: ::core::option::Option<export_resolution::Resolution>,
63}
64/// Nested message and enum types in `ExportResolution`.
65pub mod export_resolution {
66    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
67    pub enum Resolution {
68        #[prost(message, tag = "1")]
69        Step(super::super::super::types::Duration),
70        #[prost(int32, tag = "2")]
71        BucketCount(i32),
72        #[prost(message, tag = "3")]
73        Full(super::FullResolution),
74    }
75}
76#[derive(Clone, Copy, PartialEq, ::prost::Message)]
77pub struct FullResolution {}
78#[derive(Clone, PartialEq, ::prost::Message)]
79pub struct TimeDomainColumns {
80    #[prost(message, optional, tag = "1")]
81    pub timestamp_format: ::core::option::Option<ExportTimestampFormat>,
82    #[prost(message, optional, tag = "2")]
83    pub gap_fill: ::core::option::Option<GapFill>,
84    #[prost(message, repeated, tag = "3")]
85    pub columns: ::prost::alloc::vec::Vec<ExportColumn>,
86}
87#[derive(Clone, PartialEq, ::prost::Message)]
88pub struct ExportColumn {
89    #[prost(string, tag = "1")]
90    pub name: ::prost::alloc::string::String,
91    #[prost(message, optional, tag = "2")]
92    pub series: ::core::option::Option<super::super::compute::v1::SeriesExpression>,
93}
94#[derive(Clone, Copy, PartialEq, ::prost::Message)]
95pub struct ExportTimestampFormat {
96    #[prost(oneof = "export_timestamp_format::Format", tags = "1, 2")]
97    pub format: ::core::option::Option<export_timestamp_format::Format>,
98}
99/// Nested message and enum types in `ExportTimestampFormat`.
100pub mod export_timestamp_format {
101    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
102    pub enum Format {
103        #[prost(message, tag = "1")]
104        Iso8601(super::Iso8601Timestamps),
105        #[prost(message, tag = "2")]
106        Relative(super::RelativeTimestamps),
107    }
108}
109#[derive(Clone, Copy, PartialEq, ::prost::Message)]
110pub struct Iso8601Timestamps {}
111#[derive(Clone, Copy, PartialEq, ::prost::Message)]
112pub struct RelativeTimestamps {
113    #[prost(message, optional, tag = "1")]
114    pub relative_to: ::core::option::Option<
115        super::super::super::google::protobuf::Timestamp,
116    >,
117    #[prost(enumeration = "super::super::types::time::TimeUnit", tag = "2")]
118    pub unit: i32,
119}
120#[derive(Clone, Copy, PartialEq, ::prost::Message)]
121pub struct GapFill {
122    #[prost(oneof = "gap_fill::GapFill", tags = "1, 2")]
123    pub gap_fill: ::core::option::Option<gap_fill::GapFill>,
124}
125/// Nested message and enum types in `GapFill`.
126pub mod gap_fill {
127    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
128    pub enum GapFill {
129        #[prost(message, tag = "1")]
130        LeaveEmpty(super::LeaveEmpty),
131        #[prost(message, tag = "2")]
132        ForwardFill(super::ForwardFill),
133    }
134}
135#[derive(Clone, Copy, PartialEq, ::prost::Message)]
136pub struct LeaveEmpty {}
137#[derive(Clone, Copy, PartialEq, ::prost::Message)]
138pub struct ForwardFill {
139    #[prost(message, optional, tag = "1")]
140    pub max_fill_duration: ::core::option::Option<super::super::types::Duration>,
141}
142#[derive(Clone, PartialEq, ::prost::Message)]
143pub struct CreateExportRequest {
144    #[prost(message, optional, tag = "1")]
145    pub definition: ::core::option::Option<ExportDefinition>,
146}
147#[derive(Clone, PartialEq, ::prost::Message)]
148pub struct CreateExportResponse {
149    #[prost(message, optional, tag = "1")]
150    pub export: ::core::option::Option<Export>,
151}
152#[derive(Clone, PartialEq, ::prost::Message)]
153pub struct Export {
154    #[prost(string, tag = "1")]
155    pub download_url: ::prost::alloc::string::String,
156    #[prost(int64, tag = "2")]
157    pub size_bytes: i64,
158    #[prost(message, optional, tag = "3")]
159    pub download_url_expire_time: ::core::option::Option<
160        super::super::super::google::protobuf::Timestamp,
161    >,
162}
163#[derive(Clone, PartialEq, ::prost::Message)]
164pub struct StreamExportRequest {
165    #[prost(message, optional, tag = "1")]
166    pub definition: ::core::option::Option<ExportDefinition>,
167}
168#[derive(Clone, PartialEq, ::prost::Message)]
169pub struct StreamExportResponse {
170    #[prost(bytes = "vec", tag = "1")]
171    pub data: ::prost::alloc::vec::Vec<u8>,
172}
173#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
174#[repr(i32)]
175pub enum ExportCompression {
176    Unspecified = 0,
177    Gzip = 1,
178    Zip = 2,
179}
180impl ExportCompression {
181    /// String value of the enum field names used in the ProtoBuf definition.
182    ///
183    /// The values are not transformed in any way and thus are considered stable
184    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
185    pub fn as_str_name(&self) -> &'static str {
186        match self {
187            Self::Unspecified => "EXPORT_COMPRESSION_UNSPECIFIED",
188            Self::Gzip => "EXPORT_COMPRESSION_GZIP",
189            Self::Zip => "EXPORT_COMPRESSION_ZIP",
190        }
191    }
192    /// Creates an enum from field names used in the ProtoBuf definition.
193    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
194        match value {
195            "EXPORT_COMPRESSION_UNSPECIFIED" => Some(Self::Unspecified),
196            "EXPORT_COMPRESSION_GZIP" => Some(Self::Gzip),
197            "EXPORT_COMPRESSION_ZIP" => Some(Self::Zip),
198            _ => None,
199        }
200    }
201}
202/// Generated client implementations.
203pub mod data_export_service_client {
204    #![allow(
205        unused_variables,
206        dead_code,
207        missing_docs,
208        clippy::wildcard_imports,
209        clippy::let_unit_value,
210    )]
211    use tonic::codegen::*;
212    use tonic::codegen::http::Uri;
213    #[derive(Debug, Clone)]
214    pub struct DataExportServiceClient<T> {
215        inner: tonic::client::Grpc<T>,
216    }
217    impl DataExportServiceClient<tonic::transport::Channel> {
218        /// Attempt to create a new client by connecting to a given endpoint.
219        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
220        where
221            D: TryInto<tonic::transport::Endpoint>,
222            D::Error: Into<StdError>,
223        {
224            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
225            Ok(Self::new(conn))
226        }
227    }
228    impl<T> DataExportServiceClient<T>
229    where
230        T: tonic::client::GrpcService<tonic::body::Body>,
231        T::Error: Into<StdError>,
232        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
233        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
234    {
235        pub fn new(inner: T) -> Self {
236            let inner = tonic::client::Grpc::new(inner);
237            Self { inner }
238        }
239        pub fn with_origin(inner: T, origin: Uri) -> Self {
240            let inner = tonic::client::Grpc::with_origin(inner, origin);
241            Self { inner }
242        }
243        pub fn with_interceptor<F>(
244            inner: T,
245            interceptor: F,
246        ) -> DataExportServiceClient<InterceptedService<T, F>>
247        where
248            F: tonic::service::Interceptor,
249            T::ResponseBody: Default,
250            T: tonic::codegen::Service<
251                http::Request<tonic::body::Body>,
252                Response = http::Response<
253                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
254                >,
255            >,
256            <T as tonic::codegen::Service<
257                http::Request<tonic::body::Body>,
258            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
259        {
260            DataExportServiceClient::new(InterceptedService::new(inner, interceptor))
261        }
262        /// Compress requests with the given encoding.
263        ///
264        /// This requires the server to support it otherwise it might respond with an
265        /// error.
266        #[must_use]
267        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
268            self.inner = self.inner.send_compressed(encoding);
269            self
270        }
271        /// Enable decompressing responses.
272        #[must_use]
273        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
274            self.inner = self.inner.accept_compressed(encoding);
275            self
276        }
277        /// Limits the maximum size of a decoded message.
278        ///
279        /// Default: `4MB`
280        #[must_use]
281        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
282            self.inner = self.inner.max_decoding_message_size(limit);
283            self
284        }
285        /// Limits the maximum size of an encoded message.
286        ///
287        /// Default: `usize::MAX`
288        #[must_use]
289        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
290            self.inner = self.inner.max_encoding_message_size(limit);
291            self
292        }
293        pub async fn create_export(
294            &mut self,
295            request: impl tonic::IntoRequest<super::CreateExportRequest>,
296        ) -> std::result::Result<
297            tonic::Response<super::CreateExportResponse>,
298            tonic::Status,
299        > {
300            self.inner
301                .ready()
302                .await
303                .map_err(|e| {
304                    tonic::Status::unknown(
305                        format!("Service was not ready: {}", e.into()),
306                    )
307                })?;
308            let codec = tonic::codec::ProstCodec::default();
309            let path = http::uri::PathAndQuery::from_static(
310                "/nominal.dataexports.v1.DataExportService/CreateExport",
311            );
312            let mut req = request.into_request();
313            req.extensions_mut()
314                .insert(
315                    GrpcMethod::new(
316                        "nominal.dataexports.v1.DataExportService",
317                        "CreateExport",
318                    ),
319                );
320            self.inner.unary(req, path, codec).await
321        }
322        pub async fn stream_export(
323            &mut self,
324            request: impl tonic::IntoRequest<super::StreamExportRequest>,
325        ) -> std::result::Result<
326            tonic::Response<tonic::codec::Streaming<super::StreamExportResponse>>,
327            tonic::Status,
328        > {
329            self.inner
330                .ready()
331                .await
332                .map_err(|e| {
333                    tonic::Status::unknown(
334                        format!("Service was not ready: {}", e.into()),
335                    )
336                })?;
337            let codec = tonic::codec::ProstCodec::default();
338            let path = http::uri::PathAndQuery::from_static(
339                "/nominal.dataexports.v1.DataExportService/StreamExport",
340            );
341            let mut req = request.into_request();
342            req.extensions_mut()
343                .insert(
344                    GrpcMethod::new(
345                        "nominal.dataexports.v1.DataExportService",
346                        "StreamExport",
347                    ),
348                );
349            self.inner.server_streaming(req, path, codec).await
350        }
351    }
352}