Skip to content

Commit 041ee4e

Browse files
committed
Fixes for Alert models
1 parent f421462 commit 041ee4e

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

lago_python_client/models/alert.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ class AlertThresholdList(BaseModel):
1515

1616

1717
class Alert(BaseModel):
18-
alert_type: str
19-
code: str
18+
alert_type: Optional[str]
19+
code: Optional[str]
2020
name: Optional[str]
21-
thresholds: AlertThresholdList
21+
thresholds: Optional[AlertThresholdList]
2222
billable_metric_code: Optional[str]
2323

2424

tests/test_subscription_alert_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def alert_object():
1919
alert_type="billable_metric_current_usage_amount",
2020
code="storage_threshold_alert",
2121
name="Storage Usage Alert",
22-
billable_metric_cod="storage",
22+
billable_metric_code="storage",
2323
thresholds=AlertThresholdList(__root__=[threshold]),
2424
)
2525

@@ -42,7 +42,7 @@ def test_valid_create_subscription_alert_request(httpx_mock: HTTPXMock):
4242
assert response.code == "storage_threshold_alert"
4343
assert response.name == "Storage Usage Alert"
4444
assert response.alert_type == "billable_metric_current_usage_amount"
45-
assert response.previous_value == 1000
45+
assert response.previous_value == "1000"
4646
assert response.billable_metric.code == "storage"
4747
assert response.thresholds == AlertThresholdList(
4848
__root__=[AlertThreshold(code="warn", value=99.0, recurring=False)]

0 commit comments

Comments
 (0)