diff --git a/lago_python_client/models/alert.py b/lago_python_client/models/alert.py index eacd184..f7b8fb9 100644 --- a/lago_python_client/models/alert.py +++ b/lago_python_client/models/alert.py @@ -8,6 +8,7 @@ class AlertThreshold(BaseModel): code: Optional[str] value: str recurring: Optional[bool] + notify_on: Optional[List[str]] class AlertThresholdList(BaseModel): @@ -30,6 +31,7 @@ class AlertThresholdResponse(BaseResponseModel): code: Optional[str] value: str recurring: bool + notify_on: Optional[List[str]] class AlertThresholdResponseList(BaseResponseModel): diff --git a/tests/fixtures/wallet_alert.json b/tests/fixtures/wallet_alert.json index ab7e76c..3246d60 100644 --- a/tests/fixtures/wallet_alert.json +++ b/tests/fixtures/wallet_alert.json @@ -15,7 +15,8 @@ { "code": "warn", "value": 10000, - "recurring": false + "recurring": false, + "notify_on": ["triggered", "resolved"] } ], "billable_metric": null, diff --git a/tests/test_customer_wallet_alert_client.py b/tests/test_customer_wallet_alert_client.py index ed6a032..2224312 100644 --- a/tests/test_customer_wallet_alert_client.py +++ b/tests/test_customer_wallet_alert_client.py @@ -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", @@ -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