Skip to content

Commit d35e3f4

Browse files
committed
docs: document DidHistory meta fields for billing_cycles_count_changed
Add docstring documenting that DidHistory records carry meta["from"] and meta["to"] integers when action is "billing_cycles_count_changed", and that those keys are absent for every other action.
1 parent a27d0bc commit d35e3f4

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

src/didww/resources/did_history.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@
22

33

44
class DidHistory(DidwwApiModel):
5+
"""DID History event resource.
6+
7+
Attributes:
8+
did_number (str): The DID number this history event relates to.
9+
action (str): The action that occurred (e.g. "billing_cycles_count_changed").
10+
method (str): The method used for the action.
11+
created_at (datetime): When the event occurred.
12+
13+
Meta fields (present in the JSON:API ``meta`` hash on the response,
14+
not as resource attributes):
15+
16+
meta["from"] / meta["to"] (int):
17+
Only present when action is "billing_cycles_count_changed".
18+
The previous (from) and new (to) billing_cycles_count values.
19+
Absent for every other action.
20+
"""
21+
522
did_number = SafeAttributeField("did_number")
623
action = SafeAttributeField("action")
724
method = SafeAttributeField("method")

0 commit comments

Comments
 (0)