#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Instrument {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub symbol: ::prost::alloc::string::String,
#[prost(string, tag="3")]
pub code: ::prost::alloc::string::String,
#[prost(string, tag="4")]
pub display_name: ::prost::alloc::string::String,
#[prost(enumeration="ProductType", tag="5")]
pub product_type: i32,
#[prost(string, tag="6")]
pub prev_close: ::prost::alloc::string::String,
#[prost(string, tag="7")]
pub last_price: ::prost::alloc::string::String,
#[prost(bool, tag="8")]
pub tradable: bool,
#[prost(oneof="instrument::Details", tags="20, 21, 22")]
pub details: ::core::option::Option<instrument::Details>,
}
pub mod instrument {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Details {
#[prost(message, tag="20")]
Etf(super::EtfDetails),
#[prost(message, tag="21")]
Futures(super::FuturesDetails),
#[prost(message, tag="22")]
Stock(super::StockDetails),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EtfDetails {
#[prost(string, tag="1")]
pub prev_nav: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub last_inav: ::prost::alloc::string::String,
#[prost(int64, tag="3")]
pub creation_unit: i64,
#[prost(int64, tag="4")]
pub tick_size: i64,
#[prost(float, tag="5")]
pub leverage: f32,
#[prost(bool, tag="6")]
pub short_sellable: bool,
#[prost(int64, tag="7")]
pub listed_quantity: i64,
#[prost(bool, tag="8")]
pub cash_creditable: bool,
#[prost(int64, tag="9")]
pub cash_creation_amount: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FuturesDetails {
#[prost(string, tag="1")]
pub underlying_symbol: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub underlying_name: ::prost::alloc::string::String,
#[prost(string, tag="3")]
pub expiry_date: ::prost::alloc::string::String,
#[prost(double, tag="4")]
pub multiplier: f64,
#[prost(double, tag="5")]
pub tick_size: f64,
#[prost(int64, tag="6")]
pub tick_value: i64,
#[prost(string, tag="7")]
pub last_trading_date: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StockDetails {
#[prost(enumeration="super::stock::MarketType", tag="1")]
pub market_type: i32,
#[prost(int64, tag="2")]
pub listed_shares: i64,
#[prost(int64, tag="3")]
pub tick_size: i64,
#[prost(bool, tag="4")]
pub short_sellable: bool,
#[prost(bool, tag="5")]
pub margin_tradable: bool,
#[prost(string, tag="6")]
pub sector_code: ::prost::alloc::string::String,
#[prost(string, tag="7")]
pub sector_name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetInstrumentRequest {
#[prost(string, tag="1")]
pub instrument: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchGetInstrumentsRequest {
#[prost(string, repeated, tag="1")]
pub instruments: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchGetInstrumentsResponse {
#[prost(message, repeated, tag="1")]
pub instruments: ::prost::alloc::vec::Vec<Instrument>,
#[prost(string, repeated, tag="2")]
pub not_found: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListInstrumentsRequest {
#[prost(uint32, optional, tag="1")]
pub page_size: ::core::option::Option<u32>,
#[prost(string, optional, tag="2")]
pub page_token: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, tag="3")]
pub filter: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListInstrumentsResponse {
#[prost(message, repeated, tag="1")]
pub instruments: ::prost::alloc::vec::Vec<Instrument>,
#[prost(string, tag="2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ProductType {
Unspecified = 0,
Etf = 1,
Futures = 2,
Stock = 3,
}
impl ProductType {
pub fn as_str_name(&self) -> &'static str {
match self {
ProductType::Unspecified => "PRODUCT_TYPE_UNSPECIFIED",
ProductType::Etf => "PRODUCT_TYPE_ETF",
ProductType::Futures => "PRODUCT_TYPE_FUTURES",
ProductType::Stock => "PRODUCT_TYPE_STOCK",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"PRODUCT_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"PRODUCT_TYPE_ETF" => Some(Self::Etf),
"PRODUCT_TYPE_FUTURES" => Some(Self::Futures),
"PRODUCT_TYPE_STOCK" => Some(Self::Stock),
_ => None,
}
}
}
include!("master_sync.v1.instrument.tonic.rs");
include!("master_sync.v1.instrument.serde.rs");