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