lago-python-client 1.55.0__tar.gz → 1.56.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 (208) hide show
  1. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/PKG-INFO +1 -1
  2. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/mixins.py +16 -1
  3. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/__init__.py +36 -0
  4. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/alert.py +35 -0
  5. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/billing_entity.py +3 -0
  6. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/customer.py +10 -0
  7. lago_python_client-1.56.0/lago_python_client/models/entitlement.py +52 -0
  8. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/fixed_charge.py +1 -1
  9. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/organization.py +3 -0
  10. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/payment.py +11 -1
  11. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/plan.py +5 -0
  12. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/subscription.py +7 -1
  13. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/usage_threshold.py +10 -0
  14. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/wallet.py +1 -0
  15. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/wallet_transaction.py +2 -0
  16. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/services/request.py +9 -3
  17. lago_python_client-1.56.0/lago_python_client/subscriptions/alert_client.py +86 -0
  18. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/subscriptions/clients.py +8 -0
  19. lago_python_client-1.56.0/lago_python_client/version.py +1 -0
  20. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/wallets/clients.py +1 -1
  21. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client.egg-info/PKG-INFO +1 -1
  22. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client.egg-info/SOURCES.txt +10 -0
  23. lago_python_client-1.56.0/tests/test_alert_webhook_models.py +124 -0
  24. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_billing_entity_client.py +39 -0
  25. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_customer_client.py +79 -0
  26. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_customer_wallet_alert_client.py +2 -2
  27. lago_python_client-1.56.0/tests/test_find_all_children.py +78 -0
  28. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_organization_client.py +21 -0
  29. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_payment_client.py +40 -0
  30. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_plan_client.py +75 -0
  31. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_request_services.py +23 -0
  32. lago_python_client-1.56.0/tests/test_subscription_alert_client.py +265 -0
  33. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_subscription_client.py +140 -0
  34. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_wallet_client.py +47 -0
  35. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_wallet_transaction_client.py +101 -0
  36. lago_python_client-1.55.0/lago_python_client/version.py +0 -1
  37. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/LICENSE +0 -0
  38. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/README.md +0 -0
  39. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/__init__.py +0 -0
  40. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/activity_logs/__init__.py +0 -0
  41. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/activity_logs/clients.py +0 -0
  42. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/add_ons/__init__.py +0 -0
  43. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/add_ons/clients.py +0 -0
  44. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/api_logs/__init__.py +0 -0
  45. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/api_logs/clients.py +0 -0
  46. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/base_client.py +0 -0
  47. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/base_model.py +0 -0
  48. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/billable_metrics/__init__.py +0 -0
  49. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/billable_metrics/clients.py +0 -0
  50. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/billing_entities/__init__.py +0 -0
  51. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/billing_entities/clients.py +0 -0
  52. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/client.py +0 -0
  53. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/coupons/__init__.py +0 -0
  54. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/coupons/clients.py +0 -0
  55. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/credit_notes/__init__.py +0 -0
  56. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/credit_notes/clients.py +0 -0
  57. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/customers/__init__.py +0 -0
  58. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/customers/applied_coupons_client.py +0 -0
  59. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/customers/clients.py +0 -0
  60. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/customers/credit_notes_client.py +0 -0
  61. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/customers/invoices_client.py +0 -0
  62. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/customers/payment_methods_client.py +0 -0
  63. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/customers/payment_requests_client.py +0 -0
  64. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/customers/payments_client.py +0 -0
  65. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/customers/subscriptions_client.py +0 -0
  66. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/customers/wallet_client.py +0 -0
  67. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/customers/wallets/__init__.py +0 -0
  68. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/customers/wallets/alert_client.py +0 -0
  69. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/customers/wallets/metadata_client.py +0 -0
  70. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/customers/wallets_client.py +0 -0
  71. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/events/__init__.py +0 -0
  72. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/events/clients.py +0 -0
  73. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/exceptions.py +0 -0
  74. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/fees/__init__.py +0 -0
  75. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/fees/clients.py +0 -0
  76. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/functools_ext.py +0 -0
  77. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/gross_revenues/__init__.py +0 -0
  78. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/gross_revenues/clients.py +0 -0
  79. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/invoice_collections/__init__.py +0 -0
  80. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/invoice_collections/clients.py +0 -0
  81. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/invoiced_usages/__init__.py +0 -0
  82. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/invoiced_usages/clients.py +0 -0
  83. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/invoices/__init__.py +0 -0
  84. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/invoices/clients.py +0 -0
  85. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/activity_log.py +0 -0
  86. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/add_on.py +0 -0
  87. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/api_log.py +0 -0
  88. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/applied_coupon.py +0 -0
  89. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/billable_metric.py +0 -0
  90. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/billing_period.py +0 -0
  91. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/charge.py +0 -0
  92. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/coupon.py +0 -0
  93. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/credit.py +0 -0
  94. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/credit_note.py +0 -0
  95. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/customer_projected_usage.py +0 -0
  96. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/customer_usage.py +0 -0
  97. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/error_detail.py +0 -0
  98. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/event.py +0 -0
  99. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/fee.py +0 -0
  100. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/gross_revenue.py +0 -0
  101. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/invoice.py +0 -0
  102. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/invoice_collection.py +0 -0
  103. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/invoice_custom_section.py +0 -0
  104. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/invoice_item.py +0 -0
  105. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/invoiced_usage.py +0 -0
  106. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/lifetime_usage.py +0 -0
  107. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/minimum_commitment.py +0 -0
  108. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/mrr.py +0 -0
  109. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/order.py +0 -0
  110. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/order_form.py +0 -0
  111. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/overdue_balance.py +0 -0
  112. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/payment_method.py +0 -0
  113. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/payment_receipt.py +0 -0
  114. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/payment_request.py +0 -0
  115. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/quote.py +0 -0
  116. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/tax.py +0 -0
  117. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/usage.py +0 -0
  118. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/models/webhook_endpoint.py +0 -0
  119. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/mrrs/__init__.py +0 -0
  120. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/mrrs/clients.py +0 -0
  121. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/observability.py +0 -0
  122. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/order_forms/__init__.py +0 -0
  123. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/order_forms/clients.py +0 -0
  124. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/orders/__init__.py +0 -0
  125. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/orders/clients.py +0 -0
  126. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/organizations/__init__.py +0 -0
  127. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/organizations/clients.py +0 -0
  128. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/overdue_balances/__init__.py +0 -0
  129. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/overdue_balances/clients.py +0 -0
  130. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/payment_receipts/__init__.py +0 -0
  131. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/payment_receipts/clients.py +0 -0
  132. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/payment_requests/__init__.py +0 -0
  133. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/payment_requests/clients.py +0 -0
  134. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/payments/__init__.py +0 -0
  135. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/payments/clients.py +0 -0
  136. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/plans/__init__.py +0 -0
  137. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/plans/charges_client.py +0 -0
  138. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/plans/clients.py +0 -0
  139. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/plans/fixed_charges_client.py +0 -0
  140. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/py.typed +0 -0
  141. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/quote_versions/__init__.py +0 -0
  142. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/quote_versions/clients.py +0 -0
  143. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/quotes/__init__.py +0 -0
  144. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/quotes/clients.py +0 -0
  145. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/services/__init__.py +0 -0
  146. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/services/json.py +0 -0
  147. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/services/rate_limit.py +0 -0
  148. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/services/response.py +0 -0
  149. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/subscriptions/__init__.py +0 -0
  150. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/subscriptions/charges_client.py +0 -0
  151. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/subscriptions/fixed_charges_client.py +0 -0
  152. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/taxes/__init__.py +0 -0
  153. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/taxes/clients.py +0 -0
  154. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/usages/__init__.py +0 -0
  155. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/usages/clients.py +0 -0
  156. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/wallets/__init__.py +0 -0
  157. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/webhook_endpoints/__init__.py +0 -0
  158. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/webhook_endpoints/clients.py +0 -0
  159. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/webhooks/__init__.py +0 -0
  160. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client/webhooks/clients.py +0 -0
  161. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client.egg-info/dependency_links.txt +0 -0
  162. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client.egg-info/requires.txt +0 -0
  163. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/lago_python_client.egg-info/top_level.txt +0 -0
  164. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/pyproject.toml +0 -0
  165. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/setup.cfg +0 -0
  166. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/__init__.py +0 -0
  167. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_activity_logs_client.py +0 -0
  168. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_add_on_client.py +0 -0
  169. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_api_logs_client.py +0 -0
  170. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_applied_coupon_client.py +0 -0
  171. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_billable_metric_client.py +0 -0
  172. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_client.py +0 -0
  173. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_coupon_client.py +0 -0
  174. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_credit_note_client.py +0 -0
  175. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_customer_applied_coupons_client.py +0 -0
  176. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_customer_credit_notes_client.py +0 -0
  177. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_customer_invoices_client.py +0 -0
  178. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_customer_payment_methods_client.py +0 -0
  179. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_customer_payment_requests_client.py +0 -0
  180. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_customer_payments_client.py +0 -0
  181. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_customer_sbscriptions_client.py +0 -0
  182. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_customer_wallet_client.py +0 -0
  183. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_customer_wallet_metadata_client.py +0 -0
  184. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_customer_wallets_client.py +0 -0
  185. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_event_client.py +0 -0
  186. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_fee_client.py +0 -0
  187. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_functools_ext.py +0 -0
  188. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_gross_revenue_client.py +0 -0
  189. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_invoice_client.py +0 -0
  190. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_invoice_collection_client.py +0 -0
  191. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_invoiced_usage_client.py +0 -0
  192. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_json_services.py +0 -0
  193. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_mrr_client.py +0 -0
  194. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_order_client.py +0 -0
  195. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_order_form_client.py +0 -0
  196. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_overdue_balance_client.py +0 -0
  197. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_payment_receipt_client.py +0 -0
  198. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_payment_request_client.py +0 -0
  199. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_quote_client.py +0 -0
  200. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_quote_version_client.py +0 -0
  201. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_rate_limit.py +0 -0
  202. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_response_services.py +0 -0
  203. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_tax_client.py +0 -0
  204. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_usage_client.py +0 -0
  205. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_webhook_client.py +0 -0
  206. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/test_webhook_endpoint_client.py +0 -0
  207. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/utils/__init__.py +0 -0
  208. {lago_python_client-1.55.0 → lago_python_client-1.56.0}/tests/utils/mixin.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lago-python-client
3
- Version: 1.55.0
3
+ Version: 1.56.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,3 +1,4 @@
1
+ import warnings
1
2
  from typing import Any, Generic, Optional, Type, TypeVar, Union
2
3
 
3
4
  import httpx
@@ -157,9 +158,14 @@ class FindAllChildrenCommandMixin(Generic[_M]):
157
158
  self: _ClientMixin[_M],
158
159
  resource_id: str,
159
160
  options: QueryPairs = None,
161
+ timeout: Optional[httpx.Timeout] = DEFAULT_TIMEOUT,
162
+ *,
160
163
  timetour: Optional[httpx.Timeout] = None,
161
164
  ) -> Mapping[str, Any]:
162
165
  """Execute `find_all` child command."""
166
+ if timetour is not None:
167
+ warnings.warn("timetour is deprecated, use timeout instead", DeprecationWarning, stacklevel=2)
168
+ timeout = timetour
163
169
  # Send request and save response
164
170
  if options is None:
165
171
  options = {}
@@ -173,6 +179,8 @@ class FindAllChildrenCommandMixin(Generic[_M]):
173
179
  ),
174
180
  query_pairs=options,
175
181
  ),
182
+ headers=make_headers(api_key=self.api_key),
183
+ timeout=timeout,
176
184
  rate_limit_retry_config=self.rate_limit_retry_config,
177
185
  )
178
186
 
@@ -387,6 +395,7 @@ class NestedCreateCommandMixin(Generic[_M]):
387
395
  def create(
388
396
  self: _ClientMixin[_M],
389
397
  *args: Union[str, BaseModel],
398
+ options: QueryPairs = None,
390
399
  timeout: Optional[httpx.Timeout] = None,
391
400
  ) -> Optional[_M]:
392
401
  """Execute `create` command."""
@@ -394,7 +403,7 @@ class NestedCreateCommandMixin(Generic[_M]):
394
403
 
395
404
  # Send request and save response
396
405
  api_response: Response = send_post_request(
397
- url=make_url(origin=self.base_url, path_parts=self.api_resource(*parent_ids)),
406
+ url=make_url(origin=self.base_url, path_parts=self.api_resource(*parent_ids), query_pairs=options),
398
407
  content=to_json(
399
408
  {
400
409
  self.ROOT_NAME: input_object.dict(exclude_none=True),
@@ -422,6 +431,7 @@ class NestedUpdateCommandMixin(Generic[_M]):
422
431
  def update(
423
432
  self: _ClientMixin[_M],
424
433
  *args: Union[str, BaseModel],
434
+ options: QueryPairs = None,
425
435
  timeout: Optional[httpx.Timeout] = None,
426
436
  ) -> _M:
427
437
  """Execute `update` command."""
@@ -432,6 +442,7 @@ class NestedUpdateCommandMixin(Generic[_M]):
432
442
  url=make_url(
433
443
  origin=self.base_url,
434
444
  path_parts=self.api_resource(*parent_ids) + (resource_id,),
445
+ query_pairs=options,
435
446
  ),
436
447
  content=to_json(
437
448
  {
@@ -456,6 +467,7 @@ class NestedDestroyCommandMixin(Generic[_M]):
456
467
  def destroy(
457
468
  self: _ClientMixin[_M],
458
469
  *args: str,
470
+ options: QueryPairs = None,
459
471
  timeout: Optional[httpx.Timeout] = None,
460
472
  ) -> BaseModel:
461
473
  """Execute `destroy` command."""
@@ -466,6 +478,7 @@ class NestedDestroyCommandMixin(Generic[_M]):
466
478
  url=make_url(
467
479
  origin=self.base_url,
468
480
  path_parts=self.api_resource(*parent_ids) + (resource_id,),
481
+ query_pairs=options,
469
482
  ),
470
483
  headers=make_headers(api_key=self.api_key),
471
484
  timeout=timeout,
@@ -485,6 +498,7 @@ class NestedFindCommandMixin(Generic[_M]):
485
498
  def find(
486
499
  self: _ClientMixin[_M],
487
500
  *args: str,
501
+ options: QueryPairs = None,
488
502
  timeout: Optional[httpx.Timeout] = None,
489
503
  ) -> _M:
490
504
  """Execute `find` command."""
@@ -495,6 +509,7 @@ class NestedFindCommandMixin(Generic[_M]):
495
509
  url=make_url(
496
510
  origin=self.base_url,
497
511
  path_parts=self.api_resource(*parent_ids) + (resource_id,),
512
+ query_pairs=options,
498
513
  ),
499
514
  headers=make_headers(api_key=self.api_key),
500
515
  timeout=timeout,
@@ -25,6 +25,12 @@ from .alert import (
25
25
  from .alert import (
26
26
  AlertThresholdResponseList as AlertThresholdResponseList,
27
27
  )
28
+ from .alert import (
29
+ TriggeredAlert as TriggeredAlert,
30
+ )
31
+ from .alert import (
32
+ ResolvedAlert as ResolvedAlert,
33
+ )
28
34
  from .api_log import ApiLog as ApiLog
29
35
  from .api_log import ApiLogResponse as ApiLogResponse
30
36
  from .applied_coupon import AppliedCoupon as AppliedCoupon
@@ -144,6 +150,30 @@ from .customer_usage import (
144
150
  from .customer_usage import (
145
151
  PresentationBreakdowns as PresentationBreakdowns,
146
152
  )
153
+ from .entitlement import (
154
+ PlanEntitlementPrivilegeResponse as PlanEntitlementPrivilegeResponse,
155
+ )
156
+ from .entitlement import (
157
+ PlanEntitlementPrivilegesResponse as PlanEntitlementPrivilegesResponse,
158
+ )
159
+ from .entitlement import (
160
+ PlanEntitlementResponse as PlanEntitlementResponse,
161
+ )
162
+ from .entitlement import (
163
+ PlanEntitlementsResponse as PlanEntitlementsResponse,
164
+ )
165
+ from .entitlement import (
166
+ SubscriptionEntitlementPrivilegeResponse as SubscriptionEntitlementPrivilegeResponse,
167
+ )
168
+ from .entitlement import (
169
+ SubscriptionEntitlementPrivilegesResponse as SubscriptionEntitlementPrivilegesResponse,
170
+ )
171
+ from .entitlement import (
172
+ SubscriptionEntitlementResponse as SubscriptionEntitlementResponse,
173
+ )
174
+ from .entitlement import (
175
+ SubscriptionEntitlementsResponse as SubscriptionEntitlementsResponse,
176
+ )
147
177
  from .event import BatchEvent as BatchEvent
148
178
  from .event import Event as Event
149
179
  from .fee import Fee as Fee
@@ -289,6 +319,12 @@ from .tax import (
289
319
  from .tax import (
290
320
  TaxResponse as TaxResponse,
291
321
  )
322
+ from .usage_threshold import (
323
+ ApplicableUsageThresholdResponse as ApplicableUsageThresholdResponse,
324
+ )
325
+ from .usage_threshold import (
326
+ ApplicableUsageThresholdsResponse as ApplicableUsageThresholdsResponse,
327
+ )
292
328
  from .usage_threshold import (
293
329
  UsageThreshold as UsageThreshold,
294
330
  )
@@ -8,6 +8,7 @@ class AlertThreshold(BaseModel):
8
8
  code: Optional[str]
9
9
  value: str
10
10
  recurring: Optional[bool]
11
+ notify_on: Optional[List[str]]
11
12
 
12
13
 
13
14
  class AlertThresholdList(BaseModel):
@@ -30,6 +31,7 @@ class AlertThresholdResponse(BaseResponseModel):
30
31
  code: Optional[str]
31
32
  value: str
32
33
  recurring: bool
34
+ notify_on: Optional[List[str]]
33
35
 
34
36
 
35
37
  class AlertThresholdResponseList(BaseResponseModel):
@@ -55,3 +57,36 @@ class AlertResponse(BaseResponseModel):
55
57
 
56
58
  class AlertsResponseList(BaseResponseModel):
57
59
  alerts: List[AlertResponse]
60
+
61
+
62
+ class AlertWebhookBase(BaseResponseModel):
63
+ lago_id: str
64
+ lago_organization_id: str
65
+ lago_alert_id: str
66
+ lago_subscription_id: Optional[str]
67
+ external_subscription_id: Optional[str]
68
+ lago_wallet_id: Optional[str]
69
+ external_customer_id: Optional[str]
70
+ billable_metric_code: Optional[str]
71
+ alert_name: Optional[str]
72
+ alert_code: str
73
+ alert_type: str
74
+ current_value: Optional[str]
75
+ previous_value: Optional[str]
76
+
77
+
78
+ class TriggeredAlert(AlertWebhookBase):
79
+ crossed_thresholds: AlertThresholdResponseList
80
+ triggered_at: str
81
+ # Deprecated
82
+ subscription_external_id: Optional[str]
83
+ # Deprecated
84
+ customer_external_id: Optional[str]
85
+
86
+
87
+ class ResolvedAlert(AlertWebhookBase):
88
+ recovered_thresholds: AlertThresholdResponseList
89
+ in_alarm_thresholds: List[str]
90
+ fully_resolved: bool
91
+ reason: Optional[str]
92
+ resolved_at: str
@@ -38,6 +38,7 @@ class BillingEntity(BaseModel):
38
38
  tax_identification_number: Optional[str]
39
39
  email_settings: Optional[List[str]]
40
40
  billing_configuration: Optional[BillingEntityBillingConfiguration]
41
+ einvoicing: Optional[bool]
41
42
 
42
43
 
43
44
  class BillingEntityUpdate(BaseModel):
@@ -65,6 +66,7 @@ class BillingEntityUpdate(BaseModel):
65
66
  email_settings: Optional[List[str]]
66
67
  billing_configuration: Optional[BillingEntityBillingConfiguration]
67
68
  invoice_custom_section_codes: Optional[List[str]]
69
+ einvoicing: Optional[bool]
68
70
 
69
71
 
70
72
  class BillingEntityResponse(BaseResponseModel):
@@ -99,5 +101,6 @@ class BillingEntityResponse(BaseResponseModel):
99
101
  email_settings: Optional[List[str]]
100
102
  taxes: Optional[TaxesResponse]
101
103
  selected_invoice_custom_sections: Optional[InvoiceCustomSectionsResponseList]
104
+ einvoicing: Optional[bool]
102
105
  created_at: datetime
103
106
  updated_at: datetime
@@ -35,6 +35,7 @@ class IntegrationCustomer(BaseModel):
35
35
  external_customer_id: Optional[str]
36
36
  integration_type: Optional[str]
37
37
  integration_code: Optional[str]
38
+ code: Optional[str]
38
39
  subsidiary_id: Optional[str]
39
40
  sync_with_provider: Optional[bool]
40
41
 
@@ -44,6 +45,9 @@ class IntegrationCustomerResponse(BaseModel):
44
45
  external_customer_id: Optional[str]
45
46
  type: Optional[str]
46
47
  integration_code: Optional[str]
48
+ code: Optional[str]
49
+ is_default: Optional[bool]
50
+ category: Optional[str]
47
51
  subsidiary_id: Optional[str]
48
52
  sync_with_provider: Optional[bool]
49
53
 
@@ -80,6 +84,7 @@ class MetadataResponseList(BaseModel):
80
84
 
81
85
  class Customer(BaseModel):
82
86
  external_id: str
87
+ account_type: Optional[str]
83
88
  address_line1: Optional[str]
84
89
  address_line2: Optional[str]
85
90
  city: Optional[str]
@@ -89,6 +94,7 @@ class Customer(BaseModel):
89
94
  legal_name: Optional[str]
90
95
  legal_number: Optional[str]
91
96
  net_payment_term: Optional[int]
97
+ external_salesforce_id: Optional[str]
92
98
  tax_identification_number: Optional[str]
93
99
  logo_url: Optional[str]
94
100
  name: Optional[str]
@@ -114,6 +120,9 @@ class Customer(BaseModel):
114
120
  class CustomerResponse(BaseResponseModel):
115
121
  lago_id: str
116
122
  external_id: str
123
+ account_type: Optional[str]
124
+ sequential_id: Optional[int]
125
+ slug: Optional[str]
117
126
  address_line1: Optional[str]
118
127
  address_line2: Optional[str]
119
128
  city: Optional[str]
@@ -125,6 +134,7 @@ class CustomerResponse(BaseResponseModel):
125
134
  legal_name: Optional[str]
126
135
  legal_number: Optional[str]
127
136
  net_payment_term: Optional[int]
137
+ external_salesforce_id: Optional[str]
128
138
  tax_identification_number: Optional[str]
129
139
  logo_url: Optional[str]
130
140
  name: Optional[str]
@@ -0,0 +1,52 @@
1
+ from typing import Any, Dict, List, Optional
2
+
3
+ from ..base_model import BaseResponseModel
4
+
5
+
6
+ class PlanEntitlementPrivilegeResponse(BaseResponseModel):
7
+ code: Optional[str]
8
+ name: Optional[str]
9
+ value_type: Optional[str]
10
+ config: Optional[Dict[str, Any]]
11
+ value: Any
12
+
13
+
14
+ class PlanEntitlementPrivilegesResponse(BaseResponseModel):
15
+ __root__: List[PlanEntitlementPrivilegeResponse]
16
+
17
+
18
+ class PlanEntitlementResponse(BaseResponseModel):
19
+ code: Optional[str]
20
+ name: Optional[str]
21
+ description: Optional[str]
22
+ privileges: Optional[PlanEntitlementPrivilegesResponse]
23
+
24
+
25
+ class PlanEntitlementsResponse(BaseResponseModel):
26
+ __root__: List[PlanEntitlementResponse]
27
+
28
+
29
+ class SubscriptionEntitlementPrivilegeResponse(BaseResponseModel):
30
+ code: Optional[str]
31
+ name: Optional[str]
32
+ value_type: Optional[str]
33
+ config: Optional[Dict[str, Any]]
34
+ value: Any
35
+ plan_value: Any
36
+ override_value: Any
37
+
38
+
39
+ class SubscriptionEntitlementPrivilegesResponse(BaseResponseModel):
40
+ __root__: List[SubscriptionEntitlementPrivilegeResponse]
41
+
42
+
43
+ class SubscriptionEntitlementResponse(BaseResponseModel):
44
+ code: Optional[str]
45
+ name: Optional[str]
46
+ description: Optional[str]
47
+ privileges: Optional[SubscriptionEntitlementPrivilegesResponse]
48
+ overrides: Optional[Dict[str, Any]]
49
+
50
+
51
+ class SubscriptionEntitlementsResponse(BaseResponseModel):
52
+ __root__: List[SubscriptionEntitlementResponse]
@@ -52,7 +52,7 @@ class FixedChargePropertiesResponse(BaseResponseModel):
52
52
  class FixedChargeResponse(BaseResponseModel):
53
53
  lago_id: str
54
54
  lago_add_on_id: str
55
- invoice_display_name: str
55
+ invoice_display_name: Optional[str]
56
56
  add_on_code: str
57
57
  created_at: str
58
58
  code: Optional[str]
@@ -32,9 +32,11 @@ class Organization(BaseModel):
32
32
  email_settings: Optional[List[str]]
33
33
  finalize_zero_amount_invoice: Optional[bool]
34
34
  billing_configuration: Optional[OrganizationBillingConfiguration]
35
+ slug: Optional[str]
35
36
 
36
37
 
37
38
  class OrganizationResponse(BaseResponseModel):
39
+ lago_id: Optional[str]
38
40
  name: str
39
41
  created_at: str
40
42
  webhook_url: Optional[str]
@@ -57,3 +59,4 @@ class OrganizationResponse(BaseResponseModel):
57
59
  finalize_zero_amount_invoice: Optional[bool]
58
60
  billing_configuration: Optional[OrganizationBillingConfiguration]
59
61
  events_store: Optional[str]
62
+ slug: Optional[str]
@@ -1,4 +1,4 @@
1
- from typing import List, Optional
1
+ from typing import Any, Dict, List, Optional
2
2
 
3
3
  from ..base_model import BaseModel, BaseResponseModel
4
4
 
@@ -12,14 +12,24 @@ class Payment(BaseModel):
12
12
 
13
13
  class PaymentResponse(BaseResponseModel):
14
14
  lago_id: str
15
+ lago_customer_id: Optional[str]
16
+ external_customer_id: Optional[str]
15
17
  invoice_ids: List[str]
16
18
  invoice_numbers: List[str]
19
+ lago_payable_id: Optional[str]
20
+ payable_type: Optional[str]
17
21
  amount_cents: int
18
22
  amount_currency: str
23
+ status: Optional[str]
19
24
  payment_status: str
20
25
  type: str
21
26
  reference: str
27
+ payment_provider_code: Optional[str]
28
+ payment_provider_type: Optional[str]
22
29
  external_payment_id: Optional[str]
30
+ provider_payment_id: Optional[str]
31
+ provider_customer_id: Optional[str]
32
+ next_action: Optional[Dict[str, Any]]
23
33
  created_at: str
24
34
 
25
35
 
@@ -4,6 +4,7 @@ from lago_python_client.base_model import BaseModel
4
4
 
5
5
  from ..base_model import BaseResponseModel
6
6
  from .charge import Charges, ChargesOverrides, ChargesResponse
7
+ from .entitlement import PlanEntitlementsResponse
7
8
  from .fixed_charge import (
8
9
  FixedCharges,
9
10
  FixedChargesOverrides,
@@ -16,6 +17,7 @@ from .minimum_commitment import (
16
17
  )
17
18
  from .tax import TaxesResponse
18
19
  from .usage_threshold import (
20
+ ApplicableUsageThresholdsResponse,
19
21
  UsageThresholds,
20
22
  UsageThresholdsOverrides,
21
23
  UsageThresholdsResponse,
@@ -63,6 +65,9 @@ class PlanResponse(BaseResponseModel):
63
65
  usage_thresholds: Optional[UsageThresholdsResponse]
64
66
  taxes: Optional[TaxesResponse]
65
67
  metadata: Optional[Dict[str, Optional[str]]]
68
+ pending_deletion: Optional[bool]
69
+ entitlements: Optional[PlanEntitlementsResponse]
70
+ applicable_usage_thresholds: Optional[ApplicableUsageThresholdsResponse]
66
71
 
67
72
 
68
73
  class PlanOverrides(BaseModel):
@@ -3,9 +3,11 @@ from typing import List, Optional
3
3
  from lago_python_client.base_model import BaseModel
4
4
 
5
5
  from ..base_model import BaseResponseModel
6
+ from .entitlement import SubscriptionEntitlementsResponse
6
7
  from .invoice_custom_section import AppliedInvoiceCustomSections, InvoiceCustomSectionInput
7
8
  from .payment_method import PaymentMethod
8
9
  from .plan import PlanOverrides
10
+ from .usage_threshold import ApplicableUsageThresholdsResponse, UsageThresholdsOverrides
9
11
 
10
12
 
11
13
  class ActivationRuleInput(BaseModel):
@@ -28,6 +30,8 @@ class Subscription(BaseModel):
28
30
  billing_entity_code: Optional[str]
29
31
  purchase_order_number: Optional[str]
30
32
  activation_rules: Optional[List[ActivationRuleInput]]
33
+ progressive_billing_disabled: Optional[bool]
34
+ usage_thresholds: Optional[UsageThresholdsOverrides]
31
35
 
32
36
 
33
37
  class Subscriptions(BaseModel):
@@ -63,7 +67,6 @@ class SubscriptionResponse(BaseResponseModel):
63
67
  terminated_at: Optional[str]
64
68
  ending_at: Optional[str]
65
69
  trial_ended_at: Optional[str]
66
- subscription_date: Optional[str]
67
70
  subscription_at: Optional[str]
68
71
  previous_plan_code: Optional[str]
69
72
  next_plan_code: Optional[str]
@@ -80,6 +83,9 @@ class SubscriptionResponse(BaseResponseModel):
80
83
  cancellation_reason: Optional[str]
81
84
  activated_at: Optional[str]
82
85
  activation_rules: Optional[List[ActivationRuleResponse]]
86
+ progressive_billing_disabled: Optional[bool]
87
+ entitlements: Optional[SubscriptionEntitlementsResponse]
88
+ applicable_usage_thresholds: Optional[ApplicableUsageThresholdsResponse]
83
89
 
84
90
 
85
91
  class SubscriptionsResponse(BaseResponseModel):
@@ -29,6 +29,16 @@ class UsageThresholdsResponse(BaseResponseModel):
29
29
  __root__: List[UsageThresholdResponse]
30
30
 
31
31
 
32
+ class ApplicableUsageThresholdResponse(BaseResponseModel):
33
+ threshold_display_name: Optional[str]
34
+ amount_cents: Optional[int]
35
+ recurring: Optional[bool]
36
+
37
+
38
+ class ApplicableUsageThresholdsResponse(BaseResponseModel):
39
+ __root__: List[ApplicableUsageThresholdResponse]
40
+
41
+
32
42
  class UsageThresholdOverrides(BaseModel):
33
43
  amount_cents: Optional[int]
34
44
  threshold_display_name: Optional[str]
@@ -68,6 +68,7 @@ class Wallet(BaseModel):
68
68
  name: Optional[str]
69
69
  code: Optional[str]
70
70
  priority: Optional[int]
71
+ transaction_priority: Optional[int]
71
72
  paid_credits: Optional[str]
72
73
  granted_credits: Optional[str]
73
74
  expiration_at: Optional[str]
@@ -19,6 +19,8 @@ class WalletTransaction(BaseModel):
19
19
  purchase_order_number: Optional[str]
20
20
  payment_method: Optional[PaymentMethod]
21
21
  invoice_custom_section: Optional[InvoiceCustomSectionInput]
22
+ priority: Optional[int]
23
+ voided_transaction_id: Optional[str]
22
24
 
23
25
 
24
26
  class WalletTransactionResponse(BaseResponseModel):
@@ -5,7 +5,7 @@ try:
5
5
  except ImportError: # Python 3.7
6
6
  from typing_extensions import Final # type: ignore
7
7
  from collections.abc import Mapping, Sequence
8
- from urllib.parse import urlencode, urljoin
8
+ from urllib.parse import quote, urlencode, urljoin
9
9
 
10
10
  import httpx
11
11
 
@@ -24,19 +24,25 @@ QUERY_TEMPLATE: Final[str] = "?{query}"
24
24
  QueryPairs = Union[Mapping[str, Union[int, str, list[str]]], Sequence[tuple[str, Union[int, str]]]]
25
25
 
26
26
 
27
+ def _quote_path_part(part: str) -> str:
28
+ # quote() leaves dots unescaped; standalone dot segments are normalized by
29
+ # urljoin and HTTP clients, so preserve them as literal identifiers too.
30
+ return part.replace(".", "%2E") if part in (".", "..") else quote(part, safe="")
31
+
32
+
27
33
  def make_url(
28
34
  *,
29
35
  origin: str,
30
36
  path_parts: Sequence[str],
31
37
  query_pairs: QueryPairs = None,
32
38
  ) -> str:
33
- """Return url."""
39
+ """Return a URL, treating each path part as an unencoded segment."""
34
40
  if query_pairs is None:
35
41
  query_pairs = {}
36
42
  return urljoin(
37
43
  origin,
38
44
  URI_TEMPLATE.format(
39
- uri_path="/".join(path_parts),
45
+ uri_path="/".join(_quote_path_part(part) for part in path_parts),
40
46
  uri_query=QUERY_TEMPLATE.format(
41
47
  query=urlencode(query_pairs, doseq=True),
42
48
  )
@@ -0,0 +1,86 @@
1
+ from typing import Any, ClassVar, Mapping, Optional, Type
2
+
3
+ import httpx
4
+
5
+ from ..base_client import BaseClient
6
+ from ..mixins import (
7
+ NestedCreateCommandMixin,
8
+ NestedDestroyCommandMixin,
9
+ NestedFindAllCommandMixin,
10
+ NestedFindCommandMixin,
11
+ NestedUpdateCommandMixin,
12
+ )
13
+ from ..models.alert import Alert, AlertResponse
14
+ from ..services.request import QueryPairs
15
+
16
+
17
+ class SubscriptionAlertClient(
18
+ NestedCreateCommandMixin[AlertResponse],
19
+ NestedUpdateCommandMixin[AlertResponse],
20
+ NestedDestroyCommandMixin[AlertResponse],
21
+ NestedFindCommandMixin[AlertResponse],
22
+ NestedFindAllCommandMixin[AlertResponse],
23
+ BaseClient,
24
+ ):
25
+ API_RESOURCE: ClassVar[str] = "alerts"
26
+ RESPONSE_MODEL: ClassVar[Type[AlertResponse]] = AlertResponse
27
+ ROOT_NAME: ClassVar[str] = "alert"
28
+
29
+ def api_resource(self, subscription_id: str) -> tuple[str]:
30
+ return ("subscriptions", subscription_id, "alerts")
31
+
32
+ # The API only looks up active subscriptions unless `subscription_status` is given.
33
+ def create(
34
+ self,
35
+ subscription_id: str,
36
+ input_object: Alert,
37
+ subscription_status: Optional[str] = None,
38
+ timeout: Optional[httpx.Timeout] = None,
39
+ ) -> Optional[AlertResponse]:
40
+ return super().create(
41
+ subscription_id, input_object, options=_status_query(subscription_status), timeout=timeout
42
+ )
43
+
44
+ def update(
45
+ self,
46
+ subscription_id: str,
47
+ code: str,
48
+ input_object: Alert,
49
+ subscription_status: Optional[str] = None,
50
+ timeout: Optional[httpx.Timeout] = None,
51
+ ) -> AlertResponse:
52
+ return super().update(
53
+ subscription_id, code, input_object, options=_status_query(subscription_status), timeout=timeout
54
+ )
55
+
56
+ def destroy(
57
+ self,
58
+ subscription_id: str,
59
+ code: str,
60
+ subscription_status: Optional[str] = None,
61
+ timeout: Optional[httpx.Timeout] = None,
62
+ ) -> AlertResponse:
63
+ return super().destroy(subscription_id, code, options=_status_query(subscription_status), timeout=timeout)
64
+
65
+ def find(
66
+ self,
67
+ subscription_id: str,
68
+ code: str,
69
+ subscription_status: Optional[str] = None,
70
+ timeout: Optional[httpx.Timeout] = None,
71
+ ) -> AlertResponse:
72
+ return super().find(subscription_id, code, options=_status_query(subscription_status), timeout=timeout)
73
+
74
+ def find_all(
75
+ self,
76
+ subscription_id: str,
77
+ options: QueryPairs = None,
78
+ subscription_status: Optional[str] = None,
79
+ timeout: Optional[httpx.Timeout] = None,
80
+ ) -> Mapping[str, Any]:
81
+ query = {**dict(options or {}), **_status_query(subscription_status)}
82
+ return super().find_all(subscription_id, options=query, timeout=timeout)
83
+
84
+
85
+ def _status_query(subscription_status: Optional[str]) -> dict:
86
+ return {} if subscription_status is None else {"subscription_status": subscription_status}
@@ -2,6 +2,7 @@ from typing import Any, ClassVar, Mapping, Optional, Type
2
2
 
3
3
  from ..base_client import BaseClient
4
4
  from ..base_model import BaseModel
5
+ from ..functools_ext import callable_cached_property
5
6
  from ..mixins import (
6
7
  CreateCommandMixin,
7
8
  DestroyCommandMixin,
@@ -29,6 +30,7 @@ from ..services.response import (
29
30
  prepare_object_response,
30
31
  verify_response,
31
32
  )
33
+ from .alert_client import SubscriptionAlertClient
32
34
 
33
35
 
34
36
  class SubscriptionClient(
@@ -43,6 +45,12 @@ class SubscriptionClient(
43
45
  RESPONSE_MODEL: ClassVar[Type[SubscriptionResponse]] = SubscriptionResponse
44
46
  ROOT_NAME: ClassVar[str] = "subscription"
45
47
 
48
+ @callable_cached_property
49
+ def alerts(self) -> SubscriptionAlertClient:
50
+ return SubscriptionAlertClient(
51
+ self.base_url, self.api_key, rate_limit_retry_config=self.rate_limit_retry_config
52
+ )
53
+
46
54
  def lifetime_usage(self, resource_id: str) -> LifetimeUsageResponse:
47
55
  api_response: Response = send_get_request(
48
56
  url=make_url(
@@ -0,0 +1 @@
1
+ LAGO_VERSION = "1.56.0"
@@ -109,7 +109,7 @@ class WalletTransactionClient(BaseClient):
109
109
  origin=self.base_url,
110
110
  path_parts=(self.API_RESOURCE,),
111
111
  ),
112
- content=to_json({"wallet_transaction": input_object.dict()}),
112
+ content=to_json({"wallet_transaction": input_object.dict(exclude_none=True)}),
113
113
  headers=make_headers(api_key=self.api_key),
114
114
  )
115
115
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lago-python-client
3
- Version: 1.55.0
3
+ Version: 1.56.0
4
4
  Summary: Lago Python API Client
5
5
  Home-page: https://github.com/getlago/lago-python-client
6
6
  Author: Lovro Colic