lago-python-client 1.41.4__tar.gz → 1.43.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 (180) hide show
  1. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/PKG-INFO +1 -1
  2. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/billable_metrics/clients.py +1 -1
  3. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/client.py +32 -7
  4. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/coupons/clients.py +2 -2
  5. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/credit_notes/clients.py +3 -3
  6. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/customers/applied_coupons_client.py +1 -1
  7. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/customers/clients.py +8 -11
  8. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/customers/credit_notes_client.py +1 -1
  9. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/customers/invoices_client.py +1 -1
  10. lago_python_client-1.43.0/lago_python_client/customers/payment_methods_client.py +49 -0
  11. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/customers/payment_requests_client.py +1 -1
  12. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/customers/payments_client.py +1 -1
  13. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/customers/subscriptions_client.py +1 -1
  14. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/customers/wallets_client.py +1 -1
  15. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/events/clients.py +3 -10
  16. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/exceptions.py +1 -6
  17. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/functools_ext.py +6 -20
  18. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/gross_revenues/clients.py +6 -9
  19. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/invoice_collections/clients.py +6 -9
  20. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/invoiced_usages/clients.py +6 -9
  21. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/invoices/clients.py +12 -4
  22. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/mixins.py +133 -15
  23. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/__init__.py +194 -63
  24. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/activity_log.py +0 -1
  25. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/add_on.py +0 -1
  26. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/billing_entity.py +2 -3
  27. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/charge.py +14 -1
  28. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/customer.py +1 -2
  29. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/fixed_charge.py +3 -1
  30. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/invoice.py +4 -2
  31. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/lifetime_usage.py +1 -1
  32. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/organization.py +1 -1
  33. lago_python_client-1.43.0/lago_python_client/models/payment_method.py +20 -0
  34. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/plan.py +9 -9
  35. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/subscription.py +5 -1
  36. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/wallet.py +6 -1
  37. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/wallet_transaction.py +4 -1
  38. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/mrrs/clients.py +6 -9
  39. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/overdue_balances/clients.py +7 -10
  40. lago_python_client-1.43.0/lago_python_client/plans/charges_client.py +25 -0
  41. lago_python_client-1.43.0/lago_python_client/plans/clients.py +174 -0
  42. lago_python_client-1.43.0/lago_python_client/plans/fixed_charges_client.py +25 -0
  43. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/services/json.py +4 -9
  44. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/services/request.py +7 -10
  45. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/services/response.py +6 -9
  46. lago_python_client-1.43.0/lago_python_client/subscriptions/charges_client.py +21 -0
  47. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/subscriptions/clients.py +75 -7
  48. lago_python_client-1.43.0/lago_python_client/subscriptions/fixed_charges_client.py +21 -0
  49. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/usages/clients.py +6 -9
  50. lago_python_client-1.43.0/lago_python_client/version.py +1 -0
  51. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/wallets/clients.py +7 -10
  52. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/webhooks/clients.py +5 -8
  53. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client.egg-info/PKG-INFO +1 -1
  54. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client.egg-info/SOURCES.txt +14 -0
  55. lago_python_client-1.43.0/pyproject.toml +22 -0
  56. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_activity_logs_client.py +1 -2
  57. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_api_logs_client.py +1 -2
  58. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_billing_entity_client.py +1 -1
  59. lago_python_client-1.43.0/tests/test_customer_payment_methods_client.py +140 -0
  60. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_functools_ext.py +5 -9
  61. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_invoice_client.py +59 -3
  62. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_plan_client.py +333 -6
  63. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_request_services.py +1 -1
  64. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_response_services.py +7 -5
  65. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_subscription_client.py +324 -4
  66. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_wallet_client.py +183 -30
  67. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_wallet_transaction_client.py +47 -1
  68. lago_python_client-1.41.4/lago_python_client/plans/clients.py +0 -83
  69. lago_python_client-1.41.4/lago_python_client/version.py +0 -1
  70. lago_python_client-1.41.4/pyproject.toml +0 -10
  71. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/LICENSE +0 -0
  72. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/README.md +0 -0
  73. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/__init__.py +0 -0
  74. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/activity_logs/__init__.py +0 -0
  75. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/activity_logs/clients.py +0 -0
  76. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/add_ons/__init__.py +0 -0
  77. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/add_ons/clients.py +0 -0
  78. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/api_logs/__init__.py +0 -0
  79. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/api_logs/clients.py +0 -0
  80. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/base_client.py +0 -0
  81. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/base_model.py +0 -0
  82. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/billable_metrics/__init__.py +0 -0
  83. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/billing_entities/__init__.py +0 -0
  84. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/billing_entities/clients.py +0 -0
  85. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/coupons/__init__.py +0 -0
  86. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/credit_notes/__init__.py +0 -0
  87. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/customers/__init__.py +0 -0
  88. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/events/__init__.py +0 -0
  89. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/fees/__init__.py +0 -0
  90. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/fees/clients.py +2 -2
  91. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/gross_revenues/__init__.py +0 -0
  92. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/invoice_collections/__init__.py +0 -0
  93. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/invoiced_usages/__init__.py +0 -0
  94. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/invoices/__init__.py +0 -0
  95. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/alert.py +0 -0
  96. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/api_log.py +0 -0
  97. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/applied_coupon.py +1 -1
  98. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/billable_metric.py +0 -0
  99. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/billing_period.py +0 -0
  100. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/coupon.py +0 -0
  101. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/credit.py +1 -1
  102. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/credit_note.py +2 -2
  103. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/customer_projected_usage.py +0 -0
  104. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/customer_usage.py +0 -0
  105. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/error_detail.py +0 -0
  106. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/event.py +0 -0
  107. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/fee.py +1 -1
  108. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/gross_revenue.py +0 -0
  109. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/invoice_collection.py +0 -0
  110. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/invoice_custom_section.py +0 -0
  111. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/invoice_item.py +0 -0
  112. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/invoiced_usage.py +0 -0
  113. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/minimum_commitment.py +1 -1
  114. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/mrr.py +0 -0
  115. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/overdue_balance.py +0 -0
  116. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/payment.py +0 -0
  117. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/payment_receipt.py +0 -0
  118. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/payment_request.py +0 -0
  119. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/tax.py +0 -0
  120. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/usage.py +0 -0
  121. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/usage_threshold.py +0 -0
  122. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/models/webhook_endpoint.py +0 -0
  123. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/mrrs/__init__.py +0 -0
  124. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/organizations/__init__.py +0 -0
  125. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/organizations/clients.py +0 -0
  126. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/overdue_balances/__init__.py +0 -0
  127. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/payment_receipts/__init__.py +0 -0
  128. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/payment_receipts/clients.py +0 -0
  129. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/payment_requests/__init__.py +0 -0
  130. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/payment_requests/clients.py +0 -0
  131. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/payments/__init__.py +0 -0
  132. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/payments/clients.py +0 -0
  133. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/plans/__init__.py +0 -0
  134. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/py.typed +0 -0
  135. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/services/__init__.py +0 -0
  136. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/subscriptions/__init__.py +0 -0
  137. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/taxes/__init__.py +0 -0
  138. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/taxes/clients.py +0 -0
  139. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/usages/__init__.py +0 -0
  140. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/wallets/__init__.py +0 -0
  141. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/webhook_endpoints/__init__.py +0 -0
  142. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/webhook_endpoints/clients.py +0 -0
  143. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client/webhooks/__init__.py +0 -0
  144. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client.egg-info/dependency_links.txt +0 -0
  145. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client.egg-info/requires.txt +0 -0
  146. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/lago_python_client.egg-info/top_level.txt +0 -0
  147. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/setup.cfg +0 -0
  148. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/__init__.py +0 -0
  149. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_add_on_client.py +0 -0
  150. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_applied_coupon_client.py +0 -0
  151. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_billable_metric_client.py +2 -2
  152. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_client.py +0 -0
  153. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_coupon_client.py +0 -0
  154. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_credit_note_client.py +3 -3
  155. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_customer_applied_coupons_client.py +0 -0
  156. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_customer_client.py +2 -2
  157. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_customer_credit_notes_client.py +0 -0
  158. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_customer_invoices_client.py +0 -0
  159. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_customer_payment_requests_client.py +0 -0
  160. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_customer_payments_client.py +0 -0
  161. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_customer_sbscriptions_client.py +0 -0
  162. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_customer_wallets_client.py +0 -0
  163. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_event_client.py +0 -0
  164. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_fee_client.py +0 -0
  165. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_gross_revenue_client.py +0 -0
  166. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_invoice_collection_client.py +0 -0
  167. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_invoiced_usage_client.py +0 -0
  168. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_json_services.py +1 -1
  169. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_mrr_client.py +0 -0
  170. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_organization_client.py +0 -0
  171. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_overdue_balance_client.py +0 -0
  172. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_payment_client.py +0 -0
  173. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_payment_receipt_client.py +0 -0
  174. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_payment_request_client.py +0 -0
  175. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_tax_client.py +0 -0
  176. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_usage_client.py +0 -0
  177. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_webhook_client.py +0 -0
  178. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/test_webhook_endpoint_client.py +0 -0
  179. {lago_python_client-1.41.4 → lago_python_client-1.43.0}/tests/utils/__init__.py +0 -0
  180. {lago_python_client-1.41.4 → lago_python_client-1.43.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.41.4
3
+ Version: 1.43.0
4
4
  Summary: Lago Python API Client
5
5
  Home-page: https://github.com/getlago/lago-python-client
6
6
  Author: Lovro Colic
@@ -14,7 +14,7 @@ from ..models.billable_metric import (
14
14
  BillableMetricResponse,
15
15
  )
16
16
  from ..services.request import make_headers, make_url, send_post_request
17
- from ..services.response import Response, prepare_object_response, get_response_data
17
+ from ..services.response import Response, get_response_data, prepare_object_response
18
18
 
19
19
 
20
20
  class BillableMetricClient(
@@ -1,40 +1,45 @@
1
1
  from urllib.parse import urljoin
2
2
 
3
+ from .activity_logs.clients import ActivityLogClient
3
4
  from .add_ons.clients import AddOnClient
5
+ from .api_logs.clients import ApiLogClient
4
6
  from .billable_metrics.clients import BillableMetricClient
5
7
  from .billing_entities.clients import BillingEntityClient
6
8
  from .coupons.clients import AppliedCouponClient, CouponClient
7
9
  from .credit_notes.clients import CreditNoteClient
8
- from .customers.clients import CustomerClient
9
10
  from .customers.applied_coupons_client import CustomerAppliedCouponsClient
11
+ from .customers.clients import CustomerClient
10
12
  from .customers.credit_notes_client import CustomerCreditNotesClient
11
13
  from .customers.invoices_client import CustomerInvoicesClient
12
- from .customers.payments_client import CustomerPaymentsClient
14
+ from .customers.payment_methods_client import CustomerPaymentMethodsClient
13
15
  from .customers.payment_requests_client import CustomerPaymentRequestsClient
16
+ from .customers.payments_client import CustomerPaymentsClient
14
17
  from .customers.subscriptions_client import CustomerSubscriptionsClient
15
18
  from .customers.wallets_client import CustomerWalletsClient
16
19
  from .events.clients import EventClient
17
20
  from .fees.clients import FeeClient
18
21
  from .functools_ext import callable_cached_property
19
22
  from .gross_revenues.clients import GrossRevenueClient
20
- from .invoices.clients import InvoiceClient
23
+ from .invoice_collections.clients import InvoiceCollectionClient
21
24
  from .invoiced_usages.clients import InvoicedUsageClient
25
+ from .invoices.clients import InvoiceClient
22
26
  from .mrrs.clients import MrrClient
23
27
  from .organizations.clients import OrganizationClient
24
28
  from .overdue_balances.clients import OverdueBalanceClient
25
29
  from .payment_receipts.clients import PaymentReceiptClient
26
30
  from .payment_requests.clients import PaymentRequestClient
27
31
  from .payments.clients import PaymentClient
28
- from .invoice_collections.clients import InvoiceCollectionClient
32
+ from .plans.charges_client import PlanChargesClient
29
33
  from .plans.clients import PlanClient
34
+ from .plans.fixed_charges_client import PlanFixedChargesClient
35
+ from .subscriptions.charges_client import SubscriptionChargesClient
30
36
  from .subscriptions.clients import SubscriptionClient
37
+ from .subscriptions.fixed_charges_client import SubscriptionFixedChargesClient
31
38
  from .taxes.clients import TaxClient
32
39
  from .usages.clients import UsageClient
33
40
  from .wallets.clients import WalletClient, WalletTransactionClient
34
- from .webhooks.clients import WebhookClient
35
41
  from .webhook_endpoints.clients import WebhookEndpointClient
36
- from .activity_logs.clients import ActivityLogClient
37
- from .api_logs.clients import ApiLogClient
42
+ from .webhooks.clients import WebhookClient
38
43
 
39
44
  try:
40
45
  from typing import Final
@@ -111,6 +116,10 @@ class Client:
111
116
  def customer_invoices(self) -> CustomerInvoicesClient:
112
117
  return CustomerInvoicesClient(self.base_api_url, self.api_key)
113
118
 
119
+ @callable_cached_property
120
+ def customer_payment_methods(self) -> CustomerPaymentMethodsClient:
121
+ return CustomerPaymentMethodsClient(self.base_api_url, self.api_key)
122
+
114
123
  @callable_cached_property
115
124
  def customer_payments(self) -> CustomerPaymentsClient:
116
125
  return CustomerPaymentsClient(self.base_api_url, self.api_key)
@@ -179,10 +188,26 @@ class Client:
179
188
  def plans(self) -> PlanClient:
180
189
  return PlanClient(self.base_api_url, self.api_key)
181
190
 
191
+ @callable_cached_property
192
+ def plan_charges(self) -> PlanChargesClient:
193
+ return PlanChargesClient(self.base_api_url, self.api_key)
194
+
195
+ @callable_cached_property
196
+ def plan_fixed_charges(self) -> PlanFixedChargesClient:
197
+ return PlanFixedChargesClient(self.base_api_url, self.api_key)
198
+
182
199
  @callable_cached_property
183
200
  def subscriptions(self) -> SubscriptionClient:
184
201
  return SubscriptionClient(self.base_api_url, self.api_key)
185
202
 
203
+ @callable_cached_property
204
+ def subscription_charges(self) -> SubscriptionChargesClient:
205
+ return SubscriptionChargesClient(self.base_api_url, self.api_key)
206
+
207
+ @callable_cached_property
208
+ def subscription_fixed_charges(self) -> SubscriptionFixedChargesClient:
209
+ return SubscriptionFixedChargesClient(self.base_api_url, self.api_key)
210
+
186
211
  @callable_cached_property
187
212
  def taxes(self) -> TaxClient:
188
213
  return TaxClient(self.base_api_url, self.api_key)
@@ -8,10 +8,10 @@ from ..mixins import (
8
8
  FindCommandMixin,
9
9
  UpdateCommandMixin,
10
10
  )
11
- from ..models.coupon import CouponResponse
12
11
  from ..models.applied_coupon import AppliedCouponResponse
12
+ from ..models.coupon import CouponResponse
13
13
  from ..services.request import make_headers, make_url, send_delete_request
14
- from ..services.response import get_response_data, prepare_object_response, Response
14
+ from ..services.response import Response, get_response_data, prepare_object_response
15
15
 
16
16
 
17
17
  class CouponClient(
@@ -8,9 +8,9 @@ from ..mixins import (
8
8
  UpdateCommandMixin,
9
9
  )
10
10
  from ..models.credit_note import (
11
- CreditNoteResponse,
12
- CreditNoteEstimatedResponse,
13
11
  CreditNoteEstimate,
12
+ CreditNoteEstimatedResponse,
13
+ CreditNoteResponse,
14
14
  )
15
15
  from ..services.json import to_json
16
16
  from ..services.request import (
@@ -21,7 +21,7 @@ from ..services.request import (
21
21
  send_post_request,
22
22
  send_put_request,
23
23
  )
24
- from ..services.response import get_response_data, prepare_object_response, Response
24
+ from ..services.response import Response, get_response_data, prepare_object_response
25
25
 
26
26
 
27
27
  class CreditNoteClient(
@@ -3,7 +3,7 @@ from typing import ClassVar, Type
3
3
  from ..base_client import BaseClient
4
4
  from ..mixins import FindAllChildrenCommandMixin
5
5
  from ..models.applied_coupon import AppliedCouponResponse
6
- from ..client import CustomerClient
6
+ from .clients import CustomerClient
7
7
 
8
8
 
9
9
  class CustomerAppliedCouponsClient(FindAllChildrenCommandMixin, BaseClient):
@@ -1,5 +1,5 @@
1
- import sys
2
- from typing import Any, Mapping, ClassVar, Type, Optional
1
+ from collections.abc import Mapping
2
+ from typing import Any, ClassVar, Optional, Type
3
3
 
4
4
  from ..base_client import BaseClient
5
5
  from ..mixins import (
@@ -9,21 +9,16 @@ from ..mixins import (
9
9
  FindCommandMixin,
10
10
  )
11
11
  from ..models.customer import CustomerResponse
12
- from ..models.customer_usage import CustomerUsageResponse
13
12
  from ..models.customer_projected_usage import CustomerProjectedUsageResponse
14
- from ..services.request import make_headers, make_url, send_get_request, send_post_request, QueryPairs
13
+ from ..models.customer_usage import CustomerUsageResponse
14
+ from ..services.request import QueryPairs, make_headers, make_url, send_get_request, send_post_request
15
15
  from ..services.response import (
16
+ Response,
16
17
  get_response_data,
17
18
  prepare_index_response,
18
19
  prepare_object_response,
19
- Response,
20
20
  )
21
21
 
22
- if sys.version_info >= (3, 9):
23
- from collections.abc import Mapping
24
- else:
25
- from typing import Mapping
26
-
27
22
 
28
23
  class CustomerClient(
29
24
  CreateCommandMixin[CustomerResponse],
@@ -82,8 +77,10 @@ class CustomerClient(
82
77
  self,
83
78
  resource_id: str,
84
79
  external_subscription_id: str,
85
- options: QueryPairs = {},
80
+ options: QueryPairs = None,
86
81
  ) -> Mapping[str, Any]:
82
+ if options is None:
83
+ options = {}
87
84
  api_response: Response = send_get_request(
88
85
  url=make_url(
89
86
  origin=self.base_url,
@@ -3,7 +3,7 @@ from typing import ClassVar, Type
3
3
  from ..base_client import BaseClient
4
4
  from ..mixins import FindAllChildrenCommandMixin
5
5
  from ..models.credit_note import CreditNoteResponse
6
- from ..client import CustomerClient
6
+ from .clients import CustomerClient
7
7
 
8
8
 
9
9
  class CustomerCreditNotesClient(FindAllChildrenCommandMixin, BaseClient):
@@ -3,7 +3,7 @@ from typing import ClassVar, Type
3
3
  from ..base_client import BaseClient
4
4
  from ..mixins import FindAllChildrenCommandMixin
5
5
  from ..models.invoice import InvoiceResponse
6
- from ..client import CustomerClient
6
+ from .clients import CustomerClient
7
7
 
8
8
 
9
9
  class CustomerInvoicesClient(FindAllChildrenCommandMixin, BaseClient):
@@ -0,0 +1,49 @@
1
+ from typing import ClassVar, Type
2
+
3
+ from ..base_client import BaseClient
4
+ from ..customers.clients import CustomerClient
5
+ from ..mixins import FindAllChildrenCommandMixin
6
+ from ..models.payment_method import PaymentMethodResponse
7
+ from ..services.request import make_headers, make_url, send_delete_request, send_put_request
8
+ from ..services.response import Response, get_response_data, prepare_object_response
9
+
10
+
11
+ class CustomerPaymentMethodsClient(FindAllChildrenCommandMixin[PaymentMethodResponse], BaseClient):
12
+ PARENT_API_RESOURCE: ClassVar[str] = CustomerClient.API_RESOURCE
13
+ API_RESOURCE: ClassVar[str] = "payment_methods"
14
+ RESPONSE_MODEL: ClassVar[Type[PaymentMethodResponse]] = PaymentMethodResponse
15
+ ROOT_NAME: ClassVar[str] = "payment_method"
16
+
17
+ def destroy(self, customer_external_id: str, payment_method_id: str) -> PaymentMethodResponse:
18
+ api_response: Response = send_delete_request(
19
+ url=make_url(
20
+ origin=self.base_url,
21
+ path_parts=(self.PARENT_API_RESOURCE, customer_external_id, self.API_RESOURCE, payment_method_id),
22
+ ),
23
+ headers=make_headers(api_key=self.api_key),
24
+ )
25
+
26
+ return prepare_object_response(
27
+ response_model=self.RESPONSE_MODEL,
28
+ data=get_response_data(response=api_response, key=self.ROOT_NAME),
29
+ )
30
+
31
+ def set_as_default(self, customer_external_id: str, payment_method_id: str) -> PaymentMethodResponse:
32
+ api_response: Response = send_put_request(
33
+ url=make_url(
34
+ origin=self.base_url,
35
+ path_parts=(
36
+ self.PARENT_API_RESOURCE,
37
+ customer_external_id,
38
+ self.API_RESOURCE,
39
+ payment_method_id,
40
+ "set_as_default",
41
+ ),
42
+ ),
43
+ headers=make_headers(api_key=self.api_key),
44
+ )
45
+
46
+ return prepare_object_response(
47
+ response_model=self.RESPONSE_MODEL,
48
+ data=get_response_data(response=api_response, key=self.ROOT_NAME),
49
+ )
@@ -3,7 +3,7 @@ from typing import ClassVar, Type
3
3
  from ..base_client import BaseClient
4
4
  from ..mixins import FindAllChildrenCommandMixin
5
5
  from ..models.payment_request import PaymentRequestResponse
6
- from ..client import CustomerClient
6
+ from .clients import CustomerClient
7
7
 
8
8
 
9
9
  class CustomerPaymentRequestsClient(FindAllChildrenCommandMixin, BaseClient):
@@ -3,7 +3,7 @@ from typing import ClassVar, Type
3
3
  from ..base_client import BaseClient
4
4
  from ..mixins import FindAllChildrenCommandMixin
5
5
  from ..models.payment import PaymentResponse
6
- from ..client import CustomerClient
6
+ from .clients import CustomerClient
7
7
 
8
8
 
9
9
  class CustomerPaymentsClient(FindAllChildrenCommandMixin, BaseClient):
@@ -3,7 +3,7 @@ from typing import ClassVar, Type
3
3
  from ..base_client import BaseClient
4
4
  from ..mixins import FindAllChildrenCommandMixin
5
5
  from ..models.subscription import SubscriptionResponse
6
- from ..client import CustomerClient
6
+ from .clients import CustomerClient
7
7
 
8
8
 
9
9
  class CustomerSubscriptionsClient(FindAllChildrenCommandMixin, BaseClient):
@@ -3,7 +3,7 @@ from typing import ClassVar, Type
3
3
  from ..base_client import BaseClient
4
4
  from ..mixins import FindAllChildrenCommandMixin
5
5
  from ..models.wallet import WalletResponse
6
- from ..client import CustomerClient
6
+ from .clients import CustomerClient
7
7
 
8
8
 
9
9
  class CustomerWalletsClient(FindAllChildrenCommandMixin, BaseClient):
@@ -1,4 +1,4 @@
1
- import sys
1
+ from collections.abc import Mapping
2
2
  from typing import Any, ClassVar, Optional, Type
3
3
 
4
4
  import httpx
@@ -13,18 +13,13 @@ from ..models.fee import FeeResponse
13
13
  from ..services.json import to_json
14
14
  from ..services.request import make_headers, make_url, send_post_request
15
15
  from ..services.response import (
16
+ Response,
16
17
  get_response_data,
17
- prepare_object_response,
18
18
  prepare_object_list_response,
19
+ prepare_object_response,
19
20
  verify_response,
20
- Response,
21
21
  )
22
22
 
23
- if sys.version_info >= (3, 9):
24
- from collections.abc import Mapping
25
- else:
26
- from typing import Mapping
27
-
28
23
 
29
24
  class EventClient(FindCommandMixin[EventResponse], BaseClient):
30
25
  API_RESOURCE: ClassVar[str] = "events"
@@ -67,8 +62,6 @@ class EventClient(FindCommandMixin[EventResponse], BaseClient):
67
62
  )
68
63
  verify_response(api_response)
69
64
 
70
- return None
71
-
72
65
  def estimate_fees(self, input_object: BaseModel) -> Mapping[str, Any]:
73
66
  api_response: Response = send_post_request(
74
67
  url=make_url(
@@ -1,12 +1,7 @@
1
+ from collections.abc import MutableMapping
1
2
  from http import HTTPStatus
2
- import sys
3
3
  from typing import Any, Optional
4
4
 
5
- if sys.version_info < (3, 9):
6
- from typing import MutableMapping
7
- else:
8
- from collections.abc import MutableMapping
9
-
10
5
 
11
6
  class LagoApiError(Exception):
12
7
  def __init__(
@@ -1,6 +1,5 @@
1
- import sys
2
- from typing import Any, TypeVar
3
1
  import warnings
2
+ from typing import Any, TypeVar
4
3
 
5
4
  try:
6
5
  from functools import cached_property
@@ -10,14 +9,13 @@ try:
10
9
  from typing import ParamSpec
11
10
  except ImportError: # Python 3.7, Python 3.8, Python 3.9
12
11
  from typing_extensions import ParamSpec
13
- if sys.version_info >= (3, 9):
14
- from collections.abc import Callable
12
+ from collections.abc import Callable
15
13
 
16
14
  T = TypeVar("T")
17
15
  P = ParamSpec("P")
18
16
 
19
17
 
20
- class Proxy(object):
18
+ class Proxy:
21
19
  def __init__(self, _obj: object) -> None:
22
20
  object.__setattr__(self, "_obj", _obj)
23
21
 
@@ -31,13 +29,7 @@ class Proxy(object):
31
29
 
32
30
  def __call__(self) -> Any:
33
31
  warnings.warn(
34
- "".join(
35
- (
36
- "We are going to deprecate callable properties (`client.<your_tag_name>()`) in future. ",
37
- "Please, remove braces. ",
38
- "Use `client.<your_tag_name>.<your_operation_name>(...)` instead of `client.<your_tag_name>().<your_operation_name>(...)`",
39
- )
40
- ),
32
+ "We are going to deprecate callable properties (`client.<your_tag_name>()`) in future. Please, remove braces. Use `client.<your_tag_name>.<your_operation_name>(...)` instead of `client.<your_tag_name>().<your_operation_name>(...)`",
41
33
  PendingDeprecationWarning,
42
34
  )
43
35
  return self._obj
@@ -55,11 +47,5 @@ class Proxy(object):
55
47
  return hash(self._obj)
56
48
 
57
49
 
58
- if sys.version_info >= (3, 9):
59
-
60
- def callable_cached_property(func: Callable[P, T]) -> cached_property[T]:
61
- return cached_property(lambda s: Proxy(func(s))) # type: ignore
62
- else:
63
-
64
- def callable_cached_property(func):
65
- return cached_property(lambda s: Proxy(func(s)))
50
+ def callable_cached_property(func: Callable[P, T]) -> cached_property[T]:
51
+ return cached_property(lambda s: Proxy(func(s)))
@@ -1,16 +1,11 @@
1
- import sys
1
+ from collections.abc import Mapping
2
2
  from typing import Any, ClassVar, Type
3
3
 
4
4
  from ..base_client import BaseClient
5
5
  from ..mixins import FindAllCommandMixin
6
6
  from ..models.gross_revenue import GrossRevenueResponse
7
- from ..services.request import make_headers, make_url, send_get_request, 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
7
+ from ..services.request import QueryPairs, make_headers, make_url, send_get_request
8
+ from ..services.response import Response, get_response_data, prepare_index_response
14
9
 
15
10
 
16
11
  class GrossRevenueClient(
@@ -21,7 +16,9 @@ class GrossRevenueClient(
21
16
  RESPONSE_MODEL: ClassVar[Type[GrossRevenueResponse]] = GrossRevenueResponse
22
17
  ROOT_NAME: ClassVar[str] = "gross_revenue"
23
18
 
24
- def find_all(self, options: QueryPairs = {}) -> Mapping[str, Any]:
19
+ def find_all(self, options: QueryPairs = None) -> Mapping[str, Any]:
20
+ if options is None:
21
+ options = {}
25
22
  api_response: Response = send_get_request(
26
23
  url=make_url(
27
24
  origin=self.base_url,
@@ -1,16 +1,11 @@
1
- import sys
1
+ from collections.abc import Mapping
2
2
  from typing import Any, ClassVar, Type
3
3
 
4
4
  from ..base_client import BaseClient
5
5
  from ..mixins import FindAllCommandMixin
6
6
  from ..models.invoice_collection import InvoiceCollectionResponse
7
- from ..services.request import make_headers, make_url, send_get_request, 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
7
+ from ..services.request import QueryPairs, make_headers, make_url, send_get_request
8
+ from ..services.response import Response, get_response_data, prepare_index_response
14
9
 
15
10
 
16
11
  class InvoiceCollectionClient(
@@ -21,7 +16,9 @@ class InvoiceCollectionClient(
21
16
  RESPONSE_MODEL: ClassVar[Type[InvoiceCollectionResponse]] = InvoiceCollectionResponse
22
17
  ROOT_NAME: ClassVar[str] = "invoice_collection"
23
18
 
24
- def find_all(self, options: QueryPairs = {}) -> Mapping[str, Any]:
19
+ def find_all(self, options: QueryPairs = None) -> Mapping[str, Any]:
20
+ if options is None:
21
+ options = {}
25
22
  api_response: Response = send_get_request(
26
23
  url=make_url(
27
24
  origin=self.base_url,
@@ -1,16 +1,11 @@
1
- import sys
1
+ from collections.abc import Mapping
2
2
  from typing import Any, ClassVar, Type
3
3
 
4
4
  from ..base_client import BaseClient
5
5
  from ..mixins import FindAllCommandMixin
6
6
  from ..models.invoiced_usage import InvoicedUsageResponse
7
- from ..services.request import make_headers, make_url, send_get_request, 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
7
+ from ..services.request import QueryPairs, make_headers, make_url, send_get_request
8
+ from ..services.response import Response, get_response_data, prepare_index_response
14
9
 
15
10
 
16
11
  class InvoicedUsageClient(
@@ -21,7 +16,9 @@ class InvoicedUsageClient(
21
16
  RESPONSE_MODEL: ClassVar[Type[InvoicedUsageResponse]] = InvoicedUsageResponse
22
17
  ROOT_NAME: ClassVar[str] = "invoiced_usage"
23
18
 
24
- def find_all(self, options: QueryPairs = {}) -> Mapping[str, Any]:
19
+ def find_all(self, options: QueryPairs = None) -> Mapping[str, Any]:
20
+ if options is None:
21
+ options = {}
25
22
  api_response: Response = send_get_request(
26
23
  url=make_url(
27
24
  origin=self.base_url,
@@ -1,13 +1,14 @@
1
- from typing import ClassVar, Optional, Type, Mapping, Any
1
+ from typing import Any, ClassVar, Mapping, Optional, Type
2
2
 
3
3
  from ..base_client import BaseClient
4
4
  from ..mixins import (
5
+ CreateCommandMixin,
5
6
  FindAllCommandMixin,
6
7
  FindCommandMixin,
7
8
  UpdateCommandMixin,
8
- CreateCommandMixin,
9
9
  )
10
10
  from ..models.invoice import InvoicePreview, InvoiceResponse
11
+ from ..models.payment_method import PaymentMethod
11
12
  from ..services.json import to_json
12
13
  from ..services.request import (
13
14
  make_headers,
@@ -15,7 +16,7 @@ from ..services.request import (
15
16
  send_post_request,
16
17
  send_put_request,
17
18
  )
18
- from ..services.response import get_response_data, prepare_object_response, Response
19
+ from ..services.response import Response, get_response_data, prepare_object_response
19
20
 
20
21
 
21
22
  class InvoiceClient(
@@ -47,12 +48,19 @@ class InvoiceClient(
47
48
  data=response_data,
48
49
  )
49
50
 
50
- def retry_payment(self, resource_id: str) -> Optional[InvoiceResponse]:
51
+ def retry_payment(
52
+ self, resource_id: str, payment_method: Optional[PaymentMethod] = None
53
+ ) -> Optional[InvoiceResponse]:
54
+ payload = {}
55
+ if payment_method:
56
+ payload["payment_method"] = payment_method.dict(exclude_none=True)
57
+
51
58
  api_response: Response = send_post_request(
52
59
  url=make_url(
53
60
  origin=self.base_url,
54
61
  path_parts=(self.API_RESOURCE, resource_id, "retry_payment"),
55
62
  ),
63
+ content=to_json(payload) if payload else None,
56
64
  headers=make_headers(api_key=self.api_key),
57
65
  )
58
66