tinkoff_invest_client 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +169 -0
- data/Rakefile +10 -0
- data/docs/BrokerAccountType.md +15 -0
- data/docs/Candle.md +32 -0
- data/docs/CandleResolution.md +15 -0
- data/docs/Candles.md +22 -0
- data/docs/CandlesResponse.md +22 -0
- data/docs/Currencies.md +18 -0
- data/docs/Currency.md +15 -0
- data/docs/CurrencyPosition.md +22 -0
- data/docs/Empty.md +22 -0
- data/docs/Error.md +22 -0
- data/docs/ErrorPayload.md +20 -0
- data/docs/InstrumentType.md +15 -0
- data/docs/LimitOrderRequest.md +22 -0
- data/docs/LimitOrderResponse.md +22 -0
- data/docs/MarketApi.md +547 -0
- data/docs/MarketInstrument.md +34 -0
- data/docs/MarketInstrumentList.md +20 -0
- data/docs/MarketInstrumentListResponse.md +22 -0
- data/docs/MarketInstrumentResponse.md +22 -0
- data/docs/MarketOrderRequest.md +20 -0
- data/docs/MarketOrderResponse.md +22 -0
- data/docs/MoneyAmount.md +20 -0
- data/docs/Operation.md +44 -0
- data/docs/OperationStatus.md +15 -0
- data/docs/OperationTrade.md +24 -0
- data/docs/OperationType.md +15 -0
- data/docs/OperationTypeWithCommission.md +15 -0
- data/docs/Operations.md +18 -0
- data/docs/OperationsApi.md +83 -0
- data/docs/OperationsResponse.md +22 -0
- data/docs/Order.md +32 -0
- data/docs/OrderResponse.md +20 -0
- data/docs/OrderStatus.md +15 -0
- data/docs/OrderType.md +15 -0
- data/docs/Orderbook.md +38 -0
- data/docs/OrderbookResponse.md +22 -0
- data/docs/OrdersApi.md +297 -0
- data/docs/OrdersResponse.md +22 -0
- data/docs/PlacedLimitOrder.md +32 -0
- data/docs/PlacedMarketOrder.md +32 -0
- data/docs/Portfolio.md +18 -0
- data/docs/PortfolioApi.md +147 -0
- data/docs/PortfolioCurrenciesResponse.md +22 -0
- data/docs/PortfolioPosition.md +38 -0
- data/docs/PortfolioResponse.md +22 -0
- data/docs/SandboxAccount.md +20 -0
- data/docs/SandboxApi.md +367 -0
- data/docs/SandboxCurrency.md +15 -0
- data/docs/SandboxRegisterRequest.md +18 -0
- data/docs/SandboxRegisterResponse.md +22 -0
- data/docs/SandboxSetCurrencyBalanceRequest.md +20 -0
- data/docs/SandboxSetPositionBalanceRequest.md +20 -0
- data/docs/SearchMarketInstrument.md +32 -0
- data/docs/SearchMarketInstrumentResponse.md +22 -0
- data/docs/TradeStatus.md +15 -0
- data/docs/UserAccount.md +20 -0
- data/docs/UserAccounts.md +18 -0
- data/docs/UserAccountsResponse.md +22 -0
- data/docs/UserApi.md +72 -0
- data/generator_options.md +1 -0
- data/git_push.sh +58 -0
- data/lib/tinkoff_invest_client.rb +98 -0
- data/lib/tinkoff_invest_client/api/market_api.rb +518 -0
- data/lib/tinkoff_invest_client/api/operations_api.rb +97 -0
- data/lib/tinkoff_invest_client/api/orders_api.rb +291 -0
- data/lib/tinkoff_invest_client/api/portfolio_api.rb +138 -0
- data/lib/tinkoff_invest_client/api/sandbox_api.rb +335 -0
- data/lib/tinkoff_invest_client/api/user_api.rb +77 -0
- data/lib/tinkoff_invest_client/api_client.rb +390 -0
- data/lib/tinkoff_invest_client/api_error.rb +57 -0
- data/lib/tinkoff_invest_client/configuration.rb +281 -0
- data/lib/tinkoff_invest_client/models/broker_account_type.rb +37 -0
- data/lib/tinkoff_invest_client/models/candle.rb +322 -0
- data/lib/tinkoff_invest_client/models/candle_resolution.rb +46 -0
- data/lib/tinkoff_invest_client/models/candles.rb +253 -0
- data/lib/tinkoff_invest_client/models/candles_response.rb +253 -0
- data/lib/tinkoff_invest_client/models/currencies.rb +225 -0
- data/lib/tinkoff_invest_client/models/currency.rb +44 -0
- data/lib/tinkoff_invest_client/models/currency_position.rb +246 -0
- data/lib/tinkoff_invest_client/models/empty.rb +253 -0
- data/lib/tinkoff_invest_client/models/error.rb +253 -0
- data/lib/tinkoff_invest_client/models/error_payload.rb +227 -0
- data/lib/tinkoff_invest_client/models/instrument_type.rb +39 -0
- data/lib/tinkoff_invest_client/models/limit_order_request.rb +251 -0
- data/lib/tinkoff_invest_client/models/limit_order_response.rb +253 -0
- data/lib/tinkoff_invest_client/models/market_instrument.rb +317 -0
- data/lib/tinkoff_invest_client/models/market_instrument_list.rb +239 -0
- data/lib/tinkoff_invest_client/models/market_instrument_list_response.rb +253 -0
- data/lib/tinkoff_invest_client/models/market_instrument_response.rb +253 -0
- data/lib/tinkoff_invest_client/models/market_order_request.rb +237 -0
- data/lib/tinkoff_invest_client/models/market_order_response.rb +253 -0
- data/lib/tinkoff_invest_client/models/money_amount.rb +237 -0
- data/lib/tinkoff_invest_client/models/operation.rb +370 -0
- data/lib/tinkoff_invest_client/models/operation_status.rb +38 -0
- data/lib/tinkoff_invest_client/models/operation_trade.rb +266 -0
- data/lib/tinkoff_invest_client/models/operation_type.rb +37 -0
- data/lib/tinkoff_invest_client/models/operation_type_with_commission.rb +56 -0
- data/lib/tinkoff_invest_client/models/operations.rb +225 -0
- data/lib/tinkoff_invest_client/models/operations_response.rb +253 -0
- data/lib/tinkoff_invest_client/models/order.rb +321 -0
- data/lib/tinkoff_invest_client/models/order_response.rb +237 -0
- data/lib/tinkoff_invest_client/models/order_status.rb +44 -0
- data/lib/tinkoff_invest_client/models/order_type.rb +37 -0
- data/lib/tinkoff_invest_client/models/orderbook.rb +346 -0
- data/lib/tinkoff_invest_client/models/orderbook_response.rb +253 -0
- data/lib/tinkoff_invest_client/models/orders_response.rb +255 -0
- data/lib/tinkoff_invest_client/models/placed_limit_order.rb +307 -0
- data/lib/tinkoff_invest_client/models/placed_market_order.rb +307 -0
- data/lib/tinkoff_invest_client/models/portfolio.rb +225 -0
- data/lib/tinkoff_invest_client/models/portfolio_currencies_response.rb +253 -0
- data/lib/tinkoff_invest_client/models/portfolio_position.rb +333 -0
- data/lib/tinkoff_invest_client/models/portfolio_response.rb +253 -0
- data/lib/tinkoff_invest_client/models/sandbox_account.rb +237 -0
- data/lib/tinkoff_invest_client/models/sandbox_currency.rb +44 -0
- data/lib/tinkoff_invest_client/models/sandbox_register_request.rb +218 -0
- data/lib/tinkoff_invest_client/models/sandbox_register_response.rb +253 -0
- data/lib/tinkoff_invest_client/models/sandbox_set_currency_balance_request.rb +237 -0
- data/lib/tinkoff_invest_client/models/sandbox_set_position_balance_request.rb +232 -0
- data/lib/tinkoff_invest_client/models/search_market_instrument.rb +307 -0
- data/lib/tinkoff_invest_client/models/search_market_instrument_response.rb +253 -0
- data/lib/tinkoff_invest_client/models/trade_status.rb +37 -0
- data/lib/tinkoff_invest_client/models/user_account.rb +237 -0
- data/lib/tinkoff_invest_client/models/user_accounts.rb +225 -0
- data/lib/tinkoff_invest_client/models/user_accounts_response.rb +253 -0
- data/lib/tinkoff_invest_client/version.rb +15 -0
- data/spec/api/market_api_spec.rb +123 -0
- data/spec/api/operations_api_spec.rb +49 -0
- data/spec/api/orders_api_spec.rb +84 -0
- data/spec/api/portfolio_api_spec.rb +57 -0
- data/spec/api/sandbox_api_spec.rb +95 -0
- data/spec/api/user_api_spec.rb +45 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/broker_account_type_spec.rb +28 -0
- data/spec/models/candle_resolution_spec.rb +28 -0
- data/spec/models/candle_spec.rb +76 -0
- data/spec/models/candles_response_spec.rb +46 -0
- data/spec/models/candles_spec.rb +46 -0
- data/spec/models/currencies_spec.rb +34 -0
- data/spec/models/currency_position_spec.rb +46 -0
- data/spec/models/currency_spec.rb +28 -0
- data/spec/models/empty_spec.rb +46 -0
- data/spec/models/error_payload_spec.rb +40 -0
- data/spec/models/error_spec.rb +46 -0
- data/spec/models/instrument_type_spec.rb +28 -0
- data/spec/models/limit_order_request_spec.rb +46 -0
- data/spec/models/limit_order_response_spec.rb +46 -0
- data/spec/models/market_instrument_list_response_spec.rb +46 -0
- data/spec/models/market_instrument_list_spec.rb +40 -0
- data/spec/models/market_instrument_response_spec.rb +46 -0
- data/spec/models/market_instrument_spec.rb +82 -0
- data/spec/models/market_order_request_spec.rb +40 -0
- data/spec/models/market_order_response_spec.rb +46 -0
- data/spec/models/money_amount_spec.rb +40 -0
- data/spec/models/operation_spec.rb +112 -0
- data/spec/models/operation_status_spec.rb +28 -0
- data/spec/models/operation_trade_spec.rb +52 -0
- data/spec/models/operation_type_spec.rb +28 -0
- data/spec/models/operation_type_with_commission_spec.rb +28 -0
- data/spec/models/operations_response_spec.rb +46 -0
- data/spec/models/operations_spec.rb +34 -0
- data/spec/models/order_response_spec.rb +40 -0
- data/spec/models/order_spec.rb +76 -0
- data/spec/models/order_status_spec.rb +28 -0
- data/spec/models/order_type_spec.rb +28 -0
- data/spec/models/orderbook_response_spec.rb +46 -0
- data/spec/models/orderbook_spec.rb +94 -0
- data/spec/models/orders_response_spec.rb +46 -0
- data/spec/models/placed_limit_order_spec.rb +76 -0
- data/spec/models/placed_market_order_spec.rb +76 -0
- data/spec/models/portfolio_currencies_response_spec.rb +46 -0
- data/spec/models/portfolio_position_spec.rb +94 -0
- data/spec/models/portfolio_response_spec.rb +46 -0
- data/spec/models/portfolio_spec.rb +34 -0
- data/spec/models/sandbox_account_spec.rb +40 -0
- data/spec/models/sandbox_currency_spec.rb +28 -0
- data/spec/models/sandbox_register_request_spec.rb +34 -0
- data/spec/models/sandbox_register_response_spec.rb +46 -0
- data/spec/models/sandbox_set_currency_balance_request_spec.rb +40 -0
- data/spec/models/sandbox_set_position_balance_request_spec.rb +40 -0
- data/spec/models/search_market_instrument_response_spec.rb +46 -0
- data/spec/models/search_market_instrument_spec.rb +76 -0
- data/spec/models/trade_status_spec.rb +28 -0
- data/spec/models/user_account_spec.rb +40 -0
- data/spec/models/user_accounts_response_spec.rb +46 -0
- data/spec/models/user_accounts_spec.rb +34 -0
- data/spec/spec_helper.rb +111 -0
- data/tinkoff_invest_client.gemspec +38 -0
- metadata +336 -0
@@ -0,0 +1,518 @@
|
|
1
|
+
=begin
|
2
|
+
#OpenAPI
|
3
|
+
|
4
|
+
#tinkoff.ru/invest OpenAPI.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
Contact: al.a.volkov@tinkoff.ru
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.0.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module TinkoffInvestClient
|
16
|
+
class MarketApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Получение списка облигаций
|
23
|
+
# @param [Hash] opts the optional parameters
|
24
|
+
# @return [MarketInstrumentListResponse]
|
25
|
+
def market_bonds_get(opts = {})
|
26
|
+
data, _status_code, _headers = market_bonds_get_with_http_info(opts)
|
27
|
+
data
|
28
|
+
end
|
29
|
+
|
30
|
+
# Получение списка облигаций
|
31
|
+
# @param [Hash] opts the optional parameters
|
32
|
+
# @return [Array<(MarketInstrumentListResponse, Integer, Hash)>] MarketInstrumentListResponse data, response status code and response headers
|
33
|
+
def market_bonds_get_with_http_info(opts = {})
|
34
|
+
if @api_client.config.debugging
|
35
|
+
@api_client.config.logger.debug 'Calling API: MarketApi.market_bonds_get ...'
|
36
|
+
end
|
37
|
+
# resource path
|
38
|
+
local_var_path = '/market/bonds'
|
39
|
+
|
40
|
+
# query parameters
|
41
|
+
query_params = opts[:query_params] || {}
|
42
|
+
|
43
|
+
# header parameters
|
44
|
+
header_params = opts[:header_params] || {}
|
45
|
+
# HTTP header 'Accept' (if needed)
|
46
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
47
|
+
|
48
|
+
# form parameters
|
49
|
+
form_params = opts[:form_params] || {}
|
50
|
+
|
51
|
+
# http body (model)
|
52
|
+
post_body = opts[:debug_body]
|
53
|
+
|
54
|
+
# return_type
|
55
|
+
return_type = opts[:debug_return_type] || 'MarketInstrumentListResponse'
|
56
|
+
|
57
|
+
# auth_names
|
58
|
+
auth_names = opts[:debug_auth_names] || ['sso_auth']
|
59
|
+
|
60
|
+
new_options = opts.merge(
|
61
|
+
:operation => :"MarketApi.market_bonds_get",
|
62
|
+
:header_params => header_params,
|
63
|
+
:query_params => query_params,
|
64
|
+
:form_params => form_params,
|
65
|
+
:body => post_body,
|
66
|
+
:auth_names => auth_names,
|
67
|
+
:return_type => return_type
|
68
|
+
)
|
69
|
+
|
70
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
71
|
+
if @api_client.config.debugging
|
72
|
+
@api_client.config.logger.debug "API called: MarketApi#market_bonds_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
73
|
+
end
|
74
|
+
return data, status_code, headers
|
75
|
+
end
|
76
|
+
|
77
|
+
# Получение исторических свечей по FIGI
|
78
|
+
# @param figi [String] FIGI
|
79
|
+
# @param from [Time] Начало временного промежутка
|
80
|
+
# @param to [Time] Конец временного промежутка
|
81
|
+
# @param interval [CandleResolution] Интервал свечи
|
82
|
+
# @param [Hash] opts the optional parameters
|
83
|
+
# @return [CandlesResponse]
|
84
|
+
def market_candles_get(figi, from, to, interval, opts = {})
|
85
|
+
data, _status_code, _headers = market_candles_get_with_http_info(figi, from, to, interval, opts)
|
86
|
+
data
|
87
|
+
end
|
88
|
+
|
89
|
+
# Получение исторических свечей по FIGI
|
90
|
+
# @param figi [String] FIGI
|
91
|
+
# @param from [Time] Начало временного промежутка
|
92
|
+
# @param to [Time] Конец временного промежутка
|
93
|
+
# @param interval [CandleResolution] Интервал свечи
|
94
|
+
# @param [Hash] opts the optional parameters
|
95
|
+
# @return [Array<(CandlesResponse, Integer, Hash)>] CandlesResponse data, response status code and response headers
|
96
|
+
def market_candles_get_with_http_info(figi, from, to, interval, opts = {})
|
97
|
+
if @api_client.config.debugging
|
98
|
+
@api_client.config.logger.debug 'Calling API: MarketApi.market_candles_get ...'
|
99
|
+
end
|
100
|
+
# verify the required parameter 'figi' is set
|
101
|
+
if @api_client.config.client_side_validation && figi.nil?
|
102
|
+
fail ArgumentError, "Missing the required parameter 'figi' when calling MarketApi.market_candles_get"
|
103
|
+
end
|
104
|
+
# verify the required parameter 'from' is set
|
105
|
+
if @api_client.config.client_side_validation && from.nil?
|
106
|
+
fail ArgumentError, "Missing the required parameter 'from' when calling MarketApi.market_candles_get"
|
107
|
+
end
|
108
|
+
# verify the required parameter 'to' is set
|
109
|
+
if @api_client.config.client_side_validation && to.nil?
|
110
|
+
fail ArgumentError, "Missing the required parameter 'to' when calling MarketApi.market_candles_get"
|
111
|
+
end
|
112
|
+
# verify the required parameter 'interval' is set
|
113
|
+
if @api_client.config.client_side_validation && interval.nil?
|
114
|
+
fail ArgumentError, "Missing the required parameter 'interval' when calling MarketApi.market_candles_get"
|
115
|
+
end
|
116
|
+
# resource path
|
117
|
+
local_var_path = '/market/candles'
|
118
|
+
|
119
|
+
# query parameters
|
120
|
+
query_params = opts[:query_params] || {}
|
121
|
+
query_params[:'figi'] = figi
|
122
|
+
query_params[:'from'] = from
|
123
|
+
query_params[:'to'] = to
|
124
|
+
query_params[:'interval'] = interval
|
125
|
+
|
126
|
+
# header parameters
|
127
|
+
header_params = opts[:header_params] || {}
|
128
|
+
# HTTP header 'Accept' (if needed)
|
129
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
130
|
+
|
131
|
+
# form parameters
|
132
|
+
form_params = opts[:form_params] || {}
|
133
|
+
|
134
|
+
# http body (model)
|
135
|
+
post_body = opts[:debug_body]
|
136
|
+
|
137
|
+
# return_type
|
138
|
+
return_type = opts[:debug_return_type] || 'CandlesResponse'
|
139
|
+
|
140
|
+
# auth_names
|
141
|
+
auth_names = opts[:debug_auth_names] || ['sso_auth']
|
142
|
+
|
143
|
+
new_options = opts.merge(
|
144
|
+
:operation => :"MarketApi.market_candles_get",
|
145
|
+
:header_params => header_params,
|
146
|
+
:query_params => query_params,
|
147
|
+
:form_params => form_params,
|
148
|
+
:body => post_body,
|
149
|
+
:auth_names => auth_names,
|
150
|
+
:return_type => return_type
|
151
|
+
)
|
152
|
+
|
153
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
154
|
+
if @api_client.config.debugging
|
155
|
+
@api_client.config.logger.debug "API called: MarketApi#market_candles_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
156
|
+
end
|
157
|
+
return data, status_code, headers
|
158
|
+
end
|
159
|
+
|
160
|
+
# Получение списка валютных пар
|
161
|
+
# @param [Hash] opts the optional parameters
|
162
|
+
# @return [MarketInstrumentListResponse]
|
163
|
+
def market_currencies_get(opts = {})
|
164
|
+
data, _status_code, _headers = market_currencies_get_with_http_info(opts)
|
165
|
+
data
|
166
|
+
end
|
167
|
+
|
168
|
+
# Получение списка валютных пар
|
169
|
+
# @param [Hash] opts the optional parameters
|
170
|
+
# @return [Array<(MarketInstrumentListResponse, Integer, Hash)>] MarketInstrumentListResponse data, response status code and response headers
|
171
|
+
def market_currencies_get_with_http_info(opts = {})
|
172
|
+
if @api_client.config.debugging
|
173
|
+
@api_client.config.logger.debug 'Calling API: MarketApi.market_currencies_get ...'
|
174
|
+
end
|
175
|
+
# resource path
|
176
|
+
local_var_path = '/market/currencies'
|
177
|
+
|
178
|
+
# query parameters
|
179
|
+
query_params = opts[:query_params] || {}
|
180
|
+
|
181
|
+
# header parameters
|
182
|
+
header_params = opts[:header_params] || {}
|
183
|
+
# HTTP header 'Accept' (if needed)
|
184
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
185
|
+
|
186
|
+
# form parameters
|
187
|
+
form_params = opts[:form_params] || {}
|
188
|
+
|
189
|
+
# http body (model)
|
190
|
+
post_body = opts[:debug_body]
|
191
|
+
|
192
|
+
# return_type
|
193
|
+
return_type = opts[:debug_return_type] || 'MarketInstrumentListResponse'
|
194
|
+
|
195
|
+
# auth_names
|
196
|
+
auth_names = opts[:debug_auth_names] || ['sso_auth']
|
197
|
+
|
198
|
+
new_options = opts.merge(
|
199
|
+
:operation => :"MarketApi.market_currencies_get",
|
200
|
+
:header_params => header_params,
|
201
|
+
:query_params => query_params,
|
202
|
+
:form_params => form_params,
|
203
|
+
:body => post_body,
|
204
|
+
:auth_names => auth_names,
|
205
|
+
:return_type => return_type
|
206
|
+
)
|
207
|
+
|
208
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
209
|
+
if @api_client.config.debugging
|
210
|
+
@api_client.config.logger.debug "API called: MarketApi#market_currencies_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
211
|
+
end
|
212
|
+
return data, status_code, headers
|
213
|
+
end
|
214
|
+
|
215
|
+
# Получение списка ETF
|
216
|
+
# @param [Hash] opts the optional parameters
|
217
|
+
# @return [MarketInstrumentListResponse]
|
218
|
+
def market_etfs_get(opts = {})
|
219
|
+
data, _status_code, _headers = market_etfs_get_with_http_info(opts)
|
220
|
+
data
|
221
|
+
end
|
222
|
+
|
223
|
+
# Получение списка ETF
|
224
|
+
# @param [Hash] opts the optional parameters
|
225
|
+
# @return [Array<(MarketInstrumentListResponse, Integer, Hash)>] MarketInstrumentListResponse data, response status code and response headers
|
226
|
+
def market_etfs_get_with_http_info(opts = {})
|
227
|
+
if @api_client.config.debugging
|
228
|
+
@api_client.config.logger.debug 'Calling API: MarketApi.market_etfs_get ...'
|
229
|
+
end
|
230
|
+
# resource path
|
231
|
+
local_var_path = '/market/etfs'
|
232
|
+
|
233
|
+
# query parameters
|
234
|
+
query_params = opts[:query_params] || {}
|
235
|
+
|
236
|
+
# header parameters
|
237
|
+
header_params = opts[:header_params] || {}
|
238
|
+
# HTTP header 'Accept' (if needed)
|
239
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
240
|
+
|
241
|
+
# form parameters
|
242
|
+
form_params = opts[:form_params] || {}
|
243
|
+
|
244
|
+
# http body (model)
|
245
|
+
post_body = opts[:debug_body]
|
246
|
+
|
247
|
+
# return_type
|
248
|
+
return_type = opts[:debug_return_type] || 'MarketInstrumentListResponse'
|
249
|
+
|
250
|
+
# auth_names
|
251
|
+
auth_names = opts[:debug_auth_names] || ['sso_auth']
|
252
|
+
|
253
|
+
new_options = opts.merge(
|
254
|
+
:operation => :"MarketApi.market_etfs_get",
|
255
|
+
:header_params => header_params,
|
256
|
+
:query_params => query_params,
|
257
|
+
:form_params => form_params,
|
258
|
+
:body => post_body,
|
259
|
+
:auth_names => auth_names,
|
260
|
+
:return_type => return_type
|
261
|
+
)
|
262
|
+
|
263
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
264
|
+
if @api_client.config.debugging
|
265
|
+
@api_client.config.logger.debug "API called: MarketApi#market_etfs_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
266
|
+
end
|
267
|
+
return data, status_code, headers
|
268
|
+
end
|
269
|
+
|
270
|
+
# Получение стакана по FIGI
|
271
|
+
# @param figi [String] FIGI
|
272
|
+
# @param depth [Integer] Глубина стакана [1..20]
|
273
|
+
# @param [Hash] opts the optional parameters
|
274
|
+
# @return [OrderbookResponse]
|
275
|
+
def market_orderbook_get(figi, depth, opts = {})
|
276
|
+
data, _status_code, _headers = market_orderbook_get_with_http_info(figi, depth, opts)
|
277
|
+
data
|
278
|
+
end
|
279
|
+
|
280
|
+
# Получение стакана по FIGI
|
281
|
+
# @param figi [String] FIGI
|
282
|
+
# @param depth [Integer] Глубина стакана [1..20]
|
283
|
+
# @param [Hash] opts the optional parameters
|
284
|
+
# @return [Array<(OrderbookResponse, Integer, Hash)>] OrderbookResponse data, response status code and response headers
|
285
|
+
def market_orderbook_get_with_http_info(figi, depth, opts = {})
|
286
|
+
if @api_client.config.debugging
|
287
|
+
@api_client.config.logger.debug 'Calling API: MarketApi.market_orderbook_get ...'
|
288
|
+
end
|
289
|
+
# verify the required parameter 'figi' is set
|
290
|
+
if @api_client.config.client_side_validation && figi.nil?
|
291
|
+
fail ArgumentError, "Missing the required parameter 'figi' when calling MarketApi.market_orderbook_get"
|
292
|
+
end
|
293
|
+
# verify the required parameter 'depth' is set
|
294
|
+
if @api_client.config.client_side_validation && depth.nil?
|
295
|
+
fail ArgumentError, "Missing the required parameter 'depth' when calling MarketApi.market_orderbook_get"
|
296
|
+
end
|
297
|
+
# resource path
|
298
|
+
local_var_path = '/market/orderbook'
|
299
|
+
|
300
|
+
# query parameters
|
301
|
+
query_params = opts[:query_params] || {}
|
302
|
+
query_params[:'figi'] = figi
|
303
|
+
query_params[:'depth'] = depth
|
304
|
+
|
305
|
+
# header parameters
|
306
|
+
header_params = opts[:header_params] || {}
|
307
|
+
# HTTP header 'Accept' (if needed)
|
308
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
309
|
+
|
310
|
+
# form parameters
|
311
|
+
form_params = opts[:form_params] || {}
|
312
|
+
|
313
|
+
# http body (model)
|
314
|
+
post_body = opts[:debug_body]
|
315
|
+
|
316
|
+
# return_type
|
317
|
+
return_type = opts[:debug_return_type] || 'OrderbookResponse'
|
318
|
+
|
319
|
+
# auth_names
|
320
|
+
auth_names = opts[:debug_auth_names] || ['sso_auth']
|
321
|
+
|
322
|
+
new_options = opts.merge(
|
323
|
+
:operation => :"MarketApi.market_orderbook_get",
|
324
|
+
:header_params => header_params,
|
325
|
+
:query_params => query_params,
|
326
|
+
:form_params => form_params,
|
327
|
+
:body => post_body,
|
328
|
+
:auth_names => auth_names,
|
329
|
+
:return_type => return_type
|
330
|
+
)
|
331
|
+
|
332
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
333
|
+
if @api_client.config.debugging
|
334
|
+
@api_client.config.logger.debug "API called: MarketApi#market_orderbook_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
335
|
+
end
|
336
|
+
return data, status_code, headers
|
337
|
+
end
|
338
|
+
|
339
|
+
# Получение инструмента по FIGI
|
340
|
+
# @param figi [String] FIGI
|
341
|
+
# @param [Hash] opts the optional parameters
|
342
|
+
# @return [SearchMarketInstrumentResponse]
|
343
|
+
def market_search_by_figi_get(figi, opts = {})
|
344
|
+
data, _status_code, _headers = market_search_by_figi_get_with_http_info(figi, opts)
|
345
|
+
data
|
346
|
+
end
|
347
|
+
|
348
|
+
# Получение инструмента по FIGI
|
349
|
+
# @param figi [String] FIGI
|
350
|
+
# @param [Hash] opts the optional parameters
|
351
|
+
# @return [Array<(SearchMarketInstrumentResponse, Integer, Hash)>] SearchMarketInstrumentResponse data, response status code and response headers
|
352
|
+
def market_search_by_figi_get_with_http_info(figi, opts = {})
|
353
|
+
if @api_client.config.debugging
|
354
|
+
@api_client.config.logger.debug 'Calling API: MarketApi.market_search_by_figi_get ...'
|
355
|
+
end
|
356
|
+
# verify the required parameter 'figi' is set
|
357
|
+
if @api_client.config.client_side_validation && figi.nil?
|
358
|
+
fail ArgumentError, "Missing the required parameter 'figi' when calling MarketApi.market_search_by_figi_get"
|
359
|
+
end
|
360
|
+
# resource path
|
361
|
+
local_var_path = '/market/search/by-figi'
|
362
|
+
|
363
|
+
# query parameters
|
364
|
+
query_params = opts[:query_params] || {}
|
365
|
+
query_params[:'figi'] = figi
|
366
|
+
|
367
|
+
# header parameters
|
368
|
+
header_params = opts[:header_params] || {}
|
369
|
+
# HTTP header 'Accept' (if needed)
|
370
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
371
|
+
|
372
|
+
# form parameters
|
373
|
+
form_params = opts[:form_params] || {}
|
374
|
+
|
375
|
+
# http body (model)
|
376
|
+
post_body = opts[:debug_body]
|
377
|
+
|
378
|
+
# return_type
|
379
|
+
return_type = opts[:debug_return_type] || 'SearchMarketInstrumentResponse'
|
380
|
+
|
381
|
+
# auth_names
|
382
|
+
auth_names = opts[:debug_auth_names] || ['sso_auth']
|
383
|
+
|
384
|
+
new_options = opts.merge(
|
385
|
+
:operation => :"MarketApi.market_search_by_figi_get",
|
386
|
+
:header_params => header_params,
|
387
|
+
:query_params => query_params,
|
388
|
+
:form_params => form_params,
|
389
|
+
:body => post_body,
|
390
|
+
:auth_names => auth_names,
|
391
|
+
:return_type => return_type
|
392
|
+
)
|
393
|
+
|
394
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
395
|
+
if @api_client.config.debugging
|
396
|
+
@api_client.config.logger.debug "API called: MarketApi#market_search_by_figi_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
397
|
+
end
|
398
|
+
return data, status_code, headers
|
399
|
+
end
|
400
|
+
|
401
|
+
# Получение инструмента по тикеру
|
402
|
+
# @param ticker [String] Тикер инструмента
|
403
|
+
# @param [Hash] opts the optional parameters
|
404
|
+
# @return [MarketInstrumentListResponse]
|
405
|
+
def market_search_by_ticker_get(ticker, opts = {})
|
406
|
+
data, _status_code, _headers = market_search_by_ticker_get_with_http_info(ticker, opts)
|
407
|
+
data
|
408
|
+
end
|
409
|
+
|
410
|
+
# Получение инструмента по тикеру
|
411
|
+
# @param ticker [String] Тикер инструмента
|
412
|
+
# @param [Hash] opts the optional parameters
|
413
|
+
# @return [Array<(MarketInstrumentListResponse, Integer, Hash)>] MarketInstrumentListResponse data, response status code and response headers
|
414
|
+
def market_search_by_ticker_get_with_http_info(ticker, opts = {})
|
415
|
+
if @api_client.config.debugging
|
416
|
+
@api_client.config.logger.debug 'Calling API: MarketApi.market_search_by_ticker_get ...'
|
417
|
+
end
|
418
|
+
# verify the required parameter 'ticker' is set
|
419
|
+
if @api_client.config.client_side_validation && ticker.nil?
|
420
|
+
fail ArgumentError, "Missing the required parameter 'ticker' when calling MarketApi.market_search_by_ticker_get"
|
421
|
+
end
|
422
|
+
# resource path
|
423
|
+
local_var_path = '/market/search/by-ticker'
|
424
|
+
|
425
|
+
# query parameters
|
426
|
+
query_params = opts[:query_params] || {}
|
427
|
+
query_params[:'ticker'] = ticker
|
428
|
+
|
429
|
+
# header parameters
|
430
|
+
header_params = opts[:header_params] || {}
|
431
|
+
# HTTP header 'Accept' (if needed)
|
432
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
433
|
+
|
434
|
+
# form parameters
|
435
|
+
form_params = opts[:form_params] || {}
|
436
|
+
|
437
|
+
# http body (model)
|
438
|
+
post_body = opts[:debug_body]
|
439
|
+
|
440
|
+
# return_type
|
441
|
+
return_type = opts[:debug_return_type] || 'MarketInstrumentListResponse'
|
442
|
+
|
443
|
+
# auth_names
|
444
|
+
auth_names = opts[:debug_auth_names] || ['sso_auth']
|
445
|
+
|
446
|
+
new_options = opts.merge(
|
447
|
+
:operation => :"MarketApi.market_search_by_ticker_get",
|
448
|
+
:header_params => header_params,
|
449
|
+
:query_params => query_params,
|
450
|
+
:form_params => form_params,
|
451
|
+
:body => post_body,
|
452
|
+
:auth_names => auth_names,
|
453
|
+
:return_type => return_type
|
454
|
+
)
|
455
|
+
|
456
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
457
|
+
if @api_client.config.debugging
|
458
|
+
@api_client.config.logger.debug "API called: MarketApi#market_search_by_ticker_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
459
|
+
end
|
460
|
+
return data, status_code, headers
|
461
|
+
end
|
462
|
+
|
463
|
+
# Получение списка акций
|
464
|
+
# @param [Hash] opts the optional parameters
|
465
|
+
# @return [MarketInstrumentListResponse]
|
466
|
+
def market_stocks_get(opts = {})
|
467
|
+
data, _status_code, _headers = market_stocks_get_with_http_info(opts)
|
468
|
+
data
|
469
|
+
end
|
470
|
+
|
471
|
+
# Получение списка акций
|
472
|
+
# @param [Hash] opts the optional parameters
|
473
|
+
# @return [Array<(MarketInstrumentListResponse, Integer, Hash)>] MarketInstrumentListResponse data, response status code and response headers
|
474
|
+
def market_stocks_get_with_http_info(opts = {})
|
475
|
+
if @api_client.config.debugging
|
476
|
+
@api_client.config.logger.debug 'Calling API: MarketApi.market_stocks_get ...'
|
477
|
+
end
|
478
|
+
# resource path
|
479
|
+
local_var_path = '/market/stocks'
|
480
|
+
|
481
|
+
# query parameters
|
482
|
+
query_params = opts[:query_params] || {}
|
483
|
+
|
484
|
+
# header parameters
|
485
|
+
header_params = opts[:header_params] || {}
|
486
|
+
# HTTP header 'Accept' (if needed)
|
487
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
488
|
+
|
489
|
+
# form parameters
|
490
|
+
form_params = opts[:form_params] || {}
|
491
|
+
|
492
|
+
# http body (model)
|
493
|
+
post_body = opts[:debug_body]
|
494
|
+
|
495
|
+
# return_type
|
496
|
+
return_type = opts[:debug_return_type] || 'MarketInstrumentListResponse'
|
497
|
+
|
498
|
+
# auth_names
|
499
|
+
auth_names = opts[:debug_auth_names] || ['sso_auth']
|
500
|
+
|
501
|
+
new_options = opts.merge(
|
502
|
+
:operation => :"MarketApi.market_stocks_get",
|
503
|
+
:header_params => header_params,
|
504
|
+
:query_params => query_params,
|
505
|
+
:form_params => form_params,
|
506
|
+
:body => post_body,
|
507
|
+
:auth_names => auth_names,
|
508
|
+
:return_type => return_type
|
509
|
+
)
|
510
|
+
|
511
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
512
|
+
if @api_client.config.debugging
|
513
|
+
@api_client.config.logger.debug "API called: MarketApi#market_stocks_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
514
|
+
end
|
515
|
+
return data, status_code, headers
|
516
|
+
end
|
517
|
+
end
|
518
|
+
end
|