hydrogen-proton-api 1.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (217) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/README.md +82 -0
  4. data/Rakefile +8 -0
  5. data/git_push.sh +55 -0
  6. data/lib/proton_api.rb +141 -0
  7. data/lib/proton_api/api/annuities_api.rb +347 -0
  8. data/lib/proton_api/api/business_financial_management_api.rb +293 -0
  9. data/lib/proton_api/api/cards_api.rb +185 -0
  10. data/lib/proton_api/api/financial_health_api.rb +239 -0
  11. data/lib/proton_api/api/financial_planning_api.rb +671 -0
  12. data/lib/proton_api/api/goals_api.rb +347 -0
  13. data/lib/proton_api/api/life_insurance_api.rb +77 -0
  14. data/lib/proton_api/api/personal_financial_management_api.rb +347 -0
  15. data/lib/proton_api/api/portfolio_construction_api.rb +77 -0
  16. data/lib/proton_api/api/portfolio_management_api.rb +77 -0
  17. data/lib/proton_api/api/risk_scoring_api.rb +185 -0
  18. data/lib/proton_api/api/simulations_api.rb +401 -0
  19. data/lib/proton_api/api/util_api.rb +185 -0
  20. data/lib/proton_api/api_client.rb +391 -0
  21. data/lib/proton_api/api_error.rb +38 -0
  22. data/lib/proton_api/auth_configuration.rb +181 -0
  23. data/lib/proton_api/configuration.rb +209 -0
  24. data/lib/proton_api/environment.rb +36 -0
  25. data/lib/proton_api/models/accumulation_goal_deposit_config.rb +338 -0
  26. data/lib/proton_api/models/annuity_calculator_accumulation_horizon_request.rb +459 -0
  27. data/lib/proton_api/models/annuity_calculator_annuity_amount_request.rb +461 -0
  28. data/lib/proton_api/models/annuity_calculator_decumulation_horizon_request.rb +459 -0
  29. data/lib/proton_api/models/annuity_calculator_deposit_amount_request.rb +468 -0
  30. data/lib/proton_api/models/annuity_calculator_initial_balance_request.rb +468 -0
  31. data/lib/proton_api/models/annuity_deposit_schedule.rb +254 -0
  32. data/lib/proton_api/models/answer.rb +186 -0
  33. data/lib/proton_api/models/backtest_request.rb +295 -0
  34. data/lib/proton_api/models/beneficiary_bequest_config.rb +257 -0
  35. data/lib/proton_api/models/budget_aggregation_account.rb +186 -0
  36. data/lib/proton_api/models/budget_calculator_request.rb +334 -0
  37. data/lib/proton_api/models/budget_component.rb +228 -0
  38. data/lib/proton_api/models/budget_details.rb +337 -0
  39. data/lib/proton_api/models/business_financial_health_check_request.rb +484 -0
  40. data/lib/proton_api/models/business_invoice_analysis_request.rb +361 -0
  41. data/lib/proton_api/models/calculator_deposit_schedule.rb +228 -0
  42. data/lib/proton_api/models/calculator_deposit_schedule1.rb +254 -0
  43. data/lib/proton_api/models/card_analysis_request.rb +372 -0
  44. data/lib/proton_api/models/card_limit_check_request.rb +231 -0
  45. data/lib/proton_api/models/card_transaction_authorization_request.rb +422 -0
  46. data/lib/proton_api/models/cash_analysis_request.rb +340 -0
  47. data/lib/proton_api/models/cash_flow_analysis_request.rb +366 -0
  48. data/lib/proton_api/models/children_education_config.rb +221 -0
  49. data/lib/proton_api/models/customer_analysis_request.rb +292 -0
  50. data/lib/proton_api/models/decision_tree_result_request.rb +236 -0
  51. data/lib/proton_api/models/decumulation_goal_deposit_config.rb +335 -0
  52. data/lib/proton_api/models/dimensional_risk_score_request.rb +282 -0
  53. data/lib/proton_api/models/diversification_score_request.rb +324 -0
  54. data/lib/proton_api/models/education_calculator_annual_cost_request.rb +450 -0
  55. data/lib/proton_api/models/education_calculator_deposit_amount_request.rb +483 -0
  56. data/lib/proton_api/models/education_calculator_percent_covered_request.rb +448 -0
  57. data/lib/proton_api/models/education_config.rb +271 -0
  58. data/lib/proton_api/models/emergency_fund_calculator_request.rb +561 -0
  59. data/lib/proton_api/models/event_study_request.rb +317 -0
  60. data/lib/proton_api/models/fee_analysis_request.rb +239 -0
  61. data/lib/proton_api/models/financial_health_check_request.rb +384 -0
  62. data/lib/proton_api/models/financial_picture_request.rb +270 -0
  63. data/lib/proton_api/models/financial_statement_analysis_request.rb +461 -0
  64. data/lib/proton_api/models/goal_accumulation_allocation_request.rb +729 -0
  65. data/lib/proton_api/models/goal_accumulation_recommendation_request.rb +622 -0
  66. data/lib/proton_api/models/goal_accumulation_status_request.rb +622 -0
  67. data/lib/proton_api/models/goal_config.rb +222 -0
  68. data/lib/proton_api/models/goal_decumulation_allocation_request.rb +764 -0
  69. data/lib/proton_api/models/goal_decumulation_recommendation_request.rb +657 -0
  70. data/lib/proton_api/models/goal_decumulation_status_request.rb +657 -0
  71. data/lib/proton_api/models/goal_withdrawal_config.rb +335 -0
  72. data/lib/proton_api/models/guaranteed_rate_benefit.rb +272 -0
  73. data/lib/proton_api/models/income_config.rb +266 -0
  74. data/lib/proton_api/models/life_insurance_needs_calculator_request.rb +515 -0
  75. data/lib/proton_api/models/location.rb +183 -0
  76. data/lib/proton_api/models/monte_carlo_request.rb +504 -0
  77. data/lib/proton_api/models/mortgage_calculator_down_payment_request.rb +299 -0
  78. data/lib/proton_api/models/mortgage_calculator_home_price_request.rb +299 -0
  79. data/lib/proton_api/models/mortgage_calculator_periodic_payment_request.rb +299 -0
  80. data/lib/proton_api/models/mvo_request.rb +366 -0
  81. data/lib/proton_api/models/opt_config.rb +300 -0
  82. data/lib/proton_api/models/opt_config1.rb +260 -0
  83. data/lib/proton_api/models/order_rebalance_request.rb +398 -0
  84. data/lib/proton_api/models/performance_calculator_request.rb +687 -0
  85. data/lib/proton_api/models/periods.rb +220 -0
  86. data/lib/proton_api/models/portfolio_optimization_score_request.rb +356 -0
  87. data/lib/proton_api/models/portfolio_what_if_request.rb +351 -0
  88. data/lib/proton_api/models/purchase_calculator_amount_request.rb +401 -0
  89. data/lib/proton_api/models/purchase_calculator_deposit_amount_request.rb +434 -0
  90. data/lib/proton_api/models/purchase_calculator_horizon_request.rb +356 -0
  91. data/lib/proton_api/models/ratio_targets.rb +328 -0
  92. data/lib/proton_api/models/ratio_targets1.rb +328 -0
  93. data/lib/proton_api/models/rebalancing_signal_request.rb +238 -0
  94. data/lib/proton_api/models/recommendation_config.rb +357 -0
  95. data/lib/proton_api/models/recommendation_config1.rb +346 -0
  96. data/lib/proton_api/models/recurring_transaction_analysis_request.rb +400 -0
  97. data/lib/proton_api/models/retirement_calculator_deposit_amount_request.rb +509 -0
  98. data/lib/proton_api/models/retirement_calculator_expenses_request.rb +476 -0
  99. data/lib/proton_api/models/retirement_calculator_percent_covered_request.rb +474 -0
  100. data/lib/proton_api/models/risk_allocation_request.rb +316 -0
  101. data/lib/proton_api/models/risk_score_request.rb +239 -0
  102. data/lib/proton_api/models/savings_calculator_request.rb +395 -0
  103. data/lib/proton_api/models/savings_deposit_schedule.rb +276 -0
  104. data/lib/proton_api/models/scenario_analysis_request.rb +401 -0
  105. data/lib/proton_api/models/sensitivity_analysis_request.rb +399 -0
  106. data/lib/proton_api/models/sensitivity_factor.rb +278 -0
  107. data/lib/proton_api/models/settings.rb +287 -0
  108. data/lib/proton_api/models/spending_analysis_request.rb +505 -0
  109. data/lib/proton_api/models/variable_annuity_request.rb +700 -0
  110. data/lib/proton_api/models/w_config.rb +382 -0
  111. data/lib/proton_api/models/w_config1.rb +347 -0
  112. data/lib/proton_api/version.rb +15 -0
  113. data/proton_api.gemspec +46 -0
  114. data/spec/api/annuities_api_spec.rb +107 -0
  115. data/spec/api/business_financial_management_api_spec.rb +95 -0
  116. data/spec/api/cards_api_spec.rb +71 -0
  117. data/spec/api/financial_health_api_spec.rb +83 -0
  118. data/spec/api/financial_planning_api_spec.rb +179 -0
  119. data/spec/api/goals_api_spec.rb +107 -0
  120. data/spec/api/life_insurance_api_spec.rb +47 -0
  121. data/spec/api/personal_financial_management_api_spec.rb +107 -0
  122. data/spec/api/portfolio_construction_api_spec.rb +47 -0
  123. data/spec/api/portfolio_management_api_spec.rb +47 -0
  124. data/spec/api/risk_scoring_api_spec.rb +71 -0
  125. data/spec/api/simulations_api_spec.rb +119 -0
  126. data/spec/api/util_api_spec.rb +71 -0
  127. data/spec/api_client_spec.rb +243 -0
  128. data/spec/configuration_spec.rb +42 -0
  129. data/spec/models/accumulation_goal_deposit_config_spec.rb +89 -0
  130. data/spec/models/annuity_calculator_accumulation_horizon_request_spec.rb +111 -0
  131. data/spec/models/annuity_calculator_annuity_amount_request_spec.rb +111 -0
  132. data/spec/models/annuity_calculator_decumulation_horizon_request_spec.rb +111 -0
  133. data/spec/models/annuity_calculator_deposit_amount_request_spec.rb +111 -0
  134. data/spec/models/annuity_calculator_initial_balance_request_spec.rb +111 -0
  135. data/spec/models/annuity_deposit_schedule_spec.rb +57 -0
  136. data/spec/models/answer_spec.rb +41 -0
  137. data/spec/models/backtest_request_spec.rb +95 -0
  138. data/spec/models/beneficiary_bequest_config_spec.rb +53 -0
  139. data/spec/models/budget_aggregation_account_spec.rb +41 -0
  140. data/spec/models/budget_calculator_request_spec.rb +105 -0
  141. data/spec/models/budget_component_spec.rb +53 -0
  142. data/spec/models/budget_details_spec.rb +99 -0
  143. data/spec/models/business_financial_health_check_request_spec.rb +143 -0
  144. data/spec/models/business_invoice_analysis_request_spec.rb +123 -0
  145. data/spec/models/calculator_deposit_schedule1_spec.rb +57 -0
  146. data/spec/models/calculator_deposit_schedule_spec.rb +51 -0
  147. data/spec/models/card_analysis_request_spec.rb +129 -0
  148. data/spec/models/card_limit_check_request_spec.rb +65 -0
  149. data/spec/models/card_transaction_authorization_request_spec.rb +157 -0
  150. data/spec/models/cash_analysis_request_spec.rb +115 -0
  151. data/spec/models/cash_flow_analysis_request_spec.rb +135 -0
  152. data/spec/models/children_education_config_spec.rb +47 -0
  153. data/spec/models/customer_analysis_request_spec.rb +101 -0
  154. data/spec/models/decision_tree_result_request_spec.rb +51 -0
  155. data/spec/models/decumulation_goal_deposit_config_spec.rb +89 -0
  156. data/spec/models/dimensional_risk_score_request_spec.rb +89 -0
  157. data/spec/models/diversification_score_request_spec.rb +111 -0
  158. data/spec/models/education_calculator_annual_cost_request_spec.rb +101 -0
  159. data/spec/models/education_calculator_deposit_amount_request_spec.rb +107 -0
  160. data/spec/models/education_calculator_percent_covered_request_spec.rb +101 -0
  161. data/spec/models/education_config_spec.rb +53 -0
  162. data/spec/models/emergency_fund_calculator_request_spec.rb +141 -0
  163. data/spec/models/event_study_request_spec.rb +109 -0
  164. data/spec/models/fee_analysis_request_spec.rb +77 -0
  165. data/spec/models/financial_health_check_request_spec.rb +95 -0
  166. data/spec/models/financial_picture_request_spec.rb +95 -0
  167. data/spec/models/financial_statement_analysis_request_spec.rb +155 -0
  168. data/spec/models/goal_accumulation_allocation_request_spec.rb +215 -0
  169. data/spec/models/goal_accumulation_recommendation_request_spec.rb +173 -0
  170. data/spec/models/goal_accumulation_status_request_spec.rb +173 -0
  171. data/spec/models/goal_config_spec.rb +47 -0
  172. data/spec/models/goal_decumulation_allocation_request_spec.rb +221 -0
  173. data/spec/models/goal_decumulation_recommendation_request_spec.rb +179 -0
  174. data/spec/models/goal_decumulation_status_request_spec.rb +179 -0
  175. data/spec/models/goal_withdrawal_config_spec.rb +89 -0
  176. data/spec/models/guaranteed_rate_benefit_spec.rb +59 -0
  177. data/spec/models/income_config_spec.rb +53 -0
  178. data/spec/models/life_insurance_needs_calculator_request_spec.rb +125 -0
  179. data/spec/models/location_spec.rb +41 -0
  180. data/spec/models/monte_carlo_request_spec.rb +179 -0
  181. data/spec/models/mortgage_calculator_down_payment_request_spec.rb +59 -0
  182. data/spec/models/mortgage_calculator_home_price_request_spec.rb +59 -0
  183. data/spec/models/mortgage_calculator_periodic_payment_request_spec.rb +59 -0
  184. data/spec/models/mvo_request_spec.rb +113 -0
  185. data/spec/models/opt_config1_spec.rb +69 -0
  186. data/spec/models/opt_config_spec.rb +81 -0
  187. data/spec/models/order_rebalance_request_spec.rb +123 -0
  188. data/spec/models/performance_calculator_request_spec.rb +233 -0
  189. data/spec/models/periods_spec.rb +47 -0
  190. data/spec/models/portfolio_optimization_score_request_spec.rb +127 -0
  191. data/spec/models/portfolio_what_if_request_spec.rb +123 -0
  192. data/spec/models/purchase_calculator_amount_request_spec.rb +93 -0
  193. data/spec/models/purchase_calculator_deposit_amount_request_spec.rb +99 -0
  194. data/spec/models/purchase_calculator_horizon_request_spec.rb +83 -0
  195. data/spec/models/ratio_targets1_spec.rb +71 -0
  196. data/spec/models/ratio_targets_spec.rb +71 -0
  197. data/spec/models/rebalancing_signal_request_spec.rb +71 -0
  198. data/spec/models/recommendation_config1_spec.rb +77 -0
  199. data/spec/models/recommendation_config_spec.rb +83 -0
  200. data/spec/models/recurring_transaction_analysis_request_spec.rb +129 -0
  201. data/spec/models/retirement_calculator_deposit_amount_request_spec.rb +113 -0
  202. data/spec/models/retirement_calculator_expenses_request_spec.rb +107 -0
  203. data/spec/models/retirement_calculator_percent_covered_request_spec.rb +107 -0
  204. data/spec/models/risk_allocation_request_spec.rb +85 -0
  205. data/spec/models/risk_score_request_spec.rb +71 -0
  206. data/spec/models/savings_calculator_request_spec.rb +99 -0
  207. data/spec/models/savings_deposit_schedule_spec.rb +63 -0
  208. data/spec/models/scenario_analysis_request_spec.rb +133 -0
  209. data/spec/models/sensitivity_analysis_request_spec.rb +133 -0
  210. data/spec/models/sensitivity_factor_spec.rb +59 -0
  211. data/spec/models/settings_spec.rb +79 -0
  212. data/spec/models/spending_analysis_request_spec.rb +187 -0
  213. data/spec/models/variable_annuity_request_spec.rb +209 -0
  214. data/spec/models/w_config1_spec.rb +65 -0
  215. data/spec/models/w_config_spec.rb +65 -0
  216. data/spec/spec_helper.rb +111 -0
  217. metadata +561 -0
@@ -0,0 +1,257 @@
1
+ =begin
2
+ #Hydrogen Proton API
3
+
4
+ #Financial engineering module of Hydrogen Atom
5
+
6
+ OpenAPI spec version: 1.9.1
7
+ Contact: info@hydrogenplatform.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.19
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module ProtonApi
16
+ class BeneficiaryBequestConfig
17
+ attr_accessor :bequest_amount
18
+
19
+ attr_accessor :bequest_duration
20
+
21
+ attr_accessor :years_until_bequest
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'bequest_amount' => :'bequest_amount',
27
+ :'bequest_duration' => :'bequest_duration',
28
+ :'years_until_bequest' => :'years_until_bequest'
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.swagger_types
34
+ {
35
+ :'bequest_amount' => :'Float',
36
+ :'bequest_duration' => :'Integer',
37
+ :'years_until_bequest' => :'Integer'
38
+ }
39
+ end
40
+
41
+ # Initializes the object
42
+ # @param [Hash] attributes Model attributes in the form of hash
43
+ def initialize(attributes = {})
44
+ return unless attributes.is_a?(Hash)
45
+
46
+ # convert string to symbol for hash key
47
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
48
+
49
+ if attributes.has_key?(:'bequest_amount')
50
+ self.bequest_amount = attributes[:'bequest_amount']
51
+ end
52
+
53
+ if attributes.has_key?(:'bequest_duration')
54
+ self.bequest_duration = attributes[:'bequest_duration']
55
+ else
56
+ self.bequest_duration = 10
57
+ end
58
+
59
+ if attributes.has_key?(:'years_until_bequest')
60
+ self.years_until_bequest = attributes[:'years_until_bequest']
61
+ else
62
+ self.years_until_bequest = 0
63
+ end
64
+ end
65
+
66
+ # Show invalid properties with the reasons. Usually used together with valid?
67
+ # @return Array for valid properties with the reasons
68
+ def list_invalid_properties
69
+ invalid_properties = Array.new
70
+ if @bequest_amount.nil?
71
+ invalid_properties.push('invalid value for "bequest_amount", bequest_amount cannot be nil.')
72
+ end
73
+
74
+ if @bequest_amount < 0
75
+ invalid_properties.push('invalid value for "bequest_amount", must be greater than or equal to 0.')
76
+ end
77
+
78
+ if !@bequest_duration.nil? && @bequest_duration < 1
79
+ invalid_properties.push('invalid value for "bequest_duration", must be greater than or equal to 1.')
80
+ end
81
+
82
+ if !@years_until_bequest.nil? && @years_until_bequest < 0
83
+ invalid_properties.push('invalid value for "years_until_bequest", must be greater than or equal to 0.')
84
+ end
85
+
86
+ invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ return false if @bequest_amount.nil?
93
+ return false if @bequest_amount < 0
94
+ return false if !@bequest_duration.nil? && @bequest_duration < 1
95
+ return false if !@years_until_bequest.nil? && @years_until_bequest < 0
96
+ true
97
+ end
98
+
99
+ # Custom attribute writer method with validation
100
+ # @param [Object] bequest_amount Value to be assigned
101
+ def bequest_amount=(bequest_amount)
102
+ if bequest_amount.nil?
103
+ fail ArgumentError, 'bequest_amount cannot be nil'
104
+ end
105
+
106
+ if bequest_amount < 0
107
+ fail ArgumentError, 'invalid value for "bequest_amount", must be greater than or equal to 0.'
108
+ end
109
+
110
+ @bequest_amount = bequest_amount
111
+ end
112
+
113
+ # Custom attribute writer method with validation
114
+ # @param [Object] bequest_duration Value to be assigned
115
+ def bequest_duration=(bequest_duration)
116
+ if !bequest_duration.nil? && bequest_duration < 1
117
+ fail ArgumentError, 'invalid value for "bequest_duration", must be greater than or equal to 1.'
118
+ end
119
+
120
+ @bequest_duration = bequest_duration
121
+ end
122
+
123
+ # Custom attribute writer method with validation
124
+ # @param [Object] years_until_bequest Value to be assigned
125
+ def years_until_bequest=(years_until_bequest)
126
+ if !years_until_bequest.nil? && years_until_bequest < 0
127
+ fail ArgumentError, 'invalid value for "years_until_bequest", must be greater than or equal to 0.'
128
+ end
129
+
130
+ @years_until_bequest = years_until_bequest
131
+ end
132
+
133
+ # Checks equality by comparing each attribute.
134
+ # @param [Object] Object to be compared
135
+ def ==(o)
136
+ return true if self.equal?(o)
137
+ self.class == o.class &&
138
+ bequest_amount == o.bequest_amount &&
139
+ bequest_duration == o.bequest_duration &&
140
+ years_until_bequest == o.years_until_bequest
141
+ end
142
+
143
+ # @see the `==` method
144
+ # @param [Object] Object to be compared
145
+ def eql?(o)
146
+ self == o
147
+ end
148
+
149
+ # Calculates hash code according to all attributes.
150
+ # @return [Fixnum] Hash code
151
+ def hash
152
+ [bequest_amount, bequest_duration, years_until_bequest].hash
153
+ end
154
+
155
+ # Builds the object from hash
156
+ # @param [Hash] attributes Model attributes in the form of hash
157
+ # @return [Object] Returns the model itself
158
+ def build_from_hash(attributes)
159
+ return nil unless attributes.is_a?(Hash)
160
+ self.class.swagger_types.each_pair do |key, type|
161
+ if type =~ /\AArray<(.*)>/i
162
+ # check to ensure the input is an array given that the attribute
163
+ # is documented as an array but the input is not
164
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
165
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
166
+ end
167
+ elsif !attributes[self.class.attribute_map[key]].nil?
168
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
169
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
170
+ end
171
+
172
+ self
173
+ end
174
+ # Deserializes the data based on type
175
+ # @param string type Data type
176
+ # @param string value Value to be deserialized
177
+ # @return [Object] Deserialized data
178
+ def _deserialize(type, value)
179
+ case type.to_sym
180
+ when :DateTime
181
+ value
182
+ when :Date
183
+ value
184
+ when :String
185
+ value.to_s
186
+ when :Integer
187
+ value.to_i
188
+ when :Float
189
+ value.to_f
190
+ when :BOOLEAN
191
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
192
+ true
193
+ else
194
+ false
195
+ end
196
+ when :Object
197
+ # generic object (usually a Hash), return directly
198
+ value
199
+ when /\AArray<(?<inner_type>.+)>\z/
200
+ inner_type = Regexp.last_match[:inner_type]
201
+ value.map { |v| _deserialize(inner_type, v) }
202
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
203
+ k_type = Regexp.last_match[:k_type]
204
+ v_type = Regexp.last_match[:v_type]
205
+ {}.tap do |hash|
206
+ value.each do |k, v|
207
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
208
+ end
209
+ end
210
+ else # model
211
+ temp_model = ProtonApi.const_get(type).new
212
+ temp_model.build_from_hash(value)
213
+ end
214
+ end
215
+ # Returns the string representation of the object
216
+ # @return [String] String presentation of the object
217
+ def to_s
218
+ to_hash.to_s
219
+ end
220
+
221
+ # to_body is an alias to to_hash (backward compatibility)
222
+ # @return [Hash] Returns the object in the form of hash
223
+ def to_body
224
+ to_hash
225
+ end
226
+
227
+ # Returns the object in the form of hash
228
+ # @return [Hash] Returns the object in the form of hash
229
+ def to_hash
230
+ hash = {}
231
+ self.class.attribute_map.each_pair do |attr, param|
232
+ value = self.send(attr)
233
+ next if value.nil?
234
+ hash[param] = _to_hash(value)
235
+ end
236
+ hash
237
+ end
238
+ # Outputs non-array value in the form of hash
239
+ # For object, use to_hash. Otherwise, just return the value
240
+ # @param [Object] value Any valid value
241
+ # @return [Hash] Returns the value in the form of hash
242
+ def _to_hash(value)
243
+ if value.is_a?(Array)
244
+ value.compact.map { |v| _to_hash(v) }
245
+ elsif value.is_a?(Hash)
246
+ {}.tap do |hash|
247
+ value.each { |k, v| hash[k] = _to_hash(v) }
248
+ end
249
+ elsif value.respond_to? :to_hash
250
+ value.to_hash
251
+ else
252
+ value
253
+ end
254
+ end
255
+
256
+ end
257
+ end
@@ -0,0 +1,186 @@
1
+ =begin
2
+ #Hydrogen Proton API
3
+
4
+ #Financial engineering module of Hydrogen Atom
5
+
6
+ OpenAPI spec version: 1.9.1
7
+ Contact: info@hydrogenplatform.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.19
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module ProtonApi
16
+ class BudgetAggregationAccount
17
+ attr_accessor :aggregation_account_id
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+ :'aggregation_account_id' => :'aggregation_account_id'
23
+ }
24
+ end
25
+
26
+ # Attribute type mapping.
27
+ def self.swagger_types
28
+ {
29
+ :'aggregation_account_id' => :'String'
30
+ }
31
+ end
32
+
33
+ # Initializes the object
34
+ # @param [Hash] attributes Model attributes in the form of hash
35
+ def initialize(attributes = {})
36
+ return unless attributes.is_a?(Hash)
37
+
38
+ # convert string to symbol for hash key
39
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
40
+
41
+ if attributes.has_key?(:'aggregation_account_id')
42
+ self.aggregation_account_id = attributes[:'aggregation_account_id']
43
+ end
44
+ end
45
+
46
+ # Show invalid properties with the reasons. Usually used together with valid?
47
+ # @return Array for valid properties with the reasons
48
+ def list_invalid_properties
49
+ invalid_properties = Array.new
50
+ if @aggregation_account_id.nil?
51
+ invalid_properties.push('invalid value for "aggregation_account_id", aggregation_account_id cannot be nil.')
52
+ end
53
+
54
+ invalid_properties
55
+ end
56
+
57
+ # Check to see if the all the properties in the model are valid
58
+ # @return true if the model is valid
59
+ def valid?
60
+ return false if @aggregation_account_id.nil?
61
+ true
62
+ end
63
+
64
+ # Checks equality by comparing each attribute.
65
+ # @param [Object] Object to be compared
66
+ def ==(o)
67
+ return true if self.equal?(o)
68
+ self.class == o.class &&
69
+ aggregation_account_id == o.aggregation_account_id
70
+ end
71
+
72
+ # @see the `==` method
73
+ # @param [Object] Object to be compared
74
+ def eql?(o)
75
+ self == o
76
+ end
77
+
78
+ # Calculates hash code according to all attributes.
79
+ # @return [Fixnum] Hash code
80
+ def hash
81
+ [aggregation_account_id].hash
82
+ end
83
+
84
+ # Builds the object from hash
85
+ # @param [Hash] attributes Model attributes in the form of hash
86
+ # @return [Object] Returns the model itself
87
+ def build_from_hash(attributes)
88
+ return nil unless attributes.is_a?(Hash)
89
+ self.class.swagger_types.each_pair do |key, type|
90
+ if type =~ /\AArray<(.*)>/i
91
+ # check to ensure the input is an array given that the attribute
92
+ # is documented as an array but the input is not
93
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
94
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
95
+ end
96
+ elsif !attributes[self.class.attribute_map[key]].nil?
97
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
98
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
99
+ end
100
+
101
+ self
102
+ end
103
+ # Deserializes the data based on type
104
+ # @param string type Data type
105
+ # @param string value Value to be deserialized
106
+ # @return [Object] Deserialized data
107
+ def _deserialize(type, value)
108
+ case type.to_sym
109
+ when :DateTime
110
+ value
111
+ when :Date
112
+ value
113
+ when :String
114
+ value.to_s
115
+ when :Integer
116
+ value.to_i
117
+ when :Float
118
+ value.to_f
119
+ when :BOOLEAN
120
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
121
+ true
122
+ else
123
+ false
124
+ end
125
+ when :Object
126
+ # generic object (usually a Hash), return directly
127
+ value
128
+ when /\AArray<(?<inner_type>.+)>\z/
129
+ inner_type = Regexp.last_match[:inner_type]
130
+ value.map { |v| _deserialize(inner_type, v) }
131
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
132
+ k_type = Regexp.last_match[:k_type]
133
+ v_type = Regexp.last_match[:v_type]
134
+ {}.tap do |hash|
135
+ value.each do |k, v|
136
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
137
+ end
138
+ end
139
+ else # model
140
+ temp_model = ProtonApi.const_get(type).new
141
+ temp_model.build_from_hash(value)
142
+ end
143
+ end
144
+ # Returns the string representation of the object
145
+ # @return [String] String presentation of the object
146
+ def to_s
147
+ to_hash.to_s
148
+ end
149
+
150
+ # to_body is an alias to to_hash (backward compatibility)
151
+ # @return [Hash] Returns the object in the form of hash
152
+ def to_body
153
+ to_hash
154
+ end
155
+
156
+ # Returns the object in the form of hash
157
+ # @return [Hash] Returns the object in the form of hash
158
+ def to_hash
159
+ hash = {}
160
+ self.class.attribute_map.each_pair do |attr, param|
161
+ value = self.send(attr)
162
+ next if value.nil?
163
+ hash[param] = _to_hash(value)
164
+ end
165
+ hash
166
+ end
167
+ # Outputs non-array value in the form of hash
168
+ # For object, use to_hash. Otherwise, just return the value
169
+ # @param [Object] value Any valid value
170
+ # @return [Hash] Returns the value in the form of hash
171
+ def _to_hash(value)
172
+ if value.is_a?(Array)
173
+ value.compact.map { |v| _to_hash(v) }
174
+ elsif value.is_a?(Hash)
175
+ {}.tap do |hash|
176
+ value.each { |k, v| hash[k] = _to_hash(v) }
177
+ end
178
+ elsif value.respond_to? :to_hash
179
+ value.to_hash
180
+ else
181
+ value
182
+ end
183
+ end
184
+
185
+ end
186
+ end
@@ -0,0 +1,334 @@
1
+ =begin
2
+ #Hydrogen Proton API
3
+
4
+ #Financial engineering module of Hydrogen Atom
5
+
6
+ OpenAPI spec version: 1.9.1
7
+ Contact: info@hydrogenplatform.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.19
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module ProtonApi
16
+ class BudgetCalculatorRequest
17
+ attr_accessor :scope
18
+
19
+ attr_accessor :currency_conversion
20
+
21
+ attr_accessor :relative_lookback
22
+
23
+ attr_accessor :budget_id
24
+
25
+ attr_accessor :as_of_date
26
+
27
+ attr_accessor :show_average_spend
28
+
29
+ attr_accessor :lookback_periods
30
+
31
+ attr_accessor :budget_details
32
+
33
+ attr_accessor :transaction_status_scope
34
+
35
+ attr_accessor :only_cleansed
36
+
37
+ attr_accessor :show_budget_track
38
+
39
+ class EnumAttributeValidator
40
+ attr_reader :datatype
41
+ attr_reader :allowable_values
42
+
43
+ def initialize(datatype, allowable_values)
44
+ @allowable_values = allowable_values.map do |value|
45
+ case datatype.to_s
46
+ when /Integer/i
47
+ value.to_i
48
+ when /Float/i
49
+ value.to_f
50
+ else
51
+ value
52
+ end
53
+ end
54
+ end
55
+
56
+ def valid?(value)
57
+ !value || allowable_values.include?(value)
58
+ end
59
+ end
60
+
61
+ # Attribute mapping from ruby-style variable name to JSON key.
62
+ def self.attribute_map
63
+ {
64
+ :'scope' => :'scope',
65
+ :'currency_conversion' => :'currency_conversion',
66
+ :'relative_lookback' => :'relative_lookback',
67
+ :'budget_id' => :'budget_id',
68
+ :'as_of_date' => :'as_of_date',
69
+ :'show_average_spend' => :'show_average_spend',
70
+ :'lookback_periods' => :'lookback_periods',
71
+ :'budget_details' => :'budget_details',
72
+ :'transaction_status_scope' => :'transaction_status_scope',
73
+ :'only_cleansed' => :'only_cleansed',
74
+ :'show_budget_track' => :'show_budget_track'
75
+ }
76
+ end
77
+
78
+ # Attribute type mapping.
79
+ def self.swagger_types
80
+ {
81
+ :'scope' => :'String',
82
+ :'currency_conversion' => :'String',
83
+ :'relative_lookback' => :'BOOLEAN',
84
+ :'budget_id' => :'String',
85
+ :'as_of_date' => :'Date',
86
+ :'show_average_spend' => :'BOOLEAN',
87
+ :'lookback_periods' => :'Integer',
88
+ :'budget_details' => :'BudgetDetails',
89
+ :'transaction_status_scope' => :'Array<String>',
90
+ :'only_cleansed' => :'BOOLEAN',
91
+ :'show_budget_track' => :'BOOLEAN'
92
+ }
93
+ end
94
+
95
+ # Initializes the object
96
+ # @param [Hash] attributes Model attributes in the form of hash
97
+ def initialize(attributes = {})
98
+ return unless attributes.is_a?(Hash)
99
+
100
+ # convert string to symbol for hash key
101
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
102
+
103
+ if attributes.has_key?(:'scope')
104
+ self.scope = attributes[:'scope']
105
+ else
106
+ self.scope = 'all'
107
+ end
108
+
109
+ if attributes.has_key?(:'currency_conversion')
110
+ self.currency_conversion = attributes[:'currency_conversion']
111
+ end
112
+
113
+ if attributes.has_key?(:'relative_lookback')
114
+ self.relative_lookback = attributes[:'relative_lookback']
115
+ else
116
+ self.relative_lookback = true
117
+ end
118
+
119
+ if attributes.has_key?(:'budget_id')
120
+ self.budget_id = attributes[:'budget_id']
121
+ end
122
+
123
+ if attributes.has_key?(:'as_of_date')
124
+ self.as_of_date = attributes[:'as_of_date']
125
+ end
126
+
127
+ if attributes.has_key?(:'show_average_spend')
128
+ self.show_average_spend = attributes[:'show_average_spend']
129
+ else
130
+ self.show_average_spend = false
131
+ end
132
+
133
+ if attributes.has_key?(:'lookback_periods')
134
+ self.lookback_periods = attributes[:'lookback_periods']
135
+ else
136
+ self.lookback_periods = 1
137
+ end
138
+
139
+ if attributes.has_key?(:'budget_details')
140
+ self.budget_details = attributes[:'budget_details']
141
+ end
142
+
143
+ if attributes.has_key?(:'transaction_status_scope')
144
+ if (value = attributes[:'transaction_status_scope']).is_a?(Array)
145
+ self.transaction_status_scope = value
146
+ end
147
+ end
148
+
149
+ if attributes.has_key?(:'only_cleansed')
150
+ self.only_cleansed = attributes[:'only_cleansed']
151
+ else
152
+ self.only_cleansed = false
153
+ end
154
+
155
+ if attributes.has_key?(:'show_budget_track')
156
+ self.show_budget_track = attributes[:'show_budget_track']
157
+ else
158
+ self.show_budget_track = true
159
+ end
160
+ end
161
+
162
+ # Show invalid properties with the reasons. Usually used together with valid?
163
+ # @return Array for valid properties with the reasons
164
+ def list_invalid_properties
165
+ invalid_properties = Array.new
166
+ if !@lookback_periods.nil? && @lookback_periods < 1
167
+ invalid_properties.push('invalid value for "lookback_periods", must be greater than or equal to 1.')
168
+ end
169
+
170
+ invalid_properties
171
+ end
172
+
173
+ # Check to see if the all the properties in the model are valid
174
+ # @return true if the model is valid
175
+ def valid?
176
+ scope_validator = EnumAttributeValidator.new('String', ['all', 'external', 'internal'])
177
+ return false unless scope_validator.valid?(@scope)
178
+ return false if !@lookback_periods.nil? && @lookback_periods < 1
179
+ true
180
+ end
181
+
182
+ # Custom attribute writer method checking allowed values (enum).
183
+ # @param [Object] scope Object to be assigned
184
+ def scope=(scope)
185
+ validator = EnumAttributeValidator.new('String', ['all', 'external', 'internal'])
186
+ unless validator.valid?(scope)
187
+ fail ArgumentError, 'invalid value for "scope", must be one of #{validator.allowable_values}.'
188
+ end
189
+ @scope = scope
190
+ end
191
+
192
+ # Custom attribute writer method with validation
193
+ # @param [Object] lookback_periods Value to be assigned
194
+ def lookback_periods=(lookback_periods)
195
+ if !lookback_periods.nil? && lookback_periods < 1
196
+ fail ArgumentError, 'invalid value for "lookback_periods", must be greater than or equal to 1.'
197
+ end
198
+
199
+ @lookback_periods = lookback_periods
200
+ end
201
+
202
+ # Checks equality by comparing each attribute.
203
+ # @param [Object] Object to be compared
204
+ def ==(o)
205
+ return true if self.equal?(o)
206
+ self.class == o.class &&
207
+ scope == o.scope &&
208
+ currency_conversion == o.currency_conversion &&
209
+ relative_lookback == o.relative_lookback &&
210
+ budget_id == o.budget_id &&
211
+ as_of_date == o.as_of_date &&
212
+ show_average_spend == o.show_average_spend &&
213
+ lookback_periods == o.lookback_periods &&
214
+ budget_details == o.budget_details &&
215
+ transaction_status_scope == o.transaction_status_scope &&
216
+ only_cleansed == o.only_cleansed &&
217
+ show_budget_track == o.show_budget_track
218
+ end
219
+
220
+ # @see the `==` method
221
+ # @param [Object] Object to be compared
222
+ def eql?(o)
223
+ self == o
224
+ end
225
+
226
+ # Calculates hash code according to all attributes.
227
+ # @return [Fixnum] Hash code
228
+ def hash
229
+ [scope, currency_conversion, relative_lookback, budget_id, as_of_date, show_average_spend, lookback_periods, budget_details, transaction_status_scope, only_cleansed, show_budget_track].hash
230
+ end
231
+
232
+ # Builds the object from hash
233
+ # @param [Hash] attributes Model attributes in the form of hash
234
+ # @return [Object] Returns the model itself
235
+ def build_from_hash(attributes)
236
+ return nil unless attributes.is_a?(Hash)
237
+ self.class.swagger_types.each_pair do |key, type|
238
+ if type =~ /\AArray<(.*)>/i
239
+ # check to ensure the input is an array given that the attribute
240
+ # is documented as an array but the input is not
241
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
242
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
243
+ end
244
+ elsif !attributes[self.class.attribute_map[key]].nil?
245
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
246
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
247
+ end
248
+
249
+ self
250
+ end
251
+ # Deserializes the data based on type
252
+ # @param string type Data type
253
+ # @param string value Value to be deserialized
254
+ # @return [Object] Deserialized data
255
+ def _deserialize(type, value)
256
+ case type.to_sym
257
+ when :DateTime
258
+ value
259
+ when :Date
260
+ value
261
+ when :String
262
+ value.to_s
263
+ when :Integer
264
+ value.to_i
265
+ when :Float
266
+ value.to_f
267
+ when :BOOLEAN
268
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
269
+ true
270
+ else
271
+ false
272
+ end
273
+ when :Object
274
+ # generic object (usually a Hash), return directly
275
+ value
276
+ when /\AArray<(?<inner_type>.+)>\z/
277
+ inner_type = Regexp.last_match[:inner_type]
278
+ value.map { |v| _deserialize(inner_type, v) }
279
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
280
+ k_type = Regexp.last_match[:k_type]
281
+ v_type = Regexp.last_match[:v_type]
282
+ {}.tap do |hash|
283
+ value.each do |k, v|
284
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
285
+ end
286
+ end
287
+ else # model
288
+ temp_model = ProtonApi.const_get(type).new
289
+ temp_model.build_from_hash(value)
290
+ end
291
+ end
292
+ # Returns the string representation of the object
293
+ # @return [String] String presentation of the object
294
+ def to_s
295
+ to_hash.to_s
296
+ end
297
+
298
+ # to_body is an alias to to_hash (backward compatibility)
299
+ # @return [Hash] Returns the object in the form of hash
300
+ def to_body
301
+ to_hash
302
+ end
303
+
304
+ # Returns the object in the form of hash
305
+ # @return [Hash] Returns the object in the form of hash
306
+ def to_hash
307
+ hash = {}
308
+ self.class.attribute_map.each_pair do |attr, param|
309
+ value = self.send(attr)
310
+ next if value.nil?
311
+ hash[param] = _to_hash(value)
312
+ end
313
+ hash
314
+ end
315
+ # Outputs non-array value in the form of hash
316
+ # For object, use to_hash. Otherwise, just return the value
317
+ # @param [Object] value Any valid value
318
+ # @return [Hash] Returns the value in the form of hash
319
+ def _to_hash(value)
320
+ if value.is_a?(Array)
321
+ value.compact.map { |v| _to_hash(v) }
322
+ elsif value.is_a?(Hash)
323
+ {}.tap do |hash|
324
+ value.each { |k, v| hash[k] = _to_hash(v) }
325
+ end
326
+ elsif value.respond_to? :to_hash
327
+ value.to_hash
328
+ else
329
+ value
330
+ end
331
+ end
332
+
333
+ end
334
+ end