Annotation¶
-
class
watson_workspace_sdk.models.annotation.
Annotation
(title: str, display_text: str)¶ Bases:
object
Annotations are ephemeral messages that are initiated by the requester. For example clicking on a focus annotation could initiate a call and display an annotation message only to the user that clicked it.
Annotations typically have a Title, Body along with an optional sender name, buttons to trigger events and change display colour.
Attributes
- title : str
- Title/Heading of the Annotation
- display_text : str
- Main body of the Annotation
- buttons : Optional[List[Button]]
- List of Buttons if any that the Annotation has
Methods
Adds a new button object to the Annotation
Parameters: - display_text – Display text for button.
- action – Workspace action to be executed on click. Typically defined in Actions in Workspace Dev UI
- style – Visual style of the button. Primary or Secondary.
Returns: None
>>> new_annotation.add_button("Yes","guessed_correct_event") >>> new_annotation.add_button("No","guessed_incorrect_event")