summaryrefslogtreecommitdiffstats
path: root/nokiav2/generatedapis/src/main/resources/patch
blob: e19dd1a0c3f717382930c4ae3e953905e7a1e7f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
diff -Naur old/cbam/src/gen/java/main/com/nokia/cbam/lcm/v32/JSON.java new/cbam/src/gen/java/main/com/nokia/cbam/lcm/v32/JSON.java
--- old/cbam/src/gen/java/main/com/nokia/cbam/lcm/v32/JSON.java	2018-02-19 17:32:34.000000000 +0100
+++ new/cbam/src/gen/java/main/com/nokia/cbam/lcm/v32/JSON.java	2018-02-19 17:34:43.000000000 +0100
@@ -13,14 +13,12 @@
 
 package com.nokia.cbam.lcm.v32;
 
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.google.gson.JsonParseException;
-import com.google.gson.TypeAdapter;
+import com.google.gson.*;
+import com.google.gson.internal.Streams;
 import com.google.gson.internal.bind.util.ISO8601Utils;
 import com.google.gson.stream.JsonReader;
+import com.google.gson.stream.JsonToken;
 import com.google.gson.stream.JsonWriter;
-import com.google.gson.JsonElement;
 import io.gsonfire.GsonFireBuilder;
 import io.gsonfire.TypeSelector;
 import org.threeten.bp.LocalDate;
@@ -46,6 +44,8 @@
     private SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter();
     private OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter();
     private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter();
+    private VimInfoTypeAdapter vimInfoTypeAdapter = new VimInfoTypeAdapter();
+    private LcnAdapter lcnAdapter = new LcnAdapter();
 
     public static GsonBuilder createGson() {
         GsonFireBuilder fireBuilder = new GsonFireBuilder()
@@ -75,6 +75,8 @@
             .registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter)
             .registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter)
             .registerTypeAdapter(LocalDate.class, localDateTypeAdapter)
+            .registerTypeAdapter(VimInfo.class, vimInfoTypeAdapter)
+            .registerTypeAdapter(AbstractVnfNotification.class, lcnAdapter)
             .create();
     }
 
@@ -349,6 +351,67 @@
         }
     }
 
+    static abstract class AbstractTypeAdapter<T> extends TypeAdapter<T>{
+
+        @Override
+        public void write(JsonWriter out, T value) throws IOException {
+            out.jsonValue(new Gson().toJson(value));
+        }
+
+        @Override
+        public T read(JsonReader in) throws IOException {
+            switch (in.peek()) {
+                case NULL:
+                    in.nextNull();
+                    return null;
+                default:
+                    JsonElement object = Streams.parse(in);
+                    String type = object.getAsJsonObject().get(getTypeField()).getAsString();
+                    Type typeOfT = getTypeMap().get(type);
+                    return new Gson().fromJson(object, typeOfT);
+            }
+        }
+
+        abstract protected String getTypeField();
+        abstract protected Map<String, Type> getTypeMap();
+
+    }
+
+    public static class VimInfoTypeAdapter extends AbstractTypeAdapter<VimInfo> {
+
+        @Override
+        protected String getTypeField() {
+            return "vimInfoType";
+        }
+
+        @Override
+        protected Map<String, Type> getTypeMap() {
+            Map<String,Type> myMap = new HashMap<String,Type>();
+            myMap.put(VimInfo.VimInfoTypeEnum.OPENSTACK_V2_INFO.name(), OPENSTACKV2INFO.class);
+            myMap.put(VimInfo.VimInfoTypeEnum.OPENSTACK_V3_INFO.name(), OPENSTACKV3INFO.class);
+            myMap.put(VimInfo.VimInfoTypeEnum.VMWARE_VCLOUD_INFO.name(), VMWAREVCLOUDINFO.class);
+            return myMap;
+        }
+    }
+
+    public static class LcnAdapter extends AbstractTypeAdapter<AbstractVnfNotification>{
+        @Override
+        protected String getTypeField() {
+            return "notificationType";
+        }
+
+        @Override
+        protected Map<String, Type> getTypeMap() {
+            Map<String,Type> myMap = new HashMap<String,Type>();
+            myMap.put(VnfNotificationType.VNFIDENTIFIERCREATIONNOTIFICATION.name(), VnfIdentifierCreationNotification.class);
+            myMap.put(VnfNotificationType.VNFIDENTIFIERDELETIONNOTIFICATION.name(), VnfIdentifierDeletionNotification.class);
+            myMap.put(VnfNotificationType.VNFINFOATTRIBUTEVALUECHANGENOTIFICATION.name(), VnfInfoAttributeValueChangeNotification.class);
+            myMap.put(VnfNotificationType.VNFLIFECYCLECHANGENOTIFICATION.name(), VnfLifecycleChangeNotification.class);
+            myMap.put(VnfNotificationType.OTHERNOTIFICATION.name(), OtherNotification.class);
+            return myMap;
+        }
+    }
+
     public JSON setDateFormat(DateFormat dateFormat) {
         dateTypeAdapter.setFormat(dateFormat);
         return this;
diff -Naur old/cbam/src/gen/java/main/com/nokia/cbam/lcm/v32/model/OTHERVIMINFO.java new/cbam/src/gen/java/main/com/nokia/cbam/lcm/v32/model/OTHERVIMINFO.java
--- old/cbam/src/gen/java/main/com/nokia/cbam/lcm/v32/model/OTHERVIMINFO.java	2018-02-19 17:32:33.000000000 +0100
+++ new/cbam/src/gen/java/main/com/nokia/cbam/lcm/v32/model/OTHERVIMINFO.java	2018-02-19 17:34:43.000000000 +0100
@@ -43,13 +43,13 @@
       return false;
     }
     OTHERVIMINFO OTHER_VIM_INFO = (OTHERVIMINFO) o;
-    return  &&
+    return
         super.equals(o);
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(, super.hashCode());
+    return Objects.hash( super.hashCode());
   }
 
 
diff -Naur old/cbam/src/gen/java/main/com/nokia/cbam/lcm/v32/model/OtherNotification.java new/cbam/src/gen/java/main/com/nokia/cbam/lcm/v32/model/OtherNotification.java
--- old/cbam/src/gen/java/main/com/nokia/cbam/lcm/v32/model/OtherNotification.java	2018-02-19 17:32:33.000000000 +0100
+++ new/cbam/src/gen/java/main/com/nokia/cbam/lcm/v32/model/OtherNotification.java	2018-02-19 17:34:43.000000000 +0100
@@ -45,13 +45,13 @@
       return false;
     }
     OtherNotification otherNotification = (OtherNotification) o;
-    return  &&
+    return
         super.equals(o);
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(, super.hashCode());
+    return Objects.hash( super.hashCode());
   }
 
 
diff -Naur old/cbam/src/gen/java/main/com/nokia/cbam/lcm/v32/model/VnfIdentifierCreationNotification.java new/cbam/src/gen/java/main/com/nokia/cbam/lcm/v32/model/VnfIdentifierCreationNotification.java
--- old/cbam/src/gen/java/main/com/nokia/cbam/lcm/v32/model/VnfIdentifierCreationNotification.java	2018-02-19 17:32:33.000000000 +0100
+++ new/cbam/src/gen/java/main/com/nokia/cbam/lcm/v32/model/VnfIdentifierCreationNotification.java	2018-02-19 17:34:43.000000000 +0100
@@ -45,13 +45,13 @@
       return false;
     }
     VnfIdentifierCreationNotification vnfIdentifierCreationNotification = (VnfIdentifierCreationNotification) o;
-    return  &&
+    return
         super.equals(o);
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(, super.hashCode());
+    return Objects.hash(super.hashCode());
   }
 
 
diff -Naur old/cbam/src/gen/java/main/com/nokia/cbam/lcm/v32/model/VnfIdentifierDeletionNotification.java new/cbam/src/gen/java/main/com/nokia/cbam/lcm/v32/model/VnfIdentifierDeletionNotification.java
--- old/cbam/src/gen/java/main/com/nokia/cbam/lcm/v32/model/VnfIdentifierDeletionNotification.java	2018-02-19 17:32:33.000000000 +0100
+++ new/cbam/src/gen/java/main/com/nokia/cbam/lcm/v32/model/VnfIdentifierDeletionNotification.java	2018-02-19 17:34:43.000000000 +0100
@@ -45,13 +45,13 @@
       return false;
     }
     VnfIdentifierDeletionNotification vnfIdentifierDeletionNotification = (VnfIdentifierDeletionNotification) o;
-    return  &&
+    return
         super.equals(o);
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(, super.hashCode());
+    return Objects.hash( super.hashCode());
   }
 
 
diff -Naur old/cbam/src/gen/java/main/com/nokia/cbam/lcm/v32/model/VnfProperty.java new/cbam/src/gen/java/main/com/nokia/cbam/lcm/v32/model/VnfProperty.java
--- old/cbam/src/gen/java/main/com/nokia/cbam/lcm/v32/model/VnfProperty.java	2018-02-19 17:32:33.000000000 +0100
+++ new/cbam/src/gen/java/main/com/nokia/cbam/lcm/v32/model/VnfProperty.java	2018-02-19 17:38:08.000000000 +0100
@@ -40,6 +40,10 @@
   @SerializedName("description")
   private String description = null;
 
+  @XmlElement(name = "value")
+  @SerializedName("value")
+  private Object value = null;
+  
   public VnfProperty name(String name) {
     this.name = name;
     return this;
@@ -76,6 +80,18 @@
     this.description = description;
   }
 
+   /**
+   * The value of the respective property 
+   * @return value
+  **/
+  @ApiModelProperty(value = "The value of the respective property ")
+  public Object getValue() {
+    return value;
+  }
+
+  public void setValue(Object value) {
+    this.value = value;
+  }
 
   @Override
   public boolean equals(java.lang.Object o) {
@@ -87,12 +103,13 @@
     }
     VnfProperty vnfProperty = (VnfProperty) o;
     return Objects.equals(this.name, vnfProperty.name) &&
+        Objects.equals(this.value, vnfProperty.value) &&
         Objects.equals(this.description, vnfProperty.description);
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(name, description);
+    return Objects.hash(name, description, value);
   }
 
 
@@ -102,6 +119,7 @@
     sb.append("class VnfProperty {\n");
     
     sb.append("    name: ").append(toIndentedString(name)).append("\n");
+    sb.append("    value: ").append(toIndentedString(value)).append("\n");
     sb.append("    description: ").append(toIndentedString(description)).append("\n");
     sb.append("}");
     return sb.toString();