tbapi.api.adapters.ialert_adapter

 1from __future__ import annotations
 2from typing import TYPE_CHECKING
 3from tbapi.common.decorators import tb_interface
 4from tbapi.common.converters import to_python_datetime, to_net_datetime
 5from datetime import datetime
 6from Tickblaze.Scripts.Api.Adapters import IAlertAdapter as _IAlertAdapter
 7from typing import Any, overload
 8from abc import ABC, abstractmethod
 9from tbapi.api.adapters.alert_type import AlertType
10from Tickblaze.Scripts.Api.Adapters import AlertType as _AlertType
11
12@tb_interface(_IAlertAdapter)
13class IAlertAdapter():
14    """Interface for notification mechanisms such as playing sounds, sending emails, and showing dialogs."""
15
16
17    @abstractmethod
18    def play_sound(self, file_path: str) -> None:
19        """Plays a sound from the specified file path.            The path to the sound file."""
20        result = self._value.PlaySound(file_path)
21        return result
22  
23    @abstractmethod
24    def show_dialog(self, type: AlertType, message: str) -> None:
25        """Shows a dialog with the specified alert type and message.            The type of the alert.      The message to display in the dialog."""
26        result = self._value.ShowDialog(_AlertType(type.value if hasattr(type, 'value') else int(type)), message)
27        return result
28  
@tb_interface(_IAlertAdapter)
class IAlertAdapter:
18@tb_interface(_IAlertAdapter)
19class IAlertAdapter():
20    """Interface for notification mechanisms such as playing sounds, sending emails, and showing dialogs."""
21
22
23    @abstractmethod
24    def play_sound(self, file_path: str) -> None:
25        """Plays a sound from the specified file path.            The path to the sound file."""
26        result = self._value.PlaySound(file_path)
27        return result
28  
29    @abstractmethod
30    def show_dialog(self, type: AlertType, message: str) -> None:
31        """Shows a dialog with the specified alert type and message.            The type of the alert.      The message to display in the dialog."""
32        result = self._value.ShowDialog(_AlertType(type.value if hasattr(type, 'value') else int(type)), message)
33        return result

Interface for notification mechanisms such as playing sounds, sending emails, and showing dialogs.

IAlertAdapter(*args, **kwargs)
199        def __init__(self, *args, **kwargs):
200            pass
@abstractmethod
def play_sound(self, file_path: str) -> None:
23    @abstractmethod
24    def play_sound(self, file_path: str) -> None:
25        """Plays a sound from the specified file path.            The path to the sound file."""
26        result = self._value.PlaySound(file_path)
27        return result

Plays a sound from the specified file path. The path to the sound file.

@abstractmethod
def show_dialog( self, type: tbapi.api.adapters.alert_type.AlertType, message: str) -> None:
29    @abstractmethod
30    def show_dialog(self, type: AlertType, message: str) -> None:
31        """Shows a dialog with the specified alert type and message.            The type of the alert.      The message to display in the dialog."""
32        result = self._value.ShowDialog(_AlertType(type.value if hasattr(type, 'value') else int(type)), message)
33        return result

Shows a dialog with the specified alert type and message. The type of the alert. The message to display in the dialog.