hydrogen-proton-api 1.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,382 @@
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 WConfig
17
+ attr_accessor :w_min_minor
18
+
19
+ attr_accessor :w_min_major
20
+
21
+ attr_accessor :cash_amount
22
+
23
+ attr_accessor :w_max_major
24
+
25
+ attr_accessor :w_max_minor
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'w_min_minor' => :'w_min_minor',
31
+ :'w_min_major' => :'w_min_major',
32
+ :'cash_amount' => :'cash_amount',
33
+ :'w_max_major' => :'w_max_major',
34
+ :'w_max_minor' => :'w_max_minor'
35
+ }
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.swagger_types
40
+ {
41
+ :'w_min_minor' => :'Float',
42
+ :'w_min_major' => :'Float',
43
+ :'cash_amount' => :'Float',
44
+ :'w_max_major' => :'Float',
45
+ :'w_max_minor' => :'Float'
46
+ }
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ return unless attributes.is_a?(Hash)
53
+
54
+ # convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
56
+
57
+ if attributes.has_key?(:'w_min_minor')
58
+ self.w_min_minor = attributes[:'w_min_minor']
59
+ end
60
+
61
+ if attributes.has_key?(:'w_min_major')
62
+ self.w_min_major = attributes[:'w_min_major']
63
+ end
64
+
65
+ if attributes.has_key?(:'cash_amount')
66
+ self.cash_amount = attributes[:'cash_amount']
67
+ end
68
+
69
+ if attributes.has_key?(:'w_max_major')
70
+ self.w_max_major = attributes[:'w_max_major']
71
+ end
72
+
73
+ if attributes.has_key?(:'w_max_minor')
74
+ self.w_max_minor = attributes[:'w_max_minor']
75
+ end
76
+ end
77
+
78
+ # Show invalid properties with the reasons. Usually used together with valid?
79
+ # @return Array for valid properties with the reasons
80
+ def list_invalid_properties
81
+ invalid_properties = Array.new
82
+ if @w_min_minor.nil?
83
+ invalid_properties.push('invalid value for "w_min_minor", w_min_minor cannot be nil.')
84
+ end
85
+
86
+ if @w_min_minor > 1
87
+ invalid_properties.push('invalid value for "w_min_minor", must be smaller than or equal to 1.')
88
+ end
89
+
90
+ if @w_min_minor < 0
91
+ invalid_properties.push('invalid value for "w_min_minor", must be greater than or equal to 0.')
92
+ end
93
+
94
+ if @w_min_major.nil?
95
+ invalid_properties.push('invalid value for "w_min_major", w_min_major cannot be nil.')
96
+ end
97
+
98
+ if @w_min_major > 1
99
+ invalid_properties.push('invalid value for "w_min_major", must be smaller than or equal to 1.')
100
+ end
101
+
102
+ if @w_min_major < 0
103
+ invalid_properties.push('invalid value for "w_min_major", must be greater than or equal to 0.')
104
+ end
105
+
106
+ if @cash_amount.nil?
107
+ invalid_properties.push('invalid value for "cash_amount", cash_amount cannot be nil.')
108
+ end
109
+
110
+ if @cash_amount > 1
111
+ invalid_properties.push('invalid value for "cash_amount", must be smaller than or equal to 1.')
112
+ end
113
+
114
+ if @cash_amount < 0
115
+ invalid_properties.push('invalid value for "cash_amount", must be greater than or equal to 0.')
116
+ end
117
+
118
+ if @w_max_major.nil?
119
+ invalid_properties.push('invalid value for "w_max_major", w_max_major cannot be nil.')
120
+ end
121
+
122
+ if @w_max_major > 1
123
+ invalid_properties.push('invalid value for "w_max_major", must be smaller than or equal to 1.')
124
+ end
125
+
126
+ if @w_max_major < 0
127
+ invalid_properties.push('invalid value for "w_max_major", must be greater than or equal to 0.')
128
+ end
129
+
130
+ if @w_max_minor.nil?
131
+ invalid_properties.push('invalid value for "w_max_minor", w_max_minor cannot be nil.')
132
+ end
133
+
134
+ if @w_max_minor > 1
135
+ invalid_properties.push('invalid value for "w_max_minor", must be smaller than or equal to 1.')
136
+ end
137
+
138
+ if @w_max_minor < 0
139
+ invalid_properties.push('invalid value for "w_max_minor", must be greater than or equal to 0.')
140
+ end
141
+
142
+ invalid_properties
143
+ end
144
+
145
+ # Check to see if the all the properties in the model are valid
146
+ # @return true if the model is valid
147
+ def valid?
148
+ return false if @w_min_minor.nil?
149
+ return false if @w_min_minor > 1
150
+ return false if @w_min_minor < 0
151
+ return false if @w_min_major.nil?
152
+ return false if @w_min_major > 1
153
+ return false if @w_min_major < 0
154
+ return false if @cash_amount.nil?
155
+ return false if @cash_amount > 1
156
+ return false if @cash_amount < 0
157
+ return false if @w_max_major.nil?
158
+ return false if @w_max_major > 1
159
+ return false if @w_max_major < 0
160
+ return false if @w_max_minor.nil?
161
+ return false if @w_max_minor > 1
162
+ return false if @w_max_minor < 0
163
+ true
164
+ end
165
+
166
+ # Custom attribute writer method with validation
167
+ # @param [Object] w_min_minor Value to be assigned
168
+ def w_min_minor=(w_min_minor)
169
+ if w_min_minor.nil?
170
+ fail ArgumentError, 'w_min_minor cannot be nil'
171
+ end
172
+
173
+ if w_min_minor > 1
174
+ fail ArgumentError, 'invalid value for "w_min_minor", must be smaller than or equal to 1.'
175
+ end
176
+
177
+ if w_min_minor < 0
178
+ fail ArgumentError, 'invalid value for "w_min_minor", must be greater than or equal to 0.'
179
+ end
180
+
181
+ @w_min_minor = w_min_minor
182
+ end
183
+
184
+ # Custom attribute writer method with validation
185
+ # @param [Object] w_min_major Value to be assigned
186
+ def w_min_major=(w_min_major)
187
+ if w_min_major.nil?
188
+ fail ArgumentError, 'w_min_major cannot be nil'
189
+ end
190
+
191
+ if w_min_major > 1
192
+ fail ArgumentError, 'invalid value for "w_min_major", must be smaller than or equal to 1.'
193
+ end
194
+
195
+ if w_min_major < 0
196
+ fail ArgumentError, 'invalid value for "w_min_major", must be greater than or equal to 0.'
197
+ end
198
+
199
+ @w_min_major = w_min_major
200
+ end
201
+
202
+ # Custom attribute writer method with validation
203
+ # @param [Object] cash_amount Value to be assigned
204
+ def cash_amount=(cash_amount)
205
+ if cash_amount.nil?
206
+ fail ArgumentError, 'cash_amount cannot be nil'
207
+ end
208
+
209
+ if cash_amount > 1
210
+ fail ArgumentError, 'invalid value for "cash_amount", must be smaller than or equal to 1.'
211
+ end
212
+
213
+ if cash_amount < 0
214
+ fail ArgumentError, 'invalid value for "cash_amount", must be greater than or equal to 0.'
215
+ end
216
+
217
+ @cash_amount = cash_amount
218
+ end
219
+
220
+ # Custom attribute writer method with validation
221
+ # @param [Object] w_max_major Value to be assigned
222
+ def w_max_major=(w_max_major)
223
+ if w_max_major.nil?
224
+ fail ArgumentError, 'w_max_major cannot be nil'
225
+ end
226
+
227
+ if w_max_major > 1
228
+ fail ArgumentError, 'invalid value for "w_max_major", must be smaller than or equal to 1.'
229
+ end
230
+
231
+ if w_max_major < 0
232
+ fail ArgumentError, 'invalid value for "w_max_major", must be greater than or equal to 0.'
233
+ end
234
+
235
+ @w_max_major = w_max_major
236
+ end
237
+
238
+ # Custom attribute writer method with validation
239
+ # @param [Object] w_max_minor Value to be assigned
240
+ def w_max_minor=(w_max_minor)
241
+ if w_max_minor.nil?
242
+ fail ArgumentError, 'w_max_minor cannot be nil'
243
+ end
244
+
245
+ if w_max_minor > 1
246
+ fail ArgumentError, 'invalid value for "w_max_minor", must be smaller than or equal to 1.'
247
+ end
248
+
249
+ if w_max_minor < 0
250
+ fail ArgumentError, 'invalid value for "w_max_minor", must be greater than or equal to 0.'
251
+ end
252
+
253
+ @w_max_minor = w_max_minor
254
+ end
255
+
256
+ # Checks equality by comparing each attribute.
257
+ # @param [Object] Object to be compared
258
+ def ==(o)
259
+ return true if self.equal?(o)
260
+ self.class == o.class &&
261
+ w_min_minor == o.w_min_minor &&
262
+ w_min_major == o.w_min_major &&
263
+ cash_amount == o.cash_amount &&
264
+ w_max_major == o.w_max_major &&
265
+ w_max_minor == o.w_max_minor
266
+ end
267
+
268
+ # @see the `==` method
269
+ # @param [Object] Object to be compared
270
+ def eql?(o)
271
+ self == o
272
+ end
273
+
274
+ # Calculates hash code according to all attributes.
275
+ # @return [Fixnum] Hash code
276
+ def hash
277
+ [w_min_minor, w_min_major, cash_amount, w_max_major, w_max_minor].hash
278
+ end
279
+
280
+ # Builds the object from hash
281
+ # @param [Hash] attributes Model attributes in the form of hash
282
+ # @return [Object] Returns the model itself
283
+ def build_from_hash(attributes)
284
+ return nil unless attributes.is_a?(Hash)
285
+ self.class.swagger_types.each_pair do |key, type|
286
+ if type =~ /\AArray<(.*)>/i
287
+ # check to ensure the input is an array given that the attribute
288
+ # is documented as an array but the input is not
289
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
290
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
291
+ end
292
+ elsif !attributes[self.class.attribute_map[key]].nil?
293
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
294
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
295
+ end
296
+
297
+ self
298
+ end
299
+ # Deserializes the data based on type
300
+ # @param string type Data type
301
+ # @param string value Value to be deserialized
302
+ # @return [Object] Deserialized data
303
+ def _deserialize(type, value)
304
+ case type.to_sym
305
+ when :DateTime
306
+ value
307
+ when :Date
308
+ value
309
+ when :String
310
+ value.to_s
311
+ when :Integer
312
+ value.to_i
313
+ when :Float
314
+ value.to_f
315
+ when :BOOLEAN
316
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
317
+ true
318
+ else
319
+ false
320
+ end
321
+ when :Object
322
+ # generic object (usually a Hash), return directly
323
+ value
324
+ when /\AArray<(?<inner_type>.+)>\z/
325
+ inner_type = Regexp.last_match[:inner_type]
326
+ value.map { |v| _deserialize(inner_type, v) }
327
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
328
+ k_type = Regexp.last_match[:k_type]
329
+ v_type = Regexp.last_match[:v_type]
330
+ {}.tap do |hash|
331
+ value.each do |k, v|
332
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
333
+ end
334
+ end
335
+ else # model
336
+ temp_model = ProtonApi.const_get(type).new
337
+ temp_model.build_from_hash(value)
338
+ end
339
+ end
340
+ # Returns the string representation of the object
341
+ # @return [String] String presentation of the object
342
+ def to_s
343
+ to_hash.to_s
344
+ end
345
+
346
+ # to_body is an alias to to_hash (backward compatibility)
347
+ # @return [Hash] Returns the object in the form of hash
348
+ def to_body
349
+ to_hash
350
+ end
351
+
352
+ # Returns the object in the form of hash
353
+ # @return [Hash] Returns the object in the form of hash
354
+ def to_hash
355
+ hash = {}
356
+ self.class.attribute_map.each_pair do |attr, param|
357
+ value = self.send(attr)
358
+ next if value.nil?
359
+ hash[param] = _to_hash(value)
360
+ end
361
+ hash
362
+ end
363
+ # Outputs non-array value in the form of hash
364
+ # For object, use to_hash. Otherwise, just return the value
365
+ # @param [Object] value Any valid value
366
+ # @return [Hash] Returns the value in the form of hash
367
+ def _to_hash(value)
368
+ if value.is_a?(Array)
369
+ value.compact.map { |v| _to_hash(v) }
370
+ elsif value.is_a?(Hash)
371
+ {}.tap do |hash|
372
+ value.each { |k, v| hash[k] = _to_hash(v) }
373
+ end
374
+ elsif value.respond_to? :to_hash
375
+ value.to_hash
376
+ else
377
+ value
378
+ end
379
+ end
380
+
381
+ end
382
+ end
@@ -0,0 +1,347 @@
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 WConfig1
17
+ attr_accessor :w_min_minor
18
+
19
+ attr_accessor :w_min_major
20
+
21
+ attr_accessor :cash_amount
22
+
23
+ attr_accessor :w_max_major
24
+
25
+ attr_accessor :w_max_minor
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'w_min_minor' => :'w_min_minor',
31
+ :'w_min_major' => :'w_min_major',
32
+ :'cash_amount' => :'cash_amount',
33
+ :'w_max_major' => :'w_max_major',
34
+ :'w_max_minor' => :'w_max_minor'
35
+ }
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.swagger_types
40
+ {
41
+ :'w_min_minor' => :'Float',
42
+ :'w_min_major' => :'Float',
43
+ :'cash_amount' => :'Float',
44
+ :'w_max_major' => :'Float',
45
+ :'w_max_minor' => :'Float'
46
+ }
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ return unless attributes.is_a?(Hash)
53
+
54
+ # convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
56
+
57
+ if attributes.has_key?(:'w_min_minor')
58
+ self.w_min_minor = attributes[:'w_min_minor']
59
+ else
60
+ self.w_min_minor = 0.05
61
+ end
62
+
63
+ if attributes.has_key?(:'w_min_major')
64
+ self.w_min_major = attributes[:'w_min_major']
65
+ else
66
+ self.w_min_major = 0.05
67
+ end
68
+
69
+ if attributes.has_key?(:'cash_amount')
70
+ self.cash_amount = attributes[:'cash_amount']
71
+ else
72
+ self.cash_amount = 0.0
73
+ end
74
+
75
+ if attributes.has_key?(:'w_max_major')
76
+ self.w_max_major = attributes[:'w_max_major']
77
+ else
78
+ self.w_max_major = 1.0
79
+ end
80
+
81
+ if attributes.has_key?(:'w_max_minor')
82
+ self.w_max_minor = attributes[:'w_max_minor']
83
+ else
84
+ self.w_max_minor = 1.0
85
+ end
86
+ end
87
+
88
+ # Show invalid properties with the reasons. Usually used together with valid?
89
+ # @return Array for valid properties with the reasons
90
+ def list_invalid_properties
91
+ invalid_properties = Array.new
92
+ if !@w_min_minor.nil? && @w_min_minor > 1
93
+ invalid_properties.push('invalid value for "w_min_minor", must be smaller than or equal to 1.')
94
+ end
95
+
96
+ if !@w_min_minor.nil? && @w_min_minor < 0
97
+ invalid_properties.push('invalid value for "w_min_minor", must be greater than or equal to 0.')
98
+ end
99
+
100
+ if !@w_min_major.nil? && @w_min_major > 1
101
+ invalid_properties.push('invalid value for "w_min_major", must be smaller than or equal to 1.')
102
+ end
103
+
104
+ if !@w_min_major.nil? && @w_min_major < 0
105
+ invalid_properties.push('invalid value for "w_min_major", must be greater than or equal to 0.')
106
+ end
107
+
108
+ if !@cash_amount.nil? && @cash_amount > 1
109
+ invalid_properties.push('invalid value for "cash_amount", must be smaller than or equal to 1.')
110
+ end
111
+
112
+ if !@cash_amount.nil? && @cash_amount < 0
113
+ invalid_properties.push('invalid value for "cash_amount", must be greater than or equal to 0.')
114
+ end
115
+
116
+ if !@w_max_major.nil? && @w_max_major > 1
117
+ invalid_properties.push('invalid value for "w_max_major", must be smaller than or equal to 1.')
118
+ end
119
+
120
+ if !@w_max_major.nil? && @w_max_major < 0
121
+ invalid_properties.push('invalid value for "w_max_major", must be greater than or equal to 0.')
122
+ end
123
+
124
+ if !@w_max_minor.nil? && @w_max_minor > 1
125
+ invalid_properties.push('invalid value for "w_max_minor", must be smaller than or equal to 1.')
126
+ end
127
+
128
+ if !@w_max_minor.nil? && @w_max_minor < 0
129
+ invalid_properties.push('invalid value for "w_max_minor", must be greater than or equal to 0.')
130
+ end
131
+
132
+ invalid_properties
133
+ end
134
+
135
+ # Check to see if the all the properties in the model are valid
136
+ # @return true if the model is valid
137
+ def valid?
138
+ return false if !@w_min_minor.nil? && @w_min_minor > 1
139
+ return false if !@w_min_minor.nil? && @w_min_minor < 0
140
+ return false if !@w_min_major.nil? && @w_min_major > 1
141
+ return false if !@w_min_major.nil? && @w_min_major < 0
142
+ return false if !@cash_amount.nil? && @cash_amount > 1
143
+ return false if !@cash_amount.nil? && @cash_amount < 0
144
+ return false if !@w_max_major.nil? && @w_max_major > 1
145
+ return false if !@w_max_major.nil? && @w_max_major < 0
146
+ return false if !@w_max_minor.nil? && @w_max_minor > 1
147
+ return false if !@w_max_minor.nil? && @w_max_minor < 0
148
+ true
149
+ end
150
+
151
+ # Custom attribute writer method with validation
152
+ # @param [Object] w_min_minor Value to be assigned
153
+ def w_min_minor=(w_min_minor)
154
+ if !w_min_minor.nil? && w_min_minor > 1
155
+ fail ArgumentError, 'invalid value for "w_min_minor", must be smaller than or equal to 1.'
156
+ end
157
+
158
+ if !w_min_minor.nil? && w_min_minor < 0
159
+ fail ArgumentError, 'invalid value for "w_min_minor", must be greater than or equal to 0.'
160
+ end
161
+
162
+ @w_min_minor = w_min_minor
163
+ end
164
+
165
+ # Custom attribute writer method with validation
166
+ # @param [Object] w_min_major Value to be assigned
167
+ def w_min_major=(w_min_major)
168
+ if !w_min_major.nil? && w_min_major > 1
169
+ fail ArgumentError, 'invalid value for "w_min_major", must be smaller than or equal to 1.'
170
+ end
171
+
172
+ if !w_min_major.nil? && w_min_major < 0
173
+ fail ArgumentError, 'invalid value for "w_min_major", must be greater than or equal to 0.'
174
+ end
175
+
176
+ @w_min_major = w_min_major
177
+ end
178
+
179
+ # Custom attribute writer method with validation
180
+ # @param [Object] cash_amount Value to be assigned
181
+ def cash_amount=(cash_amount)
182
+ if !cash_amount.nil? && cash_amount > 1
183
+ fail ArgumentError, 'invalid value for "cash_amount", must be smaller than or equal to 1.'
184
+ end
185
+
186
+ if !cash_amount.nil? && cash_amount < 0
187
+ fail ArgumentError, 'invalid value for "cash_amount", must be greater than or equal to 0.'
188
+ end
189
+
190
+ @cash_amount = cash_amount
191
+ end
192
+
193
+ # Custom attribute writer method with validation
194
+ # @param [Object] w_max_major Value to be assigned
195
+ def w_max_major=(w_max_major)
196
+ if !w_max_major.nil? && w_max_major > 1
197
+ fail ArgumentError, 'invalid value for "w_max_major", must be smaller than or equal to 1.'
198
+ end
199
+
200
+ if !w_max_major.nil? && w_max_major < 0
201
+ fail ArgumentError, 'invalid value for "w_max_major", must be greater than or equal to 0.'
202
+ end
203
+
204
+ @w_max_major = w_max_major
205
+ end
206
+
207
+ # Custom attribute writer method with validation
208
+ # @param [Object] w_max_minor Value to be assigned
209
+ def w_max_minor=(w_max_minor)
210
+ if !w_max_minor.nil? && w_max_minor > 1
211
+ fail ArgumentError, 'invalid value for "w_max_minor", must be smaller than or equal to 1.'
212
+ end
213
+
214
+ if !w_max_minor.nil? && w_max_minor < 0
215
+ fail ArgumentError, 'invalid value for "w_max_minor", must be greater than or equal to 0.'
216
+ end
217
+
218
+ @w_max_minor = w_max_minor
219
+ end
220
+
221
+ # Checks equality by comparing each attribute.
222
+ # @param [Object] Object to be compared
223
+ def ==(o)
224
+ return true if self.equal?(o)
225
+ self.class == o.class &&
226
+ w_min_minor == o.w_min_minor &&
227
+ w_min_major == o.w_min_major &&
228
+ cash_amount == o.cash_amount &&
229
+ w_max_major == o.w_max_major &&
230
+ w_max_minor == o.w_max_minor
231
+ end
232
+
233
+ # @see the `==` method
234
+ # @param [Object] Object to be compared
235
+ def eql?(o)
236
+ self == o
237
+ end
238
+
239
+ # Calculates hash code according to all attributes.
240
+ # @return [Fixnum] Hash code
241
+ def hash
242
+ [w_min_minor, w_min_major, cash_amount, w_max_major, w_max_minor].hash
243
+ end
244
+
245
+ # Builds the object from hash
246
+ # @param [Hash] attributes Model attributes in the form of hash
247
+ # @return [Object] Returns the model itself
248
+ def build_from_hash(attributes)
249
+ return nil unless attributes.is_a?(Hash)
250
+ self.class.swagger_types.each_pair do |key, type|
251
+ if type =~ /\AArray<(.*)>/i
252
+ # check to ensure the input is an array given that the attribute
253
+ # is documented as an array but the input is not
254
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
255
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
256
+ end
257
+ elsif !attributes[self.class.attribute_map[key]].nil?
258
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
259
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
260
+ end
261
+
262
+ self
263
+ end
264
+ # Deserializes the data based on type
265
+ # @param string type Data type
266
+ # @param string value Value to be deserialized
267
+ # @return [Object] Deserialized data
268
+ def _deserialize(type, value)
269
+ case type.to_sym
270
+ when :DateTime
271
+ value
272
+ when :Date
273
+ value
274
+ when :String
275
+ value.to_s
276
+ when :Integer
277
+ value.to_i
278
+ when :Float
279
+ value.to_f
280
+ when :BOOLEAN
281
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
282
+ true
283
+ else
284
+ false
285
+ end
286
+ when :Object
287
+ # generic object (usually a Hash), return directly
288
+ value
289
+ when /\AArray<(?<inner_type>.+)>\z/
290
+ inner_type = Regexp.last_match[:inner_type]
291
+ value.map { |v| _deserialize(inner_type, v) }
292
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
293
+ k_type = Regexp.last_match[:k_type]
294
+ v_type = Regexp.last_match[:v_type]
295
+ {}.tap do |hash|
296
+ value.each do |k, v|
297
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
298
+ end
299
+ end
300
+ else # model
301
+ temp_model = ProtonApi.const_get(type).new
302
+ temp_model.build_from_hash(value)
303
+ end
304
+ end
305
+ # Returns the string representation of the object
306
+ # @return [String] String presentation of the object
307
+ def to_s
308
+ to_hash.to_s
309
+ end
310
+
311
+ # to_body is an alias to to_hash (backward compatibility)
312
+ # @return [Hash] Returns the object in the form of hash
313
+ def to_body
314
+ to_hash
315
+ end
316
+
317
+ # Returns the object in the form of hash
318
+ # @return [Hash] Returns the object in the form of hash
319
+ def to_hash
320
+ hash = {}
321
+ self.class.attribute_map.each_pair do |attr, param|
322
+ value = self.send(attr)
323
+ next if value.nil?
324
+ hash[param] = _to_hash(value)
325
+ end
326
+ hash
327
+ end
328
+ # Outputs non-array value in the form of hash
329
+ # For object, use to_hash. Otherwise, just return the value
330
+ # @param [Object] value Any valid value
331
+ # @return [Hash] Returns the value in the form of hash
332
+ def _to_hash(value)
333
+ if value.is_a?(Array)
334
+ value.compact.map { |v| _to_hash(v) }
335
+ elsif value.is_a?(Hash)
336
+ {}.tap do |hash|
337
+ value.each { |k, v| hash[k] = _to_hash(v) }
338
+ end
339
+ elsif value.respond_to? :to_hash
340
+ value.to_hash
341
+ else
342
+ value
343
+ end
344
+ end
345
+
346
+ end
347
+ end