Skip to content

Commit

Permalink
feat: Expose billing periods with invoice object
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-pochet committed Jan 16, 2025
1 parent 3a29bd3 commit 45fe63b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lago_python_client/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
BillableMetricEvaluateExpression as BillableMetricEvaluateExpression,
BillableMetricEvaluateExpressionResponse as BillableMetricEvaluateExpressionResponse,
)
from .billing_period import (
BillingPeriodResponse as BillingPeriodResponse,
BillingPeriodsResponse as BillingPeriodsResponse,
)
from .charge import (
Charge as Charge,
Charges as Charges,
Expand Down
17 changes: 17 additions & 0 deletions lago_python_client/models/billing_period.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from typing import List

from lago_python_client.base_model import BaseResponseModel


class BillingPeriodResponse(BaseResponseModel):
lago_subscription_id: str
external_subscription_id: str
subscription_from_datetime: str
subscription_to_datetime: str
charges_from_datetime: str
charges_to_datetime: str
invoicing_reason: str


class BillingPeriodsResponse(BaseResponseModel):
__root__: List[BillingPeriodResponse]
2 changes: 2 additions & 0 deletions lago_python_client/models/invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from lago_python_client.base_model import BaseModel

from .billing_period import BillingPeriodsResponse
from .credit import CreditsResponse
from .customer import CustomerResponse
from .fee import FeesResponse
Expand Down Expand Up @@ -118,6 +119,7 @@ class InvoiceResponse(BaseResponseModel):

file_url: Optional[str]
customer: Optional[CustomerResponse]
billing_periods: Optional[BillingPeriodsResponse]
subscriptions: Optional[SubscriptionsResponse]
fees: Optional[FeesResponse]
credits: Optional[CreditsResponse]
Expand Down

0 comments on commit 45fe63b

Please sign in to comment.