/** * This file is generated by the SwaggerTSGenerator. * Do not edit. */ /* tslint:disable */ import { BaseModel } from './base-model'; import { SubTypeFactory } from './sub-type-factory'; import { ICountrySubdivision, CountrySubdivision } from './country-subdivision.model'; export interface ICountry { code?: string; name?: string; subdivisions?: Array; typeSelector?: string; } export class Country extends BaseModel implements ICountry { static TYPE_SELECTOR = 'Country'; static CODE_FIELD_NAME = 'code'; static NAME_FIELD_NAME = 'name'; static SUBDIVISIONS_FIELD_NAME = 'subdivisions'; static TYPE_SELECTOR_FIELD_NAME = 'typeSelector'; code: string; name: string; subdivisions: Array; 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 = Country.TYPE_SELECTOR; this.subdivisions = new Array(); 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.code = this.getValue(rawValues, Country.CODE_FIELD_NAME); this.name = this.getValue(rawValues, Country.NAME_FIELD_NAME); this.fillModelArray(this, Country.SUBDIVISIONS_FIELD_NAME, rawValues.subdivisions, CountrySubdivision, SubTypeFactory.createSubTypeInstance); this.typeSelector = this.getValue(rawValues, Country.TYPE_SELECTOR_FIELD_NAME); } } }