OSMENG-1092 Base Class for Delete NS Record Activity
[osm/common.git] / osm_common / temporal / activities / ns.py
index 4f1f4fe..265a9c1 100644 (file)
@@ -178,3 +178,46 @@ class UpdateNsState(BaseActivity):
 
     async def __call__(self, activity_input: Input) -> None:
         raise NotImplementedError()
+
+
+class DeleteNsRecord(BaseActivity):
+    """Delete a NS record from DB.
+
+    Collaborators:
+        DB Write:           nsrs
+
+    Raises (retryable):
+        DbException: If DB access fails, the collection does not exist.
+
+    Activity Lifecycle:
+        This activity should complete relatively quickly (less than a
+        second). However, it would be reasonable to wait up to 10
+        seconds.
+
+        This activity will not report a heartbeat due to its
+        short-running nature.
+
+        This operation is idempotent.
+
+    """
+
+    @dataclass
+    class Input:
+        """
+        Input dataclass for activity that deletes a NS record.
+
+        Attributes:
+        -----------
+        ns_uuid : str
+            The UUID of the NS to be deleted from the nsrs
+            collection in Mongo.
+        """
+
+        ns_uuid: str
+
+    def __init__(self, db: DbBase):
+        super().__init__()
+        self.db: DbBase = db
+
+    async def __call__(self, activity_input: Input) -> None:
+        raise NotImplementedError()