Michael Lando | dd60339 | 2017-07-12 00:54:52 +0300 | [diff] [blame] | 1 | /*- |
| 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 Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 21 | import {IMainCategory} from "./category"; |
| 22 | /** |
| 23 | * Created by obarda on 4/18/2017. |
| 24 | */ |
| 25 | export 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; |
| 50 | |
| 51 | //Resource only |
| 52 | public resourceType: string; |
| 53 | public csarUUID:string; |
| 54 | public csarVersion:string; |
| 55 | public derivedList: string[]; |
| 56 | public vendorName:string; |
| 57 | public vendorRelease:string; |
| 58 | public derivedFrom: Array<string>; |
Michael Lando | 75aacbb | 2017-07-17 21:12:03 +0300 | [diff] [blame] | 59 | public resourceVendorModelNumber:string; |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 60 | |
| 61 | //Service only |
| 62 | public projectCode:string; |
| 63 | public distributionStatus:string; |
| 64 | public ecompGeneratedNaming: boolean; |
| 65 | public namingPolicy: string; |
Michael Lando | 75aacbb | 2017-07-17 21:12:03 +0300 | [diff] [blame] | 66 | public serviceType:string; |
| 67 | public serviceRole:string; |
Idan Amit | 6cc9a11 | 2017-09-13 17:21:33 +0300 | [diff] [blame] | 68 | public environmentContext:string; |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 69 | |
| 70 | |
| 71 | //backend lifecycleState |
| 72 | public state:string; |
| 73 | |
| 74 | deserialize (response): ComponentMetadata { |
| 75 | this.abstract = response.abstract; |
| 76 | this.uniqueId = response.uniqueId; |
| 77 | this.uuid = response.uuid; |
| 78 | this.invariantUUID = response.invariantUUID; |
| 79 | this.contactId = response.contactId; |
| 80 | this.categories = response.categories; |
| 81 | this.creatorUserId = response.creatorUserId; |
| 82 | this.creationDate = response.creationDate; |
| 83 | this.creatorFullName = response.creatorFullName; |
| 84 | this.description = response.description; |
| 85 | this.icon = response.icon; |
| 86 | this.lastUpdateDate = response.lastUpdateDate; |
| 87 | this.lastUpdaterUserId = response.lastUpdaterUserId; |
| 88 | this.lastUpdaterFullName = response.lastUpdaterFullName; |
| 89 | this.lifecycleState = response.lifecycleState; |
| 90 | this.name = response.name; |
| 91 | this.version = response.version; |
| 92 | this.tags = angular.copy(response.tags, this.tags); |
| 93 | this.allVersions = response.allVersions; |
| 94 | this.componentType = response.componentType; |
| 95 | this.distributionStatus = response.distributionStatus; |
| 96 | this.highestVersion = response.highestVersion; |
| 97 | this.vendorName = response.vendorName; |
| 98 | this.vendorRelease = response.vendorRelease; |
| 99 | this.derivedList = response.derivedList; |
| 100 | this.normalizedName = response.normalizedName; |
| 101 | this.systemName = response.systemName; |
| 102 | this.projectCode = response.projectCode; |
| 103 | this.resourceType = response.resourceType; |
| 104 | this.csarUUID = response.csarUUID; |
Idan Amit | 6cc9a11 | 2017-09-13 17:21:33 +0300 | [diff] [blame] | 105 | this.csarVersion = response.csarVersion; |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 106 | this.state = response.state; |
| 107 | this.ecompGeneratedNaming = response.ecompGeneratedNaming; |
| 108 | this.namingPolicy = response.namingPolicy; |
| 109 | this.derivedFrom = response.derivedFrom; |
Michael Lando | 75aacbb | 2017-07-17 21:12:03 +0300 | [diff] [blame] | 110 | this.resourceVendorModelNumber = response.resourceVendorModelNumber; |
| 111 | this.serviceType = response.serviceType; |
| 112 | this.serviceRole = response.serviceRole; |
Idan Amit | 6cc9a11 | 2017-09-13 17:21:33 +0300 | [diff] [blame] | 113 | this.environmentContext = response.environmentContext; |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 114 | return this; |
| 115 | } |
| 116 | |
| 117 | } |