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,229 @@
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 CompanyNewsSummary
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
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'id' => :'id',
38
+ :'title' => :'title',
39
+ :'publication_date' => :'publication_date',
40
+ :'url' => :'url',
41
+ :'summary' => :'summary'
42
+ }
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.swagger_types
47
+ {
48
+ :'id' => :'String',
49
+ :'title' => :'String',
50
+ :'publication_date' => :'String',
51
+ :'url' => :'String',
52
+ :'summary' => :'String'
53
+ }
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ return unless attributes.is_a?(Hash)
60
+
61
+ # convert string to symbol for hash key
62
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
63
+
64
+ if attributes.has_key?(:'id')
65
+ self.id = attributes[:'id']
66
+ end
67
+
68
+ if attributes.has_key?(:'title')
69
+ self.title = attributes[:'title']
70
+ end
71
+
72
+ if attributes.has_key?(:'publication_date')
73
+ self.publication_date = attributes[:'publication_date']
74
+ end
75
+
76
+ if attributes.has_key?(:'url')
77
+ self.url = attributes[:'url']
78
+ end
79
+
80
+ if attributes.has_key?(:'summary')
81
+ self.summary = attributes[:'summary']
82
+ end
83
+
84
+ end
85
+
86
+ # Show invalid properties with the reasons. Usually used together with valid?
87
+ # @return Array for valid properties with the reasons
88
+ def list_invalid_properties
89
+ invalid_properties = Array.new
90
+ return invalid_properties
91
+ end
92
+
93
+ # Check to see if the all the properties in the model are valid
94
+ # @return true if the model is valid
95
+ def valid?
96
+ return true
97
+ end
98
+
99
+ # Checks equality by comparing each attribute.
100
+ # @param [Object] Object to be compared
101
+ def ==(o)
102
+ return true if self.equal?(o)
103
+ self.class == o.class &&
104
+ id == o.id &&
105
+ title == o.title &&
106
+ publication_date == o.publication_date &&
107
+ url == o.url &&
108
+ summary == o.summary
109
+ end
110
+
111
+ # @see the `==` method
112
+ # @param [Object] Object to be compared
113
+ def eql?(o)
114
+ self == o
115
+ end
116
+
117
+ # Calculates hash code according to all attributes.
118
+ # @return [Fixnum] Hash code
119
+ def hash
120
+ [id, title, publication_date, url, summary].hash
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def build_from_hash(attributes)
127
+ return nil unless attributes.is_a?(Hash)
128
+ self.class.swagger_types.each_pair do |key, type|
129
+ if type =~ /\AArray<(.*)>/i
130
+ # check to ensure the input is an array given that the the attribute
131
+ # is documented as an array but the input is not
132
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
133
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
134
+ end
135
+ elsif !attributes[self.class.attribute_map[key]].nil?
136
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
137
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
138
+ end
139
+
140
+ self
141
+ end
142
+
143
+ # Deserializes the data based on type
144
+ # @param string type Data type
145
+ # @param string value Value to be deserialized
146
+ # @return [Object] Deserialized data
147
+ def _deserialize(type, value)
148
+ case type.to_sym
149
+ when :DateTime
150
+ DateTime.parse(value)
151
+ when :Date
152
+ Date.parse(value)
153
+ when :String
154
+ value.to_s
155
+ when :Integer
156
+ value.to_i
157
+ when :Float
158
+ value.to_f
159
+ when :BOOLEAN
160
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
161
+ true
162
+ else
163
+ false
164
+ end
165
+ when :Object
166
+ # generic object (usually a Hash), return directly
167
+ value
168
+ when /\AArray<(?<inner_type>.+)>\z/
169
+ inner_type = Regexp.last_match[:inner_type]
170
+ value.map { |v| _deserialize(inner_type, v) }
171
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
172
+ k_type = Regexp.last_match[:k_type]
173
+ v_type = Regexp.last_match[:v_type]
174
+ {}.tap do |hash|
175
+ value.each do |k, v|
176
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
177
+ end
178
+ end
179
+ else # model
180
+ temp_model = Intrinio.const_get(type).new
181
+ temp_model.build_from_hash(value)
182
+ end
183
+ end
184
+
185
+ # Returns the string representation of the object
186
+ # @return [String] String presentation of the object
187
+ def to_s
188
+ to_hash.to_s
189
+ end
190
+
191
+ # to_body is an alias to to_hash (backward compatibility)
192
+ # @return [Hash] Returns the object in the form of hash
193
+ def to_body
194
+ to_hash
195
+ end
196
+
197
+ # Returns the object in the form of hash
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_hash
200
+ hash = {}
201
+ self.class.attribute_map.each_pair do |attr, param|
202
+ value = self.send(attr)
203
+ next if value.nil?
204
+ hash[param] = _to_hash(value)
205
+ end
206
+ hash
207
+ end
208
+
209
+ # Outputs non-array value in the form of hash
210
+ # For object, use to_hash. Otherwise, just return the value
211
+ # @param [Object] value Any valid value
212
+ # @return [Hash] Returns the value in the form of hash
213
+ def _to_hash(value)
214
+ if value.is_a?(Array)
215
+ value.compact.map{ |v| _to_hash(v) }
216
+ elsif value.is_a?(Hash)
217
+ {}.tap do |hash|
218
+ value.each { |k, v| hash[k] = _to_hash(v) }
219
+ end
220
+ elsif value.respond_to? :to_hash
221
+ value.to_hash
222
+ else
223
+ value
224
+ end
225
+ end
226
+
227
+ end
228
+
229
+ end
@@ -0,0 +1,229 @@
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
+ # The summary of a company that submits filings to the SEC and has a security traded primarily on a US exchange
17
+ class CompanySummary
18
+ # The Intrinio ID of the company
19
+ attr_accessor :id
20
+
21
+ # The stock market ticker symbol associated with the company's common stock securities
22
+ attr_accessor :ticker
23
+
24
+ # The company's common name
25
+ attr_accessor :name
26
+
27
+ # The Legal Entity Identifier (LEI) assigned to the company
28
+ attr_accessor :lei
29
+
30
+ # The Central Index Key (CIK) assigned to the company
31
+ attr_accessor :cik
32
+
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'id' => :'id',
38
+ :'ticker' => :'ticker',
39
+ :'name' => :'name',
40
+ :'lei' => :'lei',
41
+ :'cik' => :'cik'
42
+ }
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.swagger_types
47
+ {
48
+ :'id' => :'String',
49
+ :'ticker' => :'String',
50
+ :'name' => :'String',
51
+ :'lei' => :'String',
52
+ :'cik' => :'String'
53
+ }
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ return unless attributes.is_a?(Hash)
60
+
61
+ # convert string to symbol for hash key
62
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
63
+
64
+ if attributes.has_key?(:'id')
65
+ self.id = attributes[:'id']
66
+ end
67
+
68
+ if attributes.has_key?(:'ticker')
69
+ self.ticker = attributes[:'ticker']
70
+ end
71
+
72
+ if attributes.has_key?(:'name')
73
+ self.name = attributes[:'name']
74
+ end
75
+
76
+ if attributes.has_key?(:'lei')
77
+ self.lei = attributes[:'lei']
78
+ end
79
+
80
+ if attributes.has_key?(:'cik')
81
+ self.cik = attributes[:'cik']
82
+ end
83
+
84
+ end
85
+
86
+ # Show invalid properties with the reasons. Usually used together with valid?
87
+ # @return Array for valid properties with the reasons
88
+ def list_invalid_properties
89
+ invalid_properties = Array.new
90
+ return invalid_properties
91
+ end
92
+
93
+ # Check to see if the all the properties in the model are valid
94
+ # @return true if the model is valid
95
+ def valid?
96
+ return true
97
+ end
98
+
99
+ # Checks equality by comparing each attribute.
100
+ # @param [Object] Object to be compared
101
+ def ==(o)
102
+ return true if self.equal?(o)
103
+ self.class == o.class &&
104
+ id == o.id &&
105
+ ticker == o.ticker &&
106
+ name == o.name &&
107
+ lei == o.lei &&
108
+ cik == o.cik
109
+ end
110
+
111
+ # @see the `==` method
112
+ # @param [Object] Object to be compared
113
+ def eql?(o)
114
+ self == o
115
+ end
116
+
117
+ # Calculates hash code according to all attributes.
118
+ # @return [Fixnum] Hash code
119
+ def hash
120
+ [id, ticker, name, lei, cik].hash
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def build_from_hash(attributes)
127
+ return nil unless attributes.is_a?(Hash)
128
+ self.class.swagger_types.each_pair do |key, type|
129
+ if type =~ /\AArray<(.*)>/i
130
+ # check to ensure the input is an array given that the the attribute
131
+ # is documented as an array but the input is not
132
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
133
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
134
+ end
135
+ elsif !attributes[self.class.attribute_map[key]].nil?
136
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
137
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
138
+ end
139
+
140
+ self
141
+ end
142
+
143
+ # Deserializes the data based on type
144
+ # @param string type Data type
145
+ # @param string value Value to be deserialized
146
+ # @return [Object] Deserialized data
147
+ def _deserialize(type, value)
148
+ case type.to_sym
149
+ when :DateTime
150
+ DateTime.parse(value)
151
+ when :Date
152
+ Date.parse(value)
153
+ when :String
154
+ value.to_s
155
+ when :Integer
156
+ value.to_i
157
+ when :Float
158
+ value.to_f
159
+ when :BOOLEAN
160
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
161
+ true
162
+ else
163
+ false
164
+ end
165
+ when :Object
166
+ # generic object (usually a Hash), return directly
167
+ value
168
+ when /\AArray<(?<inner_type>.+)>\z/
169
+ inner_type = Regexp.last_match[:inner_type]
170
+ value.map { |v| _deserialize(inner_type, v) }
171
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
172
+ k_type = Regexp.last_match[:k_type]
173
+ v_type = Regexp.last_match[:v_type]
174
+ {}.tap do |hash|
175
+ value.each do |k, v|
176
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
177
+ end
178
+ end
179
+ else # model
180
+ temp_model = Intrinio.const_get(type).new
181
+ temp_model.build_from_hash(value)
182
+ end
183
+ end
184
+
185
+ # Returns the string representation of the object
186
+ # @return [String] String presentation of the object
187
+ def to_s
188
+ to_hash.to_s
189
+ end
190
+
191
+ # to_body is an alias to to_hash (backward compatibility)
192
+ # @return [Hash] Returns the object in the form of hash
193
+ def to_body
194
+ to_hash
195
+ end
196
+
197
+ # Returns the object in the form of hash
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_hash
200
+ hash = {}
201
+ self.class.attribute_map.each_pair do |attr, param|
202
+ value = self.send(attr)
203
+ next if value.nil?
204
+ hash[param] = _to_hash(value)
205
+ end
206
+ hash
207
+ end
208
+
209
+ # Outputs non-array value in the form of hash
210
+ # For object, use to_hash. Otherwise, just return the value
211
+ # @param [Object] value Any valid value
212
+ # @return [Hash] Returns the value in the form of hash
213
+ def _to_hash(value)
214
+ if value.is_a?(Array)
215
+ value.compact.map{ |v| _to_hash(v) }
216
+ elsif value.is_a?(Hash)
217
+ {}.tap do |hash|
218
+ value.each { |k, v| hash[k] = _to_hash(v) }
219
+ end
220
+ elsif value.respond_to? :to_hash
221
+ value.to_hash
222
+ else
223
+ value
224
+ end
225
+ end
226
+
227
+ end
228
+
229
+ end