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,278 @@
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
+ # A filing submitted to the SEC by a company
17
+ class CompanyFiling
18
+ # The Intrinio ID of the Filing
19
+ attr_accessor :id
20
+
21
+ # The date when the filing was submitted to the SEC by the company
22
+ attr_accessor :filing_date
23
+
24
+ # The date and time when the filing was accepted by SEC
25
+ attr_accessor :accepted_date
26
+
27
+ # The ending date of the fiscal period for the filing
28
+ attr_accessor :period_end_date
29
+
30
+ # The filing report type
31
+ attr_accessor :report_type
32
+
33
+ # A unique identifier for the filing provided by the SEC
34
+ attr_accessor :sec_unique_id
35
+
36
+ # The URL to the filing page on the SEC site
37
+ attr_accessor :filing_url
38
+
39
+ # The URL to the actual report on the SEC site
40
+ attr_accessor :report_url
41
+
42
+ # The URL for the XBRL filing for the report
43
+ attr_accessor :instance_url
44
+
45
+ attr_accessor :company
46
+
47
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ def self.attribute_map
50
+ {
51
+ :'id' => :'id',
52
+ :'filing_date' => :'filing_date',
53
+ :'accepted_date' => :'accepted_date',
54
+ :'period_end_date' => :'period_end_date',
55
+ :'report_type' => :'report_type',
56
+ :'sec_unique_id' => :'sec_unique_id',
57
+ :'filing_url' => :'filing_url',
58
+ :'report_url' => :'report_url',
59
+ :'instance_url' => :'instance_url',
60
+ :'company' => :'company'
61
+ }
62
+ end
63
+
64
+ # Attribute type mapping.
65
+ def self.swagger_types
66
+ {
67
+ :'id' => :'String',
68
+ :'filing_date' => :'Date',
69
+ :'accepted_date' => :'DateTime',
70
+ :'period_end_date' => :'Date',
71
+ :'report_type' => :'String',
72
+ :'sec_unique_id' => :'String',
73
+ :'filing_url' => :'String',
74
+ :'report_url' => :'String',
75
+ :'instance_url' => :'String',
76
+ :'company' => :'CompanySummary'
77
+ }
78
+ end
79
+
80
+ # Initializes the object
81
+ # @param [Hash] attributes Model attributes in the form of hash
82
+ def initialize(attributes = {})
83
+ return unless attributes.is_a?(Hash)
84
+
85
+ # convert string to symbol for hash key
86
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
87
+
88
+ if attributes.has_key?(:'id')
89
+ self.id = attributes[:'id']
90
+ end
91
+
92
+ if attributes.has_key?(:'filing_date')
93
+ self.filing_date = attributes[:'filing_date']
94
+ end
95
+
96
+ if attributes.has_key?(:'accepted_date')
97
+ self.accepted_date = attributes[:'accepted_date']
98
+ end
99
+
100
+ if attributes.has_key?(:'period_end_date')
101
+ self.period_end_date = attributes[:'period_end_date']
102
+ end
103
+
104
+ if attributes.has_key?(:'report_type')
105
+ self.report_type = attributes[:'report_type']
106
+ end
107
+
108
+ if attributes.has_key?(:'sec_unique_id')
109
+ self.sec_unique_id = attributes[:'sec_unique_id']
110
+ end
111
+
112
+ if attributes.has_key?(:'filing_url')
113
+ self.filing_url = attributes[:'filing_url']
114
+ end
115
+
116
+ if attributes.has_key?(:'report_url')
117
+ self.report_url = attributes[:'report_url']
118
+ end
119
+
120
+ if attributes.has_key?(:'instance_url')
121
+ self.instance_url = attributes[:'instance_url']
122
+ end
123
+
124
+ if attributes.has_key?(:'company')
125
+ self.company = attributes[:'company']
126
+ end
127
+
128
+ end
129
+
130
+ # Show invalid properties with the reasons. Usually used together with valid?
131
+ # @return Array for valid properties with the reasons
132
+ def list_invalid_properties
133
+ invalid_properties = Array.new
134
+ return invalid_properties
135
+ end
136
+
137
+ # Check to see if the all the properties in the model are valid
138
+ # @return true if the model is valid
139
+ def valid?
140
+ return true
141
+ end
142
+
143
+ # Checks equality by comparing each attribute.
144
+ # @param [Object] Object to be compared
145
+ def ==(o)
146
+ return true if self.equal?(o)
147
+ self.class == o.class &&
148
+ id == o.id &&
149
+ filing_date == o.filing_date &&
150
+ accepted_date == o.accepted_date &&
151
+ period_end_date == o.period_end_date &&
152
+ report_type == o.report_type &&
153
+ sec_unique_id == o.sec_unique_id &&
154
+ filing_url == o.filing_url &&
155
+ report_url == o.report_url &&
156
+ instance_url == o.instance_url &&
157
+ company == o.company
158
+ end
159
+
160
+ # @see the `==` method
161
+ # @param [Object] Object to be compared
162
+ def eql?(o)
163
+ self == o
164
+ end
165
+
166
+ # Calculates hash code according to all attributes.
167
+ # @return [Fixnum] Hash code
168
+ def hash
169
+ [id, filing_date, accepted_date, period_end_date, report_type, sec_unique_id, filing_url, report_url, instance_url, company].hash
170
+ end
171
+
172
+ # Builds the object from hash
173
+ # @param [Hash] attributes Model attributes in the form of hash
174
+ # @return [Object] Returns the model itself
175
+ def build_from_hash(attributes)
176
+ return nil unless attributes.is_a?(Hash)
177
+ self.class.swagger_types.each_pair do |key, type|
178
+ if type =~ /\AArray<(.*)>/i
179
+ # check to ensure the input is an array given that the the attribute
180
+ # is documented as an array but the input is not
181
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
182
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
183
+ end
184
+ elsif !attributes[self.class.attribute_map[key]].nil?
185
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
186
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
187
+ end
188
+
189
+ self
190
+ end
191
+
192
+ # Deserializes the data based on type
193
+ # @param string type Data type
194
+ # @param string value Value to be deserialized
195
+ # @return [Object] Deserialized data
196
+ def _deserialize(type, value)
197
+ case type.to_sym
198
+ when :DateTime
199
+ DateTime.parse(value)
200
+ when :Date
201
+ Date.parse(value)
202
+ when :String
203
+ value.to_s
204
+ when :Integer
205
+ value.to_i
206
+ when :Float
207
+ value.to_f
208
+ when :BOOLEAN
209
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
210
+ true
211
+ else
212
+ false
213
+ end
214
+ when :Object
215
+ # generic object (usually a Hash), return directly
216
+ value
217
+ when /\AArray<(?<inner_type>.+)>\z/
218
+ inner_type = Regexp.last_match[:inner_type]
219
+ value.map { |v| _deserialize(inner_type, v) }
220
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
221
+ k_type = Regexp.last_match[:k_type]
222
+ v_type = Regexp.last_match[:v_type]
223
+ {}.tap do |hash|
224
+ value.each do |k, v|
225
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
226
+ end
227
+ end
228
+ else # model
229
+ temp_model = Intrinio.const_get(type).new
230
+ temp_model.build_from_hash(value)
231
+ end
232
+ end
233
+
234
+ # Returns the string representation of the object
235
+ # @return [String] String presentation of the object
236
+ def to_s
237
+ to_hash.to_s
238
+ end
239
+
240
+ # to_body is an alias to to_hash (backward compatibility)
241
+ # @return [Hash] Returns the object in the form of hash
242
+ def to_body
243
+ to_hash
244
+ end
245
+
246
+ # Returns the object in the form of hash
247
+ # @return [Hash] Returns the object in the form of hash
248
+ def to_hash
249
+ hash = {}
250
+ self.class.attribute_map.each_pair do |attr, param|
251
+ value = self.send(attr)
252
+ next if value.nil?
253
+ hash[param] = _to_hash(value)
254
+ end
255
+ hash
256
+ end
257
+
258
+ # Outputs non-array value in the form of hash
259
+ # For object, use to_hash. Otherwise, just return the value
260
+ # @param [Object] value Any valid value
261
+ # @return [Hash] Returns the value in the form of hash
262
+ def _to_hash(value)
263
+ if value.is_a?(Array)
264
+ value.compact.map{ |v| _to_hash(v) }
265
+ elsif value.is_a?(Hash)
266
+ {}.tap do |hash|
267
+ value.each { |k, v| hash[k] = _to_hash(v) }
268
+ end
269
+ elsif value.respond_to? :to_hash
270
+ value.to_hash
271
+ else
272
+ value
273
+ end
274
+ end
275
+
276
+ end
277
+
278
+ end
@@ -0,0 +1,239 @@
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
+ # A news article about a company
17
+ class CompanyNews
18
+ # The Intrinio ID for the news article
19
+ attr_accessor :id
20
+
21
+ # The title of the news article
22
+ attr_accessor :title
23
+
24
+ # The publication date of the news article
25
+ attr_accessor :publication_date
26
+
27
+ # The url of the news article
28
+ attr_accessor :url
29
+
30
+ # A summary of the news article
31
+ attr_accessor :summary
32
+
33
+ # The Company that the Fundamental was belongs to
34
+ attr_accessor :company
35
+
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'id' => :'id',
41
+ :'title' => :'title',
42
+ :'publication_date' => :'publication_date',
43
+ :'url' => :'url',
44
+ :'summary' => :'summary',
45
+ :'company' => :'company'
46
+ }
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ def self.swagger_types
51
+ {
52
+ :'id' => :'String',
53
+ :'title' => :'String',
54
+ :'publication_date' => :'DateTime',
55
+ :'url' => :'String',
56
+ :'summary' => :'String',
57
+ :'company' => :'CompanySummary'
58
+ }
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ return unless attributes.is_a?(Hash)
65
+
66
+ # convert string to symbol for hash key
67
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
68
+
69
+ if attributes.has_key?(:'id')
70
+ self.id = attributes[:'id']
71
+ end
72
+
73
+ if attributes.has_key?(:'title')
74
+ self.title = attributes[:'title']
75
+ end
76
+
77
+ if attributes.has_key?(:'publication_date')
78
+ self.publication_date = attributes[:'publication_date']
79
+ end
80
+
81
+ if attributes.has_key?(:'url')
82
+ self.url = attributes[:'url']
83
+ end
84
+
85
+ if attributes.has_key?(:'summary')
86
+ self.summary = attributes[:'summary']
87
+ end
88
+
89
+ if attributes.has_key?(:'company')
90
+ self.company = attributes[:'company']
91
+ end
92
+
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properties with the reasons
97
+ def list_invalid_properties
98
+ invalid_properties = Array.new
99
+ return invalid_properties
100
+ end
101
+
102
+ # Check to see if the all the properties in the model are valid
103
+ # @return true if the model is valid
104
+ def valid?
105
+ return true
106
+ end
107
+
108
+ # Checks equality by comparing each attribute.
109
+ # @param [Object] Object to be compared
110
+ def ==(o)
111
+ return true if self.equal?(o)
112
+ self.class == o.class &&
113
+ id == o.id &&
114
+ title == o.title &&
115
+ publication_date == o.publication_date &&
116
+ url == o.url &&
117
+ summary == o.summary &&
118
+ company == o.company
119
+ end
120
+
121
+ # @see the `==` method
122
+ # @param [Object] Object to be compared
123
+ def eql?(o)
124
+ self == o
125
+ end
126
+
127
+ # Calculates hash code according to all attributes.
128
+ # @return [Fixnum] Hash code
129
+ def hash
130
+ [id, title, publication_date, url, summary, company].hash
131
+ end
132
+
133
+ # Builds the object from hash
134
+ # @param [Hash] attributes Model attributes in the form of hash
135
+ # @return [Object] Returns the model itself
136
+ def build_from_hash(attributes)
137
+ return nil unless attributes.is_a?(Hash)
138
+ self.class.swagger_types.each_pair do |key, type|
139
+ if type =~ /\AArray<(.*)>/i
140
+ # check to ensure the input is an array given that the the attribute
141
+ # is documented as an array but the input is not
142
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
143
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
144
+ end
145
+ elsif !attributes[self.class.attribute_map[key]].nil?
146
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
147
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
148
+ end
149
+
150
+ self
151
+ end
152
+
153
+ # Deserializes the data based on type
154
+ # @param string type Data type
155
+ # @param string value Value to be deserialized
156
+ # @return [Object] Deserialized data
157
+ def _deserialize(type, value)
158
+ case type.to_sym
159
+ when :DateTime
160
+ DateTime.parse(value)
161
+ when :Date
162
+ Date.parse(value)
163
+ when :String
164
+ value.to_s
165
+ when :Integer
166
+ value.to_i
167
+ when :Float
168
+ value.to_f
169
+ when :BOOLEAN
170
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
171
+ true
172
+ else
173
+ false
174
+ end
175
+ when :Object
176
+ # generic object (usually a Hash), return directly
177
+ value
178
+ when /\AArray<(?<inner_type>.+)>\z/
179
+ inner_type = Regexp.last_match[:inner_type]
180
+ value.map { |v| _deserialize(inner_type, v) }
181
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
182
+ k_type = Regexp.last_match[:k_type]
183
+ v_type = Regexp.last_match[:v_type]
184
+ {}.tap do |hash|
185
+ value.each do |k, v|
186
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
187
+ end
188
+ end
189
+ else # model
190
+ temp_model = Intrinio.const_get(type).new
191
+ temp_model.build_from_hash(value)
192
+ end
193
+ end
194
+
195
+ # Returns the string representation of the object
196
+ # @return [String] String presentation of the object
197
+ def to_s
198
+ to_hash.to_s
199
+ end
200
+
201
+ # to_body is an alias to to_hash (backward compatibility)
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_body
204
+ to_hash
205
+ end
206
+
207
+ # Returns the object in the form of hash
208
+ # @return [Hash] Returns the object in the form of hash
209
+ def to_hash
210
+ hash = {}
211
+ self.class.attribute_map.each_pair do |attr, param|
212
+ value = self.send(attr)
213
+ next if value.nil?
214
+ hash[param] = _to_hash(value)
215
+ end
216
+ hash
217
+ end
218
+
219
+ # Outputs non-array value in the form of hash
220
+ # For object, use to_hash. Otherwise, just return the value
221
+ # @param [Object] value Any valid value
222
+ # @return [Hash] Returns the value in the form of hash
223
+ def _to_hash(value)
224
+ if value.is_a?(Array)
225
+ value.compact.map{ |v| _to_hash(v) }
226
+ elsif value.is_a?(Hash)
227
+ {}.tap do |hash|
228
+ value.each { |k, v| hash[k] = _to_hash(v) }
229
+ end
230
+ elsif value.respond_to? :to_hash
231
+ value.to_hash
232
+ else
233
+ value
234
+ end
235
+ end
236
+
237
+ end
238
+
239
+ end