/** * This file is generated by the SwaggerTSGenerator. * Do not edit. */ /* tslint:disable */ import { BaseModel } from './base-model'; import { SubTypeFactory } from './sub-type-factory'; import { IPeriod, Period } from './period.model'; import { IBoundedPeriod, BoundedPeriod } from './bounded-period.model'; import { ISoftReference, SoftReference } from './soft-reference.model'; import { IServiceProvision, ServiceProvision } from './service-provision.model'; import { BusinessNetworkMembershipType } from './enums'; export interface IBusinessNetworkMembership { effectivePeriod?: IPeriod | IBoundedPeriod; id?: string; lastUpdateDate?: Date; nodeInfo?: ISoftReference; party?: ISoftReference; services?: Array; type?: BusinessNetworkMembershipType; } export class BusinessNetworkMembership extends BaseModel implements IBusinessNetworkMembership { static EFFECTIVE_PERIOD_FIELD_NAME = 'effectivePeriod'; static ID_FIELD_NAME = 'id'; static LAST_UPDATE_DATE_FIELD_NAME = 'lastUpdateDate'; static NODE_INFO_FIELD_NAME = 'nodeInfo'; static PARTY_FIELD_NAME = 'party'; static SERVICES_FIELD_NAME = 'services'; static TYPE_FIELD_NAME = 'type'; effectivePeriod: Period | BoundedPeriod; id: string; lastUpdateDate: Date; nodeInfo: SoftReference; party: SoftReference; services: Array; type: BusinessNetworkMembershipType; /** * constructor * @param values Can be used to set a webapi response or formValues to this newly constructed model */ constructor(values?: Partial) { super(); this.effectivePeriod = new Period(); this.nodeInfo = new SoftReference(); this.party = new SoftReference(); this.services = 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.effectivePeriod && rawValues.effectivePeriod.typeSelector && this.effectivePeriod.typeSelector !== rawValues.effectivePeriod.typeSelector) { this.effectivePeriod = SubTypeFactory.createSubTypeInstance(rawValues.effectivePeriod) as Period | BoundedPeriod; } this.effectivePeriod.setValues(rawValues.effectivePeriod); this.id = this.getValue(rawValues, BusinessNetworkMembership.ID_FIELD_NAME); this.lastUpdateDate = this.getValue(rawValues, BusinessNetworkMembership.LAST_UPDATE_DATE_FIELD_NAME); this.nodeInfo.setValues(rawValues.nodeInfo); this.party.setValues(rawValues.party); this.fillModelArray(this, BusinessNetworkMembership.SERVICES_FIELD_NAME, rawValues.services, ServiceProvision, SubTypeFactory.createSubTypeInstance); this.type = this.getValue(rawValues, BusinessNetworkMembership.TYPE_FIELD_NAME); } } }