intrinio-sdk 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +78 -52
  3. data/docs/ApiResponseFilingNotes.md +9 -0
  4. data/docs/ApiResponseFilingNotesSearch.md +8 -0
  5. data/docs/ApiResponseStockExchangeRealtimeStockPrices.md +9 -0
  6. data/docs/CompanyApi.md +34 -28
  7. data/docs/DataPointApi.md +4 -4
  8. data/docs/DataTagApi.md +5 -5
  9. data/docs/DividendRecord.md +17 -0
  10. data/docs/EarningsRecord.md +30 -0
  11. data/docs/FilingApi.md +273 -7
  12. data/docs/FilingNote.md +11 -0
  13. data/docs/FilingNoteFiling.md +11 -0
  14. data/docs/FilingNoteSummary.md +10 -0
  15. data/docs/FundamentalsApi.md +9 -9
  16. data/docs/HistoricalDataApi.md +2 -2
  17. data/docs/IndexApi.md +30 -30
  18. data/docs/RealtimeStockPrice.md +21 -0
  19. data/docs/RealtimeStockPriceSecurity.md +12 -0
  20. data/docs/SecurityApi.md +148 -17
  21. data/docs/StockExchangeApi.md +64 -15
  22. data/intrinio-sdk.gemspec +1 -1
  23. data/lib/intrinio-sdk.rb +11 -1
  24. data/lib/intrinio-sdk/api/company_api.rb +41 -35
  25. data/lib/intrinio-sdk/api/data_point_api.rb +5 -5
  26. data/lib/intrinio-sdk/api/data_tag_api.rb +7 -7
  27. data/lib/intrinio-sdk/api/filing_api.rb +364 -11
  28. data/lib/intrinio-sdk/api/fundamentals_api.rb +11 -11
  29. data/lib/intrinio-sdk/api/historical_data_api.rb +3 -3
  30. data/lib/intrinio-sdk/api/index_api.rb +31 -31
  31. data/lib/intrinio-sdk/api/security_api.rb +194 -23
  32. data/lib/intrinio-sdk/api/stock_exchange_api.rb +85 -23
  33. data/lib/intrinio-sdk/api_client.rb +1 -1
  34. data/lib/intrinio-sdk/api_error.rb +1 -1
  35. data/lib/intrinio-sdk/configuration.rb +1 -1
  36. data/lib/intrinio-sdk/models/api_response_companies.rb +1 -1
  37. data/lib/intrinio-sdk/models/api_response_company_filings.rb +1 -1
  38. data/lib/intrinio-sdk/models/api_response_company_fundamentals.rb +1 -1
  39. data/lib/intrinio-sdk/models/api_response_company_historical_data.rb +1 -1
  40. data/lib/intrinio-sdk/models/api_response_company_news.rb +1 -1
  41. data/lib/intrinio-sdk/models/api_response_company_securities.rb +1 -1
  42. data/lib/intrinio-sdk/models/api_response_data_tags.rb +1 -1
  43. data/lib/intrinio-sdk/models/api_response_economic_index_historical_data.rb +1 -1
  44. data/lib/intrinio-sdk/models/api_response_economic_indices.rb +1 -1
  45. data/lib/intrinio-sdk/models/api_response_filing_notes.rb +200 -0
  46. data/lib/intrinio-sdk/models/api_response_filing_notes_search.rb +190 -0
  47. data/lib/intrinio-sdk/models/api_response_filings.rb +1 -1
  48. data/lib/intrinio-sdk/models/api_response_historical_data.rb +1 -1
  49. data/lib/intrinio-sdk/models/api_response_news.rb +1 -1
  50. data/lib/intrinio-sdk/models/api_response_reported_financials.rb +1 -1
  51. data/lib/intrinio-sdk/models/api_response_securities.rb +1 -1
  52. data/lib/intrinio-sdk/models/api_response_security_historical_data.rb +1 -1
  53. data/lib/intrinio-sdk/models/api_response_security_stock_price_adjustments.rb +1 -1
  54. data/lib/intrinio-sdk/models/api_response_security_stock_prices.rb +1 -1
  55. data/lib/intrinio-sdk/models/api_response_sic_index_historical_data.rb +1 -1
  56. data/lib/intrinio-sdk/models/api_response_sic_indices.rb +1 -1
  57. data/lib/intrinio-sdk/models/api_response_standardized_financials.rb +1 -1
  58. data/lib/intrinio-sdk/models/api_response_stock_exchange_realtime_stock_prices.rb +201 -0
  59. data/lib/intrinio-sdk/models/api_response_stock_exchange_securities.rb +1 -1
  60. data/lib/intrinio-sdk/models/api_response_stock_exchange_stock_price_adjustments.rb +1 -1
  61. data/lib/intrinio-sdk/models/api_response_stock_exchange_stock_prices.rb +1 -1
  62. data/lib/intrinio-sdk/models/api_response_stock_exchanges.rb +1 -1
  63. data/lib/intrinio-sdk/models/api_response_stock_market_index_historical_data.rb +1 -1
  64. data/lib/intrinio-sdk/models/api_response_stock_market_indices.rb +1 -1
  65. data/lib/intrinio-sdk/models/company.rb +1 -1
  66. data/lib/intrinio-sdk/models/company_filing.rb +1 -1
  67. data/lib/intrinio-sdk/models/company_news.rb +1 -1
  68. data/lib/intrinio-sdk/models/company_news_summary.rb +1 -1
  69. data/lib/intrinio-sdk/models/company_summary.rb +1 -1
  70. data/lib/intrinio-sdk/models/data_tag.rb +1 -1
  71. data/lib/intrinio-sdk/models/data_tag_summary.rb +1 -1
  72. data/lib/intrinio-sdk/models/dividend_record.rb +311 -0
  73. data/lib/intrinio-sdk/models/earnings_record.rb +465 -0
  74. data/lib/intrinio-sdk/models/economic_index.rb +1 -1
  75. data/lib/intrinio-sdk/models/economic_index_summary.rb +1 -1
  76. data/lib/intrinio-sdk/models/filing.rb +1 -1
  77. data/lib/intrinio-sdk/models/filing_note.rb +218 -0
  78. data/lib/intrinio-sdk/models/filing_note_filing.rb +219 -0
  79. data/lib/intrinio-sdk/models/filing_note_summary.rb +208 -0
  80. data/lib/intrinio-sdk/models/filing_summary.rb +1 -1
  81. data/lib/intrinio-sdk/models/fundamental.rb +1 -1
  82. data/lib/intrinio-sdk/models/fundamental_summary.rb +1 -1
  83. data/lib/intrinio-sdk/models/historical_data.rb +1 -1
  84. data/lib/intrinio-sdk/models/realtime_stock_price.rb +318 -0
  85. data/lib/intrinio-sdk/models/realtime_stock_price_security.rb +229 -0
  86. data/lib/intrinio-sdk/models/reported_financial.rb +1 -1
  87. data/lib/intrinio-sdk/models/reported_tag.rb +1 -1
  88. data/lib/intrinio-sdk/models/security.rb +1 -1
  89. data/lib/intrinio-sdk/models/security_screen_clause.rb +1 -1
  90. data/lib/intrinio-sdk/models/security_screen_group.rb +1 -1
  91. data/lib/intrinio-sdk/models/security_screen_result.rb +1 -1
  92. data/lib/intrinio-sdk/models/security_screen_result_data.rb +1 -1
  93. data/lib/intrinio-sdk/models/security_summary.rb +1 -1
  94. data/lib/intrinio-sdk/models/sic_index.rb +1 -1
  95. data/lib/intrinio-sdk/models/standardized_financial.rb +1 -1
  96. data/lib/intrinio-sdk/models/stock_exchange.rb +1 -1
  97. data/lib/intrinio-sdk/models/stock_market_index.rb +1 -1
  98. data/lib/intrinio-sdk/models/stock_market_index_summary.rb +1 -1
  99. data/lib/intrinio-sdk/models/stock_price.rb +1 -1
  100. data/lib/intrinio-sdk/models/stock_price_adjustment.rb +1 -1
  101. data/lib/intrinio-sdk/models/stock_price_adjustment_summary.rb +1 -1
  102. data/lib/intrinio-sdk/models/stock_price_summary.rb +1 -1
  103. data/lib/intrinio-sdk/version.rb +2 -2
  104. data/spec/models/api_response_filing_notes_search_spec.rb +42 -0
  105. data/spec/models/api_response_filing_notes_spec.rb +48 -0
  106. data/spec/models/api_response_stock_exchange_realtime_stock_prices_spec.rb +48 -0
  107. data/spec/models/dividend_record_spec.rb +100 -0
  108. data/spec/models/earnings_record_spec.rb +186 -0
  109. data/spec/models/filing_note_filing_spec.rb +60 -0
  110. data/spec/models/filing_note_spec.rb +60 -0
  111. data/spec/models/filing_note_summary_spec.rb +54 -0
  112. data/spec/models/realtime_stock_price_security_spec.rb +66 -0
  113. data/spec/models/realtime_stock_price_spec.rb +120 -0
  114. metadata +43 -3
@@ -0,0 +1,190 @@
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.1.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
+
17
+ class ApiResponseFilingNotesSearch
18
+ attr_accessor :filing_notes
19
+
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'filing_notes' => :'filing_notes'
25
+ }
26
+ end
27
+
28
+ # Attribute type mapping.
29
+ def self.swagger_types
30
+ {
31
+ :'filing_notes' => :'Array<FilingNoteSummary>'
32
+ }
33
+ end
34
+
35
+ # Initializes the object
36
+ # @param [Hash] attributes Model attributes in the form of hash
37
+ def initialize(attributes = {})
38
+ return unless attributes.is_a?(Hash)
39
+
40
+ # convert string to symbol for hash key
41
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
42
+
43
+ if attributes.has_key?(:'filing_notes')
44
+ if (value = attributes[:'filing_notes']).is_a?(Array)
45
+ self.filing_notes = value
46
+ end
47
+ end
48
+
49
+ end
50
+
51
+ # Show invalid properties with the reasons. Usually used together with valid?
52
+ # @return Array for valid properties with the reasons
53
+ def list_invalid_properties
54
+ invalid_properties = Array.new
55
+ return invalid_properties
56
+ end
57
+
58
+ # Check to see if the all the properties in the model are valid
59
+ # @return true if the model is valid
60
+ def valid?
61
+ return true
62
+ end
63
+
64
+ # Checks equality by comparing each attribute.
65
+ # @param [Object] Object to be compared
66
+ def ==(o)
67
+ return true if self.equal?(o)
68
+ self.class == o.class &&
69
+ filing_notes == o.filing_notes
70
+ end
71
+
72
+ # @see the `==` method
73
+ # @param [Object] Object to be compared
74
+ def eql?(o)
75
+ self == o
76
+ end
77
+
78
+ # Calculates hash code according to all attributes.
79
+ # @return [Fixnum] Hash code
80
+ def hash
81
+ [filing_notes].hash
82
+ end
83
+
84
+ # Builds the object from hash
85
+ # @param [Hash] attributes Model attributes in the form of hash
86
+ # @return [Object] Returns the model itself
87
+ def build_from_hash(attributes)
88
+ return nil unless attributes.is_a?(Hash)
89
+ self.class.swagger_types.each_pair do |key, type|
90
+ if type =~ /\AArray<(.*)>/i
91
+ # check to ensure the input is an array given that the the attribute
92
+ # is documented as an array but the input is not
93
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
94
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
95
+ end
96
+ elsif !attributes[self.class.attribute_map[key]].nil?
97
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
98
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
99
+ end
100
+
101
+ self
102
+ end
103
+
104
+ # Deserializes the data based on type
105
+ # @param string type Data type
106
+ # @param string value Value to be deserialized
107
+ # @return [Object] Deserialized data
108
+ def _deserialize(type, value)
109
+ case type.to_sym
110
+ when :DateTime
111
+ DateTime.parse(value)
112
+ when :Date
113
+ Date.parse(value)
114
+ when :String
115
+ value.to_s
116
+ when :Integer
117
+ value.to_i
118
+ when :Float
119
+ value.to_f
120
+ when :BOOLEAN
121
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
122
+ true
123
+ else
124
+ false
125
+ end
126
+ when :Object
127
+ # generic object (usually a Hash), return directly
128
+ value
129
+ when /\AArray<(?<inner_type>.+)>\z/
130
+ inner_type = Regexp.last_match[:inner_type]
131
+ value.map { |v| _deserialize(inner_type, v) }
132
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
133
+ k_type = Regexp.last_match[:k_type]
134
+ v_type = Regexp.last_match[:v_type]
135
+ {}.tap do |hash|
136
+ value.each do |k, v|
137
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
138
+ end
139
+ end
140
+ else # model
141
+ temp_model = Intrinio.const_get(type).new
142
+ temp_model.build_from_hash(value)
143
+ end
144
+ end
145
+
146
+ # Returns the string representation of the object
147
+ # @return [String] String presentation of the object
148
+ def to_s
149
+ to_hash.to_s
150
+ end
151
+
152
+ # to_body is an alias to to_hash (backward compatibility)
153
+ # @return [Hash] Returns the object in the form of hash
154
+ def to_body
155
+ to_hash
156
+ end
157
+
158
+ # Returns the object in the form of hash
159
+ # @return [Hash] Returns the object in the form of hash
160
+ def to_hash
161
+ hash = {}
162
+ self.class.attribute_map.each_pair do |attr, param|
163
+ value = self.send(attr)
164
+ next if value.nil?
165
+ hash[param] = _to_hash(value)
166
+ end
167
+ hash
168
+ end
169
+
170
+ # Outputs non-array value in the form of hash
171
+ # For object, use to_hash. Otherwise, just return the value
172
+ # @param [Object] value Any valid value
173
+ # @return [Hash] Returns the value in the form of hash
174
+ def _to_hash(value)
175
+ if value.is_a?(Array)
176
+ value.compact.map{ |v| _to_hash(v) }
177
+ elsif value.is_a?(Hash)
178
+ {}.tap do |hash|
179
+ value.each { |k, v| hash[k] = _to_hash(v) }
180
+ end
181
+ elsif value.respond_to? :to_hash
182
+ value.to_hash
183
+ else
184
+ value
185
+ end
186
+ end
187
+
188
+ end
189
+
190
+ end
@@ -3,7 +3,7 @@
3
3
 
4
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
5
 
6
- OpenAPI spec version: 2.0.0
6
+ OpenAPI spec version: 2.1.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.3.0-SNAPSHOT
@@ -3,7 +3,7 @@
3
3
 
4
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
5
 
6
- OpenAPI spec version: 2.0.0
6
+ OpenAPI spec version: 2.1.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.3.0-SNAPSHOT
@@ -3,7 +3,7 @@
3
3
 
4
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
5
 
6
- OpenAPI spec version: 2.0.0
6
+ OpenAPI spec version: 2.1.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.3.0-SNAPSHOT
@@ -3,7 +3,7 @@
3
3
 
4
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
5
 
6
- OpenAPI spec version: 2.0.0
6
+ OpenAPI spec version: 2.1.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.3.0-SNAPSHOT
@@ -3,7 +3,7 @@
3
3
 
4
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
5
 
6
- OpenAPI spec version: 2.0.0
6
+ OpenAPI spec version: 2.1.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.3.0-SNAPSHOT
@@ -3,7 +3,7 @@
3
3
 
4
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
5
 
6
- OpenAPI spec version: 2.0.0
6
+ OpenAPI spec version: 2.1.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.3.0-SNAPSHOT
@@ -3,7 +3,7 @@
3
3
 
4
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
5
 
6
- OpenAPI spec version: 2.0.0
6
+ OpenAPI spec version: 2.1.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.3.0-SNAPSHOT
@@ -3,7 +3,7 @@
3
3
 
4
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
5
 
6
- OpenAPI spec version: 2.0.0
6
+ OpenAPI spec version: 2.1.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.3.0-SNAPSHOT
@@ -3,7 +3,7 @@
3
3
 
4
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
5
 
6
- OpenAPI spec version: 2.0.0
6
+ OpenAPI spec version: 2.1.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.3.0-SNAPSHOT
@@ -3,7 +3,7 @@
3
3
 
4
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
5
 
6
- OpenAPI spec version: 2.0.0
6
+ OpenAPI spec version: 2.1.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.3.0-SNAPSHOT
@@ -3,7 +3,7 @@
3
3
 
4
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
5
 
6
- OpenAPI spec version: 2.0.0
6
+ OpenAPI spec version: 2.1.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.3.0-SNAPSHOT
@@ -0,0 +1,201 @@
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.1.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
+
17
+ class ApiResponseStockExchangeRealtimeStockPrices
18
+ # The realtime stock prices for all Securities traded on the Stock Exchange
19
+ attr_accessor :stock_prices
20
+
21
+ # The Stock Exchange resolved from the given identifier
22
+ attr_accessor :stock_exchange
23
+
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'stock_prices' => :'stock_prices',
29
+ :'stock_exchange' => :'stock_exchange'
30
+ }
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.swagger_types
35
+ {
36
+ :'stock_prices' => :'Array<RealtimeStockPrice>',
37
+ :'stock_exchange' => :'StockExchange'
38
+ }
39
+ end
40
+
41
+ # Initializes the object
42
+ # @param [Hash] attributes Model attributes in the form of hash
43
+ def initialize(attributes = {})
44
+ return unless attributes.is_a?(Hash)
45
+
46
+ # convert string to symbol for hash key
47
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
48
+
49
+ if attributes.has_key?(:'stock_prices')
50
+ if (value = attributes[:'stock_prices']).is_a?(Array)
51
+ self.stock_prices = value
52
+ end
53
+ end
54
+
55
+ if attributes.has_key?(:'stock_exchange')
56
+ self.stock_exchange = attributes[:'stock_exchange']
57
+ end
58
+
59
+ end
60
+
61
+ # Show invalid properties with the reasons. Usually used together with valid?
62
+ # @return Array for valid properties with the reasons
63
+ def list_invalid_properties
64
+ invalid_properties = Array.new
65
+ return invalid_properties
66
+ end
67
+
68
+ # Check to see if the all the properties in the model are valid
69
+ # @return true if the model is valid
70
+ def valid?
71
+ return true
72
+ end
73
+
74
+ # Checks equality by comparing each attribute.
75
+ # @param [Object] Object to be compared
76
+ def ==(o)
77
+ return true if self.equal?(o)
78
+ self.class == o.class &&
79
+ stock_prices == o.stock_prices &&
80
+ stock_exchange == o.stock_exchange
81
+ end
82
+
83
+ # @see the `==` method
84
+ # @param [Object] Object to be compared
85
+ def eql?(o)
86
+ self == o
87
+ end
88
+
89
+ # Calculates hash code according to all attributes.
90
+ # @return [Fixnum] Hash code
91
+ def hash
92
+ [stock_prices, stock_exchange].hash
93
+ end
94
+
95
+ # Builds the object from hash
96
+ # @param [Hash] attributes Model attributes in the form of hash
97
+ # @return [Object] Returns the model itself
98
+ def build_from_hash(attributes)
99
+ return nil unless attributes.is_a?(Hash)
100
+ self.class.swagger_types.each_pair do |key, type|
101
+ if type =~ /\AArray<(.*)>/i
102
+ # check to ensure the input is an array given that the the attribute
103
+ # is documented as an array but the input is not
104
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
105
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
106
+ end
107
+ elsif !attributes[self.class.attribute_map[key]].nil?
108
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
109
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
110
+ end
111
+
112
+ self
113
+ end
114
+
115
+ # Deserializes the data based on type
116
+ # @param string type Data type
117
+ # @param string value Value to be deserialized
118
+ # @return [Object] Deserialized data
119
+ def _deserialize(type, value)
120
+ case type.to_sym
121
+ when :DateTime
122
+ DateTime.parse(value)
123
+ when :Date
124
+ Date.parse(value)
125
+ when :String
126
+ value.to_s
127
+ when :Integer
128
+ value.to_i
129
+ when :Float
130
+ value.to_f
131
+ when :BOOLEAN
132
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
133
+ true
134
+ else
135
+ false
136
+ end
137
+ when :Object
138
+ # generic object (usually a Hash), return directly
139
+ value
140
+ when /\AArray<(?<inner_type>.+)>\z/
141
+ inner_type = Regexp.last_match[:inner_type]
142
+ value.map { |v| _deserialize(inner_type, v) }
143
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
144
+ k_type = Regexp.last_match[:k_type]
145
+ v_type = Regexp.last_match[:v_type]
146
+ {}.tap do |hash|
147
+ value.each do |k, v|
148
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
149
+ end
150
+ end
151
+ else # model
152
+ temp_model = Intrinio.const_get(type).new
153
+ temp_model.build_from_hash(value)
154
+ end
155
+ end
156
+
157
+ # Returns the string representation of the object
158
+ # @return [String] String presentation of the object
159
+ def to_s
160
+ to_hash.to_s
161
+ end
162
+
163
+ # to_body is an alias to to_hash (backward compatibility)
164
+ # @return [Hash] Returns the object in the form of hash
165
+ def to_body
166
+ to_hash
167
+ end
168
+
169
+ # Returns the object in the form of hash
170
+ # @return [Hash] Returns the object in the form of hash
171
+ def to_hash
172
+ hash = {}
173
+ self.class.attribute_map.each_pair do |attr, param|
174
+ value = self.send(attr)
175
+ next if value.nil?
176
+ hash[param] = _to_hash(value)
177
+ end
178
+ hash
179
+ end
180
+
181
+ # Outputs non-array value in the form of hash
182
+ # For object, use to_hash. Otherwise, just return the value
183
+ # @param [Object] value Any valid value
184
+ # @return [Hash] Returns the value in the form of hash
185
+ def _to_hash(value)
186
+ if value.is_a?(Array)
187
+ value.compact.map{ |v| _to_hash(v) }
188
+ elsif value.is_a?(Hash)
189
+ {}.tap do |hash|
190
+ value.each { |k, v| hash[k] = _to_hash(v) }
191
+ end
192
+ elsif value.respond_to? :to_hash
193
+ value.to_hash
194
+ else
195
+ value
196
+ end
197
+ end
198
+
199
+ end
200
+
201
+ end