/** * This file is generated by the SwaggerTSGenerator. * Do not edit. */ /* tslint:disable */ import { BaseModel } from './base-model'; import { SubTypeFactory } from './sub-type-factory'; import { ISoftReference, SoftReference } from './soft-reference.model'; import { DocumentStatus } from './enums'; import { DocumentType } from './enums'; export interface IDocument { createdAt?: Date; file?: ISoftReference; id?: string; lastModifiedAt?: Date; name?: string; owner?: ISoftReference; status?: DocumentStatus; title?: string; type?: DocumentType; } export class Document extends BaseModel implements IDocument { static CREATED_AT_FIELD_NAME = 'createdAt'; static FILE_FIELD_NAME = 'file'; static ID_FIELD_NAME = 'id'; static LAST_MODIFIED_AT_FIELD_NAME = 'lastModifiedAt'; static NAME_FIELD_NAME = 'name'; static OWNER_FIELD_NAME = 'owner'; static STATUS_FIELD_NAME = 'status'; static TITLE_FIELD_NAME = 'title'; static TYPE_FIELD_NAME = 'type'; createdAt: Date; file: SoftReference; id: string; lastModifiedAt: Date; name: string; owner: SoftReference; status: DocumentStatus; title: string; type: DocumentType; /** * constructor * @param values Can be used to set a webapi response or formValues to this newly constructed model */ constructor(values?: Partial) { super(); this.file = new SoftReference(); this.owner = new SoftReference(); 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.createdAt = this.getValue(rawValues, Document.CREATED_AT_FIELD_NAME); this.file.setValues(rawValues.file); this.id = this.getValue(rawValues, Document.ID_FIELD_NAME); this.lastModifiedAt = this.getValue(rawValues, Document.LAST_MODIFIED_AT_FIELD_NAME); this.name = this.getValue(rawValues, Document.NAME_FIELD_NAME); this.owner.setValues(rawValues.owner); this.status = this.getValue(rawValues, Document.STATUS_FIELD_NAME); this.title = this.getValue(rawValues, Document.TITLE_FIELD_NAME); this.type = this.getValue(rawValues, Document.TYPE_FIELD_NAME); } } }