lago-python-client 1.31.0__tar.gz → 1.33.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 (153) hide show
  1. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/PKG-INFO +15 -7
  2. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/README.md +11 -5
  3. lago_python_client-1.33.0/lago_python_client/api_logs/clients.py +18 -0
  4. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/client.py +10 -0
  5. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/customers/clients.py +22 -0
  6. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/models/__init__.py +5 -0
  7. lago_python_client-1.33.0/lago_python_client/models/api_log.py +33 -0
  8. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/models/billing_entity.py +5 -1
  9. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/models/charge.py +6 -0
  10. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/models/customer.py +1 -15
  11. lago_python_client-1.33.0/lago_python_client/models/customer_projected_usage.py +73 -0
  12. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/models/customer_usage.py +11 -2
  13. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/models/fee.py +12 -0
  14. lago_python_client-1.33.0/lago_python_client/models/invoice_custom_section.py +17 -0
  15. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/models/subscription.py +2 -0
  16. lago_python_client-1.33.0/lago_python_client/models/usage.py +18 -0
  17. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/models/wallet.py +1 -0
  18. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/payment_requests/clients.py +2 -1
  19. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/services/response.py +13 -9
  20. lago_python_client-1.33.0/lago_python_client/usages/clients.py +39 -0
  21. lago_python_client-1.33.0/lago_python_client/version.py +1 -0
  22. lago_python_client-1.33.0/lago_python_client/webhooks/__init__.py +0 -0
  23. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/webhooks/clients.py +4 -6
  24. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client.egg-info/PKG-INFO +15 -7
  25. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client.egg-info/SOURCES.txt +20 -0
  26. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client.egg-info/requires.txt +4 -1
  27. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/setup.cfg +3 -1
  28. lago_python_client-1.33.0/tests/__init__.py +0 -0
  29. lago_python_client-1.33.0/tests/test_api_logs_client.py +100 -0
  30. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/tests/test_billing_entity_client.py +1 -0
  31. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/tests/test_customer_client.py +27 -3
  32. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/tests/test_payment_request_client.py +31 -0
  33. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/tests/test_subscription_client.py +22 -0
  34. lago_python_client-1.33.0/tests/test_usage_client.py +27 -0
  35. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/tests/test_wallet_client.py +5 -1
  36. lago_python_client-1.31.0/lago_python_client/version.py +0 -1
  37. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/LICENSE +0 -0
  38. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/__init__.py +0 -0
  39. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/activity_logs/__init__.py +0 -0
  40. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/activity_logs/clients.py +0 -0
  41. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/add_ons/__init__.py +0 -0
  42. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/add_ons/clients.py +0 -0
  43. {lago_python_client-1.31.0/lago_python_client/billable_metrics → lago_python_client-1.33.0/lago_python_client/api_logs}/__init__.py +0 -0
  44. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/base_client.py +0 -0
  45. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/base_model.py +0 -0
  46. {lago_python_client-1.31.0/lago_python_client/billing_entities → lago_python_client-1.33.0/lago_python_client/billable_metrics}/__init__.py +0 -0
  47. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/billable_metrics/clients.py +0 -0
  48. {lago_python_client-1.31.0/lago_python_client/coupons → lago_python_client-1.33.0/lago_python_client/billing_entities}/__init__.py +0 -0
  49. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/billing_entities/clients.py +0 -0
  50. {lago_python_client-1.31.0/lago_python_client/credit_notes → lago_python_client-1.33.0/lago_python_client/coupons}/__init__.py +0 -0
  51. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/coupons/clients.py +0 -0
  52. {lago_python_client-1.31.0/lago_python_client/customers → lago_python_client-1.33.0/lago_python_client/credit_notes}/__init__.py +0 -0
  53. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/credit_notes/clients.py +0 -0
  54. {lago_python_client-1.31.0/lago_python_client/events → lago_python_client-1.33.0/lago_python_client/customers}/__init__.py +0 -0
  55. {lago_python_client-1.31.0/lago_python_client/fees → lago_python_client-1.33.0/lago_python_client/events}/__init__.py +0 -0
  56. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/events/clients.py +0 -0
  57. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/exceptions.py +0 -0
  58. {lago_python_client-1.31.0/lago_python_client/gross_revenues → lago_python_client-1.33.0/lago_python_client/fees}/__init__.py +0 -0
  59. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/fees/clients.py +0 -0
  60. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/functools_ext.py +0 -0
  61. {lago_python_client-1.31.0/lago_python_client/invoice_collections → lago_python_client-1.33.0/lago_python_client/gross_revenues}/__init__.py +0 -0
  62. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/gross_revenues/clients.py +0 -0
  63. {lago_python_client-1.31.0/lago_python_client/invoiced_usages → lago_python_client-1.33.0/lago_python_client/invoice_collections}/__init__.py +0 -0
  64. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/invoice_collections/clients.py +0 -0
  65. {lago_python_client-1.31.0/lago_python_client/invoices → lago_python_client-1.33.0/lago_python_client/invoiced_usages}/__init__.py +0 -0
  66. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/invoiced_usages/clients.py +0 -0
  67. {lago_python_client-1.31.0/lago_python_client/mrrs → lago_python_client-1.33.0/lago_python_client/invoices}/__init__.py +0 -0
  68. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/invoices/clients.py +0 -0
  69. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/mixins.py +0 -0
  70. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/models/activity_log.py +0 -0
  71. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/models/add_on.py +0 -0
  72. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/models/applied_coupon.py +0 -0
  73. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/models/billable_metric.py +0 -0
  74. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/models/billing_period.py +0 -0
  75. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/models/coupon.py +0 -0
  76. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/models/credit.py +0 -0
  77. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/models/credit_note.py +0 -0
  78. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/models/error_detail.py +0 -0
  79. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/models/event.py +0 -0
  80. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/models/gross_revenue.py +0 -0
  81. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/models/invoice.py +0 -0
  82. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/models/invoice_collection.py +0 -0
  83. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/models/invoice_item.py +0 -0
  84. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/models/invoiced_usage.py +0 -0
  85. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/models/lifetime_usage.py +0 -0
  86. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/models/minimum_commitment.py +0 -0
  87. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/models/mrr.py +0 -0
  88. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/models/organization.py +0 -0
  89. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/models/overdue_balance.py +0 -0
  90. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/models/payment.py +0 -0
  91. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/models/payment_receipt.py +0 -0
  92. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/models/payment_request.py +0 -0
  93. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/models/plan.py +0 -0
  94. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/models/tax.py +0 -0
  95. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/models/usage_threshold.py +0 -0
  96. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/models/wallet_transaction.py +0 -0
  97. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/models/webhook_endpoint.py +0 -0
  98. {lago_python_client-1.31.0/lago_python_client/organizations → lago_python_client-1.33.0/lago_python_client/mrrs}/__init__.py +0 -0
  99. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/mrrs/clients.py +0 -0
  100. {lago_python_client-1.31.0/lago_python_client/overdue_balances → lago_python_client-1.33.0/lago_python_client/organizations}/__init__.py +0 -0
  101. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/organizations/clients.py +0 -0
  102. {lago_python_client-1.31.0/lago_python_client/payment_receipts → lago_python_client-1.33.0/lago_python_client/overdue_balances}/__init__.py +0 -0
  103. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/overdue_balances/clients.py +0 -0
  104. {lago_python_client-1.31.0/lago_python_client/payment_requests → lago_python_client-1.33.0/lago_python_client/payment_receipts}/__init__.py +0 -0
  105. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/payment_receipts/clients.py +0 -0
  106. {lago_python_client-1.31.0/lago_python_client/payments → lago_python_client-1.33.0/lago_python_client/payment_requests}/__init__.py +0 -0
  107. {lago_python_client-1.31.0/lago_python_client/plans → lago_python_client-1.33.0/lago_python_client/payments}/__init__.py +0 -0
  108. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/payments/clients.py +0 -0
  109. {lago_python_client-1.31.0/lago_python_client/services → lago_python_client-1.33.0/lago_python_client/plans}/__init__.py +0 -0
  110. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/plans/clients.py +0 -0
  111. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/py.typed +0 -0
  112. {lago_python_client-1.31.0/lago_python_client/subscriptions → lago_python_client-1.33.0/lago_python_client/services}/__init__.py +0 -0
  113. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/services/json.py +0 -0
  114. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/services/request.py +0 -0
  115. {lago_python_client-1.31.0/lago_python_client/taxes → lago_python_client-1.33.0/lago_python_client/subscriptions}/__init__.py +0 -0
  116. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/subscriptions/clients.py +0 -0
  117. {lago_python_client-1.31.0/lago_python_client/wallets → lago_python_client-1.33.0/lago_python_client/taxes}/__init__.py +0 -0
  118. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/taxes/clients.py +0 -0
  119. {lago_python_client-1.31.0/lago_python_client/webhook_endpoints → lago_python_client-1.33.0/lago_python_client/usages}/__init__.py +0 -0
  120. {lago_python_client-1.31.0/lago_python_client/webhooks → lago_python_client-1.33.0/lago_python_client/wallets}/__init__.py +0 -0
  121. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/wallets/clients.py +0 -0
  122. {lago_python_client-1.31.0/tests → lago_python_client-1.33.0/lago_python_client/webhook_endpoints}/__init__.py +0 -0
  123. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client/webhook_endpoints/clients.py +0 -0
  124. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client.egg-info/dependency_links.txt +0 -0
  125. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/lago_python_client.egg-info/top_level.txt +0 -0
  126. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/pyproject.toml +0 -0
  127. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/tests/test_activity_logs_client.py +0 -0
  128. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/tests/test_add_on_client.py +0 -0
  129. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/tests/test_applied_coupon_client.py +0 -0
  130. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/tests/test_billable_metric_client.py +0 -0
  131. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/tests/test_client.py +0 -0
  132. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/tests/test_coupon_client.py +0 -0
  133. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/tests/test_credit_note_client.py +0 -0
  134. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/tests/test_event_client.py +0 -0
  135. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/tests/test_fee_client.py +0 -0
  136. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/tests/test_functools_ext.py +0 -0
  137. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/tests/test_gross_revenue_client.py +0 -0
  138. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/tests/test_invoice_client.py +0 -0
  139. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/tests/test_invoice_collection_client.py +0 -0
  140. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/tests/test_invoiced_usage_client.py +0 -0
  141. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/tests/test_json_services.py +0 -0
  142. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/tests/test_mrr_client.py +0 -0
  143. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/tests/test_organization_client.py +0 -0
  144. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/tests/test_overdue_balance_client.py +0 -0
  145. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/tests/test_payment_client.py +0 -0
  146. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/tests/test_payment_receipt_client.py +0 -0
  147. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/tests/test_plan_client.py +0 -0
  148. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/tests/test_request_services.py +0 -0
  149. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/tests/test_response_services.py +0 -0
  150. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/tests/test_tax_client.py +0 -0
  151. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/tests/test_wallet_transaction_client.py +0 -0
  152. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/tests/test_webhook_client.py +0 -0
  153. {lago_python_client-1.31.0 → lago_python_client-1.33.0}/tests/test_webhook_endpoint_client.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lago-python-client
3
- Version: 1.31.0
3
+ Version: 1.33.0
4
4
  Summary: Lago Python API Client
5
5
  Home-page: https://github.com/getlago/lago-python-client
6
6
  Author: Lovro Colic
@@ -24,11 +24,13 @@ Requires-Dist: classes~=0.4.1
24
24
  Requires-Dist: httpx<1.0.0,>=0.24.0
25
25
  Requires-Dist: orjson~=3.8
26
26
  Requires-Dist: pydantic<3,>=1.10
27
- Requires-Dist: typeguard~=3.0.2
27
+ Requires-Dist: typeguard~=4.0
28
28
  Provides-Extra: test
29
29
  Requires-Dist: mypy==0.971; extra == "test"
30
30
  Requires-Dist: pytest; extra == "test"
31
31
  Requires-Dist: pytest_httpx; extra == "test"
32
+ Provides-Extra: lint
33
+ Requires-Dist: ruff; extra == "lint"
32
34
  Dynamic: license-file
33
35
 
34
36
  # Lago Python Client
@@ -40,10 +42,10 @@ This is a python wrapper for Lago API
40
42
 
41
43
  ## Current Releases
42
44
 
43
- | Project | Release Badge |
44
- |--------------------|-----------------------------------------------------------------------------------------------------|
45
- | **Lago** | [![Lago Release](https://img.shields.io/github/v/release/getlago/lago)](https://github.com/getlago/lago/releases) |
46
- | **Lago Python Client** | [![Lago Python Client Release](https://img.shields.io/github/v/release/getlago/lago-python-client)](https://github.com/getlago/lago-python-client/releases) |
45
+ | Project | Release Badge |
46
+ | ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
47
+ | **Lago** | [![Lago Release](https://img.shields.io/github/v/release/getlago/lago)](https://github.com/getlago/lago/releases) |
48
+ | **Lago Python Client** | [![Lago Python Client Release](https://img.shields.io/github/v/release/getlago/lago-python-client)](https://github.com/getlago/lago-python-client/releases) |
47
49
 
48
50
  ## Installation
49
51
 
@@ -65,7 +67,7 @@ Check the [lago API reference](https://doc.getlago.com/docs/api/intro)
65
67
 
66
68
  ```bash
67
69
  python -m pip install --upgrade pip setuptools wheel
68
- python -m pip install '.[test]'
70
+ python -m pip install '.[test,lint]'
69
71
  ```
70
72
 
71
73
  ### Run tests
@@ -74,6 +76,12 @@ python -m pip install '.[test]'
74
76
  pytest
75
77
  ```
76
78
 
79
+ ### Lint
80
+
81
+ ```bash
82
+ ruff format
83
+ ```
84
+
77
85
  ## Documentation
78
86
 
79
87
  The Lago documentation is available at [doc.getlago.com](https://doc.getlago.com/docs/api/intro).
@@ -7,10 +7,10 @@ This is a python wrapper for Lago API
7
7
 
8
8
  ## Current Releases
9
9
 
10
- | Project | Release Badge |
11
- |--------------------|-----------------------------------------------------------------------------------------------------|
12
- | **Lago** | [![Lago Release](https://img.shields.io/github/v/release/getlago/lago)](https://github.com/getlago/lago/releases) |
13
- | **Lago Python Client** | [![Lago Python Client Release](https://img.shields.io/github/v/release/getlago/lago-python-client)](https://github.com/getlago/lago-python-client/releases) |
10
+ | Project | Release Badge |
11
+ | ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
12
+ | **Lago** | [![Lago Release](https://img.shields.io/github/v/release/getlago/lago)](https://github.com/getlago/lago/releases) |
13
+ | **Lago Python Client** | [![Lago Python Client Release](https://img.shields.io/github/v/release/getlago/lago-python-client)](https://github.com/getlago/lago-python-client/releases) |
14
14
 
15
15
  ## Installation
16
16
 
@@ -32,7 +32,7 @@ Check the [lago API reference](https://doc.getlago.com/docs/api/intro)
32
32
 
33
33
  ```bash
34
34
  python -m pip install --upgrade pip setuptools wheel
35
- python -m pip install '.[test]'
35
+ python -m pip install '.[test,lint]'
36
36
  ```
37
37
 
38
38
  ### Run tests
@@ -41,6 +41,12 @@ python -m pip install '.[test]'
41
41
  pytest
42
42
  ```
43
43
 
44
+ ### Lint
45
+
46
+ ```bash
47
+ ruff format
48
+ ```
49
+
44
50
  ## Documentation
45
51
 
46
52
  The Lago documentation is available at [doc.getlago.com](https://doc.getlago.com/docs/api/intro).
@@ -0,0 +1,18 @@
1
+ from typing import ClassVar, Type
2
+
3
+ from ..base_client import BaseClient
4
+ from ..mixins import (
5
+ FindAllCommandMixin,
6
+ FindCommandMixin,
7
+ )
8
+ from ..models.api_log import ApiLogResponse
9
+
10
+
11
+ class ApiLogClient(
12
+ FindAllCommandMixin[ApiLogResponse],
13
+ FindCommandMixin[ApiLogResponse],
14
+ BaseClient,
15
+ ):
16
+ API_RESOURCE: ClassVar[str] = "api_logs"
17
+ RESPONSE_MODEL: ClassVar[Type[ApiLogResponse]] = ApiLogResponse
18
+ ROOT_NAME: ClassVar[str] = "api_log"
@@ -22,10 +22,12 @@ from .invoice_collections.clients import InvoiceCollectionClient
22
22
  from .plans.clients import PlanClient
23
23
  from .subscriptions.clients import SubscriptionClient
24
24
  from .taxes.clients import TaxClient
25
+ from .usages.clients import UsageClient
25
26
  from .wallets.clients import WalletClient, WalletTransactionClient
26
27
  from .webhooks.clients import WebhookClient
27
28
  from .webhook_endpoints.clients import WebhookEndpointClient
28
29
  from .activity_logs.clients import ActivityLogClient
30
+ from .api_logs.clients import ApiLogClient
29
31
 
30
32
  try:
31
33
  from typing import Final
@@ -150,6 +152,10 @@ class Client:
150
152
  def taxes(self) -> TaxClient:
151
153
  return TaxClient(self.base_api_url, self.api_key)
152
154
 
155
+ @callable_cached_property
156
+ def usages(self) -> UsageClient:
157
+ return UsageClient(self.base_api_url, self.api_key)
158
+
153
159
  @callable_cached_property
154
160
  def wallets(self) -> WalletClient:
155
161
  return WalletClient(self.base_api_url, self.api_key)
@@ -169,3 +175,7 @@ class Client:
169
175
  @callable_cached_property
170
176
  def activity_logs(self) -> ActivityLogClient:
171
177
  return ActivityLogClient(self.base_api_url, self.api_key)
178
+
179
+ @callable_cached_property
180
+ def api_logs(self) -> ApiLogClient:
181
+ return ApiLogClient(self.base_api_url, self.api_key)
@@ -10,6 +10,7 @@ from ..mixins import (
10
10
  )
11
11
  from ..models.customer import CustomerResponse
12
12
  from ..models.customer_usage import CustomerUsageResponse
13
+ from ..models.customer_projected_usage import CustomerProjectedUsageResponse
13
14
  from ..services.request import make_headers, make_url, send_get_request, send_post_request, QueryPairs
14
15
  from ..services.response import (
15
16
  get_response_data,
@@ -56,6 +57,27 @@ class CustomerClient(
56
57
  data=get_response_data(response=api_response, key="customer_usage"),
57
58
  )
58
59
 
60
+ def projected_usage(
61
+ self, resource_id: str, external_subscription_id: str, apply_taxes: Optional[str] = None
62
+ ) -> CustomerProjectedUsageResponse:
63
+ query_params = {"external_subscription_id": external_subscription_id}
64
+ if apply_taxes is not None:
65
+ query_params["apply_taxes"] = apply_taxes
66
+
67
+ api_response: Response = send_get_request(
68
+ url=make_url(
69
+ origin=self.base_url,
70
+ path_parts=(self.API_RESOURCE, resource_id, "projected_usage"),
71
+ query_pairs=query_params,
72
+ ),
73
+ headers=make_headers(api_key=self.api_key),
74
+ )
75
+
76
+ return prepare_object_response(
77
+ response_model=CustomerProjectedUsageResponse,
78
+ data=get_response_data(response=api_response, key="customer_projected_usage"),
79
+ )
80
+
59
81
  def past_usage(
60
82
  self,
61
83
  resource_id: str,
@@ -1,4 +1,5 @@
1
1
  from .activity_log import ActivityLog as ActivityLog, ActivityLogResponse as ActivityLogResponse
2
+ from .api_log import ApiLog as ApiLog, ApiLogResponse as ApiLogResponse
2
3
  from .applied_coupon import AppliedCoupon as AppliedCoupon
3
4
  from .billable_metric import (
4
5
  BillableMetric as BillableMetric,
@@ -66,6 +67,10 @@ from .invoice import (
66
67
  InvoiceFee as InvoiceFee,
67
68
  )
68
69
  from .invoice_item import InvoiceItemResponse as InvoiceItemResponse
70
+ from .invoice_custom_section import (
71
+ InvoiceCustomSectionResponse as InvoiceCustomSectionResponse,
72
+ InvoiceCustomSectionsResponseList as InvoiceCustomSectionsResponseList,
73
+ )
69
74
  from .minimum_commitment import (
70
75
  MinimumCommitment as MinimumCommitment,
71
76
  MinimumCommitmentResponse as MinimumCommitmentResponse,
@@ -0,0 +1,33 @@
1
+ from typing import Optional
2
+
3
+ from lago_python_client.base_model import BaseModel
4
+
5
+ from ..base_model import BaseResponseModel
6
+
7
+
8
+ class ApiLog(BaseModel):
9
+ api_version: str
10
+ client: str
11
+ http_method: str
12
+ http_status: int
13
+ request_body: dict
14
+ logged_at: str
15
+ request_origin: str
16
+ created_at: str
17
+ request_path: str
18
+ request_response: Optional[dict]
19
+ request_id: str
20
+
21
+
22
+ class ApiLogResponse(BaseResponseModel):
23
+ request_id: str
24
+ client: str
25
+ http_method: str
26
+ http_status: int
27
+ request_origin: str
28
+ request_path: str
29
+ request_body: dict
30
+ request_response: Optional[dict]
31
+ api_version: str
32
+ logged_at: str
33
+ created_at: str
@@ -1,7 +1,9 @@
1
1
  from typing import Optional, List
2
+ from datetime import datetime
3
+
2
4
  from ..base_model import BaseModel, BaseResponseModel
3
5
  from .tax import TaxesResponse
4
- from datetime import datetime
6
+ from .invoice_custom_section import InvoiceCustomSectionsResponseList
5
7
 
6
8
 
7
9
  class BillingEntityBillingConfiguration(BaseModel):
@@ -60,6 +62,7 @@ class BillingEntityUpdate(BaseModel):
60
62
  tax_codes: Optional[List[str]]
61
63
  email_settings: Optional[List[str]]
62
64
  billing_configuration: Optional[BillingEntityBillingConfiguration]
65
+ invoice_custom_section_codes: Optional[List[str]]
63
66
 
64
67
 
65
68
  class BillingEntityResponse(BaseResponseModel):
@@ -92,5 +95,6 @@ class BillingEntityResponse(BaseResponseModel):
92
95
  invoice_grace_period: Optional[int]
93
96
  email_settings: Optional[List[str]]
94
97
  taxes: Optional[TaxesResponse]
98
+ selected_invoice_custom_sections: Optional[InvoiceCustomSectionsResponseList]
95
99
  created_at: datetime
96
100
  updated_at: datetime
@@ -12,6 +12,11 @@ class ChargeFilter(BaseModel):
12
12
  values: Optional[Dict[str, List[str]]]
13
13
 
14
14
 
15
+ class AppliedPricingUnit(BaseModel):
16
+ code: Optional[str]
17
+ conversion_rate: Optional[float]
18
+
19
+
15
20
  class ChargeFilters(BaseModel):
16
21
  __root__: List[ChargeFilter]
17
22
 
@@ -29,6 +34,7 @@ class Charge(BaseModel):
29
34
  properties: Optional[Dict[str, Any]]
30
35
  filters: Optional[ChargeFilters]
31
36
  tax_codes: Optional[List[str]]
37
+ applied_pricing_unit: Optional[AppliedPricingUnit]
32
38
 
33
39
 
34
40
  class Charges(BaseModel):
@@ -5,6 +5,7 @@ from lago_python_client.base_model import BaseModel
5
5
  from ..base_model import BaseResponseModel
6
6
 
7
7
  from .tax import TaxesResponse
8
+ from .invoice_custom_section import InvoiceCustomSectionsResponseList
8
9
 
9
10
 
10
11
  class CustomerBillingConfiguration(BaseModel):
@@ -75,21 +76,6 @@ class MetadataResponseList(BaseModel):
75
76
  __root__: List[MetadataResponse]
76
77
 
77
78
 
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
-
93
79
  class Customer(BaseModel):
94
80
  external_id: str
95
81
  address_line1: Optional[str]
@@ -0,0 +1,73 @@
1
+ from typing import Dict, List, Optional
2
+
3
+ from lago_python_client.base_model import BaseModel
4
+
5
+ from ..base_model import BaseResponseModel
6
+
7
+
8
+ class Metric(BaseModel):
9
+ lago_id: str
10
+ name: str
11
+ code: str
12
+ aggregation_type: str
13
+
14
+
15
+ class PricingUnitDetails(BaseModel):
16
+ amount_cents: int
17
+ short_name: str
18
+ conversion_rate: float
19
+
20
+
21
+ class ProjectedChargeFilterUsage(BaseModel):
22
+ invoice_display_name: Optional[str]
23
+ values: Dict[str, List[str]]
24
+ units: str
25
+ projected_units: str
26
+ amount_cents: int
27
+ projected_amount_cents: int
28
+ events_count: int
29
+ pricing_unit_details: Optional[PricingUnitDetails]
30
+
31
+
32
+ class ChargeObject(BaseModel):
33
+ lago_id: str
34
+ charge_model: str
35
+ invoice_display_name: Optional[str]
36
+
37
+
38
+ class ProjectedGroupedUsage(BaseModel):
39
+ amount_cents: int
40
+ projected_amount_cents: int
41
+ events_count: int
42
+ units: str
43
+ projected_units: str
44
+ grouped_by: Dict[str, str]
45
+ filters: List[ProjectedChargeFilterUsage]
46
+ pricing_unit_details: Optional[PricingUnitDetails]
47
+
48
+
49
+ class ProjectedChargeUsage(BaseModel):
50
+ units: str
51
+ projected_units: str
52
+ events_count: int
53
+ amount_cents: int
54
+ projected_amount_cents: int
55
+ amount_currency: str
56
+ charge: ChargeObject
57
+ billable_metric: Metric
58
+ filters: List[ProjectedChargeFilterUsage]
59
+ grouped_usage: Optional[List[ProjectedGroupedUsage]]
60
+ pricing_unit_details: Optional[PricingUnitDetails]
61
+
62
+
63
+ class CustomerProjectedUsageResponse(BaseResponseModel):
64
+ from_datetime: str
65
+ to_datetime: str
66
+ issuing_date: str
67
+ invoice_id: Optional[str]
68
+ currency: str
69
+ amount_cents: int
70
+ projected_amount_cents: int
71
+ total_amount_cents: int
72
+ taxes_amount_cents: int
73
+ charges_usage: List[ProjectedChargeUsage]
@@ -12,12 +12,19 @@ class Metric(BaseModel):
12
12
  aggregation_type: str
13
13
 
14
14
 
15
+ class PricingUnitDetails(BaseModel):
16
+ amount_cents: int
17
+ short_name: str
18
+ conversion_rate: float
19
+
20
+
15
21
  class ChargeFilterUsage(BaseModel):
16
22
  invoice_display_name: Optional[str]
17
23
  values: Dict[str, List[str]]
18
24
  units: str
19
25
  amount_cents: int
20
26
  events_count: int
27
+ pricing_unit_details: Optional[PricingUnitDetails]
21
28
 
22
29
 
23
30
  class ChargeObject(BaseModel):
@@ -29,13 +36,14 @@ class ChargeObject(BaseModel):
29
36
  class GroupedUsage(BaseModel):
30
37
  amount_cents: int
31
38
  events_count: int
32
- units: float
39
+ units: str
33
40
  grouped_by: Dict[str, str]
34
41
  filters: List[ChargeFilterUsage]
42
+ pricing_unit_details: Optional[PricingUnitDetails]
35
43
 
36
44
 
37
45
  class ChargeUsage(BaseModel):
38
- units: float
46
+ units: str
39
47
  events_count: int
40
48
  amount_cents: int
41
49
  amount_currency: str
@@ -43,6 +51,7 @@ class ChargeUsage(BaseModel):
43
51
  billable_metric: Metric
44
52
  filters: List[ChargeFilterUsage]
45
53
  grouped_usage: Optional[List[GroupedUsage]]
54
+ pricing_unit_details: Optional[PricingUnitDetails]
46
55
 
47
56
 
48
57
  class CustomerUsageResponse(BaseResponseModel):
@@ -26,6 +26,17 @@ class FeeAppliedTaxes(BaseResponseModel):
26
26
  __root__: List[FeeAppliedTax]
27
27
 
28
28
 
29
+ class PricingUnitDetails(BaseResponseModel):
30
+ lago_pricing_unit_id: Optional[str]
31
+ pricing_unit_code: Optional[str]
32
+ short_name: Optional[str]
33
+ amount_cents: Optional[int]
34
+ precise_amount_cents: Optional[str]
35
+ unit_amount_cents: Optional[int]
36
+ precise_unit_amount: Optional[str]
37
+ conversion_rate: Optional[float]
38
+
39
+
29
40
  class FeeResponse(BaseResponseModel):
30
41
  lago_id: Optional[str]
31
42
  lago_charge_id: Optional[str]
@@ -59,6 +70,7 @@ class FeeResponse(BaseResponseModel):
59
70
  from_date: Optional[str]
60
71
  to_date: Optional[str]
61
72
  amount_details: Optional[Dict[str, Any]]
73
+ pricing_unit_details: Optional[PricingUnitDetails]
62
74
  billing_entity_code: Optional[str]
63
75
 
64
76
  item: Optional[InvoiceItemResponse]
@@ -0,0 +1,17 @@
1
+ from typing import List, Optional
2
+
3
+ from ..base_model import BaseResponseModel
4
+
5
+
6
+ class InvoiceCustomSectionResponse(BaseResponseModel):
7
+ lago_id: Optional[str]
8
+ code: Optional[str]
9
+ name: Optional[str]
10
+ description: Optional[str]
11
+ details: Optional[str]
12
+ display_name: Optional[str]
13
+ applied_to_organization: Optional[bool] # Deprecated
14
+
15
+
16
+ class InvoiceCustomSectionsResponseList(BaseResponseModel):
17
+ __root__: List[InvoiceCustomSectionResponse]
@@ -44,6 +44,8 @@ class SubscriptionResponse(BaseResponseModel):
44
44
  downgrade_plan_date: Optional[str]
45
45
  current_billing_period_started_at: Optional[str]
46
46
  current_billing_period_ending_at: Optional[str]
47
+ on_termination_credit_note: Optional[str]
48
+ on_termination_invoice: Optional[str]
47
49
 
48
50
 
49
51
  class SubscriptionsResponse(BaseResponseModel):
@@ -0,0 +1,18 @@
1
+ from typing import List
2
+
3
+ from ..base_model import BaseResponseModel
4
+
5
+
6
+ class UsageResponse(BaseResponseModel):
7
+ organization_id: str
8
+ start_of_period_dt: str
9
+ end_of_period_dt: str
10
+ amount_currency: str
11
+ amount_cents: int
12
+ billable_metric_code: str
13
+ units: float
14
+ is_billable_metric_deleted: bool
15
+
16
+
17
+ class UsagesResponse(BaseResponseModel):
18
+ __root__: List[UsageResponse]
@@ -45,6 +45,7 @@ class RecurringTransactionRuleResponseList(BaseModel):
45
45
 
46
46
  class AppliesTo(BaseModel):
47
47
  fee_types: Optional[List[str]]
48
+ billable_metric_codes: Optional[List[str]]
48
49
 
49
50
 
50
51
  class Wallet(BaseModel):
@@ -1,13 +1,14 @@
1
1
  from typing import ClassVar, Type
2
2
 
3
3
  from ..base_client import BaseClient
4
- from ..mixins import CreateCommandMixin, FindAllCommandMixin
4
+ from ..mixins import CreateCommandMixin, FindAllCommandMixin, FindCommandMixin
5
5
  from ..models.payment_request import PaymentRequestResponse
6
6
 
7
7
 
8
8
  class PaymentRequestClient(
9
9
  CreateCommandMixin[PaymentRequestResponse],
10
10
  FindAllCommandMixin[PaymentRequestResponse],
11
+ FindCommandMixin[PaymentRequestResponse],
11
12
  BaseClient,
12
13
  ):
13
14
  API_RESOURCE: ClassVar[str] = "payment_requests"
@@ -13,7 +13,7 @@ except ImportError: # Python 3.7
13
13
 
14
14
  from httpx import Response as Response # not a typo! implicit reexport
15
15
  from lago_python_client.base_model import BaseModel
16
- import typeguard
16
+ from typeguard import check_type, CollectionCheckStrategy, TypeCheckError
17
17
 
18
18
  from ..exceptions import LagoApiError
19
19
  from ..services.json import DeserializedData, from_json
@@ -25,8 +25,6 @@ else:
25
25
 
26
26
  _M = TypeVar("_M", bound=BaseModel)
27
27
 
28
- typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS
29
-
30
28
  RESPONSE_SUCCESS_CODES: Final[Set[int]] = {
31
29
  HTTPStatus.OK, # 200
32
30
  HTTPStatus.CREATED, # 201
@@ -74,8 +72,10 @@ def get_response_data(*, response: Response, key: str = "") -> Optional[_Mapping
74
72
 
75
73
  # Ensure deserialized_data has correct type: sequence or mapping or raise LagoApiError
76
74
  try:
77
- mapping_or_sequence_data = typeguard.check_type(deserialized_data, _MappingOrSequence)
78
- except typeguard.TypeCheckError as exc:
75
+ mapping_or_sequence_data = check_type(
76
+ deserialized_data, _MappingOrSequence, collection_check_strategy=CollectionCheckStrategy.ALL_ITEMS
77
+ )
78
+ except TypeCheckError as exc:
79
79
  raise LagoApiError(
80
80
  status_code=HTTPStatus.INTERNAL_SERVER_ERROR, # 500
81
81
  url=None,
@@ -113,8 +113,10 @@ def prepare_index_response(
113
113
  # Ensure deserialized_data has correct type: mapping with mapping or sequence inside or raise LagoApiError
114
114
 
115
115
  try:
116
- response_data: Mapping[str, _MappingOrSequence] = typeguard.check_type(data, Mapping[str, _MappingOrSequence])
117
- except typeguard.TypeCheckError as exc:
116
+ response_data: Mapping[str, _MappingOrSequence] = check_type(
117
+ data, Mapping[str, _MappingOrSequence], collection_check_strategy=CollectionCheckStrategy.ALL_ITEMS
118
+ )
119
+ except TypeCheckError as exc:
118
120
  raise LagoApiError(
119
121
  status_code=HTTPStatus.INTERNAL_SERVER_ERROR, # 500
120
122
  url=None,
@@ -140,8 +142,10 @@ def prepare_object_list_response(
140
142
  # The only usage - ``WalletTransactionClient.create``
141
143
  # Ensure deserialized_data has correct type: sequence with mapping or sequence inside or raise LagoApiError
142
144
  try:
143
- response_data: Sequence[_MappingOrSequence] = typeguard.check_type(data, Sequence[_MappingOrSequence])
144
- except typeguard.TypeCheckError as exc:
145
+ response_data: Sequence[_MappingOrSequence] = check_type(
146
+ data, Sequence[_MappingOrSequence], collection_check_strategy=CollectionCheckStrategy.ALL_ITEMS
147
+ )
148
+ except TypeCheckError as exc:
145
149
  raise LagoApiError(
146
150
  status_code=HTTPStatus.INTERNAL_SERVER_ERROR, # 500
147
151
  url=None,
@@ -0,0 +1,39 @@
1
+ import sys
2
+ from typing import Any, ClassVar, Type
3
+
4
+ from ..base_client import BaseClient
5
+ from ..mixins import FindAllCommandMixin
6
+ from ..models.usage import UsageResponse
7
+ from ..services.request import make_headers, make_url, send_get_request, QueryPairs
8
+ from ..services.response import get_response_data, prepare_index_response, Response
9
+
10
+ if sys.version_info >= (3, 9):
11
+ from collections.abc import Mapping
12
+ else:
13
+ from typing import Mapping
14
+
15
+
16
+ class UsageClient(
17
+ FindAllCommandMixin[UsageResponse],
18
+ BaseClient,
19
+ ):
20
+ API_RESOURCE: ClassVar[str] = "usages"
21
+ RESPONSE_MODEL: ClassVar[Type[UsageResponse]] = UsageResponse
22
+ ROOT_NAME: ClassVar[str] = "usage"
23
+
24
+ def find_all(self, options: QueryPairs = {}) -> Mapping[str, Any]:
25
+ api_response: Response = send_get_request(
26
+ url=make_url(
27
+ origin=self.base_url,
28
+ path_parts=("analytics", "usage"),
29
+ query_pairs=options,
30
+ ),
31
+ headers=make_headers(api_key=self.api_key),
32
+ )
33
+
34
+ # Process response data
35
+ return prepare_index_response(
36
+ api_resource=self.API_RESOURCE,
37
+ response_model=self.RESPONSE_MODEL,
38
+ data=get_response_data(response=api_response),
39
+ )
@@ -0,0 +1 @@
1
+ LAGO_VERSION = "1.33.0"
@@ -9,7 +9,7 @@ except ImportError:
9
9
  from typing_extensions import TypedDict
10
10
 
11
11
  from lago_python_client.base_model import BaseModel
12
- import typeguard
12
+ from typeguard import check_type, CollectionCheckStrategy, TypeCheckError
13
13
 
14
14
  from ..base_client import BaseClient
15
15
  from ..exceptions import LagoApiError
@@ -21,8 +21,6 @@ if sys.version_info >= (3, 9):
21
21
  else:
22
22
  from typing import Mapping, Sequence
23
23
 
24
- typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS
25
-
26
24
 
27
25
  class _ResponseWithPublicKeyInside(TypedDict):
28
26
  public_key: str
@@ -46,10 +44,10 @@ class WebhookClient(BaseClient):
46
44
  )
47
45
 
48
46
  try:
49
- checked_response_data: _ResponseWithPublicKeyInside = typeguard.check_type(
50
- response_data, _ResponseWithPublicKeyInside
47
+ checked_response_data: _ResponseWithPublicKeyInside = check_type(
48
+ response_data, _ResponseWithPublicKeyInside, collection_check_strategy=CollectionCheckStrategy.ALL_ITEMS
51
49
  ) # type: ignore
52
- except typeguard.TypeCheckError:
50
+ except TypeCheckError:
53
51
  raise LagoApiError(
54
52
  status_code=HTTPStatus.INTERNAL_SERVER_ERROR, # 500
55
53
  url=None,