/** * This file is generated by the SwaggerTSGenerator. * Do not edit. */ /* tslint:disable */ import { BaseModel } from './base-model'; import { SubTypeFactory } from './sub-type-factory'; import { ICategory, Category } from './category.model'; import { ITag, Tag } from './tag.model'; import { status } from './enums'; export interface IPet { id?: number; category?: ICategory; name: string; photoUrls: Array; tags?: Array; status?: status; } export class Pet extends BaseModel implements IPet { static ID_FIELD_NAME = 'id'; static CATEGORY_FIELD_NAME = 'category'; static NAME_FIELD_NAME = 'name'; static PHOTO_URLS_FIELD_NAME = 'photoUrls'; static TAGS_FIELD_NAME = 'tags'; static STATUS_FIELD_NAME = 'status'; id: number; category: Category; name: string; photoUrls: Array; tags: Array; /** pet status in the store */ status: status; /** * constructor * @param values Can be used to set a webapi response or formValues to this newly constructed model */ constructor(values?: Partial) { super(); this.category = new Category(); this.photoUrls = new Array(); this.tags = 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.id = this.getValue(rawValues, Pet.ID_FIELD_NAME); this.category.setValues(rawValues.category); this.name = this.getValue(rawValues, Pet.NAME_FIELD_NAME); this.fillModelArray(this, Pet.PHOTO_URLS_FIELD_NAME, rawValues.photoUrls); this.fillModelArray(this, Pet.TAGS_FIELD_NAME, rawValues.tags, Tag, SubTypeFactory.createSubTypeInstance); this.status = this.getValue(rawValues, Pet.STATUS_FIELD_NAME); } } }