/** * This file is generated by the SwaggerTSGenerator. * Do not edit. */ /* tslint:disable */ import { BaseModel } from './base-model'; import { SubTypeFactory } from './sub-type-factory'; import { ISoftReference, SoftReference } from './soft-reference.model'; import { IDocument, Document } from './document.model'; import { IBoundedPeriod, BoundedPeriod } from './bounded-period.model'; import { ICompany, Company } from './company.model'; import { IPerson, Person } from './person.model'; import { IRiskScope, RiskScope } from './risk-scope.model'; import { IStateChangeRecord, StateChangeRecord } from './state-change-record.model'; import { IMoney, Money } from './money.model'; export interface IInsurancePortfolio { contracts?: Array; description: string; documents?: Array; effectivePeriod?: IBoundedPeriod; id?: string; name: string; owner?: ICompany | IPerson; scopesCovered: Array; stateChangeRecordDtos?: Array; totalPremium?: IMoney; totalSumInsured?: IMoney; version?: number; } export class InsurancePortfolio extends BaseModel implements IInsurancePortfolio { static CONTRACTS_FIELD_NAME = 'contracts'; static DESCRIPTION_FIELD_NAME = 'description'; static DOCUMENTS_FIELD_NAME = 'documents'; static EFFECTIVE_PERIOD_FIELD_NAME = 'effectivePeriod'; static ID_FIELD_NAME = 'id'; static NAME_FIELD_NAME = 'name'; static OWNER_FIELD_NAME = 'owner'; static SCOPES_COVERED_FIELD_NAME = 'scopesCovered'; static STATE_CHANGE_RECORD_DTOS_FIELD_NAME = 'stateChangeRecordDtos'; static TOTAL_PREMIUM_FIELD_NAME = 'totalPremium'; static TOTAL_SUM_INSURED_FIELD_NAME = 'totalSumInsured'; static VERSION_FIELD_NAME = 'version'; contracts: Array; description: string; documents: Array; effectivePeriod: BoundedPeriod; id: string; name: string; owner: Company | Person; scopesCovered: Array; stateChangeRecordDtos: Array; totalPremium: Money; totalSumInsured: Money; version: number; /** * constructor * @param values Can be used to set a webapi response or formValues to this newly constructed model */ constructor(values?: Partial) { super(); this.contracts = new Array(); this.documents = new Array(); this.effectivePeriod = new BoundedPeriod(); this.owner = new Company(); this.scopesCovered = new Array(); this.stateChangeRecordDtos = new Array(); this.totalPremium = new Money(); this.totalSumInsured = 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, InsurancePortfolio.CONTRACTS_FIELD_NAME, rawValues.contracts, SoftReference, SubTypeFactory.createSubTypeInstance); this.description = this.getValue(rawValues, InsurancePortfolio.DESCRIPTION_FIELD_NAME); this.fillModelArray(this, InsurancePortfolio.DOCUMENTS_FIELD_NAME, rawValues.documents, Document, SubTypeFactory.createSubTypeInstance); this.effectivePeriod.setValues(rawValues.effectivePeriod); this.id = this.getValue(rawValues, InsurancePortfolio.ID_FIELD_NAME); this.name = this.getValue(rawValues, InsurancePortfolio.NAME_FIELD_NAME); if (rawValues.owner && rawValues.owner.typeSelector && this.owner.typeSelector !== rawValues.owner.typeSelector) { this.owner = SubTypeFactory.createSubTypeInstance(rawValues.owner) as Company | Person; } this.owner.setValues(rawValues.owner); this.fillModelArray(this, InsurancePortfolio.SCOPES_COVERED_FIELD_NAME, rawValues.scopesCovered, RiskScope, SubTypeFactory.createSubTypeInstance); this.fillModelArray(this, InsurancePortfolio.STATE_CHANGE_RECORD_DTOS_FIELD_NAME, rawValues.stateChangeRecordDtos, StateChangeRecord, SubTypeFactory.createSubTypeInstance); this.totalPremium.setValues(rawValues.totalPremium); this.totalSumInsured.setValues(rawValues.totalSumInsured); this.version = this.getValue(rawValues, InsurancePortfolio.VERSION_FIELD_NAME); } } }