/** * This file is generated by the SwaggerTSGenerator. * Do not edit. */ /* tslint:disable */ import { BaseModel } from './base-model'; import { SubTypeFactory } from './sub-type-factory'; import { IDocument, Document } from './document.model'; import { IBoundedPeriod, BoundedPeriod } from './bounded-period.model'; import { ILegalJurisdiction, LegalJurisdiction } from './legal-jurisdiction.model'; import { ICompany, Company } from './company.model'; import { IPerson, Person } from './person.model'; import { IInsuranceProgramProducer, InsuranceProgramProducer } from './insurance-program-producer.model'; import { IRiskScope, RiskScope } from './risk-scope.model'; import { IStateChangeRecord, StateChangeRecord } from './state-change-record.model'; import { IMoney, Money } from './money.model'; import { TotalPremiumType } from './enums'; export interface IInsuranceProgram { actionExpected?: boolean; description?: string; documents?: Array; effectivePeriod?: IBoundedPeriod; id?: string; legalJurisdiction?: ILegalJurisdiction; name: string; owner?: ICompany | IPerson; partyRolesInContract?: Array; referenceCurrency?: string; scopesCovered?: Array; stateChangeRecordDtos?: Array; totalPremium?: IMoney; totalPremiumType?: TotalPremiumType; totalSumInsured?: IMoney; transitory?: boolean; version?: number; } export class InsuranceProgram extends BaseModel implements IInsuranceProgram { static ACTION_EXPECTED_FIELD_NAME = 'actionExpected'; static DESCRIPTION_FIELD_NAME = 'description'; static DOCUMENTS_FIELD_NAME = 'documents'; static EFFECTIVE_PERIOD_FIELD_NAME = 'effectivePeriod'; static ID_FIELD_NAME = 'id'; static LEGAL_JURISDICTION_FIELD_NAME = 'legalJurisdiction'; static NAME_FIELD_NAME = 'name'; static OWNER_FIELD_NAME = 'owner'; static PARTY_ROLES_IN_CONTRACT_FIELD_NAME = 'partyRolesInContract'; static REFERENCE_CURRENCY_FIELD_NAME = 'referenceCurrency'; static SCOPES_COVERED_FIELD_NAME = 'scopesCovered'; static STATE_CHANGE_RECORD_DTOS_FIELD_NAME = 'stateChangeRecordDtos'; static TOTAL_PREMIUM_FIELD_NAME = 'totalPremium'; static TOTAL_PREMIUM_TYPE_FIELD_NAME = 'totalPremiumType'; static TOTAL_SUM_INSURED_FIELD_NAME = 'totalSumInsured'; static TRANSITORY_FIELD_NAME = 'transitory'; static VERSION_FIELD_NAME = 'version'; actionExpected: boolean; description: string; documents: Array; effectivePeriod: BoundedPeriod; id: string; legalJurisdiction: LegalJurisdiction; name: string; owner: Company | Person; partyRolesInContract: Array; referenceCurrency: string; scopesCovered: Array; stateChangeRecordDtos: Array; totalPremium: Money; totalPremiumType: TotalPremiumType; totalSumInsured: Money; transitory: boolean; 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.documents = new Array(); this.effectivePeriod = new BoundedPeriod(); this.legalJurisdiction = new LegalJurisdiction(); this.owner = new Company(); this.partyRolesInContract = new Array(); 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.actionExpected = this.getValue(rawValues, InsuranceProgram.ACTION_EXPECTED_FIELD_NAME); this.description = this.getValue(rawValues, InsuranceProgram.DESCRIPTION_FIELD_NAME); this.fillModelArray(this, InsuranceProgram.DOCUMENTS_FIELD_NAME, rawValues.documents, Document, SubTypeFactory.createSubTypeInstance); this.effectivePeriod.setValues(rawValues.effectivePeriod); this.id = this.getValue(rawValues, InsuranceProgram.ID_FIELD_NAME); this.legalJurisdiction.setValues(rawValues.legalJurisdiction); this.name = this.getValue(rawValues, InsuranceProgram.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, InsuranceProgram.PARTY_ROLES_IN_CONTRACT_FIELD_NAME, rawValues.partyRolesInContract, InsuranceProgramProducer, SubTypeFactory.createSubTypeInstance); this.referenceCurrency = this.getValue(rawValues, InsuranceProgram.REFERENCE_CURRENCY_FIELD_NAME); this.fillModelArray(this, InsuranceProgram.SCOPES_COVERED_FIELD_NAME, rawValues.scopesCovered, RiskScope, SubTypeFactory.createSubTypeInstance); this.fillModelArray(this, InsuranceProgram.STATE_CHANGE_RECORD_DTOS_FIELD_NAME, rawValues.stateChangeRecordDtos, StateChangeRecord, SubTypeFactory.createSubTypeInstance); this.totalPremium.setValues(rawValues.totalPremium); this.totalPremiumType = this.getValue(rawValues, InsuranceProgram.TOTAL_PREMIUM_TYPE_FIELD_NAME); this.totalSumInsured.setValues(rawValues.totalSumInsured); this.transitory = this.getValue(rawValues, InsuranceProgram.TRANSITORY_FIELD_NAME); this.version = this.getValue(rawValues, InsuranceProgram.VERSION_FIELD_NAME); } } }