#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MoneyValue {
#[prost(string, tag = "1")]
pub currency: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub units: i64,
#[prost(int32, tag = "3")]
pub nano: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Quotation {
#[prost(int64, tag = "1")]
pub units: i64,
#[prost(int32, tag = "2")]
pub nano: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Ping {
#[prost(message, optional, tag = "1")]
pub time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "2")]
pub stream_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Page {
#[prost(int32, tag = "1")]
pub limit: i32,
#[prost(int32, tag = "2")]
pub page_number: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PageResponse {
#[prost(int32, tag = "1")]
pub limit: i32,
#[prost(int32, tag = "2")]
pub page_number: i32,
#[prost(int32, tag = "3")]
pub total_count: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResponseMetadata {
#[prost(string, tag = "42")]
pub tracking_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "43")]
pub server_time: ::core::option::Option<::prost_types::Timestamp>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BrandData {
#[prost(string, tag = "1")]
pub logo_name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub logo_base_color: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub text_color: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum InstrumentType {
Unspecified = 0,
Bond = 1,
Share = 2,
Currency = 3,
Etf = 4,
Futures = 5,
Sp = 6,
Option = 7,
ClearingCertificate = 8,
Index = 9,
Commodity = 10,
}
impl InstrumentType {
pub fn as_str_name(&self) -> &'static str {
match self {
InstrumentType::Unspecified => "INSTRUMENT_TYPE_UNSPECIFIED",
InstrumentType::Bond => "INSTRUMENT_TYPE_BOND",
InstrumentType::Share => "INSTRUMENT_TYPE_SHARE",
InstrumentType::Currency => "INSTRUMENT_TYPE_CURRENCY",
InstrumentType::Etf => "INSTRUMENT_TYPE_ETF",
InstrumentType::Futures => "INSTRUMENT_TYPE_FUTURES",
InstrumentType::Sp => "INSTRUMENT_TYPE_SP",
InstrumentType::Option => "INSTRUMENT_TYPE_OPTION",
InstrumentType::ClearingCertificate => "INSTRUMENT_TYPE_CLEARING_CERTIFICATE",
InstrumentType::Index => "INSTRUMENT_TYPE_INDEX",
InstrumentType::Commodity => "INSTRUMENT_TYPE_COMMODITY",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"INSTRUMENT_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"INSTRUMENT_TYPE_BOND" => Some(Self::Bond),
"INSTRUMENT_TYPE_SHARE" => Some(Self::Share),
"INSTRUMENT_TYPE_CURRENCY" => Some(Self::Currency),
"INSTRUMENT_TYPE_ETF" => Some(Self::Etf),
"INSTRUMENT_TYPE_FUTURES" => Some(Self::Futures),
"INSTRUMENT_TYPE_SP" => Some(Self::Sp),
"INSTRUMENT_TYPE_OPTION" => Some(Self::Option),
"INSTRUMENT_TYPE_CLEARING_CERTIFICATE" => Some(Self::ClearingCertificate),
"INSTRUMENT_TYPE_INDEX" => Some(Self::Index),
"INSTRUMENT_TYPE_COMMODITY" => Some(Self::Commodity),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SecurityTradingStatus {
Unspecified = 0,
NotAvailableForTrading = 1,
OpeningPeriod = 2,
ClosingPeriod = 3,
BreakInTrading = 4,
NormalTrading = 5,
ClosingAuction = 6,
DarkPoolAuction = 7,
DiscreteAuction = 8,
OpeningAuctionPeriod = 9,
TradingAtClosingAuctionPrice = 10,
SessionAssigned = 11,
SessionClose = 12,
SessionOpen = 13,
DealerNormalTrading = 14,
DealerBreakInTrading = 15,
DealerNotAvailableForTrading = 16,
}
impl SecurityTradingStatus {
pub fn as_str_name(&self) -> &'static str {
match self {
SecurityTradingStatus::Unspecified => "SECURITY_TRADING_STATUS_UNSPECIFIED",
SecurityTradingStatus::NotAvailableForTrading => {
"SECURITY_TRADING_STATUS_NOT_AVAILABLE_FOR_TRADING"
}
SecurityTradingStatus::OpeningPeriod => {
"SECURITY_TRADING_STATUS_OPENING_PERIOD"
}
SecurityTradingStatus::ClosingPeriod => {
"SECURITY_TRADING_STATUS_CLOSING_PERIOD"
}
SecurityTradingStatus::BreakInTrading => {
"SECURITY_TRADING_STATUS_BREAK_IN_TRADING"
}
SecurityTradingStatus::NormalTrading => {
"SECURITY_TRADING_STATUS_NORMAL_TRADING"
}
SecurityTradingStatus::ClosingAuction => {
"SECURITY_TRADING_STATUS_CLOSING_AUCTION"
}
SecurityTradingStatus::DarkPoolAuction => {
"SECURITY_TRADING_STATUS_DARK_POOL_AUCTION"
}
SecurityTradingStatus::DiscreteAuction => {
"SECURITY_TRADING_STATUS_DISCRETE_AUCTION"
}
SecurityTradingStatus::OpeningAuctionPeriod => {
"SECURITY_TRADING_STATUS_OPENING_AUCTION_PERIOD"
}
SecurityTradingStatus::TradingAtClosingAuctionPrice => {
"SECURITY_TRADING_STATUS_TRADING_AT_CLOSING_AUCTION_PRICE"
}
SecurityTradingStatus::SessionAssigned => {
"SECURITY_TRADING_STATUS_SESSION_ASSIGNED"
}
SecurityTradingStatus::SessionClose => {
"SECURITY_TRADING_STATUS_SESSION_CLOSE"
}
SecurityTradingStatus::SessionOpen => "SECURITY_TRADING_STATUS_SESSION_OPEN",
SecurityTradingStatus::DealerNormalTrading => {
"SECURITY_TRADING_STATUS_DEALER_NORMAL_TRADING"
}
SecurityTradingStatus::DealerBreakInTrading => {
"SECURITY_TRADING_STATUS_DEALER_BREAK_IN_TRADING"
}
SecurityTradingStatus::DealerNotAvailableForTrading => {
"SECURITY_TRADING_STATUS_DEALER_NOT_AVAILABLE_FOR_TRADING"
}
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SECURITY_TRADING_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
"SECURITY_TRADING_STATUS_NOT_AVAILABLE_FOR_TRADING" => {
Some(Self::NotAvailableForTrading)
}
"SECURITY_TRADING_STATUS_OPENING_PERIOD" => Some(Self::OpeningPeriod),
"SECURITY_TRADING_STATUS_CLOSING_PERIOD" => Some(Self::ClosingPeriod),
"SECURITY_TRADING_STATUS_BREAK_IN_TRADING" => Some(Self::BreakInTrading),
"SECURITY_TRADING_STATUS_NORMAL_TRADING" => Some(Self::NormalTrading),
"SECURITY_TRADING_STATUS_CLOSING_AUCTION" => Some(Self::ClosingAuction),
"SECURITY_TRADING_STATUS_DARK_POOL_AUCTION" => Some(Self::DarkPoolAuction),
"SECURITY_TRADING_STATUS_DISCRETE_AUCTION" => Some(Self::DiscreteAuction),
"SECURITY_TRADING_STATUS_OPENING_AUCTION_PERIOD" => {
Some(Self::OpeningAuctionPeriod)
}
"SECURITY_TRADING_STATUS_TRADING_AT_CLOSING_AUCTION_PRICE" => {
Some(Self::TradingAtClosingAuctionPrice)
}
"SECURITY_TRADING_STATUS_SESSION_ASSIGNED" => Some(Self::SessionAssigned),
"SECURITY_TRADING_STATUS_SESSION_CLOSE" => Some(Self::SessionClose),
"SECURITY_TRADING_STATUS_SESSION_OPEN" => Some(Self::SessionOpen),
"SECURITY_TRADING_STATUS_DEALER_NORMAL_TRADING" => {
Some(Self::DealerNormalTrading)
}
"SECURITY_TRADING_STATUS_DEALER_BREAK_IN_TRADING" => {
Some(Self::DealerBreakInTrading)
}
"SECURITY_TRADING_STATUS_DEALER_NOT_AVAILABLE_FOR_TRADING" => {
Some(Self::DealerNotAvailableForTrading)
}
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum PriceType {
Unspecified = 0,
Point = 1,
Currency = 2,
}
impl PriceType {
pub fn as_str_name(&self) -> &'static str {
match self {
PriceType::Unspecified => "PRICE_TYPE_UNSPECIFIED",
PriceType::Point => "PRICE_TYPE_POINT",
PriceType::Currency => "PRICE_TYPE_CURRENCY",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"PRICE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"PRICE_TYPE_POINT" => Some(Self::Point),
"PRICE_TYPE_CURRENCY" => Some(Self::Currency),
_ => None,
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TradingSchedulesRequest {
#[prost(string, optional, tag = "1")]
pub exchange: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub from: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "3")]
pub to: ::core::option::Option<::prost_types::Timestamp>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TradingSchedulesResponse {
#[prost(message, repeated, tag = "1")]
pub exchanges: ::prost::alloc::vec::Vec<TradingSchedule>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TradingSchedule {
#[prost(string, tag = "1")]
pub exchange: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub days: ::prost::alloc::vec::Vec<TradingDay>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TradingDay {
#[prost(message, optional, tag = "1")]
pub date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(bool, tag = "2")]
pub is_trading_day: bool,
#[prost(message, optional, tag = "3")]
pub start_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "4")]
pub end_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "7")]
pub opening_auction_start_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "8")]
pub closing_auction_end_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "9")]
pub evening_opening_auction_start_time: ::core::option::Option<
::prost_types::Timestamp,
>,
#[prost(message, optional, tag = "10")]
pub evening_start_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "11")]
pub evening_end_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "12")]
pub clearing_start_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "13")]
pub clearing_end_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "14")]
pub premarket_start_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "15")]
pub premarket_end_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "16")]
pub closing_auction_start_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "17")]
pub opening_auction_end_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, repeated, tag = "18")]
pub intervals: ::prost::alloc::vec::Vec<TradingInterval>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InstrumentRequest {
#[prost(enumeration = "InstrumentIdType", tag = "1")]
pub id_type: i32,
#[prost(string, optional, tag = "2")]
pub class_code: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, tag = "3")]
pub id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InstrumentsRequest {
#[prost(enumeration = "InstrumentStatus", optional, tag = "1")]
pub instrument_status: ::core::option::Option<i32>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FilterOptionsRequest {
#[prost(string, optional, tag = "1")]
pub basic_asset_uid: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "2")]
pub basic_asset_position_uid: ::core::option::Option<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BondResponse {
#[prost(message, optional, tag = "1")]
pub instrument: ::core::option::Option<Bond>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BondsResponse {
#[prost(message, repeated, tag = "1")]
pub instruments: ::prost::alloc::vec::Vec<Bond>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetBondCouponsRequest {
#[deprecated]
#[prost(string, tag = "1")]
pub figi: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub from: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "3")]
pub to: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "4")]
pub instrument_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetBondCouponsResponse {
#[prost(message, repeated, tag = "1")]
pub events: ::prost::alloc::vec::Vec<Coupon>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetBondEventsRequest {
#[prost(message, optional, tag = "2")]
pub from: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "3")]
pub to: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "4")]
pub instrument_id: ::prost::alloc::string::String,
#[prost(enumeration = "get_bond_events_request::EventType", tag = "5")]
pub r#type: i32,
}
pub mod get_bond_events_request {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum EventType {
Unspecified = 0,
Cpn = 1,
Call = 2,
Mty = 3,
Conv = 4,
}
impl EventType {
pub fn as_str_name(&self) -> &'static str {
match self {
EventType::Unspecified => "EVENT_TYPE_UNSPECIFIED",
EventType::Cpn => "EVENT_TYPE_CPN",
EventType::Call => "EVENT_TYPE_CALL",
EventType::Mty => "EVENT_TYPE_MTY",
EventType::Conv => "EVENT_TYPE_CONV",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"EVENT_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"EVENT_TYPE_CPN" => Some(Self::Cpn),
"EVENT_TYPE_CALL" => Some(Self::Call),
"EVENT_TYPE_MTY" => Some(Self::Mty),
"EVENT_TYPE_CONV" => Some(Self::Conv),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetBondEventsResponse {
#[prost(message, repeated, tag = "1")]
pub events: ::prost::alloc::vec::Vec<get_bond_events_response::BondEvent>,
}
pub mod get_bond_events_response {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BondEvent {
#[prost(string, tag = "2")]
pub instrument_id: ::prost::alloc::string::String,
#[prost(int32, tag = "3")]
pub event_number: i32,
#[prost(message, optional, tag = "4")]
pub event_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(enumeration = "super::get_bond_events_request::EventType", tag = "5")]
pub event_type: i32,
#[prost(message, optional, tag = "6")]
pub event_total_vol: ::core::option::Option<super::Quotation>,
#[prost(message, optional, tag = "7")]
pub fix_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "8")]
pub rate_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "9")]
pub default_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "10")]
pub real_pay_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "11")]
pub pay_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "12")]
pub pay_one_bond: ::core::option::Option<super::MoneyValue>,
#[prost(message, optional, tag = "13")]
pub money_flow_val: ::core::option::Option<super::MoneyValue>,
#[prost(string, tag = "14")]
pub execution: ::prost::alloc::string::String,
#[prost(string, tag = "15")]
pub operation_type: ::prost::alloc::string::String,
#[prost(message, optional, tag = "16")]
pub value: ::core::option::Option<super::Quotation>,
#[prost(string, tag = "17")]
pub note: ::prost::alloc::string::String,
#[prost(string, tag = "18")]
pub convert_to_fin_tool_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "19")]
pub coupon_start_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "20")]
pub coupon_end_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(int32, tag = "21")]
pub coupon_period: i32,
#[prost(message, optional, tag = "22")]
pub coupon_interest_rate: ::core::option::Option<super::Quotation>,
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Coupon {
#[prost(string, tag = "1")]
pub figi: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub coupon_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(int64, tag = "3")]
pub coupon_number: i64,
#[prost(message, optional, tag = "4")]
pub fix_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "5")]
pub pay_one_bond: ::core::option::Option<MoneyValue>,
#[prost(enumeration = "CouponType", tag = "6")]
pub coupon_type: i32,
#[prost(message, optional, tag = "7")]
pub coupon_start_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "8")]
pub coupon_end_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(int32, tag = "9")]
pub coupon_period: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CurrencyResponse {
#[prost(message, optional, tag = "1")]
pub instrument: ::core::option::Option<Currency>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CurrenciesResponse {
#[prost(message, repeated, tag = "1")]
pub instruments: ::prost::alloc::vec::Vec<Currency>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EtfResponse {
#[prost(message, optional, tag = "1")]
pub instrument: ::core::option::Option<Etf>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EtfsResponse {
#[prost(message, repeated, tag = "1")]
pub instruments: ::prost::alloc::vec::Vec<Etf>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FutureResponse {
#[prost(message, optional, tag = "1")]
pub instrument: ::core::option::Option<Future>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FuturesResponse {
#[prost(message, repeated, tag = "1")]
pub instruments: ::prost::alloc::vec::Vec<Future>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OptionResponse {
#[prost(message, optional, tag = "1")]
pub instrument: ::core::option::Option<Option>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OptionsResponse {
#[prost(message, repeated, tag = "1")]
pub instruments: ::prost::alloc::vec::Vec<Option>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Option {
#[prost(string, tag = "1")]
pub uid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub position_uid: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub ticker: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub class_code: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub basic_asset_position_uid: ::prost::alloc::string::String,
#[prost(enumeration = "SecurityTradingStatus", tag = "21")]
pub trading_status: i32,
#[prost(enumeration = "RealExchange", tag = "31")]
pub real_exchange: i32,
#[prost(enumeration = "OptionDirection", tag = "41")]
pub direction: i32,
#[prost(enumeration = "OptionPaymentType", tag = "42")]
pub payment_type: i32,
#[prost(enumeration = "OptionStyle", tag = "43")]
pub style: i32,
#[prost(enumeration = "OptionSettlementType", tag = "44")]
pub settlement_type: i32,
#[prost(string, tag = "101")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "111")]
pub currency: ::prost::alloc::string::String,
#[prost(string, tag = "112")]
pub settlement_currency: ::prost::alloc::string::String,
#[prost(string, tag = "131")]
pub asset_type: ::prost::alloc::string::String,
#[prost(string, tag = "132")]
pub basic_asset: ::prost::alloc::string::String,
#[prost(string, tag = "141")]
pub exchange: ::prost::alloc::string::String,
#[prost(string, tag = "151")]
pub country_of_risk: ::prost::alloc::string::String,
#[prost(string, tag = "152")]
pub country_of_risk_name: ::prost::alloc::string::String,
#[prost(string, tag = "161")]
pub sector: ::prost::alloc::string::String,
#[prost(message, optional, tag = "162")]
pub brand: ::core::option::Option<BrandData>,
#[prost(int32, tag = "201")]
pub lot: i32,
#[prost(message, optional, tag = "211")]
pub basic_asset_size: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "221")]
pub klong: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "222")]
pub kshort: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "223")]
pub dlong: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "224")]
pub dshort: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "225")]
pub dlong_min: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "226")]
pub dshort_min: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "231")]
pub min_price_increment: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "241")]
pub strike_price: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "301")]
pub expiration_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "311")]
pub first_trade_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "312")]
pub last_trade_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "321")]
pub first_1min_candle_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "322")]
pub first_1day_candle_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(bool, tag = "401")]
pub short_enabled_flag: bool,
#[prost(bool, tag = "402")]
pub for_iis_flag: bool,
#[prost(bool, tag = "403")]
pub otc_flag: bool,
#[prost(bool, tag = "404")]
pub buy_available_flag: bool,
#[prost(bool, tag = "405")]
pub sell_available_flag: bool,
#[prost(bool, tag = "406")]
pub for_qual_investor_flag: bool,
#[prost(bool, tag = "407")]
pub weekend_flag: bool,
#[prost(bool, tag = "408")]
pub blocked_tca_flag: bool,
#[prost(bool, tag = "409")]
pub api_trade_available_flag: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ShareResponse {
#[prost(message, optional, tag = "1")]
pub instrument: ::core::option::Option<Share>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SharesResponse {
#[prost(message, repeated, tag = "1")]
pub instruments: ::prost::alloc::vec::Vec<Share>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Bond {
#[prost(string, tag = "1")]
pub figi: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub ticker: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub class_code: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub isin: ::prost::alloc::string::String,
#[prost(int32, tag = "5")]
pub lot: i32,
#[prost(string, tag = "6")]
pub currency: ::prost::alloc::string::String,
#[prost(message, optional, tag = "7")]
pub klong: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "8")]
pub kshort: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "9")]
pub dlong: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "10")]
pub dshort: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "11")]
pub dlong_min: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "12")]
pub dshort_min: ::core::option::Option<Quotation>,
#[prost(bool, tag = "13")]
pub short_enabled_flag: bool,
#[prost(string, tag = "15")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "16")]
pub exchange: ::prost::alloc::string::String,
#[prost(int32, tag = "17")]
pub coupon_quantity_per_year: i32,
#[prost(message, optional, tag = "18")]
pub maturity_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "19")]
pub nominal: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "20")]
pub initial_nominal: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "21")]
pub state_reg_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "22")]
pub placement_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "23")]
pub placement_price: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "24")]
pub aci_value: ::core::option::Option<MoneyValue>,
#[prost(string, tag = "25")]
pub country_of_risk: ::prost::alloc::string::String,
#[prost(string, tag = "26")]
pub country_of_risk_name: ::prost::alloc::string::String,
#[prost(string, tag = "27")]
pub sector: ::prost::alloc::string::String,
#[prost(string, tag = "28")]
pub issue_kind: ::prost::alloc::string::String,
#[prost(int64, tag = "29")]
pub issue_size: i64,
#[prost(int64, tag = "30")]
pub issue_size_plan: i64,
#[prost(enumeration = "SecurityTradingStatus", tag = "31")]
pub trading_status: i32,
#[prost(bool, tag = "32")]
pub otc_flag: bool,
#[prost(bool, tag = "33")]
pub buy_available_flag: bool,
#[prost(bool, tag = "34")]
pub sell_available_flag: bool,
#[prost(bool, tag = "35")]
pub floating_coupon_flag: bool,
#[prost(bool, tag = "36")]
pub perpetual_flag: bool,
#[prost(bool, tag = "37")]
pub amortization_flag: bool,
#[prost(message, optional, tag = "38")]
pub min_price_increment: ::core::option::Option<Quotation>,
#[prost(bool, tag = "39")]
pub api_trade_available_flag: bool,
#[prost(string, tag = "40")]
pub uid: ::prost::alloc::string::String,
#[prost(enumeration = "RealExchange", tag = "41")]
pub real_exchange: i32,
#[prost(string, tag = "42")]
pub position_uid: ::prost::alloc::string::String,
#[prost(string, tag = "43")]
pub asset_uid: ::prost::alloc::string::String,
#[prost(bool, tag = "51")]
pub for_iis_flag: bool,
#[prost(bool, tag = "52")]
pub for_qual_investor_flag: bool,
#[prost(bool, tag = "53")]
pub weekend_flag: bool,
#[prost(bool, tag = "54")]
pub blocked_tca_flag: bool,
#[prost(bool, tag = "55")]
pub subordinated_flag: bool,
#[prost(bool, tag = "56")]
pub liquidity_flag: bool,
#[prost(message, optional, tag = "61")]
pub first_1min_candle_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "62")]
pub first_1day_candle_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(enumeration = "RiskLevel", tag = "63")]
pub risk_level: i32,
#[prost(message, optional, tag = "64")]
pub brand: ::core::option::Option<BrandData>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Currency {
#[prost(string, tag = "1")]
pub figi: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub ticker: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub class_code: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub isin: ::prost::alloc::string::String,
#[prost(int32, tag = "5")]
pub lot: i32,
#[prost(string, tag = "6")]
pub currency: ::prost::alloc::string::String,
#[prost(message, optional, tag = "7")]
pub klong: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "8")]
pub kshort: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "9")]
pub dlong: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "10")]
pub dshort: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "11")]
pub dlong_min: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "12")]
pub dshort_min: ::core::option::Option<Quotation>,
#[prost(bool, tag = "13")]
pub short_enabled_flag: bool,
#[prost(string, tag = "15")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "16")]
pub exchange: ::prost::alloc::string::String,
#[prost(message, optional, tag = "17")]
pub nominal: ::core::option::Option<MoneyValue>,
#[prost(string, tag = "18")]
pub country_of_risk: ::prost::alloc::string::String,
#[prost(string, tag = "19")]
pub country_of_risk_name: ::prost::alloc::string::String,
#[prost(enumeration = "SecurityTradingStatus", tag = "20")]
pub trading_status: i32,
#[prost(bool, tag = "21")]
pub otc_flag: bool,
#[prost(bool, tag = "22")]
pub buy_available_flag: bool,
#[prost(bool, tag = "23")]
pub sell_available_flag: bool,
#[prost(string, tag = "24")]
pub iso_currency_name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "25")]
pub min_price_increment: ::core::option::Option<Quotation>,
#[prost(bool, tag = "26")]
pub api_trade_available_flag: bool,
#[prost(string, tag = "27")]
pub uid: ::prost::alloc::string::String,
#[prost(enumeration = "RealExchange", tag = "28")]
pub real_exchange: i32,
#[prost(string, tag = "29")]
pub position_uid: ::prost::alloc::string::String,
#[prost(bool, tag = "41")]
pub for_iis_flag: bool,
#[prost(bool, tag = "52")]
pub for_qual_investor_flag: bool,
#[prost(bool, tag = "53")]
pub weekend_flag: bool,
#[prost(bool, tag = "54")]
pub blocked_tca_flag: bool,
#[prost(message, optional, tag = "56")]
pub first_1min_candle_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "57")]
pub first_1day_candle_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "60")]
pub brand: ::core::option::Option<BrandData>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Etf {
#[prost(string, tag = "1")]
pub figi: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub ticker: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub class_code: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub isin: ::prost::alloc::string::String,
#[prost(int32, tag = "5")]
pub lot: i32,
#[prost(string, tag = "6")]
pub currency: ::prost::alloc::string::String,
#[prost(message, optional, tag = "7")]
pub klong: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "8")]
pub kshort: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "9")]
pub dlong: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "10")]
pub dshort: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "11")]
pub dlong_min: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "12")]
pub dshort_min: ::core::option::Option<Quotation>,
#[prost(bool, tag = "13")]
pub short_enabled_flag: bool,
#[prost(string, tag = "15")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "16")]
pub exchange: ::prost::alloc::string::String,
#[prost(message, optional, tag = "17")]
pub fixed_commission: ::core::option::Option<Quotation>,
#[prost(string, tag = "18")]
pub focus_type: ::prost::alloc::string::String,
#[prost(message, optional, tag = "19")]
pub released_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "20")]
pub num_shares: ::core::option::Option<Quotation>,
#[prost(string, tag = "21")]
pub country_of_risk: ::prost::alloc::string::String,
#[prost(string, tag = "22")]
pub country_of_risk_name: ::prost::alloc::string::String,
#[prost(string, tag = "23")]
pub sector: ::prost::alloc::string::String,
#[prost(string, tag = "24")]
pub rebalancing_freq: ::prost::alloc::string::String,
#[prost(enumeration = "SecurityTradingStatus", tag = "25")]
pub trading_status: i32,
#[prost(bool, tag = "26")]
pub otc_flag: bool,
#[prost(bool, tag = "27")]
pub buy_available_flag: bool,
#[prost(bool, tag = "28")]
pub sell_available_flag: bool,
#[prost(message, optional, tag = "29")]
pub min_price_increment: ::core::option::Option<Quotation>,
#[prost(bool, tag = "30")]
pub api_trade_available_flag: bool,
#[prost(string, tag = "31")]
pub uid: ::prost::alloc::string::String,
#[prost(enumeration = "RealExchange", tag = "32")]
pub real_exchange: i32,
#[prost(string, tag = "33")]
pub position_uid: ::prost::alloc::string::String,
#[prost(string, tag = "34")]
pub asset_uid: ::prost::alloc::string::String,
#[prost(bool, tag = "41")]
pub for_iis_flag: bool,
#[prost(bool, tag = "42")]
pub for_qual_investor_flag: bool,
#[prost(bool, tag = "43")]
pub weekend_flag: bool,
#[prost(bool, tag = "44")]
pub blocked_tca_flag: bool,
#[prost(bool, tag = "45")]
pub liquidity_flag: bool,
#[prost(message, optional, tag = "56")]
pub first_1min_candle_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "57")]
pub first_1day_candle_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "60")]
pub brand: ::core::option::Option<BrandData>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Future {
#[prost(string, tag = "1")]
pub figi: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub ticker: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub class_code: ::prost::alloc::string::String,
#[prost(int32, tag = "4")]
pub lot: i32,
#[prost(string, tag = "5")]
pub currency: ::prost::alloc::string::String,
#[prost(message, optional, tag = "6")]
pub klong: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "7")]
pub kshort: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "8")]
pub dlong: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "9")]
pub dshort: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "10")]
pub dlong_min: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "11")]
pub dshort_min: ::core::option::Option<Quotation>,
#[prost(bool, tag = "12")]
pub short_enabled_flag: bool,
#[prost(string, tag = "13")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "14")]
pub exchange: ::prost::alloc::string::String,
#[prost(message, optional, tag = "15")]
pub first_trade_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "16")]
pub last_trade_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "17")]
pub futures_type: ::prost::alloc::string::String,
#[prost(string, tag = "18")]
pub asset_type: ::prost::alloc::string::String,
#[prost(string, tag = "19")]
pub basic_asset: ::prost::alloc::string::String,
#[prost(message, optional, tag = "20")]
pub basic_asset_size: ::core::option::Option<Quotation>,
#[prost(string, tag = "21")]
pub country_of_risk: ::prost::alloc::string::String,
#[prost(string, tag = "22")]
pub country_of_risk_name: ::prost::alloc::string::String,
#[prost(string, tag = "23")]
pub sector: ::prost::alloc::string::String,
#[prost(message, optional, tag = "24")]
pub expiration_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(enumeration = "SecurityTradingStatus", tag = "25")]
pub trading_status: i32,
#[prost(bool, tag = "26")]
pub otc_flag: bool,
#[prost(bool, tag = "27")]
pub buy_available_flag: bool,
#[prost(bool, tag = "28")]
pub sell_available_flag: bool,
#[prost(message, optional, tag = "29")]
pub min_price_increment: ::core::option::Option<Quotation>,
#[prost(bool, tag = "30")]
pub api_trade_available_flag: bool,
#[prost(string, tag = "31")]
pub uid: ::prost::alloc::string::String,
#[prost(enumeration = "RealExchange", tag = "32")]
pub real_exchange: i32,
#[prost(string, tag = "33")]
pub position_uid: ::prost::alloc::string::String,
#[prost(string, tag = "34")]
pub basic_asset_position_uid: ::prost::alloc::string::String,
#[prost(bool, tag = "41")]
pub for_iis_flag: bool,
#[prost(bool, tag = "42")]
pub for_qual_investor_flag: bool,
#[prost(bool, tag = "43")]
pub weekend_flag: bool,
#[prost(bool, tag = "44")]
pub blocked_tca_flag: bool,
#[prost(message, optional, tag = "56")]
pub first_1min_candle_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "57")]
pub first_1day_candle_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "61")]
pub initial_margin_on_buy: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "62")]
pub initial_margin_on_sell: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "63")]
pub min_price_increment_amount: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "64")]
pub brand: ::core::option::Option<BrandData>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Share {
#[prost(string, tag = "1")]
pub figi: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub ticker: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub class_code: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub isin: ::prost::alloc::string::String,
#[prost(int32, tag = "5")]
pub lot: i32,
#[prost(string, tag = "6")]
pub currency: ::prost::alloc::string::String,
#[prost(message, optional, tag = "7")]
pub klong: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "8")]
pub kshort: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "9")]
pub dlong: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "10")]
pub dshort: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "11")]
pub dlong_min: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "12")]
pub dshort_min: ::core::option::Option<Quotation>,
#[prost(bool, tag = "13")]
pub short_enabled_flag: bool,
#[prost(string, tag = "15")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "16")]
pub exchange: ::prost::alloc::string::String,
#[prost(message, optional, tag = "17")]
pub ipo_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(int64, tag = "18")]
pub issue_size: i64,
#[prost(string, tag = "19")]
pub country_of_risk: ::prost::alloc::string::String,
#[prost(string, tag = "20")]
pub country_of_risk_name: ::prost::alloc::string::String,
#[prost(string, tag = "21")]
pub sector: ::prost::alloc::string::String,
#[prost(int64, tag = "22")]
pub issue_size_plan: i64,
#[prost(message, optional, tag = "23")]
pub nominal: ::core::option::Option<MoneyValue>,
#[prost(enumeration = "SecurityTradingStatus", tag = "25")]
pub trading_status: i32,
#[prost(bool, tag = "26")]
pub otc_flag: bool,
#[prost(bool, tag = "27")]
pub buy_available_flag: bool,
#[prost(bool, tag = "28")]
pub sell_available_flag: bool,
#[prost(bool, tag = "29")]
pub div_yield_flag: bool,
#[prost(enumeration = "ShareType", tag = "30")]
pub share_type: i32,
#[prost(message, optional, tag = "31")]
pub min_price_increment: ::core::option::Option<Quotation>,
#[prost(bool, tag = "32")]
pub api_trade_available_flag: bool,
#[prost(string, tag = "33")]
pub uid: ::prost::alloc::string::String,
#[prost(enumeration = "RealExchange", tag = "34")]
pub real_exchange: i32,
#[prost(string, tag = "35")]
pub position_uid: ::prost::alloc::string::String,
#[prost(string, tag = "36")]
pub asset_uid: ::prost::alloc::string::String,
#[prost(bool, tag = "46")]
pub for_iis_flag: bool,
#[prost(bool, tag = "47")]
pub for_qual_investor_flag: bool,
#[prost(bool, tag = "48")]
pub weekend_flag: bool,
#[prost(bool, tag = "49")]
pub blocked_tca_flag: bool,
#[prost(bool, tag = "50")]
pub liquidity_flag: bool,
#[prost(message, optional, tag = "56")]
pub first_1min_candle_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "57")]
pub first_1day_candle_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "60")]
pub brand: ::core::option::Option<BrandData>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetAccruedInterestsRequest {
#[deprecated]
#[prost(string, tag = "1")]
pub figi: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub from: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "3")]
pub to: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "4")]
pub instrument_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetAccruedInterestsResponse {
#[prost(message, repeated, tag = "1")]
pub accrued_interests: ::prost::alloc::vec::Vec<AccruedInterest>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AccruedInterest {
#[prost(message, optional, tag = "1")]
pub date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "2")]
pub value: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "3")]
pub value_percent: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "4")]
pub nominal: ::core::option::Option<Quotation>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetFuturesMarginRequest {
#[deprecated]
#[prost(string, tag = "1")]
pub figi: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub instrument_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetFuturesMarginResponse {
#[prost(message, optional, tag = "1")]
pub initial_margin_on_buy: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "2")]
pub initial_margin_on_sell: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "3")]
pub min_price_increment: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "4")]
pub min_price_increment_amount: ::core::option::Option<Quotation>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InstrumentResponse {
#[prost(message, optional, tag = "1")]
pub instrument: ::core::option::Option<Instrument>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Instrument {
#[prost(string, tag = "1")]
pub figi: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub ticker: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub class_code: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub isin: ::prost::alloc::string::String,
#[prost(int32, tag = "5")]
pub lot: i32,
#[prost(string, tag = "6")]
pub currency: ::prost::alloc::string::String,
#[prost(message, optional, tag = "7")]
pub klong: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "8")]
pub kshort: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "9")]
pub dlong: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "10")]
pub dshort: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "11")]
pub dlong_min: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "12")]
pub dshort_min: ::core::option::Option<Quotation>,
#[prost(bool, tag = "13")]
pub short_enabled_flag: bool,
#[prost(string, tag = "14")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "15")]
pub exchange: ::prost::alloc::string::String,
#[prost(string, tag = "16")]
pub country_of_risk: ::prost::alloc::string::String,
#[prost(string, tag = "17")]
pub country_of_risk_name: ::prost::alloc::string::String,
#[prost(string, tag = "18")]
pub instrument_type: ::prost::alloc::string::String,
#[prost(enumeration = "SecurityTradingStatus", tag = "19")]
pub trading_status: i32,
#[prost(bool, tag = "20")]
pub otc_flag: bool,
#[prost(bool, tag = "21")]
pub buy_available_flag: bool,
#[prost(bool, tag = "22")]
pub sell_available_flag: bool,
#[prost(message, optional, tag = "23")]
pub min_price_increment: ::core::option::Option<Quotation>,
#[prost(bool, tag = "24")]
pub api_trade_available_flag: bool,
#[prost(string, tag = "25")]
pub uid: ::prost::alloc::string::String,
#[prost(enumeration = "RealExchange", tag = "26")]
pub real_exchange: i32,
#[prost(string, tag = "27")]
pub position_uid: ::prost::alloc::string::String,
#[prost(string, tag = "28")]
pub asset_uid: ::prost::alloc::string::String,
#[prost(bool, tag = "36")]
pub for_iis_flag: bool,
#[prost(bool, tag = "37")]
pub for_qual_investor_flag: bool,
#[prost(bool, tag = "38")]
pub weekend_flag: bool,
#[prost(bool, tag = "39")]
pub blocked_tca_flag: bool,
#[prost(enumeration = "InstrumentType", tag = "40")]
pub instrument_kind: i32,
#[prost(message, optional, tag = "56")]
pub first_1min_candle_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "57")]
pub first_1day_candle_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "60")]
pub brand: ::core::option::Option<BrandData>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetDividendsRequest {
#[deprecated]
#[prost(string, tag = "1")]
pub figi: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub from: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "3")]
pub to: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "4")]
pub instrument_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetDividendsResponse {
#[prost(message, repeated, tag = "1")]
pub dividends: ::prost::alloc::vec::Vec<Dividend>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Dividend {
#[prost(message, optional, tag = "1")]
pub dividend_net: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "2")]
pub payment_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "3")]
pub declared_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "4")]
pub last_buy_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "5")]
pub dividend_type: ::prost::alloc::string::String,
#[prost(message, optional, tag = "6")]
pub record_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "7")]
pub regularity: ::prost::alloc::string::String,
#[prost(message, optional, tag = "8")]
pub close_price: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "9")]
pub yield_value: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "10")]
pub created_at: ::core::option::Option<::prost_types::Timestamp>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AssetRequest {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AssetResponse {
#[prost(message, optional, tag = "1")]
pub asset: ::core::option::Option<AssetFull>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AssetsRequest {
#[prost(enumeration = "InstrumentType", optional, tag = "1")]
pub instrument_type: ::core::option::Option<i32>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AssetsResponse {
#[prost(message, repeated, tag = "1")]
pub assets: ::prost::alloc::vec::Vec<Asset>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AssetFull {
#[prost(string, tag = "1")]
pub uid: ::prost::alloc::string::String,
#[prost(enumeration = "AssetType", tag = "2")]
pub r#type: i32,
#[prost(string, tag = "3")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub name_brief: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub description: ::prost::alloc::string::String,
#[prost(message, optional, tag = "6")]
pub deleted_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, repeated, tag = "7")]
pub required_tests: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, tag = "10")]
pub gos_reg_code: ::prost::alloc::string::String,
#[prost(string, tag = "11")]
pub cfi: ::prost::alloc::string::String,
#[prost(string, tag = "12")]
pub code_nsd: ::prost::alloc::string::String,
#[prost(string, tag = "13")]
pub status: ::prost::alloc::string::String,
#[prost(message, optional, tag = "14")]
pub brand: ::core::option::Option<Brand>,
#[prost(message, optional, tag = "15")]
pub updated_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "16")]
pub br_code: ::prost::alloc::string::String,
#[prost(string, tag = "17")]
pub br_code_name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "18")]
pub instruments: ::prost::alloc::vec::Vec<AssetInstrument>,
#[prost(oneof = "asset_full::Ext", tags = "8, 9")]
pub ext: ::core::option::Option<asset_full::Ext>,
}
pub mod asset_full {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Ext {
#[prost(message, tag = "8")]
Currency(super::AssetCurrency),
#[prost(message, tag = "9")]
Security(super::AssetSecurity),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Asset {
#[prost(string, tag = "1")]
pub uid: ::prost::alloc::string::String,
#[prost(enumeration = "AssetType", tag = "2")]
pub r#type: i32,
#[prost(string, tag = "3")]
pub name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "4")]
pub instruments: ::prost::alloc::vec::Vec<AssetInstrument>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AssetCurrency {
#[prost(string, tag = "1")]
pub base_currency: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AssetSecurity {
#[prost(string, tag = "1")]
pub isin: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub r#type: ::prost::alloc::string::String,
#[prost(enumeration = "InstrumentType", tag = "10")]
pub instrument_kind: i32,
#[prost(oneof = "asset_security::Ext", tags = "3, 4, 5, 6, 7")]
pub ext: ::core::option::Option<asset_security::Ext>,
}
pub mod asset_security {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Ext {
#[prost(message, tag = "3")]
Share(super::AssetShare),
#[prost(message, tag = "4")]
Bond(super::AssetBond),
#[prost(message, tag = "5")]
Sp(super::AssetStructuredProduct),
#[prost(message, tag = "6")]
Etf(super::AssetEtf),
#[prost(message, tag = "7")]
ClearingCertificate(super::AssetClearingCertificate),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AssetShare {
#[prost(enumeration = "ShareType", tag = "1")]
pub r#type: i32,
#[prost(message, optional, tag = "2")]
pub issue_size: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "3")]
pub nominal: ::core::option::Option<Quotation>,
#[prost(string, tag = "4")]
pub nominal_currency: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub primary_index: ::prost::alloc::string::String,
#[prost(message, optional, tag = "6")]
pub dividend_rate: ::core::option::Option<Quotation>,
#[prost(string, tag = "7")]
pub preferred_share_type: ::prost::alloc::string::String,
#[prost(message, optional, tag = "8")]
pub ipo_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "9")]
pub registry_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(bool, tag = "10")]
pub div_yield_flag: bool,
#[prost(string, tag = "11")]
pub issue_kind: ::prost::alloc::string::String,
#[prost(message, optional, tag = "12")]
pub placement_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "13")]
pub repres_isin: ::prost::alloc::string::String,
#[prost(message, optional, tag = "14")]
pub issue_size_plan: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "15")]
pub total_float: ::core::option::Option<Quotation>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AssetBond {
#[prost(message, optional, tag = "1")]
pub current_nominal: ::core::option::Option<Quotation>,
#[prost(string, tag = "2")]
pub borrow_name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub issue_size: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "4")]
pub nominal: ::core::option::Option<Quotation>,
#[prost(string, tag = "5")]
pub nominal_currency: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub issue_kind: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub interest_kind: ::prost::alloc::string::String,
#[prost(int32, tag = "8")]
pub coupon_quantity_per_year: i32,
#[prost(bool, tag = "9")]
pub indexed_nominal_flag: bool,
#[prost(bool, tag = "10")]
pub subordinated_flag: bool,
#[prost(bool, tag = "11")]
pub collateral_flag: bool,
#[prost(bool, tag = "12")]
pub tax_free_flag: bool,
#[prost(bool, tag = "13")]
pub amortization_flag: bool,
#[prost(bool, tag = "14")]
pub floating_coupon_flag: bool,
#[prost(bool, tag = "15")]
pub perpetual_flag: bool,
#[prost(message, optional, tag = "16")]
pub maturity_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "17")]
pub return_condition: ::prost::alloc::string::String,
#[prost(message, optional, tag = "18")]
pub state_reg_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "19")]
pub placement_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "20")]
pub placement_price: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "21")]
pub issue_size_plan: ::core::option::Option<Quotation>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AssetStructuredProduct {
#[prost(string, tag = "1")]
pub borrow_name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub nominal: ::core::option::Option<Quotation>,
#[prost(string, tag = "3")]
pub nominal_currency: ::prost::alloc::string::String,
#[prost(enumeration = "StructuredProductType", tag = "4")]
pub r#type: i32,
#[prost(string, tag = "5")]
pub logic_portfolio: ::prost::alloc::string::String,
#[prost(enumeration = "AssetType", tag = "6")]
pub asset_type: i32,
#[prost(string, tag = "7")]
pub basic_asset: ::prost::alloc::string::String,
#[prost(message, optional, tag = "8")]
pub safety_barrier: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "9")]
pub maturity_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "10")]
pub issue_size_plan: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "11")]
pub issue_size: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "12")]
pub placement_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "13")]
pub issue_kind: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AssetEtf {
#[prost(message, optional, tag = "1")]
pub total_expense: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "2")]
pub hurdle_rate: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "3")]
pub performance_fee: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "4")]
pub fixed_commission: ::core::option::Option<Quotation>,
#[prost(string, tag = "5")]
pub payment_type: ::prost::alloc::string::String,
#[prost(bool, tag = "6")]
pub watermark_flag: bool,
#[prost(message, optional, tag = "7")]
pub buy_premium: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "8")]
pub sell_discount: ::core::option::Option<Quotation>,
#[prost(bool, tag = "9")]
pub rebalancing_flag: bool,
#[prost(string, tag = "10")]
pub rebalancing_freq: ::prost::alloc::string::String,
#[prost(string, tag = "11")]
pub management_type: ::prost::alloc::string::String,
#[prost(string, tag = "12")]
pub primary_index: ::prost::alloc::string::String,
#[prost(string, tag = "13")]
pub focus_type: ::prost::alloc::string::String,
#[prost(bool, tag = "14")]
pub leveraged_flag: bool,
#[prost(message, optional, tag = "15")]
pub num_share: ::core::option::Option<Quotation>,
#[prost(bool, tag = "16")]
pub ucits_flag: bool,
#[prost(message, optional, tag = "17")]
pub released_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "18")]
pub description: ::prost::alloc::string::String,
#[prost(string, tag = "19")]
pub primary_index_description: ::prost::alloc::string::String,
#[prost(string, tag = "20")]
pub primary_index_company: ::prost::alloc::string::String,
#[prost(message, optional, tag = "21")]
pub index_recovery_period: ::core::option::Option<Quotation>,
#[prost(string, tag = "22")]
pub inav_code: ::prost::alloc::string::String,
#[prost(bool, tag = "23")]
pub div_yield_flag: bool,
#[prost(message, optional, tag = "24")]
pub expense_commission: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "25")]
pub primary_index_tracking_error: ::core::option::Option<Quotation>,
#[prost(string, tag = "26")]
pub rebalancing_plan: ::prost::alloc::string::String,
#[prost(string, tag = "27")]
pub tax_rate: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "28")]
pub rebalancing_dates: ::prost::alloc::vec::Vec<::prost_types::Timestamp>,
#[prost(string, tag = "29")]
pub issue_kind: ::prost::alloc::string::String,
#[prost(message, optional, tag = "30")]
pub nominal: ::core::option::Option<Quotation>,
#[prost(string, tag = "31")]
pub nominal_currency: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AssetClearingCertificate {
#[prost(message, optional, tag = "1")]
pub nominal: ::core::option::Option<Quotation>,
#[prost(string, tag = "2")]
pub nominal_currency: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Brand {
#[prost(string, tag = "1")]
pub uid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub description: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub info: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub company: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub sector: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub country_of_risk: ::prost::alloc::string::String,
#[prost(string, tag = "8")]
pub country_of_risk_name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AssetInstrument {
#[prost(string, tag = "1")]
pub uid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub figi: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub instrument_type: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub ticker: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub class_code: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "6")]
pub links: ::prost::alloc::vec::Vec<InstrumentLink>,
#[prost(enumeration = "InstrumentType", tag = "10")]
pub instrument_kind: i32,
#[prost(string, tag = "11")]
pub position_uid: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InstrumentLink {
#[prost(string, tag = "1")]
pub r#type: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub instrument_uid: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetFavoritesRequest {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetFavoritesResponse {
#[prost(message, repeated, tag = "1")]
pub favorite_instruments: ::prost::alloc::vec::Vec<FavoriteInstrument>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FavoriteInstrument {
#[prost(string, tag = "1")]
pub figi: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub ticker: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub class_code: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub isin: ::prost::alloc::string::String,
#[prost(string, tag = "11")]
pub instrument_type: ::prost::alloc::string::String,
#[prost(string, tag = "12")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "13")]
pub uid: ::prost::alloc::string::String,
#[prost(bool, tag = "16")]
pub otc_flag: bool,
#[prost(bool, tag = "17")]
pub api_trade_available_flag: bool,
#[prost(enumeration = "InstrumentType", tag = "18")]
pub instrument_kind: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EditFavoritesRequest {
#[prost(message, repeated, tag = "1")]
pub instruments: ::prost::alloc::vec::Vec<EditFavoritesRequestInstrument>,
#[prost(enumeration = "EditFavoritesActionType", tag = "6")]
pub action_type: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EditFavoritesRequestInstrument {
#[deprecated]
#[prost(string, optional, tag = "1")]
pub figi: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, tag = "2")]
pub instrument_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EditFavoritesResponse {
#[prost(message, repeated, tag = "1")]
pub favorite_instruments: ::prost::alloc::vec::Vec<FavoriteInstrument>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetCountriesRequest {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetCountriesResponse {
#[prost(message, repeated, tag = "1")]
pub countries: ::prost::alloc::vec::Vec<CountryResponse>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IndicativesRequest {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IndicativesResponse {
#[prost(message, repeated, tag = "1")]
pub instruments: ::prost::alloc::vec::Vec<IndicativeResponse>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IndicativeResponse {
#[prost(string, tag = "1")]
pub figi: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub ticker: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub class_code: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub currency: ::prost::alloc::string::String,
#[prost(enumeration = "InstrumentType", tag = "10")]
pub instrument_kind: i32,
#[prost(string, tag = "12")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "13")]
pub exchange: ::prost::alloc::string::String,
#[prost(string, tag = "14")]
pub uid: ::prost::alloc::string::String,
#[prost(bool, tag = "404")]
pub buy_available_flag: bool,
#[prost(bool, tag = "405")]
pub sell_available_flag: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CountryResponse {
#[prost(string, tag = "1")]
pub alfa_two: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub alfa_three: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub name_brief: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FindInstrumentRequest {
#[prost(string, tag = "1")]
pub query: ::prost::alloc::string::String,
#[prost(enumeration = "InstrumentType", optional, tag = "2")]
pub instrument_kind: ::core::option::Option<i32>,
#[prost(bool, optional, tag = "3")]
pub api_trade_available_flag: ::core::option::Option<bool>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FindInstrumentResponse {
#[prost(message, repeated, tag = "1")]
pub instruments: ::prost::alloc::vec::Vec<InstrumentShort>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InstrumentShort {
#[prost(string, tag = "1")]
pub isin: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub figi: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub ticker: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub class_code: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub instrument_type: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub uid: ::prost::alloc::string::String,
#[prost(string, tag = "8")]
pub position_uid: ::prost::alloc::string::String,
#[prost(enumeration = "InstrumentType", tag = "10")]
pub instrument_kind: i32,
#[prost(bool, tag = "11")]
pub api_trade_available_flag: bool,
#[prost(bool, tag = "12")]
pub for_iis_flag: bool,
#[prost(message, optional, tag = "26")]
pub first_1min_candle_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "27")]
pub first_1day_candle_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(bool, tag = "28")]
pub for_qual_investor_flag: bool,
#[prost(bool, tag = "29")]
pub weekend_flag: bool,
#[prost(bool, tag = "30")]
pub blocked_tca_flag: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetBrandsRequest {
#[prost(message, optional, tag = "1")]
pub paging: ::core::option::Option<Page>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetBrandRequest {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetBrandsResponse {
#[prost(message, repeated, tag = "1")]
pub brands: ::prost::alloc::vec::Vec<Brand>,
#[prost(message, optional, tag = "2")]
pub paging: ::core::option::Option<PageResponse>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetAssetFundamentalsRequest {
#[prost(string, repeated, tag = "1")]
pub assets: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetAssetFundamentalsResponse {
#[prost(message, repeated, tag = "1")]
pub fundamentals: ::prost::alloc::vec::Vec<
get_asset_fundamentals_response::StatisticResponse,
>,
}
pub mod get_asset_fundamentals_response {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StatisticResponse {
#[prost(string, tag = "1")]
pub asset_uid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub currency: ::prost::alloc::string::String,
#[prost(double, tag = "3")]
pub market_capitalization: f64,
#[prost(double, tag = "4")]
pub high_price_last_52_weeks: f64,
#[prost(double, tag = "5")]
pub low_price_last_52_weeks: f64,
#[prost(double, tag = "6")]
pub average_daily_volume_last_10_days: f64,
#[prost(double, tag = "7")]
pub average_daily_volume_last_4_weeks: f64,
#[prost(double, tag = "8")]
pub beta: f64,
#[prost(double, tag = "9")]
pub free_float: f64,
#[prost(double, tag = "10")]
pub forward_annual_dividend_yield: f64,
#[prost(double, tag = "11")]
pub shares_outstanding: f64,
#[prost(double, tag = "12")]
pub revenue_ttm: f64,
#[prost(double, tag = "13")]
pub ebitda_ttm: f64,
#[prost(double, tag = "14")]
pub net_income_ttm: f64,
#[prost(double, tag = "15")]
pub eps_ttm: f64,
#[prost(double, tag = "16")]
pub diluted_eps_ttm: f64,
#[prost(double, tag = "17")]
pub free_cash_flow_ttm: f64,
#[prost(double, tag = "18")]
pub five_year_annual_revenue_growth_rate: f64,
#[prost(double, tag = "19")]
pub three_year_annual_revenue_growth_rate: f64,
#[prost(double, tag = "20")]
pub pe_ratio_ttm: f64,
#[prost(double, tag = "21")]
pub price_to_sales_ttm: f64,
#[prost(double, tag = "22")]
pub price_to_book_ttm: f64,
#[prost(double, tag = "23")]
pub price_to_free_cash_flow_ttm: f64,
#[prost(double, tag = "24")]
pub total_enterprise_value_mrq: f64,
#[prost(double, tag = "25")]
pub ev_to_ebitda_mrq: f64,
#[prost(double, tag = "26")]
pub net_margin_mrq: f64,
#[prost(double, tag = "27")]
pub net_interest_margin_mrq: f64,
#[prost(double, tag = "28")]
pub roe: f64,
#[prost(double, tag = "29")]
pub roa: f64,
#[prost(double, tag = "30")]
pub roic: f64,
#[prost(double, tag = "31")]
pub total_debt_mrq: f64,
#[prost(double, tag = "32")]
pub total_debt_to_equity_mrq: f64,
#[prost(double, tag = "33")]
pub total_debt_to_ebitda_mrq: f64,
#[prost(double, tag = "34")]
pub free_cash_flow_to_price: f64,
#[prost(double, tag = "35")]
pub net_debt_to_ebitda: f64,
#[prost(double, tag = "36")]
pub current_ratio_mrq: f64,
#[prost(double, tag = "37")]
pub fixed_charge_coverage_ratio_fy: f64,
#[prost(double, tag = "38")]
pub dividend_yield_daily_ttm: f64,
#[prost(double, tag = "39")]
pub dividend_rate_ttm: f64,
#[prost(double, tag = "40")]
pub dividends_per_share: f64,
#[prost(double, tag = "41")]
pub five_years_average_dividend_yield: f64,
#[prost(double, tag = "42")]
pub five_year_annual_dividend_growth_rate: f64,
#[prost(double, tag = "43")]
pub dividend_payout_ratio_fy: f64,
#[prost(double, tag = "44")]
pub buy_back_ttm: f64,
#[prost(double, tag = "45")]
pub one_year_annual_revenue_growth_rate: f64,
#[prost(string, tag = "46")]
pub domicile_indicator_code: ::prost::alloc::string::String,
#[prost(double, tag = "47")]
pub adr_to_common_share_ratio: f64,
#[prost(double, tag = "48")]
pub number_of_employees: f64,
#[prost(message, optional, tag = "49")]
pub ex_dividend_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "50")]
pub fiscal_period_start_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "51")]
pub fiscal_period_end_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(double, tag = "53")]
pub revenue_change_five_years: f64,
#[prost(double, tag = "54")]
pub eps_change_five_years: f64,
#[prost(double, tag = "55")]
pub ebitda_change_five_years: f64,
#[prost(double, tag = "56")]
pub total_debt_change_five_years: f64,
#[prost(double, tag = "57")]
pub ev_to_sales: f64,
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetAssetReportsRequest {
#[prost(string, tag = "1")]
pub instrument_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub from: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "3")]
pub to: ::core::option::Option<::prost_types::Timestamp>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetAssetReportsResponse {
#[prost(message, repeated, tag = "1")]
pub events: ::prost::alloc::vec::Vec<
get_asset_reports_response::GetAssetReportsEvent,
>,
}
pub mod get_asset_reports_response {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetAssetReportsEvent {
#[prost(string, tag = "1")]
pub instrument_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub report_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(int32, tag = "3")]
pub period_year: i32,
#[prost(int32, tag = "4")]
pub period_num: i32,
#[prost(enumeration = "AssetReportPeriodType", tag = "5")]
pub period_type: i32,
#[prost(message, optional, tag = "6")]
pub created_at: ::core::option::Option<::prost_types::Timestamp>,
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum AssetReportPeriodType {
PeriodTypeUnspecified = 0,
PeriodTypeQuarter = 1,
PeriodTypeSemiannual = 2,
PeriodTypeAnnual = 3,
}
impl AssetReportPeriodType {
pub fn as_str_name(&self) -> &'static str {
match self {
AssetReportPeriodType::PeriodTypeUnspecified => "PERIOD_TYPE_UNSPECIFIED",
AssetReportPeriodType::PeriodTypeQuarter => "PERIOD_TYPE_QUARTER",
AssetReportPeriodType::PeriodTypeSemiannual => "PERIOD_TYPE_SEMIANNUAL",
AssetReportPeriodType::PeriodTypeAnnual => "PERIOD_TYPE_ANNUAL",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"PERIOD_TYPE_UNSPECIFIED" => Some(Self::PeriodTypeUnspecified),
"PERIOD_TYPE_QUARTER" => Some(Self::PeriodTypeQuarter),
"PERIOD_TYPE_SEMIANNUAL" => Some(Self::PeriodTypeSemiannual),
"PERIOD_TYPE_ANNUAL" => Some(Self::PeriodTypeAnnual),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetConsensusForecastsRequest {
#[prost(message, optional, tag = "1")]
pub paging: ::core::option::Option<Page>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetConsensusForecastsResponse {
#[prost(message, repeated, tag = "1")]
pub items: ::prost::alloc::vec::Vec<
get_consensus_forecasts_response::ConsensusForecastsItem,
>,
#[prost(message, optional, tag = "2")]
pub page: ::core::option::Option<PageResponse>,
}
pub mod get_consensus_forecasts_response {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConsensusForecastsItem {
#[prost(string, tag = "1")]
pub uid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub asset_uid: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub created_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "4")]
pub best_target_price: ::core::option::Option<super::Quotation>,
#[prost(message, optional, tag = "5")]
pub best_target_low: ::core::option::Option<super::Quotation>,
#[prost(message, optional, tag = "6")]
pub best_target_high: ::core::option::Option<super::Quotation>,
#[prost(int32, tag = "7")]
pub total_buy_recommend: i32,
#[prost(int32, tag = "8")]
pub total_hold_recommend: i32,
#[prost(int32, tag = "9")]
pub total_sell_recommend: i32,
#[prost(string, tag = "10")]
pub currency: ::prost::alloc::string::String,
#[prost(enumeration = "super::Recommendation", tag = "11")]
pub consensus: i32,
#[prost(message, optional, tag = "12")]
pub prognosis_date: ::core::option::Option<::prost_types::Timestamp>,
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetForecastRequest {
#[prost(string, tag = "1")]
pub instrument_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetForecastResponse {
#[prost(message, repeated, tag = "1")]
pub targets: ::prost::alloc::vec::Vec<get_forecast_response::TargetItem>,
#[prost(message, optional, tag = "2")]
pub consensus: ::core::option::Option<get_forecast_response::ConsensusItem>,
}
pub mod get_forecast_response {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TargetItem {
#[prost(string, tag = "1")]
pub uid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub ticker: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub company: ::prost::alloc::string::String,
#[prost(enumeration = "super::Recommendation", tag = "4")]
pub recommendation: i32,
#[prost(message, optional, tag = "5")]
pub recommendation_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "6")]
pub currency: ::prost::alloc::string::String,
#[prost(message, optional, tag = "7")]
pub current_price: ::core::option::Option<super::Quotation>,
#[prost(message, optional, tag = "8")]
pub target_price: ::core::option::Option<super::Quotation>,
#[prost(message, optional, tag = "9")]
pub price_change: ::core::option::Option<super::Quotation>,
#[prost(message, optional, tag = "10")]
pub price_change_rel: ::core::option::Option<super::Quotation>,
#[prost(string, tag = "11")]
pub show_name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConsensusItem {
#[prost(string, tag = "1")]
pub uid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub ticker: ::prost::alloc::string::String,
#[prost(enumeration = "super::Recommendation", tag = "3")]
pub recommendation: i32,
#[prost(string, tag = "4")]
pub currency: ::prost::alloc::string::String,
#[prost(message, optional, tag = "5")]
pub current_price: ::core::option::Option<super::Quotation>,
#[prost(message, optional, tag = "6")]
pub consensus: ::core::option::Option<super::Quotation>,
#[prost(message, optional, tag = "7")]
pub min_target: ::core::option::Option<super::Quotation>,
#[prost(message, optional, tag = "8")]
pub max_target: ::core::option::Option<super::Quotation>,
#[prost(message, optional, tag = "9")]
pub price_change: ::core::option::Option<super::Quotation>,
#[prost(message, optional, tag = "10")]
pub price_change_rel: ::core::option::Option<super::Quotation>,
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TradingInterval {
#[prost(string, tag = "1")]
pub r#type: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub interval: ::core::option::Option<trading_interval::TimeInterval>,
}
pub mod trading_interval {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TimeInterval {
#[prost(message, optional, tag = "1")]
pub start_ts: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "2")]
pub end_ts: ::core::option::Option<::prost_types::Timestamp>,
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum CouponType {
Unspecified = 0,
Constant = 1,
Floating = 2,
Discount = 3,
Mortgage = 4,
Fix = 5,
Variable = 6,
Other = 7,
}
impl CouponType {
pub fn as_str_name(&self) -> &'static str {
match self {
CouponType::Unspecified => "COUPON_TYPE_UNSPECIFIED",
CouponType::Constant => "COUPON_TYPE_CONSTANT",
CouponType::Floating => "COUPON_TYPE_FLOATING",
CouponType::Discount => "COUPON_TYPE_DISCOUNT",
CouponType::Mortgage => "COUPON_TYPE_MORTGAGE",
CouponType::Fix => "COUPON_TYPE_FIX",
CouponType::Variable => "COUPON_TYPE_VARIABLE",
CouponType::Other => "COUPON_TYPE_OTHER",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"COUPON_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"COUPON_TYPE_CONSTANT" => Some(Self::Constant),
"COUPON_TYPE_FLOATING" => Some(Self::Floating),
"COUPON_TYPE_DISCOUNT" => Some(Self::Discount),
"COUPON_TYPE_MORTGAGE" => Some(Self::Mortgage),
"COUPON_TYPE_FIX" => Some(Self::Fix),
"COUPON_TYPE_VARIABLE" => Some(Self::Variable),
"COUPON_TYPE_OTHER" => Some(Self::Other),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OptionDirection {
Unspecified = 0,
Put = 1,
Call = 2,
}
impl OptionDirection {
pub fn as_str_name(&self) -> &'static str {
match self {
OptionDirection::Unspecified => "OPTION_DIRECTION_UNSPECIFIED",
OptionDirection::Put => "OPTION_DIRECTION_PUT",
OptionDirection::Call => "OPTION_DIRECTION_CALL",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"OPTION_DIRECTION_UNSPECIFIED" => Some(Self::Unspecified),
"OPTION_DIRECTION_PUT" => Some(Self::Put),
"OPTION_DIRECTION_CALL" => Some(Self::Call),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OptionPaymentType {
Unspecified = 0,
Premium = 1,
Marginal = 2,
}
impl OptionPaymentType {
pub fn as_str_name(&self) -> &'static str {
match self {
OptionPaymentType::Unspecified => "OPTION_PAYMENT_TYPE_UNSPECIFIED",
OptionPaymentType::Premium => "OPTION_PAYMENT_TYPE_PREMIUM",
OptionPaymentType::Marginal => "OPTION_PAYMENT_TYPE_MARGINAL",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"OPTION_PAYMENT_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"OPTION_PAYMENT_TYPE_PREMIUM" => Some(Self::Premium),
"OPTION_PAYMENT_TYPE_MARGINAL" => Some(Self::Marginal),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OptionStyle {
Unspecified = 0,
American = 1,
European = 2,
}
impl OptionStyle {
pub fn as_str_name(&self) -> &'static str {
match self {
OptionStyle::Unspecified => "OPTION_STYLE_UNSPECIFIED",
OptionStyle::American => "OPTION_STYLE_AMERICAN",
OptionStyle::European => "OPTION_STYLE_EUROPEAN",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"OPTION_STYLE_UNSPECIFIED" => Some(Self::Unspecified),
"OPTION_STYLE_AMERICAN" => Some(Self::American),
"OPTION_STYLE_EUROPEAN" => Some(Self::European),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OptionSettlementType {
OptionExecutionTypeUnspecified = 0,
OptionExecutionTypePhysicalDelivery = 1,
OptionExecutionTypeCashSettlement = 2,
}
impl OptionSettlementType {
pub fn as_str_name(&self) -> &'static str {
match self {
OptionSettlementType::OptionExecutionTypeUnspecified => {
"OPTION_EXECUTION_TYPE_UNSPECIFIED"
}
OptionSettlementType::OptionExecutionTypePhysicalDelivery => {
"OPTION_EXECUTION_TYPE_PHYSICAL_DELIVERY"
}
OptionSettlementType::OptionExecutionTypeCashSettlement => {
"OPTION_EXECUTION_TYPE_CASH_SETTLEMENT"
}
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"OPTION_EXECUTION_TYPE_UNSPECIFIED" => {
Some(Self::OptionExecutionTypeUnspecified)
}
"OPTION_EXECUTION_TYPE_PHYSICAL_DELIVERY" => {
Some(Self::OptionExecutionTypePhysicalDelivery)
}
"OPTION_EXECUTION_TYPE_CASH_SETTLEMENT" => {
Some(Self::OptionExecutionTypeCashSettlement)
}
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum InstrumentIdType {
InstrumentIdUnspecified = 0,
Figi = 1,
Ticker = 2,
Uid = 3,
PositionUid = 4,
}
impl InstrumentIdType {
pub fn as_str_name(&self) -> &'static str {
match self {
InstrumentIdType::InstrumentIdUnspecified => "INSTRUMENT_ID_UNSPECIFIED",
InstrumentIdType::Figi => "INSTRUMENT_ID_TYPE_FIGI",
InstrumentIdType::Ticker => "INSTRUMENT_ID_TYPE_TICKER",
InstrumentIdType::Uid => "INSTRUMENT_ID_TYPE_UID",
InstrumentIdType::PositionUid => "INSTRUMENT_ID_TYPE_POSITION_UID",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"INSTRUMENT_ID_UNSPECIFIED" => Some(Self::InstrumentIdUnspecified),
"INSTRUMENT_ID_TYPE_FIGI" => Some(Self::Figi),
"INSTRUMENT_ID_TYPE_TICKER" => Some(Self::Ticker),
"INSTRUMENT_ID_TYPE_UID" => Some(Self::Uid),
"INSTRUMENT_ID_TYPE_POSITION_UID" => Some(Self::PositionUid),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum InstrumentStatus {
Unspecified = 0,
Base = 1,
All = 2,
}
impl InstrumentStatus {
pub fn as_str_name(&self) -> &'static str {
match self {
InstrumentStatus::Unspecified => "INSTRUMENT_STATUS_UNSPECIFIED",
InstrumentStatus::Base => "INSTRUMENT_STATUS_BASE",
InstrumentStatus::All => "INSTRUMENT_STATUS_ALL",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"INSTRUMENT_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
"INSTRUMENT_STATUS_BASE" => Some(Self::Base),
"INSTRUMENT_STATUS_ALL" => Some(Self::All),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ShareType {
Unspecified = 0,
Common = 1,
Preferred = 2,
Adr = 3,
Gdr = 4,
Mlp = 5,
NyRegShrs = 6,
ClosedEndFund = 7,
Reit = 8,
}
impl ShareType {
pub fn as_str_name(&self) -> &'static str {
match self {
ShareType::Unspecified => "SHARE_TYPE_UNSPECIFIED",
ShareType::Common => "SHARE_TYPE_COMMON",
ShareType::Preferred => "SHARE_TYPE_PREFERRED",
ShareType::Adr => "SHARE_TYPE_ADR",
ShareType::Gdr => "SHARE_TYPE_GDR",
ShareType::Mlp => "SHARE_TYPE_MLP",
ShareType::NyRegShrs => "SHARE_TYPE_NY_REG_SHRS",
ShareType::ClosedEndFund => "SHARE_TYPE_CLOSED_END_FUND",
ShareType::Reit => "SHARE_TYPE_REIT",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SHARE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"SHARE_TYPE_COMMON" => Some(Self::Common),
"SHARE_TYPE_PREFERRED" => Some(Self::Preferred),
"SHARE_TYPE_ADR" => Some(Self::Adr),
"SHARE_TYPE_GDR" => Some(Self::Gdr),
"SHARE_TYPE_MLP" => Some(Self::Mlp),
"SHARE_TYPE_NY_REG_SHRS" => Some(Self::NyRegShrs),
"SHARE_TYPE_CLOSED_END_FUND" => Some(Self::ClosedEndFund),
"SHARE_TYPE_REIT" => Some(Self::Reit),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum AssetType {
Unspecified = 0,
Currency = 1,
Commodity = 2,
Index = 3,
Security = 4,
}
impl AssetType {
pub fn as_str_name(&self) -> &'static str {
match self {
AssetType::Unspecified => "ASSET_TYPE_UNSPECIFIED",
AssetType::Currency => "ASSET_TYPE_CURRENCY",
AssetType::Commodity => "ASSET_TYPE_COMMODITY",
AssetType::Index => "ASSET_TYPE_INDEX",
AssetType::Security => "ASSET_TYPE_SECURITY",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ASSET_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"ASSET_TYPE_CURRENCY" => Some(Self::Currency),
"ASSET_TYPE_COMMODITY" => Some(Self::Commodity),
"ASSET_TYPE_INDEX" => Some(Self::Index),
"ASSET_TYPE_SECURITY" => Some(Self::Security),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum StructuredProductType {
SpTypeUnspecified = 0,
SpTypeDeliverable = 1,
SpTypeNonDeliverable = 2,
}
impl StructuredProductType {
pub fn as_str_name(&self) -> &'static str {
match self {
StructuredProductType::SpTypeUnspecified => "SP_TYPE_UNSPECIFIED",
StructuredProductType::SpTypeDeliverable => "SP_TYPE_DELIVERABLE",
StructuredProductType::SpTypeNonDeliverable => "SP_TYPE_NON_DELIVERABLE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SP_TYPE_UNSPECIFIED" => Some(Self::SpTypeUnspecified),
"SP_TYPE_DELIVERABLE" => Some(Self::SpTypeDeliverable),
"SP_TYPE_NON_DELIVERABLE" => Some(Self::SpTypeNonDeliverable),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum EditFavoritesActionType {
Unspecified = 0,
Add = 1,
Del = 2,
}
impl EditFavoritesActionType {
pub fn as_str_name(&self) -> &'static str {
match self {
EditFavoritesActionType::Unspecified => {
"EDIT_FAVORITES_ACTION_TYPE_UNSPECIFIED"
}
EditFavoritesActionType::Add => "EDIT_FAVORITES_ACTION_TYPE_ADD",
EditFavoritesActionType::Del => "EDIT_FAVORITES_ACTION_TYPE_DEL",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"EDIT_FAVORITES_ACTION_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"EDIT_FAVORITES_ACTION_TYPE_ADD" => Some(Self::Add),
"EDIT_FAVORITES_ACTION_TYPE_DEL" => Some(Self::Del),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum RealExchange {
Unspecified = 0,
Moex = 1,
Rts = 2,
Otc = 3,
}
impl RealExchange {
pub fn as_str_name(&self) -> &'static str {
match self {
RealExchange::Unspecified => "REAL_EXCHANGE_UNSPECIFIED",
RealExchange::Moex => "REAL_EXCHANGE_MOEX",
RealExchange::Rts => "REAL_EXCHANGE_RTS",
RealExchange::Otc => "REAL_EXCHANGE_OTC",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"REAL_EXCHANGE_UNSPECIFIED" => Some(Self::Unspecified),
"REAL_EXCHANGE_MOEX" => Some(Self::Moex),
"REAL_EXCHANGE_RTS" => Some(Self::Rts),
"REAL_EXCHANGE_OTC" => Some(Self::Otc),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Recommendation {
Unspecified = 0,
Buy = 1,
Hold = 2,
Sell = 3,
}
impl Recommendation {
pub fn as_str_name(&self) -> &'static str {
match self {
Recommendation::Unspecified => "RECOMMENDATION_UNSPECIFIED",
Recommendation::Buy => "RECOMMENDATION_BUY",
Recommendation::Hold => "RECOMMENDATION_HOLD",
Recommendation::Sell => "RECOMMENDATION_SELL",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"RECOMMENDATION_UNSPECIFIED" => Some(Self::Unspecified),
"RECOMMENDATION_BUY" => Some(Self::Buy),
"RECOMMENDATION_HOLD" => Some(Self::Hold),
"RECOMMENDATION_SELL" => Some(Self::Sell),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum RiskLevel {
Unspecified = 0,
Low = 1,
Moderate = 2,
High = 3,
}
impl RiskLevel {
pub fn as_str_name(&self) -> &'static str {
match self {
RiskLevel::Unspecified => "RISK_LEVEL_UNSPECIFIED",
RiskLevel::Low => "RISK_LEVEL_LOW",
RiskLevel::Moderate => "RISK_LEVEL_MODERATE",
RiskLevel::High => "RISK_LEVEL_HIGH",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"RISK_LEVEL_UNSPECIFIED" => Some(Self::Unspecified),
"RISK_LEVEL_LOW" => Some(Self::Low),
"RISK_LEVEL_MODERATE" => Some(Self::Moderate),
"RISK_LEVEL_HIGH" => Some(Self::High),
_ => None,
}
}
}
pub mod instruments_service_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 InstrumentsServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl InstrumentsServiceClient<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> InstrumentsServiceClient<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,
) -> InstrumentsServiceClient<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,
{
InstrumentsServiceClient::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 trading_schedules(
&mut self,
request: impl tonic::IntoRequest<super::TradingSchedulesRequest>,
) -> std::result::Result<
tonic::Response<super::TradingSchedulesResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.InstrumentsService/TradingSchedules",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.InstrumentsService",
"TradingSchedules",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn bond_by(
&mut self,
request: impl tonic::IntoRequest<super::InstrumentRequest>,
) -> std::result::Result<tonic::Response<super::BondResponse>, 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(
"/tinkoff.public.invest.api.contract.v1.InstrumentsService/BondBy",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.InstrumentsService",
"BondBy",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn bonds(
&mut self,
request: impl tonic::IntoRequest<super::InstrumentsRequest>,
) -> std::result::Result<tonic::Response<super::BondsResponse>, 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(
"/tinkoff.public.invest.api.contract.v1.InstrumentsService/Bonds",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.InstrumentsService",
"Bonds",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_bond_coupons(
&mut self,
request: impl tonic::IntoRequest<super::GetBondCouponsRequest>,
) -> std::result::Result<
tonic::Response<super::GetBondCouponsResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.InstrumentsService/GetBondCoupons",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.InstrumentsService",
"GetBondCoupons",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_bond_events(
&mut self,
request: impl tonic::IntoRequest<super::GetBondEventsRequest>,
) -> std::result::Result<
tonic::Response<super::GetBondEventsResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.InstrumentsService/GetBondEvents",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.InstrumentsService",
"GetBondEvents",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn currency_by(
&mut self,
request: impl tonic::IntoRequest<super::InstrumentRequest>,
) -> std::result::Result<
tonic::Response<super::CurrencyResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.InstrumentsService/CurrencyBy",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.InstrumentsService",
"CurrencyBy",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn currencies(
&mut self,
request: impl tonic::IntoRequest<super::InstrumentsRequest>,
) -> std::result::Result<
tonic::Response<super::CurrenciesResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.InstrumentsService/Currencies",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.InstrumentsService",
"Currencies",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn etf_by(
&mut self,
request: impl tonic::IntoRequest<super::InstrumentRequest>,
) -> std::result::Result<tonic::Response<super::EtfResponse>, 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(
"/tinkoff.public.invest.api.contract.v1.InstrumentsService/EtfBy",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.InstrumentsService",
"EtfBy",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn etfs(
&mut self,
request: impl tonic::IntoRequest<super::InstrumentsRequest>,
) -> std::result::Result<tonic::Response<super::EtfsResponse>, 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(
"/tinkoff.public.invest.api.contract.v1.InstrumentsService/Etfs",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.InstrumentsService",
"Etfs",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn future_by(
&mut self,
request: impl tonic::IntoRequest<super::InstrumentRequest>,
) -> std::result::Result<tonic::Response<super::FutureResponse>, 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(
"/tinkoff.public.invest.api.contract.v1.InstrumentsService/FutureBy",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.InstrumentsService",
"FutureBy",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn futures(
&mut self,
request: impl tonic::IntoRequest<super::InstrumentsRequest>,
) -> std::result::Result<
tonic::Response<super::FuturesResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.InstrumentsService/Futures",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.InstrumentsService",
"Futures",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn option_by(
&mut self,
request: impl tonic::IntoRequest<super::InstrumentRequest>,
) -> std::result::Result<tonic::Response<super::OptionResponse>, 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(
"/tinkoff.public.invest.api.contract.v1.InstrumentsService/OptionBy",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.InstrumentsService",
"OptionBy",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn options(
&mut self,
request: impl tonic::IntoRequest<super::InstrumentsRequest>,
) -> std::result::Result<
tonic::Response<super::OptionsResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.InstrumentsService/Options",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.InstrumentsService",
"Options",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn options_by(
&mut self,
request: impl tonic::IntoRequest<super::FilterOptionsRequest>,
) -> std::result::Result<
tonic::Response<super::OptionsResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.InstrumentsService/OptionsBy",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.InstrumentsService",
"OptionsBy",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn share_by(
&mut self,
request: impl tonic::IntoRequest<super::InstrumentRequest>,
) -> std::result::Result<tonic::Response<super::ShareResponse>, 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(
"/tinkoff.public.invest.api.contract.v1.InstrumentsService/ShareBy",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.InstrumentsService",
"ShareBy",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn shares(
&mut self,
request: impl tonic::IntoRequest<super::InstrumentsRequest>,
) -> std::result::Result<tonic::Response<super::SharesResponse>, 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(
"/tinkoff.public.invest.api.contract.v1.InstrumentsService/Shares",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.InstrumentsService",
"Shares",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn indicatives(
&mut self,
request: impl tonic::IntoRequest<super::IndicativesRequest>,
) -> std::result::Result<
tonic::Response<super::IndicativesResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.InstrumentsService/Indicatives",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.InstrumentsService",
"Indicatives",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_accrued_interests(
&mut self,
request: impl tonic::IntoRequest<super::GetAccruedInterestsRequest>,
) -> std::result::Result<
tonic::Response<super::GetAccruedInterestsResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.InstrumentsService/GetAccruedInterests",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.InstrumentsService",
"GetAccruedInterests",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_futures_margin(
&mut self,
request: impl tonic::IntoRequest<super::GetFuturesMarginRequest>,
) -> std::result::Result<
tonic::Response<super::GetFuturesMarginResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.InstrumentsService/GetFuturesMargin",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.InstrumentsService",
"GetFuturesMargin",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_instrument_by(
&mut self,
request: impl tonic::IntoRequest<super::InstrumentRequest>,
) -> std::result::Result<
tonic::Response<super::InstrumentResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.InstrumentsService/GetInstrumentBy",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.InstrumentsService",
"GetInstrumentBy",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_dividends(
&mut self,
request: impl tonic::IntoRequest<super::GetDividendsRequest>,
) -> std::result::Result<
tonic::Response<super::GetDividendsResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.InstrumentsService/GetDividends",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.InstrumentsService",
"GetDividends",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_asset_by(
&mut self,
request: impl tonic::IntoRequest<super::AssetRequest>,
) -> std::result::Result<tonic::Response<super::AssetResponse>, 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(
"/tinkoff.public.invest.api.contract.v1.InstrumentsService/GetAssetBy",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.InstrumentsService",
"GetAssetBy",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_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::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/tinkoff.public.invest.api.contract.v1.InstrumentsService/GetAssets",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.InstrumentsService",
"GetAssets",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_favorites(
&mut self,
request: impl tonic::IntoRequest<super::GetFavoritesRequest>,
) -> std::result::Result<
tonic::Response<super::GetFavoritesResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.InstrumentsService/GetFavorites",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.InstrumentsService",
"GetFavorites",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn edit_favorites(
&mut self,
request: impl tonic::IntoRequest<super::EditFavoritesRequest>,
) -> std::result::Result<
tonic::Response<super::EditFavoritesResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.InstrumentsService/EditFavorites",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.InstrumentsService",
"EditFavorites",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_countries(
&mut self,
request: impl tonic::IntoRequest<super::GetCountriesRequest>,
) -> std::result::Result<
tonic::Response<super::GetCountriesResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.InstrumentsService/GetCountries",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.InstrumentsService",
"GetCountries",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn find_instrument(
&mut self,
request: impl tonic::IntoRequest<super::FindInstrumentRequest>,
) -> std::result::Result<
tonic::Response<super::FindInstrumentResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.InstrumentsService/FindInstrument",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.InstrumentsService",
"FindInstrument",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_brands(
&mut self,
request: impl tonic::IntoRequest<super::GetBrandsRequest>,
) -> std::result::Result<
tonic::Response<super::GetBrandsResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.InstrumentsService/GetBrands",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.InstrumentsService",
"GetBrands",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_brand_by(
&mut self,
request: impl tonic::IntoRequest<super::GetBrandRequest>,
) -> std::result::Result<tonic::Response<super::Brand>, 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(
"/tinkoff.public.invest.api.contract.v1.InstrumentsService/GetBrandBy",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.InstrumentsService",
"GetBrandBy",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_asset_fundamentals(
&mut self,
request: impl tonic::IntoRequest<super::GetAssetFundamentalsRequest>,
) -> std::result::Result<
tonic::Response<super::GetAssetFundamentalsResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.InstrumentsService/GetAssetFundamentals",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.InstrumentsService",
"GetAssetFundamentals",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_asset_reports(
&mut self,
request: impl tonic::IntoRequest<super::GetAssetReportsRequest>,
) -> std::result::Result<
tonic::Response<super::GetAssetReportsResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.InstrumentsService/GetAssetReports",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.InstrumentsService",
"GetAssetReports",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_consensus_forecasts(
&mut self,
request: impl tonic::IntoRequest<super::GetConsensusForecastsRequest>,
) -> std::result::Result<
tonic::Response<super::GetConsensusForecastsResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.InstrumentsService/GetConsensusForecasts",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.InstrumentsService",
"GetConsensusForecasts",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_forecast_by(
&mut self,
request: impl tonic::IntoRequest<super::GetForecastRequest>,
) -> std::result::Result<
tonic::Response<super::GetForecastResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.InstrumentsService/GetForecastBy",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.InstrumentsService",
"GetForecastBy",
),
);
self.inner.unary(req, path, codec).await
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MarketDataRequest {
#[prost(oneof = "market_data_request::Payload", tags = "1, 2, 3, 4, 5, 6")]
pub payload: ::core::option::Option<market_data_request::Payload>,
}
pub mod market_data_request {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Payload {
#[prost(message, tag = "1")]
SubscribeCandlesRequest(super::SubscribeCandlesRequest),
#[prost(message, tag = "2")]
SubscribeOrderBookRequest(super::SubscribeOrderBookRequest),
#[prost(message, tag = "3")]
SubscribeTradesRequest(super::SubscribeTradesRequest),
#[prost(message, tag = "4")]
SubscribeInfoRequest(super::SubscribeInfoRequest),
#[prost(message, tag = "5")]
SubscribeLastPriceRequest(super::SubscribeLastPriceRequest),
#[prost(message, tag = "6")]
GetMySubscriptions(super::GetMySubscriptions),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MarketDataServerSideStreamRequest {
#[prost(message, optional, tag = "1")]
pub subscribe_candles_request: ::core::option::Option<SubscribeCandlesRequest>,
#[prost(message, optional, tag = "2")]
pub subscribe_order_book_request: ::core::option::Option<SubscribeOrderBookRequest>,
#[prost(message, optional, tag = "3")]
pub subscribe_trades_request: ::core::option::Option<SubscribeTradesRequest>,
#[prost(message, optional, tag = "4")]
pub subscribe_info_request: ::core::option::Option<SubscribeInfoRequest>,
#[prost(message, optional, tag = "5")]
pub subscribe_last_price_request: ::core::option::Option<SubscribeLastPriceRequest>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MarketDataResponse {
#[prost(
oneof = "market_data_response::Payload",
tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11"
)]
pub payload: ::core::option::Option<market_data_response::Payload>,
}
pub mod market_data_response {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Payload {
#[prost(message, tag = "1")]
SubscribeCandlesResponse(super::SubscribeCandlesResponse),
#[prost(message, tag = "2")]
SubscribeOrderBookResponse(super::SubscribeOrderBookResponse),
#[prost(message, tag = "3")]
SubscribeTradesResponse(super::SubscribeTradesResponse),
#[prost(message, tag = "4")]
SubscribeInfoResponse(super::SubscribeInfoResponse),
#[prost(message, tag = "5")]
Candle(super::Candle),
#[prost(message, tag = "6")]
Trade(super::Trade),
#[prost(message, tag = "7")]
Orderbook(super::OrderBook),
#[prost(message, tag = "8")]
TradingStatus(super::TradingStatus),
#[prost(message, tag = "9")]
Ping(super::Ping),
#[prost(message, tag = "10")]
SubscribeLastPriceResponse(super::SubscribeLastPriceResponse),
#[prost(message, tag = "11")]
LastPrice(super::LastPrice),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubscribeCandlesRequest {
#[prost(enumeration = "SubscriptionAction", tag = "1")]
pub subscription_action: i32,
#[prost(message, repeated, tag = "2")]
pub instruments: ::prost::alloc::vec::Vec<CandleInstrument>,
#[prost(bool, tag = "3")]
pub waiting_close: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CandleInstrument {
#[deprecated]
#[prost(string, tag = "1")]
pub figi: ::prost::alloc::string::String,
#[prost(enumeration = "SubscriptionInterval", tag = "2")]
pub interval: i32,
#[prost(string, tag = "3")]
pub instrument_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubscribeCandlesResponse {
#[prost(string, tag = "1")]
pub tracking_id: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub candles_subscriptions: ::prost::alloc::vec::Vec<CandleSubscription>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CandleSubscription {
#[prost(string, tag = "1")]
pub figi: ::prost::alloc::string::String,
#[prost(enumeration = "SubscriptionInterval", tag = "2")]
pub interval: i32,
#[prost(enumeration = "SubscriptionStatus", tag = "3")]
pub subscription_status: i32,
#[prost(string, tag = "4")]
pub instrument_uid: ::prost::alloc::string::String,
#[prost(bool, tag = "5")]
pub waiting_close: bool,
#[prost(string, tag = "6")]
pub stream_id: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub subscription_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubscribeOrderBookRequest {
#[prost(enumeration = "SubscriptionAction", tag = "1")]
pub subscription_action: i32,
#[prost(message, repeated, tag = "2")]
pub instruments: ::prost::alloc::vec::Vec<OrderBookInstrument>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OrderBookInstrument {
#[deprecated]
#[prost(string, tag = "1")]
pub figi: ::prost::alloc::string::String,
#[prost(int32, tag = "2")]
pub depth: i32,
#[prost(string, tag = "3")]
pub instrument_id: ::prost::alloc::string::String,
#[prost(enumeration = "OrderBookType", tag = "4")]
pub order_book_type: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubscribeOrderBookResponse {
#[prost(string, tag = "1")]
pub tracking_id: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub order_book_subscriptions: ::prost::alloc::vec::Vec<OrderBookSubscription>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OrderBookSubscription {
#[prost(string, tag = "1")]
pub figi: ::prost::alloc::string::String,
#[prost(int32, tag = "2")]
pub depth: i32,
#[prost(enumeration = "SubscriptionStatus", tag = "3")]
pub subscription_status: i32,
#[prost(string, tag = "4")]
pub instrument_uid: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub stream_id: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub subscription_id: ::prost::alloc::string::String,
#[prost(enumeration = "OrderBookType", tag = "7")]
pub order_book_type: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubscribeTradesRequest {
#[prost(enumeration = "SubscriptionAction", tag = "1")]
pub subscription_action: i32,
#[prost(message, repeated, tag = "2")]
pub instruments: ::prost::alloc::vec::Vec<TradeInstrument>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TradeInstrument {
#[deprecated]
#[prost(string, tag = "1")]
pub figi: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub instrument_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubscribeTradesResponse {
#[prost(string, tag = "1")]
pub tracking_id: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub trade_subscriptions: ::prost::alloc::vec::Vec<TradeSubscription>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TradeSubscription {
#[prost(string, tag = "1")]
pub figi: ::prost::alloc::string::String,
#[prost(enumeration = "SubscriptionStatus", tag = "2")]
pub subscription_status: i32,
#[prost(string, tag = "3")]
pub instrument_uid: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub stream_id: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub subscription_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubscribeInfoRequest {
#[prost(enumeration = "SubscriptionAction", tag = "1")]
pub subscription_action: i32,
#[prost(message, repeated, tag = "2")]
pub instruments: ::prost::alloc::vec::Vec<InfoInstrument>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InfoInstrument {
#[deprecated]
#[prost(string, tag = "1")]
pub figi: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub instrument_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubscribeInfoResponse {
#[prost(string, tag = "1")]
pub tracking_id: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub info_subscriptions: ::prost::alloc::vec::Vec<InfoSubscription>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InfoSubscription {
#[prost(string, tag = "1")]
pub figi: ::prost::alloc::string::String,
#[prost(enumeration = "SubscriptionStatus", tag = "2")]
pub subscription_status: i32,
#[prost(string, tag = "3")]
pub instrument_uid: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub stream_id: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub subscription_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubscribeLastPriceRequest {
#[prost(enumeration = "SubscriptionAction", tag = "1")]
pub subscription_action: i32,
#[prost(message, repeated, tag = "2")]
pub instruments: ::prost::alloc::vec::Vec<LastPriceInstrument>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LastPriceInstrument {
#[deprecated]
#[prost(string, tag = "1")]
pub figi: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub instrument_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubscribeLastPriceResponse {
#[prost(string, tag = "1")]
pub tracking_id: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub last_price_subscriptions: ::prost::alloc::vec::Vec<LastPriceSubscription>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LastPriceSubscription {
#[prost(string, tag = "1")]
pub figi: ::prost::alloc::string::String,
#[prost(enumeration = "SubscriptionStatus", tag = "2")]
pub subscription_status: i32,
#[prost(string, tag = "3")]
pub instrument_uid: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub stream_id: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub subscription_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Candle {
#[prost(string, tag = "1")]
pub figi: ::prost::alloc::string::String,
#[prost(enumeration = "SubscriptionInterval", tag = "2")]
pub interval: i32,
#[prost(message, optional, tag = "3")]
pub open: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "4")]
pub high: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "5")]
pub low: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "6")]
pub close: ::core::option::Option<Quotation>,
#[prost(int64, tag = "7")]
pub volume: i64,
#[prost(message, optional, tag = "8")]
pub time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "9")]
pub last_trade_ts: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "10")]
pub instrument_uid: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OrderBook {
#[prost(string, tag = "1")]
pub figi: ::prost::alloc::string::String,
#[prost(int32, tag = "2")]
pub depth: i32,
#[prost(bool, tag = "3")]
pub is_consistent: bool,
#[prost(message, repeated, tag = "4")]
pub bids: ::prost::alloc::vec::Vec<Order>,
#[prost(message, repeated, tag = "5")]
pub asks: ::prost::alloc::vec::Vec<Order>,
#[prost(message, optional, tag = "6")]
pub time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "7")]
pub limit_up: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "8")]
pub limit_down: ::core::option::Option<Quotation>,
#[prost(string, tag = "9")]
pub instrument_uid: ::prost::alloc::string::String,
#[prost(enumeration = "OrderBookType", tag = "10")]
pub order_book_type: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Order {
#[prost(message, optional, tag = "1")]
pub price: ::core::option::Option<Quotation>,
#[prost(int64, tag = "2")]
pub quantity: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Trade {
#[prost(string, tag = "1")]
pub figi: ::prost::alloc::string::String,
#[prost(enumeration = "TradeDirection", tag = "2")]
pub direction: i32,
#[prost(message, optional, tag = "3")]
pub price: ::core::option::Option<Quotation>,
#[prost(int64, tag = "4")]
pub quantity: i64,
#[prost(message, optional, tag = "5")]
pub time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "6")]
pub instrument_uid: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TradingStatus {
#[prost(string, tag = "1")]
pub figi: ::prost::alloc::string::String,
#[prost(enumeration = "SecurityTradingStatus", tag = "2")]
pub trading_status: i32,
#[prost(message, optional, tag = "3")]
pub time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(bool, tag = "4")]
pub limit_order_available_flag: bool,
#[prost(bool, tag = "5")]
pub market_order_available_flag: bool,
#[prost(string, tag = "6")]
pub instrument_uid: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetCandlesRequest {
#[deprecated]
#[prost(string, optional, tag = "1")]
pub figi: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub from: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "3")]
pub to: ::core::option::Option<::prost_types::Timestamp>,
#[prost(enumeration = "CandleInterval", tag = "4")]
pub interval: i32,
#[prost(string, optional, tag = "5")]
pub instrument_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(enumeration = "get_candles_request::CandleSource", optional, tag = "7")]
pub candle_source_type: ::core::option::Option<i32>,
}
pub mod get_candles_request {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum CandleSource {
Unspecified = 0,
Exchange = 1,
}
impl CandleSource {
pub fn as_str_name(&self) -> &'static str {
match self {
CandleSource::Unspecified => "CANDLE_SOURCE_UNSPECIFIED",
CandleSource::Exchange => "CANDLE_SOURCE_EXCHANGE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"CANDLE_SOURCE_UNSPECIFIED" => Some(Self::Unspecified),
"CANDLE_SOURCE_EXCHANGE" => Some(Self::Exchange),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetCandlesResponse {
#[prost(message, repeated, tag = "1")]
pub candles: ::prost::alloc::vec::Vec<HistoricCandle>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HistoricCandle {
#[prost(message, optional, tag = "1")]
pub open: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "2")]
pub high: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "3")]
pub low: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "4")]
pub close: ::core::option::Option<Quotation>,
#[prost(int64, tag = "5")]
pub volume: i64,
#[prost(message, optional, tag = "6")]
pub time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(bool, tag = "7")]
pub is_complete: bool,
#[prost(enumeration = "CandleSource", tag = "9")]
pub candle_source: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetLastPricesRequest {
#[deprecated]
#[prost(string, repeated, tag = "1")]
pub figi: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "2")]
pub instrument_id: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetLastPricesResponse {
#[prost(message, repeated, tag = "1")]
pub last_prices: ::prost::alloc::vec::Vec<LastPrice>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LastPrice {
#[prost(string, tag = "1")]
pub figi: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub price: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "3")]
pub time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "11")]
pub instrument_uid: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetOrderBookRequest {
#[deprecated]
#[prost(string, optional, tag = "1")]
pub figi: ::core::option::Option<::prost::alloc::string::String>,
#[prost(int32, tag = "2")]
pub depth: i32,
#[prost(string, optional, tag = "3")]
pub instrument_id: ::core::option::Option<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetOrderBookResponse {
#[prost(string, tag = "1")]
pub figi: ::prost::alloc::string::String,
#[prost(int32, tag = "2")]
pub depth: i32,
#[prost(message, repeated, tag = "3")]
pub bids: ::prost::alloc::vec::Vec<Order>,
#[prost(message, repeated, tag = "4")]
pub asks: ::prost::alloc::vec::Vec<Order>,
#[prost(message, optional, tag = "5")]
pub last_price: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "6")]
pub close_price: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "7")]
pub limit_up: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "8")]
pub limit_down: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "21")]
pub last_price_ts: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "22")]
pub close_price_ts: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "23")]
pub orderbook_ts: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "9")]
pub instrument_uid: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetTradingStatusRequest {
#[deprecated]
#[prost(string, optional, tag = "1")]
pub figi: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "2")]
pub instrument_id: ::core::option::Option<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetTradingStatusesRequest {
#[prost(string, repeated, tag = "1")]
pub instrument_id: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetTradingStatusesResponse {
#[prost(message, repeated, tag = "1")]
pub trading_statuses: ::prost::alloc::vec::Vec<GetTradingStatusResponse>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetTradingStatusResponse {
#[prost(string, tag = "1")]
pub figi: ::prost::alloc::string::String,
#[prost(enumeration = "SecurityTradingStatus", tag = "2")]
pub trading_status: i32,
#[prost(bool, tag = "3")]
pub limit_order_available_flag: bool,
#[prost(bool, tag = "4")]
pub market_order_available_flag: bool,
#[prost(bool, tag = "5")]
pub api_trade_available_flag: bool,
#[prost(string, tag = "6")]
pub instrument_uid: ::prost::alloc::string::String,
#[prost(bool, tag = "8")]
pub bestprice_order_available_flag: bool,
#[prost(bool, tag = "9")]
pub only_best_price: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetLastTradesRequest {
#[deprecated]
#[prost(string, optional, tag = "1")]
pub figi: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub from: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "3")]
pub to: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, optional, tag = "4")]
pub instrument_id: ::core::option::Option<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetLastTradesResponse {
#[prost(message, repeated, tag = "1")]
pub trades: ::prost::alloc::vec::Vec<Trade>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetMySubscriptions {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetClosePricesRequest {
#[prost(message, repeated, tag = "1")]
pub instruments: ::prost::alloc::vec::Vec<InstrumentClosePriceRequest>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InstrumentClosePriceRequest {
#[prost(string, tag = "1")]
pub instrument_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetClosePricesResponse {
#[prost(message, repeated, tag = "1")]
pub close_prices: ::prost::alloc::vec::Vec<InstrumentClosePriceResponse>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InstrumentClosePriceResponse {
#[prost(string, tag = "1")]
pub figi: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub instrument_uid: ::prost::alloc::string::String,
#[prost(message, optional, tag = "11")]
pub price: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "12")]
pub evening_session_price: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "21")]
pub time: ::core::option::Option<::prost_types::Timestamp>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetTechAnalysisRequest {
#[prost(enumeration = "get_tech_analysis_request::IndicatorType", tag = "1")]
pub indicator_type: i32,
#[prost(string, tag = "2")]
pub instrument_uid: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub from: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "4")]
pub to: ::core::option::Option<::prost_types::Timestamp>,
#[prost(enumeration = "get_tech_analysis_request::IndicatorInterval", tag = "5")]
pub interval: i32,
#[prost(enumeration = "get_tech_analysis_request::TypeOfPrice", tag = "6")]
pub type_of_price: i32,
#[prost(int32, tag = "7")]
pub length: i32,
#[prost(message, optional, tag = "8")]
pub deviation: ::core::option::Option<get_tech_analysis_request::Deviation>,
#[prost(message, optional, tag = "9")]
pub smoothing: ::core::option::Option<get_tech_analysis_request::Smoothing>,
}
pub mod get_tech_analysis_request {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Smoothing {
#[prost(int32, tag = "1")]
pub fast_length: i32,
#[prost(int32, tag = "2")]
pub slow_length: i32,
#[prost(int32, tag = "3")]
pub signal_smoothing: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Deviation {
#[prost(message, optional, tag = "1")]
pub deviation_multiplier: ::core::option::Option<super::Quotation>,
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum IndicatorInterval {
Unspecified = 0,
OneMinute = 1,
FiveMinutes = 2,
FifteenMinutes = 3,
OneHour = 4,
OneDay = 5,
IndicatorInterval2Min = 6,
IndicatorInterval3Min = 7,
IndicatorInterval10Min = 8,
IndicatorInterval30Min = 9,
IndicatorInterval2Hour = 10,
IndicatorInterval4Hour = 11,
Week = 12,
Month = 13,
}
impl IndicatorInterval {
pub fn as_str_name(&self) -> &'static str {
match self {
IndicatorInterval::Unspecified => "INDICATOR_INTERVAL_UNSPECIFIED",
IndicatorInterval::OneMinute => "INDICATOR_INTERVAL_ONE_MINUTE",
IndicatorInterval::FiveMinutes => "INDICATOR_INTERVAL_FIVE_MINUTES",
IndicatorInterval::FifteenMinutes => "INDICATOR_INTERVAL_FIFTEEN_MINUTES",
IndicatorInterval::OneHour => "INDICATOR_INTERVAL_ONE_HOUR",
IndicatorInterval::OneDay => "INDICATOR_INTERVAL_ONE_DAY",
IndicatorInterval::IndicatorInterval2Min => "INDICATOR_INTERVAL_2_MIN",
IndicatorInterval::IndicatorInterval3Min => "INDICATOR_INTERVAL_3_MIN",
IndicatorInterval::IndicatorInterval10Min => "INDICATOR_INTERVAL_10_MIN",
IndicatorInterval::IndicatorInterval30Min => "INDICATOR_INTERVAL_30_MIN",
IndicatorInterval::IndicatorInterval2Hour => "INDICATOR_INTERVAL_2_HOUR",
IndicatorInterval::IndicatorInterval4Hour => "INDICATOR_INTERVAL_4_HOUR",
IndicatorInterval::Week => "INDICATOR_INTERVAL_WEEK",
IndicatorInterval::Month => "INDICATOR_INTERVAL_MONTH",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"INDICATOR_INTERVAL_UNSPECIFIED" => Some(Self::Unspecified),
"INDICATOR_INTERVAL_ONE_MINUTE" => Some(Self::OneMinute),
"INDICATOR_INTERVAL_FIVE_MINUTES" => Some(Self::FiveMinutes),
"INDICATOR_INTERVAL_FIFTEEN_MINUTES" => Some(Self::FifteenMinutes),
"INDICATOR_INTERVAL_ONE_HOUR" => Some(Self::OneHour),
"INDICATOR_INTERVAL_ONE_DAY" => Some(Self::OneDay),
"INDICATOR_INTERVAL_2_MIN" => Some(Self::IndicatorInterval2Min),
"INDICATOR_INTERVAL_3_MIN" => Some(Self::IndicatorInterval3Min),
"INDICATOR_INTERVAL_10_MIN" => Some(Self::IndicatorInterval10Min),
"INDICATOR_INTERVAL_30_MIN" => Some(Self::IndicatorInterval30Min),
"INDICATOR_INTERVAL_2_HOUR" => Some(Self::IndicatorInterval2Hour),
"INDICATOR_INTERVAL_4_HOUR" => Some(Self::IndicatorInterval4Hour),
"INDICATOR_INTERVAL_WEEK" => Some(Self::Week),
"INDICATOR_INTERVAL_MONTH" => Some(Self::Month),
_ => None,
}
}
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum TypeOfPrice {
Unspecified = 0,
Close = 1,
Open = 2,
High = 3,
Low = 4,
Avg = 5,
}
impl TypeOfPrice {
pub fn as_str_name(&self) -> &'static str {
match self {
TypeOfPrice::Unspecified => "TYPE_OF_PRICE_UNSPECIFIED",
TypeOfPrice::Close => "TYPE_OF_PRICE_CLOSE",
TypeOfPrice::Open => "TYPE_OF_PRICE_OPEN",
TypeOfPrice::High => "TYPE_OF_PRICE_HIGH",
TypeOfPrice::Low => "TYPE_OF_PRICE_LOW",
TypeOfPrice::Avg => "TYPE_OF_PRICE_AVG",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TYPE_OF_PRICE_UNSPECIFIED" => Some(Self::Unspecified),
"TYPE_OF_PRICE_CLOSE" => Some(Self::Close),
"TYPE_OF_PRICE_OPEN" => Some(Self::Open),
"TYPE_OF_PRICE_HIGH" => Some(Self::High),
"TYPE_OF_PRICE_LOW" => Some(Self::Low),
"TYPE_OF_PRICE_AVG" => Some(Self::Avg),
_ => None,
}
}
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum IndicatorType {
Unspecified = 0,
Bb = 1,
Ema = 2,
Rsi = 3,
Macd = 4,
Sma = 5,
}
impl IndicatorType {
pub fn as_str_name(&self) -> &'static str {
match self {
IndicatorType::Unspecified => "INDICATOR_TYPE_UNSPECIFIED",
IndicatorType::Bb => "INDICATOR_TYPE_BB",
IndicatorType::Ema => "INDICATOR_TYPE_EMA",
IndicatorType::Rsi => "INDICATOR_TYPE_RSI",
IndicatorType::Macd => "INDICATOR_TYPE_MACD",
IndicatorType::Sma => "INDICATOR_TYPE_SMA",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"INDICATOR_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"INDICATOR_TYPE_BB" => Some(Self::Bb),
"INDICATOR_TYPE_EMA" => Some(Self::Ema),
"INDICATOR_TYPE_RSI" => Some(Self::Rsi),
"INDICATOR_TYPE_MACD" => Some(Self::Macd),
"INDICATOR_TYPE_SMA" => Some(Self::Sma),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetTechAnalysisResponse {
#[prost(message, repeated, tag = "1")]
pub technical_indicators: ::prost::alloc::vec::Vec<
get_tech_analysis_response::TechAnalysisItem,
>,
}
pub mod get_tech_analysis_response {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TechAnalysisItem {
#[prost(message, optional, tag = "1")]
pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "2")]
pub middle_band: ::core::option::Option<super::Quotation>,
#[prost(message, optional, tag = "3")]
pub upper_band: ::core::option::Option<super::Quotation>,
#[prost(message, optional, tag = "4")]
pub lower_band: ::core::option::Option<super::Quotation>,
#[prost(message, optional, tag = "5")]
pub signal: ::core::option::Option<super::Quotation>,
#[prost(message, optional, tag = "6")]
pub macd: ::core::option::Option<super::Quotation>,
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SubscriptionAction {
Unspecified = 0,
Subscribe = 1,
Unsubscribe = 2,
}
impl SubscriptionAction {
pub fn as_str_name(&self) -> &'static str {
match self {
SubscriptionAction::Unspecified => "SUBSCRIPTION_ACTION_UNSPECIFIED",
SubscriptionAction::Subscribe => "SUBSCRIPTION_ACTION_SUBSCRIBE",
SubscriptionAction::Unsubscribe => "SUBSCRIPTION_ACTION_UNSUBSCRIBE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SUBSCRIPTION_ACTION_UNSPECIFIED" => Some(Self::Unspecified),
"SUBSCRIPTION_ACTION_SUBSCRIBE" => Some(Self::Subscribe),
"SUBSCRIPTION_ACTION_UNSUBSCRIBE" => Some(Self::Unsubscribe),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SubscriptionInterval {
Unspecified = 0,
OneMinute = 1,
FiveMinutes = 2,
FifteenMinutes = 3,
OneHour = 4,
OneDay = 5,
SubscriptionInterval2Min = 6,
SubscriptionInterval3Min = 7,
SubscriptionInterval10Min = 8,
SubscriptionInterval30Min = 9,
SubscriptionInterval2Hour = 10,
SubscriptionInterval4Hour = 11,
Week = 12,
Month = 13,
}
impl SubscriptionInterval {
pub fn as_str_name(&self) -> &'static str {
match self {
SubscriptionInterval::Unspecified => "SUBSCRIPTION_INTERVAL_UNSPECIFIED",
SubscriptionInterval::OneMinute => "SUBSCRIPTION_INTERVAL_ONE_MINUTE",
SubscriptionInterval::FiveMinutes => "SUBSCRIPTION_INTERVAL_FIVE_MINUTES",
SubscriptionInterval::FifteenMinutes => {
"SUBSCRIPTION_INTERVAL_FIFTEEN_MINUTES"
}
SubscriptionInterval::OneHour => "SUBSCRIPTION_INTERVAL_ONE_HOUR",
SubscriptionInterval::OneDay => "SUBSCRIPTION_INTERVAL_ONE_DAY",
SubscriptionInterval::SubscriptionInterval2Min => {
"SUBSCRIPTION_INTERVAL_2_MIN"
}
SubscriptionInterval::SubscriptionInterval3Min => {
"SUBSCRIPTION_INTERVAL_3_MIN"
}
SubscriptionInterval::SubscriptionInterval10Min => {
"SUBSCRIPTION_INTERVAL_10_MIN"
}
SubscriptionInterval::SubscriptionInterval30Min => {
"SUBSCRIPTION_INTERVAL_30_MIN"
}
SubscriptionInterval::SubscriptionInterval2Hour => {
"SUBSCRIPTION_INTERVAL_2_HOUR"
}
SubscriptionInterval::SubscriptionInterval4Hour => {
"SUBSCRIPTION_INTERVAL_4_HOUR"
}
SubscriptionInterval::Week => "SUBSCRIPTION_INTERVAL_WEEK",
SubscriptionInterval::Month => "SUBSCRIPTION_INTERVAL_MONTH",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SUBSCRIPTION_INTERVAL_UNSPECIFIED" => Some(Self::Unspecified),
"SUBSCRIPTION_INTERVAL_ONE_MINUTE" => Some(Self::OneMinute),
"SUBSCRIPTION_INTERVAL_FIVE_MINUTES" => Some(Self::FiveMinutes),
"SUBSCRIPTION_INTERVAL_FIFTEEN_MINUTES" => Some(Self::FifteenMinutes),
"SUBSCRIPTION_INTERVAL_ONE_HOUR" => Some(Self::OneHour),
"SUBSCRIPTION_INTERVAL_ONE_DAY" => Some(Self::OneDay),
"SUBSCRIPTION_INTERVAL_2_MIN" => Some(Self::SubscriptionInterval2Min),
"SUBSCRIPTION_INTERVAL_3_MIN" => Some(Self::SubscriptionInterval3Min),
"SUBSCRIPTION_INTERVAL_10_MIN" => Some(Self::SubscriptionInterval10Min),
"SUBSCRIPTION_INTERVAL_30_MIN" => Some(Self::SubscriptionInterval30Min),
"SUBSCRIPTION_INTERVAL_2_HOUR" => Some(Self::SubscriptionInterval2Hour),
"SUBSCRIPTION_INTERVAL_4_HOUR" => Some(Self::SubscriptionInterval4Hour),
"SUBSCRIPTION_INTERVAL_WEEK" => Some(Self::Week),
"SUBSCRIPTION_INTERVAL_MONTH" => Some(Self::Month),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SubscriptionStatus {
Unspecified = 0,
Success = 1,
InstrumentNotFound = 2,
SubscriptionActionIsInvalid = 3,
DepthIsInvalid = 4,
IntervalIsInvalid = 5,
LimitIsExceeded = 6,
InternalError = 7,
TooManyRequests = 8,
SubscriptionNotFound = 9,
}
impl SubscriptionStatus {
pub fn as_str_name(&self) -> &'static str {
match self {
SubscriptionStatus::Unspecified => "SUBSCRIPTION_STATUS_UNSPECIFIED",
SubscriptionStatus::Success => "SUBSCRIPTION_STATUS_SUCCESS",
SubscriptionStatus::InstrumentNotFound => {
"SUBSCRIPTION_STATUS_INSTRUMENT_NOT_FOUND"
}
SubscriptionStatus::SubscriptionActionIsInvalid => {
"SUBSCRIPTION_STATUS_SUBSCRIPTION_ACTION_IS_INVALID"
}
SubscriptionStatus::DepthIsInvalid => "SUBSCRIPTION_STATUS_DEPTH_IS_INVALID",
SubscriptionStatus::IntervalIsInvalid => {
"SUBSCRIPTION_STATUS_INTERVAL_IS_INVALID"
}
SubscriptionStatus::LimitIsExceeded => {
"SUBSCRIPTION_STATUS_LIMIT_IS_EXCEEDED"
}
SubscriptionStatus::InternalError => "SUBSCRIPTION_STATUS_INTERNAL_ERROR",
SubscriptionStatus::TooManyRequests => {
"SUBSCRIPTION_STATUS_TOO_MANY_REQUESTS"
}
SubscriptionStatus::SubscriptionNotFound => {
"SUBSCRIPTION_STATUS_SUBSCRIPTION_NOT_FOUND"
}
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SUBSCRIPTION_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
"SUBSCRIPTION_STATUS_SUCCESS" => Some(Self::Success),
"SUBSCRIPTION_STATUS_INSTRUMENT_NOT_FOUND" => Some(Self::InstrumentNotFound),
"SUBSCRIPTION_STATUS_SUBSCRIPTION_ACTION_IS_INVALID" => {
Some(Self::SubscriptionActionIsInvalid)
}
"SUBSCRIPTION_STATUS_DEPTH_IS_INVALID" => Some(Self::DepthIsInvalid),
"SUBSCRIPTION_STATUS_INTERVAL_IS_INVALID" => Some(Self::IntervalIsInvalid),
"SUBSCRIPTION_STATUS_LIMIT_IS_EXCEEDED" => Some(Self::LimitIsExceeded),
"SUBSCRIPTION_STATUS_INTERNAL_ERROR" => Some(Self::InternalError),
"SUBSCRIPTION_STATUS_TOO_MANY_REQUESTS" => Some(Self::TooManyRequests),
"SUBSCRIPTION_STATUS_SUBSCRIPTION_NOT_FOUND" => {
Some(Self::SubscriptionNotFound)
}
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TradeDirection {
Unspecified = 0,
Buy = 1,
Sell = 2,
}
impl TradeDirection {
pub fn as_str_name(&self) -> &'static str {
match self {
TradeDirection::Unspecified => "TRADE_DIRECTION_UNSPECIFIED",
TradeDirection::Buy => "TRADE_DIRECTION_BUY",
TradeDirection::Sell => "TRADE_DIRECTION_SELL",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TRADE_DIRECTION_UNSPECIFIED" => Some(Self::Unspecified),
"TRADE_DIRECTION_BUY" => Some(Self::Buy),
"TRADE_DIRECTION_SELL" => Some(Self::Sell),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum CandleInterval {
Unspecified = 0,
CandleInterval1Min = 1,
CandleInterval5Min = 2,
CandleInterval15Min = 3,
Hour = 4,
Day = 5,
CandleInterval2Min = 6,
CandleInterval3Min = 7,
CandleInterval10Min = 8,
CandleInterval30Min = 9,
CandleInterval2Hour = 10,
CandleInterval4Hour = 11,
Week = 12,
Month = 13,
}
impl CandleInterval {
pub fn as_str_name(&self) -> &'static str {
match self {
CandleInterval::Unspecified => "CANDLE_INTERVAL_UNSPECIFIED",
CandleInterval::CandleInterval1Min => "CANDLE_INTERVAL_1_MIN",
CandleInterval::CandleInterval5Min => "CANDLE_INTERVAL_5_MIN",
CandleInterval::CandleInterval15Min => "CANDLE_INTERVAL_15_MIN",
CandleInterval::Hour => "CANDLE_INTERVAL_HOUR",
CandleInterval::Day => "CANDLE_INTERVAL_DAY",
CandleInterval::CandleInterval2Min => "CANDLE_INTERVAL_2_MIN",
CandleInterval::CandleInterval3Min => "CANDLE_INTERVAL_3_MIN",
CandleInterval::CandleInterval10Min => "CANDLE_INTERVAL_10_MIN",
CandleInterval::CandleInterval30Min => "CANDLE_INTERVAL_30_MIN",
CandleInterval::CandleInterval2Hour => "CANDLE_INTERVAL_2_HOUR",
CandleInterval::CandleInterval4Hour => "CANDLE_INTERVAL_4_HOUR",
CandleInterval::Week => "CANDLE_INTERVAL_WEEK",
CandleInterval::Month => "CANDLE_INTERVAL_MONTH",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"CANDLE_INTERVAL_UNSPECIFIED" => Some(Self::Unspecified),
"CANDLE_INTERVAL_1_MIN" => Some(Self::CandleInterval1Min),
"CANDLE_INTERVAL_5_MIN" => Some(Self::CandleInterval5Min),
"CANDLE_INTERVAL_15_MIN" => Some(Self::CandleInterval15Min),
"CANDLE_INTERVAL_HOUR" => Some(Self::Hour),
"CANDLE_INTERVAL_DAY" => Some(Self::Day),
"CANDLE_INTERVAL_2_MIN" => Some(Self::CandleInterval2Min),
"CANDLE_INTERVAL_3_MIN" => Some(Self::CandleInterval3Min),
"CANDLE_INTERVAL_10_MIN" => Some(Self::CandleInterval10Min),
"CANDLE_INTERVAL_30_MIN" => Some(Self::CandleInterval30Min),
"CANDLE_INTERVAL_2_HOUR" => Some(Self::CandleInterval2Hour),
"CANDLE_INTERVAL_4_HOUR" => Some(Self::CandleInterval4Hour),
"CANDLE_INTERVAL_WEEK" => Some(Self::Week),
"CANDLE_INTERVAL_MONTH" => Some(Self::Month),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum CandleSource {
Unspecified = 0,
Exchange = 1,
DealerWeekend = 2,
}
impl CandleSource {
pub fn as_str_name(&self) -> &'static str {
match self {
CandleSource::Unspecified => "CANDLE_SOURCE_UNSPECIFIED",
CandleSource::Exchange => "CANDLE_SOURCE_EXCHANGE",
CandleSource::DealerWeekend => "CANDLE_SOURCE_DEALER_WEEKEND",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"CANDLE_SOURCE_UNSPECIFIED" => Some(Self::Unspecified),
"CANDLE_SOURCE_EXCHANGE" => Some(Self::Exchange),
"CANDLE_SOURCE_DEALER_WEEKEND" => Some(Self::DealerWeekend),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OrderBookType {
OrderbookTypeUnspecified = 0,
OrderbookTypeExchange = 1,
OrderbookTypeDealer = 2,
}
impl OrderBookType {
pub fn as_str_name(&self) -> &'static str {
match self {
OrderBookType::OrderbookTypeUnspecified => "ORDERBOOK_TYPE_UNSPECIFIED",
OrderBookType::OrderbookTypeExchange => "ORDERBOOK_TYPE_EXCHANGE",
OrderBookType::OrderbookTypeDealer => "ORDERBOOK_TYPE_DEALER",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ORDERBOOK_TYPE_UNSPECIFIED" => Some(Self::OrderbookTypeUnspecified),
"ORDERBOOK_TYPE_EXCHANGE" => Some(Self::OrderbookTypeExchange),
"ORDERBOOK_TYPE_DEALER" => Some(Self::OrderbookTypeDealer),
_ => None,
}
}
}
pub mod market_data_service_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 MarketDataServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl MarketDataServiceClient<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> MarketDataServiceClient<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,
) -> MarketDataServiceClient<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,
{
MarketDataServiceClient::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 get_candles(
&mut self,
request: impl tonic::IntoRequest<super::GetCandlesRequest>,
) -> std::result::Result<
tonic::Response<super::GetCandlesResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.MarketDataService/GetCandles",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.MarketDataService",
"GetCandles",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_last_prices(
&mut self,
request: impl tonic::IntoRequest<super::GetLastPricesRequest>,
) -> std::result::Result<
tonic::Response<super::GetLastPricesResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.MarketDataService/GetLastPrices",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.MarketDataService",
"GetLastPrices",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_order_book(
&mut self,
request: impl tonic::IntoRequest<super::GetOrderBookRequest>,
) -> std::result::Result<
tonic::Response<super::GetOrderBookResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.MarketDataService/GetOrderBook",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.MarketDataService",
"GetOrderBook",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_trading_status(
&mut self,
request: impl tonic::IntoRequest<super::GetTradingStatusRequest>,
) -> std::result::Result<
tonic::Response<super::GetTradingStatusResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.MarketDataService/GetTradingStatus",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.MarketDataService",
"GetTradingStatus",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_trading_statuses(
&mut self,
request: impl tonic::IntoRequest<super::GetTradingStatusesRequest>,
) -> std::result::Result<
tonic::Response<super::GetTradingStatusesResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.MarketDataService/GetTradingStatuses",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.MarketDataService",
"GetTradingStatuses",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_last_trades(
&mut self,
request: impl tonic::IntoRequest<super::GetLastTradesRequest>,
) -> std::result::Result<
tonic::Response<super::GetLastTradesResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.MarketDataService/GetLastTrades",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.MarketDataService",
"GetLastTrades",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_close_prices(
&mut self,
request: impl tonic::IntoRequest<super::GetClosePricesRequest>,
) -> std::result::Result<
tonic::Response<super::GetClosePricesResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.MarketDataService/GetClosePrices",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.MarketDataService",
"GetClosePrices",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_tech_analysis(
&mut self,
request: impl tonic::IntoRequest<super::GetTechAnalysisRequest>,
) -> std::result::Result<
tonic::Response<super::GetTechAnalysisResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.MarketDataService/GetTechAnalysis",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.MarketDataService",
"GetTechAnalysis",
),
);
self.inner.unary(req, path, codec).await
}
}
}
pub mod market_data_stream_service_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 MarketDataStreamServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl MarketDataStreamServiceClient<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> MarketDataStreamServiceClient<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,
) -> MarketDataStreamServiceClient<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,
{
MarketDataStreamServiceClient::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 market_data_stream(
&mut self,
request: impl tonic::IntoStreamingRequest<Message = super::MarketDataRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::MarketDataResponse>>,
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(
"/tinkoff.public.invest.api.contract.v1.MarketDataStreamService/MarketDataStream",
);
let mut req = request.into_streaming_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.MarketDataStreamService",
"MarketDataStream",
),
);
self.inner.streaming(req, path, codec).await
}
pub async fn market_data_server_side_stream(
&mut self,
request: impl tonic::IntoRequest<super::MarketDataServerSideStreamRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::MarketDataResponse>>,
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(
"/tinkoff.public.invest.api.contract.v1.MarketDataStreamService/MarketDataServerSideStream",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.MarketDataStreamService",
"MarketDataServerSideStream",
),
);
self.inner.server_streaming(req, path, codec).await
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OperationsRequest {
#[prost(string, tag = "1")]
pub account_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub from: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "3")]
pub to: ::core::option::Option<::prost_types::Timestamp>,
#[prost(enumeration = "OperationState", optional, tag = "4")]
pub state: ::core::option::Option<i32>,
#[prost(string, optional, tag = "5")]
pub figi: ::core::option::Option<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OperationsResponse {
#[prost(message, repeated, tag = "1")]
pub operations: ::prost::alloc::vec::Vec<Operation>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Operation {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub parent_operation_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub currency: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub payment: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "5")]
pub price: ::core::option::Option<MoneyValue>,
#[prost(enumeration = "OperationState", tag = "6")]
pub state: i32,
#[prost(int64, tag = "7")]
pub quantity: i64,
#[prost(int64, tag = "8")]
pub quantity_rest: i64,
#[prost(string, tag = "9")]
pub figi: ::prost::alloc::string::String,
#[prost(string, tag = "10")]
pub instrument_type: ::prost::alloc::string::String,
#[prost(message, optional, tag = "11")]
pub date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "12")]
pub r#type: ::prost::alloc::string::String,
#[prost(enumeration = "OperationType", tag = "13")]
pub operation_type: i32,
#[prost(message, repeated, tag = "14")]
pub trades: ::prost::alloc::vec::Vec<OperationTrade>,
#[prost(string, tag = "16")]
pub asset_uid: ::prost::alloc::string::String,
#[prost(string, tag = "17")]
pub position_uid: ::prost::alloc::string::String,
#[prost(string, tag = "18")]
pub instrument_uid: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OperationTrade {
#[prost(string, tag = "1")]
pub trade_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub date_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(int64, tag = "3")]
pub quantity: i64,
#[prost(message, optional, tag = "4")]
pub price: ::core::option::Option<MoneyValue>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PortfolioRequest {
#[prost(string, tag = "1")]
pub account_id: ::prost::alloc::string::String,
#[prost(enumeration = "portfolio_request::CurrencyRequest", optional, tag = "2")]
pub currency: ::core::option::Option<i32>,
}
pub mod portfolio_request {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum CurrencyRequest {
Rub = 0,
Usd = 1,
Eur = 2,
}
impl CurrencyRequest {
pub fn as_str_name(&self) -> &'static str {
match self {
CurrencyRequest::Rub => "RUB",
CurrencyRequest::Usd => "USD",
CurrencyRequest::Eur => "EUR",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"RUB" => Some(Self::Rub),
"USD" => Some(Self::Usd),
"EUR" => Some(Self::Eur),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PortfolioResponse {
#[prost(message, optional, tag = "1")]
pub total_amount_shares: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "2")]
pub total_amount_bonds: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "3")]
pub total_amount_etf: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "4")]
pub total_amount_currencies: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "5")]
pub total_amount_futures: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "6")]
pub expected_yield: ::core::option::Option<Quotation>,
#[prost(message, repeated, tag = "7")]
pub positions: ::prost::alloc::vec::Vec<PortfolioPosition>,
#[prost(string, tag = "8")]
pub account_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "9")]
pub total_amount_options: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "10")]
pub total_amount_sp: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "11")]
pub total_amount_portfolio: ::core::option::Option<MoneyValue>,
#[prost(message, repeated, tag = "12")]
pub virtual_positions: ::prost::alloc::vec::Vec<VirtualPortfolioPosition>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PositionsRequest {
#[prost(string, tag = "1")]
pub account_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PositionsResponse {
#[prost(message, repeated, tag = "1")]
pub money: ::prost::alloc::vec::Vec<MoneyValue>,
#[prost(message, repeated, tag = "2")]
pub blocked: ::prost::alloc::vec::Vec<MoneyValue>,
#[prost(message, repeated, tag = "3")]
pub securities: ::prost::alloc::vec::Vec<PositionsSecurities>,
#[prost(bool, tag = "4")]
pub limits_loading_in_progress: bool,
#[prost(message, repeated, tag = "5")]
pub futures: ::prost::alloc::vec::Vec<PositionsFutures>,
#[prost(message, repeated, tag = "6")]
pub options: ::prost::alloc::vec::Vec<PositionsOptions>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WithdrawLimitsRequest {
#[prost(string, tag = "1")]
pub account_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WithdrawLimitsResponse {
#[prost(message, repeated, tag = "1")]
pub money: ::prost::alloc::vec::Vec<MoneyValue>,
#[prost(message, repeated, tag = "2")]
pub blocked: ::prost::alloc::vec::Vec<MoneyValue>,
#[prost(message, repeated, tag = "3")]
pub blocked_guarantee: ::prost::alloc::vec::Vec<MoneyValue>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PortfolioPosition {
#[prost(string, tag = "1")]
pub figi: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub instrument_type: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub quantity: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "4")]
pub average_position_price: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "5")]
pub expected_yield: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "6")]
pub current_nkd: ::core::option::Option<MoneyValue>,
#[deprecated]
#[prost(message, optional, tag = "7")]
pub average_position_price_pt: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "8")]
pub current_price: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "9")]
pub average_position_price_fifo: ::core::option::Option<MoneyValue>,
#[deprecated]
#[prost(message, optional, tag = "10")]
pub quantity_lots: ::core::option::Option<Quotation>,
#[prost(bool, tag = "21")]
pub blocked: bool,
#[prost(message, optional, tag = "22")]
pub blocked_lots: ::core::option::Option<Quotation>,
#[prost(string, tag = "24")]
pub position_uid: ::prost::alloc::string::String,
#[prost(string, tag = "25")]
pub instrument_uid: ::prost::alloc::string::String,
#[prost(message, optional, tag = "26")]
pub var_margin: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "27")]
pub expected_yield_fifo: ::core::option::Option<Quotation>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VirtualPortfolioPosition {
#[prost(string, tag = "1")]
pub position_uid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub instrument_uid: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub figi: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub instrument_type: ::prost::alloc::string::String,
#[prost(message, optional, tag = "5")]
pub quantity: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "6")]
pub average_position_price: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "7")]
pub expected_yield: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "8")]
pub expected_yield_fifo: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "9")]
pub expire_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "10")]
pub current_price: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "11")]
pub average_position_price_fifo: ::core::option::Option<MoneyValue>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PositionsSecurities {
#[prost(string, tag = "1")]
pub figi: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub blocked: i64,
#[prost(int64, tag = "3")]
pub balance: i64,
#[prost(string, tag = "4")]
pub position_uid: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub instrument_uid: ::prost::alloc::string::String,
#[prost(bool, tag = "11")]
pub exchange_blocked: bool,
#[prost(string, tag = "16")]
pub instrument_type: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PositionsFutures {
#[prost(string, tag = "1")]
pub figi: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub blocked: i64,
#[prost(int64, tag = "3")]
pub balance: i64,
#[prost(string, tag = "4")]
pub position_uid: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub instrument_uid: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PositionsOptions {
#[prost(string, tag = "1")]
pub position_uid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub instrument_uid: ::prost::alloc::string::String,
#[prost(int64, tag = "11")]
pub blocked: i64,
#[prost(int64, tag = "21")]
pub balance: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BrokerReportRequest {
#[prost(oneof = "broker_report_request::Payload", tags = "1, 2")]
pub payload: ::core::option::Option<broker_report_request::Payload>,
}
pub mod broker_report_request {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Payload {
#[prost(message, tag = "1")]
GenerateBrokerReportRequest(super::GenerateBrokerReportRequest),
#[prost(message, tag = "2")]
GetBrokerReportRequest(super::GetBrokerReportRequest),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BrokerReportResponse {
#[prost(oneof = "broker_report_response::Payload", tags = "1, 2")]
pub payload: ::core::option::Option<broker_report_response::Payload>,
}
pub mod broker_report_response {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Payload {
#[prost(message, tag = "1")]
GenerateBrokerReportResponse(super::GenerateBrokerReportResponse),
#[prost(message, tag = "2")]
GetBrokerReportResponse(super::GetBrokerReportResponse),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GenerateBrokerReportRequest {
#[prost(string, tag = "1")]
pub account_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub from: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "3")]
pub to: ::core::option::Option<::prost_types::Timestamp>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GenerateBrokerReportResponse {
#[prost(string, tag = "1")]
pub task_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetBrokerReportRequest {
#[prost(string, tag = "1")]
pub task_id: ::prost::alloc::string::String,
#[prost(int32, optional, tag = "2")]
pub page: ::core::option::Option<i32>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetBrokerReportResponse {
#[prost(message, repeated, tag = "1")]
pub broker_report: ::prost::alloc::vec::Vec<BrokerReport>,
#[prost(int32, tag = "2")]
pub items_count: i32,
#[prost(int32, tag = "3")]
pub pages_count: i32,
#[prost(int32, tag = "4")]
pub page: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BrokerReport {
#[prost(string, tag = "1")]
pub trade_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub order_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub figi: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub execute_sign: ::prost::alloc::string::String,
#[prost(message, optional, tag = "5")]
pub trade_datetime: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "6")]
pub exchange: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub class_code: ::prost::alloc::string::String,
#[prost(string, tag = "8")]
pub direction: ::prost::alloc::string::String,
#[prost(string, tag = "9")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "10")]
pub ticker: ::prost::alloc::string::String,
#[prost(message, optional, tag = "11")]
pub price: ::core::option::Option<MoneyValue>,
#[prost(int64, tag = "12")]
pub quantity: i64,
#[prost(message, optional, tag = "13")]
pub order_amount: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "14")]
pub aci_value: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "15")]
pub total_order_amount: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "16")]
pub broker_commission: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "17")]
pub exchange_commission: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "18")]
pub exchange_clearing_commission: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "19")]
pub repo_rate: ::core::option::Option<Quotation>,
#[prost(string, tag = "20")]
pub party: ::prost::alloc::string::String,
#[prost(message, optional, tag = "21")]
pub clear_value_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "22")]
pub sec_value_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "23")]
pub broker_status: ::prost::alloc::string::String,
#[prost(string, tag = "24")]
pub separate_agreement_type: ::prost::alloc::string::String,
#[prost(string, tag = "25")]
pub separate_agreement_number: ::prost::alloc::string::String,
#[prost(string, tag = "26")]
pub separate_agreement_date: ::prost::alloc::string::String,
#[prost(string, tag = "27")]
pub delivery_type: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetDividendsForeignIssuerRequest {
#[prost(oneof = "get_dividends_foreign_issuer_request::Payload", tags = "1, 2")]
pub payload: ::core::option::Option<get_dividends_foreign_issuer_request::Payload>,
}
pub mod get_dividends_foreign_issuer_request {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Payload {
#[prost(message, tag = "1")]
GenerateDivForeignIssuerReport(
super::GenerateDividendsForeignIssuerReportRequest,
),
#[prost(message, tag = "2")]
GetDivForeignIssuerReport(super::GetDividendsForeignIssuerReportRequest),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetDividendsForeignIssuerResponse {
#[prost(oneof = "get_dividends_foreign_issuer_response::Payload", tags = "1, 2")]
pub payload: ::core::option::Option<get_dividends_foreign_issuer_response::Payload>,
}
pub mod get_dividends_foreign_issuer_response {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Payload {
#[prost(message, tag = "1")]
GenerateDivForeignIssuerReportResponse(
super::GenerateDividendsForeignIssuerReportResponse,
),
#[prost(message, tag = "2")]
DivForeignIssuerReport(super::GetDividendsForeignIssuerReportResponse),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GenerateDividendsForeignIssuerReportRequest {
#[prost(string, tag = "1")]
pub account_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub from: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "3")]
pub to: ::core::option::Option<::prost_types::Timestamp>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetDividendsForeignIssuerReportRequest {
#[prost(string, tag = "1")]
pub task_id: ::prost::alloc::string::String,
#[prost(int32, optional, tag = "2")]
pub page: ::core::option::Option<i32>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GenerateDividendsForeignIssuerReportResponse {
#[prost(string, tag = "1")]
pub task_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetDividendsForeignIssuerReportResponse {
#[prost(message, repeated, tag = "1")]
pub dividends_foreign_issuer_report: ::prost::alloc::vec::Vec<
DividendsForeignIssuerReport,
>,
#[prost(int32, tag = "2")]
pub items_count: i32,
#[prost(int32, tag = "3")]
pub pages_count: i32,
#[prost(int32, tag = "4")]
pub page: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DividendsForeignIssuerReport {
#[prost(message, optional, tag = "1")]
pub record_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "2")]
pub payment_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "3")]
pub security_name: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub isin: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub issuer_country: ::prost::alloc::string::String,
#[prost(int64, tag = "6")]
pub quantity: i64,
#[prost(message, optional, tag = "7")]
pub dividend: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "8")]
pub external_commission: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "9")]
pub dividend_gross: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "10")]
pub tax: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "11")]
pub dividend_amount: ::core::option::Option<Quotation>,
#[prost(string, tag = "12")]
pub currency: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PortfolioStreamRequest {
#[prost(string, repeated, tag = "1")]
pub accounts: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PortfolioStreamResponse {
#[prost(oneof = "portfolio_stream_response::Payload", tags = "1, 2, 3")]
pub payload: ::core::option::Option<portfolio_stream_response::Payload>,
}
pub mod portfolio_stream_response {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Payload {
#[prost(message, tag = "1")]
Subscriptions(super::PortfolioSubscriptionResult),
#[prost(message, tag = "2")]
Portfolio(super::PortfolioResponse),
#[prost(message, tag = "3")]
Ping(super::Ping),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PortfolioSubscriptionResult {
#[prost(message, repeated, tag = "1")]
pub accounts: ::prost::alloc::vec::Vec<AccountSubscriptionStatus>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AccountSubscriptionStatus {
#[prost(string, tag = "1")]
pub account_id: ::prost::alloc::string::String,
#[prost(enumeration = "PortfolioSubscriptionStatus", tag = "6")]
pub subscription_status: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetOperationsByCursorRequest {
#[prost(string, tag = "1")]
pub account_id: ::prost::alloc::string::String,
#[prost(string, optional, tag = "2")]
pub instrument_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "6")]
pub from: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "7")]
pub to: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, optional, tag = "11")]
pub cursor: ::core::option::Option<::prost::alloc::string::String>,
#[prost(int32, optional, tag = "12")]
pub limit: ::core::option::Option<i32>,
#[prost(enumeration = "OperationType", repeated, tag = "13")]
pub operation_types: ::prost::alloc::vec::Vec<i32>,
#[prost(enumeration = "OperationState", optional, tag = "14")]
pub state: ::core::option::Option<i32>,
#[prost(bool, optional, tag = "15")]
pub without_commissions: ::core::option::Option<bool>,
#[prost(bool, optional, tag = "16")]
pub without_trades: ::core::option::Option<bool>,
#[prost(bool, optional, tag = "17")]
pub without_overnights: ::core::option::Option<bool>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetOperationsByCursorResponse {
#[prost(bool, tag = "1")]
pub has_next: bool,
#[prost(string, tag = "2")]
pub next_cursor: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "6")]
pub items: ::prost::alloc::vec::Vec<OperationItem>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OperationItem {
#[prost(string, tag = "1")]
pub cursor: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub broker_account_id: ::prost::alloc::string::String,
#[prost(string, tag = "16")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "17")]
pub parent_operation_id: ::prost::alloc::string::String,
#[prost(string, tag = "18")]
pub name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "21")]
pub date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(enumeration = "OperationType", tag = "22")]
pub r#type: i32,
#[prost(string, tag = "23")]
pub description: ::prost::alloc::string::String,
#[prost(enumeration = "OperationState", tag = "24")]
pub state: i32,
#[prost(string, tag = "31")]
pub instrument_uid: ::prost::alloc::string::String,
#[prost(string, tag = "32")]
pub figi: ::prost::alloc::string::String,
#[prost(string, tag = "33")]
pub instrument_type: ::prost::alloc::string::String,
#[prost(enumeration = "InstrumentType", tag = "34")]
pub instrument_kind: i32,
#[prost(string, tag = "35")]
pub position_uid: ::prost::alloc::string::String,
#[prost(message, optional, tag = "41")]
pub payment: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "42")]
pub price: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "43")]
pub commission: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "44")]
pub r#yield: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "45")]
pub yield_relative: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "46")]
pub accrued_int: ::core::option::Option<MoneyValue>,
#[prost(int64, tag = "51")]
pub quantity: i64,
#[prost(int64, tag = "52")]
pub quantity_rest: i64,
#[prost(int64, tag = "53")]
pub quantity_done: i64,
#[prost(message, optional, tag = "56")]
pub cancel_date_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "57")]
pub cancel_reason: ::prost::alloc::string::String,
#[prost(message, optional, tag = "61")]
pub trades_info: ::core::option::Option<OperationItemTrades>,
#[prost(string, tag = "64")]
pub asset_uid: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OperationItemTrades {
#[prost(message, repeated, tag = "6")]
pub trades: ::prost::alloc::vec::Vec<OperationItemTrade>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OperationItemTrade {
#[prost(string, tag = "1")]
pub num: ::prost::alloc::string::String,
#[prost(message, optional, tag = "6")]
pub date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(int64, tag = "11")]
pub quantity: i64,
#[prost(message, optional, tag = "16")]
pub price: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "21")]
pub r#yield: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "22")]
pub yield_relative: ::core::option::Option<Quotation>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PositionsStreamRequest {
#[prost(string, repeated, tag = "1")]
pub accounts: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PositionsStreamResponse {
#[prost(oneof = "positions_stream_response::Payload", tags = "1, 2, 3")]
pub payload: ::core::option::Option<positions_stream_response::Payload>,
}
pub mod positions_stream_response {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Payload {
#[prost(message, tag = "1")]
Subscriptions(super::PositionsSubscriptionResult),
#[prost(message, tag = "2")]
Position(super::PositionData),
#[prost(message, tag = "3")]
Ping(super::Ping),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PositionsSubscriptionResult {
#[prost(message, repeated, tag = "1")]
pub accounts: ::prost::alloc::vec::Vec<PositionsSubscriptionStatus>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PositionsSubscriptionStatus {
#[prost(string, tag = "1")]
pub account_id: ::prost::alloc::string::String,
#[prost(enumeration = "PositionsAccountSubscriptionStatus", tag = "6")]
pub subscription_status: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PositionData {
#[prost(string, tag = "1")]
pub account_id: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub money: ::prost::alloc::vec::Vec<PositionsMoney>,
#[prost(message, repeated, tag = "3")]
pub securities: ::prost::alloc::vec::Vec<PositionsSecurities>,
#[prost(message, repeated, tag = "4")]
pub futures: ::prost::alloc::vec::Vec<PositionsFutures>,
#[prost(message, repeated, tag = "5")]
pub options: ::prost::alloc::vec::Vec<PositionsOptions>,
#[prost(message, optional, tag = "6")]
pub date: ::core::option::Option<::prost_types::Timestamp>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PositionsMoney {
#[prost(message, optional, tag = "1")]
pub available_value: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "2")]
pub blocked_value: ::core::option::Option<MoneyValue>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OperationState {
Unspecified = 0,
Executed = 1,
Canceled = 2,
Progress = 3,
}
impl OperationState {
pub fn as_str_name(&self) -> &'static str {
match self {
OperationState::Unspecified => "OPERATION_STATE_UNSPECIFIED",
OperationState::Executed => "OPERATION_STATE_EXECUTED",
OperationState::Canceled => "OPERATION_STATE_CANCELED",
OperationState::Progress => "OPERATION_STATE_PROGRESS",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"OPERATION_STATE_UNSPECIFIED" => Some(Self::Unspecified),
"OPERATION_STATE_EXECUTED" => Some(Self::Executed),
"OPERATION_STATE_CANCELED" => Some(Self::Canceled),
"OPERATION_STATE_PROGRESS" => Some(Self::Progress),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OperationType {
Unspecified = 0,
Input = 1,
BondTax = 2,
OutputSecurities = 3,
Overnight = 4,
Tax = 5,
BondRepaymentFull = 6,
SellCard = 7,
DividendTax = 8,
Output = 9,
BondRepayment = 10,
TaxCorrection = 11,
ServiceFee = 12,
BenefitTax = 13,
MarginFee = 14,
Buy = 15,
BuyCard = 16,
InputSecurities = 17,
SellMargin = 18,
BrokerFee = 19,
BuyMargin = 20,
Dividend = 21,
Sell = 22,
Coupon = 23,
SuccessFee = 24,
DividendTransfer = 25,
AccruingVarmargin = 26,
WritingOffVarmargin = 27,
DeliveryBuy = 28,
DeliverySell = 29,
TrackMfee = 30,
TrackPfee = 31,
TaxProgressive = 32,
BondTaxProgressive = 33,
DividendTaxProgressive = 34,
BenefitTaxProgressive = 35,
TaxCorrectionProgressive = 36,
TaxRepoProgressive = 37,
TaxRepo = 38,
TaxRepoHold = 39,
TaxRepoRefund = 40,
TaxRepoHoldProgressive = 41,
TaxRepoRefundProgressive = 42,
DivExt = 43,
TaxCorrectionCoupon = 44,
CashFee = 45,
OutFee = 46,
OutStampDuty = 47,
OutputSwift = 50,
InputSwift = 51,
OutputAcquiring = 53,
InputAcquiring = 54,
OutputPenalty = 55,
AdviceFee = 56,
TransIisBs = 57,
TransBsBs = 58,
OutMulti = 59,
InpMulti = 60,
OverPlacement = 61,
OverCom = 62,
OverIncome = 63,
OptionExpiration = 64,
}
impl OperationType {
pub fn as_str_name(&self) -> &'static str {
match self {
OperationType::Unspecified => "OPERATION_TYPE_UNSPECIFIED",
OperationType::Input => "OPERATION_TYPE_INPUT",
OperationType::BondTax => "OPERATION_TYPE_BOND_TAX",
OperationType::OutputSecurities => "OPERATION_TYPE_OUTPUT_SECURITIES",
OperationType::Overnight => "OPERATION_TYPE_OVERNIGHT",
OperationType::Tax => "OPERATION_TYPE_TAX",
OperationType::BondRepaymentFull => "OPERATION_TYPE_BOND_REPAYMENT_FULL",
OperationType::SellCard => "OPERATION_TYPE_SELL_CARD",
OperationType::DividendTax => "OPERATION_TYPE_DIVIDEND_TAX",
OperationType::Output => "OPERATION_TYPE_OUTPUT",
OperationType::BondRepayment => "OPERATION_TYPE_BOND_REPAYMENT",
OperationType::TaxCorrection => "OPERATION_TYPE_TAX_CORRECTION",
OperationType::ServiceFee => "OPERATION_TYPE_SERVICE_FEE",
OperationType::BenefitTax => "OPERATION_TYPE_BENEFIT_TAX",
OperationType::MarginFee => "OPERATION_TYPE_MARGIN_FEE",
OperationType::Buy => "OPERATION_TYPE_BUY",
OperationType::BuyCard => "OPERATION_TYPE_BUY_CARD",
OperationType::InputSecurities => "OPERATION_TYPE_INPUT_SECURITIES",
OperationType::SellMargin => "OPERATION_TYPE_SELL_MARGIN",
OperationType::BrokerFee => "OPERATION_TYPE_BROKER_FEE",
OperationType::BuyMargin => "OPERATION_TYPE_BUY_MARGIN",
OperationType::Dividend => "OPERATION_TYPE_DIVIDEND",
OperationType::Sell => "OPERATION_TYPE_SELL",
OperationType::Coupon => "OPERATION_TYPE_COUPON",
OperationType::SuccessFee => "OPERATION_TYPE_SUCCESS_FEE",
OperationType::DividendTransfer => "OPERATION_TYPE_DIVIDEND_TRANSFER",
OperationType::AccruingVarmargin => "OPERATION_TYPE_ACCRUING_VARMARGIN",
OperationType::WritingOffVarmargin => "OPERATION_TYPE_WRITING_OFF_VARMARGIN",
OperationType::DeliveryBuy => "OPERATION_TYPE_DELIVERY_BUY",
OperationType::DeliverySell => "OPERATION_TYPE_DELIVERY_SELL",
OperationType::TrackMfee => "OPERATION_TYPE_TRACK_MFEE",
OperationType::TrackPfee => "OPERATION_TYPE_TRACK_PFEE",
OperationType::TaxProgressive => "OPERATION_TYPE_TAX_PROGRESSIVE",
OperationType::BondTaxProgressive => "OPERATION_TYPE_BOND_TAX_PROGRESSIVE",
OperationType::DividendTaxProgressive => {
"OPERATION_TYPE_DIVIDEND_TAX_PROGRESSIVE"
}
OperationType::BenefitTaxProgressive => {
"OPERATION_TYPE_BENEFIT_TAX_PROGRESSIVE"
}
OperationType::TaxCorrectionProgressive => {
"OPERATION_TYPE_TAX_CORRECTION_PROGRESSIVE"
}
OperationType::TaxRepoProgressive => "OPERATION_TYPE_TAX_REPO_PROGRESSIVE",
OperationType::TaxRepo => "OPERATION_TYPE_TAX_REPO",
OperationType::TaxRepoHold => "OPERATION_TYPE_TAX_REPO_HOLD",
OperationType::TaxRepoRefund => "OPERATION_TYPE_TAX_REPO_REFUND",
OperationType::TaxRepoHoldProgressive => {
"OPERATION_TYPE_TAX_REPO_HOLD_PROGRESSIVE"
}
OperationType::TaxRepoRefundProgressive => {
"OPERATION_TYPE_TAX_REPO_REFUND_PROGRESSIVE"
}
OperationType::DivExt => "OPERATION_TYPE_DIV_EXT",
OperationType::TaxCorrectionCoupon => "OPERATION_TYPE_TAX_CORRECTION_COUPON",
OperationType::CashFee => "OPERATION_TYPE_CASH_FEE",
OperationType::OutFee => "OPERATION_TYPE_OUT_FEE",
OperationType::OutStampDuty => "OPERATION_TYPE_OUT_STAMP_DUTY",
OperationType::OutputSwift => "OPERATION_TYPE_OUTPUT_SWIFT",
OperationType::InputSwift => "OPERATION_TYPE_INPUT_SWIFT",
OperationType::OutputAcquiring => "OPERATION_TYPE_OUTPUT_ACQUIRING",
OperationType::InputAcquiring => "OPERATION_TYPE_INPUT_ACQUIRING",
OperationType::OutputPenalty => "OPERATION_TYPE_OUTPUT_PENALTY",
OperationType::AdviceFee => "OPERATION_TYPE_ADVICE_FEE",
OperationType::TransIisBs => "OPERATION_TYPE_TRANS_IIS_BS",
OperationType::TransBsBs => "OPERATION_TYPE_TRANS_BS_BS",
OperationType::OutMulti => "OPERATION_TYPE_OUT_MULTI",
OperationType::InpMulti => "OPERATION_TYPE_INP_MULTI",
OperationType::OverPlacement => "OPERATION_TYPE_OVER_PLACEMENT",
OperationType::OverCom => "OPERATION_TYPE_OVER_COM",
OperationType::OverIncome => "OPERATION_TYPE_OVER_INCOME",
OperationType::OptionExpiration => "OPERATION_TYPE_OPTION_EXPIRATION",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"OPERATION_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"OPERATION_TYPE_INPUT" => Some(Self::Input),
"OPERATION_TYPE_BOND_TAX" => Some(Self::BondTax),
"OPERATION_TYPE_OUTPUT_SECURITIES" => Some(Self::OutputSecurities),
"OPERATION_TYPE_OVERNIGHT" => Some(Self::Overnight),
"OPERATION_TYPE_TAX" => Some(Self::Tax),
"OPERATION_TYPE_BOND_REPAYMENT_FULL" => Some(Self::BondRepaymentFull),
"OPERATION_TYPE_SELL_CARD" => Some(Self::SellCard),
"OPERATION_TYPE_DIVIDEND_TAX" => Some(Self::DividendTax),
"OPERATION_TYPE_OUTPUT" => Some(Self::Output),
"OPERATION_TYPE_BOND_REPAYMENT" => Some(Self::BondRepayment),
"OPERATION_TYPE_TAX_CORRECTION" => Some(Self::TaxCorrection),
"OPERATION_TYPE_SERVICE_FEE" => Some(Self::ServiceFee),
"OPERATION_TYPE_BENEFIT_TAX" => Some(Self::BenefitTax),
"OPERATION_TYPE_MARGIN_FEE" => Some(Self::MarginFee),
"OPERATION_TYPE_BUY" => Some(Self::Buy),
"OPERATION_TYPE_BUY_CARD" => Some(Self::BuyCard),
"OPERATION_TYPE_INPUT_SECURITIES" => Some(Self::InputSecurities),
"OPERATION_TYPE_SELL_MARGIN" => Some(Self::SellMargin),
"OPERATION_TYPE_BROKER_FEE" => Some(Self::BrokerFee),
"OPERATION_TYPE_BUY_MARGIN" => Some(Self::BuyMargin),
"OPERATION_TYPE_DIVIDEND" => Some(Self::Dividend),
"OPERATION_TYPE_SELL" => Some(Self::Sell),
"OPERATION_TYPE_COUPON" => Some(Self::Coupon),
"OPERATION_TYPE_SUCCESS_FEE" => Some(Self::SuccessFee),
"OPERATION_TYPE_DIVIDEND_TRANSFER" => Some(Self::DividendTransfer),
"OPERATION_TYPE_ACCRUING_VARMARGIN" => Some(Self::AccruingVarmargin),
"OPERATION_TYPE_WRITING_OFF_VARMARGIN" => Some(Self::WritingOffVarmargin),
"OPERATION_TYPE_DELIVERY_BUY" => Some(Self::DeliveryBuy),
"OPERATION_TYPE_DELIVERY_SELL" => Some(Self::DeliverySell),
"OPERATION_TYPE_TRACK_MFEE" => Some(Self::TrackMfee),
"OPERATION_TYPE_TRACK_PFEE" => Some(Self::TrackPfee),
"OPERATION_TYPE_TAX_PROGRESSIVE" => Some(Self::TaxProgressive),
"OPERATION_TYPE_BOND_TAX_PROGRESSIVE" => Some(Self::BondTaxProgressive),
"OPERATION_TYPE_DIVIDEND_TAX_PROGRESSIVE" => {
Some(Self::DividendTaxProgressive)
}
"OPERATION_TYPE_BENEFIT_TAX_PROGRESSIVE" => Some(Self::BenefitTaxProgressive),
"OPERATION_TYPE_TAX_CORRECTION_PROGRESSIVE" => {
Some(Self::TaxCorrectionProgressive)
}
"OPERATION_TYPE_TAX_REPO_PROGRESSIVE" => Some(Self::TaxRepoProgressive),
"OPERATION_TYPE_TAX_REPO" => Some(Self::TaxRepo),
"OPERATION_TYPE_TAX_REPO_HOLD" => Some(Self::TaxRepoHold),
"OPERATION_TYPE_TAX_REPO_REFUND" => Some(Self::TaxRepoRefund),
"OPERATION_TYPE_TAX_REPO_HOLD_PROGRESSIVE" => {
Some(Self::TaxRepoHoldProgressive)
}
"OPERATION_TYPE_TAX_REPO_REFUND_PROGRESSIVE" => {
Some(Self::TaxRepoRefundProgressive)
}
"OPERATION_TYPE_DIV_EXT" => Some(Self::DivExt),
"OPERATION_TYPE_TAX_CORRECTION_COUPON" => Some(Self::TaxCorrectionCoupon),
"OPERATION_TYPE_CASH_FEE" => Some(Self::CashFee),
"OPERATION_TYPE_OUT_FEE" => Some(Self::OutFee),
"OPERATION_TYPE_OUT_STAMP_DUTY" => Some(Self::OutStampDuty),
"OPERATION_TYPE_OUTPUT_SWIFT" => Some(Self::OutputSwift),
"OPERATION_TYPE_INPUT_SWIFT" => Some(Self::InputSwift),
"OPERATION_TYPE_OUTPUT_ACQUIRING" => Some(Self::OutputAcquiring),
"OPERATION_TYPE_INPUT_ACQUIRING" => Some(Self::InputAcquiring),
"OPERATION_TYPE_OUTPUT_PENALTY" => Some(Self::OutputPenalty),
"OPERATION_TYPE_ADVICE_FEE" => Some(Self::AdviceFee),
"OPERATION_TYPE_TRANS_IIS_BS" => Some(Self::TransIisBs),
"OPERATION_TYPE_TRANS_BS_BS" => Some(Self::TransBsBs),
"OPERATION_TYPE_OUT_MULTI" => Some(Self::OutMulti),
"OPERATION_TYPE_INP_MULTI" => Some(Self::InpMulti),
"OPERATION_TYPE_OVER_PLACEMENT" => Some(Self::OverPlacement),
"OPERATION_TYPE_OVER_COM" => Some(Self::OverCom),
"OPERATION_TYPE_OVER_INCOME" => Some(Self::OverIncome),
"OPERATION_TYPE_OPTION_EXPIRATION" => Some(Self::OptionExpiration),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum PortfolioSubscriptionStatus {
Unspecified = 0,
Success = 1,
AccountNotFound = 2,
InternalError = 3,
}
impl PortfolioSubscriptionStatus {
pub fn as_str_name(&self) -> &'static str {
match self {
PortfolioSubscriptionStatus::Unspecified => {
"PORTFOLIO_SUBSCRIPTION_STATUS_UNSPECIFIED"
}
PortfolioSubscriptionStatus::Success => {
"PORTFOLIO_SUBSCRIPTION_STATUS_SUCCESS"
}
PortfolioSubscriptionStatus::AccountNotFound => {
"PORTFOLIO_SUBSCRIPTION_STATUS_ACCOUNT_NOT_FOUND"
}
PortfolioSubscriptionStatus::InternalError => {
"PORTFOLIO_SUBSCRIPTION_STATUS_INTERNAL_ERROR"
}
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"PORTFOLIO_SUBSCRIPTION_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
"PORTFOLIO_SUBSCRIPTION_STATUS_SUCCESS" => Some(Self::Success),
"PORTFOLIO_SUBSCRIPTION_STATUS_ACCOUNT_NOT_FOUND" => {
Some(Self::AccountNotFound)
}
"PORTFOLIO_SUBSCRIPTION_STATUS_INTERNAL_ERROR" => Some(Self::InternalError),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum PositionsAccountSubscriptionStatus {
PositionsSubscriptionStatusUnspecified = 0,
PositionsSubscriptionStatusSuccess = 1,
PositionsSubscriptionStatusAccountNotFound = 2,
PositionsSubscriptionStatusInternalError = 3,
}
impl PositionsAccountSubscriptionStatus {
pub fn as_str_name(&self) -> &'static str {
match self {
PositionsAccountSubscriptionStatus::PositionsSubscriptionStatusUnspecified => {
"POSITIONS_SUBSCRIPTION_STATUS_UNSPECIFIED"
}
PositionsAccountSubscriptionStatus::PositionsSubscriptionStatusSuccess => {
"POSITIONS_SUBSCRIPTION_STATUS_SUCCESS"
}
PositionsAccountSubscriptionStatus::PositionsSubscriptionStatusAccountNotFound => {
"POSITIONS_SUBSCRIPTION_STATUS_ACCOUNT_NOT_FOUND"
}
PositionsAccountSubscriptionStatus::PositionsSubscriptionStatusInternalError => {
"POSITIONS_SUBSCRIPTION_STATUS_INTERNAL_ERROR"
}
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"POSITIONS_SUBSCRIPTION_STATUS_UNSPECIFIED" => {
Some(Self::PositionsSubscriptionStatusUnspecified)
}
"POSITIONS_SUBSCRIPTION_STATUS_SUCCESS" => {
Some(Self::PositionsSubscriptionStatusSuccess)
}
"POSITIONS_SUBSCRIPTION_STATUS_ACCOUNT_NOT_FOUND" => {
Some(Self::PositionsSubscriptionStatusAccountNotFound)
}
"POSITIONS_SUBSCRIPTION_STATUS_INTERNAL_ERROR" => {
Some(Self::PositionsSubscriptionStatusInternalError)
}
_ => None,
}
}
}
pub mod operations_service_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 OperationsServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl OperationsServiceClient<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> OperationsServiceClient<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,
) -> OperationsServiceClient<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,
{
OperationsServiceClient::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 get_operations(
&mut self,
request: impl tonic::IntoRequest<super::OperationsRequest>,
) -> std::result::Result<
tonic::Response<super::OperationsResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.OperationsService/GetOperations",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.OperationsService",
"GetOperations",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_portfolio(
&mut self,
request: impl tonic::IntoRequest<super::PortfolioRequest>,
) -> std::result::Result<
tonic::Response<super::PortfolioResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.OperationsService/GetPortfolio",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.OperationsService",
"GetPortfolio",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_positions(
&mut self,
request: impl tonic::IntoRequest<super::PositionsRequest>,
) -> std::result::Result<
tonic::Response<super::PositionsResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.OperationsService/GetPositions",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.OperationsService",
"GetPositions",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_withdraw_limits(
&mut self,
request: impl tonic::IntoRequest<super::WithdrawLimitsRequest>,
) -> std::result::Result<
tonic::Response<super::WithdrawLimitsResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.OperationsService/GetWithdrawLimits",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.OperationsService",
"GetWithdrawLimits",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_broker_report(
&mut self,
request: impl tonic::IntoRequest<super::BrokerReportRequest>,
) -> std::result::Result<
tonic::Response<super::BrokerReportResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.OperationsService/GetBrokerReport",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.OperationsService",
"GetBrokerReport",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_dividends_foreign_issuer(
&mut self,
request: impl tonic::IntoRequest<super::GetDividendsForeignIssuerRequest>,
) -> std::result::Result<
tonic::Response<super::GetDividendsForeignIssuerResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.OperationsService/GetDividendsForeignIssuer",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.OperationsService",
"GetDividendsForeignIssuer",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_operations_by_cursor(
&mut self,
request: impl tonic::IntoRequest<super::GetOperationsByCursorRequest>,
) -> std::result::Result<
tonic::Response<super::GetOperationsByCursorResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.OperationsService/GetOperationsByCursor",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.OperationsService",
"GetOperationsByCursor",
),
);
self.inner.unary(req, path, codec).await
}
}
}
pub mod operations_stream_service_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 OperationsStreamServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl OperationsStreamServiceClient<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> OperationsStreamServiceClient<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,
) -> OperationsStreamServiceClient<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,
{
OperationsStreamServiceClient::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 portfolio_stream(
&mut self,
request: impl tonic::IntoRequest<super::PortfolioStreamRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::PortfolioStreamResponse>>,
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(
"/tinkoff.public.invest.api.contract.v1.OperationsStreamService/PortfolioStream",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.OperationsStreamService",
"PortfolioStream",
),
);
self.inner.server_streaming(req, path, codec).await
}
pub async fn positions_stream(
&mut self,
request: impl tonic::IntoRequest<super::PositionsStreamRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::PositionsStreamResponse>>,
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(
"/tinkoff.public.invest.api.contract.v1.OperationsStreamService/PositionsStream",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.OperationsStreamService",
"PositionsStream",
),
);
self.inner.server_streaming(req, path, codec).await
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TradesStreamRequest {
#[prost(string, repeated, tag = "1")]
pub accounts: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TradesStreamResponse {
#[prost(oneof = "trades_stream_response::Payload", tags = "1, 2")]
pub payload: ::core::option::Option<trades_stream_response::Payload>,
}
pub mod trades_stream_response {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Payload {
#[prost(message, tag = "1")]
OrderTrades(super::OrderTrades),
#[prost(message, tag = "2")]
Ping(super::Ping),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OrderTrades {
#[prost(string, tag = "1")]
pub order_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub created_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(enumeration = "OrderDirection", tag = "3")]
pub direction: i32,
#[prost(string, tag = "4")]
pub figi: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "5")]
pub trades: ::prost::alloc::vec::Vec<OrderTrade>,
#[prost(string, tag = "6")]
pub account_id: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub instrument_uid: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OrderTrade {
#[prost(message, optional, tag = "1")]
pub date_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "2")]
pub price: ::core::option::Option<Quotation>,
#[prost(int64, tag = "3")]
pub quantity: i64,
#[prost(string, tag = "4")]
pub trade_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PostOrderRequest {
#[deprecated]
#[prost(string, optional, tag = "1")]
pub figi: ::core::option::Option<::prost::alloc::string::String>,
#[prost(int64, tag = "2")]
pub quantity: i64,
#[prost(message, optional, tag = "3")]
pub price: ::core::option::Option<Quotation>,
#[prost(enumeration = "OrderDirection", tag = "4")]
pub direction: i32,
#[prost(string, tag = "5")]
pub account_id: ::prost::alloc::string::String,
#[prost(enumeration = "OrderType", tag = "6")]
pub order_type: i32,
#[prost(string, tag = "7")]
pub order_id: ::prost::alloc::string::String,
#[prost(string, tag = "8")]
pub instrument_id: ::prost::alloc::string::String,
#[prost(enumeration = "TimeInForceType", tag = "9")]
pub time_in_force: i32,
#[prost(enumeration = "PriceType", tag = "10")]
pub price_type: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PostOrderResponse {
#[prost(string, tag = "1")]
pub order_id: ::prost::alloc::string::String,
#[prost(enumeration = "OrderExecutionReportStatus", tag = "2")]
pub execution_report_status: i32,
#[prost(int64, tag = "3")]
pub lots_requested: i64,
#[prost(int64, tag = "4")]
pub lots_executed: i64,
#[prost(message, optional, tag = "5")]
pub initial_order_price: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "6")]
pub executed_order_price: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "7")]
pub total_order_amount: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "8")]
pub initial_commission: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "9")]
pub executed_commission: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "10")]
pub aci_value: ::core::option::Option<MoneyValue>,
#[prost(string, tag = "11")]
pub figi: ::prost::alloc::string::String,
#[prost(enumeration = "OrderDirection", tag = "12")]
pub direction: i32,
#[prost(message, optional, tag = "13")]
pub initial_security_price: ::core::option::Option<MoneyValue>,
#[prost(enumeration = "OrderType", tag = "14")]
pub order_type: i32,
#[prost(string, tag = "15")]
pub message: ::prost::alloc::string::String,
#[prost(message, optional, tag = "16")]
pub initial_order_price_pt: ::core::option::Option<Quotation>,
#[prost(string, tag = "17")]
pub instrument_uid: ::prost::alloc::string::String,
#[prost(string, tag = "20")]
pub order_request_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "254")]
pub response_metadata: ::core::option::Option<ResponseMetadata>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CancelOrderRequest {
#[prost(string, tag = "1")]
pub account_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub order_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CancelOrderResponse {
#[prost(message, optional, tag = "1")]
pub time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "254")]
pub response_metadata: ::core::option::Option<ResponseMetadata>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetOrderStateRequest {
#[prost(string, tag = "1")]
pub account_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub order_id: ::prost::alloc::string::String,
#[prost(enumeration = "PriceType", tag = "3")]
pub price_type: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetOrdersRequest {
#[prost(string, tag = "1")]
pub account_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetOrdersResponse {
#[prost(message, repeated, tag = "1")]
pub orders: ::prost::alloc::vec::Vec<OrderState>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OrderState {
#[prost(string, tag = "1")]
pub order_id: ::prost::alloc::string::String,
#[prost(enumeration = "OrderExecutionReportStatus", tag = "2")]
pub execution_report_status: i32,
#[prost(int64, tag = "3")]
pub lots_requested: i64,
#[prost(int64, tag = "4")]
pub lots_executed: i64,
#[prost(message, optional, tag = "5")]
pub initial_order_price: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "6")]
pub executed_order_price: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "7")]
pub total_order_amount: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "8")]
pub average_position_price: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "9")]
pub initial_commission: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "10")]
pub executed_commission: ::core::option::Option<MoneyValue>,
#[prost(string, tag = "11")]
pub figi: ::prost::alloc::string::String,
#[prost(enumeration = "OrderDirection", tag = "12")]
pub direction: i32,
#[prost(message, optional, tag = "13")]
pub initial_security_price: ::core::option::Option<MoneyValue>,
#[prost(message, repeated, tag = "14")]
pub stages: ::prost::alloc::vec::Vec<OrderStage>,
#[prost(message, optional, tag = "15")]
pub service_commission: ::core::option::Option<MoneyValue>,
#[prost(string, tag = "16")]
pub currency: ::prost::alloc::string::String,
#[prost(enumeration = "OrderType", tag = "17")]
pub order_type: i32,
#[prost(message, optional, tag = "18")]
pub order_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "19")]
pub instrument_uid: ::prost::alloc::string::String,
#[prost(string, tag = "20")]
pub order_request_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OrderStage {
#[prost(message, optional, tag = "1")]
pub price: ::core::option::Option<MoneyValue>,
#[prost(int64, tag = "2")]
pub quantity: i64,
#[prost(string, tag = "3")]
pub trade_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "5")]
pub execution_time: ::core::option::Option<::prost_types::Timestamp>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReplaceOrderRequest {
#[prost(string, tag = "1")]
pub account_id: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub order_id: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub idempotency_key: ::prost::alloc::string::String,
#[prost(int64, tag = "11")]
pub quantity: i64,
#[prost(message, optional, tag = "12")]
pub price: ::core::option::Option<Quotation>,
#[prost(enumeration = "PriceType", optional, tag = "13")]
pub price_type: ::core::option::Option<i32>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetMaxLotsRequest {
#[prost(string, tag = "1")]
pub account_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub instrument_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub price: ::core::option::Option<Quotation>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetMaxLotsResponse {
#[prost(string, tag = "1")]
pub currency: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub buy_limits: ::core::option::Option<get_max_lots_response::BuyLimitsView>,
#[prost(message, optional, tag = "3")]
pub buy_margin_limits: ::core::option::Option<get_max_lots_response::BuyLimitsView>,
#[prost(message, optional, tag = "4")]
pub sell_limits: ::core::option::Option<get_max_lots_response::SellLimitsView>,
#[prost(message, optional, tag = "5")]
pub sell_margin_limits: ::core::option::Option<
get_max_lots_response::SellLimitsView,
>,
}
pub mod get_max_lots_response {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BuyLimitsView {
#[prost(message, optional, tag = "1")]
pub buy_money_amount: ::core::option::Option<super::Quotation>,
#[prost(int64, tag = "2")]
pub buy_max_lots: i64,
#[prost(int64, tag = "3")]
pub buy_max_market_lots: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SellLimitsView {
#[prost(int64, tag = "1")]
pub sell_max_lots: i64,
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetOrderPriceRequest {
#[prost(string, tag = "1")]
pub account_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub instrument_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub price: ::core::option::Option<Quotation>,
#[prost(enumeration = "OrderDirection", tag = "12")]
pub direction: i32,
#[prost(int64, tag = "13")]
pub quantity: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetOrderPriceResponse {
#[prost(message, optional, tag = "1")]
pub total_order_amount: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "5")]
pub initial_order_amount: ::core::option::Option<MoneyValue>,
#[prost(int64, tag = "3")]
pub lots_requested: i64,
#[prost(message, optional, tag = "7")]
pub executed_commission: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "8")]
pub executed_commission_rub: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "9")]
pub service_commission: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "10")]
pub deal_commission: ::core::option::Option<MoneyValue>,
#[prost(oneof = "get_order_price_response::InstrumentExtra", tags = "12, 13")]
pub instrument_extra: ::core::option::Option<
get_order_price_response::InstrumentExtra,
>,
}
pub mod get_order_price_response {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExtraBond {
#[prost(message, optional, tag = "2")]
pub aci_value: ::core::option::Option<super::MoneyValue>,
#[prost(message, optional, tag = "3")]
pub nominal_conversion_rate: ::core::option::Option<super::Quotation>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExtraFuture {
#[prost(message, optional, tag = "2")]
pub initial_margin: ::core::option::Option<super::MoneyValue>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum InstrumentExtra {
#[prost(message, tag = "12")]
ExtraBond(ExtraBond),
#[prost(message, tag = "13")]
ExtraFuture(ExtraFuture),
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OrderDirection {
Unspecified = 0,
Buy = 1,
Sell = 2,
}
impl OrderDirection {
pub fn as_str_name(&self) -> &'static str {
match self {
OrderDirection::Unspecified => "ORDER_DIRECTION_UNSPECIFIED",
OrderDirection::Buy => "ORDER_DIRECTION_BUY",
OrderDirection::Sell => "ORDER_DIRECTION_SELL",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ORDER_DIRECTION_UNSPECIFIED" => Some(Self::Unspecified),
"ORDER_DIRECTION_BUY" => Some(Self::Buy),
"ORDER_DIRECTION_SELL" => Some(Self::Sell),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OrderType {
Unspecified = 0,
Limit = 1,
Market = 2,
Bestprice = 3,
}
impl OrderType {
pub fn as_str_name(&self) -> &'static str {
match self {
OrderType::Unspecified => "ORDER_TYPE_UNSPECIFIED",
OrderType::Limit => "ORDER_TYPE_LIMIT",
OrderType::Market => "ORDER_TYPE_MARKET",
OrderType::Bestprice => "ORDER_TYPE_BESTPRICE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ORDER_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"ORDER_TYPE_LIMIT" => Some(Self::Limit),
"ORDER_TYPE_MARKET" => Some(Self::Market),
"ORDER_TYPE_BESTPRICE" => Some(Self::Bestprice),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OrderExecutionReportStatus {
ExecutionReportStatusUnspecified = 0,
ExecutionReportStatusFill = 1,
ExecutionReportStatusRejected = 2,
ExecutionReportStatusCancelled = 3,
ExecutionReportStatusNew = 4,
ExecutionReportStatusPartiallyfill = 5,
}
impl OrderExecutionReportStatus {
pub fn as_str_name(&self) -> &'static str {
match self {
OrderExecutionReportStatus::ExecutionReportStatusUnspecified => {
"EXECUTION_REPORT_STATUS_UNSPECIFIED"
}
OrderExecutionReportStatus::ExecutionReportStatusFill => {
"EXECUTION_REPORT_STATUS_FILL"
}
OrderExecutionReportStatus::ExecutionReportStatusRejected => {
"EXECUTION_REPORT_STATUS_REJECTED"
}
OrderExecutionReportStatus::ExecutionReportStatusCancelled => {
"EXECUTION_REPORT_STATUS_CANCELLED"
}
OrderExecutionReportStatus::ExecutionReportStatusNew => {
"EXECUTION_REPORT_STATUS_NEW"
}
OrderExecutionReportStatus::ExecutionReportStatusPartiallyfill => {
"EXECUTION_REPORT_STATUS_PARTIALLYFILL"
}
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"EXECUTION_REPORT_STATUS_UNSPECIFIED" => {
Some(Self::ExecutionReportStatusUnspecified)
}
"EXECUTION_REPORT_STATUS_FILL" => Some(Self::ExecutionReportStatusFill),
"EXECUTION_REPORT_STATUS_REJECTED" => {
Some(Self::ExecutionReportStatusRejected)
}
"EXECUTION_REPORT_STATUS_CANCELLED" => {
Some(Self::ExecutionReportStatusCancelled)
}
"EXECUTION_REPORT_STATUS_NEW" => Some(Self::ExecutionReportStatusNew),
"EXECUTION_REPORT_STATUS_PARTIALLYFILL" => {
Some(Self::ExecutionReportStatusPartiallyfill)
}
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TimeInForceType {
TimeInForceUnspecified = 0,
TimeInForceDay = 1,
TimeInForceFillAndKill = 2,
TimeInForceFillOrKill = 3,
}
impl TimeInForceType {
pub fn as_str_name(&self) -> &'static str {
match self {
TimeInForceType::TimeInForceUnspecified => "TIME_IN_FORCE_UNSPECIFIED",
TimeInForceType::TimeInForceDay => "TIME_IN_FORCE_DAY",
TimeInForceType::TimeInForceFillAndKill => "TIME_IN_FORCE_FILL_AND_KILL",
TimeInForceType::TimeInForceFillOrKill => "TIME_IN_FORCE_FILL_OR_KILL",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TIME_IN_FORCE_UNSPECIFIED" => Some(Self::TimeInForceUnspecified),
"TIME_IN_FORCE_DAY" => Some(Self::TimeInForceDay),
"TIME_IN_FORCE_FILL_AND_KILL" => Some(Self::TimeInForceFillAndKill),
"TIME_IN_FORCE_FILL_OR_KILL" => Some(Self::TimeInForceFillOrKill),
_ => None,
}
}
}
pub mod orders_stream_service_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 OrdersStreamServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl OrdersStreamServiceClient<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> OrdersStreamServiceClient<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,
) -> OrdersStreamServiceClient<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,
{
OrdersStreamServiceClient::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 trades_stream(
&mut self,
request: impl tonic::IntoRequest<super::TradesStreamRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::TradesStreamResponse>>,
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(
"/tinkoff.public.invest.api.contract.v1.OrdersStreamService/TradesStream",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.OrdersStreamService",
"TradesStream",
),
);
self.inner.server_streaming(req, path, codec).await
}
}
}
pub mod orders_service_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 OrdersServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl OrdersServiceClient<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> OrdersServiceClient<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,
) -> OrdersServiceClient<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,
{
OrdersServiceClient::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 post_order(
&mut self,
request: impl tonic::IntoRequest<super::PostOrderRequest>,
) -> std::result::Result<
tonic::Response<super::PostOrderResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.OrdersService/PostOrder",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.OrdersService",
"PostOrder",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn cancel_order(
&mut self,
request: impl tonic::IntoRequest<super::CancelOrderRequest>,
) -> std::result::Result<
tonic::Response<super::CancelOrderResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.OrdersService/CancelOrder",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.OrdersService",
"CancelOrder",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_order_state(
&mut self,
request: impl tonic::IntoRequest<super::GetOrderStateRequest>,
) -> std::result::Result<tonic::Response<super::OrderState>, 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(
"/tinkoff.public.invest.api.contract.v1.OrdersService/GetOrderState",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.OrdersService",
"GetOrderState",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_orders(
&mut self,
request: impl tonic::IntoRequest<super::GetOrdersRequest>,
) -> std::result::Result<
tonic::Response<super::GetOrdersResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.OrdersService/GetOrders",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.OrdersService",
"GetOrders",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn replace_order(
&mut self,
request: impl tonic::IntoRequest<super::ReplaceOrderRequest>,
) -> std::result::Result<
tonic::Response<super::PostOrderResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.OrdersService/ReplaceOrder",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.OrdersService",
"ReplaceOrder",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_max_lots(
&mut self,
request: impl tonic::IntoRequest<super::GetMaxLotsRequest>,
) -> std::result::Result<
tonic::Response<super::GetMaxLotsResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.OrdersService/GetMaxLots",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.OrdersService",
"GetMaxLots",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_order_price(
&mut self,
request: impl tonic::IntoRequest<super::GetOrderPriceRequest>,
) -> std::result::Result<
tonic::Response<super::GetOrderPriceResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.OrdersService/GetOrderPrice",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.OrdersService",
"GetOrderPrice",
),
);
self.inner.unary(req, path, codec).await
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetAccountsRequest {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetAccountsResponse {
#[prost(message, repeated, tag = "1")]
pub accounts: ::prost::alloc::vec::Vec<Account>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Account {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(enumeration = "AccountType", tag = "2")]
pub r#type: i32,
#[prost(string, tag = "3")]
pub name: ::prost::alloc::string::String,
#[prost(enumeration = "AccountStatus", tag = "4")]
pub status: i32,
#[prost(message, optional, tag = "5")]
pub opened_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "6")]
pub closed_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(enumeration = "AccessLevel", tag = "7")]
pub access_level: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetMarginAttributesRequest {
#[prost(string, tag = "1")]
pub account_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetMarginAttributesResponse {
#[prost(message, optional, tag = "1")]
pub liquid_portfolio: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "2")]
pub starting_margin: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "3")]
pub minimal_margin: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "4")]
pub funds_sufficiency_level: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "5")]
pub amount_of_missing_funds: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "6")]
pub corrected_margin: ::core::option::Option<MoneyValue>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetUserTariffRequest {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetUserTariffResponse {
#[prost(message, repeated, tag = "1")]
pub unary_limits: ::prost::alloc::vec::Vec<UnaryLimit>,
#[prost(message, repeated, tag = "2")]
pub stream_limits: ::prost::alloc::vec::Vec<StreamLimit>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UnaryLimit {
#[prost(int32, tag = "1")]
pub limit_per_minute: i32,
#[prost(string, repeated, tag = "2")]
pub methods: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamLimit {
#[prost(int32, tag = "1")]
pub limit: i32,
#[prost(string, repeated, tag = "2")]
pub streams: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(int32, tag = "3")]
pub open: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetInfoRequest {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetInfoResponse {
#[prost(bool, tag = "1")]
pub prem_status: bool,
#[prost(bool, tag = "2")]
pub qual_status: bool,
#[prost(string, repeated, tag = "3")]
pub qualified_for_work_with: ::prost::alloc::vec::Vec<
::prost::alloc::string::String,
>,
#[prost(string, tag = "4")]
pub tariff: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum AccountType {
Unspecified = 0,
Tinkoff = 1,
TinkoffIis = 2,
InvestBox = 3,
}
impl AccountType {
pub fn as_str_name(&self) -> &'static str {
match self {
AccountType::Unspecified => "ACCOUNT_TYPE_UNSPECIFIED",
AccountType::Tinkoff => "ACCOUNT_TYPE_TINKOFF",
AccountType::TinkoffIis => "ACCOUNT_TYPE_TINKOFF_IIS",
AccountType::InvestBox => "ACCOUNT_TYPE_INVEST_BOX",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ACCOUNT_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"ACCOUNT_TYPE_TINKOFF" => Some(Self::Tinkoff),
"ACCOUNT_TYPE_TINKOFF_IIS" => Some(Self::TinkoffIis),
"ACCOUNT_TYPE_INVEST_BOX" => Some(Self::InvestBox),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum AccountStatus {
Unspecified = 0,
New = 1,
Open = 2,
Closed = 3,
}
impl AccountStatus {
pub fn as_str_name(&self) -> &'static str {
match self {
AccountStatus::Unspecified => "ACCOUNT_STATUS_UNSPECIFIED",
AccountStatus::New => "ACCOUNT_STATUS_NEW",
AccountStatus::Open => "ACCOUNT_STATUS_OPEN",
AccountStatus::Closed => "ACCOUNT_STATUS_CLOSED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ACCOUNT_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
"ACCOUNT_STATUS_NEW" => Some(Self::New),
"ACCOUNT_STATUS_OPEN" => Some(Self::Open),
"ACCOUNT_STATUS_CLOSED" => Some(Self::Closed),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum AccessLevel {
AccountAccessLevelUnspecified = 0,
AccountAccessLevelFullAccess = 1,
AccountAccessLevelReadOnly = 2,
AccountAccessLevelNoAccess = 3,
}
impl AccessLevel {
pub fn as_str_name(&self) -> &'static str {
match self {
AccessLevel::AccountAccessLevelUnspecified => {
"ACCOUNT_ACCESS_LEVEL_UNSPECIFIED"
}
AccessLevel::AccountAccessLevelFullAccess => {
"ACCOUNT_ACCESS_LEVEL_FULL_ACCESS"
}
AccessLevel::AccountAccessLevelReadOnly => "ACCOUNT_ACCESS_LEVEL_READ_ONLY",
AccessLevel::AccountAccessLevelNoAccess => "ACCOUNT_ACCESS_LEVEL_NO_ACCESS",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ACCOUNT_ACCESS_LEVEL_UNSPECIFIED" => {
Some(Self::AccountAccessLevelUnspecified)
}
"ACCOUNT_ACCESS_LEVEL_FULL_ACCESS" => {
Some(Self::AccountAccessLevelFullAccess)
}
"ACCOUNT_ACCESS_LEVEL_READ_ONLY" => Some(Self::AccountAccessLevelReadOnly),
"ACCOUNT_ACCESS_LEVEL_NO_ACCESS" => Some(Self::AccountAccessLevelNoAccess),
_ => None,
}
}
}
pub mod users_service_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 UsersServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl UsersServiceClient<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> UsersServiceClient<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,
) -> UsersServiceClient<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,
{
UsersServiceClient::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 get_accounts(
&mut self,
request: impl tonic::IntoRequest<super::GetAccountsRequest>,
) -> std::result::Result<
tonic::Response<super::GetAccountsResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.UsersService/GetAccounts",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.UsersService",
"GetAccounts",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_margin_attributes(
&mut self,
request: impl tonic::IntoRequest<super::GetMarginAttributesRequest>,
) -> std::result::Result<
tonic::Response<super::GetMarginAttributesResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.UsersService/GetMarginAttributes",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.UsersService",
"GetMarginAttributes",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_user_tariff(
&mut self,
request: impl tonic::IntoRequest<super::GetUserTariffRequest>,
) -> std::result::Result<
tonic::Response<super::GetUserTariffResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.UsersService/GetUserTariff",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.UsersService",
"GetUserTariff",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_info(
&mut self,
request: impl tonic::IntoRequest<super::GetInfoRequest>,
) -> std::result::Result<
tonic::Response<super::GetInfoResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.UsersService/GetInfo",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.UsersService",
"GetInfo",
),
);
self.inner.unary(req, path, codec).await
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OpenSandboxAccountRequest {
#[prost(string, optional, tag = "1")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OpenSandboxAccountResponse {
#[prost(string, tag = "1")]
pub account_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CloseSandboxAccountRequest {
#[prost(string, tag = "1")]
pub account_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CloseSandboxAccountResponse {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SandboxPayInRequest {
#[prost(string, tag = "1")]
pub account_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub amount: ::core::option::Option<MoneyValue>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SandboxPayInResponse {
#[prost(message, optional, tag = "1")]
pub balance: ::core::option::Option<MoneyValue>,
}
pub mod sandbox_service_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 SandboxServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl SandboxServiceClient<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> SandboxServiceClient<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,
) -> SandboxServiceClient<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,
{
SandboxServiceClient::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 open_sandbox_account(
&mut self,
request: impl tonic::IntoRequest<super::OpenSandboxAccountRequest>,
) -> std::result::Result<
tonic::Response<super::OpenSandboxAccountResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.SandboxService/OpenSandboxAccount",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.SandboxService",
"OpenSandboxAccount",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_sandbox_accounts(
&mut self,
request: impl tonic::IntoRequest<super::GetAccountsRequest>,
) -> std::result::Result<
tonic::Response<super::GetAccountsResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.SandboxService/GetSandboxAccounts",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.SandboxService",
"GetSandboxAccounts",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn close_sandbox_account(
&mut self,
request: impl tonic::IntoRequest<super::CloseSandboxAccountRequest>,
) -> std::result::Result<
tonic::Response<super::CloseSandboxAccountResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.SandboxService/CloseSandboxAccount",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.SandboxService",
"CloseSandboxAccount",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn post_sandbox_order(
&mut self,
request: impl tonic::IntoRequest<super::PostOrderRequest>,
) -> std::result::Result<
tonic::Response<super::PostOrderResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.SandboxService/PostSandboxOrder",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.SandboxService",
"PostSandboxOrder",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn replace_sandbox_order(
&mut self,
request: impl tonic::IntoRequest<super::ReplaceOrderRequest>,
) -> std::result::Result<
tonic::Response<super::PostOrderResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.SandboxService/ReplaceSandboxOrder",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.SandboxService",
"ReplaceSandboxOrder",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_sandbox_orders(
&mut self,
request: impl tonic::IntoRequest<super::GetOrdersRequest>,
) -> std::result::Result<
tonic::Response<super::GetOrdersResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.SandboxService/GetSandboxOrders",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.SandboxService",
"GetSandboxOrders",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn cancel_sandbox_order(
&mut self,
request: impl tonic::IntoRequest<super::CancelOrderRequest>,
) -> std::result::Result<
tonic::Response<super::CancelOrderResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.SandboxService/CancelSandboxOrder",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.SandboxService",
"CancelSandboxOrder",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_sandbox_order_state(
&mut self,
request: impl tonic::IntoRequest<super::GetOrderStateRequest>,
) -> std::result::Result<tonic::Response<super::OrderState>, 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(
"/tinkoff.public.invest.api.contract.v1.SandboxService/GetSandboxOrderState",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.SandboxService",
"GetSandboxOrderState",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_sandbox_positions(
&mut self,
request: impl tonic::IntoRequest<super::PositionsRequest>,
) -> std::result::Result<
tonic::Response<super::PositionsResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.SandboxService/GetSandboxPositions",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.SandboxService",
"GetSandboxPositions",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_sandbox_operations(
&mut self,
request: impl tonic::IntoRequest<super::OperationsRequest>,
) -> std::result::Result<
tonic::Response<super::OperationsResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.SandboxService/GetSandboxOperations",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.SandboxService",
"GetSandboxOperations",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_sandbox_operations_by_cursor(
&mut self,
request: impl tonic::IntoRequest<super::GetOperationsByCursorRequest>,
) -> std::result::Result<
tonic::Response<super::GetOperationsByCursorResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.SandboxService/GetSandboxOperationsByCursor",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.SandboxService",
"GetSandboxOperationsByCursor",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_sandbox_portfolio(
&mut self,
request: impl tonic::IntoRequest<super::PortfolioRequest>,
) -> std::result::Result<
tonic::Response<super::PortfolioResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.SandboxService/GetSandboxPortfolio",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.SandboxService",
"GetSandboxPortfolio",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn sandbox_pay_in(
&mut self,
request: impl tonic::IntoRequest<super::SandboxPayInRequest>,
) -> std::result::Result<
tonic::Response<super::SandboxPayInResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.SandboxService/SandboxPayIn",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.SandboxService",
"SandboxPayIn",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_sandbox_withdraw_limits(
&mut self,
request: impl tonic::IntoRequest<super::WithdrawLimitsRequest>,
) -> std::result::Result<
tonic::Response<super::WithdrawLimitsResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.SandboxService/GetSandboxWithdrawLimits",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.SandboxService",
"GetSandboxWithdrawLimits",
),
);
self.inner.unary(req, path, codec).await
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PostStopOrderRequest {
#[deprecated]
#[prost(string, optional, tag = "1")]
pub figi: ::core::option::Option<::prost::alloc::string::String>,
#[prost(int64, tag = "2")]
pub quantity: i64,
#[prost(message, optional, tag = "3")]
pub price: ::core::option::Option<Quotation>,
#[prost(message, optional, tag = "4")]
pub stop_price: ::core::option::Option<Quotation>,
#[prost(enumeration = "StopOrderDirection", tag = "5")]
pub direction: i32,
#[prost(string, tag = "6")]
pub account_id: ::prost::alloc::string::String,
#[prost(enumeration = "StopOrderExpirationType", tag = "7")]
pub expiration_type: i32,
#[prost(enumeration = "StopOrderType", tag = "8")]
pub stop_order_type: i32,
#[prost(message, optional, tag = "9")]
pub expire_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "10")]
pub instrument_id: ::prost::alloc::string::String,
#[prost(enumeration = "ExchangeOrderType", tag = "11")]
pub exchange_order_type: i32,
#[prost(enumeration = "TakeProfitType", tag = "12")]
pub take_profit_type: i32,
#[prost(message, optional, tag = "13")]
pub trailing_data: ::core::option::Option<post_stop_order_request::TrailingData>,
#[prost(enumeration = "PriceType", tag = "14")]
pub price_type: i32,
#[prost(string, tag = "15")]
pub order_id: ::prost::alloc::string::String,
}
pub mod post_stop_order_request {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TrailingData {
#[prost(message, optional, tag = "1")]
pub indent: ::core::option::Option<super::Quotation>,
#[prost(enumeration = "super::TrailingValueType", tag = "2")]
pub indent_type: i32,
#[prost(message, optional, tag = "3")]
pub spread: ::core::option::Option<super::Quotation>,
#[prost(enumeration = "super::TrailingValueType", tag = "4")]
pub spread_type: i32,
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PostStopOrderResponse {
#[prost(string, tag = "1")]
pub stop_order_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub order_request_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "254")]
pub response_metadata: ::core::option::Option<ResponseMetadata>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetStopOrdersRequest {
#[prost(string, tag = "1")]
pub account_id: ::prost::alloc::string::String,
#[prost(enumeration = "StopOrderStatusOption", tag = "2")]
pub status: i32,
#[prost(message, optional, tag = "3")]
pub from: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "4")]
pub to: ::core::option::Option<::prost_types::Timestamp>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetStopOrdersResponse {
#[prost(message, repeated, tag = "1")]
pub stop_orders: ::prost::alloc::vec::Vec<StopOrder>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CancelStopOrderRequest {
#[prost(string, tag = "1")]
pub account_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub stop_order_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CancelStopOrderResponse {
#[prost(message, optional, tag = "1")]
pub time: ::core::option::Option<::prost_types::Timestamp>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StopOrder {
#[prost(string, tag = "1")]
pub stop_order_id: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub lots_requested: i64,
#[prost(string, tag = "3")]
pub figi: ::prost::alloc::string::String,
#[prost(enumeration = "StopOrderDirection", tag = "4")]
pub direction: i32,
#[prost(string, tag = "5")]
pub currency: ::prost::alloc::string::String,
#[prost(enumeration = "StopOrderType", tag = "6")]
pub order_type: i32,
#[prost(message, optional, tag = "7")]
pub create_date: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "8")]
pub activation_date_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "9")]
pub expiration_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "10")]
pub price: ::core::option::Option<MoneyValue>,
#[prost(message, optional, tag = "11")]
pub stop_price: ::core::option::Option<MoneyValue>,
#[prost(string, tag = "12")]
pub instrument_uid: ::prost::alloc::string::String,
#[prost(enumeration = "TakeProfitType", tag = "13")]
pub take_profit_type: i32,
#[prost(message, optional, tag = "14")]
pub trailing_data: ::core::option::Option<stop_order::TrailingData>,
#[prost(enumeration = "StopOrderStatusOption", tag = "15")]
pub status: i32,
}
pub mod stop_order {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TrailingData {
#[prost(message, optional, tag = "1")]
pub indent: ::core::option::Option<super::Quotation>,
#[prost(enumeration = "super::TrailingValueType", tag = "2")]
pub indent_type: i32,
#[prost(message, optional, tag = "3")]
pub spread: ::core::option::Option<super::Quotation>,
#[prost(enumeration = "super::TrailingValueType", tag = "4")]
pub spread_type: i32,
#[prost(enumeration = "super::TrailingStopStatus", tag = "5")]
pub status: i32,
#[prost(message, optional, tag = "7")]
pub price: ::core::option::Option<super::Quotation>,
#[prost(message, optional, tag = "8")]
pub extr: ::core::option::Option<super::Quotation>,
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum StopOrderDirection {
Unspecified = 0,
Buy = 1,
Sell = 2,
}
impl StopOrderDirection {
pub fn as_str_name(&self) -> &'static str {
match self {
StopOrderDirection::Unspecified => "STOP_ORDER_DIRECTION_UNSPECIFIED",
StopOrderDirection::Buy => "STOP_ORDER_DIRECTION_BUY",
StopOrderDirection::Sell => "STOP_ORDER_DIRECTION_SELL",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"STOP_ORDER_DIRECTION_UNSPECIFIED" => Some(Self::Unspecified),
"STOP_ORDER_DIRECTION_BUY" => Some(Self::Buy),
"STOP_ORDER_DIRECTION_SELL" => Some(Self::Sell),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum StopOrderExpirationType {
Unspecified = 0,
GoodTillCancel = 1,
GoodTillDate = 2,
}
impl StopOrderExpirationType {
pub fn as_str_name(&self) -> &'static str {
match self {
StopOrderExpirationType::Unspecified => {
"STOP_ORDER_EXPIRATION_TYPE_UNSPECIFIED"
}
StopOrderExpirationType::GoodTillCancel => {
"STOP_ORDER_EXPIRATION_TYPE_GOOD_TILL_CANCEL"
}
StopOrderExpirationType::GoodTillDate => {
"STOP_ORDER_EXPIRATION_TYPE_GOOD_TILL_DATE"
}
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"STOP_ORDER_EXPIRATION_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"STOP_ORDER_EXPIRATION_TYPE_GOOD_TILL_CANCEL" => Some(Self::GoodTillCancel),
"STOP_ORDER_EXPIRATION_TYPE_GOOD_TILL_DATE" => Some(Self::GoodTillDate),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum StopOrderType {
Unspecified = 0,
TakeProfit = 1,
StopLoss = 2,
StopLimit = 3,
}
impl StopOrderType {
pub fn as_str_name(&self) -> &'static str {
match self {
StopOrderType::Unspecified => "STOP_ORDER_TYPE_UNSPECIFIED",
StopOrderType::TakeProfit => "STOP_ORDER_TYPE_TAKE_PROFIT",
StopOrderType::StopLoss => "STOP_ORDER_TYPE_STOP_LOSS",
StopOrderType::StopLimit => "STOP_ORDER_TYPE_STOP_LIMIT",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"STOP_ORDER_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"STOP_ORDER_TYPE_TAKE_PROFIT" => Some(Self::TakeProfit),
"STOP_ORDER_TYPE_STOP_LOSS" => Some(Self::StopLoss),
"STOP_ORDER_TYPE_STOP_LIMIT" => Some(Self::StopLimit),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum StopOrderStatusOption {
StopOrderStatusUnspecified = 0,
StopOrderStatusAll = 1,
StopOrderStatusActive = 2,
StopOrderStatusExecuted = 3,
StopOrderStatusCanceled = 4,
StopOrderStatusExpired = 5,
}
impl StopOrderStatusOption {
pub fn as_str_name(&self) -> &'static str {
match self {
StopOrderStatusOption::StopOrderStatusUnspecified => {
"STOP_ORDER_STATUS_UNSPECIFIED"
}
StopOrderStatusOption::StopOrderStatusAll => "STOP_ORDER_STATUS_ALL",
StopOrderStatusOption::StopOrderStatusActive => "STOP_ORDER_STATUS_ACTIVE",
StopOrderStatusOption::StopOrderStatusExecuted => {
"STOP_ORDER_STATUS_EXECUTED"
}
StopOrderStatusOption::StopOrderStatusCanceled => {
"STOP_ORDER_STATUS_CANCELED"
}
StopOrderStatusOption::StopOrderStatusExpired => "STOP_ORDER_STATUS_EXPIRED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"STOP_ORDER_STATUS_UNSPECIFIED" => Some(Self::StopOrderStatusUnspecified),
"STOP_ORDER_STATUS_ALL" => Some(Self::StopOrderStatusAll),
"STOP_ORDER_STATUS_ACTIVE" => Some(Self::StopOrderStatusActive),
"STOP_ORDER_STATUS_EXECUTED" => Some(Self::StopOrderStatusExecuted),
"STOP_ORDER_STATUS_CANCELED" => Some(Self::StopOrderStatusCanceled),
"STOP_ORDER_STATUS_EXPIRED" => Some(Self::StopOrderStatusExpired),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ExchangeOrderType {
Unspecified = 0,
Market = 1,
Limit = 2,
}
impl ExchangeOrderType {
pub fn as_str_name(&self) -> &'static str {
match self {
ExchangeOrderType::Unspecified => "EXCHANGE_ORDER_TYPE_UNSPECIFIED",
ExchangeOrderType::Market => "EXCHANGE_ORDER_TYPE_MARKET",
ExchangeOrderType::Limit => "EXCHANGE_ORDER_TYPE_LIMIT",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"EXCHANGE_ORDER_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"EXCHANGE_ORDER_TYPE_MARKET" => Some(Self::Market),
"EXCHANGE_ORDER_TYPE_LIMIT" => Some(Self::Limit),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TakeProfitType {
Unspecified = 0,
Regular = 1,
Trailing = 2,
}
impl TakeProfitType {
pub fn as_str_name(&self) -> &'static str {
match self {
TakeProfitType::Unspecified => "TAKE_PROFIT_TYPE_UNSPECIFIED",
TakeProfitType::Regular => "TAKE_PROFIT_TYPE_REGULAR",
TakeProfitType::Trailing => "TAKE_PROFIT_TYPE_TRAILING",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TAKE_PROFIT_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"TAKE_PROFIT_TYPE_REGULAR" => Some(Self::Regular),
"TAKE_PROFIT_TYPE_TRAILING" => Some(Self::Trailing),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TrailingValueType {
TrailingValueUnspecified = 0,
TrailingValueAbsolute = 1,
TrailingValueRelative = 2,
}
impl TrailingValueType {
pub fn as_str_name(&self) -> &'static str {
match self {
TrailingValueType::TrailingValueUnspecified => "TRAILING_VALUE_UNSPECIFIED",
TrailingValueType::TrailingValueAbsolute => "TRAILING_VALUE_ABSOLUTE",
TrailingValueType::TrailingValueRelative => "TRAILING_VALUE_RELATIVE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TRAILING_VALUE_UNSPECIFIED" => Some(Self::TrailingValueUnspecified),
"TRAILING_VALUE_ABSOLUTE" => Some(Self::TrailingValueAbsolute),
"TRAILING_VALUE_RELATIVE" => Some(Self::TrailingValueRelative),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TrailingStopStatus {
TrailingStopUnspecified = 0,
TrailingStopActive = 1,
TrailingStopActivated = 2,
}
impl TrailingStopStatus {
pub fn as_str_name(&self) -> &'static str {
match self {
TrailingStopStatus::TrailingStopUnspecified => "TRAILING_STOP_UNSPECIFIED",
TrailingStopStatus::TrailingStopActive => "TRAILING_STOP_ACTIVE",
TrailingStopStatus::TrailingStopActivated => "TRAILING_STOP_ACTIVATED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TRAILING_STOP_UNSPECIFIED" => Some(Self::TrailingStopUnspecified),
"TRAILING_STOP_ACTIVE" => Some(Self::TrailingStopActive),
"TRAILING_STOP_ACTIVATED" => Some(Self::TrailingStopActivated),
_ => None,
}
}
}
pub mod stop_orders_service_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 StopOrdersServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl StopOrdersServiceClient<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> StopOrdersServiceClient<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,
) -> StopOrdersServiceClient<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,
{
StopOrdersServiceClient::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 post_stop_order(
&mut self,
request: impl tonic::IntoRequest<super::PostStopOrderRequest>,
) -> std::result::Result<
tonic::Response<super::PostStopOrderResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.StopOrdersService/PostStopOrder",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.StopOrdersService",
"PostStopOrder",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_stop_orders(
&mut self,
request: impl tonic::IntoRequest<super::GetStopOrdersRequest>,
) -> std::result::Result<
tonic::Response<super::GetStopOrdersResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.StopOrdersService/GetStopOrders",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.StopOrdersService",
"GetStopOrders",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn cancel_stop_order(
&mut self,
request: impl tonic::IntoRequest<super::CancelStopOrderRequest>,
) -> std::result::Result<
tonic::Response<super::CancelStopOrderResponse>,
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(
"/tinkoff.public.invest.api.contract.v1.StopOrdersService/CancelStopOrder",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"tinkoff.public.invest.api.contract.v1.StopOrdersService",
"CancelStopOrder",
),
);
self.inner.unary(req, path, codec).await
}
}
}