#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ExchangesRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExchangesResponse {
#[prost(message, repeated, tag = "1")]
pub exchanges: ::prost::alloc::vec::Vec<Exchange>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct AssetsRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AssetsResponse {
#[prost(message, repeated, tag = "1")]
pub assets: ::prost::alloc::vec::Vec<Asset>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetAssetRequest {
#[prost(string, tag = "1")]
pub symbol: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub account_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetAssetResponse {
#[prost(string, tag = "1")]
pub board: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub ticker: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub mic: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub isin: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub r#type: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub name: ::prost::alloc::string::String,
#[prost(int32, tag = "10")]
pub decimals: i32,
#[prost(int64, tag = "11")]
pub min_step: i64,
#[prost(message, optional, tag = "9")]
pub lot_size: ::core::option::Option<
super::super::super::super::google::r#type::Decimal,
>,
#[prost(message, optional, tag = "12")]
pub expiration_date: ::core::option::Option<
super::super::super::super::google::r#type::Date,
>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetAssetParamsRequest {
#[prost(string, tag = "1")]
pub symbol: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub account_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetAssetParamsResponse {
#[prost(string, tag = "1")]
pub symbol: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub account_id: ::prost::alloc::string::String,
#[prost(bool, tag = "3")]
pub tradeable: bool,
#[prost(message, optional, tag = "4")]
pub longable: ::core::option::Option<Longable>,
#[prost(message, optional, tag = "5")]
pub shortable: ::core::option::Option<Shortable>,
#[prost(message, optional, tag = "6")]
pub long_risk_rate: ::core::option::Option<
super::super::super::super::google::r#type::Decimal,
>,
#[prost(message, optional, tag = "7")]
pub long_collateral: ::core::option::Option<
super::super::super::super::google::r#type::Money,
>,
#[prost(message, optional, tag = "8")]
pub short_risk_rate: ::core::option::Option<
super::super::super::super::google::r#type::Decimal,
>,
#[prost(message, optional, tag = "9")]
pub short_collateral: ::core::option::Option<
super::super::super::super::google::r#type::Money,
>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct OptionsChainRequest {
#[prost(string, tag = "1")]
pub underlying_symbol: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OptionsChainResponse {
#[prost(string, tag = "1")]
pub symbol: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub options: ::prost::alloc::vec::Vec<Option>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ScheduleRequest {
#[prost(string, tag = "1")]
pub symbol: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ScheduleResponse {
#[prost(string, tag = "1")]
pub symbol: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub sessions: ::prost::alloc::vec::Vec<schedule_response::Sessions>,
}
pub mod schedule_response {
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Sessions {
#[prost(string, tag = "1")]
pub r#type: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub interval: ::core::option::Option<
super::super::super::super::super::google::r#type::Interval,
>,
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ClockRequest {}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ClockResponse {
#[prost(message, optional, tag = "1")]
pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Exchange {
#[prost(string, tag = "1")]
pub mic: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Asset {
#[prost(string, tag = "1")]
pub symbol: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub ticker: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub mic: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub isin: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub r#type: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Option {
#[prost(string, tag = "1")]
pub symbol: ::prost::alloc::string::String,
#[prost(enumeration = "option::Type", tag = "2")]
pub r#type: i32,
#[prost(message, optional, tag = "4")]
pub contract_size: ::core::option::Option<
super::super::super::super::google::r#type::Decimal,
>,
#[prost(message, optional, tag = "5")]
pub trade_first_day: ::core::option::Option<
super::super::super::super::google::r#type::Date,
>,
#[prost(message, optional, tag = "6")]
pub trade_last_day: ::core::option::Option<
super::super::super::super::google::r#type::Date,
>,
#[prost(message, optional, tag = "7")]
pub strike: ::core::option::Option<
super::super::super::super::google::r#type::Decimal,
>,
#[prost(message, optional, tag = "9")]
pub multiplier: ::core::option::Option<
super::super::super::super::google::r#type::Decimal,
>,
}
pub mod option {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Type {
Unspecified = 0,
Call = 1,
Put = 2,
}
impl Type {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "TYPE_UNSPECIFIED",
Self::Call => "TYPE_CALL",
Self::Put => "TYPE_PUT",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"TYPE_CALL" => Some(Self::Call),
"TYPE_PUT" => Some(Self::Put),
_ => None,
}
}
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Longable {
#[prost(enumeration = "longable::Status", tag = "1")]
pub value: i32,
#[prost(int32, tag = "2")]
pub halted_days: i32,
}
pub mod longable {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Status {
NotAvailable = 0,
Available = 1,
AccountNotApproved = 2,
}
impl Status {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::NotAvailable => "NOT_AVAILABLE",
Self::Available => "AVAILABLE",
Self::AccountNotApproved => "ACCOUNT_NOT_APPROVED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"NOT_AVAILABLE" => Some(Self::NotAvailable),
"AVAILABLE" => Some(Self::Available),
"ACCOUNT_NOT_APPROVED" => Some(Self::AccountNotApproved),
_ => None,
}
}
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Shortable {
#[prost(enumeration = "shortable::Status", tag = "1")]
pub value: i32,
#[prost(int32, tag = "2")]
pub halted_days: i32,
}
pub mod shortable {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Status {
NotAvailable = 0,
Available = 1,
Htb = 2,
AccountNotApproved = 3,
AvailableStrategy = 4,
}
impl Status {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::NotAvailable => "NOT_AVAILABLE",
Self::Available => "AVAILABLE",
Self::Htb => "HTB",
Self::AccountNotApproved => "ACCOUNT_NOT_APPROVED",
Self::AvailableStrategy => "AVAILABLE_STRATEGY",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"NOT_AVAILABLE" => Some(Self::NotAvailable),
"AVAILABLE" => Some(Self::Available),
"HTB" => Some(Self::Htb),
"ACCOUNT_NOT_APPROVED" => Some(Self::AccountNotApproved),
"AVAILABLE_STRATEGY" => Some(Self::AvailableStrategy),
_ => None,
}
}
}
}
pub mod assets_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 AssetsServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl AssetsServiceClient<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> AssetsServiceClient<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,
) -> AssetsServiceClient<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,
{
AssetsServiceClient::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 exchanges(
&mut self,
request: impl tonic::IntoRequest<super::ExchangesRequest>,
) -> std::result::Result<
tonic::Response<super::ExchangesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/grpc.tradeapi.v1.assets.AssetsService/Exchanges",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("grpc.tradeapi.v1.assets.AssetsService", "Exchanges"),
);
self.inner.unary(req, path, codec).await
}
pub async fn assets(
&mut self,
request: impl tonic::IntoRequest<super::AssetsRequest>,
) -> std::result::Result<tonic::Response<super::AssetsResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/grpc.tradeapi.v1.assets.AssetsService/Assets",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("grpc.tradeapi.v1.assets.AssetsService", "Assets"),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_asset(
&mut self,
request: impl tonic::IntoRequest<super::GetAssetRequest>,
) -> std::result::Result<
tonic::Response<super::GetAssetResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/grpc.tradeapi.v1.assets.AssetsService/GetAsset",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("grpc.tradeapi.v1.assets.AssetsService", "GetAsset"),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_asset_params(
&mut self,
request: impl tonic::IntoRequest<super::GetAssetParamsRequest>,
) -> std::result::Result<
tonic::Response<super::GetAssetParamsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/grpc.tradeapi.v1.assets.AssetsService/GetAssetParams",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"grpc.tradeapi.v1.assets.AssetsService",
"GetAssetParams",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn options_chain(
&mut self,
request: impl tonic::IntoRequest<super::OptionsChainRequest>,
) -> std::result::Result<
tonic::Response<super::OptionsChainResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/grpc.tradeapi.v1.assets.AssetsService/OptionsChain",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"grpc.tradeapi.v1.assets.AssetsService",
"OptionsChain",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn schedule(
&mut self,
request: impl tonic::IntoRequest<super::ScheduleRequest>,
) -> std::result::Result<
tonic::Response<super::ScheduleResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/grpc.tradeapi.v1.assets.AssetsService/Schedule",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("grpc.tradeapi.v1.assets.AssetsService", "Schedule"),
);
self.inner.unary(req, path, codec).await
}
pub async fn clock(
&mut self,
request: impl tonic::IntoRequest<super::ClockRequest>,
) -> std::result::Result<tonic::Response<super::ClockResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/grpc.tradeapi.v1.assets.AssetsService/Clock",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("grpc.tradeapi.v1.assets.AssetsService", "Clock"),
);
self.inner.unary(req, path, codec).await
}
}
}