/** * This file is generated by the SwaggerTSGenerator. * Do not edit. */ /* tslint:disable */ import { BaseModel } from './base-model'; import { SubTypeFactory } from './sub-type-factory'; import { IPeriod, Period } from './period.model'; import { IBoundedPeriod, BoundedPeriod } from './bounded-period.model'; import { ElectronicAddressType } from './enums'; export interface IElectronicAddress { effectivity?: IPeriod | IBoundedPeriod; locator?: string; type?: ElectronicAddressType; typeSelector?: string; } export class ElectronicAddress extends BaseModel implements IElectronicAddress { static TYPE_SELECTOR = 'ElectronicAddress'; static EFFECTIVITY_FIELD_NAME = 'effectivity'; static LOCATOR_FIELD_NAME = 'locator'; static TYPE_FIELD_NAME = 'type'; static TYPE_SELECTOR_FIELD_NAME = 'typeSelector'; effectivity: Period | BoundedPeriod; locator: string; type: ElectronicAddressType; 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 = ElectronicAddress.TYPE_SELECTOR; this.effectivity = new Period(); 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 if (rawValues.effectivity && rawValues.effectivity.typeSelector && this.effectivity.typeSelector !== rawValues.effectivity.typeSelector) { this.effectivity = SubTypeFactory.createSubTypeInstance(rawValues.effectivity) as Period | BoundedPeriod; } this.effectivity.setValues(rawValues.effectivity); this.locator = this.getValue(rawValues, ElectronicAddress.LOCATOR_FIELD_NAME); this.type = this.getValue(rawValues, ElectronicAddress.TYPE_FIELD_NAME); this.typeSelector = this.getValue(rawValues, ElectronicAddress.TYPE_SELECTOR_FIELD_NAME); } } }