lago-python-client 1.16.1__tar.gz → 1.18.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/PKG-INFO +2 -2
  2. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/customers/clients.py +3 -8
  3. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/gross_revenues/clients.py +3 -3
  4. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/invoice_collections/clients.py +3 -3
  5. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/invoiced_usages/clients.py +3 -3
  6. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/mixins.py +5 -4
  7. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/models/billable_metric.py +0 -3
  8. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/models/customer.py +19 -0
  9. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/models/invoice.py +14 -0
  10. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/models/plan.py +0 -2
  11. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/models/tax.py +0 -4
  12. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/mrrs/clients.py +3 -3
  13. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/overdue_balances/clients.py +3 -3
  14. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/services/request.py +4 -2
  15. lago_python_client-1.18.0/lago_python_client/version.py +1 -0
  16. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/wallets/clients.py +3 -8
  17. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client.egg-info/PKG-INFO +2 -2
  18. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/tests/test_request_services.py +11 -0
  19. lago_python_client-1.16.1/lago_python_client/version.py +0 -1
  20. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/LICENSE +0 -0
  21. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/README.md +0 -0
  22. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/__init__.py +0 -0
  23. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/add_ons/__init__.py +0 -0
  24. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/add_ons/clients.py +0 -0
  25. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/base_client.py +0 -0
  26. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/base_model.py +0 -0
  27. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/billable_metrics/__init__.py +0 -0
  28. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/billable_metrics/clients.py +0 -0
  29. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/client.py +0 -0
  30. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/coupons/__init__.py +0 -0
  31. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/coupons/clients.py +0 -0
  32. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/credit_notes/__init__.py +0 -0
  33. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/credit_notes/clients.py +0 -0
  34. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/customers/__init__.py +0 -0
  35. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/events/__init__.py +0 -0
  36. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/events/clients.py +0 -0
  37. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/exceptions.py +0 -0
  38. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/fees/__init__.py +0 -0
  39. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/fees/clients.py +0 -0
  40. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/functools_ext.py +0 -0
  41. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/gross_revenues/__init__.py +0 -0
  42. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/invoice_collections/__init__.py +0 -0
  43. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/invoiced_usages/__init__.py +0 -0
  44. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/invoices/__init__.py +0 -0
  45. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/invoices/clients.py +0 -0
  46. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/models/__init__.py +0 -0
  47. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/models/add_on.py +0 -0
  48. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/models/applied_coupon.py +0 -0
  49. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/models/charge.py +0 -0
  50. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/models/coupon.py +0 -0
  51. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/models/credit.py +0 -0
  52. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/models/credit_note.py +0 -0
  53. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/models/customer_usage.py +0 -0
  54. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/models/error_detail.py +0 -0
  55. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/models/event.py +0 -0
  56. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/models/fee.py +0 -0
  57. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/models/gross_revenue.py +0 -0
  58. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/models/invoice_collection.py +0 -0
  59. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/models/invoice_item.py +0 -0
  60. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/models/invoiced_usage.py +0 -0
  61. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/models/lifetime_usage.py +0 -0
  62. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/models/minimum_commitment.py +0 -0
  63. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/models/mrr.py +0 -0
  64. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/models/organization.py +0 -0
  65. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/models/overdue_balance.py +0 -0
  66. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/models/payment_request.py +0 -0
  67. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/models/subscription.py +0 -0
  68. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/models/usage_threshold.py +0 -0
  69. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/models/wallet.py +0 -0
  70. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/models/wallet_transaction.py +0 -0
  71. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/models/webhook_endpoint.py +0 -0
  72. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/mrrs/__init__.py +0 -0
  73. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/organizations/__init__.py +0 -0
  74. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/organizations/clients.py +0 -0
  75. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/overdue_balances/__init__.py +0 -0
  76. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/payment_requests/__init__.py +0 -0
  77. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/payment_requests/clients.py +0 -0
  78. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/plans/__init__.py +0 -0
  79. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/plans/clients.py +0 -0
  80. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/py.typed +0 -0
  81. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/services/__init__.py +0 -0
  82. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/services/json.py +0 -0
  83. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/services/response.py +0 -0
  84. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/subscriptions/__init__.py +0 -0
  85. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/subscriptions/clients.py +0 -0
  86. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/taxes/__init__.py +0 -0
  87. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/taxes/clients.py +0 -0
  88. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/wallets/__init__.py +0 -0
  89. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/webhook_endpoints/__init__.py +0 -0
  90. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/webhook_endpoints/clients.py +0 -0
  91. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/webhooks/__init__.py +0 -0
  92. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client/webhooks/clients.py +0 -0
  93. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client.egg-info/SOURCES.txt +0 -0
  94. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client.egg-info/dependency_links.txt +0 -0
  95. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client.egg-info/requires.txt +0 -0
  96. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/lago_python_client.egg-info/top_level.txt +0 -0
  97. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/pyproject.toml +0 -0
  98. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/setup.cfg +0 -0
  99. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/tests/__init__.py +0 -0
  100. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/tests/test_add_on_client.py +0 -0
  101. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/tests/test_applied_coupon_client.py +0 -0
  102. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/tests/test_billable_metric_client.py +0 -0
  103. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/tests/test_client.py +0 -0
  104. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/tests/test_coupon_client.py +0 -0
  105. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/tests/test_credit_note_client.py +0 -0
  106. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/tests/test_customer_client.py +0 -0
  107. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/tests/test_event_client.py +0 -0
  108. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/tests/test_fee_client.py +0 -0
  109. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/tests/test_functools_ext.py +0 -0
  110. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/tests/test_gross_revenue_client.py +0 -0
  111. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/tests/test_invoice_client.py +0 -0
  112. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/tests/test_invoice_collection_client.py +0 -0
  113. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/tests/test_invoiced_usage_client.py +0 -0
  114. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/tests/test_json_services.py +0 -0
  115. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/tests/test_mrr_client.py +0 -0
  116. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/tests/test_organization_client.py +0 -0
  117. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/tests/test_overdue_balance_client.py +0 -0
  118. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/tests/test_payment_request_client.py +0 -0
  119. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/tests/test_plan_client.py +0 -0
  120. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/tests/test_response_services.py +0 -0
  121. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/tests/test_subscription_client.py +0 -0
  122. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/tests/test_tax_client.py +0 -0
  123. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/tests/test_wallet_client.py +0 -0
  124. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/tests/test_wallet_transaction_client.py +0 -0
  125. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/tests/test_webhook_client.py +0 -0
  126. {lago_python_client-1.16.1 → lago_python_client-1.18.0}/tests/test_webhook_endpoint_client.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: lago-python-client
3
- Version: 1.16.1
3
+ Version: 1.18.0
4
4
  Summary: Lago Python API Client
5
5
  Home-page: https://github.com/getlago/lago-python-client
6
6
  Author: Lovro Colic
@@ -1,5 +1,5 @@
1
1
  import sys
2
- from typing import Any, Mapping, ClassVar, Type, Union
2
+ from typing import Any, Mapping, ClassVar, Type
3
3
 
4
4
  from ..base_client import BaseClient
5
5
  from ..mixins import (
@@ -10,12 +10,7 @@ from ..mixins import (
10
10
  )
11
11
  from ..models.customer import CustomerResponse
12
12
  from ..models.customer_usage import CustomerUsageResponse
13
- from ..services.request import (
14
- make_headers,
15
- make_url,
16
- send_get_request,
17
- send_post_request,
18
- )
13
+ from ..services.request import make_headers, make_url, send_get_request, send_post_request, QueryPairs
19
14
  from ..services.response import (
20
15
  get_response_data,
21
16
  prepare_index_response,
@@ -61,7 +56,7 @@ class CustomerClient(
61
56
  self,
62
57
  resource_id: str,
63
58
  external_subscription_id: str,
64
- options: Mapping[str, Union[int, str]] = {},
59
+ options: QueryPairs = {},
65
60
  ) -> Mapping[str, Any]:
66
61
  api_response: Response = send_get_request(
67
62
  url=make_url(
@@ -1,10 +1,10 @@
1
1
  import sys
2
- from typing import Any, ClassVar, Type, Union
2
+ from typing import Any, ClassVar, Type
3
3
 
4
4
  from ..base_client import BaseClient
5
5
  from ..mixins import FindAllCommandMixin
6
6
  from ..models.gross_revenue import GrossRevenueResponse
7
- from ..services.request import make_headers, make_url, send_get_request
7
+ from ..services.request import make_headers, make_url, send_get_request, QueryPairs
8
8
  from ..services.response import get_response_data, prepare_index_response, Response
9
9
 
10
10
  if sys.version_info >= (3, 9):
@@ -21,7 +21,7 @@ class GrossRevenueClient(
21
21
  RESPONSE_MODEL: ClassVar[Type[GrossRevenueResponse]] = GrossRevenueResponse
22
22
  ROOT_NAME: ClassVar[str] = "gross_revenue"
23
23
 
24
- def find_all(self, options: Mapping[str, Union[int, str]] = {}) -> Mapping[str, Any]:
24
+ def find_all(self, options: QueryPairs = {}) -> Mapping[str, Any]:
25
25
  api_response: Response = send_get_request(
26
26
  url=make_url(
27
27
  origin=self.base_url,
@@ -1,10 +1,10 @@
1
1
  import sys
2
- from typing import Any, ClassVar, Type, Union
2
+ from typing import Any, ClassVar, Type
3
3
 
4
4
  from ..base_client import BaseClient
5
5
  from ..mixins import FindAllCommandMixin
6
6
  from ..models.invoice_collection import InvoiceCollectionResponse
7
- from ..services.request import make_headers, make_url, send_get_request
7
+ from ..services.request import make_headers, make_url, send_get_request, QueryPairs
8
8
  from ..services.response import get_response_data, prepare_index_response, Response
9
9
 
10
10
  if sys.version_info >= (3, 9):
@@ -21,7 +21,7 @@ class InvoiceCollectionClient(
21
21
  RESPONSE_MODEL: ClassVar[Type[InvoiceCollectionResponse]] = InvoiceCollectionResponse
22
22
  ROOT_NAME: ClassVar[str] = "invoice_collection"
23
23
 
24
- def find_all(self, options: Mapping[str, Union[int, str]] = {}) -> Mapping[str, Any]:
24
+ def find_all(self, options: QueryPairs = {}) -> Mapping[str, Any]:
25
25
  api_response: Response = send_get_request(
26
26
  url=make_url(
27
27
  origin=self.base_url,
@@ -1,10 +1,10 @@
1
1
  import sys
2
- from typing import Any, ClassVar, Type, Union
2
+ from typing import Any, ClassVar, Type
3
3
 
4
4
  from ..base_client import BaseClient
5
5
  from ..mixins import FindAllCommandMixin
6
6
  from ..models.invoiced_usage import InvoicedUsageResponse
7
- from ..services.request import make_headers, make_url, send_get_request
7
+ from ..services.request import make_headers, make_url, send_get_request, QueryPairs
8
8
  from ..services.response import get_response_data, prepare_index_response, Response
9
9
 
10
10
  if sys.version_info >= (3, 9):
@@ -21,7 +21,7 @@ class InvoicedUsageClient(
21
21
  RESPONSE_MODEL: ClassVar[Type[InvoicedUsageResponse]] = InvoicedUsageResponse
22
22
  ROOT_NAME: ClassVar[str] = "invoiced_usage"
23
23
 
24
- def find_all(self, options: Mapping[str, Union[int, str]] = {}) -> Mapping[str, Any]:
24
+ def find_all(self, options: QueryPairs = {}) -> Mapping[str, Any]:
25
25
  api_response: Response = send_get_request(
26
26
  url=make_url(
27
27
  origin=self.base_url,
@@ -1,5 +1,5 @@
1
1
  import sys
2
- from typing import Any, Generic, Optional, Type, TypeVar, Union
2
+ from typing import Any, Generic, Optional, Type, TypeVar
3
3
 
4
4
  import httpx
5
5
 
@@ -12,6 +12,7 @@ from lago_python_client.base_model import BaseModel
12
12
 
13
13
  from .services.json import to_json
14
14
  from .services.request import (
15
+ QueryPairs,
15
16
  make_headers,
16
17
  make_url,
17
18
  send_delete_request,
@@ -89,7 +90,7 @@ class DestroyCommandMixin(Generic[_M]):
89
90
  def destroy(
90
91
  self: _ClientMixin[_M],
91
92
  resource_id: str,
92
- options: Mapping[str, Union[int, str]] = {},
93
+ options: QueryPairs = {},
93
94
  timeout: Optional[httpx.Timeout] = None,
94
95
  ) -> BaseModel:
95
96
  """Execute `destroy` command."""
@@ -116,7 +117,7 @@ class FindAllCommandMixin(Generic[_M]):
116
117
 
117
118
  def find_all(
118
119
  self: _ClientMixin[_M],
119
- options: Mapping[str, Union[int, str]] = {},
120
+ options: QueryPairs = {},
120
121
  timeout: Optional[httpx.Timeout] = None,
121
122
  ) -> Mapping[str, Any]:
122
123
  """Execute `find all` command."""
@@ -145,7 +146,7 @@ class FindCommandMixin(Generic[_M]):
145
146
  def find(
146
147
  self: _ClientMixin[_M],
147
148
  resource_id: str,
148
- params: Mapping[str, str] = {},
149
+ params: QueryPairs = {},
149
150
  timeout: Optional[httpx.Timeout] = None,
150
151
  ) -> _M:
151
152
  """Execute `find` command."""
@@ -42,9 +42,6 @@ class BillableMetricResponse(BaseResponseModel):
42
42
  field_name: Optional[str]
43
43
  created_at: str
44
44
  filters: BillableMetricFilters
45
- active_subscriptions_count: int
46
- draft_invoices_count: int
47
- plans_count: int
48
45
 
49
46
 
50
47
  class BillableMetricEvaluateExpressionEvent(BaseModel):
@@ -75,6 +75,21 @@ class MetadataResponseList(BaseModel):
75
75
  __root__: List[MetadataResponse]
76
76
 
77
77
 
78
+ class InvoiceCustomSection(BaseModel):
79
+ lago_id: Optional[str]
80
+ code: Optional[str]
81
+ name: Optional[str]
82
+ description: Optional[str]
83
+ details: Optional[str]
84
+ display_name: Optional[str]
85
+ applied_to_organization: Optional[bool]
86
+ created_at: Optional[str]
87
+
88
+
89
+ class InvoiceCustomSectionsResponseList(BaseModel):
90
+ __root__: List[InvoiceCustomSection]
91
+
92
+
78
93
  class Customer(BaseModel):
79
94
  external_id: str
80
95
  address_line1: Optional[str]
@@ -103,6 +118,8 @@ class Customer(BaseModel):
103
118
  shipping_address: Optional[Address]
104
119
  integration_customers: Optional[IntegrationCustomersList]
105
120
  tax_codes: Optional[List[str]]
121
+ skip_invoice_custom_sections: Optional[bool]
122
+ invoice_custom_section_codes: Optional[List[str]]
106
123
 
107
124
 
108
125
  class CustomerResponse(BaseResponseModel):
@@ -137,3 +154,5 @@ class CustomerResponse(BaseResponseModel):
137
154
  shipping_address: Optional[Address]
138
155
  integration_customers: Optional[IntegrationCustomersResponseList]
139
156
  taxes: Optional[TaxesResponse]
157
+ skip_invoice_custom_sections: Optional[bool]
158
+ applicable_invoice_custom_sections: Optional[InvoiceCustomSectionsResponseList]
@@ -69,6 +69,19 @@ class InvoiceAppliedTaxes(BaseResponseModel):
69
69
  __root__: List[InvoiceAppliedTax]
70
70
 
71
71
 
72
+ class InvoiceAppliedInvoiceCustomSection(BaseResponseModel):
73
+ lago_id: Optional[str]
74
+ lago_invoice_id: Optional[str]
75
+ code: Optional[str]
76
+ details: Optional[str]
77
+ display_name: Optional[str]
78
+ created_at: Optional[str]
79
+
80
+
81
+ class InvoiceAppliedInvoiceCustomSections(BaseResponseModel):
82
+ __root__: List[InvoiceAppliedInvoiceCustomSection]
83
+
84
+
72
85
  class InvoiceAppliedUsageThreshold(BaseResponseModel):
73
86
  lifetime_usage_amount_cents: Optional[int]
74
87
  created_at: Optional[str]
@@ -110,5 +123,6 @@ class InvoiceResponse(BaseResponseModel):
110
123
  credits: Optional[CreditsResponse]
111
124
  metadata: Optional[InvoiceMetadataList]
112
125
  applied_taxes: Optional[InvoiceAppliedTaxes]
126
+ applied_invoice_custom_sections: Optional[InvoiceAppliedInvoiceCustomSections]
113
127
  applied_usage_thresholds: Optional[InvoiceAppliedUsageThresholds]
114
128
  error_details: Optional[ErrorDetailsResponse]
@@ -51,8 +51,6 @@ class PlanResponse(BaseResponseModel):
51
51
  charges: Optional[ChargesResponse]
52
52
  minimum_commitment: Optional[MinimumCommitmentResponse]
53
53
  usage_thresholds: Optional[UsageThresholdsResponse]
54
- active_subscriptions_count: Optional[int]
55
- draft_invoices_count: Optional[int]
56
54
  taxes: Optional[TaxesResponse]
57
55
 
58
56
 
@@ -23,10 +23,6 @@ class TaxResponse(BaseResponseModel):
23
23
  code: str
24
24
  rate: float
25
25
  description: Optional[str]
26
- add_ons_count: Optional[int]
27
- customers_count: Optional[int]
28
- plans_count: Optional[int]
29
- charges_count: Optional[int]
30
26
  applied_to_organization: bool
31
27
  created_at: str
32
28
 
@@ -1,10 +1,10 @@
1
1
  import sys
2
- from typing import Any, ClassVar, Type, Union
2
+ from typing import Any, ClassVar, Type
3
3
 
4
4
  from ..base_client import BaseClient
5
5
  from ..mixins import FindAllCommandMixin
6
6
  from ..models.mrr import MrrResponse
7
- from ..services.request import make_headers, make_url, send_get_request
7
+ from ..services.request import make_headers, make_url, send_get_request, QueryPairs
8
8
  from ..services.response import get_response_data, prepare_index_response, Response
9
9
 
10
10
  if sys.version_info >= (3, 9):
@@ -21,7 +21,7 @@ class MrrClient(
21
21
  RESPONSE_MODEL: ClassVar[Type[MrrResponse]] = MrrResponse
22
22
  ROOT_NAME: ClassVar[str] = "mrr"
23
23
 
24
- def find_all(self, options: Mapping[str, Union[int, str]] = {}) -> Mapping[str, Any]:
24
+ def find_all(self, options: QueryPairs = {}) -> Mapping[str, Any]:
25
25
  api_response: Response = send_get_request(
26
26
  url=make_url(
27
27
  origin=self.base_url,
@@ -1,12 +1,12 @@
1
1
  import sys
2
- from typing import Any, ClassVar, Type, Union, Optional
2
+ from typing import Any, ClassVar, Type, Optional
3
3
 
4
4
  import httpx
5
5
 
6
6
  from ..base_client import BaseClient
7
7
  from ..mixins import FindAllCommandMixin
8
8
  from ..models.overdue_balance import OverdueBalanceResponse
9
- from ..services.request import make_headers, make_url, send_get_request
9
+ from ..services.request import make_headers, make_url, send_get_request, QueryPairs
10
10
  from ..services.response import get_response_data, prepare_index_response, Response
11
11
 
12
12
  if sys.version_info >= (3, 9):
@@ -25,7 +25,7 @@ class OverdueBalanceClient(
25
25
 
26
26
  def find_all(
27
27
  self,
28
- options: Mapping[str, Union[int, str]] = {},
28
+ options: QueryPairs = {},
29
29
  timeout: Optional[httpx.Timeout] = None,
30
30
  ) -> Mapping[str, Any]:
31
31
  api_response: Response = send_get_request(
@@ -19,12 +19,14 @@ else:
19
19
  URI_TEMPLATE: Final[str] = "{uri_path}{uri_query}"
20
20
  QUERY_TEMPLATE: Final[str] = "?{query}"
21
21
 
22
+ QueryPairs = Union[Mapping[str, Union[int, str, list[str]]], Sequence[tuple[str, Union[int, str]]]]
23
+
22
24
 
23
25
  def make_url(
24
26
  *,
25
27
  origin: str,
26
28
  path_parts: Sequence[str],
27
- query_pairs: Mapping[str, Union[int, str]] = {},
29
+ query_pairs: QueryPairs = {},
28
30
  ) -> str:
29
31
  """Return url."""
30
32
  return urljoin(
@@ -32,7 +34,7 @@ def make_url(
32
34
  URI_TEMPLATE.format(
33
35
  uri_path="/".join(path_parts),
34
36
  uri_query=QUERY_TEMPLATE.format(
35
- query=urlencode(query_pairs),
37
+ query=urlencode(query_pairs, doseq=True),
36
38
  )
37
39
  if query_pairs
38
40
  else "",
@@ -0,0 +1 @@
1
+ LAGO_VERSION = "1.18.0"
@@ -1,5 +1,5 @@
1
1
  import sys
2
- from typing import Any, ClassVar, Type, Union
2
+ from typing import Any, ClassVar, Type
3
3
 
4
4
  from lago_python_client.base_model import BaseModel
5
5
 
@@ -14,12 +14,7 @@ from ..mixins import (
14
14
  from ..models.wallet import WalletResponse
15
15
  from ..models.wallet_transaction import WalletTransactionResponse
16
16
  from ..services.json import to_json
17
- from ..services.request import (
18
- make_headers,
19
- make_url,
20
- send_get_request,
21
- send_post_request,
22
- )
17
+ from ..services.request import make_headers, make_url, send_get_request, send_post_request, QueryPairs
23
18
  from ..services.response import (
24
19
  get_response_data,
25
20
  prepare_object_list_response,
@@ -67,7 +62,7 @@ class WalletTransactionClient(BaseClient):
67
62
  data=get_response_data(response=api_response, key=self.ROOT_NAME),
68
63
  )
69
64
 
70
- def find_all(self, wallet_id: str, options: Mapping[str, Union[int, str]] = {}) -> Mapping[str, Any]:
65
+ def find_all(self, wallet_id: str, options: QueryPairs = {}) -> Mapping[str, Any]:
71
66
  api_response: Response = send_get_request(
72
67
  url=make_url(
73
68
  origin=self.base_url,
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: lago-python-client
3
- Version: 1.16.1
3
+ Version: 1.18.0
4
4
  Summary: Lago Python API Client
5
5
  Home-page: https://github.com/getlago/lago-python-client
6
6
  Author: Lovro Colic
@@ -76,3 +76,14 @@ def test_send_post_request():
76
76
  def test_send_put_request():
77
77
  """Ensure `send_put_request` service use httpx."""
78
78
  assert send_put_request == httpx.put
79
+
80
+
81
+ def test_make_url_with_list_query_params():
82
+ base_url = "http://example.com"
83
+ url = make_url(origin=base_url, path_parts=("test",), query_pairs={"status[]": ["active", "terminated"]})
84
+ assert url == "http://example.com/test?status%5B%5D=active&status%5B%5D=terminated"
85
+
86
+ url = make_url(
87
+ origin=base_url, path_parts=("test",), query_pairs=(("status[]", "active"), ("status[]", "terminated"))
88
+ )
89
+ assert url == "http://example.com/test?status%5B%5D=active&status%5B%5D=terminated"
@@ -1 +0,0 @@
1
- LAGO_VERSION = "1.16.1"