3ef334ffd510acbe678eedb030a6549b8848f43b
[ccsdk/dashboard.git] /
1 package org.onap.ccsdk.dashboard.model.inventory;
2
3 import java.util.Collection;
4 import java.util.Optional;
5
6 import com.fasterxml.jackson.annotation.JsonCreator;
7 import com.fasterxml.jackson.annotation.JsonProperty;
8
9 public class ServiceTypeUploadRequest {
10
11         /** Owner of the Service Type */
12         public String owner;
13         /** Name of the Service Type */
14         public String typeName;
15         /** Version number of the Service Type */
16         public Integer typeVersion;
17         /** String representation of a Cloudify blueprint with unbound variables */
18         public String blueprintTemplate;
19         /** Application controller name */
20         public String application;
21         /** onboarding component name */
22         public String component;
23
24         @JsonCreator
25         public ServiceTypeUploadRequest(@JsonProperty("owner") String owner, 
26                         @JsonProperty("typeName") String typeName,
27                         @JsonProperty("typeVersion") Integer typeVersion,
28                         @JsonProperty("blueprintTemplate") String blueprintTemplate,
29                         @JsonProperty("application") String application,
30                         @JsonProperty("component") String component ) {
31                         this.owner = owner;
32                         this.typeName = typeName;
33                         this.typeVersion = typeVersion;
34                         this.blueprintTemplate = blueprintTemplate;
35                         this.application = application;
36                         this.component = component;
37         }
38
39         public static ServiceTypeUploadRequest from(ServiceType serviceType) {
40                 return new ServiceTypeUploadRequest(serviceType.getOwner(), serviceType.getTypeName(),
41                                 serviceType.getTypeVersion(), serviceType.getBlueprintTemplate(),
42                                 serviceType.getApplication(), serviceType.getComponent());
43         }
44         public String getBlueprintTemplate() {
45                 return this.blueprintTemplate;
46
47         }
48 }