Skip to content

Commit

Permalink
updated python client with ics
Browse files Browse the repository at this point in the history
  • Loading branch information
annvelents committed Jan 14, 2025
1 parent e566031 commit 0ad9e4c
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lago_python_client/models/customer.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,19 @@ class MetadataList(BaseModel):
class MetadataResponseList(BaseModel):
__root__: List[MetadataResponse]

class InvoiceCustomSection(BaseModel):
lago_id: Optional[str]
code: Optional[str]
name: Optional[str]
description: Optional[str]
details: Optional[str]
display_name: Optional[str]
selected_for_organization: Optional[bool]
created_at: Optional[str]

class InvoiceCustomSectionsResponseList(BaseModel):
__root__: List[InvoiceCustomSection]


class Customer(BaseModel):
external_id: str
Expand Down Expand Up @@ -103,6 +116,8 @@ class Customer(BaseModel):
shipping_address: Optional[Address]
integration_customers: Optional[IntegrationCustomersList]
tax_codes: Optional[List[str]]
skip_invoice_custom_sections: Optional[bool]
invoice_custom_section_codes: Optional[List[str]]


class CustomerResponse(BaseResponseModel):
Expand Down Expand Up @@ -137,3 +152,5 @@ class CustomerResponse(BaseResponseModel):
shipping_address: Optional[Address]
integration_customers: Optional[IntegrationCustomersResponseList]
taxes: Optional[TaxesResponse]
skip_invoice_custom_sections: Optional[bool]
applicable_invoice_custom_sections: Optional[InvoiceCustomSectionsResponseList]
13 changes: 13 additions & 0 deletions lago_python_client/models/invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,18 @@ class InvoiceAppliedTax(BaseResponseModel):
class InvoiceAppliedTaxes(BaseResponseModel):
__root__: List[InvoiceAppliedTax]

class InvoiceAppliedInvoiceCustomSection(BaseResponseModel):
lago_id: Optional[str]
lago_invoice_id: Optional[str]
code: Optional[str]
details: Optional[str]
display_name: Optional[str]
created_at: Optional[str]


class InvoiceAppliedInvoiceCustomSections(BaseResponseModel):
__root__: List[InvoiceAppliedInvoiceCustomSection]


class InvoiceAppliedUsageThreshold(BaseResponseModel):
lifetime_usage_amount_cents: Optional[int]
Expand Down Expand Up @@ -110,5 +122,6 @@ class InvoiceResponse(BaseResponseModel):
credits: Optional[CreditsResponse]
metadata: Optional[InvoiceMetadataList]
applied_taxes: Optional[InvoiceAppliedTaxes]
applied_invoice_custom_sections: Optional[InvoiceAppliedInvoiceCustomSections]
applied_usage_thresholds: Optional[InvoiceAppliedUsageThresholds]
error_details: Optional[ErrorDetailsResponse]
4 changes: 4 additions & 0 deletions tests/test_customer_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ def create_customer():
),
integration_customers=integration_customers_list,
metadata=metadata_list,
skip_invoice_custom_sections=False,
applicable_invoice_custom_sections=[],
)


Expand Down Expand Up @@ -96,6 +98,8 @@ def test_valid_create_customers_request(httpx_mock: HTTPXMock):
assert response.metadata.__root__[0].lago_id == "12345"
assert response.metadata.__root__[0].key == "key"
assert response.metadata.__root__[0].value == "value"
assert response.skip_invoice_custom_sections is False
assert response.applicable_invoice_custom_sections == []


def test_invalid_create_customers_request(httpx_mock: HTTPXMock):
Expand Down

0 comments on commit 0ad9e4c

Please sign in to comment.