Spending Status Notification
API reference for diameter.message.commands.spending_status_notification.
This module contains Spending-Status-Notification Request and Answer messages, implementing AVPs documented in 3GPP TS 29.219.
SpendingStatusNotification ¶
SpendingStatusNotification(
header: MessageHeader = None, avps: list[Avp] = None
)
Bases: DefinedMessage
A Spending-Status-Notification message.
This message class lists message attributes based on the current 3GPP TS 29.219 version 11.2.0 Release 11 as python properties, acessible as instance attributes. AVPs not listed in the base protocol can be retrieved using the SpendingStatusNotification.find_avps search method.
Examples:
AVPs accessible either as instance attributes or by searching:
>>> msg = Message.from_bytes(b"...")
>>> msg.session_id
dra1.mvno.net;2323;546
>>> msg.find_avps((AVP_SESSION_ID, 0))
['dra1.mvno.net;2323;546']
When diameter message is decoded using
Message.from_bytes, it returns
either an instance of SpendingStatusNotificationRequest or
SpendingStatusNotificationAnswer automatically:
>>> msg = Message.from_bytes(b"...")
>>> assert msg.header.is_request is True
>>> assert isinstance(msg, SpendingStatusNotificationRequest)
When creating a new message, the SpendingStatusNotificationRequest or
SpendingStatusNotificationAnswer class should be instantiated directly, and
the values for AVPs set as class attributes:
>>> msg = SpendingStatusNotificationRequest()
>>> msg.session_id = "dra1.mvno.net;2323;546"
Other, custom AVPs can be appended to the message using the
SpendingStatusNotification.append_avp method, or
by overwriting the avp attribute entirely.
Warning
Every AVP documented for the subclasses of this command can be accessed
as an instance attribute, even if the original network-received message
did not contain that specific AVP. Such AVPs will be returned with the
value None when accessed.
Every other AVP not mentioned here, and not present in a
network-received message will raise an AttributeError when being
accessed; their presence should be validated with hasattr before
accessing.
SpendingStatusNotificationAnswer ¶
SpendingStatusNotificationAnswer(
header: MessageHeader = None, avps: list[Avp] = None
)
SpendingStatusNotificationRequest ¶
SpendingStatusNotificationRequest(
header: MessageHeader = None, avps: list[Avp] = None
)
Bases: SpendingStatusNotification
A Spending-Status-Notification-Request message.
policy_counter_status_report
instance-attribute
¶
policy_counter_status_report: list[PolicyCounterStatusReport]