Skip to content

Commit

Permalink
fix(automate): add success result case (#355)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdriesler authored Nov 21, 2024
1 parent 932838d commit 281483f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/speckle_automate/automation_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/speckle_automate/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 281483f

Please sign in to comment.