/** * 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 { IPeriod, Period } from './period.model'; import { IBoundedPeriod, BoundedPeriod } from './bounded-period.model'; import { IGeographicLocation, GeographicLocation } from './geographic-location.model'; import { ICountry, Country } from './country.model'; import { ICountrySubdivision, CountrySubdivision } from './country-subdivision.model'; import { ILossEventReference, LossEventReference } from './loss-event-reference.model'; import { IPeril, Peril } from './peril.model'; export interface ILossEvent { custodian?: ISoftReference; description?: string; duration?: IPeriod | IBoundedPeriod; id?: string; locations?: Array; lossReference?: string; marketReferences?: Array; name?: string; peril?: IPeril; shared?: boolean; typeSelector?: string; } export class LossEvent extends BaseModel implements ILossEvent { static TYPE_SELECTOR = 'LossEvent'; static CUSTODIAN_FIELD_NAME = 'custodian'; static DESCRIPTION_FIELD_NAME = 'description'; static DURATION_FIELD_NAME = 'duration'; static ID_FIELD_NAME = 'id'; static LOCATIONS_FIELD_NAME = 'locations'; static LOSS_REFERENCE_FIELD_NAME = 'lossReference'; static MARKET_REFERENCES_FIELD_NAME = 'marketReferences'; static NAME_FIELD_NAME = 'name'; static PERIL_FIELD_NAME = 'peril'; static SHARED_FIELD_NAME = 'shared'; static TYPE_SELECTOR_FIELD_NAME = 'typeSelector'; custodian: SoftReference; description: string; duration: Period | BoundedPeriod; id: string; locations: Array; lossReference: string; marketReferences: Array; name: string; peril: Peril; shared: boolean; 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 = LossEvent.TYPE_SELECTOR; this.custodian = new SoftReference(); this.duration = new Period(); this.locations = new Array(); this.marketReferences = new Array(); this.peril = new Peril(); 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.custodian.setValues(rawValues.custodian); this.description = this.getValue(rawValues, LossEvent.DESCRIPTION_FIELD_NAME); if (rawValues.duration && rawValues.duration.typeSelector && this.duration.typeSelector !== rawValues.duration.typeSelector) { this.duration = SubTypeFactory.createSubTypeInstance(rawValues.duration) as Period | BoundedPeriod; } this.duration.setValues(rawValues.duration); this.id = this.getValue(rawValues, LossEvent.ID_FIELD_NAME); this.fillModelArray(this, LossEvent.LOCATIONS_FIELD_NAME, rawValues.locations, GeographicLocation, SubTypeFactory.createSubTypeInstance); this.lossReference = this.getValue(rawValues, LossEvent.LOSS_REFERENCE_FIELD_NAME); this.fillModelArray(this, LossEvent.MARKET_REFERENCES_FIELD_NAME, rawValues.marketReferences, LossEventReference, SubTypeFactory.createSubTypeInstance); this.name = this.getValue(rawValues, LossEvent.NAME_FIELD_NAME); this.peril.setValues(rawValues.peril); this.shared = this.getValue(rawValues, LossEvent.SHARED_FIELD_NAME); this.typeSelector = this.getValue(rawValues, LossEvent.TYPE_SELECTOR_FIELD_NAME); } } }