/** * This file is generated by the SwaggerTSGenerator. * Do not edit. */ /* tslint:disable */ import { BaseModel } from './base-model'; import { SubTypeFactory } from './sub-type-factory'; import { IDocument, Document } from './document.model'; import { IGrossNetAmount, GrossNetAmount } from './gross-net-amount.model'; import { ISoftReference, SoftReference } from './soft-reference.model'; import { IPeriod, Period } from './period.model'; import { IBoundedPeriod, BoundedPeriod } from './bounded-period.model'; import { LossStatus } from './enums'; import { TransactionStatus } from './enums'; export interface ILossSummary { asOf?: Date; currency?: string; documents?: Array; grossNetAmounts?: Array; id?: string; lossEvent?: ISoftReference; lossPeriod?: IPeriod | IBoundedPeriod; name?: string; nrOfOpenTasks?: number; nrOfUnreadMessages?: number; shared?: boolean; status?: LossStatus; transactionStatus?: TransactionStatus; version?: number; versionCreatedAt?: Date; } export class LossSummary extends BaseModel implements ILossSummary { static AS_OF_FIELD_NAME = 'asOf'; static CURRENCY_FIELD_NAME = 'currency'; static DOCUMENTS_FIELD_NAME = 'documents'; static GROSS_NET_AMOUNTS_FIELD_NAME = 'grossNetAmounts'; static ID_FIELD_NAME = 'id'; static LOSS_EVENT_FIELD_NAME = 'lossEvent'; static LOSS_PERIOD_FIELD_NAME = 'lossPeriod'; static NAME_FIELD_NAME = 'name'; static NR_OF_OPEN_TASKS_FIELD_NAME = 'nrOfOpenTasks'; static NR_OF_UNREAD_MESSAGES_FIELD_NAME = 'nrOfUnreadMessages'; static SHARED_FIELD_NAME = 'shared'; static STATUS_FIELD_NAME = 'status'; static TRANSACTION_STATUS_FIELD_NAME = 'transactionStatus'; static VERSION_FIELD_NAME = 'version'; static VERSION_CREATED_AT_FIELD_NAME = 'versionCreatedAt'; asOf: Date; currency: string; documents: Array; grossNetAmounts: Array; id: string; lossEvent: SoftReference; lossPeriod: Period | BoundedPeriod; name: string; nrOfOpenTasks: number; nrOfUnreadMessages: number; shared: boolean; status: LossStatus; transactionStatus: TransactionStatus; version: number; versionCreatedAt: Date; /** * constructor * @param values Can be used to set a webapi response or formValues to this newly constructed model */ constructor(values?: Partial) { super(); this.documents = new Array(); this.grossNetAmounts = new Array(); this.lossEvent = new SoftReference(); this.lossPeriod = 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.asOf = this.getValue(rawValues, LossSummary.AS_OF_FIELD_NAME); this.currency = this.getValue(rawValues, LossSummary.CURRENCY_FIELD_NAME); this.fillModelArray(this, LossSummary.DOCUMENTS_FIELD_NAME, rawValues.documents, Document, SubTypeFactory.createSubTypeInstance); this.fillModelArray(this, LossSummary.GROSS_NET_AMOUNTS_FIELD_NAME, rawValues.grossNetAmounts, GrossNetAmount, SubTypeFactory.createSubTypeInstance); this.id = this.getValue(rawValues, LossSummary.ID_FIELD_NAME); this.lossEvent.setValues(rawValues.lossEvent); if (rawValues.lossPeriod && rawValues.lossPeriod.typeSelector && this.lossPeriod.typeSelector !== rawValues.lossPeriod.typeSelector) { this.lossPeriod = SubTypeFactory.createSubTypeInstance(rawValues.lossPeriod) as Period | BoundedPeriod; } this.lossPeriod.setValues(rawValues.lossPeriod); this.name = this.getValue(rawValues, LossSummary.NAME_FIELD_NAME); this.nrOfOpenTasks = this.getValue(rawValues, LossSummary.NR_OF_OPEN_TASKS_FIELD_NAME); this.nrOfUnreadMessages = this.getValue(rawValues, LossSummary.NR_OF_UNREAD_MESSAGES_FIELD_NAME); this.shared = this.getValue(rawValues, LossSummary.SHARED_FIELD_NAME); this.status = this.getValue(rawValues, LossSummary.STATUS_FIELD_NAME); this.transactionStatus = this.getValue(rawValues, LossSummary.TRANSACTION_STATUS_FIELD_NAME); this.version = this.getValue(rawValues, LossSummary.VERSION_FIELD_NAME); this.versionCreatedAt = this.getValue(rawValues, LossSummary.VERSION_CREATED_AT_FIELD_NAME); } } }