Skip to content

Commit

Permalink
add applied_usage_thresholds to the api
Browse files Browse the repository at this point in the history
  • Loading branch information
nudded committed Aug 30, 2024
1 parent 8dbf7e7 commit 3e1d951
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lago_python_client/models/invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from .fee import FeesResponse
from .subscription import SubscriptionsResponse
from ..base_model import BaseResponseModel
from .usage_threshold import UsageThreshold


# Deprecated: Will be removed in the future
Expand Down Expand Up @@ -66,6 +67,16 @@ class InvoiceAppliedTaxes(BaseResponseModel):
__root__: List[InvoiceAppliedTax]


class InvoiceAppliedUsageThreshold(BaseResponseModel):
lifetime_usage_amount_cents: Optional[int]
created_at: Optional[str]
usage_threshold: Optional[UsageThreshold]


class InvoiceAppliedUsageThresholds(BaseResponseModel):
__root__: List[InvoiceAppliedUsageThreshold]


class InvoiceResponse(BaseResponseModel):
lago_id: str
sequential_id: Optional[int]
Expand Down Expand Up @@ -97,3 +108,4 @@ class InvoiceResponse(BaseResponseModel):
credits: Optional[CreditsResponse]
metadata: Optional[InvoiceMetadataList]
applied_taxes: Optional[InvoiceAppliedTaxes]
applied_usage_thresholds: Optional[InvoiceAppliedUsageThresholds]
12 changes: 12 additions & 0 deletions tests/fixtures/invoice.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@
"display_in_invoice": true
}
],
"applied_usage_thresholds": [
{
"lifetime_usage_amount_cents": 120,
"created_at": "2022-04-29T08:59:51Z",
"usage_threshold": {
"id": "7b6a2799-6db5-4f82-8362-1483b65f8f90",
"threshold_display_name": "Threshold 1",
"amount_cents": 100,
"recurring": false
}
}
],
"applied_taxes": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
Expand Down

0 comments on commit 3e1d951

Please sign in to comment.