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>; |
| 59 | |
| 60 | //Service only |
| 61 | public projectCode:string; |
| 62 | public distributionStatus:string; |
| 63 | public ecompGeneratedNaming: boolean; |
| 64 | public namingPolicy: string; |
| 65 | |
| 66 | |
| 67 | //backend lifecycleState |
| 68 | public state:string; |
| 69 | |
| 70 | deserialize (response): ComponentMetadata { |
| 71 | this.abstract = response.abstract; |
| 72 | this.uniqueId = response.uniqueId; |
| 73 | this.uuid = response.uuid; |
| 74 | this.invariantUUID = response.invariantUUID; |
| 75 | this.contactId = response.contactId; |
| 76 | this.categories = response.categories; |
| 77 | this.creatorUserId = response.creatorUserId; |
| 78 | this.creationDate = response.creationDate; |
| 79 | this.creatorFullName = response.creatorFullName; |
| 80 | this.description = response.description; |
| 81 | this.icon = response.icon; |
| 82 | this.lastUpdateDate = response.lastUpdateDate; |
| 83 | this.lastUpdaterUserId = response.lastUpdaterUserId; |
| 84 | this.lastUpdaterFullName = response.lastUpdaterFullName; |
| 85 | this.lifecycleState = response.lifecycleState; |
| 86 | this.name = response.name; |
| 87 | this.version = response.version; |
| 88 | this.tags = angular.copy(response.tags, this.tags); |
| 89 | this.allVersions = response.allVersions; |
| 90 | this.componentType = response.componentType; |
| 91 | this.distributionStatus = response.distributionStatus; |
| 92 | this.highestVersion = response.highestVersion; |
| 93 | this.vendorName = response.vendorName; |
| 94 | this.vendorRelease = response.vendorRelease; |
| 95 | this.derivedList = response.derivedList; |
| 96 | this.normalizedName = response.normalizedName; |
| 97 | this.systemName = response.systemName; |
| 98 | this.projectCode = response.projectCode; |
| 99 | this.resourceType = response.resourceType; |
| 100 | this.csarUUID = response.csarUUID; |
| 101 | this.csarVersion = response.version; |
| 102 | this.state = response.state; |
| 103 | this.ecompGeneratedNaming = response.ecompGeneratedNaming; |
| 104 | this.namingPolicy = response.namingPolicy; |
| 105 | this.derivedFrom = response.derivedFrom; |
| 106 | return this; |
| 107 | } |
| 108 | |
| 109 | } |