Class: Intrinio::StockExchangeApi

Inherits:
Object
  • Object
show all
Defined in:
lib/intrinio-sdk/api/stock_exchange_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ StockExchangeApi

Returns a new instance of StockExchangeApi.



19
20
21
# File 'lib/intrinio-sdk/api/stock_exchange_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/intrinio-sdk/api/stock_exchange_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#filter_stock_exchanges(opts = {}) ⇒ ApiResponseStockExchanges

Filter Stock Exchanges Returns Stock Exchanges matching the given filters

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :city (String)

    Filter by city

  • :country (String)

    Filter by country

  • :country_code (String)

    Filter by ISO country code

Returns:



30
31
32
33
# File 'lib/intrinio-sdk/api/stock_exchange_api.rb', line 30

def filter_stock_exchanges(opts = {})
  data, _status_code, _headers = filter_stock_exchanges_with_http_info(opts)
  return data
end

#filter_stock_exchanges_with_http_info(opts = {}) ⇒ Array<(ApiResponseStockExchanges, Fixnum, Hash)>

Filter Stock Exchanges Returns Stock Exchanges matching the given filters

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :city (String)

    Filter by city

  • :country (String)

    Filter by country

  • :country_code (String)

    Filter by ISO country code

Returns:

  • (Array<(ApiResponseStockExchanges, Fixnum, Hash)>)

    ApiResponseStockExchanges data, response status code and response headers



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/intrinio-sdk/api/stock_exchange_api.rb', line 42

def filter_stock_exchanges_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: StockExchangeApi.filter_stock_exchanges ..."
  end
  # resource path
  local_var_path = "/stock_exchanges/filter"

  # query parameters
  query_params = {}
  query_params[:'city'] = opts[:'city'] if !opts[:'city'].nil?
  query_params[:'country'] = opts[:'country'] if !opts[:'country'].nil?
  query_params[:'country_code'] = opts[:'country_code'] if !opts[:'country_code'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ApiResponseStockExchanges')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StockExchangeApi#filter_stock_exchanges\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_all_stock_exchanges(opts = {}) ⇒ ApiResponseStockExchanges

All Stock Exchanges Returns all Stock Exchanges

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



83
84
85
86
# File 'lib/intrinio-sdk/api/stock_exchange_api.rb', line 83

def get_all_stock_exchanges(opts = {})
  data, _status_code, _headers = get_all_stock_exchanges_with_http_info(opts)
  return data
end

#get_all_stock_exchanges_with_http_info(opts = {}) ⇒ Array<(ApiResponseStockExchanges, Fixnum, Hash)>

All Stock Exchanges Returns all Stock Exchanges

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ApiResponseStockExchanges, Fixnum, Hash)>)

    ApiResponseStockExchanges data, response status code and response headers



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/intrinio-sdk/api/stock_exchange_api.rb', line 92

def get_all_stock_exchanges_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: StockExchangeApi.get_all_stock_exchanges ..."
  end
  # resource path
  local_var_path = "/stock_exchanges"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ApiResponseStockExchanges')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StockExchangeApi#get_all_stock_exchanges\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_stock_exchange_by_id(identifier, opts = {}) ⇒ StockExchange

Lookup Stock Exchange Returns the Stock Exchange with the given ‘identifier`

Parameters:

  • identifier

    A Stock Exchange identifier (MIC or Intrinio ID)

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



131
132
133
134
# File 'lib/intrinio-sdk/api/stock_exchange_api.rb', line 131

def get_stock_exchange_by_id(identifier, opts = {})
  data, _status_code, _headers = get_stock_exchange_by_id_with_http_info(identifier, opts)
  return data
end

#get_stock_exchange_by_id_with_http_info(identifier, opts = {}) ⇒ Array<(StockExchange, Fixnum, Hash)>

Lookup Stock Exchange Returns the Stock Exchange with the given &#x60;identifier&#x60;

Parameters:

  • identifier

    A Stock Exchange identifier (MIC or Intrinio ID)

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(StockExchange, Fixnum, Hash)>)

    StockExchange data, response status code and response headers



141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# File 'lib/intrinio-sdk/api/stock_exchange_api.rb', line 141

def get_stock_exchange_by_id_with_http_info(identifier, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: StockExchangeApi.get_stock_exchange_by_id ..."
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling StockExchangeApi.get_stock_exchange_by_id"
  end
  # resource path
  local_var_path = "/stock_exchanges/{identifier}".sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'StockExchange')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StockExchangeApi#get_stock_exchange_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_stock_exchange_price_adjustments(identifier, opts = {}) ⇒ ApiResponseStockExchangeStockPriceAdjustments

Stock Price Adjustments by Exchange Returns stock price adjustments for the Stock Exchange with the given ‘identifier`

Parameters:

  • identifier

    A Stock Exchange identifier (MIC or Intrinio ID)

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :date (Date)

    The date for which to return price adjustments

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:



186
187
188
189
# File 'lib/intrinio-sdk/api/stock_exchange_api.rb', line 186

def get_stock_exchange_price_adjustments(identifier, opts = {})
  data, _status_code, _headers = get_stock_exchange_price_adjustments_with_http_info(identifier, opts)
  return data
end

#get_stock_exchange_price_adjustments_with_http_info(identifier, opts = {}) ⇒ Array<(ApiResponseStockExchangeStockPriceAdjustments, Fixnum, Hash)>

Stock Price Adjustments by Exchange Returns stock price adjustments for the Stock Exchange with the given &#x60;identifier&#x60;

Parameters:

  • identifier

    A Stock Exchange identifier (MIC or Intrinio ID)

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :date (Date)

    The date for which to return price adjustments

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:



198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
# File 'lib/intrinio-sdk/api/stock_exchange_api.rb', line 198

def get_stock_exchange_price_adjustments_with_http_info(identifier, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: StockExchangeApi.get_stock_exchange_price_adjustments ..."
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling StockExchangeApi.get_stock_exchange_price_adjustments"
  end
  # resource path
  local_var_path = "/stock_exchanges/{identifier}/prices/adjustments".sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'date'] = opts[:'date'] if !opts[:'date'].nil?
  query_params[:'next_page'] = opts[:'next_page'] if !opts[:'next_page'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ApiResponseStockExchangeStockPriceAdjustments')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StockExchangeApi#get_stock_exchange_price_adjustments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_stock_exchange_prices(identifier, opts = {}) ⇒ ApiResponseStockExchangeStockPrices

Stock Prices by Exchange Returns end-of-day stock prices for Securities on the Stock Exchange with ‘identifier` and on the `price_date` (or the latest date that prices are available)

Parameters:

  • identifier

    A Stock Exchange identifier (MIC or Intrinio ID)

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :date (Date)

    The date for which to return prices

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:



245
246
247
248
# File 'lib/intrinio-sdk/api/stock_exchange_api.rb', line 245

def get_stock_exchange_prices(identifier, opts = {})
  data, _status_code, _headers = get_stock_exchange_prices_with_http_info(identifier, opts)
  return data
end

#get_stock_exchange_prices_with_http_info(identifier, opts = {}) ⇒ Array<(ApiResponseStockExchangeStockPrices, Fixnum, Hash)>

Stock Prices by Exchange Returns end-of-day stock prices for Securities on the Stock Exchange with &#x60;identifier&#x60; and on the &#x60;price_date&#x60; (or the latest date that prices are available)

Parameters:

  • identifier

    A Stock Exchange identifier (MIC or Intrinio ID)

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :date (Date)

    The date for which to return prices

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:



257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
# File 'lib/intrinio-sdk/api/stock_exchange_api.rb', line 257

def get_stock_exchange_prices_with_http_info(identifier, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: StockExchangeApi.get_stock_exchange_prices ..."
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling StockExchangeApi.get_stock_exchange_prices"
  end
  # resource path
  local_var_path = "/stock_exchanges/{identifier}/prices".sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'date'] = opts[:'date'] if !opts[:'date'].nil?
  query_params[:'next_page'] = opts[:'next_page'] if !opts[:'next_page'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ApiResponseStockExchangeStockPrices')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StockExchangeApi#get_stock_exchange_prices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_stock_exchange_realtime_prices(identifier, opts = {}) ⇒ ApiResponseStockExchangeRealtimeStockPrices

Realtime Stock Prices by Exchange Returns realtime stock prices for the Stock Exchange with the given ‘identifier`

Parameters:

  • identifier

    A Stock Exchange identifier (MIC or Intrinio ID)

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :source (String)

    Return realtime prices from the specified data source

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:



304
305
306
307
# File 'lib/intrinio-sdk/api/stock_exchange_api.rb', line 304

def get_stock_exchange_realtime_prices(identifier, opts = {})
  data, _status_code, _headers = get_stock_exchange_realtime_prices_with_http_info(identifier, opts)
  return data
end

#get_stock_exchange_realtime_prices_with_http_info(identifier, opts = {}) ⇒ Array<(ApiResponseStockExchangeRealtimeStockPrices, Fixnum, Hash)>

Realtime Stock Prices by Exchange Returns realtime stock prices for the Stock Exchange with the given &#x60;identifier&#x60;

Parameters:

  • identifier

    A Stock Exchange identifier (MIC or Intrinio ID)

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :source (String)

    Return realtime prices from the specified data source

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:



316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
# File 'lib/intrinio-sdk/api/stock_exchange_api.rb', line 316

def get_stock_exchange_realtime_prices_with_http_info(identifier, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: StockExchangeApi.get_stock_exchange_realtime_prices ..."
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling StockExchangeApi.get_stock_exchange_realtime_prices"
  end
  if @api_client.config.client_side_validation && opts[:'source'] && !['iex', 'bats', 'bats_delayed'].include?(opts[:'source'])
    fail ArgumentError, 'invalid value for "source", must be one of iex, bats, bats_delayed'
  end
  # resource path
  local_var_path = "/stock_exchanges/{identifier}/prices/realtime".sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?
  query_params[:'next_page'] = opts[:'next_page'] if !opts[:'next_page'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ApiResponseStockExchangeRealtimeStockPrices')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StockExchangeApi#get_stock_exchange_realtime_prices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_stock_exchange_securities(identifier, opts = {}) ⇒ ApiResponseStockExchangeSecurities

Securities by Exchange Returns Securities traded on the Stock Exchange with ‘identifier`

Parameters:

  • identifier

    A Stock Exchange identifier (MIC or Intrinio ID)

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:



365
366
367
368
# File 'lib/intrinio-sdk/api/stock_exchange_api.rb', line 365

def get_stock_exchange_securities(identifier, opts = {})
  data, _status_code, _headers = get_stock_exchange_securities_with_http_info(identifier, opts)
  return data
end

#get_stock_exchange_securities_with_http_info(identifier, opts = {}) ⇒ Array<(ApiResponseStockExchangeSecurities, Fixnum, Hash)>

Securities by Exchange Returns Securities traded on the Stock Exchange with &#x60;identifier&#x60;

Parameters:

  • identifier

    A Stock Exchange identifier (MIC or Intrinio ID)

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:



376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
# File 'lib/intrinio-sdk/api/stock_exchange_api.rb', line 376

def get_stock_exchange_securities_with_http_info(identifier, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: StockExchangeApi.get_stock_exchange_securities ..."
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling StockExchangeApi.get_stock_exchange_securities"
  end
  # resource path
  local_var_path = "/stock_exchanges/{identifier}/securities".sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'next_page'] = opts[:'next_page'] if !opts[:'next_page'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ApiResponseStockExchangeSecurities')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StockExchangeApi#get_stock_exchange_securities\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end