Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lago_python_client/models/alert.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class AlertThreshold(BaseModel):
code: Optional[str]
value: str
recurring: Optional[bool]
notify_on: Optional[List[str]]


class AlertThresholdList(BaseModel):
Expand All @@ -30,6 +31,7 @@ class AlertThresholdResponse(BaseResponseModel):
code: Optional[str]
value: str
recurring: bool
notify_on: Optional[List[str]]


class AlertThresholdResponseList(BaseResponseModel):
Expand Down
3 changes: 2 additions & 1 deletion tests/fixtures/wallet_alert.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
{
"code": "warn",
"value": 10000,
"recurring": false
"recurring": false,
"notify_on": ["triggered", "resolved"]
}
],
"billable_metric": null,
Expand Down
4 changes: 2 additions & 2 deletions tests/test_customer_wallet_alert_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


def alert_object():
threshold = AlertThreshold(code="warn", value=10000)
threshold = AlertThreshold(code="warn", value=10000, notify_on=["triggered", "resolved"])

return Alert(
alert_type="wallet_balance_amount",
Expand Down Expand Up @@ -45,7 +45,7 @@ def test_valid_create_customer_wallet_alert_request(httpx_mock: HTTPXMock):
assert response.direction == "increasing"
assert response.previous_value == "1000"
assert response.thresholds == AlertThresholdList(
__root__=[AlertThreshold(code="warn", value=10000, recurring=False)]
__root__=[AlertThreshold(code="warn", value=10000, recurring=False, notify_on=["triggered", "resolved"])]
)
assert response.billable_metric is None

Expand Down
Loading