blob: 15fb4fb0c539c42086a25d74f3d192363f62c3a9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
import {NodeModel, NodeModelResponseInterface} from "./nodeModel";
import {VidNotions} from "./vidNotions";
export interface ServiceModelResponseInterface extends NodeModelResponseInterface{
serviceType: string;
serviceRole: string;
serviceEcompNaming: boolean;
vidNotions: any;
}
export class ServiceModel extends NodeModel{
serviceType: string;
serviceRole: string;
servicesQty: number;
isEcompGeneratedNaming: boolean;
isMultiStepDesign: boolean;
vidNotions?: VidNotions;
constructor(serviceModelJson?: any){
super(serviceModelJson.service);
if (serviceModelJson) {
const service: ServiceModelResponseInterface = serviceModelJson.service;
this.serviceType = service.serviceType;
this.serviceRole = service.serviceRole;
this.vidNotions= service.vidNotions;
this.isEcompGeneratedNaming = this.getServiceEcompNaming(service);
this.isMultiStepDesign = this.getIsMultiStepDesign(serviceModelJson);
}
}
private getServiceEcompNaming(serviceJson): boolean {
return serviceJson.serviceEcompNaming === "true";
};
private getIsMultiStepDesign(serviceModel): boolean {
for (let key in serviceModel.vnfs) {
const vnf = serviceModel.vnfs[key];
if (vnf.properties.multi_stage_design === "true") {
return true
}
}
return false;
}
}
|