/** * 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 { TelecomType } from './enums'; export interface ITelephoneNumber { countryCode?: string; effectivity?: IPeriod | IBoundedPeriod; extension?: string; subscriberNumber?: string; type?: TelecomType; typeSelector?: string; } export class TelephoneNumber extends BaseModel implements ITelephoneNumber { static TYPE_SELECTOR = 'TelephoneNumber'; static COUNTRY_CODE_FIELD_NAME = 'countryCode'; static EFFECTIVITY_FIELD_NAME = 'effectivity'; static EXTENSION_FIELD_NAME = 'extension'; static SUBSCRIBER_NUMBER_FIELD_NAME = 'subscriberNumber'; static TYPE_FIELD_NAME = 'type'; static TYPE_SELECTOR_FIELD_NAME = 'typeSelector'; countryCode: string; effectivity: Period | BoundedPeriod; extension: string; subscriberNumber: string; type: TelecomType; 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 = TelephoneNumber.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 this.countryCode = this.getValue(rawValues, TelephoneNumber.COUNTRY_CODE_FIELD_NAME); 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.extension = this.getValue(rawValues, TelephoneNumber.EXTENSION_FIELD_NAME); this.subscriberNumber = this.getValue(rawValues, TelephoneNumber.SUBSCRIBER_NUMBER_FIELD_NAME); this.type = this.getValue(rawValues, TelephoneNumber.TYPE_FIELD_NAME); this.typeSelector = this.getValue(rawValues, TelephoneNumber.TYPE_SELECTOR_FIELD_NAME); } } }