lago-python-client 1.47.0__tar.gz → 1.49.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 (188) hide show
  1. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/PKG-INFO +1 -1
  2. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/customers/clients.py +26 -0
  3. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/__init__.py +6 -0
  4. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/credit_note.py +1 -0
  5. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/customer_projected_usage.py +7 -0
  6. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/customer_usage.py +12 -0
  7. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/fee.py +2 -0
  8. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/invoice.py +2 -0
  9. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/organization.py +1 -0
  10. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/subscription.py +4 -0
  11. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/wallet.py +4 -0
  12. lago_python_client-1.49.0/lago_python_client/version.py +1 -0
  13. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client.egg-info/PKG-INFO +1 -1
  14. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_customer_client.py +44 -0
  15. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_customer_wallet_client.py +41 -0
  16. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_fee_client.py +2 -0
  17. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_plan_client.py +27 -2
  18. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_subscription_client.py +5 -0
  19. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_wallet_client.py +41 -0
  20. lago_python_client-1.47.0/lago_python_client/version.py +0 -1
  21. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/LICENSE +0 -0
  22. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/README.md +0 -0
  23. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/__init__.py +0 -0
  24. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/activity_logs/__init__.py +0 -0
  25. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/activity_logs/clients.py +0 -0
  26. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/add_ons/__init__.py +0 -0
  27. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/add_ons/clients.py +0 -0
  28. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/api_logs/__init__.py +0 -0
  29. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/api_logs/clients.py +0 -0
  30. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/base_client.py +0 -0
  31. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/base_model.py +0 -0
  32. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/billable_metrics/__init__.py +0 -0
  33. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/billable_metrics/clients.py +0 -0
  34. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/billing_entities/__init__.py +0 -0
  35. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/billing_entities/clients.py +0 -0
  36. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/client.py +0 -0
  37. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/coupons/__init__.py +0 -0
  38. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/coupons/clients.py +0 -0
  39. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/credit_notes/__init__.py +0 -0
  40. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/credit_notes/clients.py +0 -0
  41. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/customers/__init__.py +0 -0
  42. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/customers/applied_coupons_client.py +0 -0
  43. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/customers/credit_notes_client.py +0 -0
  44. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/customers/invoices_client.py +0 -0
  45. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/customers/payment_methods_client.py +0 -0
  46. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/customers/payment_requests_client.py +0 -0
  47. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/customers/payments_client.py +0 -0
  48. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/customers/subscriptions_client.py +0 -0
  49. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/customers/wallet_client.py +0 -0
  50. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/customers/wallets/__init__.py +0 -0
  51. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/customers/wallets/alert_client.py +0 -0
  52. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/customers/wallets/metadata_client.py +0 -0
  53. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/customers/wallets_client.py +0 -0
  54. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/events/__init__.py +0 -0
  55. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/events/clients.py +0 -0
  56. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/exceptions.py +0 -0
  57. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/fees/__init__.py +0 -0
  58. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/fees/clients.py +0 -0
  59. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/functools_ext.py +0 -0
  60. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/gross_revenues/__init__.py +0 -0
  61. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/gross_revenues/clients.py +0 -0
  62. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/invoice_collections/__init__.py +0 -0
  63. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/invoice_collections/clients.py +0 -0
  64. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/invoiced_usages/__init__.py +0 -0
  65. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/invoiced_usages/clients.py +0 -0
  66. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/invoices/__init__.py +0 -0
  67. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/invoices/clients.py +0 -0
  68. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/mixins.py +0 -0
  69. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/activity_log.py +0 -0
  70. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/add_on.py +0 -0
  71. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/alert.py +0 -0
  72. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/api_log.py +0 -0
  73. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/applied_coupon.py +0 -0
  74. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/billable_metric.py +0 -0
  75. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/billing_entity.py +0 -0
  76. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/billing_period.py +0 -0
  77. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/charge.py +0 -0
  78. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/coupon.py +0 -0
  79. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/credit.py +0 -0
  80. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/customer.py +0 -0
  81. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/error_detail.py +0 -0
  82. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/event.py +0 -0
  83. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/fixed_charge.py +0 -0
  84. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/gross_revenue.py +0 -0
  85. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/invoice_collection.py +0 -0
  86. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/invoice_custom_section.py +0 -0
  87. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/invoice_item.py +0 -0
  88. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/invoiced_usage.py +0 -0
  89. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/lifetime_usage.py +0 -0
  90. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/minimum_commitment.py +0 -0
  91. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/mrr.py +0 -0
  92. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/overdue_balance.py +0 -0
  93. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/payment.py +0 -0
  94. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/payment_method.py +0 -0
  95. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/payment_receipt.py +0 -0
  96. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/payment_request.py +0 -0
  97. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/plan.py +0 -0
  98. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/tax.py +0 -0
  99. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/usage.py +0 -0
  100. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/usage_threshold.py +0 -0
  101. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/wallet_transaction.py +0 -0
  102. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/models/webhook_endpoint.py +0 -0
  103. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/mrrs/__init__.py +0 -0
  104. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/mrrs/clients.py +0 -0
  105. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/observability.py +0 -0
  106. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/organizations/__init__.py +0 -0
  107. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/organizations/clients.py +0 -0
  108. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/overdue_balances/__init__.py +0 -0
  109. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/overdue_balances/clients.py +0 -0
  110. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/payment_receipts/__init__.py +0 -0
  111. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/payment_receipts/clients.py +0 -0
  112. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/payment_requests/__init__.py +0 -0
  113. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/payment_requests/clients.py +0 -0
  114. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/payments/__init__.py +0 -0
  115. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/payments/clients.py +0 -0
  116. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/plans/__init__.py +0 -0
  117. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/plans/charges_client.py +0 -0
  118. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/plans/clients.py +0 -0
  119. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/plans/fixed_charges_client.py +0 -0
  120. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/py.typed +0 -0
  121. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/services/__init__.py +0 -0
  122. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/services/json.py +0 -0
  123. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/services/rate_limit.py +0 -0
  124. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/services/request.py +0 -0
  125. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/services/response.py +0 -0
  126. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/subscriptions/__init__.py +0 -0
  127. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/subscriptions/charges_client.py +0 -0
  128. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/subscriptions/clients.py +0 -0
  129. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/subscriptions/fixed_charges_client.py +0 -0
  130. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/taxes/__init__.py +0 -0
  131. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/taxes/clients.py +0 -0
  132. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/usages/__init__.py +0 -0
  133. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/usages/clients.py +0 -0
  134. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/wallets/__init__.py +0 -0
  135. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/wallets/clients.py +0 -0
  136. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/webhook_endpoints/__init__.py +0 -0
  137. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/webhook_endpoints/clients.py +0 -0
  138. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/webhooks/__init__.py +0 -0
  139. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client/webhooks/clients.py +0 -0
  140. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client.egg-info/SOURCES.txt +0 -0
  141. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client.egg-info/dependency_links.txt +0 -0
  142. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client.egg-info/requires.txt +0 -0
  143. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/lago_python_client.egg-info/top_level.txt +0 -0
  144. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/pyproject.toml +0 -0
  145. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/setup.cfg +0 -0
  146. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/__init__.py +0 -0
  147. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_activity_logs_client.py +0 -0
  148. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_add_on_client.py +0 -0
  149. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_api_logs_client.py +0 -0
  150. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_applied_coupon_client.py +0 -0
  151. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_billable_metric_client.py +0 -0
  152. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_billing_entity_client.py +0 -0
  153. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_client.py +0 -0
  154. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_coupon_client.py +0 -0
  155. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_credit_note_client.py +0 -0
  156. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_customer_applied_coupons_client.py +0 -0
  157. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_customer_credit_notes_client.py +0 -0
  158. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_customer_invoices_client.py +0 -0
  159. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_customer_payment_methods_client.py +0 -0
  160. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_customer_payment_requests_client.py +0 -0
  161. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_customer_payments_client.py +0 -0
  162. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_customer_sbscriptions_client.py +0 -0
  163. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_customer_wallet_alert_client.py +0 -0
  164. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_customer_wallet_metadata_client.py +0 -0
  165. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_customer_wallets_client.py +0 -0
  166. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_event_client.py +0 -0
  167. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_functools_ext.py +0 -0
  168. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_gross_revenue_client.py +0 -0
  169. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_invoice_client.py +0 -0
  170. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_invoice_collection_client.py +0 -0
  171. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_invoiced_usage_client.py +0 -0
  172. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_json_services.py +0 -0
  173. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_mrr_client.py +0 -0
  174. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_organization_client.py +0 -0
  175. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_overdue_balance_client.py +0 -0
  176. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_payment_client.py +0 -0
  177. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_payment_receipt_client.py +0 -0
  178. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_payment_request_client.py +0 -0
  179. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_rate_limit.py +0 -0
  180. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_request_services.py +0 -0
  181. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_response_services.py +0 -0
  182. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_tax_client.py +0 -0
  183. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_usage_client.py +0 -0
  184. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_wallet_transaction_client.py +0 -0
  185. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_webhook_client.py +0 -0
  186. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/test_webhook_endpoint_client.py +0 -0
  187. {lago_python_client-1.47.0 → lago_python_client-1.49.0}/tests/utils/__init__.py +0 -0
  188. {lago_python_client-1.47.0 → lago_python_client-1.49.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.47.0
3
+ Version: 1.49.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,4 +1,5 @@
1
1
  import json
2
+ import warnings
2
3
  from collections.abc import Mapping
3
4
  from typing import Any, ClassVar, Optional, Type, Union
4
5
 
@@ -46,17 +47,42 @@ class CustomerClient(
46
47
  filter_by_charge_id: Optional[str] = None,
47
48
  filter_by_charge_code: Optional[str] = None,
48
49
  filter_by_group: Optional[dict] = None,
50
+ filter_by_presentation: Optional[Union[str, list[str]]] = None,
49
51
  full_usage: Optional[bool] = None,
52
+ charge_id: Optional[str] = None,
53
+ charge_code: Optional[str] = None,
54
+ billable_metric_code: Optional[str] = None,
55
+ group: Optional[dict] = None,
50
56
  ) -> CustomerUsageResponse:
51
57
  query_params: dict[str, Union[str, bool]] = {"external_subscription_id": external_subscription_id}
52
58
  if apply_taxes is not None:
53
59
  query_params["apply_taxes"] = apply_taxes
60
+ if charge_id is not None:
61
+ query_params["charge_id"] = charge_id
62
+ if charge_code is not None:
63
+ query_params["charge_code"] = charge_code
64
+ if billable_metric_code is not None:
65
+ query_params["billable_metric_code"] = billable_metric_code
66
+ if group is not None:
67
+ for k, v in group.items():
68
+ query_params[f"group[{k}]"] = v
54
69
  if filter_by_charge_id is not None:
70
+ warnings.warn("filter_by_charge_id is deprecated, use charge_id instead", DeprecationWarning, stacklevel=2)
55
71
  query_params["filter_by_charge_id"] = filter_by_charge_id
56
72
  if filter_by_charge_code is not None:
73
+ warnings.warn(
74
+ "filter_by_charge_code is deprecated, use charge_code instead", DeprecationWarning, stacklevel=2
75
+ )
57
76
  query_params["filter_by_charge_code"] = filter_by_charge_code
58
77
  if filter_by_group is not None:
78
+ warnings.warn("filter_by_group is deprecated, use group instead", DeprecationWarning, stacklevel=2)
59
79
  query_params["filter_by_group"] = json.dumps(filter_by_group)
80
+ if filter_by_presentation is not None:
81
+ query_params["filter_by_presentation"] = (
82
+ filter_by_presentation
83
+ if isinstance(filter_by_presentation, str)
84
+ else json.dumps(filter_by_presentation)
85
+ )
60
86
  if full_usage is not None:
61
87
  query_params["full_usage"] = str(full_usage).lower()
62
88
 
@@ -138,6 +138,12 @@ from .customer_usage import (
138
138
  from .customer_usage import (
139
139
  Metric as Metric,
140
140
  )
141
+ from .customer_usage import (
142
+ PresentationBreakdown as PresentationBreakdown,
143
+ )
144
+ from .customer_usage import (
145
+ PresentationBreakdowns as PresentationBreakdowns,
146
+ )
141
147
  from .event import BatchEvent as BatchEvent
142
148
  from .event import Event as Event
143
149
  from .fee import Fee as Fee
@@ -39,6 +39,7 @@ class CreditNoteAppliedTaxes(BaseResponseModel):
39
39
  class CreditNoteResponse(BaseResponseModel):
40
40
  lago_id: Optional[str]
41
41
  sequential_id: Optional[int]
42
+ billing_entity_code: Optional[str]
42
43
  number: Optional[str]
43
44
  lago_invoice_id: Optional[str]
44
45
  invoice_number: Optional[str]
@@ -3,6 +3,7 @@ from typing import Dict, List, Optional
3
3
  from lago_python_client.base_model import BaseModel
4
4
 
5
5
  from ..base_model import BaseResponseModel
6
+ from .customer_usage import PresentationBreakdowns
6
7
 
7
8
 
8
9
  class Metric(BaseModel):
@@ -27,6 +28,8 @@ class ProjectedChargeFilterUsage(BaseModel):
27
28
  projected_amount_cents: int
28
29
  events_count: int
29
30
  pricing_unit_details: Optional[PricingUnitDetails]
31
+ presentation_breakdowns: Optional[PresentationBreakdowns]
32
+ projected_presentation_breakdowns: Optional[PresentationBreakdowns]
30
33
 
31
34
 
32
35
  class ChargeObject(BaseModel):
@@ -44,6 +47,8 @@ class ProjectedGroupedUsage(BaseModel):
44
47
  grouped_by: Dict[str, Optional[str]]
45
48
  filters: List[ProjectedChargeFilterUsage]
46
49
  pricing_unit_details: Optional[PricingUnitDetails]
50
+ presentation_breakdowns: Optional[PresentationBreakdowns]
51
+ projected_presentation_breakdowns: Optional[PresentationBreakdowns]
47
52
 
48
53
 
49
54
  class ProjectedChargeUsage(BaseModel):
@@ -58,6 +63,8 @@ class ProjectedChargeUsage(BaseModel):
58
63
  filters: List[ProjectedChargeFilterUsage]
59
64
  grouped_usage: Optional[List[ProjectedGroupedUsage]]
60
65
  pricing_unit_details: Optional[PricingUnitDetails]
66
+ presentation_breakdowns: Optional[PresentationBreakdowns]
67
+ projected_presentation_breakdowns: Optional[PresentationBreakdowns]
61
68
 
62
69
 
63
70
  class CustomerProjectedUsageResponse(BaseResponseModel):
@@ -18,6 +18,15 @@ class PricingUnitDetails(BaseModel):
18
18
  conversion_rate: float
19
19
 
20
20
 
21
+ class PresentationBreakdown(BaseModel):
22
+ presentation_by: Dict[str, str]
23
+ units: str
24
+
25
+
26
+ class PresentationBreakdowns(BaseModel):
27
+ __root__: List[PresentationBreakdown]
28
+
29
+
21
30
  class ChargeFilterUsage(BaseModel):
22
31
  invoice_display_name: Optional[str]
23
32
  values: Optional[Dict[str, List[str]]]
@@ -26,6 +35,7 @@ class ChargeFilterUsage(BaseModel):
26
35
  amount_cents: int
27
36
  events_count: int
28
37
  pricing_unit_details: Optional[PricingUnitDetails]
38
+ presentation_breakdowns: Optional[PresentationBreakdowns]
29
39
 
30
40
 
31
41
  class ChargeObject(BaseModel):
@@ -42,6 +52,7 @@ class GroupedUsage(BaseModel):
42
52
  grouped_by: Dict[str, Optional[str]]
43
53
  filters: List[ChargeFilterUsage]
44
54
  pricing_unit_details: Optional[PricingUnitDetails]
55
+ presentation_breakdowns: Optional[PresentationBreakdowns]
45
56
 
46
57
 
47
58
  class ChargeUsage(BaseModel):
@@ -55,6 +66,7 @@ class ChargeUsage(BaseModel):
55
66
  filters: List[ChargeFilterUsage]
56
67
  grouped_usage: Optional[List[GroupedUsage]]
57
68
  pricing_unit_details: Optional[PricingUnitDetails]
69
+ presentation_breakdowns: Optional[PresentationBreakdowns]
58
70
 
59
71
 
60
72
  class CustomerUsageResponse(BaseResponseModel):
@@ -1,6 +1,7 @@
1
1
  from typing import Any, Dict, List, Optional
2
2
 
3
3
  from ..base_model import BaseModel, BaseResponseModel
4
+ from .customer_usage import PresentationBreakdowns
4
5
  from .invoice_item import InvoiceItemResponse
5
6
 
6
7
 
@@ -75,6 +76,7 @@ class FeeResponse(BaseResponseModel):
75
76
  to_date: Optional[str]
76
77
  amount_details: Optional[Dict[str, Any]]
77
78
  pricing_unit_details: Optional[PricingUnitDetails]
79
+ presentation_breakdowns: Optional[PresentationBreakdowns]
78
80
  billing_entity_code: Optional[str]
79
81
 
80
82
  item: Optional[InvoiceItemResponse]
@@ -57,6 +57,7 @@ class OneOffInvoice(BaseModel):
57
57
  error_details: Optional[ErrorDetailsResponse]
58
58
  payment_method: Optional[PaymentMethod]
59
59
  invoice_custom_section: Optional[InvoiceCustomSectionInput]
60
+ billing_entity_code: Optional[str]
60
61
 
61
62
 
62
63
  class InvoicePreview(BaseModel):
@@ -66,6 +67,7 @@ class InvoicePreview(BaseModel):
66
67
  coupons: Optional[CouponsList]
67
68
  customer: Optional[Customer]
68
69
  subscriptions: Optional[Subscriptions]
70
+ billing_entity_code: Optional[str]
69
71
 
70
72
 
71
73
  class InvoiceAppliedTax(BaseResponseModel):
@@ -56,3 +56,4 @@ class OrganizationResponse(BaseResponseModel):
56
56
  email_settings: Optional[List[str]]
57
57
  finalize_zero_amount_invoice: Optional[bool]
58
58
  billing_configuration: Optional[OrganizationBillingConfiguration]
59
+ events_store: Optional[str]
@@ -19,6 +19,8 @@ class Subscription(BaseModel):
19
19
  plan_overrides: Optional[PlanOverrides]
20
20
  payment_method: Optional[PaymentMethod]
21
21
  invoice_custom_section: Optional[InvoiceCustomSectionInput]
22
+ consolidate_invoice: Optional[bool]
23
+ billing_entity_code: Optional[str]
22
24
 
23
25
 
24
26
  class Subscriptions(BaseModel):
@@ -55,6 +57,8 @@ class SubscriptionResponse(BaseResponseModel):
55
57
  on_termination_invoice: Optional[str]
56
58
  payment_method: Optional[PaymentMethod]
57
59
  applied_invoice_custom_sections: Optional[AppliedInvoiceCustomSections]
60
+ consolidate_invoice: Optional[bool]
61
+ billing_entity_code: Optional[str]
58
62
 
59
63
 
60
64
  class SubscriptionsResponse(BaseResponseModel):
@@ -21,6 +21,7 @@ class RecurringTransactionRule(BaseModel):
21
21
  transaction_metadata: Optional[List[Dict[str, str]]]
22
22
  transaction_name: Optional[str]
23
23
  ignore_paid_top_up_limits: Optional[bool]
24
+ grants_target_top_up: Optional[bool]
24
25
  payment_method: Optional[PaymentMethod]
25
26
  invoice_custom_section: Optional[InvoiceCustomSectionInput]
26
27
 
@@ -41,6 +42,7 @@ class RecurringTransactionRuleResponse(BaseModel):
41
42
  transaction_metadata: Optional[List[Dict[str, str]]]
42
43
  transaction_name: Optional[str]
43
44
  ignore_paid_top_up_limits: Optional[bool]
45
+ grants_target_top_up: Optional[bool]
44
46
  payment_method: Optional[PaymentMethod]
45
47
  applied_invoice_custom_sections: Optional[AppliedInvoiceCustomSections]
46
48
 
@@ -79,6 +81,7 @@ class Wallet(BaseModel):
79
81
  metadata: Optional[Dict[str, Optional[str]]]
80
82
  payment_method: Optional[PaymentMethod]
81
83
  invoice_custom_section: Optional[InvoiceCustomSectionInput]
84
+ billing_entity_code: Optional[str]
82
85
 
83
86
 
84
87
  class WalletResponse(BaseResponseModel):
@@ -111,3 +114,4 @@ class WalletResponse(BaseResponseModel):
111
114
  metadata: Optional[Dict[str, Optional[str]]]
112
115
  payment_method: Optional[PaymentMethod]
113
116
  applied_invoice_custom_sections: Optional[AppliedInvoiceCustomSections]
117
+ billing_entity_code: Optional[str]
@@ -0,0 +1 @@
1
+ LAGO_VERSION = "1.49.0"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lago-python-client
3
- Version: 1.47.0
3
+ Version: 1.49.0
4
4
  Summary: Lago Python API Client
5
5
  Home-page: https://github.com/getlago/lago-python-client
6
6
  Author: Lovro Colic
@@ -134,6 +134,11 @@ def test_valid_current_usage(httpx_mock: HTTPXMock):
134
134
  assert response.charges_usage[0].units == "1.0"
135
135
  assert len(response.charges_usage[0].filters) == 1
136
136
  assert response.charges_usage[0].filters[0].values["country"] == ["france"]
137
+ charge_usage = response.charges_usage[0]
138
+ assert charge_usage.presentation_breakdowns.__root__[0].presentation_by["team"] == "engineering"
139
+ assert charge_usage.presentation_breakdowns.__root__[0].units == "3.0"
140
+ assert charge_usage.filters[0].presentation_breakdowns.__root__[0].units == "2.0"
141
+ assert charge_usage.grouped_usage[0].presentation_breakdowns.__root__[0].units == "1.0"
137
142
 
138
143
 
139
144
  def test_valid_projected_usage(httpx_mock: HTTPXMock):
@@ -157,6 +162,11 @@ def test_valid_projected_usage(httpx_mock: HTTPXMock):
157
162
  assert response.charges_usage[0].charge.charge_model == "graduated"
158
163
  assert response.charges_usage[0].charge.invoice_display_name == "add_on_invoice_display_name"
159
164
  assert response.charges_usage[0].billable_metric.lago_id == "99a6094e-199b-4101-896a-54e927ce7bd7"
165
+ charge_usage = response.charges_usage[0]
166
+ assert charge_usage.presentation_breakdowns.__root__[0].units == "3.0"
167
+ assert charge_usage.projected_presentation_breakdowns.__root__[0].units == "6.0"
168
+ assert charge_usage.filters[0].projected_presentation_breakdowns.__root__[0].units == "4.0"
169
+ assert charge_usage.grouped_usage[0].projected_presentation_breakdowns.__root__[0].units == "2.0"
160
170
 
161
171
 
162
172
  def test_valid_current_usage_without_taxes(httpx_mock: HTTPXMock):
@@ -204,6 +214,38 @@ def test_valid_current_usage_with_filters(httpx_mock: HTTPXMock):
204
214
  assert len(response.charges_usage) == 1
205
215
 
206
216
 
217
+ def test_valid_current_usage_with_new_filters(httpx_mock: HTTPXMock):
218
+ client = Client(api_key="886fe239-927d-4072-ab72-6dd345e8dd0d")
219
+ charge_id = "1a901a90-1a90-1a90-1a90-1a901a901a90"
220
+
221
+ httpx_mock.add_response(
222
+ method="GET",
223
+ url=(
224
+ "https://api.getlago.com/api/v1/customers/external_customer_id/current_usage"
225
+ f"?external_subscription_id=123&charge_id={charge_id}"
226
+ "&charge_code=storage"
227
+ "&billable_metric_code=storage"
228
+ "&group%5Bcloud%5D=aws"
229
+ "&filter_by_presentation=%5B%22engineering%22%2C+%22operations%22%5D"
230
+ "&full_usage=true"
231
+ ),
232
+ content=mock_response("customer_usage"),
233
+ )
234
+ response = client.customers.current_usage(
235
+ "external_customer_id",
236
+ "123",
237
+ charge_id=charge_id,
238
+ charge_code="storage",
239
+ billable_metric_code="storage",
240
+ group={"cloud": "aws"},
241
+ filter_by_presentation=["engineering", "operations"],
242
+ full_usage=True,
243
+ )
244
+
245
+ assert response.from_datetime == "2022-07-01T00:00:00Z"
246
+ assert len(response.charges_usage) == 1
247
+
248
+
207
249
  def test_invalid_current_usage(httpx_mock: HTTPXMock):
208
250
  client = Client(api_key="886fe239-927d-4072-ab72-6dd345e8dd0d")
209
251
 
@@ -233,6 +275,8 @@ def test_valid_past_usage(httpx_mock: HTTPXMock):
233
275
  assert len(response["usage_periods"][0].charges_usage) == 1
234
276
  assert response["usage_periods"][0].charges_usage[0].units == "1.0"
235
277
  assert len(response["usage_periods"][0].charges_usage[0].filters) == 1
278
+ past_charge_usage = response["usage_periods"][0].charges_usage[0]
279
+ assert past_charge_usage.presentation_breakdowns.__root__[0].units == "3.0"
236
280
 
237
281
 
238
282
  def test_invalid_past_usage(httpx_mock: HTTPXMock):
@@ -24,6 +24,7 @@ def wallet_object():
24
24
  target_ongoing_balance="105.0",
25
25
  transaction_name="Recurring Transaction Rule",
26
26
  ignore_paid_top_up_limits=True,
27
+ grants_target_top_up=True,
27
28
  )
28
29
  rules_list = RecurringTransactionRuleList(__root__=[rule])
29
30
  applies_to = AppliesTo(
@@ -73,6 +74,7 @@ def test_valid_create_wallet_request(httpx_mock: HTTPXMock):
73
74
  "target_ongoing_balance": "105.0",
74
75
  "transaction_name": "Recurring Transaction Rule",
75
76
  "ignore_paid_top_up_limits": True,
77
+ "grants_target_top_up": True,
76
78
  }
77
79
  ],
78
80
  "invoice_requires_successful_payment": False,
@@ -88,6 +90,7 @@ def test_valid_create_wallet_request(httpx_mock: HTTPXMock):
88
90
  assert response.recurring_transaction_rules.__root__[0].trigger == "interval"
89
91
  assert response.recurring_transaction_rules.__root__[0].interval == "monthly"
90
92
  assert response.recurring_transaction_rules.__root__[0].ignore_paid_top_up_limits is True
93
+ assert response.recurring_transaction_rules.__root__[0].grants_target_top_up is True
91
94
  assert response.applies_to.fee_types[0] == "charge"
92
95
  assert response.applies_to.billable_metric_codes[0] == "usage"
93
96
  assert response.paid_top_up_max_amount_cents == 10000
@@ -348,3 +351,41 @@ def test_valid_update_customer_wallet_with_invoice_custom_section_on_recurring_t
348
351
  .invoice_custom_section_id
349
352
  == "section_rule_001"
350
353
  )
354
+
355
+
356
+ def test_valid_update_wallet_with_grants_target_top_up_on_recurring_transaction_rule(httpx_mock: HTTPXMock):
357
+ client = Client(api_key="886fe239-927d-4072-ab72-6dd345e8dd0d")
358
+ wallet_id = "b7ab2926-1de8-4428-9bcd-779314ac129b"
359
+ rule = RecurringTransactionRule(
360
+ trigger="interval",
361
+ interval="monthly",
362
+ method="target",
363
+ target_ongoing_balance="200.0",
364
+ grants_target_top_up=True,
365
+ )
366
+ rules_list = RecurringTransactionRuleList(__root__=[rule])
367
+
368
+ httpx_mock.add_response(
369
+ method="PUT",
370
+ url="https://api.getlago.com/api/v1/customers/customer_id/wallets/" + wallet_id,
371
+ content=mock_response("wallet"),
372
+ match_json={
373
+ "wallet": {
374
+ "name": "name",
375
+ "recurring_transaction_rules": [
376
+ {
377
+ "interval": "monthly",
378
+ "trigger": "interval",
379
+ "method": "target",
380
+ "target_ongoing_balance": "200.0",
381
+ "grants_target_top_up": True,
382
+ }
383
+ ],
384
+ }
385
+ },
386
+ )
387
+ wallet = Wallet(name="name", recurring_transaction_rules=rules_list)
388
+ response = client.customers.wallets.update("customer_id", wallet_id, wallet)
389
+
390
+ assert response.lago_id == "b7ab2926-1de8-4428-9bcd-779314ac129b"
391
+ assert response.recurring_transaction_rules.__root__[0].grants_target_top_up is True
@@ -29,6 +29,8 @@ def test_valid_find_fee_request(httpx_mock: HTTPXMock):
29
29
  assert response.lago_id == identifier
30
30
  assert response.invoice_display_name == fee_invoice_display_name
31
31
  assert response.item.invoice_display_name == charge_invoice_display_name
32
+ assert response.presentation_breakdowns.__root__[0].presentation_by["team"] == "engineering"
33
+ assert response.presentation_breakdowns.__root__[0].units == "10.0"
32
34
 
33
35
 
34
36
  def test_fee_response_with_fixed_charge_id():
@@ -25,7 +25,14 @@ def plan_object():
25
25
  id=None,
26
26
  invoice_display_name=None,
27
27
  regroup_paid_fees=None,
28
- properties=None,
28
+ properties={
29
+ "presentation_group_keys": [
30
+ {
31
+ "value": "region",
32
+ "options": {"display_in_invoice": True},
33
+ }
34
+ ]
35
+ },
29
36
  tax_codes=None,
30
37
  billable_metric_id="id",
31
38
  charge_model="standard",
@@ -194,6 +201,8 @@ def test_valid_create_plan_request(httpx_mock: HTTPXMock):
194
201
  assert response.code == "plan_code"
195
202
  assert response.invoice_display_name == "test plan 1"
196
203
  assert response.charges.__root__[0].invoice_display_name == "Setup"
204
+ charge = response.charges.__root__[0]
205
+ assert charge.properties["presentation_group_keys"][0]["value"] == "region"
197
206
  assert response.minimum_commitment.invoice_display_name == "Minimum commitment (C1)"
198
207
  assert response.usage_thresholds.__root__[0].threshold_display_name == "Threshold 1"
199
208
  assert response.metadata == {"key1": "value1", "key2": None}
@@ -276,6 +285,8 @@ def test_valid_find_plan_request(httpx_mock: HTTPXMock):
276
285
  assert response.invoice_display_name == "test plan 1"
277
286
  assert response.charges.__root__[0].charge_model == "standard"
278
287
  assert response.charges.__root__[0].min_amount_cents == 0
288
+ charge = response.charges.__root__[0]
289
+ assert charge.properties["presentation_group_keys"][0]["value"] == "region"
279
290
  assert response.minimum_commitment.amount_cents == 1000
280
291
 
281
292
 
@@ -338,6 +349,8 @@ def test_valid_find_all_plan_request(httpx_mock: HTTPXMock):
338
349
  assert response["plans"][0].invoice_display_name == "test plan 1"
339
350
  assert response["plans"][0].minimum_commitment.invoice_display_name == "Minimum commitment (C2)"
340
351
  assert response["plans"][0].charges.__root__[0].lago_id == "51c1e851-5be6-4343-a0ee-39a81d8b4ee1"
352
+ plan_charge = response["plans"][0].charges.__root__[0]
353
+ assert plan_charge.properties["presentation_group_keys"][0]["value"] == "region"
341
354
  assert response["plans"][0].charges.__root__[0].filters.__root__[0].properties["amount"] == "0.22"
342
355
  assert response["plans"][0].charges.__root__[0].filters.__root__[0].invoice_display_name == "Europe"
343
356
  assert response["meta"]["current_page"] == 1
@@ -506,6 +519,9 @@ def test_valid_find_charge_request(httpx_mock: HTTPXMock):
506
519
  assert response.code == "charge_code"
507
520
  assert response.charge_model == "standard"
508
521
  assert response.invoice_display_name == "Setup"
522
+ presentation_group_key = response.properties["presentation_group_keys"][0]
523
+ assert presentation_group_key["value"] == "region"
524
+ assert presentation_group_key["options"]["display_in_invoice"] is True
509
525
 
510
526
 
511
527
  def test_valid_create_charge_request(httpx_mock: HTTPXMock):
@@ -522,12 +538,21 @@ def test_valid_create_charge_request(httpx_mock: HTTPXMock):
522
538
  charge_model="standard",
523
539
  pay_in_advance=True,
524
540
  invoiceable=True,
525
- properties={"amount": "0.22"},
541
+ properties={
542
+ "amount": "0.22",
543
+ "presentation_group_keys": [
544
+ {
545
+ "value": "region",
546
+ "options": {"display_in_invoice": True},
547
+ }
548
+ ],
549
+ },
526
550
  )
527
551
  response = client.plan_charges.create(plan_code, charge)
528
552
 
529
553
  assert response.lago_id == "51c1e851-5be6-4343-a0ee-39a81d8b4ee1"
530
554
  assert response.charge_model == "standard"
555
+ assert charge.dict()["properties"]["presentation_group_keys"][0]["value"] == "region"
531
556
 
532
557
 
533
558
  def test_valid_update_charge_request(httpx_mock: HTTPXMock):
@@ -26,6 +26,7 @@ def create_subscription():
26
26
  billing_time="anniversary",
27
27
  subscription_at="2022-04-29T08:59:51Z",
28
28
  ending_at="2022-08-29T08:59:51Z",
29
+ consolidate_invoice=False,
29
30
  )
30
31
 
31
32
 
@@ -85,6 +86,7 @@ def test_valid_create_subscriptions_request(httpx_mock: HTTPXMock):
85
86
  assert response.billing_time == "anniversary"
86
87
  assert response.subscription_at == "2022-04-29T08:59:51Z"
87
88
  assert response.ending_at == "2022-08-29T08:59:51Z"
89
+ assert response.consolidate_invoice is False
88
90
 
89
91
 
90
92
  def test_valid_create_subscriptions_request_with_payment_method(httpx_mock: HTTPXMock):
@@ -637,6 +639,9 @@ def test_valid_find_charge_request(httpx_mock: HTTPXMock):
637
639
  assert response.code == "charge_code"
638
640
  assert response.charge_model == "standard"
639
641
  assert response.invoice_display_name == "Setup"
642
+ presentation_group_key = response.properties["presentation_group_keys"][0]
643
+ assert presentation_group_key["value"] == "region"
644
+ assert presentation_group_key["options"]["display_in_invoice"] is True
640
645
 
641
646
 
642
647
  def test_valid_update_charge_request(httpx_mock: HTTPXMock):
@@ -25,6 +25,7 @@ def wallet_object():
25
25
  target_ongoing_balance="105.0",
26
26
  transaction_name="Recurring Transaction Rule",
27
27
  ignore_paid_top_up_limits=True,
28
+ grants_target_top_up=True,
28
29
  )
29
30
  rules_list = RecurringTransactionRuleList(__root__=[rule])
30
31
  applies_to = AppliesTo(
@@ -92,6 +93,7 @@ def test_valid_create_wallet_request(httpx_mock: HTTPXMock):
92
93
  "target_ongoing_balance": "105.0",
93
94
  "transaction_name": "Recurring Transaction Rule",
94
95
  "ignore_paid_top_up_limits": True,
96
+ "grants_target_top_up": True,
95
97
  }
96
98
  ],
97
99
  "invoice_requires_successful_payment": False,
@@ -107,6 +109,7 @@ def test_valid_create_wallet_request(httpx_mock: HTTPXMock):
107
109
  assert response.recurring_transaction_rules.__root__[0].trigger == "interval"
108
110
  assert response.recurring_transaction_rules.__root__[0].interval == "monthly"
109
111
  assert response.recurring_transaction_rules.__root__[0].ignore_paid_top_up_limits is True
112
+ assert response.recurring_transaction_rules.__root__[0].grants_target_top_up is True
110
113
  assert response.applies_to.fee_types[0] == "charge"
111
114
  assert response.applies_to.billable_metric_codes[0] == "usage"
112
115
  assert response.paid_top_up_max_amount_cents == 10000
@@ -594,3 +597,41 @@ def test_valid_update_wallet_with_invoice_custom_section_on_recurring_transactio
594
597
  .invoice_custom_section_id
595
598
  == "section_rule_001"
596
599
  )
600
+
601
+
602
+ def test_valid_update_wallet_with_grants_target_top_up_on_recurring_transaction_rule(httpx_mock: HTTPXMock):
603
+ client = Client(api_key="886fe239-927d-4072-ab72-6dd345e8dd0d")
604
+ wallet_id = "b7ab2926-1de8-4428-9bcd-779314ac129b"
605
+ rule = RecurringTransactionRule(
606
+ trigger="interval",
607
+ interval="monthly",
608
+ method="target",
609
+ target_ongoing_balance="200.0",
610
+ grants_target_top_up=True,
611
+ )
612
+ rules_list = RecurringTransactionRuleList(__root__=[rule])
613
+
614
+ httpx_mock.add_response(
615
+ method="PUT",
616
+ url="https://api.getlago.com/api/v1/wallets/" + wallet_id,
617
+ content=mock_response(),
618
+ match_json={
619
+ "wallet": {
620
+ "name": "name",
621
+ "recurring_transaction_rules": [
622
+ {
623
+ "interval": "monthly",
624
+ "trigger": "interval",
625
+ "method": "target",
626
+ "target_ongoing_balance": "200.0",
627
+ "grants_target_top_up": True,
628
+ }
629
+ ],
630
+ }
631
+ },
632
+ )
633
+ wallet = Wallet(name="name", recurring_transaction_rules=rules_list)
634
+ response = client.wallets.update(wallet, wallet_id)
635
+
636
+ assert response.lago_id == "b7ab2926-1de8-4428-9bcd-779314ac129b"
637
+ assert response.recurring_transaction_rules.__root__[0].grants_target_top_up is True
@@ -1 +0,0 @@
1
- LAGO_VERSION = "1.47.0"