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; |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame] | 50 | public archived:boolean; |
| 51 | public vspArchived: boolean; |
miriame | 41ee9cb | 2019-03-04 13:49:15 +0200 | [diff] [blame] | 52 | public toscaResourceName: string; |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 53 | |
| 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 Lando | 75aacbb | 2017-07-17 21:12:03 +0300 | [diff] [blame] | 62 | public resourceVendorModelNumber:string; |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 63 | |
| 64 | //Service only |
| 65 | public projectCode:string; |
| 66 | public distributionStatus:string; |
| 67 | public ecompGeneratedNaming: boolean; |
| 68 | public namingPolicy: string; |
Michael Lando | 75aacbb | 2017-07-17 21:12:03 +0300 | [diff] [blame] | 69 | public serviceType:string; |
| 70 | public serviceRole:string; |
Idan Amit | 6cc9a11 | 2017-09-13 17:21:33 +0300 | [diff] [blame] | 71 | public environmentContext:string; |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame] | 72 | public instantiationType:string; |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 73 | |
| 74 | |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame] | 75 | |
| 76 | //backend lifecycleState |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 77 | 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 Amit | 6cc9a11 | 2017-09-13 17:21:33 +0300 | [diff] [blame] | 110 | this.csarVersion = response.csarVersion; |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 111 | this.state = response.state; |
| 112 | this.ecompGeneratedNaming = response.ecompGeneratedNaming; |
| 113 | this.namingPolicy = response.namingPolicy; |
| 114 | this.derivedFrom = response.derivedFrom; |
Michael Lando | 75aacbb | 2017-07-17 21:12:03 +0300 | [diff] [blame] | 115 | this.resourceVendorModelNumber = response.resourceVendorModelNumber; |
| 116 | this.serviceType = response.serviceType; |
| 117 | this.serviceRole = response.serviceRole; |
Idan Amit | 6cc9a11 | 2017-09-13 17:21:33 +0300 | [diff] [blame] | 118 | this.environmentContext = response.environmentContext; |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame] | 119 | this.archived = response.archived; |
| 120 | this.instantiationType = response.instantiationType; |
| 121 | this.vspArchived = response.vspArchived; |
miriame | 41ee9cb | 2019-03-04 13:49:15 +0200 | [diff] [blame] | 122 | this.toscaResourceName = response.toscaResourceName; |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 123 | return this; |
| 124 | } |
| 125 | |
| 126 | } |