intrinio-sdk 2.0.0 → 2.0.1

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