Class: Intrinio::HistoricalDataApi
- Inherits:
-
Object
- Object
- Intrinio::HistoricalDataApi
- Defined in:
- lib/intrinio-sdk/api/historical_data_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#get_historical_data(identifier, tag, opts = {}) ⇒ ApiResponseHistoricalData
Historical Data Returns historical values for the given ‘tag` and the entity represented by the given `identifier`.
-
#get_historical_data_with_http_info(identifier, tag, opts = {}) ⇒ Array<(ApiResponseHistoricalData, Fixnum, Hash)>
Historical Data Returns historical values for the given `tag` and the entity represented by the given `identifier`.
-
#initialize(api_client = ApiClient.default) ⇒ HistoricalDataApi
constructor
A new instance of HistoricalDataApi.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ HistoricalDataApi
Returns a new instance of HistoricalDataApi.
19 20 21 |
# File 'lib/intrinio-sdk/api/historical_data_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/intrinio-sdk/api/historical_data_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#get_historical_data(identifier, tag, opts = {}) ⇒ ApiResponseHistoricalData
Historical Data Returns historical values for the given ‘tag` and the entity represented by the given `identifier`
34 35 36 37 |
# File 'lib/intrinio-sdk/api/historical_data_api.rb', line 34 def get_historical_data(identifier, tag, opts = {}) data, _status_code, _headers = get_historical_data_with_http_info(identifier, tag, opts) return data end |
#get_historical_data_with_http_info(identifier, tag, opts = {}) ⇒ Array<(ApiResponseHistoricalData, Fixnum, Hash)>
Historical Data Returns historical values for the given `tag` and the entity represented by the given `identifier`
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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/intrinio-sdk/api/historical_data_api.rb', line 50 def get_historical_data_with_http_info(identifier, tag, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: HistoricalDataApi.get_historical_data ..." 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 HistoricalDataApi.get_historical_data" end # verify the required parameter 'tag' is set if @api_client.config.client_side_validation && tag.nil? fail ArgumentError, "Missing the required parameter 'tag' when calling HistoricalDataApi.get_historical_data" end if @api_client.config.client_side_validation && opts[:'sort_order'] && !['asc', 'desc'].include?(opts[:'sort_order']) fail ArgumentError, 'invalid value for "sort_order", must be one of asc, desc' end # resource path local_var_path = "/historical_data/{identifier}/{tag}".sub('{' + 'identifier' + '}', identifier.to_s).sub('{' + 'tag' + '}', tag.to_s) # query parameters query_params = {} query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil? query_params[:'start_date'] = opts[:'start_date'] if !opts[:'start_date'].nil? query_params[:'end_date'] = opts[:'end_date'] if !opts[:'end_date'].nil? query_params[:'sort_order'] = opts[:'sort_order'] if !opts[:'sort_order'].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 => 'ApiResponseHistoricalData') if @api_client.config.debugging @api_client.config.logger.debug "API called: HistoricalDataApi#get_historical_data\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |