#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExportDefinition {
#[prost(message, optional, tag = "1")]
pub format: ::core::option::Option<ExportFileFormat>,
#[prost(enumeration = "ExportCompression", tag = "2")]
pub compression: i32,
#[prost(message, optional, tag = "3")]
pub start_time: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(message, optional, tag = "4")]
pub end_time: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(message, optional, tag = "5")]
pub resolution: ::core::option::Option<ExportResolution>,
#[prost(message, optional, tag = "7")]
pub context: ::core::option::Option<super::super::compute::v1::ComputeContext>,
#[prost(oneof = "export_definition::Channels", tags = "6")]
pub channels: ::core::option::Option<export_definition::Channels>,
}
pub mod export_definition {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Channels {
#[prost(message, tag = "6")]
TimeDomain(super::TimeDomainColumns),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExportFileFormat {
#[prost(oneof = "export_file_format::Format", tags = "1, 2, 3")]
pub format: ::core::option::Option<export_file_format::Format>,
}
pub mod export_file_format {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Format {
#[prost(message, tag = "1")]
Csv(super::CsvFormat),
#[prost(message, tag = "2")]
Arrow(super::ArrowFormat),
#[prost(message, tag = "3")]
Matfile(super::MatfileFormat),
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct CsvFormat {}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ArrowFormat {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MatfileFormat {
#[prost(string, optional, tag = "1")]
pub struct_hierarchical_delimiter: ::core::option::Option<
::prost::alloc::string::String,
>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ExportResolution {
#[prost(oneof = "export_resolution::Resolution", tags = "1, 2, 3")]
pub resolution: ::core::option::Option<export_resolution::Resolution>,
}
pub mod export_resolution {
#[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
pub enum Resolution {
#[prost(message, tag = "1")]
Step(super::super::super::types::Duration),
#[prost(int32, tag = "2")]
BucketCount(i32),
#[prost(message, tag = "3")]
Full(super::FullResolution),
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct FullResolution {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TimeDomainColumns {
#[prost(message, optional, tag = "1")]
pub timestamp_format: ::core::option::Option<ExportTimestampFormat>,
#[prost(message, optional, tag = "2")]
pub gap_fill: ::core::option::Option<GapFill>,
#[prost(message, repeated, tag = "3")]
pub columns: ::prost::alloc::vec::Vec<ExportColumn>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExportColumn {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub series: ::core::option::Option<super::super::compute::v1::SeriesExpression>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ExportTimestampFormat {
#[prost(oneof = "export_timestamp_format::Format", tags = "1, 2")]
pub format: ::core::option::Option<export_timestamp_format::Format>,
}
pub mod export_timestamp_format {
#[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
pub enum Format {
#[prost(message, tag = "1")]
Iso8601(super::Iso8601Timestamps),
#[prost(message, tag = "2")]
Relative(super::RelativeTimestamps),
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Iso8601Timestamps {}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct RelativeTimestamps {
#[prost(message, optional, tag = "1")]
pub relative_to: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(enumeration = "super::super::types::time::TimeUnit", tag = "2")]
pub unit: i32,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct GapFill {
#[prost(oneof = "gap_fill::GapFill", tags = "1, 2")]
pub gap_fill: ::core::option::Option<gap_fill::GapFill>,
}
pub mod gap_fill {
#[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
pub enum GapFill {
#[prost(message, tag = "1")]
LeaveEmpty(super::LeaveEmpty),
#[prost(message, tag = "2")]
ForwardFill(super::ForwardFill),
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct LeaveEmpty {}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ForwardFill {
#[prost(message, optional, tag = "1")]
pub max_fill_duration: ::core::option::Option<super::super::types::Duration>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateExportRequest {
#[prost(message, optional, tag = "1")]
pub definition: ::core::option::Option<ExportDefinition>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateExportResponse {
#[prost(message, optional, tag = "1")]
pub export: ::core::option::Option<Export>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Export {
#[prost(string, tag = "1")]
pub download_url: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub size_bytes: i64,
#[prost(message, optional, tag = "3")]
pub download_url_expire_time: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamExportRequest {
#[prost(message, optional, tag = "1")]
pub definition: ::core::option::Option<ExportDefinition>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamExportResponse {
#[prost(bytes = "vec", tag = "1")]
pub data: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ExportCompression {
Unspecified = 0,
Gzip = 1,
Zip = 2,
}
impl ExportCompression {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "EXPORT_COMPRESSION_UNSPECIFIED",
Self::Gzip => "EXPORT_COMPRESSION_GZIP",
Self::Zip => "EXPORT_COMPRESSION_ZIP",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"EXPORT_COMPRESSION_UNSPECIFIED" => Some(Self::Unspecified),
"EXPORT_COMPRESSION_GZIP" => Some(Self::Gzip),
"EXPORT_COMPRESSION_ZIP" => Some(Self::Zip),
_ => None,
}
}
}
pub mod data_export_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct DataExportServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl DataExportServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> DataExportServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> DataExportServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
DataExportServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn create_export(
&mut self,
request: impl tonic::IntoRequest<super::CreateExportRequest>,
) -> std::result::Result<
tonic::Response<super::CreateExportResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.dataexports.v1.DataExportService/CreateExport",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.dataexports.v1.DataExportService",
"CreateExport",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn stream_export(
&mut self,
request: impl tonic::IntoRequest<super::StreamExportRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::StreamExportResponse>>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.dataexports.v1.DataExportService/StreamExport",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.dataexports.v1.DataExportService",
"StreamExport",
),
);
self.inner.server_streaming(req, path, codec).await
}
}
}