/** * This file is generated by the SwaggerTSGenerator. * Do not edit. */ /* tslint:disable */ import { BaseModel } from './base-model'; import { SubTypeFactory } from './sub-type-factory'; import { IMoney, Money } from './money.model'; import { IInsurer, Insurer } from './insurer.model'; import { ShareType } from './enums'; export interface IShare { amount?: IMoney; insurer?: IInsurer; rate?: string; timestamp?: Date; type?: ShareType; } export class Share extends BaseModel implements IShare { static AMOUNT_FIELD_NAME = 'amount'; static INSURER_FIELD_NAME = 'insurer'; static RATE_FIELD_NAME = 'rate'; static TIMESTAMP_FIELD_NAME = 'timestamp'; static TYPE_FIELD_NAME = 'type'; amount: Money; insurer: Insurer; rate: string; timestamp: Date; type: ShareType; /** * constructor * @param values Can be used to set a webapi response or formValues to this newly constructed model */ constructor(values?: Partial) { super(); this.amount = new Money(); this.insurer = new Insurer(); 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.amount.setValues(rawValues.amount); this.insurer.setValues(rawValues.insurer); this.rate = this.getValue(rawValues, Share.RATE_FIELD_NAME); this.timestamp = this.getValue(rawValues, Share.TIMESTAMP_FIELD_NAME); this.type = this.getValue(rawValues, Share.TYPE_FIELD_NAME); } } }