/** * This file is generated by the SwaggerTSGenerator. * Do not edit. */ /* tslint:disable */ import { BaseModel } from './base-model'; import { SubTypeFactory } from './sub-type-factory'; import { IBureauLeader, BureauLeader } from './bureau-leader.model'; import { ICedent, Cedent } from './cedent.model'; import { ICoAgreementParty, CoAgreementParty } from './co-agreement-party.model'; import { IContractHolder, ContractHolder } from './contract-holder.model'; import { ICoverHolder, CoverHolder } from './cover-holder.model'; import { IFinancialBroker, FinancialBroker } from './financial-broker.model'; import { IInsuranceBroker, InsuranceBroker } from './insurance-broker.model'; import { IInsured, Insured } from './insured.model'; import { IPricingLeader, PricingLeader } from './pricing-leader.model'; import { IPrimaryInsurer, PrimaryInsurer } from './primary-insurer.model'; import { IProducingBroker, ProducingBroker } from './producing-broker.model'; import { IProducingContractHolder, ProducingContractHolder } from './producing-contract-holder.model'; import { IProducingInsurer, ProducingInsurer } from './producing-insurer.model'; import { IReinsurer, Reinsurer } from './reinsurer.model'; import { ISlipLeader, SlipLeader } from './slip-leader.model'; import { IStateChangeRecord, StateChangeRecord } from './state-change-record.model'; import { ClauseType } from './enums'; export interface IClause { addedFor?: IBureauLeader | ICedent | ICoAgreementParty | IContractHolder | ICoverHolder | IFinancialBroker | IInsuranceBroker | IInsured | IPricingLeader | IPrimaryInsurer | IProducingBroker | IProducingContractHolder | IProducingInsurer | IReinsurer | ISlipLeader; content: string; id?: string; number?: number; stateChangeRecordDtos?: Array; title: string; type?: ClauseType; typeSelector?: string; } export class Clause extends BaseModel implements IClause { static TYPE_SELECTOR = 'Clause'; static ADDED_FOR_FIELD_NAME = 'addedFor'; static CONTENT_FIELD_NAME = 'content'; static ID_FIELD_NAME = 'id'; static NUMBER_FIELD_NAME = 'number'; static STATE_CHANGE_RECORD_DTOS_FIELD_NAME = 'stateChangeRecordDtos'; static TITLE_FIELD_NAME = 'title'; static TYPE_FIELD_NAME = 'type'; static TYPE_SELECTOR_FIELD_NAME = 'typeSelector'; addedFor: BureauLeader | Cedent | CoAgreementParty | ContractHolder | CoverHolder | FinancialBroker | InsuranceBroker | Insured | PricingLeader | PrimaryInsurer | ProducingBroker | ProducingContractHolder | ProducingInsurer | Reinsurer | SlipLeader; content: string; id: string; number: number; stateChangeRecordDtos: Array; title: string; type: ClauseType; 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 = Clause.TYPE_SELECTOR; this.addedFor = new BureauLeader(); this.stateChangeRecordDtos = 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 if (rawValues.addedFor && rawValues.addedFor.typeSelector && this.addedFor.typeSelector !== rawValues.addedFor.typeSelector) { this.addedFor = SubTypeFactory.createSubTypeInstance(rawValues.addedFor) as BureauLeader | Cedent | CoAgreementParty | ContractHolder | CoverHolder | FinancialBroker | InsuranceBroker | Insured | PricingLeader | PrimaryInsurer | ProducingBroker | ProducingContractHolder | ProducingInsurer | Reinsurer | SlipLeader; } this.addedFor.setValues(rawValues.addedFor); this.content = this.getValue(rawValues, Clause.CONTENT_FIELD_NAME); this.id = this.getValue(rawValues, Clause.ID_FIELD_NAME); this.number = this.getValue(rawValues, Clause.NUMBER_FIELD_NAME); this.fillModelArray(this, Clause.STATE_CHANGE_RECORD_DTOS_FIELD_NAME, rawValues.stateChangeRecordDtos, StateChangeRecord, SubTypeFactory.createSubTypeInstance); this.title = this.getValue(rawValues, Clause.TITLE_FIELD_NAME); this.type = this.getValue(rawValues, Clause.TYPE_FIELD_NAME); this.typeSelector = this.getValue(rawValues, Clause.TYPE_SELECTOR_FIELD_NAME); } } }