Modify Identifer definition in swagger
[modeling/etsicatalog.git] / catalog / packages / serializers / vnf_pkg_notifications.py
index ee2b99c..c1dab6a 100644 (file)
@@ -43,7 +43,8 @@ class vnfProductsSerializer(serializers.Serializer):
         required=True,
         allow_null=False
     )
-    versions = VersionSerializer(
+    versions = serializers.ListField(
+        child=VersionSerializer(),
         help_text="match VNF packages that contain "
                   "VNF products with certain versions",
         required=False,
@@ -58,7 +59,8 @@ class vnfProductsProvidersSerializer(serializers.Serializer):
         required=True,
         allow_null=False
     )
-    vnfProducts = vnfProductsSerializer(
+    vnfProducts = serializers.ListField(
+        child=vnfProductsSerializer(),
         help_text="match VNF packages that contain "
                   "VNF products with certain product names, "
                   "from one particular provider",
@@ -77,21 +79,22 @@ class PkgmNotificationsFilter(serializers.Serializer):
         allow_null=False,
         required=False
     )
-    vnfProductsFromProviders = vnfProductsProvidersSerializer(
+    vnfProductsFromProviders = serializers.ListField(
+        child=vnfProductsProvidersSerializer(),
         help_text="Match VNF packages that contain "
                   "VNF products from certain providers.",
         allow_null=False,
         required=False
     )
     vnfdId = serializers.ListField(
-        child=serializers.UUIDField(),
+        child=serializers.CharField(),
         help_text="Match VNF packages with a VNFD identifier"
                   "listed in the attribute",
         required=False,
         allow_null=False
     )
     vnfPkgId = serializers.ListField(
-        child=serializers.UUIDField(),
+        child=serializers.CharField(),
         help_text="Match VNF packages with a VNFD identifier"
                   "listed in the attribute",
         required=False,
@@ -142,32 +145,35 @@ class PkgmLinksSerializer(serializers.Serializer):
     )
 
 
-class PkgNotificationSerializer(serializers.Serializer):
+class PkgChangeNotificationSerializer(serializers.Serializer):
     id = serializers.CharField(
         help_text="Identifier of this notification.",
         required=True,
         allow_null=False
     )
-    notificationTypes = serializers.ListField(
-        child=serializers.ChoiceField(
-            required=True,
-            choices=NOTIFICATION_TYPES
-        ),
+    notificationType = serializers.ChoiceField(
         help_text="Discriminator for the different notification types.",
-        allow_null=True,
-        required=False
+        choices=["VnfPackageChangeNotification"],
+        required=True,
+        allow_null=False
+    )
+    timeStamp = serializers.DateTimeField(
+        help_text="Date-time of the generation of the notification.",
+        format="%Y-%m-%d %H:%M:%S",
+        required=True,
+        allow_null=False
     )
     subscriptionId = serializers.CharField(
         help_text="Identifier of the subscription that this notification relates to.",
         required=True,
         allow_null=False
     )
-    vnfPkgId = serializers.UUIDField(
+    vnfPkgId = serializers.CharField(
         help_text="Identifier of the VNF package.",
         required=True,
         allow_null=False
     )
-    vnfdId = serializers.UUIDField(
+    vnfdId = serializers.CharField(
         help_text="This identifier, which is managed by the VNF provider, "
                   "identifies the VNF package and the VNFD in a globally unique way.",
         required=True,
@@ -176,7 +182,7 @@ class PkgNotificationSerializer(serializers.Serializer):
     changeType = serializers.ChoiceField(
         help_text="The type of change of the VNF package.",
         choices=PackageChangeType,
-        required=False,
+        required=True,
         allow_null=False
     )
     operationalState = serializers.ChoiceField(
@@ -196,3 +202,44 @@ class PkgNotificationSerializer(serializers.Serializer):
         required=True,
         allow_null=False
     )
+
+
+class PkgOnboardingNotificationSerializer(serializers.Serializer):
+    id = serializers.CharField(
+        help_text="Identifier of this notification.",
+        required=True,
+        allow_null=False
+    )
+    notificationType = serializers.ChoiceField(
+        help_text="Discriminator for the different notification types.",
+        choices=["VnfPackageOnboardingNotification"],
+        required=True,
+        allow_null=False
+    )
+    subscriptionId = serializers.CharField(
+        help_text="Identifier of the subscription that this notification relates to.",
+        required=True,
+        allow_null=False
+    )
+    timeStamp = serializers.DateTimeField(
+        help_text="Date-time of the generation of the notification.",
+        format="%Y-%m-%d %H:%M:%S",
+        required=True,
+        allow_null=False
+    )
+    vnfPkgId = serializers.CharField(
+        help_text="Identifier of the VNF package.",
+        required=True,
+        allow_null=False
+    )
+    vnfdId = serializers.CharField(
+        help_text="This identifier, which is managed by the VNF provider, "
+                  "identifies the VNF package and the VNFD in a globally unique way.",
+        required=True,
+        allow_null=False
+    )
+    _links = PkgmLinksSerializer(
+        help_text="Links to resources related to this resource.",
+        required=True,
+        allow_null=False
+    )