/** * This file is generated by the SwaggerTSGenerator. * Do not edit. */ /* tslint:disable */ import { BaseModel } from './base-model'; import { SubTypeFactory } from './sub-type-factory'; import { ICompany, Company } from './company.model'; import { IPerson, Person } from './person.model'; import { ISoftReference, SoftReference } from './soft-reference.model'; export interface IInsurer { contractReference?: string; localParty?: ICompany | IPerson; party?: ISoftReference; typeSelector?: string; } export class Insurer extends BaseModel implements IInsurer { static TYPE_SELECTOR = 'Insurer'; static CONTRACT_REFERENCE_FIELD_NAME = 'contractReference'; static LOCAL_PARTY_FIELD_NAME = 'localParty'; static PARTY_FIELD_NAME = 'party'; static TYPE_SELECTOR_FIELD_NAME = 'typeSelector'; contractReference: string; localParty: Company | Person; party: SoftReference; 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 = Insurer.TYPE_SELECTOR; this.localParty = new Company(); this.party = new SoftReference(); 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.contractReference = this.getValue(rawValues, Insurer.CONTRACT_REFERENCE_FIELD_NAME); if (rawValues.localParty && rawValues.localParty.typeSelector && this.localParty.typeSelector !== rawValues.localParty.typeSelector) { this.localParty = SubTypeFactory.createSubTypeInstance(rawValues.localParty) as Company | Person; } this.localParty.setValues(rawValues.localParty); this.party.setValues(rawValues.party); this.typeSelector = this.getValue(rawValues, Insurer.TYPE_SELECTOR_FIELD_NAME); } } }