/// <summary> /// Initializes a new instance of the <see cref="EducationCalculatorDepositAmountRequest" /> class. /// </summary> /// <param name="educationInflationRate">educationInflationRate (default to 0.05F).</param> /// <param name="decumulationHorizon">decumulationHorizon (required).</param> /// <param name="accumulationHorizon">accumulationHorizon (required).</param> /// <param name="accountIds">accountIds.</param> /// <param name="taxRate">taxRate (default to 0.0F).</param> /// <param name="generalInflationRate">generalInflationRate (default to 0.0F).</param> /// <param name="totalAnnualCost">totalAnnualCost (required).</param> /// <param name="portfolioReturn">portfolioReturn (required).</param> /// <param name="depositSchedule">depositSchedule.</param> /// <param name="initialBalance">initialBalance (default to 0.0F).</param> /// <param name="percentOfCostsCovered">percentOfCostsCovered (default to 1.0F).</param> /// <param name="aggregationAccountIds">aggregationAccountIds.</param> public EducationCalculatorDepositAmountRequest(float?educationInflationRate = 0.05F, int?decumulationHorizon = default(int?), int?accumulationHorizon = default(int?), List <Guid?> accountIds = default(List <Guid?>), float?taxRate = 0.0F, float?generalInflationRate = 0.0F, float?totalAnnualCost = default(float?), float?portfolioReturn = default(float?), CalculatorDepositSchedule depositSchedule = default(CalculatorDepositSchedule), float?initialBalance = 0.0F, float?percentOfCostsCovered = 1.0F, List <Guid?> aggregationAccountIds = default(List <Guid?>)) { // to ensure "decumulationHorizon" is required (not null) if (decumulationHorizon == null) { throw new InvalidDataException("decumulationHorizon is a required property for EducationCalculatorDepositAmountRequest and cannot be null"); } else { this.DecumulationHorizon = decumulationHorizon; } // to ensure "accumulationHorizon" is required (not null) if (accumulationHorizon == null) { throw new InvalidDataException("accumulationHorizon is a required property for EducationCalculatorDepositAmountRequest and cannot be null"); } else { this.AccumulationHorizon = accumulationHorizon; } // to ensure "totalAnnualCost" is required (not null) if (totalAnnualCost == null) { throw new InvalidDataException("totalAnnualCost is a required property for EducationCalculatorDepositAmountRequest and cannot be null"); } else { this.TotalAnnualCost = totalAnnualCost; } // to ensure "portfolioReturn" is required (not null) if (portfolioReturn == null) { throw new InvalidDataException("portfolioReturn is a required property for EducationCalculatorDepositAmountRequest and cannot be null"); } else { this.PortfolioReturn = portfolioReturn; } // use default value if no "educationInflationRate" provided if (educationInflationRate == null) { this.EducationInflationRate = 0.05F; } else { this.EducationInflationRate = educationInflationRate; } this.AccountIds = accountIds; // use default value if no "taxRate" provided if (taxRate == null) { this.TaxRate = 0.0F; } else { this.TaxRate = taxRate; } // use default value if no "generalInflationRate" provided if (generalInflationRate == null) { this.GeneralInflationRate = 0.0F; } else { this.GeneralInflationRate = generalInflationRate; } this.DepositSchedule = depositSchedule; // use default value if no "initialBalance" provided if (initialBalance == null) { this.InitialBalance = 0.0F; } else { this.InitialBalance = initialBalance; } // use default value if no "percentOfCostsCovered" provided if (percentOfCostsCovered == null) { this.PercentOfCostsCovered = 1.0F; } else { this.PercentOfCostsCovered = percentOfCostsCovered; } this.AggregationAccountIds = aggregationAccountIds; }
/// <summary> /// Initializes a new instance of the <see cref="PurchaseCalculatorDepositAmountRequest" /> class. /// </summary> /// <param name="accountIds">accountIds.</param> /// <param name="horizonFrequencyInterval">horizonFrequencyInterval (default to HorizonFrequencyIntervalEnum.Year).</param> /// <param name="purchaseHorizon">purchaseHorizon (required).</param> /// <param name="investmentTax">investmentTax (default to 0.0F).</param> /// <param name="portfolioReturn">portfolioReturn (required).</param> /// <param name="depositSchedule">depositSchedule.</param> /// <param name="currentSavings">currentSavings (default to 0.0F).</param> /// <param name="purchaseAmount">purchaseAmount (required).</param> /// <param name="inflationRate">inflationRate (default to 0.0F).</param> /// <param name="aggregationAccountIds">aggregationAccountIds.</param> public PurchaseCalculatorDepositAmountRequest(List <Guid?> accountIds = default(List <Guid?>), HorizonFrequencyIntervalEnum?horizonFrequencyInterval = HorizonFrequencyIntervalEnum.Year, int?purchaseHorizon = default(int?), float?investmentTax = 0.0F, float?portfolioReturn = default(float?), CalculatorDepositSchedule depositSchedule = default(CalculatorDepositSchedule), float?currentSavings = 0.0F, float?purchaseAmount = default(float?), float?inflationRate = 0.0F, List <Guid?> aggregationAccountIds = default(List <Guid?>)) { // to ensure "purchaseHorizon" is required (not null) if (purchaseHorizon == null) { throw new InvalidDataException("purchaseHorizon is a required property for PurchaseCalculatorDepositAmountRequest and cannot be null"); } else { this.PurchaseHorizon = purchaseHorizon; } // to ensure "portfolioReturn" is required (not null) if (portfolioReturn == null) { throw new InvalidDataException("portfolioReturn is a required property for PurchaseCalculatorDepositAmountRequest and cannot be null"); } else { this.PortfolioReturn = portfolioReturn; } // to ensure "purchaseAmount" is required (not null) if (purchaseAmount == null) { throw new InvalidDataException("purchaseAmount is a required property for PurchaseCalculatorDepositAmountRequest and cannot be null"); } else { this.PurchaseAmount = purchaseAmount; } this.AccountIds = accountIds; // use default value if no "horizonFrequencyInterval" provided if (horizonFrequencyInterval == null) { this.HorizonFrequencyInterval = HorizonFrequencyIntervalEnum.Year; } else { this.HorizonFrequencyInterval = horizonFrequencyInterval; } // use default value if no "investmentTax" provided if (investmentTax == null) { this.InvestmentTax = 0.0F; } else { this.InvestmentTax = investmentTax; } this.DepositSchedule = depositSchedule; // use default value if no "currentSavings" provided if (currentSavings == null) { this.CurrentSavings = 0.0F; } else { this.CurrentSavings = currentSavings; } // use default value if no "inflationRate" provided if (inflationRate == null) { this.InflationRate = 0.0F; } else { this.InflationRate = inflationRate; } this.AggregationAccountIds = aggregationAccountIds; }
/// <summary> /// Initializes a new instance of the <see cref="RetirementCalculatorDepositAmountRequest" /> class. /// </summary> /// <param name="retirementSavings">retirementSavings (default to 0.0F).</param> /// <param name="currentAge">currentAge (required).</param> /// <param name="accountIds">accountIds.</param> /// <param name="retirementIncome">retirementIncome (default to 0.0F).</param> /// <param name="retirementTax">retirementTax (default to 0.0F).</param> /// <param name="deathAge">deathAge (required).</param> /// <param name="retirementAge">retirementAge (default to 65).</param> /// <param name="percentOfExpensesCovered">percentOfExpensesCovered (default to 1.0F).</param> /// <param name="portfolioReturn">portfolioReturn (required).</param> /// <param name="retirementExpenses">retirementExpenses (required).</param> /// <param name="depositSchedule">depositSchedule.</param> /// <param name="inflationRate">inflationRate (default to 0.0F).</param> /// <param name="aggregationAccountIds">aggregationAccountIds.</param> public RetirementCalculatorDepositAmountRequest(float?retirementSavings = 0.0F, int?currentAge = default(int?), List <Guid?> accountIds = default(List <Guid?>), float?retirementIncome = 0.0F, float?retirementTax = 0.0F, int?deathAge = default(int?), int?retirementAge = 65, float?percentOfExpensesCovered = 1.0F, float?portfolioReturn = default(float?), float?retirementExpenses = default(float?), CalculatorDepositSchedule depositSchedule = default(CalculatorDepositSchedule), float?inflationRate = 0.0F, List <Guid?> aggregationAccountIds = default(List <Guid?>)) { // to ensure "currentAge" is required (not null) if (currentAge == null) { throw new InvalidDataException("currentAge is a required property for RetirementCalculatorDepositAmountRequest and cannot be null"); } else { this.CurrentAge = currentAge; } // to ensure "deathAge" is required (not null) if (deathAge == null) { throw new InvalidDataException("deathAge is a required property for RetirementCalculatorDepositAmountRequest and cannot be null"); } else { this.DeathAge = deathAge; } // to ensure "portfolioReturn" is required (not null) if (portfolioReturn == null) { throw new InvalidDataException("portfolioReturn is a required property for RetirementCalculatorDepositAmountRequest and cannot be null"); } else { this.PortfolioReturn = portfolioReturn; } // to ensure "retirementExpenses" is required (not null) if (retirementExpenses == null) { throw new InvalidDataException("retirementExpenses is a required property for RetirementCalculatorDepositAmountRequest and cannot be null"); } else { this.RetirementExpenses = retirementExpenses; } // use default value if no "retirementSavings" provided if (retirementSavings == null) { this.RetirementSavings = 0.0F; } else { this.RetirementSavings = retirementSavings; } this.AccountIds = accountIds; // use default value if no "retirementIncome" provided if (retirementIncome == null) { this.RetirementIncome = 0.0F; } else { this.RetirementIncome = retirementIncome; } // use default value if no "retirementTax" provided if (retirementTax == null) { this.RetirementTax = 0.0F; } else { this.RetirementTax = retirementTax; } // use default value if no "retirementAge" provided if (retirementAge == null) { this.RetirementAge = 65; } else { this.RetirementAge = retirementAge; } // use default value if no "percentOfExpensesCovered" provided if (percentOfExpensesCovered == null) { this.PercentOfExpensesCovered = 1.0F; } else { this.PercentOfExpensesCovered = percentOfExpensesCovered; } this.DepositSchedule = depositSchedule; // use default value if no "inflationRate" provided if (inflationRate == null) { this.InflationRate = 0.0F; } else { this.InflationRate = inflationRate; } this.AggregationAccountIds = aggregationAccountIds; }