proton_api 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/README.md +246 -0
- data/Rakefile +8 -0
- data/docs/AccumulationGoalDepositConfig.md +14 -0
- data/docs/AnnuitiesApi.md +344 -0
- data/docs/AnnuityCalculatorAccumulationHorizonRequest.md +19 -0
- data/docs/AnnuityCalculatorAnnuityAmountRequest.md +19 -0
- data/docs/AnnuityCalculatorDecumulationHorizonRequest.md +19 -0
- data/docs/AnnuityCalculatorDepositAmountRequest.md +19 -0
- data/docs/AnnuityCalculatorInitialBalanceRequest.md +19 -0
- data/docs/AnnuityDepositSchedule.md +10 -0
- data/docs/BacktestRequest.md +17 -0
- data/docs/BeneficiaryBequestConfig.md +10 -0
- data/docs/BudgetAggregationAccount.md +8 -0
- data/docs/BudgetCalculatorRequest.md +16 -0
- data/docs/BudgetComponent.md +10 -0
- data/docs/BudgetDetails.md +17 -0
- data/docs/BusinessFinancialHealthCheckRequest.md +22 -0
- data/docs/BusinessFinancialManagementApi.md +288 -0
- data/docs/BusinessInvoiceAnalysisRequest.md +20 -0
- data/docs/CalculatorDepositSchedule.md +9 -0
- data/docs/CalculatorDepositSchedule1.md +10 -0
- data/docs/CardLimitCheckRequest.md +9 -0
- data/docs/CardTransactionAuthorizationRequest.md +19 -0
- data/docs/CardsApi.md +120 -0
- data/docs/CashAnalysisRequest.md +17 -0
- data/docs/CashFlowAnalysisRequest.md +20 -0
- data/docs/ChildrenEducationConfig.md +9 -0
- data/docs/CustomerAnalysisRequest.md +17 -0
- data/docs/DecumulationGoalDepositConfig.md +14 -0
- data/docs/DimensionalRiskScoreRequest.md +16 -0
- data/docs/DiversificationScoreRequest.md +19 -0
- data/docs/EducationCalculatorAnnualCostRequest.md +18 -0
- data/docs/EducationCalculatorDepositAmountRequest.md +19 -0
- data/docs/EducationCalculatorPercentCoveredRequest.md +18 -0
- data/docs/EducationConfig.md +10 -0
- data/docs/EmergencyFundCalculatorRequest.md +24 -0
- data/docs/EventStudyRequest.md +18 -0
- data/docs/FeeAnalysisRequest.md +13 -0
- data/docs/FinancialHealthApi.md +232 -0
- data/docs/FinancialHealthCheckRequest.md +17 -0
- data/docs/FinancialPictureRequest.md +16 -0
- data/docs/FinancialPlanningApi.md +680 -0
- data/docs/FinancialStatementAnalysisRequest.md +22 -0
- data/docs/GoalAccumulationAllocationRequest.md +33 -0
- data/docs/GoalAccumulationRecommendationRequest.md +28 -0
- data/docs/GoalAccumulationStatusRequest.md +28 -0
- data/docs/GoalConfig.md +9 -0
- data/docs/GoalDecumulationAllocationRequest.md +34 -0
- data/docs/GoalDecumulationRecommendationRequest.md +29 -0
- data/docs/GoalDecumulationStatusRequest.md +29 -0
- data/docs/GoalWithdrawalConfig.md +14 -0
- data/docs/GoalsApi.md +344 -0
- data/docs/GuaranteedRateBenefit.md +11 -0
- data/docs/IncomeConfig.md +10 -0
- data/docs/LifeInsuranceApi.md +64 -0
- data/docs/LifeInsuranceNeedsCalculatorRequest.md +22 -0
- data/docs/MonteCarloRequest.md +29 -0
- data/docs/MortgageCalculatorDownPaymentRequest.md +11 -0
- data/docs/MortgageCalculatorHomePriceRequest.md +11 -0
- data/docs/MortgageCalculatorPeriodicPaymentRequest.md +11 -0
- data/docs/MvoRequest.md +18 -0
- data/docs/OptConfig.md +14 -0
- data/docs/OptConfig1.md +12 -0
- data/docs/Periods.md +9 -0
- data/docs/PersonalFinancialManagementApi.md +288 -0
- data/docs/PortfolioConstructionApi.md +64 -0
- data/docs/PortfolioManagementApi.md +64 -0
- data/docs/PortfolioOptimizationScoreRequest.md +21 -0
- data/docs/PortfolioWhatIfRequest.md +21 -0
- data/docs/PurchaseCalculatorAmountRequest.md +16 -0
- data/docs/PurchaseCalculatorDepositAmountRequest.md +17 -0
- data/docs/PurchaseCalculatorHorizonRequest.md +15 -0
- data/docs/RatioTargets.md +13 -0
- data/docs/RatioTargets1.md +13 -0
- data/docs/RebalancingSignalRequest.md +13 -0
- data/docs/RecommendationConfig.md +15 -0
- data/docs/RecommendationConfig1.md +14 -0
- data/docs/RecurringTransactionAnalysisRequest.md +19 -0
- data/docs/RetirementCalculatorDepositAmountRequest.md +20 -0
- data/docs/RetirementCalculatorExpensesRequest.md +19 -0
- data/docs/RetirementCalculatorPercentCoveredRequest.md +19 -0
- data/docs/RiskAllocationRequest.md +14 -0
- data/docs/RiskScoreRequest.md +13 -0
- data/docs/RiskScoringApi.md +176 -0
- data/docs/SavingsCalculatorRequest.md +17 -0
- data/docs/SavingsDepositSchedule.md +11 -0
- data/docs/ScenarioAnalysisRequest.md +22 -0
- data/docs/SensitivityAnalysisRequest.md +22 -0
- data/docs/SensitivityFactor.md +11 -0
- data/docs/Settings.md +13 -0
- data/docs/SimulationsApi.md +400 -0
- data/docs/VariableAnnuityRequest.md +34 -0
- data/docs/WConfig.md +12 -0
- data/docs/WConfig1.md +12 -0
- data/git_push.sh +55 -0
- data/lib/proton_api.rb +132 -0
- data/lib/proton_api/api/annuities_api.rb +347 -0
- data/lib/proton_api/api/business_financial_management_api.rb +293 -0
- data/lib/proton_api/api/cards_api.rb +131 -0
- data/lib/proton_api/api/financial_health_api.rb +239 -0
- data/lib/proton_api/api/financial_planning_api.rb +671 -0
- data/lib/proton_api/api/goals_api.rb +347 -0
- data/lib/proton_api/api/life_insurance_api.rb +77 -0
- data/lib/proton_api/api/personal_financial_management_api.rb +293 -0
- data/lib/proton_api/api/portfolio_construction_api.rb +77 -0
- data/lib/proton_api/api/portfolio_management_api.rb +77 -0
- data/lib/proton_api/api/risk_scoring_api.rb +185 -0
- data/lib/proton_api/api/simulations_api.rb +401 -0
- data/lib/proton_api/api_client.rb +391 -0
- data/lib/proton_api/api_error.rb +38 -0
- data/lib/proton_api/auth_configuration.rb +177 -0
- data/lib/proton_api/configuration.rb +209 -0
- data/lib/proton_api/models/accumulation_goal_deposit_config.rb +338 -0
- data/lib/proton_api/models/annuity_calculator_accumulation_horizon_request.rb +462 -0
- data/lib/proton_api/models/annuity_calculator_annuity_amount_request.rb +464 -0
- data/lib/proton_api/models/annuity_calculator_decumulation_horizon_request.rb +462 -0
- data/lib/proton_api/models/annuity_calculator_deposit_amount_request.rb +471 -0
- data/lib/proton_api/models/annuity_calculator_initial_balance_request.rb +471 -0
- data/lib/proton_api/models/annuity_deposit_schedule.rb +257 -0
- data/lib/proton_api/models/backtest_request.rb +298 -0
- data/lib/proton_api/models/beneficiary_bequest_config.rb +260 -0
- data/lib/proton_api/models/budget_aggregation_account.rb +189 -0
- data/lib/proton_api/models/budget_calculator_request.rb +315 -0
- data/lib/proton_api/models/budget_component.rb +231 -0
- data/lib/proton_api/models/budget_details.rb +340 -0
- data/lib/proton_api/models/business_financial_health_check_request.rb +478 -0
- data/lib/proton_api/models/business_invoice_analysis_request.rb +355 -0
- data/lib/proton_api/models/calculator_deposit_schedule.rb +231 -0
- data/lib/proton_api/models/calculator_deposit_schedule1.rb +257 -0
- data/lib/proton_api/models/card_limit_check_request.rb +203 -0
- data/lib/proton_api/models/card_transaction_authorization_request.rb +359 -0
- data/lib/proton_api/models/cash_analysis_request.rb +321 -0
- data/lib/proton_api/models/cash_flow_analysis_request.rb +338 -0
- data/lib/proton_api/models/children_education_config.rb +224 -0
- data/lib/proton_api/models/customer_analysis_request.rb +286 -0
- data/lib/proton_api/models/decumulation_goal_deposit_config.rb +338 -0
- data/lib/proton_api/models/dimensional_risk_score_request.rb +285 -0
- data/lib/proton_api/models/diversification_score_request.rb +327 -0
- data/lib/proton_api/models/education_calculator_annual_cost_request.rb +453 -0
- data/lib/proton_api/models/education_calculator_deposit_amount_request.rb +486 -0
- data/lib/proton_api/models/education_calculator_percent_covered_request.rb +451 -0
- data/lib/proton_api/models/education_config.rb +274 -0
- data/lib/proton_api/models/emergency_fund_calculator_request.rb +564 -0
- data/lib/proton_api/models/event_study_request.rb +320 -0
- data/lib/proton_api/models/fee_analysis_request.rb +231 -0
- data/lib/proton_api/models/financial_health_check_request.rb +387 -0
- data/lib/proton_api/models/financial_picture_request.rb +269 -0
- data/lib/proton_api/models/financial_statement_analysis_request.rb +455 -0
- data/lib/proton_api/models/goal_accumulation_allocation_request.rb +732 -0
- data/lib/proton_api/models/goal_accumulation_recommendation_request.rb +625 -0
- data/lib/proton_api/models/goal_accumulation_status_request.rb +625 -0
- data/lib/proton_api/models/goal_config.rb +225 -0
- data/lib/proton_api/models/goal_decumulation_allocation_request.rb +767 -0
- data/lib/proton_api/models/goal_decumulation_recommendation_request.rb +660 -0
- data/lib/proton_api/models/goal_decumulation_status_request.rb +660 -0
- data/lib/proton_api/models/goal_withdrawal_config.rb +338 -0
- data/lib/proton_api/models/guaranteed_rate_benefit.rb +275 -0
- data/lib/proton_api/models/income_config.rb +269 -0
- data/lib/proton_api/models/life_insurance_needs_calculator_request.rb +518 -0
- data/lib/proton_api/models/monte_carlo_request.rb +507 -0
- data/lib/proton_api/models/mortgage_calculator_down_payment_request.rb +302 -0
- data/lib/proton_api/models/mortgage_calculator_home_price_request.rb +302 -0
- data/lib/proton_api/models/mortgage_calculator_periodic_payment_request.rb +302 -0
- data/lib/proton_api/models/mvo_request.rb +369 -0
- data/lib/proton_api/models/opt_config.rb +303 -0
- data/lib/proton_api/models/opt_config1.rb +263 -0
- data/lib/proton_api/models/periods.rb +223 -0
- data/lib/proton_api/models/portfolio_optimization_score_request.rb +359 -0
- data/lib/proton_api/models/portfolio_what_if_request.rb +354 -0
- data/lib/proton_api/models/purchase_calculator_amount_request.rb +404 -0
- data/lib/proton_api/models/purchase_calculator_deposit_amount_request.rb +437 -0
- data/lib/proton_api/models/purchase_calculator_horizon_request.rb +359 -0
- data/lib/proton_api/models/ratio_targets.rb +331 -0
- data/lib/proton_api/models/ratio_targets1.rb +331 -0
- data/lib/proton_api/models/rebalancing_signal_request.rb +241 -0
- data/lib/proton_api/models/recommendation_config.rb +360 -0
- data/lib/proton_api/models/recommendation_config1.rb +349 -0
- data/lib/proton_api/models/recurring_transaction_analysis_request.rb +370 -0
- data/lib/proton_api/models/retirement_calculator_deposit_amount_request.rb +512 -0
- data/lib/proton_api/models/retirement_calculator_expenses_request.rb +479 -0
- data/lib/proton_api/models/retirement_calculator_percent_covered_request.rb +477 -0
- data/lib/proton_api/models/risk_allocation_request.rb +319 -0
- data/lib/proton_api/models/risk_score_request.rb +242 -0
- data/lib/proton_api/models/savings_calculator_request.rb +398 -0
- data/lib/proton_api/models/savings_deposit_schedule.rb +279 -0
- data/lib/proton_api/models/scenario_analysis_request.rb +404 -0
- data/lib/proton_api/models/sensitivity_analysis_request.rb +402 -0
- data/lib/proton_api/models/sensitivity_factor.rb +281 -0
- data/lib/proton_api/models/settings.rb +290 -0
- data/lib/proton_api/models/variable_annuity_request.rb +703 -0
- data/lib/proton_api/models/w_config.rb +385 -0
- data/lib/proton_api/models/w_config1.rb +350 -0
- data/lib/proton_api/version.rb +15 -0
- data/proton_api.gemspec +46 -0
- data/spec/api/annuities_api_spec.rb +107 -0
- data/spec/api/business_financial_management_api_spec.rb +95 -0
- data/spec/api/cards_api_spec.rb +59 -0
- data/spec/api/financial_health_api_spec.rb +83 -0
- data/spec/api/financial_planning_api_spec.rb +179 -0
- data/spec/api/goals_api_spec.rb +107 -0
- data/spec/api/life_insurance_api_spec.rb +47 -0
- data/spec/api/personal_financial_management_api_spec.rb +95 -0
- data/spec/api/portfolio_construction_api_spec.rb +47 -0
- data/spec/api/portfolio_management_api_spec.rb +47 -0
- data/spec/api/risk_scoring_api_spec.rb +71 -0
- data/spec/api/simulations_api_spec.rb +119 -0
- data/spec/api_client_spec.rb +243 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/accumulation_goal_deposit_config_spec.rb +89 -0
- data/spec/models/annuity_calculator_accumulation_horizon_request_spec.rb +111 -0
- data/spec/models/annuity_calculator_annuity_amount_request_spec.rb +111 -0
- data/spec/models/annuity_calculator_decumulation_horizon_request_spec.rb +111 -0
- data/spec/models/annuity_calculator_deposit_amount_request_spec.rb +111 -0
- data/spec/models/annuity_calculator_initial_balance_request_spec.rb +111 -0
- data/spec/models/annuity_deposit_schedule_spec.rb +57 -0
- data/spec/models/backtest_request_spec.rb +95 -0
- data/spec/models/beneficiary_bequest_config_spec.rb +53 -0
- data/spec/models/budget_aggregation_account_spec.rb +41 -0
- data/spec/models/budget_calculator_request_spec.rb +93 -0
- data/spec/models/budget_component_spec.rb +53 -0
- data/spec/models/budget_details_spec.rb +99 -0
- data/spec/models/business_financial_health_check_request_spec.rb +137 -0
- data/spec/models/business_invoice_analysis_request_spec.rb +117 -0
- data/spec/models/calculator_deposit_schedule1_spec.rb +57 -0
- data/spec/models/calculator_deposit_schedule_spec.rb +51 -0
- data/spec/models/card_limit_check_request_spec.rb +47 -0
- data/spec/models/card_transaction_authorization_request_spec.rb +115 -0
- data/spec/models/cash_analysis_request_spec.rb +103 -0
- data/spec/models/cash_flow_analysis_request_spec.rb +117 -0
- data/spec/models/children_education_config_spec.rb +47 -0
- data/spec/models/customer_analysis_request_spec.rb +95 -0
- data/spec/models/decumulation_goal_deposit_config_spec.rb +89 -0
- data/spec/models/dimensional_risk_score_request_spec.rb +89 -0
- data/spec/models/diversification_score_request_spec.rb +111 -0
- data/spec/models/education_calculator_annual_cost_request_spec.rb +101 -0
- data/spec/models/education_calculator_deposit_amount_request_spec.rb +107 -0
- data/spec/models/education_calculator_percent_covered_request_spec.rb +101 -0
- data/spec/models/education_config_spec.rb +53 -0
- data/spec/models/emergency_fund_calculator_request_spec.rb +141 -0
- data/spec/models/event_study_request_spec.rb +109 -0
- data/spec/models/fee_analysis_request_spec.rb +71 -0
- data/spec/models/financial_health_check_request_spec.rb +95 -0
- data/spec/models/financial_picture_request_spec.rb +89 -0
- data/spec/models/financial_statement_analysis_request_spec.rb +149 -0
- data/spec/models/goal_accumulation_allocation_request_spec.rb +215 -0
- data/spec/models/goal_accumulation_recommendation_request_spec.rb +173 -0
- data/spec/models/goal_accumulation_status_request_spec.rb +173 -0
- data/spec/models/goal_config_spec.rb +47 -0
- data/spec/models/goal_decumulation_allocation_request_spec.rb +221 -0
- data/spec/models/goal_decumulation_recommendation_request_spec.rb +179 -0
- data/spec/models/goal_decumulation_status_request_spec.rb +179 -0
- data/spec/models/goal_withdrawal_config_spec.rb +89 -0
- data/spec/models/guaranteed_rate_benefit_spec.rb +59 -0
- data/spec/models/income_config_spec.rb +53 -0
- data/spec/models/life_insurance_needs_calculator_request_spec.rb +125 -0
- data/spec/models/monte_carlo_request_spec.rb +179 -0
- data/spec/models/mortgage_calculator_down_payment_request_spec.rb +59 -0
- data/spec/models/mortgage_calculator_home_price_request_spec.rb +59 -0
- data/spec/models/mortgage_calculator_periodic_payment_request_spec.rb +59 -0
- data/spec/models/mvo_request_spec.rb +113 -0
- data/spec/models/opt_config1_spec.rb +69 -0
- data/spec/models/opt_config_spec.rb +81 -0
- data/spec/models/periods_spec.rb +47 -0
- data/spec/models/portfolio_optimization_score_request_spec.rb +127 -0
- data/spec/models/portfolio_what_if_request_spec.rb +123 -0
- data/spec/models/purchase_calculator_amount_request_spec.rb +93 -0
- data/spec/models/purchase_calculator_deposit_amount_request_spec.rb +99 -0
- data/spec/models/purchase_calculator_horizon_request_spec.rb +83 -0
- data/spec/models/ratio_targets1_spec.rb +71 -0
- data/spec/models/ratio_targets_spec.rb +71 -0
- data/spec/models/rebalancing_signal_request_spec.rb +71 -0
- data/spec/models/recommendation_config1_spec.rb +77 -0
- data/spec/models/recommendation_config_spec.rb +83 -0
- data/spec/models/recurring_transaction_analysis_request_spec.rb +111 -0
- data/spec/models/retirement_calculator_deposit_amount_request_spec.rb +113 -0
- data/spec/models/retirement_calculator_expenses_request_spec.rb +107 -0
- data/spec/models/retirement_calculator_percent_covered_request_spec.rb +107 -0
- data/spec/models/risk_allocation_request_spec.rb +85 -0
- data/spec/models/risk_score_request_spec.rb +71 -0
- data/spec/models/savings_calculator_request_spec.rb +99 -0
- data/spec/models/savings_deposit_schedule_spec.rb +63 -0
- data/spec/models/scenario_analysis_request_spec.rb +133 -0
- data/spec/models/sensitivity_analysis_request_spec.rb +133 -0
- data/spec/models/sensitivity_factor_spec.rb +59 -0
- data/spec/models/settings_spec.rb +79 -0
- data/spec/models/variable_annuity_request_spec.rb +209 -0
- data/spec/models/w_config1_spec.rb +65 -0
- data/spec/models/w_config_spec.rb +65 -0
- data/spec/spec_helper.rb +111 -0
- metadata +628 -0
@@ -0,0 +1,269 @@
|
|
1
|
+
=begin
|
2
|
+
#Hydrogen Proton API
|
3
|
+
|
4
|
+
#Financial engineering module of Hydrogen Atom
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.8.0
|
7
|
+
Contact: info@hydrogenplatform.com
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.17
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module ProtonApi
|
16
|
+
class IncomeConfig
|
17
|
+
attr_accessor :annual_net_take_home_pay
|
18
|
+
|
19
|
+
attr_accessor :percentage_of_income_covered
|
20
|
+
|
21
|
+
attr_accessor :income_benefit_duration
|
22
|
+
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
24
|
+
def self.attribute_map
|
25
|
+
{
|
26
|
+
:'annual_net_take_home_pay' => :'annual_net_take_home_pay',
|
27
|
+
:'percentage_of_income_covered' => :'percentage_of_income_covered',
|
28
|
+
:'income_benefit_duration' => :'income_benefit_duration'
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
# Attribute type mapping.
|
33
|
+
def self.swagger_types
|
34
|
+
{
|
35
|
+
:'annual_net_take_home_pay' => :'Float',
|
36
|
+
:'percentage_of_income_covered' => :'Float',
|
37
|
+
:'income_benefit_duration' => :'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?(:'annual_net_take_home_pay')
|
50
|
+
self.annual_net_take_home_pay = attributes[:'annual_net_take_home_pay']
|
51
|
+
end
|
52
|
+
|
53
|
+
if attributes.has_key?(:'percentage_of_income_covered')
|
54
|
+
self.percentage_of_income_covered = attributes[:'percentage_of_income_covered']
|
55
|
+
else
|
56
|
+
self.percentage_of_income_covered = 1.0
|
57
|
+
end
|
58
|
+
|
59
|
+
if attributes.has_key?(:'income_benefit_duration')
|
60
|
+
self.income_benefit_duration = attributes[:'income_benefit_duration']
|
61
|
+
else
|
62
|
+
self.income_benefit_duration = 10
|
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 @annual_net_take_home_pay.nil?
|
71
|
+
invalid_properties.push('invalid value for "annual_net_take_home_pay", annual_net_take_home_pay cannot be nil.')
|
72
|
+
end
|
73
|
+
|
74
|
+
if @annual_net_take_home_pay < 0
|
75
|
+
invalid_properties.push('invalid value for "annual_net_take_home_pay", must be greater than or equal to 0.')
|
76
|
+
end
|
77
|
+
|
78
|
+
if !@percentage_of_income_covered.nil? && @percentage_of_income_covered > 1
|
79
|
+
invalid_properties.push('invalid value for "percentage_of_income_covered", must be smaller than or equal to 1.')
|
80
|
+
end
|
81
|
+
|
82
|
+
if !@percentage_of_income_covered.nil? && @percentage_of_income_covered < 0
|
83
|
+
invalid_properties.push('invalid value for "percentage_of_income_covered", must be greater than or equal to 0.')
|
84
|
+
end
|
85
|
+
|
86
|
+
if !@income_benefit_duration.nil? && @income_benefit_duration < 1
|
87
|
+
invalid_properties.push('invalid value for "income_benefit_duration", must be greater than or equal to 1.')
|
88
|
+
end
|
89
|
+
|
90
|
+
invalid_properties
|
91
|
+
end
|
92
|
+
|
93
|
+
# Check to see if the all the properties in the model are valid
|
94
|
+
# @return true if the model is valid
|
95
|
+
def valid?
|
96
|
+
return false if @annual_net_take_home_pay.nil?
|
97
|
+
return false if @annual_net_take_home_pay < 0
|
98
|
+
return false if !@percentage_of_income_covered.nil? && @percentage_of_income_covered > 1
|
99
|
+
return false if !@percentage_of_income_covered.nil? && @percentage_of_income_covered < 0
|
100
|
+
return false if !@income_benefit_duration.nil? && @income_benefit_duration < 1
|
101
|
+
true
|
102
|
+
end
|
103
|
+
|
104
|
+
# Custom attribute writer method with validation
|
105
|
+
# @param [Object] annual_net_take_home_pay Value to be assigned
|
106
|
+
def annual_net_take_home_pay=(annual_net_take_home_pay)
|
107
|
+
if annual_net_take_home_pay.nil?
|
108
|
+
fail ArgumentError, 'annual_net_take_home_pay cannot be nil'
|
109
|
+
end
|
110
|
+
|
111
|
+
if annual_net_take_home_pay < 0
|
112
|
+
fail ArgumentError, 'invalid value for "annual_net_take_home_pay", must be greater than or equal to 0.'
|
113
|
+
end
|
114
|
+
|
115
|
+
@annual_net_take_home_pay = annual_net_take_home_pay
|
116
|
+
end
|
117
|
+
|
118
|
+
# Custom attribute writer method with validation
|
119
|
+
# @param [Object] percentage_of_income_covered Value to be assigned
|
120
|
+
def percentage_of_income_covered=(percentage_of_income_covered)
|
121
|
+
if !percentage_of_income_covered.nil? && percentage_of_income_covered > 1
|
122
|
+
fail ArgumentError, 'invalid value for "percentage_of_income_covered", must be smaller than or equal to 1.'
|
123
|
+
end
|
124
|
+
|
125
|
+
if !percentage_of_income_covered.nil? && percentage_of_income_covered < 0
|
126
|
+
fail ArgumentError, 'invalid value for "percentage_of_income_covered", must be greater than or equal to 0.'
|
127
|
+
end
|
128
|
+
|
129
|
+
@percentage_of_income_covered = percentage_of_income_covered
|
130
|
+
end
|
131
|
+
|
132
|
+
# Custom attribute writer method with validation
|
133
|
+
# @param [Object] income_benefit_duration Value to be assigned
|
134
|
+
def income_benefit_duration=(income_benefit_duration)
|
135
|
+
if !income_benefit_duration.nil? && income_benefit_duration < 1
|
136
|
+
fail ArgumentError, 'invalid value for "income_benefit_duration", must be greater than or equal to 1.'
|
137
|
+
end
|
138
|
+
|
139
|
+
@income_benefit_duration = income_benefit_duration
|
140
|
+
end
|
141
|
+
|
142
|
+
# Checks equality by comparing each attribute.
|
143
|
+
# @param [Object] Object to be compared
|
144
|
+
def ==(o)
|
145
|
+
return true if self.equal?(o)
|
146
|
+
self.class == o.class &&
|
147
|
+
annual_net_take_home_pay == o.annual_net_take_home_pay &&
|
148
|
+
percentage_of_income_covered == o.percentage_of_income_covered &&
|
149
|
+
income_benefit_duration == o.income_benefit_duration
|
150
|
+
end
|
151
|
+
|
152
|
+
# @see the `==` method
|
153
|
+
# @param [Object] Object to be compared
|
154
|
+
def eql?(o)
|
155
|
+
self == o
|
156
|
+
end
|
157
|
+
|
158
|
+
# Calculates hash code according to all attributes.
|
159
|
+
# @return [Fixnum] Hash code
|
160
|
+
def hash
|
161
|
+
[annual_net_take_home_pay, percentage_of_income_covered, income_benefit_duration].hash
|
162
|
+
end
|
163
|
+
|
164
|
+
# Builds the object from hash
|
165
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
166
|
+
# @return [Object] Returns the model itself
|
167
|
+
def build_from_hash(attributes)
|
168
|
+
return nil unless attributes.is_a?(Hash)
|
169
|
+
self.class.swagger_types.each_pair do |key, type|
|
170
|
+
if type =~ /\AArray<(.*)>/i
|
171
|
+
# check to ensure the input is an array given that the attribute
|
172
|
+
# is documented as an array but the input is not
|
173
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
174
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
175
|
+
end
|
176
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
177
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
178
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
179
|
+
end
|
180
|
+
|
181
|
+
self
|
182
|
+
end
|
183
|
+
|
184
|
+
# Deserializes the data based on type
|
185
|
+
# @param string type Data type
|
186
|
+
# @param string value Value to be deserialized
|
187
|
+
# @return [Object] Deserialized data
|
188
|
+
def _deserialize(type, value)
|
189
|
+
case type.to_sym
|
190
|
+
when :DateTime
|
191
|
+
DateTime.parse(value)
|
192
|
+
when :Date
|
193
|
+
Date.parse(value)
|
194
|
+
when :String
|
195
|
+
value.to_s
|
196
|
+
when :Integer
|
197
|
+
value.to_i
|
198
|
+
when :Float
|
199
|
+
value.to_f
|
200
|
+
when :BOOLEAN
|
201
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
202
|
+
true
|
203
|
+
else
|
204
|
+
false
|
205
|
+
end
|
206
|
+
when :Object
|
207
|
+
# generic object (usually a Hash), return directly
|
208
|
+
value
|
209
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
210
|
+
inner_type = Regexp.last_match[:inner_type]
|
211
|
+
value.map { |v| _deserialize(inner_type, v) }
|
212
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
213
|
+
k_type = Regexp.last_match[:k_type]
|
214
|
+
v_type = Regexp.last_match[:v_type]
|
215
|
+
{}.tap do |hash|
|
216
|
+
value.each do |k, v|
|
217
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
218
|
+
end
|
219
|
+
end
|
220
|
+
else # model
|
221
|
+
temp_model = ProtonApi.const_get(type).new
|
222
|
+
temp_model.build_from_hash(value)
|
223
|
+
end
|
224
|
+
end
|
225
|
+
|
226
|
+
# Returns the string representation of the object
|
227
|
+
# @return [String] String presentation of the object
|
228
|
+
def to_s
|
229
|
+
to_hash.to_s
|
230
|
+
end
|
231
|
+
|
232
|
+
# to_body is an alias to to_hash (backward compatibility)
|
233
|
+
# @return [Hash] Returns the object in the form of hash
|
234
|
+
def to_body
|
235
|
+
to_hash
|
236
|
+
end
|
237
|
+
|
238
|
+
# Returns the object in the form of hash
|
239
|
+
# @return [Hash] Returns the object in the form of hash
|
240
|
+
def to_hash
|
241
|
+
hash = {}
|
242
|
+
self.class.attribute_map.each_pair do |attr, param|
|
243
|
+
value = self.send(attr)
|
244
|
+
next if value.nil?
|
245
|
+
hash[param] = _to_hash(value)
|
246
|
+
end
|
247
|
+
hash
|
248
|
+
end
|
249
|
+
|
250
|
+
# Outputs non-array value in the form of hash
|
251
|
+
# For object, use to_hash. Otherwise, just return the value
|
252
|
+
# @param [Object] value Any valid value
|
253
|
+
# @return [Hash] Returns the value in the form of hash
|
254
|
+
def _to_hash(value)
|
255
|
+
if value.is_a?(Array)
|
256
|
+
value.compact.map { |v| _to_hash(v) }
|
257
|
+
elsif value.is_a?(Hash)
|
258
|
+
{}.tap do |hash|
|
259
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
260
|
+
end
|
261
|
+
elsif value.respond_to? :to_hash
|
262
|
+
value.to_hash
|
263
|
+
else
|
264
|
+
value
|
265
|
+
end
|
266
|
+
end
|
267
|
+
|
268
|
+
end
|
269
|
+
end
|
@@ -0,0 +1,518 @@
|
|
1
|
+
=begin
|
2
|
+
#Hydrogen Proton API
|
3
|
+
|
4
|
+
#Financial engineering module of Hydrogen Atom
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.8.0
|
7
|
+
Contact: info@hydrogenplatform.com
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.17
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module ProtonApi
|
16
|
+
class LifeInsuranceNeedsCalculatorRequest
|
17
|
+
attr_accessor :children_education_config
|
18
|
+
|
19
|
+
attr_accessor :liquid_assets
|
20
|
+
|
21
|
+
attr_accessor :other_debt
|
22
|
+
|
23
|
+
attr_accessor :client_id
|
24
|
+
|
25
|
+
attr_accessor :tax_rate
|
26
|
+
|
27
|
+
attr_accessor :end_of_life_expenses
|
28
|
+
|
29
|
+
attr_accessor :mortgage_balance
|
30
|
+
|
31
|
+
attr_accessor :income_config
|
32
|
+
|
33
|
+
attr_accessor :beneficiary_bequest_config
|
34
|
+
|
35
|
+
attr_accessor :margin_of_error
|
36
|
+
|
37
|
+
attr_accessor :education_inflation_rate
|
38
|
+
|
39
|
+
attr_accessor :interest_rate
|
40
|
+
|
41
|
+
attr_accessor :existing_life_insurance
|
42
|
+
|
43
|
+
attr_accessor :benefit_amount_rounding
|
44
|
+
|
45
|
+
attr_accessor :general_inflation_rate
|
46
|
+
|
47
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
48
|
+
def self.attribute_map
|
49
|
+
{
|
50
|
+
:'children_education_config' => :'children_education_config',
|
51
|
+
:'liquid_assets' => :'liquid_assets',
|
52
|
+
:'other_debt' => :'other_debt',
|
53
|
+
:'client_id' => :'client_id',
|
54
|
+
:'tax_rate' => :'tax_rate',
|
55
|
+
:'end_of_life_expenses' => :'end_of_life_expenses',
|
56
|
+
:'mortgage_balance' => :'mortgage_balance',
|
57
|
+
:'income_config' => :'income_config',
|
58
|
+
:'beneficiary_bequest_config' => :'beneficiary_bequest_config',
|
59
|
+
:'margin_of_error' => :'margin_of_error',
|
60
|
+
:'education_inflation_rate' => :'education_inflation_rate',
|
61
|
+
:'interest_rate' => :'interest_rate',
|
62
|
+
:'existing_life_insurance' => :'existing_life_insurance',
|
63
|
+
:'benefit_amount_rounding' => :'benefit_amount_rounding',
|
64
|
+
:'general_inflation_rate' => :'general_inflation_rate'
|
65
|
+
}
|
66
|
+
end
|
67
|
+
|
68
|
+
# Attribute type mapping.
|
69
|
+
def self.swagger_types
|
70
|
+
{
|
71
|
+
:'children_education_config' => :'Array<ChildrenEducationConfig>',
|
72
|
+
:'liquid_assets' => :'Float',
|
73
|
+
:'other_debt' => :'Float',
|
74
|
+
:'client_id' => :'String',
|
75
|
+
:'tax_rate' => :'Float',
|
76
|
+
:'end_of_life_expenses' => :'Float',
|
77
|
+
:'mortgage_balance' => :'Float',
|
78
|
+
:'income_config' => :'Array<IncomeConfig>',
|
79
|
+
:'beneficiary_bequest_config' => :'Array<BeneficiaryBequestConfig>',
|
80
|
+
:'margin_of_error' => :'Float',
|
81
|
+
:'education_inflation_rate' => :'Float',
|
82
|
+
:'interest_rate' => :'Float',
|
83
|
+
:'existing_life_insurance' => :'Float',
|
84
|
+
:'benefit_amount_rounding' => :'Integer',
|
85
|
+
:'general_inflation_rate' => :'Float'
|
86
|
+
}
|
87
|
+
end
|
88
|
+
|
89
|
+
# Initializes the object
|
90
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
91
|
+
def initialize(attributes = {})
|
92
|
+
return unless attributes.is_a?(Hash)
|
93
|
+
|
94
|
+
# convert string to symbol for hash key
|
95
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
96
|
+
|
97
|
+
if attributes.has_key?(:'children_education_config')
|
98
|
+
if (value = attributes[:'children_education_config']).is_a?(Array)
|
99
|
+
self.children_education_config = value
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
if attributes.has_key?(:'liquid_assets')
|
104
|
+
self.liquid_assets = attributes[:'liquid_assets']
|
105
|
+
end
|
106
|
+
|
107
|
+
if attributes.has_key?(:'other_debt')
|
108
|
+
self.other_debt = attributes[:'other_debt']
|
109
|
+
end
|
110
|
+
|
111
|
+
if attributes.has_key?(:'client_id')
|
112
|
+
self.client_id = attributes[:'client_id']
|
113
|
+
end
|
114
|
+
|
115
|
+
if attributes.has_key?(:'tax_rate')
|
116
|
+
self.tax_rate = attributes[:'tax_rate']
|
117
|
+
else
|
118
|
+
self.tax_rate = 0.0
|
119
|
+
end
|
120
|
+
|
121
|
+
if attributes.has_key?(:'end_of_life_expenses')
|
122
|
+
self.end_of_life_expenses = attributes[:'end_of_life_expenses']
|
123
|
+
end
|
124
|
+
|
125
|
+
if attributes.has_key?(:'mortgage_balance')
|
126
|
+
self.mortgage_balance = attributes[:'mortgage_balance']
|
127
|
+
end
|
128
|
+
|
129
|
+
if attributes.has_key?(:'income_config')
|
130
|
+
if (value = attributes[:'income_config']).is_a?(Array)
|
131
|
+
self.income_config = value
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
if attributes.has_key?(:'beneficiary_bequest_config')
|
136
|
+
if (value = attributes[:'beneficiary_bequest_config']).is_a?(Array)
|
137
|
+
self.beneficiary_bequest_config = value
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
if attributes.has_key?(:'margin_of_error')
|
142
|
+
self.margin_of_error = attributes[:'margin_of_error']
|
143
|
+
else
|
144
|
+
self.margin_of_error = 0.0
|
145
|
+
end
|
146
|
+
|
147
|
+
if attributes.has_key?(:'education_inflation_rate')
|
148
|
+
self.education_inflation_rate = attributes[:'education_inflation_rate']
|
149
|
+
else
|
150
|
+
self.education_inflation_rate = 0.0
|
151
|
+
end
|
152
|
+
|
153
|
+
if attributes.has_key?(:'interest_rate')
|
154
|
+
self.interest_rate = attributes[:'interest_rate']
|
155
|
+
end
|
156
|
+
|
157
|
+
if attributes.has_key?(:'existing_life_insurance')
|
158
|
+
self.existing_life_insurance = attributes[:'existing_life_insurance']
|
159
|
+
end
|
160
|
+
|
161
|
+
if attributes.has_key?(:'benefit_amount_rounding')
|
162
|
+
self.benefit_amount_rounding = attributes[:'benefit_amount_rounding']
|
163
|
+
else
|
164
|
+
self.benefit_amount_rounding = 0
|
165
|
+
end
|
166
|
+
|
167
|
+
if attributes.has_key?(:'general_inflation_rate')
|
168
|
+
self.general_inflation_rate = attributes[:'general_inflation_rate']
|
169
|
+
else
|
170
|
+
self.general_inflation_rate = 0.0
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
175
|
+
# @return Array for valid properties with the reasons
|
176
|
+
def list_invalid_properties
|
177
|
+
invalid_properties = Array.new
|
178
|
+
if !@liquid_assets.nil? && @liquid_assets < 0
|
179
|
+
invalid_properties.push('invalid value for "liquid_assets", must be greater than or equal to 0.')
|
180
|
+
end
|
181
|
+
|
182
|
+
if !@other_debt.nil? && @other_debt < 0
|
183
|
+
invalid_properties.push('invalid value for "other_debt", must be greater than or equal to 0.')
|
184
|
+
end
|
185
|
+
|
186
|
+
if !@tax_rate.nil? && @tax_rate > 1
|
187
|
+
invalid_properties.push('invalid value for "tax_rate", must be smaller than or equal to 1.')
|
188
|
+
end
|
189
|
+
|
190
|
+
if !@tax_rate.nil? && @tax_rate < 0
|
191
|
+
invalid_properties.push('invalid value for "tax_rate", must be greater than or equal to 0.')
|
192
|
+
end
|
193
|
+
|
194
|
+
if !@end_of_life_expenses.nil? && @end_of_life_expenses < 0
|
195
|
+
invalid_properties.push('invalid value for "end_of_life_expenses", must be greater than or equal to 0.')
|
196
|
+
end
|
197
|
+
|
198
|
+
if !@mortgage_balance.nil? && @mortgage_balance < 0
|
199
|
+
invalid_properties.push('invalid value for "mortgage_balance", must be greater than or equal to 0.')
|
200
|
+
end
|
201
|
+
|
202
|
+
if !@margin_of_error.nil? && @margin_of_error < 0
|
203
|
+
invalid_properties.push('invalid value for "margin_of_error", must be greater than or equal to 0.')
|
204
|
+
end
|
205
|
+
|
206
|
+
if !@education_inflation_rate.nil? && @education_inflation_rate < -1
|
207
|
+
invalid_properties.push('invalid value for "education_inflation_rate", must be greater than or equal to -1.')
|
208
|
+
end
|
209
|
+
|
210
|
+
if @interest_rate.nil?
|
211
|
+
invalid_properties.push('invalid value for "interest_rate", interest_rate cannot be nil.')
|
212
|
+
end
|
213
|
+
|
214
|
+
if @interest_rate < -1
|
215
|
+
invalid_properties.push('invalid value for "interest_rate", must be greater than or equal to -1.')
|
216
|
+
end
|
217
|
+
|
218
|
+
if !@existing_life_insurance.nil? && @existing_life_insurance < 0
|
219
|
+
invalid_properties.push('invalid value for "existing_life_insurance", must be greater than or equal to 0.')
|
220
|
+
end
|
221
|
+
|
222
|
+
if !@benefit_amount_rounding.nil? && @benefit_amount_rounding > 12
|
223
|
+
invalid_properties.push('invalid value for "benefit_amount_rounding", must be smaller than or equal to 12.')
|
224
|
+
end
|
225
|
+
|
226
|
+
if !@benefit_amount_rounding.nil? && @benefit_amount_rounding < 0
|
227
|
+
invalid_properties.push('invalid value for "benefit_amount_rounding", must be greater than or equal to 0.')
|
228
|
+
end
|
229
|
+
|
230
|
+
if !@general_inflation_rate.nil? && @general_inflation_rate < -1
|
231
|
+
invalid_properties.push('invalid value for "general_inflation_rate", must be greater than or equal to -1.')
|
232
|
+
end
|
233
|
+
|
234
|
+
invalid_properties
|
235
|
+
end
|
236
|
+
|
237
|
+
# Check to see if the all the properties in the model are valid
|
238
|
+
# @return true if the model is valid
|
239
|
+
def valid?
|
240
|
+
return false if !@liquid_assets.nil? && @liquid_assets < 0
|
241
|
+
return false if !@other_debt.nil? && @other_debt < 0
|
242
|
+
return false if !@tax_rate.nil? && @tax_rate > 1
|
243
|
+
return false if !@tax_rate.nil? && @tax_rate < 0
|
244
|
+
return false if !@end_of_life_expenses.nil? && @end_of_life_expenses < 0
|
245
|
+
return false if !@mortgage_balance.nil? && @mortgage_balance < 0
|
246
|
+
return false if !@margin_of_error.nil? && @margin_of_error < 0
|
247
|
+
return false if !@education_inflation_rate.nil? && @education_inflation_rate < -1
|
248
|
+
return false if @interest_rate.nil?
|
249
|
+
return false if @interest_rate < -1
|
250
|
+
return false if !@existing_life_insurance.nil? && @existing_life_insurance < 0
|
251
|
+
return false if !@benefit_amount_rounding.nil? && @benefit_amount_rounding > 12
|
252
|
+
return false if !@benefit_amount_rounding.nil? && @benefit_amount_rounding < 0
|
253
|
+
return false if !@general_inflation_rate.nil? && @general_inflation_rate < -1
|
254
|
+
true
|
255
|
+
end
|
256
|
+
|
257
|
+
# Custom attribute writer method with validation
|
258
|
+
# @param [Object] liquid_assets Value to be assigned
|
259
|
+
def liquid_assets=(liquid_assets)
|
260
|
+
if !liquid_assets.nil? && liquid_assets < 0
|
261
|
+
fail ArgumentError, 'invalid value for "liquid_assets", must be greater than or equal to 0.'
|
262
|
+
end
|
263
|
+
|
264
|
+
@liquid_assets = liquid_assets
|
265
|
+
end
|
266
|
+
|
267
|
+
# Custom attribute writer method with validation
|
268
|
+
# @param [Object] other_debt Value to be assigned
|
269
|
+
def other_debt=(other_debt)
|
270
|
+
if !other_debt.nil? && other_debt < 0
|
271
|
+
fail ArgumentError, 'invalid value for "other_debt", must be greater than or equal to 0.'
|
272
|
+
end
|
273
|
+
|
274
|
+
@other_debt = other_debt
|
275
|
+
end
|
276
|
+
|
277
|
+
# Custom attribute writer method with validation
|
278
|
+
# @param [Object] tax_rate Value to be assigned
|
279
|
+
def tax_rate=(tax_rate)
|
280
|
+
if !tax_rate.nil? && tax_rate > 1
|
281
|
+
fail ArgumentError, 'invalid value for "tax_rate", must be smaller than or equal to 1.'
|
282
|
+
end
|
283
|
+
|
284
|
+
if !tax_rate.nil? && tax_rate < 0
|
285
|
+
fail ArgumentError, 'invalid value for "tax_rate", must be greater than or equal to 0.'
|
286
|
+
end
|
287
|
+
|
288
|
+
@tax_rate = tax_rate
|
289
|
+
end
|
290
|
+
|
291
|
+
# Custom attribute writer method with validation
|
292
|
+
# @param [Object] end_of_life_expenses Value to be assigned
|
293
|
+
def end_of_life_expenses=(end_of_life_expenses)
|
294
|
+
if !end_of_life_expenses.nil? && end_of_life_expenses < 0
|
295
|
+
fail ArgumentError, 'invalid value for "end_of_life_expenses", must be greater than or equal to 0.'
|
296
|
+
end
|
297
|
+
|
298
|
+
@end_of_life_expenses = end_of_life_expenses
|
299
|
+
end
|
300
|
+
|
301
|
+
# Custom attribute writer method with validation
|
302
|
+
# @param [Object] mortgage_balance Value to be assigned
|
303
|
+
def mortgage_balance=(mortgage_balance)
|
304
|
+
if !mortgage_balance.nil? && mortgage_balance < 0
|
305
|
+
fail ArgumentError, 'invalid value for "mortgage_balance", must be greater than or equal to 0.'
|
306
|
+
end
|
307
|
+
|
308
|
+
@mortgage_balance = mortgage_balance
|
309
|
+
end
|
310
|
+
|
311
|
+
# Custom attribute writer method with validation
|
312
|
+
# @param [Object] margin_of_error Value to be assigned
|
313
|
+
def margin_of_error=(margin_of_error)
|
314
|
+
if !margin_of_error.nil? && margin_of_error < 0
|
315
|
+
fail ArgumentError, 'invalid value for "margin_of_error", must be greater than or equal to 0.'
|
316
|
+
end
|
317
|
+
|
318
|
+
@margin_of_error = margin_of_error
|
319
|
+
end
|
320
|
+
|
321
|
+
# Custom attribute writer method with validation
|
322
|
+
# @param [Object] education_inflation_rate Value to be assigned
|
323
|
+
def education_inflation_rate=(education_inflation_rate)
|
324
|
+
if !education_inflation_rate.nil? && education_inflation_rate < -1
|
325
|
+
fail ArgumentError, 'invalid value for "education_inflation_rate", must be greater than or equal to -1.'
|
326
|
+
end
|
327
|
+
|
328
|
+
@education_inflation_rate = education_inflation_rate
|
329
|
+
end
|
330
|
+
|
331
|
+
# Custom attribute writer method with validation
|
332
|
+
# @param [Object] interest_rate Value to be assigned
|
333
|
+
def interest_rate=(interest_rate)
|
334
|
+
if interest_rate.nil?
|
335
|
+
fail ArgumentError, 'interest_rate cannot be nil'
|
336
|
+
end
|
337
|
+
|
338
|
+
if interest_rate < -1
|
339
|
+
fail ArgumentError, 'invalid value for "interest_rate", must be greater than or equal to -1.'
|
340
|
+
end
|
341
|
+
|
342
|
+
@interest_rate = interest_rate
|
343
|
+
end
|
344
|
+
|
345
|
+
# Custom attribute writer method with validation
|
346
|
+
# @param [Object] existing_life_insurance Value to be assigned
|
347
|
+
def existing_life_insurance=(existing_life_insurance)
|
348
|
+
if !existing_life_insurance.nil? && existing_life_insurance < 0
|
349
|
+
fail ArgumentError, 'invalid value for "existing_life_insurance", must be greater than or equal to 0.'
|
350
|
+
end
|
351
|
+
|
352
|
+
@existing_life_insurance = existing_life_insurance
|
353
|
+
end
|
354
|
+
|
355
|
+
# Custom attribute writer method with validation
|
356
|
+
# @param [Object] benefit_amount_rounding Value to be assigned
|
357
|
+
def benefit_amount_rounding=(benefit_amount_rounding)
|
358
|
+
if !benefit_amount_rounding.nil? && benefit_amount_rounding > 12
|
359
|
+
fail ArgumentError, 'invalid value for "benefit_amount_rounding", must be smaller than or equal to 12.'
|
360
|
+
end
|
361
|
+
|
362
|
+
if !benefit_amount_rounding.nil? && benefit_amount_rounding < 0
|
363
|
+
fail ArgumentError, 'invalid value for "benefit_amount_rounding", must be greater than or equal to 0.'
|
364
|
+
end
|
365
|
+
|
366
|
+
@benefit_amount_rounding = benefit_amount_rounding
|
367
|
+
end
|
368
|
+
|
369
|
+
# Custom attribute writer method with validation
|
370
|
+
# @param [Object] general_inflation_rate Value to be assigned
|
371
|
+
def general_inflation_rate=(general_inflation_rate)
|
372
|
+
if !general_inflation_rate.nil? && general_inflation_rate < -1
|
373
|
+
fail ArgumentError, 'invalid value for "general_inflation_rate", must be greater than or equal to -1.'
|
374
|
+
end
|
375
|
+
|
376
|
+
@general_inflation_rate = general_inflation_rate
|
377
|
+
end
|
378
|
+
|
379
|
+
# Checks equality by comparing each attribute.
|
380
|
+
# @param [Object] Object to be compared
|
381
|
+
def ==(o)
|
382
|
+
return true if self.equal?(o)
|
383
|
+
self.class == o.class &&
|
384
|
+
children_education_config == o.children_education_config &&
|
385
|
+
liquid_assets == o.liquid_assets &&
|
386
|
+
other_debt == o.other_debt &&
|
387
|
+
client_id == o.client_id &&
|
388
|
+
tax_rate == o.tax_rate &&
|
389
|
+
end_of_life_expenses == o.end_of_life_expenses &&
|
390
|
+
mortgage_balance == o.mortgage_balance &&
|
391
|
+
income_config == o.income_config &&
|
392
|
+
beneficiary_bequest_config == o.beneficiary_bequest_config &&
|
393
|
+
margin_of_error == o.margin_of_error &&
|
394
|
+
education_inflation_rate == o.education_inflation_rate &&
|
395
|
+
interest_rate == o.interest_rate &&
|
396
|
+
existing_life_insurance == o.existing_life_insurance &&
|
397
|
+
benefit_amount_rounding == o.benefit_amount_rounding &&
|
398
|
+
general_inflation_rate == o.general_inflation_rate
|
399
|
+
end
|
400
|
+
|
401
|
+
# @see the `==` method
|
402
|
+
# @param [Object] Object to be compared
|
403
|
+
def eql?(o)
|
404
|
+
self == o
|
405
|
+
end
|
406
|
+
|
407
|
+
# Calculates hash code according to all attributes.
|
408
|
+
# @return [Fixnum] Hash code
|
409
|
+
def hash
|
410
|
+
[children_education_config, liquid_assets, other_debt, client_id, tax_rate, end_of_life_expenses, mortgage_balance, income_config, beneficiary_bequest_config, margin_of_error, education_inflation_rate, interest_rate, existing_life_insurance, benefit_amount_rounding, general_inflation_rate].hash
|
411
|
+
end
|
412
|
+
|
413
|
+
# Builds the object from hash
|
414
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
415
|
+
# @return [Object] Returns the model itself
|
416
|
+
def build_from_hash(attributes)
|
417
|
+
return nil unless attributes.is_a?(Hash)
|
418
|
+
self.class.swagger_types.each_pair do |key, type|
|
419
|
+
if type =~ /\AArray<(.*)>/i
|
420
|
+
# check to ensure the input is an array given that the attribute
|
421
|
+
# is documented as an array but the input is not
|
422
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
423
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
424
|
+
end
|
425
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
426
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
427
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
428
|
+
end
|
429
|
+
|
430
|
+
self
|
431
|
+
end
|
432
|
+
|
433
|
+
# Deserializes the data based on type
|
434
|
+
# @param string type Data type
|
435
|
+
# @param string value Value to be deserialized
|
436
|
+
# @return [Object] Deserialized data
|
437
|
+
def _deserialize(type, value)
|
438
|
+
case type.to_sym
|
439
|
+
when :DateTime
|
440
|
+
DateTime.parse(value)
|
441
|
+
when :Date
|
442
|
+
Date.parse(value)
|
443
|
+
when :String
|
444
|
+
value.to_s
|
445
|
+
when :Integer
|
446
|
+
value.to_i
|
447
|
+
when :Float
|
448
|
+
value.to_f
|
449
|
+
when :BOOLEAN
|
450
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
451
|
+
true
|
452
|
+
else
|
453
|
+
false
|
454
|
+
end
|
455
|
+
when :Object
|
456
|
+
# generic object (usually a Hash), return directly
|
457
|
+
value
|
458
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
459
|
+
inner_type = Regexp.last_match[:inner_type]
|
460
|
+
value.map { |v| _deserialize(inner_type, v) }
|
461
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
462
|
+
k_type = Regexp.last_match[:k_type]
|
463
|
+
v_type = Regexp.last_match[:v_type]
|
464
|
+
{}.tap do |hash|
|
465
|
+
value.each do |k, v|
|
466
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
467
|
+
end
|
468
|
+
end
|
469
|
+
else # model
|
470
|
+
temp_model = ProtonApi.const_get(type).new
|
471
|
+
temp_model.build_from_hash(value)
|
472
|
+
end
|
473
|
+
end
|
474
|
+
|
475
|
+
# Returns the string representation of the object
|
476
|
+
# @return [String] String presentation of the object
|
477
|
+
def to_s
|
478
|
+
to_hash.to_s
|
479
|
+
end
|
480
|
+
|
481
|
+
# to_body is an alias to to_hash (backward compatibility)
|
482
|
+
# @return [Hash] Returns the object in the form of hash
|
483
|
+
def to_body
|
484
|
+
to_hash
|
485
|
+
end
|
486
|
+
|
487
|
+
# Returns the object in the form of hash
|
488
|
+
# @return [Hash] Returns the object in the form of hash
|
489
|
+
def to_hash
|
490
|
+
hash = {}
|
491
|
+
self.class.attribute_map.each_pair do |attr, param|
|
492
|
+
value = self.send(attr)
|
493
|
+
next if value.nil?
|
494
|
+
hash[param] = _to_hash(value)
|
495
|
+
end
|
496
|
+
hash
|
497
|
+
end
|
498
|
+
|
499
|
+
# Outputs non-array value in the form of hash
|
500
|
+
# For object, use to_hash. Otherwise, just return the value
|
501
|
+
# @param [Object] value Any valid value
|
502
|
+
# @return [Hash] Returns the value in the form of hash
|
503
|
+
def _to_hash(value)
|
504
|
+
if value.is_a?(Array)
|
505
|
+
value.compact.map { |v| _to_hash(v) }
|
506
|
+
elsif value.is_a?(Hash)
|
507
|
+
{}.tap do |hash|
|
508
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
509
|
+
end
|
510
|
+
elsif value.respond_to? :to_hash
|
511
|
+
value.to_hash
|
512
|
+
else
|
513
|
+
value
|
514
|
+
end
|
515
|
+
end
|
516
|
+
|
517
|
+
end
|
518
|
+
end
|