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_partner_info(extra: {}) ⇒ Object
Get Client Info.
-
#get_partner_info_with_http_info(extra: {}) ⇒ Object
Get Client Info.
-
#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.
-
#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_partner_info(extra: {}) ⇒ Object
Get Client Info
Returns configurations for your SnapTrade Client ID, including allowed brokerages and data access.
25 26 27 28 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 25 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.
35 36 37 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 35 def get_partner_info_with_http_info(extra: {}) get_partner_info_with_http_info_impl(extra) end |
#get_stock_exchanges(extra: {}) ⇒ Object
Get exchanges
Returns a list of all supported Exchanges.
102 103 104 105 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 102 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.
112 113 114 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 112 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.
181 182 183 184 185 186 187 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 181 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(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.
274 275 276 277 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 274 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(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.
285 286 287 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 285 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.
196 197 198 199 200 201 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 196 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.
359 360 361 362 363 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 359 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.
371 372 373 374 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 371 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.
443 444 445 446 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 443 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.
454 455 456 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 454 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.
527 528 529 530 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 527 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.
537 538 539 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 537 def list_all_brokerages_with_http_info(extra: {}) list_all_brokerages_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.
611 612 613 614 615 616 617 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 611 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.
631 632 633 634 635 636 |
# File 'lib/snaptrade/api/reference_data_api.rb', line 631 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 |