Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(plan_override): Add plan overrides to subscription input #202

Merged
merged 1 commit into from
Oct 11, 2023
Merged
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
13 changes: 13 additions & 0 deletions lago_python_client/models/charge.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,16 @@ class ChargeResponse(BaseResponseModel):

class ChargesResponse(BaseResponseModel):
__root__: List[ChargeResponse]


class ChargeOverrides(BaseModel):
id: Optional[str]
invoice_display_name: Optional[str]
min_amount_cents: Optional[int]
properties: Optional[Dict[str, Any]]
group_properties: Optional[GroupPropertiesList]
tax_codes: Optional[List[str]]


class ChargesOverrides(BaseModel):
__root__: List[ChargeOverrides]
12 changes: 11 additions & 1 deletion lago_python_client/models/plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from pydantic import BaseModel

from .charge import Charges, ChargesResponse
from .charge import Charges, ChargesResponse, ChargesOverrides
from .tax import Taxes, TaxesResponse
from ..base_model import BaseResponseModel

Expand Down Expand Up @@ -39,3 +39,13 @@ class PlanResponse(BaseResponseModel):
active_subscriptions_count: int
draft_invoices_count: int
taxes: Optional[TaxesResponse]

class PlanOverrides(BaseModel):
name: Optional[str]
invoice_display_name: Optional[str]
description: Optional[str]
amount_cents: Optional[int]
amount_currency: Optional[str]
trial_period: Optional[float]
charges: Optional[ChargesOverrides]
tax_codes: Optional[List[str]]
3 changes: 2 additions & 1 deletion lago_python_client/models/subscription.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import List, Optional

from pydantic import BaseModel

from .plan import PlanOverrides
from ..base_model import BaseResponseModel


Expand All @@ -13,6 +13,7 @@ class Subscription(BaseModel):
subscription_date: Optional[str]
billing_time: Optional[str]
ending_at: Optional[str]
plan_overrides: Optional[PlanOverrides]


class SubscriptionResponse(BaseResponseModel):
Expand Down