Notification

class q2_sdk.hq.db.notification.NotificationAddResponse(success=False, error_message='', id=None)[source]

Bases: object

NotificationAddResponse(success: bool = False, error_message: str = ‘’, id: int = None)

success: bool = False
error_message: str = ''
id: int = None
class q2_sdk.hq.db.notification.CreateNotificationParams(NotificationTypeID, CreateDate, NotificationStatusID, TargetAddress, NotificationSubject, RetryCount='0', NotificationTime=None, NotificationBody=None, AccessCodeID=None, ErrorMessage=None, UserID=None, TransactionID=None, UiLanguageID=None, HtmlBody=None, TargetAddressRaw=None, CountryID=None, NotificationFlavorID=None, ZoneID=None, SessionId=None)[source]

Bases: object

CreateNotificationParams(NotificationTypeID: str, CreateDate: str, NotificationStatusID: str, TargetAddress: str, NotificationSubject: str, RetryCount: str = ‘0’, NotificationTime: Optional[str] = None, NotificationBody: Optional[str] = None, AccessCodeID: Optional[str] = None, ErrorMessage: Optional[str] = None, UserID: Optional[str] = None, TransactionID: Optional[str] = None, UiLanguageID: Optional[str] = None, HtmlBody: Optional[str] = None, TargetAddressRaw: Optional[str] = None, CountryID: Optional[str] = None, NotificationFlavorID: Optional[str] = None, ZoneID: Optional[str] = None, SessionId: Optional[str] = None)

NotificationTypeID: str
CreateDate: str
NotificationStatusID: str
TargetAddress: str
NotificationSubject: str
RetryCount: str = '0'
NotificationTime: Optional[str] = None
NotificationBody: Optional[str] = None
AccessCodeID: Optional[str] = None
ErrorMessage: Optional[str] = None
UserID: Optional[str] = None
TransactionID: Optional[str] = None
UiLanguageID: Optional[str] = None
HtmlBody: Optional[str] = None
TargetAddressRaw: Optional[str] = None
CountryID: Optional[str] = None
NotificationFlavorID: Optional[str] = None
ZoneID: Optional[str] = None
SessionId: Optional[str] = None
class q2_sdk.hq.db.notification.NotificationRow(element, row_class=None, rename_fields=None)[source]

Bases: TableRow

NotificationID: str
NotificationTypeID: str
CreateDate: str
NotificationStatusID: str
NotificationTime: str
TargetAddress: str
NotificationSubject: str
NotificationBody: str
AccessCodeID: str
RetryCount: str
ErrorMessage: str
UserID: str
TransactionID: str
UiLanguageID: str
HtmlBody: str
TargetAddressRaw: str
CountryID: str
NotificationFlavorID: str
ZoneID: str
SessionId: str
class q2_sdk.hq.db.notification.Notification(logger, hq_credentials=None, ret_table_obj=None)[source]

Bases: DbObject

Programmatic access to the Q2 database. Not as flexible as a true ORM, but takes the guesswork out of database schemas and ensures safety in the transactions.

Parameters:
  • logger – Reference to calling request’s logger (self.logger in your extension)

  • hq_credentials (Optional[HqCredentials]) – HQ Connectivity Information (Defaults to settings file)

  • ret_table_obj (Optional[bool]) – Flag to return list of LXML elements if False or TableRow objects from DB calls if True (Defaults to settings file)

NAME = 'Notification'
REPRESENTATION_ROW_CLASS

alias of NotificationRow

add_arguments(parser)[source]

Hook for subclassed DbObjects to add custom arguments.

async get(notification_ids, serialize_for_cli=False)[source]

Retrieves notification rows based on provided notification IDs. :type notification_ids: list[int] :param notification_ids: List of notification IDs to search.

Return type:

List[NotificationRow]

async add(params)[source]

Creates a notification row with the provided parameters. :rtype: NotificationAddResponse

Parameters:

params (CreateNotificationParams) – Instance of CreateNotificationParams dataclass containing the values of the columns to populate in the Q2_Notifications table.