DeleteEventOption#
- class teamworksams.delete_option.DeleteEventOption(interactive_mode: bool = True)[source]#
Bases:
object
Options for configuring event data deletion.
Customizes the behavior of
delete_event_data()
anddelete_multiple_events()
, controlling whether interactive feedback, such as confirmation prompts and status messages, is enabled. Ensures safe deletion of AMS events. See Deleting Data for deletion workflows.- Parameters:
interactive_mode (bool) – If True, prompts for user confirmation before deletion and prints status messages (e.g., “Deleted event with SUCCESS”), ideal for interactive environments like Jupyter notebooks. Set to False for silent execution in automated scripts. Defaults to True.
- interactive_mode#
Indicates whether interactive mode is enabled.
- Type:
bool
Examples
>>> from teamworksams import DeleteEventOption, delete_event_data >>> option = DeleteEventOption(interactive_mode = True) >>> result = delete_event_data( ... event_id = 134273, ... url = "https://example.smartabase.com/site", ... option = option ... ) Are you sure you want to delete event '134273'? (y/n): y ℹ Deleting event with ID 134273... ✔ SUCCESS: Deleted 134273
Additional Notes#
Enable
interactive_mode=True
to prompt for confirmation before deletion, preventing accidental data loss, and to display status messages like “SUCCESS: Deleted 134273”.Set
interactive_mode=False
for automated scripts where silent execution is preferred, but ensure robust error handling with AMSError().Use with delete_event_data() or delete_multiple_events() for safe event deletion.
See Also#
delete_event_data(): Function for single event deletion.
delete_multiple_events(): Function for batch event deletion.
Deleting Data: Event deletion workflows.