/** * 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'; export interface ICurrencyMasterData { alphabeticCode?: string; decimals?: number; definition?: string; majorUnitSymbol?: string; name?: string; validity?: IPeriod | IBoundedPeriod; } export class CurrencyMasterData extends BaseModel implements ICurrencyMasterData { static ALPHABETIC_CODE_FIELD_NAME = 'alphabeticCode'; static DECIMALS_FIELD_NAME = 'decimals'; static DEFINITION_FIELD_NAME = 'definition'; static MAJOR_UNIT_SYMBOL_FIELD_NAME = 'majorUnitSymbol'; static NAME_FIELD_NAME = 'name'; static VALIDITY_FIELD_NAME = 'validity'; alphabeticCode: string; decimals: number; definition: string; majorUnitSymbol: string; name: string; validity: Period | BoundedPeriod; /** * constructor * @param values Can be used to set a webapi response or formValues to this newly constructed model */ constructor(values?: Partial) { super(); this.validity = 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.alphabeticCode = this.getValue(rawValues, CurrencyMasterData.ALPHABETIC_CODE_FIELD_NAME); this.decimals = this.getValue(rawValues, CurrencyMasterData.DECIMALS_FIELD_NAME); this.definition = this.getValue(rawValues, CurrencyMasterData.DEFINITION_FIELD_NAME); this.majorUnitSymbol = this.getValue(rawValues, CurrencyMasterData.MAJOR_UNIT_SYMBOL_FIELD_NAME); this.name = this.getValue(rawValues, CurrencyMasterData.NAME_FIELD_NAME); if (rawValues.validity && rawValues.validity.typeSelector && this.validity.typeSelector !== rawValues.validity.typeSelector) { this.validity = SubTypeFactory.createSubTypeInstance(rawValues.validity) as Period | BoundedPeriod; } this.validity.setValues(rawValues.validity); } } }