Define the schema 54/13454/1
authorMartin Skorupski <martin.skorupski@highstreet-technologies.com>
Wed, 25 Sep 2024 12:44:37 +0000 (14:44 +0200)
committerMartin Skorupski <martin.skorupski@highstreet-technologies.com>
Wed, 25 Sep 2024 12:44:37 +0000 (14:44 +0200)
- house keeping

Issue-ID: OAM-415
Change-Id: I304a65915aa37296e96a608f49e7df710726c328
Signed-off-by: Martin Skorupski <martin.skorupski@highstreet-technologies.com>
code/network-generator/network_generation/model/python/o_ran_object.py

index 66a2633..5e1789c 100644 (file)
@@ -42,6 +42,7 @@ class ORanObject(Top):
             **super().json(),
             "id": self.id,
             "name": self.name,
+            "type": self.type,
             "administrativeState": self.administrativeState,
             "operationalState": self.operationalState,
             "lifeCycleState": self.lifeCycleState,
@@ -49,3 +50,12 @@ class ORanObject(Top):
             "usageState": self.usageState,
             "utilization": self.utilization,
         }
+
+    def flatten_list(self, nested_list: list) -> list:
+        flat_list = []
+        for item in nested_list:
+            if isinstance(item, list):
+                flat_list.extend(self.flatten_list(item))
+            else:
+                flat_list.append(item)
+        return flat_list