summaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/shared/models/vnfModel.ts
diff options
context:
space:
mode:
Diffstat (limited to 'vid-webpack-master/src/app/shared/models/vnfModel.ts')
-rw-r--r--vid-webpack-master/src/app/shared/models/vnfModel.ts52
1 files changed, 52 insertions, 0 deletions
diff --git a/vid-webpack-master/src/app/shared/models/vnfModel.ts b/vid-webpack-master/src/app/shared/models/vnfModel.ts
new file mode 100644
index 000000000..e1302f1d0
--- /dev/null
+++ b/vid-webpack-master/src/app/shared/models/vnfModel.ts
@@ -0,0 +1,52 @@
+import {NodeModel, NodeModelResponseInterface} from "./nodeModel";
+import {VfcInstanceGroupMap} from "./vfcInstanceGroupMap";
+
+
+export interface VnfProperties {
+ ecomp_generated_naming: string
+}
+
+export interface VNFModelResponseInterface extends NodeModelResponseInterface{
+
+ serviceType: string;
+ serviceRole: string;
+ subCategory: string;
+ customizationUuid: string;
+ serviceEcompNaming: boolean;
+ type: string;
+ modelCustomizationName: string;
+ properties: VnfProperties;
+ vfcInstanceGroups: VfcInstanceGroupMap;
+}
+
+export class VNFModel extends NodeModel{
+
+ serviceType: string;
+ serviceRole: string;
+ subCategory: string;
+ customizationUuid: string;
+ isUserProvidedNaming: boolean;
+ type: string;
+ modelCustomizationName: string;
+ vfcInstanceGroups: VfcInstanceGroupMap;
+
+ constructor(vnfJson?: VNFModelResponseInterface){
+ super(vnfJson);
+ if (vnfJson) {
+ this.serviceType = vnfJson.serviceType;
+ this.serviceRole = vnfJson.serviceRole;
+ this.subCategory = vnfJson.subCategory;
+ this.customizationUuid = vnfJson.customizationUuid;
+ this.isUserProvidedNaming = this.getIsUserProvidedName(vnfJson);
+ this.type = vnfJson.type;
+ this.modelCustomizationName = vnfJson.modelCustomizationName;
+ this.vfcInstanceGroups = vnfJson.vfcInstanceGroups;
+
+ }
+ }
+
+ private getIsUserProvidedName(vnfJson) {
+ const ecompGeneratedNaming = vnfJson.properties.ecomp_generated_naming;
+ return ecompGeneratedNaming !== undefined && ecompGeneratedNaming === "false";
+ };
+}