intrinio-sdk 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/README.md +176 -0
- data/Rakefile +8 -0
- data/docs/ApiResponseCompanies.md +9 -0
- data/docs/ApiResponseCompanyFilings.md +10 -0
- data/docs/ApiResponseCompanyFundamentals.md +10 -0
- data/docs/ApiResponseCompanyHistoricalData.md +10 -0
- data/docs/ApiResponseCompanyNews.md +10 -0
- data/docs/ApiResponseCompanySecurities.md +10 -0
- data/docs/ApiResponseDataTags.md +9 -0
- data/docs/ApiResponseEconomicIndexHistoricalData.md +10 -0
- data/docs/ApiResponseEconomicIndices.md +9 -0
- data/docs/ApiResponseFilings.md +9 -0
- data/docs/ApiResponseHistoricalData.md +9 -0
- data/docs/ApiResponseNews.md +9 -0
- data/docs/ApiResponseReportedFinancials.md +10 -0
- data/docs/ApiResponseSICIndexHistoricalData.md +10 -0
- data/docs/ApiResponseSICIndices.md +9 -0
- data/docs/ApiResponseSecurities.md +9 -0
- data/docs/ApiResponseSecurityHistoricalData.md +10 -0
- data/docs/ApiResponseSecurityStockPriceAdjustments.md +10 -0
- data/docs/ApiResponseSecurityStockPrices.md +10 -0
- data/docs/ApiResponseStandardizedFinancials.md +10 -0
- data/docs/ApiResponseStockExchangeSecurities.md +10 -0
- data/docs/ApiResponseStockExchangeStockPriceAdjustments.md +10 -0
- data/docs/ApiResponseStockExchangeStockPrices.md +10 -0
- data/docs/ApiResponseStockExchanges.md +9 -0
- data/docs/ApiResponseStockMarketIndexHistoricalData.md +10 -0
- data/docs/ApiResponseStockMarketIndices.md +9 -0
- data/docs/Company.md +39 -0
- data/docs/CompanyApi.md +659 -0
- data/docs/CompanyFiling.md +17 -0
- data/docs/CompanyNews.md +13 -0
- data/docs/CompanyNewsSummary.md +12 -0
- data/docs/CompanySummary.md +12 -0
- data/docs/DataPointApi.md +96 -0
- data/docs/DataTag.md +17 -0
- data/docs/DataTagApi.md +184 -0
- data/docs/DataTagSummary.md +11 -0
- data/docs/EconomicIndex.md +19 -0
- data/docs/EconomicIndexSummary.md +18 -0
- data/docs/Filing.md +17 -0
- data/docs/FilingApi.md +142 -0
- data/docs/FilingSummary.md +16 -0
- data/docs/Fundamental.md +16 -0
- data/docs/FundamentalSummary.md +15 -0
- data/docs/FundamentalsApi.md +181 -0
- data/docs/HistoricalData.md +9 -0
- data/docs/HistoricalDataApi.md +64 -0
- data/docs/IndexApi.md +800 -0
- data/docs/ReportedFinancial.md +9 -0
- data/docs/ReportedTag.md +14 -0
- data/docs/SICIndex.md +12 -0
- data/docs/Security.md +34 -0
- data/docs/SecurityApi.md +420 -0
- data/docs/SecurityScreenClause.md +10 -0
- data/docs/SecurityScreenGroup.md +10 -0
- data/docs/SecurityScreenResult.md +9 -0
- data/docs/SecurityScreenResultData.md +10 -0
- data/docs/SecuritySummary.md +17 -0
- data/docs/StandardizedFinancial.md +9 -0
- data/docs/StockExchange.md +17 -0
- data/docs/StockExchangeApi.md +267 -0
- data/docs/StockMarketIndex.md +17 -0
- data/docs/StockMarketIndexSummary.md +16 -0
- data/docs/StockPrice.md +21 -0
- data/docs/StockPriceAdjustment.md +12 -0
- data/docs/StockPriceAdjustmentSummary.md +13 -0
- data/docs/StockPriceSummary.md +20 -0
- data/git_push.sh +55 -0
- data/intrinio-sdk.gemspec +45 -0
- data/lib/intrinio-sdk.rb +105 -0
- data/lib/intrinio-sdk/api/company_api.rb +885 -0
- data/lib/intrinio-sdk/api/data_point_api.rb +141 -0
- data/lib/intrinio-sdk/api/data_tag_api.rb +251 -0
- data/lib/intrinio-sdk/api/filing_api.rb +192 -0
- data/lib/intrinio-sdk/api/fundamentals_api.rb +261 -0
- data/lib/intrinio-sdk/api/historical_data_api.rb +100 -0
- data/lib/intrinio-sdk/api/index_api.rb +1079 -0
- data/lib/intrinio-sdk/api/security_api.rb +568 -0
- data/lib/intrinio-sdk/api/stock_exchange_api.rb +353 -0
- data/lib/intrinio-sdk/api_client.rb +389 -0
- data/lib/intrinio-sdk/api_error.rb +38 -0
- data/lib/intrinio-sdk/configuration.rb +209 -0
- data/lib/intrinio-sdk/models/api_response_companies.rb +200 -0
- data/lib/intrinio-sdk/models/api_response_company_filings.rb +209 -0
- data/lib/intrinio-sdk/models/api_response_company_fundamentals.rb +209 -0
- data/lib/intrinio-sdk/models/api_response_company_historical_data.rb +209 -0
- data/lib/intrinio-sdk/models/api_response_company_news.rb +209 -0
- data/lib/intrinio-sdk/models/api_response_company_securities.rb +209 -0
- data/lib/intrinio-sdk/models/api_response_data_tags.rb +200 -0
- data/lib/intrinio-sdk/models/api_response_economic_index_historical_data.rb +209 -0
- data/lib/intrinio-sdk/models/api_response_economic_indices.rb +200 -0
- data/lib/intrinio-sdk/models/api_response_filings.rb +200 -0
- data/lib/intrinio-sdk/models/api_response_historical_data.rb +200 -0
- data/lib/intrinio-sdk/models/api_response_news.rb +200 -0
- data/lib/intrinio-sdk/models/api_response_reported_financials.rb +209 -0
- data/lib/intrinio-sdk/models/api_response_securities.rb +200 -0
- data/lib/intrinio-sdk/models/api_response_security_historical_data.rb +209 -0
- data/lib/intrinio-sdk/models/api_response_security_stock_price_adjustments.rb +211 -0
- data/lib/intrinio-sdk/models/api_response_security_stock_prices.rb +211 -0
- data/lib/intrinio-sdk/models/api_response_sic_index_historical_data.rb +209 -0
- data/lib/intrinio-sdk/models/api_response_sic_indices.rb +200 -0
- data/lib/intrinio-sdk/models/api_response_standardized_financials.rb +209 -0
- data/lib/intrinio-sdk/models/api_response_stock_exchange_securities.rb +211 -0
- data/lib/intrinio-sdk/models/api_response_stock_exchange_stock_price_adjustments.rb +211 -0
- data/lib/intrinio-sdk/models/api_response_stock_exchange_stock_prices.rb +211 -0
- data/lib/intrinio-sdk/models/api_response_stock_exchanges.rb +200 -0
- data/lib/intrinio-sdk/models/api_response_stock_market_index_historical_data.rb +209 -0
- data/lib/intrinio-sdk/models/api_response_stock_market_indices.rb +200 -0
- data/lib/intrinio-sdk/models/company.rb +498 -0
- data/lib/intrinio-sdk/models/company_filing.rb +278 -0
- data/lib/intrinio-sdk/models/company_news.rb +239 -0
- data/lib/intrinio-sdk/models/company_news_summary.rb +229 -0
- data/lib/intrinio-sdk/models/company_summary.rb +229 -0
- data/lib/intrinio-sdk/models/data_tag.rb +312 -0
- data/lib/intrinio-sdk/models/data_tag_summary.rb +219 -0
- data/lib/intrinio-sdk/models/economic_index.rb +299 -0
- data/lib/intrinio-sdk/models/economic_index_summary.rb +289 -0
- data/lib/intrinio-sdk/models/filing.rb +278 -0
- data/lib/intrinio-sdk/models/filing_summary.rb +269 -0
- data/lib/intrinio-sdk/models/fundamental.rb +302 -0
- data/lib/intrinio-sdk/models/fundamental_summary.rb +292 -0
- data/lib/intrinio-sdk/models/historical_data.rb +199 -0
- data/lib/intrinio-sdk/models/reported_financial.rb +198 -0
- data/lib/intrinio-sdk/models/reported_tag.rb +249 -0
- data/lib/intrinio-sdk/models/security.rb +453 -0
- data/lib/intrinio-sdk/models/security_screen_clause.rb +242 -0
- data/lib/intrinio-sdk/models/security_screen_group.rb +213 -0
- data/lib/intrinio-sdk/models/security_screen_result.rb +199 -0
- data/lib/intrinio-sdk/models/security_screen_result_data.rb +209 -0
- data/lib/intrinio-sdk/models/security_summary.rb +279 -0
- data/lib/intrinio-sdk/models/sic_index.rb +229 -0
- data/lib/intrinio-sdk/models/standardized_financial.rb +198 -0
- data/lib/intrinio-sdk/models/stock_exchange.rb +279 -0
- data/lib/intrinio-sdk/models/stock_market_index.rb +279 -0
- data/lib/intrinio-sdk/models/stock_market_index_summary.rb +269 -0
- data/lib/intrinio-sdk/models/stock_price.rb +352 -0
- data/lib/intrinio-sdk/models/stock_price_adjustment.rb +229 -0
- data/lib/intrinio-sdk/models/stock_price_adjustment_summary.rb +239 -0
- data/lib/intrinio-sdk/models/stock_price_summary.rb +342 -0
- data/lib/intrinio-sdk/version.rb +15 -0
- data/spec/api/company_api_spec.rb +233 -0
- data/spec/api/data_point_api_spec.rb +61 -0
- data/spec/api/data_tag_api_spec.rb +88 -0
- data/spec/api/filing_api_spec.rb +75 -0
- data/spec/api/fundamentals_api_spec.rb +86 -0
- data/spec/api/historical_data_api_spec.rb +53 -0
- data/spec/api/index_api_spec.rb +275 -0
- data/spec/api/security_api_spec.rb +161 -0
- data/spec/api/stock_exchange_api_spec.rb +113 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/api_response_companies_spec.rb +48 -0
- data/spec/models/api_response_company_filings_spec.rb +54 -0
- data/spec/models/api_response_company_fundamentals_spec.rb +54 -0
- data/spec/models/api_response_company_historical_data_spec.rb +54 -0
- data/spec/models/api_response_company_news_spec.rb +54 -0
- data/spec/models/api_response_company_securities_spec.rb +54 -0
- data/spec/models/api_response_data_tags_spec.rb +48 -0
- data/spec/models/api_response_economic_index_historical_data_spec.rb +54 -0
- data/spec/models/api_response_economic_indices_spec.rb +48 -0
- data/spec/models/api_response_filings_spec.rb +48 -0
- data/spec/models/api_response_historical_data_spec.rb +48 -0
- data/spec/models/api_response_news_spec.rb +48 -0
- data/spec/models/api_response_reported_financials_spec.rb +54 -0
- data/spec/models/api_response_securities_spec.rb +48 -0
- data/spec/models/api_response_security_historical_data_spec.rb +54 -0
- data/spec/models/api_response_security_stock_price_adjustments_spec.rb +54 -0
- data/spec/models/api_response_security_stock_prices_spec.rb +54 -0
- data/spec/models/api_response_sic_index_historical_data_spec.rb +54 -0
- data/spec/models/api_response_sic_indices_spec.rb +48 -0
- data/spec/models/api_response_standardized_financials_spec.rb +54 -0
- data/spec/models/api_response_stock_exchange_securities_spec.rb +54 -0
- data/spec/models/api_response_stock_exchange_stock_price_adjustments_spec.rb +54 -0
- data/spec/models/api_response_stock_exchange_stock_prices_spec.rb +54 -0
- data/spec/models/api_response_stock_exchanges_spec.rb +48 -0
- data/spec/models/api_response_stock_market_index_historical_data_spec.rb +54 -0
- data/spec/models/api_response_stock_market_indices_spec.rb +48 -0
- data/spec/models/company_filing_spec.rb +96 -0
- data/spec/models/company_news_spec.rb +72 -0
- data/spec/models/company_news_summary_spec.rb +66 -0
- data/spec/models/company_spec.rb +228 -0
- data/spec/models/company_summary_spec.rb +66 -0
- data/spec/models/data_tag_spec.rb +100 -0
- data/spec/models/data_tag_summary_spec.rb +60 -0
- data/spec/models/economic_index_spec.rb +108 -0
- data/spec/models/economic_index_summary_spec.rb +102 -0
- data/spec/models/filing_spec.rb +96 -0
- data/spec/models/filing_summary_spec.rb +90 -0
- data/spec/models/fundamental_spec.rb +94 -0
- data/spec/models/fundamental_summary_spec.rb +88 -0
- data/spec/models/historical_data_spec.rb +48 -0
- data/spec/models/reported_financial_spec.rb +48 -0
- data/spec/models/reported_tag_spec.rb +78 -0
- data/spec/models/security_screen_clause_spec.rb +58 -0
- data/spec/models/security_screen_group_spec.rb +54 -0
- data/spec/models/security_screen_result_data_spec.rb +54 -0
- data/spec/models/security_screen_result_spec.rb +48 -0
- data/spec/models/security_spec.rb +198 -0
- data/spec/models/security_summary_spec.rb +96 -0
- data/spec/models/sic_index_spec.rb +66 -0
- data/spec/models/standardized_financial_spec.rb +48 -0
- data/spec/models/stock_exchange_spec.rb +96 -0
- data/spec/models/stock_market_index_spec.rb +96 -0
- data/spec/models/stock_market_index_summary_spec.rb +90 -0
- data/spec/models/stock_price_adjustment_spec.rb +66 -0
- data/spec/models/stock_price_adjustment_summary_spec.rb +72 -0
- data/spec/models/stock_price_spec.rb +124 -0
- data/spec/models/stock_price_summary_spec.rb +118 -0
- data/spec/spec_helper.rb +111 -0
- metadata +509 -0
@@ -0,0 +1,211 @@
|
|
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
|
+
|
17
|
+
class ApiResponseStockExchangeSecurities
|
18
|
+
# The securities traded on the Stock Exchange
|
19
|
+
attr_accessor :securities
|
20
|
+
|
21
|
+
# The Stock Exchange resolved from the given identifier
|
22
|
+
attr_accessor :stock_exchange
|
23
|
+
|
24
|
+
# The token required to request the next page of the data
|
25
|
+
attr_accessor :next_page
|
26
|
+
|
27
|
+
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
29
|
+
def self.attribute_map
|
30
|
+
{
|
31
|
+
:'securities' => :'securities',
|
32
|
+
:'stock_exchange' => :'stock_exchange',
|
33
|
+
:'next_page' => :'next_page'
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
# Attribute type mapping.
|
38
|
+
def self.swagger_types
|
39
|
+
{
|
40
|
+
:'securities' => :'Array<SecuritySummary>',
|
41
|
+
:'stock_exchange' => :'StockExchange',
|
42
|
+
:'next_page' => :'String'
|
43
|
+
}
|
44
|
+
end
|
45
|
+
|
46
|
+
# Initializes the object
|
47
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
48
|
+
def initialize(attributes = {})
|
49
|
+
return unless attributes.is_a?(Hash)
|
50
|
+
|
51
|
+
# convert string to symbol for hash key
|
52
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
53
|
+
|
54
|
+
if attributes.has_key?(:'securities')
|
55
|
+
if (value = attributes[:'securities']).is_a?(Array)
|
56
|
+
self.securities = value
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
if attributes.has_key?(:'stock_exchange')
|
61
|
+
self.stock_exchange = attributes[:'stock_exchange']
|
62
|
+
end
|
63
|
+
|
64
|
+
if attributes.has_key?(:'next_page')
|
65
|
+
self.next_page = attributes[:'next_page']
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
69
|
+
|
70
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
71
|
+
# @return Array for valid properties with the reasons
|
72
|
+
def list_invalid_properties
|
73
|
+
invalid_properties = Array.new
|
74
|
+
return invalid_properties
|
75
|
+
end
|
76
|
+
|
77
|
+
# Check to see if the all the properties in the model are valid
|
78
|
+
# @return true if the model is valid
|
79
|
+
def valid?
|
80
|
+
return true
|
81
|
+
end
|
82
|
+
|
83
|
+
# Checks equality by comparing each attribute.
|
84
|
+
# @param [Object] Object to be compared
|
85
|
+
def ==(o)
|
86
|
+
return true if self.equal?(o)
|
87
|
+
self.class == o.class &&
|
88
|
+
securities == o.securities &&
|
89
|
+
stock_exchange == o.stock_exchange &&
|
90
|
+
next_page == o.next_page
|
91
|
+
end
|
92
|
+
|
93
|
+
# @see the `==` method
|
94
|
+
# @param [Object] Object to be compared
|
95
|
+
def eql?(o)
|
96
|
+
self == o
|
97
|
+
end
|
98
|
+
|
99
|
+
# Calculates hash code according to all attributes.
|
100
|
+
# @return [Fixnum] Hash code
|
101
|
+
def hash
|
102
|
+
[securities, stock_exchange, next_page].hash
|
103
|
+
end
|
104
|
+
|
105
|
+
# Builds the object from hash
|
106
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
107
|
+
# @return [Object] Returns the model itself
|
108
|
+
def build_from_hash(attributes)
|
109
|
+
return nil unless attributes.is_a?(Hash)
|
110
|
+
self.class.swagger_types.each_pair do |key, type|
|
111
|
+
if type =~ /\AArray<(.*)>/i
|
112
|
+
# check to ensure the input is an array given that the the attribute
|
113
|
+
# is documented as an array but the input is not
|
114
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
115
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
116
|
+
end
|
117
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
118
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
119
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
120
|
+
end
|
121
|
+
|
122
|
+
self
|
123
|
+
end
|
124
|
+
|
125
|
+
# Deserializes the data based on type
|
126
|
+
# @param string type Data type
|
127
|
+
# @param string value Value to be deserialized
|
128
|
+
# @return [Object] Deserialized data
|
129
|
+
def _deserialize(type, value)
|
130
|
+
case type.to_sym
|
131
|
+
when :DateTime
|
132
|
+
DateTime.parse(value)
|
133
|
+
when :Date
|
134
|
+
Date.parse(value)
|
135
|
+
when :String
|
136
|
+
value.to_s
|
137
|
+
when :Integer
|
138
|
+
value.to_i
|
139
|
+
when :Float
|
140
|
+
value.to_f
|
141
|
+
when :BOOLEAN
|
142
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
143
|
+
true
|
144
|
+
else
|
145
|
+
false
|
146
|
+
end
|
147
|
+
when :Object
|
148
|
+
# generic object (usually a Hash), return directly
|
149
|
+
value
|
150
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
151
|
+
inner_type = Regexp.last_match[:inner_type]
|
152
|
+
value.map { |v| _deserialize(inner_type, v) }
|
153
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
154
|
+
k_type = Regexp.last_match[:k_type]
|
155
|
+
v_type = Regexp.last_match[:v_type]
|
156
|
+
{}.tap do |hash|
|
157
|
+
value.each do |k, v|
|
158
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
159
|
+
end
|
160
|
+
end
|
161
|
+
else # model
|
162
|
+
temp_model = Intrinio.const_get(type).new
|
163
|
+
temp_model.build_from_hash(value)
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
# Returns the string representation of the object
|
168
|
+
# @return [String] String presentation of the object
|
169
|
+
def to_s
|
170
|
+
to_hash.to_s
|
171
|
+
end
|
172
|
+
|
173
|
+
# to_body is an alias to to_hash (backward compatibility)
|
174
|
+
# @return [Hash] Returns the object in the form of hash
|
175
|
+
def to_body
|
176
|
+
to_hash
|
177
|
+
end
|
178
|
+
|
179
|
+
# Returns the object in the form of hash
|
180
|
+
# @return [Hash] Returns the object in the form of hash
|
181
|
+
def to_hash
|
182
|
+
hash = {}
|
183
|
+
self.class.attribute_map.each_pair do |attr, param|
|
184
|
+
value = self.send(attr)
|
185
|
+
next if value.nil?
|
186
|
+
hash[param] = _to_hash(value)
|
187
|
+
end
|
188
|
+
hash
|
189
|
+
end
|
190
|
+
|
191
|
+
# Outputs non-array value in the form of hash
|
192
|
+
# For object, use to_hash. Otherwise, just return the value
|
193
|
+
# @param [Object] value Any valid value
|
194
|
+
# @return [Hash] Returns the value in the form of hash
|
195
|
+
def _to_hash(value)
|
196
|
+
if value.is_a?(Array)
|
197
|
+
value.compact.map{ |v| _to_hash(v) }
|
198
|
+
elsif value.is_a?(Hash)
|
199
|
+
{}.tap do |hash|
|
200
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
201
|
+
end
|
202
|
+
elsif value.respond_to? :to_hash
|
203
|
+
value.to_hash
|
204
|
+
else
|
205
|
+
value
|
206
|
+
end
|
207
|
+
end
|
208
|
+
|
209
|
+
end
|
210
|
+
|
211
|
+
end
|
@@ -0,0 +1,211 @@
|
|
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
|
+
|
17
|
+
class ApiResponseStockExchangeStockPriceAdjustments
|
18
|
+
# The stock price adjustments for all Securities traded on the Stock Exchange on the given date
|
19
|
+
attr_accessor :stock_price_adjustments
|
20
|
+
|
21
|
+
# The Stock Exchange resolved from the given identifier
|
22
|
+
attr_accessor :stock_exchange
|
23
|
+
|
24
|
+
# The token required to request the next page of the data
|
25
|
+
attr_accessor :next_page
|
26
|
+
|
27
|
+
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
29
|
+
def self.attribute_map
|
30
|
+
{
|
31
|
+
:'stock_price_adjustments' => :'stock_price_adjustments',
|
32
|
+
:'stock_exchange' => :'stock_exchange',
|
33
|
+
:'next_page' => :'next_page'
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
# Attribute type mapping.
|
38
|
+
def self.swagger_types
|
39
|
+
{
|
40
|
+
:'stock_price_adjustments' => :'Array<StockPriceAdjustment>',
|
41
|
+
:'stock_exchange' => :'StockExchange',
|
42
|
+
:'next_page' => :'String'
|
43
|
+
}
|
44
|
+
end
|
45
|
+
|
46
|
+
# Initializes the object
|
47
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
48
|
+
def initialize(attributes = {})
|
49
|
+
return unless attributes.is_a?(Hash)
|
50
|
+
|
51
|
+
# convert string to symbol for hash key
|
52
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
53
|
+
|
54
|
+
if attributes.has_key?(:'stock_price_adjustments')
|
55
|
+
if (value = attributes[:'stock_price_adjustments']).is_a?(Array)
|
56
|
+
self.stock_price_adjustments = value
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
if attributes.has_key?(:'stock_exchange')
|
61
|
+
self.stock_exchange = attributes[:'stock_exchange']
|
62
|
+
end
|
63
|
+
|
64
|
+
if attributes.has_key?(:'next_page')
|
65
|
+
self.next_page = attributes[:'next_page']
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
69
|
+
|
70
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
71
|
+
# @return Array for valid properties with the reasons
|
72
|
+
def list_invalid_properties
|
73
|
+
invalid_properties = Array.new
|
74
|
+
return invalid_properties
|
75
|
+
end
|
76
|
+
|
77
|
+
# Check to see if the all the properties in the model are valid
|
78
|
+
# @return true if the model is valid
|
79
|
+
def valid?
|
80
|
+
return true
|
81
|
+
end
|
82
|
+
|
83
|
+
# Checks equality by comparing each attribute.
|
84
|
+
# @param [Object] Object to be compared
|
85
|
+
def ==(o)
|
86
|
+
return true if self.equal?(o)
|
87
|
+
self.class == o.class &&
|
88
|
+
stock_price_adjustments == o.stock_price_adjustments &&
|
89
|
+
stock_exchange == o.stock_exchange &&
|
90
|
+
next_page == o.next_page
|
91
|
+
end
|
92
|
+
|
93
|
+
# @see the `==` method
|
94
|
+
# @param [Object] Object to be compared
|
95
|
+
def eql?(o)
|
96
|
+
self == o
|
97
|
+
end
|
98
|
+
|
99
|
+
# Calculates hash code according to all attributes.
|
100
|
+
# @return [Fixnum] Hash code
|
101
|
+
def hash
|
102
|
+
[stock_price_adjustments, stock_exchange, next_page].hash
|
103
|
+
end
|
104
|
+
|
105
|
+
# Builds the object from hash
|
106
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
107
|
+
# @return [Object] Returns the model itself
|
108
|
+
def build_from_hash(attributes)
|
109
|
+
return nil unless attributes.is_a?(Hash)
|
110
|
+
self.class.swagger_types.each_pair do |key, type|
|
111
|
+
if type =~ /\AArray<(.*)>/i
|
112
|
+
# check to ensure the input is an array given that the the attribute
|
113
|
+
# is documented as an array but the input is not
|
114
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
115
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
116
|
+
end
|
117
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
118
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
119
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
120
|
+
end
|
121
|
+
|
122
|
+
self
|
123
|
+
end
|
124
|
+
|
125
|
+
# Deserializes the data based on type
|
126
|
+
# @param string type Data type
|
127
|
+
# @param string value Value to be deserialized
|
128
|
+
# @return [Object] Deserialized data
|
129
|
+
def _deserialize(type, value)
|
130
|
+
case type.to_sym
|
131
|
+
when :DateTime
|
132
|
+
DateTime.parse(value)
|
133
|
+
when :Date
|
134
|
+
Date.parse(value)
|
135
|
+
when :String
|
136
|
+
value.to_s
|
137
|
+
when :Integer
|
138
|
+
value.to_i
|
139
|
+
when :Float
|
140
|
+
value.to_f
|
141
|
+
when :BOOLEAN
|
142
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
143
|
+
true
|
144
|
+
else
|
145
|
+
false
|
146
|
+
end
|
147
|
+
when :Object
|
148
|
+
# generic object (usually a Hash), return directly
|
149
|
+
value
|
150
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
151
|
+
inner_type = Regexp.last_match[:inner_type]
|
152
|
+
value.map { |v| _deserialize(inner_type, v) }
|
153
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
154
|
+
k_type = Regexp.last_match[:k_type]
|
155
|
+
v_type = Regexp.last_match[:v_type]
|
156
|
+
{}.tap do |hash|
|
157
|
+
value.each do |k, v|
|
158
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
159
|
+
end
|
160
|
+
end
|
161
|
+
else # model
|
162
|
+
temp_model = Intrinio.const_get(type).new
|
163
|
+
temp_model.build_from_hash(value)
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
# Returns the string representation of the object
|
168
|
+
# @return [String] String presentation of the object
|
169
|
+
def to_s
|
170
|
+
to_hash.to_s
|
171
|
+
end
|
172
|
+
|
173
|
+
# to_body is an alias to to_hash (backward compatibility)
|
174
|
+
# @return [Hash] Returns the object in the form of hash
|
175
|
+
def to_body
|
176
|
+
to_hash
|
177
|
+
end
|
178
|
+
|
179
|
+
# Returns the object in the form of hash
|
180
|
+
# @return [Hash] Returns the object in the form of hash
|
181
|
+
def to_hash
|
182
|
+
hash = {}
|
183
|
+
self.class.attribute_map.each_pair do |attr, param|
|
184
|
+
value = self.send(attr)
|
185
|
+
next if value.nil?
|
186
|
+
hash[param] = _to_hash(value)
|
187
|
+
end
|
188
|
+
hash
|
189
|
+
end
|
190
|
+
|
191
|
+
# Outputs non-array value in the form of hash
|
192
|
+
# For object, use to_hash. Otherwise, just return the value
|
193
|
+
# @param [Object] value Any valid value
|
194
|
+
# @return [Hash] Returns the value in the form of hash
|
195
|
+
def _to_hash(value)
|
196
|
+
if value.is_a?(Array)
|
197
|
+
value.compact.map{ |v| _to_hash(v) }
|
198
|
+
elsif value.is_a?(Hash)
|
199
|
+
{}.tap do |hash|
|
200
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
201
|
+
end
|
202
|
+
elsif value.respond_to? :to_hash
|
203
|
+
value.to_hash
|
204
|
+
else
|
205
|
+
value
|
206
|
+
end
|
207
|
+
end
|
208
|
+
|
209
|
+
end
|
210
|
+
|
211
|
+
end
|
@@ -0,0 +1,211 @@
|
|
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
|
+
|
17
|
+
class ApiResponseStockExchangeStockPrices
|
18
|
+
# The stock prices for all Securities traded on the Stock Exchange on the given date
|
19
|
+
attr_accessor :stock_prices
|
20
|
+
|
21
|
+
# The Stock Exchange resolved from the given identifier
|
22
|
+
attr_accessor :stock_exchange
|
23
|
+
|
24
|
+
# The token required to request the next page of the data
|
25
|
+
attr_accessor :next_page
|
26
|
+
|
27
|
+
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
29
|
+
def self.attribute_map
|
30
|
+
{
|
31
|
+
:'stock_prices' => :'stock_prices',
|
32
|
+
:'stock_exchange' => :'stock_exchange',
|
33
|
+
:'next_page' => :'next_page'
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
# Attribute type mapping.
|
38
|
+
def self.swagger_types
|
39
|
+
{
|
40
|
+
:'stock_prices' => :'Array<StockPrice>',
|
41
|
+
:'stock_exchange' => :'StockExchange',
|
42
|
+
:'next_page' => :'String'
|
43
|
+
}
|
44
|
+
end
|
45
|
+
|
46
|
+
# Initializes the object
|
47
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
48
|
+
def initialize(attributes = {})
|
49
|
+
return unless attributes.is_a?(Hash)
|
50
|
+
|
51
|
+
# convert string to symbol for hash key
|
52
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
53
|
+
|
54
|
+
if attributes.has_key?(:'stock_prices')
|
55
|
+
if (value = attributes[:'stock_prices']).is_a?(Array)
|
56
|
+
self.stock_prices = value
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
if attributes.has_key?(:'stock_exchange')
|
61
|
+
self.stock_exchange = attributes[:'stock_exchange']
|
62
|
+
end
|
63
|
+
|
64
|
+
if attributes.has_key?(:'next_page')
|
65
|
+
self.next_page = attributes[:'next_page']
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
69
|
+
|
70
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
71
|
+
# @return Array for valid properties with the reasons
|
72
|
+
def list_invalid_properties
|
73
|
+
invalid_properties = Array.new
|
74
|
+
return invalid_properties
|
75
|
+
end
|
76
|
+
|
77
|
+
# Check to see if the all the properties in the model are valid
|
78
|
+
# @return true if the model is valid
|
79
|
+
def valid?
|
80
|
+
return true
|
81
|
+
end
|
82
|
+
|
83
|
+
# Checks equality by comparing each attribute.
|
84
|
+
# @param [Object] Object to be compared
|
85
|
+
def ==(o)
|
86
|
+
return true if self.equal?(o)
|
87
|
+
self.class == o.class &&
|
88
|
+
stock_prices == o.stock_prices &&
|
89
|
+
stock_exchange == o.stock_exchange &&
|
90
|
+
next_page == o.next_page
|
91
|
+
end
|
92
|
+
|
93
|
+
# @see the `==` method
|
94
|
+
# @param [Object] Object to be compared
|
95
|
+
def eql?(o)
|
96
|
+
self == o
|
97
|
+
end
|
98
|
+
|
99
|
+
# Calculates hash code according to all attributes.
|
100
|
+
# @return [Fixnum] Hash code
|
101
|
+
def hash
|
102
|
+
[stock_prices, stock_exchange, next_page].hash
|
103
|
+
end
|
104
|
+
|
105
|
+
# Builds the object from hash
|
106
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
107
|
+
# @return [Object] Returns the model itself
|
108
|
+
def build_from_hash(attributes)
|
109
|
+
return nil unless attributes.is_a?(Hash)
|
110
|
+
self.class.swagger_types.each_pair do |key, type|
|
111
|
+
if type =~ /\AArray<(.*)>/i
|
112
|
+
# check to ensure the input is an array given that the the attribute
|
113
|
+
# is documented as an array but the input is not
|
114
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
115
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
116
|
+
end
|
117
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
118
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
119
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
120
|
+
end
|
121
|
+
|
122
|
+
self
|
123
|
+
end
|
124
|
+
|
125
|
+
# Deserializes the data based on type
|
126
|
+
# @param string type Data type
|
127
|
+
# @param string value Value to be deserialized
|
128
|
+
# @return [Object] Deserialized data
|
129
|
+
def _deserialize(type, value)
|
130
|
+
case type.to_sym
|
131
|
+
when :DateTime
|
132
|
+
DateTime.parse(value)
|
133
|
+
when :Date
|
134
|
+
Date.parse(value)
|
135
|
+
when :String
|
136
|
+
value.to_s
|
137
|
+
when :Integer
|
138
|
+
value.to_i
|
139
|
+
when :Float
|
140
|
+
value.to_f
|
141
|
+
when :BOOLEAN
|
142
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
143
|
+
true
|
144
|
+
else
|
145
|
+
false
|
146
|
+
end
|
147
|
+
when :Object
|
148
|
+
# generic object (usually a Hash), return directly
|
149
|
+
value
|
150
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
151
|
+
inner_type = Regexp.last_match[:inner_type]
|
152
|
+
value.map { |v| _deserialize(inner_type, v) }
|
153
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
154
|
+
k_type = Regexp.last_match[:k_type]
|
155
|
+
v_type = Regexp.last_match[:v_type]
|
156
|
+
{}.tap do |hash|
|
157
|
+
value.each do |k, v|
|
158
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
159
|
+
end
|
160
|
+
end
|
161
|
+
else # model
|
162
|
+
temp_model = Intrinio.const_get(type).new
|
163
|
+
temp_model.build_from_hash(value)
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
# Returns the string representation of the object
|
168
|
+
# @return [String] String presentation of the object
|
169
|
+
def to_s
|
170
|
+
to_hash.to_s
|
171
|
+
end
|
172
|
+
|
173
|
+
# to_body is an alias to to_hash (backward compatibility)
|
174
|
+
# @return [Hash] Returns the object in the form of hash
|
175
|
+
def to_body
|
176
|
+
to_hash
|
177
|
+
end
|
178
|
+
|
179
|
+
# Returns the object in the form of hash
|
180
|
+
# @return [Hash] Returns the object in the form of hash
|
181
|
+
def to_hash
|
182
|
+
hash = {}
|
183
|
+
self.class.attribute_map.each_pair do |attr, param|
|
184
|
+
value = self.send(attr)
|
185
|
+
next if value.nil?
|
186
|
+
hash[param] = _to_hash(value)
|
187
|
+
end
|
188
|
+
hash
|
189
|
+
end
|
190
|
+
|
191
|
+
# Outputs non-array value in the form of hash
|
192
|
+
# For object, use to_hash. Otherwise, just return the value
|
193
|
+
# @param [Object] value Any valid value
|
194
|
+
# @return [Hash] Returns the value in the form of hash
|
195
|
+
def _to_hash(value)
|
196
|
+
if value.is_a?(Array)
|
197
|
+
value.compact.map{ |v| _to_hash(v) }
|
198
|
+
elsif value.is_a?(Hash)
|
199
|
+
{}.tap do |hash|
|
200
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
201
|
+
end
|
202
|
+
elsif value.respond_to? :to_hash
|
203
|
+
value.to_hash
|
204
|
+
else
|
205
|
+
value
|
206
|
+
end
|
207
|
+
end
|
208
|
+
|
209
|
+
end
|
210
|
+
|
211
|
+
end
|