#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DataShape {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub r#type: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NumpyMultiDataset {
#[prost(message, optional, tag = "1")]
pub data: ::core::option::Option<NumpyDataset>,
#[prost(map = "string, int32", tag = "2")]
pub start_index: ::std::collections::HashMap<::prost::alloc::string::String, i32>,
#[prost(map = "string, int32", tag = "3")]
pub lengths: ::std::collections::HashMap<::prost::alloc::string::String, i32>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NumpyDataset {
#[prost(string, repeated, tag = "1")]
pub column_types: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "2")]
pub column_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(bytes = "vec", repeated, tag = "3")]
pub column_data: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
#[prost(int32, tag = "4")]
pub length: i32,
#[prost(message, repeated, tag = "5")]
pub data_shapes: ::prost::alloc::vec::Vec<DataShape>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateRequest {
#[prost(string, tag = "1")]
pub key: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub data_shapes: ::prost::alloc::vec::Vec<DataShape>,
#[prost(string, tag = "3")]
pub row_type: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MultiCreateRequest {
#[prost(message, repeated, tag = "1")]
pub requests: ::prost::alloc::vec::Vec<CreateRequest>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MultiQueryRequest {
#[prost(message, repeated, tag = "1")]
pub requests: ::prost::alloc::vec::Vec<QueryRequest>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryRequest {
#[prost(bool, tag = "1")]
pub is_sql_statement: bool,
#[prost(string, tag = "2")]
pub sql_statement: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub destination: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub key_category: ::prost::alloc::string::String,
#[prost(int64, tag = "5")]
pub epoch_start: i64,
#[prost(int64, tag = "6")]
pub epoch_start_nanos: i64,
#[prost(int64, tag = "7")]
pub epoch_end: i64,
#[prost(int64, tag = "8")]
pub epoch_end_nanos: i64,
#[prost(int32, tag = "9")]
pub limit_record_count: i32,
#[prost(bool, tag = "10")]
pub limit_from_start: bool,
#[prost(string, repeated, tag = "11")]
pub columns: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "12")]
pub functions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MultiQueryResponse {
#[prost(message, repeated, tag = "1")]
pub responses: ::prost::alloc::vec::Vec<QueryResponse>,
#[prost(string, tag = "2")]
pub version: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub timezone: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryResponse {
#[prost(message, optional, tag = "1")]
pub result: ::core::option::Option<NumpyMultiDataset>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MultiWriteRequest {
#[prost(message, repeated, tag = "1")]
pub requests: ::prost::alloc::vec::Vec<WriteRequest>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WriteRequest {
#[prost(message, optional, tag = "1")]
pub data: ::core::option::Option<NumpyMultiDataset>,
#[prost(bool, tag = "2")]
pub is_variable_length: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MultiServerResponse {
#[prost(message, repeated, tag = "1")]
pub responses: ::prost::alloc::vec::Vec<ServerResponse>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ServerResponse {
#[prost(string, tag = "1")]
pub error: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub version: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MultiKeyRequest {
#[prost(message, repeated, tag = "1")]
pub requests: ::prost::alloc::vec::Vec<KeyRequest>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct KeyRequest {
#[prost(string, tag = "1")]
pub key: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListSymbolsRequest {
#[prost(enumeration = "list_symbols_request::Format", tag = "1")]
pub format: i32,
}
pub mod list_symbols_request {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Format {
Symbol = 0,
TimeBucketKey = 1,
}
impl Format {
pub fn as_str_name(&self) -> &'static str {
match self {
Format::Symbol => "SYMBOL",
Format::TimeBucketKey => "TIME_BUCKET_KEY",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SYMBOL" => Some(Self::Symbol),
"TIME_BUCKET_KEY" => Some(Self::TimeBucketKey),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListSymbolsResponse {
#[prost(string, repeated, tag = "1")]
pub results: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ServerVersionRequest {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ServerVersionResponse {
#[prost(string, tag = "1")]
pub version: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum DataType {
Unknown = 0,
Float32 = 1,
Int32 = 2,
Float64 = 3,
Int64 = 4,
Epoch = 5,
Byte = 6,
Bool = 7,
None = 8,
String = 9,
Int16 = 10,
Uint8 = 11,
Uint16 = 12,
Uint32 = 13,
Uint64 = 14,
String16 = 15,
}
impl DataType {
pub fn as_str_name(&self) -> &'static str {
match self {
DataType::Unknown => "UNKNOWN",
DataType::Float32 => "FLOAT32",
DataType::Int32 => "INT32",
DataType::Float64 => "FLOAT64",
DataType::Int64 => "INT64",
DataType::Epoch => "EPOCH",
DataType::Byte => "BYTE",
DataType::Bool => "BOOL",
DataType::None => "NONE",
DataType::String => "STRING",
DataType::Int16 => "INT16",
DataType::Uint8 => "UINT8",
DataType::Uint16 => "UINT16",
DataType::Uint32 => "UINT32",
DataType::Uint64 => "UINT64",
DataType::String16 => "STRING16",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN" => Some(Self::Unknown),
"FLOAT32" => Some(Self::Float32),
"INT32" => Some(Self::Int32),
"FLOAT64" => Some(Self::Float64),
"INT64" => Some(Self::Int64),
"EPOCH" => Some(Self::Epoch),
"BYTE" => Some(Self::Byte),
"BOOL" => Some(Self::Bool),
"NONE" => Some(Self::None),
"STRING" => Some(Self::String),
"INT16" => Some(Self::Int16),
"UINT8" => Some(Self::Uint8),
"UINT16" => Some(Self::Uint16),
"UINT32" => Some(Self::Uint32),
"UINT64" => Some(Self::Uint64),
"STRING16" => Some(Self::String16),
_ => None,
}
}
}
pub mod marketstore_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct MarketstoreClient<T> {
inner: tonic::client::Grpc<T>,
}
impl MarketstoreClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> MarketstoreClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + 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,
) -> MarketstoreClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
MarketstoreClient::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
}
pub async fn query(
&mut self,
request: impl tonic::IntoRequest<super::MultiQueryRequest>,
) -> Result<tonic::Response<super::MultiQueryResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/proto.Marketstore/Query");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn create(
&mut self,
request: impl tonic::IntoRequest<super::MultiCreateRequest>,
) -> Result<tonic::Response<super::MultiServerResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/proto.Marketstore/Create");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn write(
&mut self,
request: impl tonic::IntoRequest<super::MultiWriteRequest>,
) -> Result<tonic::Response<super::MultiServerResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/proto.Marketstore/Write");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn destroy(
&mut self,
request: impl tonic::IntoRequest<super::MultiKeyRequest>,
) -> Result<tonic::Response<super::MultiServerResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.Marketstore/Destroy",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn list_symbols(
&mut self,
request: impl tonic::IntoRequest<super::ListSymbolsRequest>,
) -> Result<tonic::Response<super::ListSymbolsResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.Marketstore/ListSymbols",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn server_version(
&mut self,
request: impl tonic::IntoRequest<super::ServerVersionRequest>,
) -> Result<tonic::Response<super::ServerVersionResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.Marketstore/ServerVersion",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}