From 281483f0fc5c29adb8d5fd972bb8e668f179bfb2 Mon Sep 17 00:00:00 2001 From: Chuck Driesler Date: Thu, 21 Nov 2024 12:07:48 +0000 Subject: [PATCH] fix(automate): add success result case (#355) --- src/speckle_automate/automation_context.py | 18 ++++++++++++++++++ src/speckle_automate/schema.py | 1 + 2 files changed, 19 insertions(+) diff --git a/src/speckle_automate/automation_context.py b/src/speckle_automate/automation_context.py index ac72cf9f..1043664d 100644 --- a/src/speckle_automate/automation_context.py +++ b/src/speckle_automate/automation_context.py @@ -355,6 +355,24 @@ def attach_warning_to_objects( visual_overrides, ) + def attach_success_to_objects( + self, + category: str, + object_ids: Union[str, List[str]], + message: Optional[str] = None, + metadata: Optional[Dict[str, Any]] = None, + visual_overrides: Optional[Dict[str, Any]] = None, + ) -> None: + """Add a new success case to the run results.""" + self.attach_result_to_objects( + ObjectResultLevel.SUCCESS, + category, + object_ids, + message, + metadata, + visual_overrides, + ) + def attach_info_to_objects( self, category: str, diff --git a/src/speckle_automate/schema.py b/src/speckle_automate/schema.py index 6e0b5649..ad2a7b93 100644 --- a/src/speckle_automate/schema.py +++ b/src/speckle_automate/schema.py @@ -69,6 +69,7 @@ class AutomationStatus(str, Enum): class ObjectResultLevel(str, Enum): """Possible status message levels for object reports.""" + SUCCESS = "SUCCESS" INFO = "INFO" WARNING = "WARNING" ERROR = "ERROR"