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