blob: 0f0a30d52984a2a4fb56f0c1fac8327b4ff9e5f9 [file] [log] [blame]
Michael Landodd603392017-07-12 00:54:52 +03001/*-
2 * ============LICENSE_START=======================================================
3 * SDC
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
19 */
20
Michael Landoed64b5e2017-06-09 03:19:04 +030021import {IMainCategory} from "./category";
22/**
23 * Created by obarda on 4/18/2017.
24 */
25export class ComponentMetadata {
26
27 public abstract:string;
28 public uniqueId:string;
29 public uuid:string;
30 public invariantUUID:string;
31 public name:string;
32 public version:string;
33 public creationDate:number;
34 public lastUpdateDate:number;
35 public description:string;
36 public lifecycleState:string;
37 public tags:Array<string>;
38 public icon:string;
39 public contactId:string;
40 public allVersions:any;
41 public creatorUserId:string;
42 public creatorFullName:string;
43 public lastUpdaterUserId:string;
44 public lastUpdaterFullName:string;
45 public componentType:string;
46 public categories:Array<IMainCategory>;
47 public highestVersion:boolean;
48 public normalizedName:string;
49 public systemName:string;
Michael Lando5b593492018-07-29 16:13:45 +030050 public archived:boolean;
51 public vspArchived: boolean;
miriame41ee9cb2019-03-04 13:49:15 +020052 public toscaResourceName: string;
Michael Landoed64b5e2017-06-09 03:19:04 +030053
54 //Resource only
55 public resourceType: string;
56 public csarUUID:string;
57 public csarVersion:string;
58 public derivedList: string[];
59 public vendorName:string;
60 public vendorRelease:string;
61 public derivedFrom: Array<string>;
Michael Lando75aacbb2017-07-17 21:12:03 +030062 public resourceVendorModelNumber:string;
Michael Landoed64b5e2017-06-09 03:19:04 +030063
64 //Service only
65 public projectCode:string;
66 public distributionStatus:string;
67 public ecompGeneratedNaming: boolean;
68 public namingPolicy: string;
Michael Lando75aacbb2017-07-17 21:12:03 +030069 public serviceType:string;
70 public serviceRole:string;
Idan Amit6cc9a112017-09-13 17:21:33 +030071 public environmentContext:string;
Michael Lando5b593492018-07-29 16:13:45 +030072 public instantiationType:string;
Michael Landoed64b5e2017-06-09 03:19:04 +030073
74
Michael Lando5b593492018-07-29 16:13:45 +030075
76 //backend lifecycleState
Michael Landoed64b5e2017-06-09 03:19:04 +030077 public state:string;
78
79 deserialize (response): ComponentMetadata {
80 this.abstract = response.abstract;
81 this.uniqueId = response.uniqueId;
82 this.uuid = response.uuid;
83 this.invariantUUID = response.invariantUUID;
84 this.contactId = response.contactId;
85 this.categories = response.categories;
86 this.creatorUserId = response.creatorUserId;
87 this.creationDate = response.creationDate;
88 this.creatorFullName = response.creatorFullName;
89 this.description = response.description;
90 this.icon = response.icon;
91 this.lastUpdateDate = response.lastUpdateDate;
92 this.lastUpdaterUserId = response.lastUpdaterUserId;
93 this.lastUpdaterFullName = response.lastUpdaterFullName;
94 this.lifecycleState = response.lifecycleState;
95 this.name = response.name;
96 this.version = response.version;
97 this.tags = angular.copy(response.tags, this.tags);
98 this.allVersions = response.allVersions;
99 this.componentType = response.componentType;
100 this.distributionStatus = response.distributionStatus;
101 this.highestVersion = response.highestVersion;
102 this.vendorName = response.vendorName;
103 this.vendorRelease = response.vendorRelease;
104 this.derivedList = response.derivedList;
105 this.normalizedName = response.normalizedName;
106 this.systemName = response.systemName;
107 this.projectCode = response.projectCode;
108 this.resourceType = response.resourceType;
109 this.csarUUID = response.csarUUID;
Idan Amit6cc9a112017-09-13 17:21:33 +0300110 this.csarVersion = response.csarVersion;
Michael Landoed64b5e2017-06-09 03:19:04 +0300111 this.state = response.state;
112 this.ecompGeneratedNaming = response.ecompGeneratedNaming;
113 this.namingPolicy = response.namingPolicy;
114 this.derivedFrom = response.derivedFrom;
Michael Lando75aacbb2017-07-17 21:12:03 +0300115 this.resourceVendorModelNumber = response.resourceVendorModelNumber;
116 this.serviceType = response.serviceType;
117 this.serviceRole = response.serviceRole;
Idan Amit6cc9a112017-09-13 17:21:33 +0300118 this.environmentContext = response.environmentContext;
Michael Lando5b593492018-07-29 16:13:45 +0300119 this.archived = response.archived;
120 this.instantiationType = response.instantiationType;
121 this.vspArchived = response.vspArchived;
miriame41ee9cb2019-03-04 13:49:15 +0200122 this.toscaResourceName = response.toscaResourceName;
Michael Landoed64b5e2017-06-09 03:19:04 +0300123 return this;
124 }
125
126}