Class: SnapTrade::ReferenceDataApi
- Inherits:
-
Object
- Object
- SnapTrade::ReferenceDataApi
- Defined in:
- lib/snaptrade/api/reference_data_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#get_currency_exchange_rate_pair(currency_pair:, extra: {}) ⇒ Object
Get exchange rate of a currency pair.
-
#get_currency_exchange_rate_pair_with_http_info(currency_pair:, extra: {}) ⇒ Object
Get exchange rate of a currency pair.
-
#get_partner_info(extra: {}) ⇒ Object
Get Client Info.
-
#get_partner_info_with_http_info(extra: {}) ⇒ Object
Get Client Info.
-
#get_security_types(extra: {}) ⇒ Object
List security types.
-
#get_security_types_with_http_info(extra: {}) ⇒ Object
List security types.
-
#get_stock_exchanges(extra: {}) ⇒ Object
Get exchanges.
-
#get_stock_exchanges_with_http_info(extra: {}) ⇒ Object
Get exchanges.
-
#get_symbols(substring: SENTINEL, extra: {}) ⇒ Object
Search symbols.
-
#get_symbols_by_ticker(query:, extra: {}) ⇒ Object
Get symbol detail.
-
#get_symbols_by_ticker_with_http_info(query:, extra: {}) ⇒ Object
Get symbol detail.
-
#get_symbols_with_http_info(substring: SENTINEL, extra: {}) ⇒ Object
Search symbols.
-
#initialize(api_client = ApiClient.default) ⇒ ReferenceDataApi
constructor
A new instance of ReferenceDataApi.
-
#list_all_brokerage_authorization_type(brokerage: SENTINEL, extra: {}) ⇒ Object
Get all brokerage authorization types.
-
#list_all_brokerage_authorization_type_with_http_info(brokerage: SENTINEL, extra: {}) ⇒ Object
Get all brokerage authorization types.
-
#list_all_brokerage_instruments(slug:, extra: {}) ⇒ Object
Get brokerage instruments.
-
#list_all_brokerage_instruments_with_http_info(slug:, extra: {}) ⇒ Object
Get brokerage instruments.
-
#list_all_brokerages(extra: {}) ⇒ Object
Get brokerages.
-
#list_all_brokerages_with_http_info(extra: {}) ⇒ Object
Get brokerages.
-
#list_all_currencies(extra: {}) ⇒ Object
Get currencies.
-
#list_all_currencies_rates(extra: {}) ⇒ Object
Get currency exchange rates.
-
#list_all_currencies_rates_with_http_info(extra: {}) ⇒ Object
Get currency exchange rates.
-
#list_all_currencies_with_http_info(extra: {}) ⇒ Object
Get currencies.
-
#symbol_search_user_account(user_id:, user_secret:, account_id:, substring: SENTINEL, extra: {}) ⇒ Object
Search account symbols.
-
#symbol_search_user_account_with_http_info(user_id:, user_secret:, account_id:, substring: SENTINEL, extra: {}) ⇒ Object
Search account symbols.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ ReferenceDataApi
Returns a new instance of ReferenceDataApi.
16 17 18 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 16 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
14 15 16 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 14 def api_client @api_client end |
Instance Method Details
#get_currency_exchange_rate_pair(currency_pair:, extra: {}) ⇒ Object
Get exchange rate of a currency pair
Returns an Exchange Rate Pair object for the specified Currency Pair.
26 27 28 29 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 26 def get_currency_exchange_rate_pair(currency_pair:, extra: {}) data, _status_code, _headers = get_currency_exchange_rate_pair_with_http_info_impl(currency_pair, extra) data end |
#get_currency_exchange_rate_pair_with_http_info(currency_pair:, extra: {}) ⇒ Object
Get exchange rate of a currency pair
Returns an Exchange Rate Pair object for the specified Currency Pair.
37 38 39 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 37 def get_currency_exchange_rate_pair_with_http_info(currency_pair:, extra: {}) get_currency_exchange_rate_pair_with_http_info_impl(currency_pair, extra) end |
#get_partner_info(extra: {}) ⇒ Object
Get Client Info
Returns configurations for your SnapTrade Client ID, including allowed brokerages and data access.
110 111 112 113 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 110 def get_partner_info(extra: {}) data, _status_code, _headers = get_partner_info_with_http_info_impl(extra) data end |
#get_partner_info_with_http_info(extra: {}) ⇒ Object
Get Client Info
Returns configurations for your SnapTrade Client ID, including allowed brokerages and data access.
120 121 122 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 120 def get_partner_info_with_http_info(extra: {}) get_partner_info_with_http_info_impl(extra) end |
#get_security_types(extra: {}) ⇒ Object
List security types
Return all available security types supported by SnapTrade.
187 188 189 190 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 187 def get_security_types(extra: {}) data, _status_code, _headers = get_security_types_with_http_info_impl(extra) data end |
#get_security_types_with_http_info(extra: {}) ⇒ Object
List security types
Return all available security types supported by SnapTrade.
197 198 199 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 197 def get_security_types_with_http_info(extra: {}) get_security_types_with_http_info_impl(extra) end |
#get_stock_exchanges(extra: {}) ⇒ Object
Get exchanges
Returns a list of all supported Exchanges.
264 265 266 267 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 264 def get_stock_exchanges(extra: {}) data, _status_code, _headers = get_stock_exchanges_with_http_info_impl(extra) data end |
#get_stock_exchanges_with_http_info(extra: {}) ⇒ Object
Get exchanges
Returns a list of all supported Exchanges.
274 275 276 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 274 def get_stock_exchanges_with_http_info(extra: {}) get_stock_exchanges_with_http_info_impl(extra) end |
#get_symbols(substring: SENTINEL, extra: {}) ⇒ Object
Search symbols
Returns a list of Universal Symbol objects that match the given query. The matching takes into consideration both the ticker and the name of the symbol. Only the first 20 results are returned.
343 344 345 346 347 348 349 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 343 def get_symbols(substring: SENTINEL, extra: {}) _body = {} _body[:substring] = substring if substring != SENTINEL extra[:symbol_query] = _body if !_body.empty? data, _status_code, _headers = get_symbols_with_http_info_impl(extra) data end |
#get_symbols_by_ticker(query:, extra: {}) ⇒ Object
Get symbol detail
Returns the Universal Symbol object specified by the ticker or the Universal Symbol ID. When a ticker is specified, the first matching result is returned. We largely follow the [Yahoo Finance ticker format](help.yahoo.com/kb/SLN2310.html)(click on “Yahoo Finance Market Coverage and Data Delays”). For example, for securities traded on the Toronto Stock Exchange, the symbol has a ‘.TO’ suffix. For securities traded on NASDAQ or NYSE, the symbol does not have a suffix. Please use the ticker with the proper suffix for the best results.
436 437 438 439 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 436 def get_symbols_by_ticker(query:, extra: {}) data, _status_code, _headers = get_symbols_by_ticker_with_http_info_impl(query, extra) data end |
#get_symbols_by_ticker_with_http_info(query:, extra: {}) ⇒ Object
Get symbol detail
Returns the Universal Symbol object specified by the ticker or the Universal Symbol ID. When a ticker is specified, the first matching result is returned. We largely follow the [Yahoo Finance ticker format](help.yahoo.com/kb/SLN2310.html)(click on “Yahoo Finance Market Coverage and Data Delays”). For example, for securities traded on the Toronto Stock Exchange, the symbol has a ‘.TO’ suffix. For securities traded on NASDAQ or NYSE, the symbol does not have a suffix. Please use the ticker with the proper suffix for the best results.
447 448 449 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 447 def get_symbols_by_ticker_with_http_info(query:, extra: {}) get_symbols_by_ticker_with_http_info_impl(query, extra) end |
#get_symbols_with_http_info(substring: SENTINEL, extra: {}) ⇒ Object
Search symbols
Returns a list of Universal Symbol objects that match the given query. The matching takes into consideration both the ticker and the name of the symbol. Only the first 20 results are returned.
358 359 360 361 362 363 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 358 def get_symbols_with_http_info(substring: SENTINEL, extra: {}) _body = {} _body[:substring] = substring if substring != SENTINEL extra[:symbol_query] = _body if !_body.empty? get_symbols_with_http_info_impl(extra) end |
#list_all_brokerage_authorization_type(brokerage: SENTINEL, extra: {}) ⇒ Object
Get all brokerage authorization types
Returns a list of all defined Brokerage authorization Type objects.
521 522 523 524 525 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 521 def (brokerage: SENTINEL, extra: {}) extra[:brokerage] = brokerage if brokerage != SENTINEL data, _status_code, _headers = (extra) data end |
#list_all_brokerage_authorization_type_with_http_info(brokerage: SENTINEL, extra: {}) ⇒ Object
Get all brokerage authorization types
Returns a list of all defined Brokerage authorization Type objects.
533 534 535 536 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 533 def (brokerage: SENTINEL, extra: {}) extra[:brokerage] = brokerage if brokerage != SENTINEL (extra) end |
#list_all_brokerage_instruments(slug:, extra: {}) ⇒ Object
Get brokerage instruments
Returns a list of all brokerage instruments available for a given brokerage. Not all brokerages support this. The ones that don’t will return an empty list.
605 606 607 608 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 605 def list_all_brokerage_instruments(slug:, extra: {}) data, _status_code, _headers = list_all_brokerage_instruments_with_http_info_impl(slug, extra) data end |
#list_all_brokerage_instruments_with_http_info(slug:, extra: {}) ⇒ Object
Get brokerage instruments
Returns a list of all brokerage instruments available for a given brokerage. Not all brokerages support this. The ones that don’t will return an empty list.
616 617 618 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 616 def list_all_brokerage_instruments_with_http_info(slug:, extra: {}) list_all_brokerage_instruments_with_http_info_impl(slug, extra) end |
#list_all_brokerages(extra: {}) ⇒ Object
Get brokerages
Returns a list of all defined Brokerage objects.
689 690 691 692 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 689 def list_all_brokerages(extra: {}) data, _status_code, _headers = list_all_brokerages_with_http_info_impl(extra) data end |
#list_all_brokerages_with_http_info(extra: {}) ⇒ Object
Get brokerages
Returns a list of all defined Brokerage objects.
699 700 701 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 699 def list_all_brokerages_with_http_info(extra: {}) list_all_brokerages_with_http_info_impl(extra) end |
#list_all_currencies(extra: {}) ⇒ Object
Get currencies
Returns a list of all defined Currency objects.
766 767 768 769 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 766 def list_all_currencies(extra: {}) data, _status_code, _headers = list_all_currencies_with_http_info_impl(extra) data end |
#list_all_currencies_rates(extra: {}) ⇒ Object
Get currency exchange rates
Returns a list of all Exchange Rate Pairs for all supported Currencies.
843 844 845 846 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 843 def list_all_currencies_rates(extra: {}) data, _status_code, _headers = list_all_currencies_rates_with_http_info_impl(extra) data end |
#list_all_currencies_rates_with_http_info(extra: {}) ⇒ Object
Get currency exchange rates
Returns a list of all Exchange Rate Pairs for all supported Currencies.
853 854 855 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 853 def list_all_currencies_rates_with_http_info(extra: {}) list_all_currencies_rates_with_http_info_impl(extra) end |
#list_all_currencies_with_http_info(extra: {}) ⇒ Object
Get currencies
Returns a list of all defined Currency objects.
776 777 778 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 776 def list_all_currencies_with_http_info(extra: {}) list_all_currencies_with_http_info_impl(extra) end |
#symbol_search_user_account(user_id:, user_secret:, account_id:, substring: SENTINEL, extra: {}) ⇒ Object
Search account symbols
Returns a list of Universal Symbol objects that match the given query. The matching takes into consideration both the ticker and the name of the symbol. Only the first 20 results are returned.
The search results are further limited to the symbols supported by the brokerage for which the account is under.
927 928 929 930 931 932 933 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 927 def symbol_search_user_account(user_id:, user_secret:, account_id:, substring: SENTINEL, extra: {}) _body = {} _body[:substring] = substring if substring != SENTINEL extra[:symbol_query] = _body if !_body.empty? data, _status_code, _headers = symbol_search_user_account_with_http_info_impl(user_id, user_secret, account_id, extra) data end |
#symbol_search_user_account_with_http_info(user_id:, user_secret:, account_id:, substring: SENTINEL, extra: {}) ⇒ Object
Search account symbols
Returns a list of Universal Symbol objects that match the given query. The matching takes into consideration both the ticker and the name of the symbol. Only the first 20 results are returned.
The search results are further limited to the symbols supported by the brokerage for which the account is under.
947 948 949 950 951 952 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 947 def symbol_search_user_account_with_http_info(user_id:, user_secret:, account_id:, substring: SENTINEL, extra: {}) _body = {} _body[:substring] = substring if substring != SENTINEL extra[:symbol_query] = _body if !_body.empty? symbol_search_user_account_with_http_info_impl(user_id, user_secret, account_id, extra) end |