/** * This file is generated by the SwaggerTSGenerator. * Do not edit. */ /* tslint:disable */ import { BaseModel } from './base-model'; import { SubTypeFactory } from './sub-type-factory'; import { IClause, Clause } from './clause.model'; import { ICustomClause, CustomClause } from './custom-clause.model'; import { IPredefinedClause, PredefinedClause } from './predefined-clause.model'; import { IMoney, Money } from './money.model'; import { PremiumIncomeType } from './enums'; export interface IRisk { clauses?: Array; estimatedPremiumIncome?: IMoney; estimatedSumInsured?: IMoney; finalPremiumIncome?: IMoney; finalSumInsured?: IMoney; id?: string; premiumIncomeType?: PremiumIncomeType; typeSelector?: string; } export class Risk extends BaseModel implements IRisk { static TYPE_SELECTOR = 'Risk'; static CLAUSES_FIELD_NAME = 'clauses'; static ESTIMATED_PREMIUM_INCOME_FIELD_NAME = 'estimatedPremiumIncome'; static ESTIMATED_SUM_INSURED_FIELD_NAME = 'estimatedSumInsured'; static FINAL_PREMIUM_INCOME_FIELD_NAME = 'finalPremiumIncome'; static FINAL_SUM_INSURED_FIELD_NAME = 'finalSumInsured'; static ID_FIELD_NAME = 'id'; static PREMIUM_INCOME_TYPE_FIELD_NAME = 'premiumIncomeType'; static TYPE_SELECTOR_FIELD_NAME = 'typeSelector'; clauses: Array; estimatedPremiumIncome: Money; estimatedSumInsured: Money; finalPremiumIncome: Money; finalSumInsured: Money; id: string; premiumIncomeType: PremiumIncomeType; typeSelector: string; /** * constructor * @param values Can be used to set a webapi response or formValues to this newly constructed model */ constructor(values?: Partial) { super(); this.typeSelector = Risk.TYPE_SELECTOR; this.clauses = new Array(); this.estimatedPremiumIncome = new Money(); this.estimatedSumInsured = new Money(); this.finalPremiumIncome = new Money(); this.finalSumInsured = new Money(); if (values) { this.setValues(values); } } /** * set the values. * @param values Can be used to set a webapi response to this newly constructed model */ setValues(values: Partial): void { if (values) { const rawValues = values this.fillModelArray(this, Risk.CLAUSES_FIELD_NAME, rawValues.clauses, Clause, SubTypeFactory.createSubTypeInstance); this.estimatedPremiumIncome.setValues(rawValues.estimatedPremiumIncome); this.estimatedSumInsured.setValues(rawValues.estimatedSumInsured); this.finalPremiumIncome.setValues(rawValues.finalPremiumIncome); this.finalSumInsured.setValues(rawValues.finalSumInsured); this.id = this.getValue(rawValues, Risk.ID_FIELD_NAME); this.premiumIncomeType = this.getValue(rawValues, Risk.PREMIUM_INCOME_TYPE_FIELD_NAME); this.typeSelector = this.getValue(rawValues, Risk.TYPE_SELECTOR_FIELD_NAME); } } }