Inotification

Classes

class arshai.core.interfaces.inotification.INotificationAttempt(**data)[source]

Bases: IDTO

Record of a notification attempt.

notification: Dict
timestamp: datetime
successful: bool
had_active_connection: bool
error: Optional[str]
dict(*args, **kwargs)[source]

Convert to dictionary with serializable datetime.

Return type:

dict

model_config: ClassVar[ConfigDict] = {'allow_mutation': False, 'arbitrary_types_allowed': True, 'smart_union': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class arshai.core.interfaces.inotification.INotificationState(**data)[source]

Bases: IDTO

Active notification state.

pending_notifications: List[Dict]
notification_history: List[INotificationAttempt]
notifications: List[Dict]
last_notification_time: Optional[datetime]
notification_count: int
successful_notifications: int
failed_notifications: int
dict(*args, **kwargs)[source]

Convert to dictionary with serializable datetime.

Return type:

dict

record_attempt(notification, had_active_connection, error=None)[source]

Record a notification attempt.

Parameters:
  • notification (Dict) – The notification that was attempted

  • had_active_connection (bool) – Whether there was an active connection

  • error (Optional[str]) – Optional error message if the attempt failed

Return type:

None

model_config: ClassVar[ConfigDict] = {'allow_mutation': False, 'arbitrary_types_allowed': True, 'smart_union': True, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].