intrinio-sdk 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (213) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/README.md +176 -0
  4. data/Rakefile +8 -0
  5. data/docs/ApiResponseCompanies.md +9 -0
  6. data/docs/ApiResponseCompanyFilings.md +10 -0
  7. data/docs/ApiResponseCompanyFundamentals.md +10 -0
  8. data/docs/ApiResponseCompanyHistoricalData.md +10 -0
  9. data/docs/ApiResponseCompanyNews.md +10 -0
  10. data/docs/ApiResponseCompanySecurities.md +10 -0
  11. data/docs/ApiResponseDataTags.md +9 -0
  12. data/docs/ApiResponseEconomicIndexHistoricalData.md +10 -0
  13. data/docs/ApiResponseEconomicIndices.md +9 -0
  14. data/docs/ApiResponseFilings.md +9 -0
  15. data/docs/ApiResponseHistoricalData.md +9 -0
  16. data/docs/ApiResponseNews.md +9 -0
  17. data/docs/ApiResponseReportedFinancials.md +10 -0
  18. data/docs/ApiResponseSICIndexHistoricalData.md +10 -0
  19. data/docs/ApiResponseSICIndices.md +9 -0
  20. data/docs/ApiResponseSecurities.md +9 -0
  21. data/docs/ApiResponseSecurityHistoricalData.md +10 -0
  22. data/docs/ApiResponseSecurityStockPriceAdjustments.md +10 -0
  23. data/docs/ApiResponseSecurityStockPrices.md +10 -0
  24. data/docs/ApiResponseStandardizedFinancials.md +10 -0
  25. data/docs/ApiResponseStockExchangeSecurities.md +10 -0
  26. data/docs/ApiResponseStockExchangeStockPriceAdjustments.md +10 -0
  27. data/docs/ApiResponseStockExchangeStockPrices.md +10 -0
  28. data/docs/ApiResponseStockExchanges.md +9 -0
  29. data/docs/ApiResponseStockMarketIndexHistoricalData.md +10 -0
  30. data/docs/ApiResponseStockMarketIndices.md +9 -0
  31. data/docs/Company.md +39 -0
  32. data/docs/CompanyApi.md +659 -0
  33. data/docs/CompanyFiling.md +17 -0
  34. data/docs/CompanyNews.md +13 -0
  35. data/docs/CompanyNewsSummary.md +12 -0
  36. data/docs/CompanySummary.md +12 -0
  37. data/docs/DataPointApi.md +96 -0
  38. data/docs/DataTag.md +17 -0
  39. data/docs/DataTagApi.md +184 -0
  40. data/docs/DataTagSummary.md +11 -0
  41. data/docs/EconomicIndex.md +19 -0
  42. data/docs/EconomicIndexSummary.md +18 -0
  43. data/docs/Filing.md +17 -0
  44. data/docs/FilingApi.md +142 -0
  45. data/docs/FilingSummary.md +16 -0
  46. data/docs/Fundamental.md +16 -0
  47. data/docs/FundamentalSummary.md +15 -0
  48. data/docs/FundamentalsApi.md +181 -0
  49. data/docs/HistoricalData.md +9 -0
  50. data/docs/HistoricalDataApi.md +64 -0
  51. data/docs/IndexApi.md +800 -0
  52. data/docs/ReportedFinancial.md +9 -0
  53. data/docs/ReportedTag.md +14 -0
  54. data/docs/SICIndex.md +12 -0
  55. data/docs/Security.md +34 -0
  56. data/docs/SecurityApi.md +420 -0
  57. data/docs/SecurityScreenClause.md +10 -0
  58. data/docs/SecurityScreenGroup.md +10 -0
  59. data/docs/SecurityScreenResult.md +9 -0
  60. data/docs/SecurityScreenResultData.md +10 -0
  61. data/docs/SecuritySummary.md +17 -0
  62. data/docs/StandardizedFinancial.md +9 -0
  63. data/docs/StockExchange.md +17 -0
  64. data/docs/StockExchangeApi.md +267 -0
  65. data/docs/StockMarketIndex.md +17 -0
  66. data/docs/StockMarketIndexSummary.md +16 -0
  67. data/docs/StockPrice.md +21 -0
  68. data/docs/StockPriceAdjustment.md +12 -0
  69. data/docs/StockPriceAdjustmentSummary.md +13 -0
  70. data/docs/StockPriceSummary.md +20 -0
  71. data/git_push.sh +55 -0
  72. data/intrinio-sdk.gemspec +45 -0
  73. data/lib/intrinio-sdk.rb +105 -0
  74. data/lib/intrinio-sdk/api/company_api.rb +885 -0
  75. data/lib/intrinio-sdk/api/data_point_api.rb +141 -0
  76. data/lib/intrinio-sdk/api/data_tag_api.rb +251 -0
  77. data/lib/intrinio-sdk/api/filing_api.rb +192 -0
  78. data/lib/intrinio-sdk/api/fundamentals_api.rb +261 -0
  79. data/lib/intrinio-sdk/api/historical_data_api.rb +100 -0
  80. data/lib/intrinio-sdk/api/index_api.rb +1079 -0
  81. data/lib/intrinio-sdk/api/security_api.rb +568 -0
  82. data/lib/intrinio-sdk/api/stock_exchange_api.rb +353 -0
  83. data/lib/intrinio-sdk/api_client.rb +389 -0
  84. data/lib/intrinio-sdk/api_error.rb +38 -0
  85. data/lib/intrinio-sdk/configuration.rb +209 -0
  86. data/lib/intrinio-sdk/models/api_response_companies.rb +200 -0
  87. data/lib/intrinio-sdk/models/api_response_company_filings.rb +209 -0
  88. data/lib/intrinio-sdk/models/api_response_company_fundamentals.rb +209 -0
  89. data/lib/intrinio-sdk/models/api_response_company_historical_data.rb +209 -0
  90. data/lib/intrinio-sdk/models/api_response_company_news.rb +209 -0
  91. data/lib/intrinio-sdk/models/api_response_company_securities.rb +209 -0
  92. data/lib/intrinio-sdk/models/api_response_data_tags.rb +200 -0
  93. data/lib/intrinio-sdk/models/api_response_economic_index_historical_data.rb +209 -0
  94. data/lib/intrinio-sdk/models/api_response_economic_indices.rb +200 -0
  95. data/lib/intrinio-sdk/models/api_response_filings.rb +200 -0
  96. data/lib/intrinio-sdk/models/api_response_historical_data.rb +200 -0
  97. data/lib/intrinio-sdk/models/api_response_news.rb +200 -0
  98. data/lib/intrinio-sdk/models/api_response_reported_financials.rb +209 -0
  99. data/lib/intrinio-sdk/models/api_response_securities.rb +200 -0
  100. data/lib/intrinio-sdk/models/api_response_security_historical_data.rb +209 -0
  101. data/lib/intrinio-sdk/models/api_response_security_stock_price_adjustments.rb +211 -0
  102. data/lib/intrinio-sdk/models/api_response_security_stock_prices.rb +211 -0
  103. data/lib/intrinio-sdk/models/api_response_sic_index_historical_data.rb +209 -0
  104. data/lib/intrinio-sdk/models/api_response_sic_indices.rb +200 -0
  105. data/lib/intrinio-sdk/models/api_response_standardized_financials.rb +209 -0
  106. data/lib/intrinio-sdk/models/api_response_stock_exchange_securities.rb +211 -0
  107. data/lib/intrinio-sdk/models/api_response_stock_exchange_stock_price_adjustments.rb +211 -0
  108. data/lib/intrinio-sdk/models/api_response_stock_exchange_stock_prices.rb +211 -0
  109. data/lib/intrinio-sdk/models/api_response_stock_exchanges.rb +200 -0
  110. data/lib/intrinio-sdk/models/api_response_stock_market_index_historical_data.rb +209 -0
  111. data/lib/intrinio-sdk/models/api_response_stock_market_indices.rb +200 -0
  112. data/lib/intrinio-sdk/models/company.rb +498 -0
  113. data/lib/intrinio-sdk/models/company_filing.rb +278 -0
  114. data/lib/intrinio-sdk/models/company_news.rb +239 -0
  115. data/lib/intrinio-sdk/models/company_news_summary.rb +229 -0
  116. data/lib/intrinio-sdk/models/company_summary.rb +229 -0
  117. data/lib/intrinio-sdk/models/data_tag.rb +312 -0
  118. data/lib/intrinio-sdk/models/data_tag_summary.rb +219 -0
  119. data/lib/intrinio-sdk/models/economic_index.rb +299 -0
  120. data/lib/intrinio-sdk/models/economic_index_summary.rb +289 -0
  121. data/lib/intrinio-sdk/models/filing.rb +278 -0
  122. data/lib/intrinio-sdk/models/filing_summary.rb +269 -0
  123. data/lib/intrinio-sdk/models/fundamental.rb +302 -0
  124. data/lib/intrinio-sdk/models/fundamental_summary.rb +292 -0
  125. data/lib/intrinio-sdk/models/historical_data.rb +199 -0
  126. data/lib/intrinio-sdk/models/reported_financial.rb +198 -0
  127. data/lib/intrinio-sdk/models/reported_tag.rb +249 -0
  128. data/lib/intrinio-sdk/models/security.rb +453 -0
  129. data/lib/intrinio-sdk/models/security_screen_clause.rb +242 -0
  130. data/lib/intrinio-sdk/models/security_screen_group.rb +213 -0
  131. data/lib/intrinio-sdk/models/security_screen_result.rb +199 -0
  132. data/lib/intrinio-sdk/models/security_screen_result_data.rb +209 -0
  133. data/lib/intrinio-sdk/models/security_summary.rb +279 -0
  134. data/lib/intrinio-sdk/models/sic_index.rb +229 -0
  135. data/lib/intrinio-sdk/models/standardized_financial.rb +198 -0
  136. data/lib/intrinio-sdk/models/stock_exchange.rb +279 -0
  137. data/lib/intrinio-sdk/models/stock_market_index.rb +279 -0
  138. data/lib/intrinio-sdk/models/stock_market_index_summary.rb +269 -0
  139. data/lib/intrinio-sdk/models/stock_price.rb +352 -0
  140. data/lib/intrinio-sdk/models/stock_price_adjustment.rb +229 -0
  141. data/lib/intrinio-sdk/models/stock_price_adjustment_summary.rb +239 -0
  142. data/lib/intrinio-sdk/models/stock_price_summary.rb +342 -0
  143. data/lib/intrinio-sdk/version.rb +15 -0
  144. data/spec/api/company_api_spec.rb +233 -0
  145. data/spec/api/data_point_api_spec.rb +61 -0
  146. data/spec/api/data_tag_api_spec.rb +88 -0
  147. data/spec/api/filing_api_spec.rb +75 -0
  148. data/spec/api/fundamentals_api_spec.rb +86 -0
  149. data/spec/api/historical_data_api_spec.rb +53 -0
  150. data/spec/api/index_api_spec.rb +275 -0
  151. data/spec/api/security_api_spec.rb +161 -0
  152. data/spec/api/stock_exchange_api_spec.rb +113 -0
  153. data/spec/api_client_spec.rb +226 -0
  154. data/spec/configuration_spec.rb +42 -0
  155. data/spec/models/api_response_companies_spec.rb +48 -0
  156. data/spec/models/api_response_company_filings_spec.rb +54 -0
  157. data/spec/models/api_response_company_fundamentals_spec.rb +54 -0
  158. data/spec/models/api_response_company_historical_data_spec.rb +54 -0
  159. data/spec/models/api_response_company_news_spec.rb +54 -0
  160. data/spec/models/api_response_company_securities_spec.rb +54 -0
  161. data/spec/models/api_response_data_tags_spec.rb +48 -0
  162. data/spec/models/api_response_economic_index_historical_data_spec.rb +54 -0
  163. data/spec/models/api_response_economic_indices_spec.rb +48 -0
  164. data/spec/models/api_response_filings_spec.rb +48 -0
  165. data/spec/models/api_response_historical_data_spec.rb +48 -0
  166. data/spec/models/api_response_news_spec.rb +48 -0
  167. data/spec/models/api_response_reported_financials_spec.rb +54 -0
  168. data/spec/models/api_response_securities_spec.rb +48 -0
  169. data/spec/models/api_response_security_historical_data_spec.rb +54 -0
  170. data/spec/models/api_response_security_stock_price_adjustments_spec.rb +54 -0
  171. data/spec/models/api_response_security_stock_prices_spec.rb +54 -0
  172. data/spec/models/api_response_sic_index_historical_data_spec.rb +54 -0
  173. data/spec/models/api_response_sic_indices_spec.rb +48 -0
  174. data/spec/models/api_response_standardized_financials_spec.rb +54 -0
  175. data/spec/models/api_response_stock_exchange_securities_spec.rb +54 -0
  176. data/spec/models/api_response_stock_exchange_stock_price_adjustments_spec.rb +54 -0
  177. data/spec/models/api_response_stock_exchange_stock_prices_spec.rb +54 -0
  178. data/spec/models/api_response_stock_exchanges_spec.rb +48 -0
  179. data/spec/models/api_response_stock_market_index_historical_data_spec.rb +54 -0
  180. data/spec/models/api_response_stock_market_indices_spec.rb +48 -0
  181. data/spec/models/company_filing_spec.rb +96 -0
  182. data/spec/models/company_news_spec.rb +72 -0
  183. data/spec/models/company_news_summary_spec.rb +66 -0
  184. data/spec/models/company_spec.rb +228 -0
  185. data/spec/models/company_summary_spec.rb +66 -0
  186. data/spec/models/data_tag_spec.rb +100 -0
  187. data/spec/models/data_tag_summary_spec.rb +60 -0
  188. data/spec/models/economic_index_spec.rb +108 -0
  189. data/spec/models/economic_index_summary_spec.rb +102 -0
  190. data/spec/models/filing_spec.rb +96 -0
  191. data/spec/models/filing_summary_spec.rb +90 -0
  192. data/spec/models/fundamental_spec.rb +94 -0
  193. data/spec/models/fundamental_summary_spec.rb +88 -0
  194. data/spec/models/historical_data_spec.rb +48 -0
  195. data/spec/models/reported_financial_spec.rb +48 -0
  196. data/spec/models/reported_tag_spec.rb +78 -0
  197. data/spec/models/security_screen_clause_spec.rb +58 -0
  198. data/spec/models/security_screen_group_spec.rb +54 -0
  199. data/spec/models/security_screen_result_data_spec.rb +54 -0
  200. data/spec/models/security_screen_result_spec.rb +48 -0
  201. data/spec/models/security_spec.rb +198 -0
  202. data/spec/models/security_summary_spec.rb +96 -0
  203. data/spec/models/sic_index_spec.rb +66 -0
  204. data/spec/models/standardized_financial_spec.rb +48 -0
  205. data/spec/models/stock_exchange_spec.rb +96 -0
  206. data/spec/models/stock_market_index_spec.rb +96 -0
  207. data/spec/models/stock_market_index_summary_spec.rb +90 -0
  208. data/spec/models/stock_price_adjustment_spec.rb +66 -0
  209. data/spec/models/stock_price_adjustment_summary_spec.rb +72 -0
  210. data/spec/models/stock_price_spec.rb +124 -0
  211. data/spec/models/stock_price_summary_spec.rb +118 -0
  212. data/spec/spec_helper.rb +111 -0
  213. metadata +509 -0
@@ -0,0 +1,299 @@
1
+ =begin
2
+ #Intrinio API
3
+
4
+ #Welcome to the Intrinio API! Through our Financial Data Marketplace, we offer a wide selection of financial data feed APIs sourced by our own proprietary processes as well as from many data vendors. For a complete API request / response reference please view the [Intrinio API documentation](https://intrinio.com/documentation/api_v2). If you need additional help in using the API, please visit the [Intrinio website](https://intrinio.com) and click on the chat icon in the lower right corner.
5
+
6
+ OpenAPI spec version: 2.0.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module Intrinio
16
+ # An economic index provided by the St. Lous Fed FRED API, such as GDP, Unemployment, Fed Funds Rate, and more.
17
+ class EconomicIndex
18
+ # The Intrinio ID for the Index
19
+ attr_accessor :id
20
+
21
+ # The symbol used to identify the Index
22
+ attr_accessor :symbol
23
+
24
+ # The name of the Index
25
+ attr_accessor :name
26
+
27
+ # The continent of the country of focus for the Index
28
+ attr_accessor :continent
29
+
30
+ # The country of focus for the Index
31
+ attr_accessor :country
32
+
33
+ # How often the Index is updated
34
+ attr_accessor :update_frequency
35
+
36
+ # When the Index was updated last
37
+ attr_accessor :last_updated
38
+
39
+ # A paragraph describing the index and its scope
40
+ attr_accessor :description
41
+
42
+ # The earliest date for which data is available
43
+ attr_accessor :observation_start
44
+
45
+ # The latest date for which data is available
46
+ attr_accessor :observation_end
47
+
48
+ # Whether the data is adjusted to account for seasonality
49
+ attr_accessor :seasonal_adjustment
50
+
51
+ # The units of the data
52
+ attr_accessor :units
53
+
54
+
55
+ # Attribute mapping from ruby-style variable name to JSON key.
56
+ def self.attribute_map
57
+ {
58
+ :'id' => :'id',
59
+ :'symbol' => :'symbol',
60
+ :'name' => :'name',
61
+ :'continent' => :'continent',
62
+ :'country' => :'country',
63
+ :'update_frequency' => :'update_frequency',
64
+ :'last_updated' => :'last_updated',
65
+ :'description' => :'description',
66
+ :'observation_start' => :'observation_start',
67
+ :'observation_end' => :'observation_end',
68
+ :'seasonal_adjustment' => :'seasonal_adjustment',
69
+ :'units' => :'units'
70
+ }
71
+ end
72
+
73
+ # Attribute type mapping.
74
+ def self.swagger_types
75
+ {
76
+ :'id' => :'String',
77
+ :'symbol' => :'String',
78
+ :'name' => :'String',
79
+ :'continent' => :'String',
80
+ :'country' => :'String',
81
+ :'update_frequency' => :'String',
82
+ :'last_updated' => :'DateTime',
83
+ :'description' => :'String',
84
+ :'observation_start' => :'Date',
85
+ :'observation_end' => :'Date',
86
+ :'seasonal_adjustment' => :'String',
87
+ :'units' => :'String'
88
+ }
89
+ end
90
+
91
+ # Initializes the object
92
+ # @param [Hash] attributes Model attributes in the form of hash
93
+ def initialize(attributes = {})
94
+ return unless attributes.is_a?(Hash)
95
+
96
+ # convert string to symbol for hash key
97
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
98
+
99
+ if attributes.has_key?(:'id')
100
+ self.id = attributes[:'id']
101
+ end
102
+
103
+ if attributes.has_key?(:'symbol')
104
+ self.symbol = attributes[:'symbol']
105
+ end
106
+
107
+ if attributes.has_key?(:'name')
108
+ self.name = attributes[:'name']
109
+ end
110
+
111
+ if attributes.has_key?(:'continent')
112
+ self.continent = attributes[:'continent']
113
+ end
114
+
115
+ if attributes.has_key?(:'country')
116
+ self.country = attributes[:'country']
117
+ end
118
+
119
+ if attributes.has_key?(:'update_frequency')
120
+ self.update_frequency = attributes[:'update_frequency']
121
+ end
122
+
123
+ if attributes.has_key?(:'last_updated')
124
+ self.last_updated = attributes[:'last_updated']
125
+ end
126
+
127
+ if attributes.has_key?(:'description')
128
+ self.description = attributes[:'description']
129
+ end
130
+
131
+ if attributes.has_key?(:'observation_start')
132
+ self.observation_start = attributes[:'observation_start']
133
+ end
134
+
135
+ if attributes.has_key?(:'observation_end')
136
+ self.observation_end = attributes[:'observation_end']
137
+ end
138
+
139
+ if attributes.has_key?(:'seasonal_adjustment')
140
+ self.seasonal_adjustment = attributes[:'seasonal_adjustment']
141
+ end
142
+
143
+ if attributes.has_key?(:'units')
144
+ self.units = attributes[:'units']
145
+ end
146
+
147
+ end
148
+
149
+ # Show invalid properties with the reasons. Usually used together with valid?
150
+ # @return Array for valid properties with the reasons
151
+ def list_invalid_properties
152
+ invalid_properties = Array.new
153
+ return invalid_properties
154
+ end
155
+
156
+ # Check to see if the all the properties in the model are valid
157
+ # @return true if the model is valid
158
+ def valid?
159
+ return true
160
+ end
161
+
162
+ # Checks equality by comparing each attribute.
163
+ # @param [Object] Object to be compared
164
+ def ==(o)
165
+ return true if self.equal?(o)
166
+ self.class == o.class &&
167
+ id == o.id &&
168
+ symbol == o.symbol &&
169
+ name == o.name &&
170
+ continent == o.continent &&
171
+ country == o.country &&
172
+ update_frequency == o.update_frequency &&
173
+ last_updated == o.last_updated &&
174
+ description == o.description &&
175
+ observation_start == o.observation_start &&
176
+ observation_end == o.observation_end &&
177
+ seasonal_adjustment == o.seasonal_adjustment &&
178
+ units == o.units
179
+ end
180
+
181
+ # @see the `==` method
182
+ # @param [Object] Object to be compared
183
+ def eql?(o)
184
+ self == o
185
+ end
186
+
187
+ # Calculates hash code according to all attributes.
188
+ # @return [Fixnum] Hash code
189
+ def hash
190
+ [id, symbol, name, continent, country, update_frequency, last_updated, description, observation_start, observation_end, seasonal_adjustment, units].hash
191
+ end
192
+
193
+ # Builds the object from hash
194
+ # @param [Hash] attributes Model attributes in the form of hash
195
+ # @return [Object] Returns the model itself
196
+ def build_from_hash(attributes)
197
+ return nil unless attributes.is_a?(Hash)
198
+ self.class.swagger_types.each_pair do |key, type|
199
+ if type =~ /\AArray<(.*)>/i
200
+ # check to ensure the input is an array given that the the attribute
201
+ # is documented as an array but the input is not
202
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
203
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
204
+ end
205
+ elsif !attributes[self.class.attribute_map[key]].nil?
206
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
207
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
208
+ end
209
+
210
+ self
211
+ end
212
+
213
+ # Deserializes the data based on type
214
+ # @param string type Data type
215
+ # @param string value Value to be deserialized
216
+ # @return [Object] Deserialized data
217
+ def _deserialize(type, value)
218
+ case type.to_sym
219
+ when :DateTime
220
+ DateTime.parse(value)
221
+ when :Date
222
+ Date.parse(value)
223
+ when :String
224
+ value.to_s
225
+ when :Integer
226
+ value.to_i
227
+ when :Float
228
+ value.to_f
229
+ when :BOOLEAN
230
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
231
+ true
232
+ else
233
+ false
234
+ end
235
+ when :Object
236
+ # generic object (usually a Hash), return directly
237
+ value
238
+ when /\AArray<(?<inner_type>.+)>\z/
239
+ inner_type = Regexp.last_match[:inner_type]
240
+ value.map { |v| _deserialize(inner_type, v) }
241
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
242
+ k_type = Regexp.last_match[:k_type]
243
+ v_type = Regexp.last_match[:v_type]
244
+ {}.tap do |hash|
245
+ value.each do |k, v|
246
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
247
+ end
248
+ end
249
+ else # model
250
+ temp_model = Intrinio.const_get(type).new
251
+ temp_model.build_from_hash(value)
252
+ end
253
+ end
254
+
255
+ # Returns the string representation of the object
256
+ # @return [String] String presentation of the object
257
+ def to_s
258
+ to_hash.to_s
259
+ end
260
+
261
+ # to_body is an alias to to_hash (backward compatibility)
262
+ # @return [Hash] Returns the object in the form of hash
263
+ def to_body
264
+ to_hash
265
+ end
266
+
267
+ # Returns the object in the form of hash
268
+ # @return [Hash] Returns the object in the form of hash
269
+ def to_hash
270
+ hash = {}
271
+ self.class.attribute_map.each_pair do |attr, param|
272
+ value = self.send(attr)
273
+ next if value.nil?
274
+ hash[param] = _to_hash(value)
275
+ end
276
+ hash
277
+ end
278
+
279
+ # Outputs non-array value in the form of hash
280
+ # For object, use to_hash. Otherwise, just return the value
281
+ # @param [Object] value Any valid value
282
+ # @return [Hash] Returns the value in the form of hash
283
+ def _to_hash(value)
284
+ if value.is_a?(Array)
285
+ value.compact.map{ |v| _to_hash(v) }
286
+ elsif value.is_a?(Hash)
287
+ {}.tap do |hash|
288
+ value.each { |k, v| hash[k] = _to_hash(v) }
289
+ end
290
+ elsif value.respond_to? :to_hash
291
+ value.to_hash
292
+ else
293
+ value
294
+ end
295
+ end
296
+
297
+ end
298
+
299
+ end
@@ -0,0 +1,289 @@
1
+ =begin
2
+ #Intrinio API
3
+
4
+ #Welcome to the Intrinio API! Through our Financial Data Marketplace, we offer a wide selection of financial data feed APIs sourced by our own proprietary processes as well as from many data vendors. For a complete API request / response reference please view the [Intrinio API documentation](https://intrinio.com/documentation/api_v2). If you need additional help in using the API, please visit the [Intrinio website](https://intrinio.com) and click on the chat icon in the lower right corner.
5
+
6
+ OpenAPI spec version: 2.0.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module Intrinio
16
+ # An economic index provided by the St. Lous Fed FRED API, such as GDP, Unemployment, Fed Funds Rate, and more.
17
+ class EconomicIndexSummary
18
+ # The Intrinio ID for the Index
19
+ attr_accessor :id
20
+
21
+ # The symbol used to identify the Index
22
+ attr_accessor :symbol
23
+
24
+ # The name of the Index
25
+ attr_accessor :name
26
+
27
+ # The continent of the country of focus for the Index
28
+ attr_accessor :continent
29
+
30
+ # The country of focus for the Index
31
+ attr_accessor :country
32
+
33
+ # How often the Index is updated
34
+ attr_accessor :update_frequency
35
+
36
+ # When the Index was updated last
37
+ attr_accessor :last_updated
38
+
39
+ # The earliest date for which data is available
40
+ attr_accessor :observation_start
41
+
42
+ # The latest date for which data is available
43
+ attr_accessor :observation_end
44
+
45
+ # Whether the data is adjusted to account for seasonality
46
+ attr_accessor :seasonal_adjustment
47
+
48
+ # The units of the data
49
+ attr_accessor :units
50
+
51
+
52
+ # Attribute mapping from ruby-style variable name to JSON key.
53
+ def self.attribute_map
54
+ {
55
+ :'id' => :'id',
56
+ :'symbol' => :'symbol',
57
+ :'name' => :'name',
58
+ :'continent' => :'continent',
59
+ :'country' => :'country',
60
+ :'update_frequency' => :'update_frequency',
61
+ :'last_updated' => :'last_updated',
62
+ :'observation_start' => :'observation_start',
63
+ :'observation_end' => :'observation_end',
64
+ :'seasonal_adjustment' => :'seasonal_adjustment',
65
+ :'units' => :'units'
66
+ }
67
+ end
68
+
69
+ # Attribute type mapping.
70
+ def self.swagger_types
71
+ {
72
+ :'id' => :'String',
73
+ :'symbol' => :'String',
74
+ :'name' => :'String',
75
+ :'continent' => :'String',
76
+ :'country' => :'String',
77
+ :'update_frequency' => :'String',
78
+ :'last_updated' => :'DateTime',
79
+ :'observation_start' => :'Date',
80
+ :'observation_end' => :'Date',
81
+ :'seasonal_adjustment' => :'String',
82
+ :'units' => :'String'
83
+ }
84
+ end
85
+
86
+ # Initializes the object
87
+ # @param [Hash] attributes Model attributes in the form of hash
88
+ def initialize(attributes = {})
89
+ return unless attributes.is_a?(Hash)
90
+
91
+ # convert string to symbol for hash key
92
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
93
+
94
+ if attributes.has_key?(:'id')
95
+ self.id = attributes[:'id']
96
+ end
97
+
98
+ if attributes.has_key?(:'symbol')
99
+ self.symbol = attributes[:'symbol']
100
+ end
101
+
102
+ if attributes.has_key?(:'name')
103
+ self.name = attributes[:'name']
104
+ end
105
+
106
+ if attributes.has_key?(:'continent')
107
+ self.continent = attributes[:'continent']
108
+ end
109
+
110
+ if attributes.has_key?(:'country')
111
+ self.country = attributes[:'country']
112
+ end
113
+
114
+ if attributes.has_key?(:'update_frequency')
115
+ self.update_frequency = attributes[:'update_frequency']
116
+ end
117
+
118
+ if attributes.has_key?(:'last_updated')
119
+ self.last_updated = attributes[:'last_updated']
120
+ end
121
+
122
+ if attributes.has_key?(:'observation_start')
123
+ self.observation_start = attributes[:'observation_start']
124
+ end
125
+
126
+ if attributes.has_key?(:'observation_end')
127
+ self.observation_end = attributes[:'observation_end']
128
+ end
129
+
130
+ if attributes.has_key?(:'seasonal_adjustment')
131
+ self.seasonal_adjustment = attributes[:'seasonal_adjustment']
132
+ end
133
+
134
+ if attributes.has_key?(:'units')
135
+ self.units = attributes[:'units']
136
+ end
137
+
138
+ end
139
+
140
+ # Show invalid properties with the reasons. Usually used together with valid?
141
+ # @return Array for valid properties with the reasons
142
+ def list_invalid_properties
143
+ invalid_properties = Array.new
144
+ return invalid_properties
145
+ end
146
+
147
+ # Check to see if the all the properties in the model are valid
148
+ # @return true if the model is valid
149
+ def valid?
150
+ return true
151
+ end
152
+
153
+ # Checks equality by comparing each attribute.
154
+ # @param [Object] Object to be compared
155
+ def ==(o)
156
+ return true if self.equal?(o)
157
+ self.class == o.class &&
158
+ id == o.id &&
159
+ symbol == o.symbol &&
160
+ name == o.name &&
161
+ continent == o.continent &&
162
+ country == o.country &&
163
+ update_frequency == o.update_frequency &&
164
+ last_updated == o.last_updated &&
165
+ observation_start == o.observation_start &&
166
+ observation_end == o.observation_end &&
167
+ seasonal_adjustment == o.seasonal_adjustment &&
168
+ units == o.units
169
+ end
170
+
171
+ # @see the `==` method
172
+ # @param [Object] Object to be compared
173
+ def eql?(o)
174
+ self == o
175
+ end
176
+
177
+ # Calculates hash code according to all attributes.
178
+ # @return [Fixnum] Hash code
179
+ def hash
180
+ [id, symbol, name, continent, country, update_frequency, last_updated, observation_start, observation_end, seasonal_adjustment, units].hash
181
+ end
182
+
183
+ # Builds the object from hash
184
+ # @param [Hash] attributes Model attributes in the form of hash
185
+ # @return [Object] Returns the model itself
186
+ def build_from_hash(attributes)
187
+ return nil unless attributes.is_a?(Hash)
188
+ self.class.swagger_types.each_pair do |key, type|
189
+ if type =~ /\AArray<(.*)>/i
190
+ # check to ensure the input is an array given that the the attribute
191
+ # is documented as an array but the input is not
192
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
193
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
194
+ end
195
+ elsif !attributes[self.class.attribute_map[key]].nil?
196
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
197
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
198
+ end
199
+
200
+ self
201
+ end
202
+
203
+ # Deserializes the data based on type
204
+ # @param string type Data type
205
+ # @param string value Value to be deserialized
206
+ # @return [Object] Deserialized data
207
+ def _deserialize(type, value)
208
+ case type.to_sym
209
+ when :DateTime
210
+ DateTime.parse(value)
211
+ when :Date
212
+ Date.parse(value)
213
+ when :String
214
+ value.to_s
215
+ when :Integer
216
+ value.to_i
217
+ when :Float
218
+ value.to_f
219
+ when :BOOLEAN
220
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
221
+ true
222
+ else
223
+ false
224
+ end
225
+ when :Object
226
+ # generic object (usually a Hash), return directly
227
+ value
228
+ when /\AArray<(?<inner_type>.+)>\z/
229
+ inner_type = Regexp.last_match[:inner_type]
230
+ value.map { |v| _deserialize(inner_type, v) }
231
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
232
+ k_type = Regexp.last_match[:k_type]
233
+ v_type = Regexp.last_match[:v_type]
234
+ {}.tap do |hash|
235
+ value.each do |k, v|
236
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
237
+ end
238
+ end
239
+ else # model
240
+ temp_model = Intrinio.const_get(type).new
241
+ temp_model.build_from_hash(value)
242
+ end
243
+ end
244
+
245
+ # Returns the string representation of the object
246
+ # @return [String] String presentation of the object
247
+ def to_s
248
+ to_hash.to_s
249
+ end
250
+
251
+ # to_body is an alias to to_hash (backward compatibility)
252
+ # @return [Hash] Returns the object in the form of hash
253
+ def to_body
254
+ to_hash
255
+ end
256
+
257
+ # Returns the object in the form of hash
258
+ # @return [Hash] Returns the object in the form of hash
259
+ def to_hash
260
+ hash = {}
261
+ self.class.attribute_map.each_pair do |attr, param|
262
+ value = self.send(attr)
263
+ next if value.nil?
264
+ hash[param] = _to_hash(value)
265
+ end
266
+ hash
267
+ end
268
+
269
+ # Outputs non-array value in the form of hash
270
+ # For object, use to_hash. Otherwise, just return the value
271
+ # @param [Object] value Any valid value
272
+ # @return [Hash] Returns the value in the form of hash
273
+ def _to_hash(value)
274
+ if value.is_a?(Array)
275
+ value.compact.map{ |v| _to_hash(v) }
276
+ elsif value.is_a?(Hash)
277
+ {}.tap do |hash|
278
+ value.each { |k, v| hash[k] = _to_hash(v) }
279
+ end
280
+ elsif value.respond_to? :to_hash
281
+ value.to_hash
282
+ else
283
+ value
284
+ end
285
+ end
286
+
287
+ end
288
+
289
+ end