lago-python-client 1.50.0__tar.gz → 1.53.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 (203) hide show
  1. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/PKG-INFO +1 -1
  2. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/client.py +21 -1
  3. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/invoices/clients.py +2 -0
  4. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/__init__.py +42 -0
  5. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/credit_note.py +8 -2
  6. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/customer_usage.py +1 -1
  7. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/fee.py +6 -4
  8. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/invoice.py +8 -0
  9. lago_python_client-1.53.0/lago_python_client/models/order.py +39 -0
  10. lago_python_client-1.53.0/lago_python_client/models/order_form.py +28 -0
  11. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/payment_request.py +1 -0
  12. lago_python_client-1.53.0/lago_python_client/models/quote.py +83 -0
  13. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/subscription.py +2 -0
  14. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/tax.py +1 -0
  15. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/wallet.py +4 -0
  16. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/wallet_transaction.py +2 -0
  17. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/webhook_endpoint.py +6 -1
  18. lago_python_client-1.53.0/lago_python_client/order_forms/clients.py +74 -0
  19. lago_python_client-1.53.0/lago_python_client/orders/clients.py +53 -0
  20. lago_python_client-1.53.0/lago_python_client/quote_versions/clients.py +90 -0
  21. lago_python_client-1.53.0/lago_python_client/quotes/clients.py +56 -0
  22. lago_python_client-1.53.0/lago_python_client/version.py +1 -0
  23. lago_python_client-1.53.0/lago_python_client/webhook_endpoints/__init__.py +0 -0
  24. lago_python_client-1.53.0/lago_python_client/webhooks/__init__.py +0 -0
  25. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client.egg-info/PKG-INFO +1 -1
  26. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client.egg-info/SOURCES.txt +30 -0
  27. lago_python_client-1.53.0/tests/__init__.py +0 -0
  28. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_credit_note_client.py +8 -1
  29. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_customer_client.py +2 -0
  30. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_fee_client.py +5 -2
  31. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_invoice_client.py +32 -1
  32. lago_python_client-1.53.0/tests/test_order_client.py +146 -0
  33. lago_python_client-1.53.0/tests/test_order_form_client.py +161 -0
  34. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_plan_client.py +1 -1
  35. lago_python_client-1.53.0/tests/test_quote_client.py +118 -0
  36. lago_python_client-1.53.0/tests/test_quote_version_client.py +126 -0
  37. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_rate_limit.py +10 -10
  38. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_subscription_client.py +3 -2
  39. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_tax_client.py +1 -0
  40. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_wallet_client.py +6 -0
  41. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_wallet_transaction_client.py +2 -0
  42. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_webhook_endpoint_client.py +6 -1
  43. lago_python_client-1.53.0/tests/utils/__init__.py +0 -0
  44. lago_python_client-1.50.0/lago_python_client/version.py +0 -1
  45. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/LICENSE +0 -0
  46. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/README.md +0 -0
  47. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/__init__.py +0 -0
  48. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/activity_logs/__init__.py +0 -0
  49. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/activity_logs/clients.py +0 -0
  50. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/add_ons/__init__.py +0 -0
  51. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/add_ons/clients.py +0 -0
  52. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/api_logs/__init__.py +0 -0
  53. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/api_logs/clients.py +0 -0
  54. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/base_client.py +0 -0
  55. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/base_model.py +0 -0
  56. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/billable_metrics/__init__.py +0 -0
  57. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/billable_metrics/clients.py +0 -0
  58. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/billing_entities/__init__.py +0 -0
  59. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/billing_entities/clients.py +0 -0
  60. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/coupons/__init__.py +0 -0
  61. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/coupons/clients.py +0 -0
  62. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/credit_notes/__init__.py +0 -0
  63. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/credit_notes/clients.py +0 -0
  64. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/customers/__init__.py +0 -0
  65. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/customers/applied_coupons_client.py +0 -0
  66. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/customers/clients.py +0 -0
  67. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/customers/credit_notes_client.py +0 -0
  68. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/customers/invoices_client.py +0 -0
  69. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/customers/payment_methods_client.py +0 -0
  70. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/customers/payment_requests_client.py +0 -0
  71. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/customers/payments_client.py +0 -0
  72. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/customers/subscriptions_client.py +0 -0
  73. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/customers/wallet_client.py +0 -0
  74. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/customers/wallets/__init__.py +0 -0
  75. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/customers/wallets/alert_client.py +0 -0
  76. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/customers/wallets/metadata_client.py +0 -0
  77. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/customers/wallets_client.py +0 -0
  78. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/events/__init__.py +0 -0
  79. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/events/clients.py +0 -0
  80. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/exceptions.py +0 -0
  81. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/fees/__init__.py +0 -0
  82. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/fees/clients.py +0 -0
  83. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/functools_ext.py +0 -0
  84. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/gross_revenues/__init__.py +0 -0
  85. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/gross_revenues/clients.py +0 -0
  86. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/invoice_collections/__init__.py +0 -0
  87. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/invoice_collections/clients.py +0 -0
  88. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/invoiced_usages/__init__.py +0 -0
  89. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/invoiced_usages/clients.py +0 -0
  90. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/invoices/__init__.py +0 -0
  91. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/mixins.py +0 -0
  92. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/activity_log.py +0 -0
  93. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/add_on.py +0 -0
  94. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/alert.py +0 -0
  95. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/api_log.py +0 -0
  96. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/applied_coupon.py +0 -0
  97. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/billable_metric.py +0 -0
  98. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/billing_entity.py +0 -0
  99. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/billing_period.py +0 -0
  100. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/charge.py +0 -0
  101. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/coupon.py +0 -0
  102. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/credit.py +0 -0
  103. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/customer.py +0 -0
  104. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/customer_projected_usage.py +0 -0
  105. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/error_detail.py +0 -0
  106. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/event.py +0 -0
  107. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/fixed_charge.py +0 -0
  108. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/gross_revenue.py +0 -0
  109. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/invoice_collection.py +0 -0
  110. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/invoice_custom_section.py +0 -0
  111. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/invoice_item.py +0 -0
  112. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/invoiced_usage.py +0 -0
  113. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/lifetime_usage.py +0 -0
  114. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/minimum_commitment.py +0 -0
  115. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/mrr.py +0 -0
  116. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/organization.py +0 -0
  117. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/overdue_balance.py +0 -0
  118. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/payment.py +0 -0
  119. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/payment_method.py +0 -0
  120. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/payment_receipt.py +0 -0
  121. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/plan.py +0 -0
  122. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/usage.py +0 -0
  123. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/models/usage_threshold.py +0 -0
  124. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/mrrs/__init__.py +0 -0
  125. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/mrrs/clients.py +0 -0
  126. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/observability.py +0 -0
  127. {lago_python_client-1.50.0/lago_python_client/organizations → lago_python_client-1.53.0/lago_python_client/order_forms}/__init__.py +0 -0
  128. {lago_python_client-1.50.0/lago_python_client/overdue_balances → lago_python_client-1.53.0/lago_python_client/orders}/__init__.py +0 -0
  129. {lago_python_client-1.50.0/lago_python_client/payment_receipts → lago_python_client-1.53.0/lago_python_client/organizations}/__init__.py +0 -0
  130. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/organizations/clients.py +0 -0
  131. {lago_python_client-1.50.0/lago_python_client/payment_requests → lago_python_client-1.53.0/lago_python_client/overdue_balances}/__init__.py +0 -0
  132. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/overdue_balances/clients.py +0 -0
  133. {lago_python_client-1.50.0/lago_python_client/payments → lago_python_client-1.53.0/lago_python_client/payment_receipts}/__init__.py +0 -0
  134. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/payment_receipts/clients.py +0 -0
  135. {lago_python_client-1.50.0/lago_python_client/plans → lago_python_client-1.53.0/lago_python_client/payment_requests}/__init__.py +0 -0
  136. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/payment_requests/clients.py +0 -0
  137. {lago_python_client-1.50.0/lago_python_client/services → lago_python_client-1.53.0/lago_python_client/payments}/__init__.py +0 -0
  138. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/payments/clients.py +0 -0
  139. {lago_python_client-1.50.0/lago_python_client/subscriptions → lago_python_client-1.53.0/lago_python_client/plans}/__init__.py +0 -0
  140. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/plans/charges_client.py +0 -0
  141. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/plans/clients.py +0 -0
  142. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/plans/fixed_charges_client.py +0 -0
  143. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/py.typed +0 -0
  144. {lago_python_client-1.50.0/lago_python_client/taxes → lago_python_client-1.53.0/lago_python_client/quote_versions}/__init__.py +0 -0
  145. {lago_python_client-1.50.0/lago_python_client/usages → lago_python_client-1.53.0/lago_python_client/quotes}/__init__.py +0 -0
  146. {lago_python_client-1.50.0/lago_python_client/wallets → lago_python_client-1.53.0/lago_python_client/services}/__init__.py +0 -0
  147. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/services/json.py +0 -0
  148. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/services/rate_limit.py +0 -0
  149. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/services/request.py +0 -0
  150. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/services/response.py +0 -0
  151. {lago_python_client-1.50.0/lago_python_client/webhook_endpoints → lago_python_client-1.53.0/lago_python_client/subscriptions}/__init__.py +0 -0
  152. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/subscriptions/charges_client.py +0 -0
  153. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/subscriptions/clients.py +0 -0
  154. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/subscriptions/fixed_charges_client.py +0 -0
  155. {lago_python_client-1.50.0/lago_python_client/webhooks → lago_python_client-1.53.0/lago_python_client/taxes}/__init__.py +0 -0
  156. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/taxes/clients.py +0 -0
  157. {lago_python_client-1.50.0/tests → lago_python_client-1.53.0/lago_python_client/usages}/__init__.py +0 -0
  158. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/usages/clients.py +0 -0
  159. {lago_python_client-1.50.0/tests/utils → lago_python_client-1.53.0/lago_python_client/wallets}/__init__.py +0 -0
  160. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/wallets/clients.py +0 -0
  161. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/webhook_endpoints/clients.py +0 -0
  162. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client/webhooks/clients.py +0 -0
  163. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client.egg-info/dependency_links.txt +0 -0
  164. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client.egg-info/requires.txt +0 -0
  165. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/lago_python_client.egg-info/top_level.txt +0 -0
  166. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/pyproject.toml +0 -0
  167. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/setup.cfg +0 -0
  168. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_activity_logs_client.py +0 -0
  169. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_add_on_client.py +0 -0
  170. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_api_logs_client.py +0 -0
  171. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_applied_coupon_client.py +0 -0
  172. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_billable_metric_client.py +0 -0
  173. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_billing_entity_client.py +0 -0
  174. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_client.py +0 -0
  175. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_coupon_client.py +0 -0
  176. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_customer_applied_coupons_client.py +0 -0
  177. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_customer_credit_notes_client.py +0 -0
  178. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_customer_invoices_client.py +0 -0
  179. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_customer_payment_methods_client.py +0 -0
  180. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_customer_payment_requests_client.py +0 -0
  181. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_customer_payments_client.py +0 -0
  182. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_customer_sbscriptions_client.py +0 -0
  183. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_customer_wallet_alert_client.py +0 -0
  184. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_customer_wallet_client.py +0 -0
  185. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_customer_wallet_metadata_client.py +0 -0
  186. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_customer_wallets_client.py +0 -0
  187. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_event_client.py +0 -0
  188. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_functools_ext.py +0 -0
  189. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_gross_revenue_client.py +0 -0
  190. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_invoice_collection_client.py +0 -0
  191. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_invoiced_usage_client.py +0 -0
  192. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_json_services.py +0 -0
  193. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_mrr_client.py +0 -0
  194. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_organization_client.py +0 -0
  195. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_overdue_balance_client.py +0 -0
  196. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_payment_client.py +0 -0
  197. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_payment_receipt_client.py +0 -0
  198. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_payment_request_client.py +0 -0
  199. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_request_services.py +0 -0
  200. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_response_services.py +0 -0
  201. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_usage_client.py +0 -0
  202. {lago_python_client-1.50.0 → lago_python_client-1.53.0}/tests/test_webhook_client.py +0 -0
  203. {lago_python_client-1.50.0 → lago_python_client-1.53.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.50.0
3
+ Version: 1.53.0
4
4
  Summary: Lago Python API Client
5
5
  Home-page: https://github.com/getlago/lago-python-client
6
6
  Author: Lovro Colic
@@ -25,6 +25,8 @@ from .invoice_collections.clients import InvoiceCollectionClient
25
25
  from .invoiced_usages.clients import InvoicedUsageClient
26
26
  from .invoices.clients import InvoiceClient
27
27
  from .mrrs.clients import MrrClient
28
+ from .order_forms.clients import OrderFormClient
29
+ from .orders.clients import OrderClient
28
30
  from .organizations.clients import OrganizationClient
29
31
  from .overdue_balances.clients import OverdueBalanceClient
30
32
  from .payment_receipts.clients import PaymentReceiptClient
@@ -33,6 +35,8 @@ from .payments.clients import PaymentClient
33
35
  from .plans.charges_client import PlanChargesClient
34
36
  from .plans.clients import PlanClient
35
37
  from .plans.fixed_charges_client import PlanFixedChargesClient
38
+ from .quote_versions.clients import QuoteVersionClient
39
+ from .quotes.clients import QuoteClient
36
40
  from .services.rate_limit import RateLimitCallback, RateLimitRetryConfig
37
41
  from .subscriptions.charges_client import SubscriptionChargesClient
38
42
  from .subscriptions.clients import SubscriptionClient
@@ -76,7 +80,7 @@ class Client:
76
80
 
77
81
  @property
78
82
  def base_api_url(self) -> str:
79
- return urljoin(self.api_url if self.api_url else Client.BASE_URL, Client.API_PATH)
83
+ return urljoin(self.api_url or Client.BASE_URL, Client.API_PATH)
80
84
 
81
85
  @property
82
86
  def base_ingest_api_url(self) -> str:
@@ -180,6 +184,14 @@ class Client:
180
184
  def mrrs(self) -> MrrClient:
181
185
  return self._create_client(MrrClient, self.base_api_url, self.api_key)
182
186
 
187
+ @callable_cached_property
188
+ def order_forms(self) -> OrderFormClient:
189
+ return self._create_client(OrderFormClient, self.base_api_url, self.api_key)
190
+
191
+ @callable_cached_property
192
+ def orders(self) -> OrderClient:
193
+ return self._create_client(OrderClient, self.base_api_url, self.api_key)
194
+
183
195
  @callable_cached_property
184
196
  def organizations(self) -> OrganizationClient:
185
197
  return self._create_client(OrganizationClient, self.base_api_url, self.api_key)
@@ -216,6 +228,14 @@ class Client:
216
228
  def plan_fixed_charges(self) -> PlanFixedChargesClient:
217
229
  return self._create_client(PlanFixedChargesClient, self.base_api_url, self.api_key)
218
230
 
231
+ @callable_cached_property
232
+ def quotes(self) -> QuoteClient:
233
+ return self._create_client(QuoteClient, self.base_api_url, self.api_key)
234
+
235
+ @callable_cached_property
236
+ def quote_versions(self) -> QuoteVersionClient:
237
+ return self._create_client(QuoteVersionClient, self.base_api_url, self.api_key)
238
+
219
239
  @callable_cached_property
220
240
  def subscriptions(self) -> SubscriptionClient:
221
241
  return self._create_client(SubscriptionClient, self.base_api_url, self.api_key)
@@ -3,6 +3,7 @@ from typing import Any, ClassVar, Mapping, Optional, Type
3
3
  from ..base_client import BaseClient
4
4
  from ..mixins import (
5
5
  CreateCommandMixin,
6
+ DestroyCommandMixin,
6
7
  FindAllCommandMixin,
7
8
  FindCommandMixin,
8
9
  UpdateCommandMixin,
@@ -24,6 +25,7 @@ class InvoiceClient(
24
25
  FindAllCommandMixin[InvoiceResponse],
25
26
  UpdateCommandMixin[InvoiceResponse],
26
27
  CreateCommandMixin[InvoiceResponse],
28
+ DestroyCommandMixin[InvoiceResponse],
27
29
  BaseClient,
28
30
  ):
29
31
  API_RESOURCE: ClassVar[str] = "invoices"
@@ -218,6 +218,21 @@ from .minimum_commitment import (
218
218
  from .minimum_commitment import (
219
219
  MinimumCommitmentResponse as MinimumCommitmentResponse,
220
220
  )
221
+ from .order import (
222
+ OrderExecute as OrderExecute,
223
+ )
224
+ from .order import (
225
+ OrderExecutionRecordResponse as OrderExecutionRecordResponse,
226
+ )
227
+ from .order import (
228
+ OrderResponse as OrderResponse,
229
+ )
230
+ from .order_form import (
231
+ OrderFormMarkAsSigned as OrderFormMarkAsSigned,
232
+ )
233
+ from .order_form import (
234
+ OrderFormResponse as OrderFormResponse,
235
+ )
221
236
  from .organization import (
222
237
  Organization as Organization,
223
238
  )
@@ -234,6 +249,33 @@ from .payment_receipt import (
234
249
  from .payment_request import PaymentRequest as PaymentRequest
235
250
  from .payment_method import PaymentMethod as PaymentMethod, PaymentMethodResponse as PaymentMethodResponse
236
251
  from .plan import Plan as Plan
252
+ from .quote import (
253
+ QuoteBillingItemAddOnResponse as QuoteBillingItemAddOnResponse,
254
+ )
255
+ from .quote import (
256
+ QuoteBillingItemCouponResponse as QuoteBillingItemCouponResponse,
257
+ )
258
+ from .quote import (
259
+ QuoteBillingItemPlanResponse as QuoteBillingItemPlanResponse,
260
+ )
261
+ from .quote import (
262
+ QuoteBillingItemsResponse as QuoteBillingItemsResponse,
263
+ )
264
+ from .quote import (
265
+ QuoteBillingItemWalletCreditResponse as QuoteBillingItemWalletCreditResponse,
266
+ )
267
+ from .quote import (
268
+ QuoteOwnerResponse as QuoteOwnerResponse,
269
+ )
270
+ from .quote import (
271
+ QuoteResponse as QuoteResponse,
272
+ )
273
+ from .quote import (
274
+ QuoteVersionApprove as QuoteVersionApprove,
275
+ )
276
+ from .quote import (
277
+ QuoteVersionResponse as QuoteVersionResponse,
278
+ )
237
279
  from .subscription import ActivationRuleInput as ActivationRuleInput, Subscription as Subscription
238
280
  from .tax import (
239
281
  Tax as Tax,
@@ -43,6 +43,7 @@ class CreditNoteResponse(BaseResponseModel):
43
43
  number: Optional[str]
44
44
  lago_invoice_id: Optional[str]
45
45
  invoice_number: Optional[str]
46
+ purchase_order_number: Optional[str]
46
47
  credit_status: Optional[str]
47
48
  refund_status: Optional[str]
48
49
  reason: Optional[str]
@@ -52,7 +53,7 @@ class CreditNoteResponse(BaseResponseModel):
52
53
  balance_amount_cents: int
53
54
  refund_amount_cents: int
54
55
  offset_amount_cents: int
55
- taxes_amount_cents: str
56
+ taxes_amount_cents: int
56
57
  taxes_rate: float
57
58
  sub_total_excluding_taxes_amount_cents: int
58
59
  coupons_adjustment_amount_cents: int
@@ -75,7 +76,12 @@ class Items(BaseModel):
75
76
 
76
77
 
77
78
  class CreditNote(BaseModel):
79
+ invoice_id: Optional[str]
78
80
  reason: Optional[str]
81
+ description: Optional[str]
82
+ credit_amount_cents: Optional[int]
83
+ refund_amount_cents: Optional[int]
84
+ offset_amount_cents: Optional[int]
79
85
  items: Optional[Items]
80
86
  metadata: Optional[Dict[str, Optional[str]]]
81
87
 
@@ -116,7 +122,7 @@ class CreditNoteEstimatedResponse(BaseResponseModel):
116
122
  max_creditable_amount_cents: int
117
123
  max_refundable_amount_cents: int
118
124
  max_offsettable_amount_cents: int
119
- taxes_amount_cents: str
125
+ taxes_amount_cents: int
120
126
  taxes_rate: float
121
127
  sub_total_excluding_taxes_amount_cents: int
122
128
  coupons_adjustment_amount_cents: int
@@ -73,7 +73,7 @@ class CustomerUsageResponse(BaseResponseModel):
73
73
  from_datetime: str
74
74
  to_datetime: str
75
75
  issuing_date: str
76
- invoice_id: Optional[str]
76
+ lago_invoice_id: Optional[str]
77
77
  currency: str
78
78
  amount_cents: int
79
79
  total_amount_cents: int
@@ -7,7 +7,6 @@ from .invoice_item import InvoiceItemResponse
7
7
 
8
8
  class Fee(BaseModel):
9
9
  payment_status: Optional[str]
10
- invoice_display_name: Optional[str]
11
10
 
12
11
 
13
12
  class FeeAppliedTax(BaseResponseModel):
@@ -46,18 +45,21 @@ class FeeResponse(BaseResponseModel):
46
45
  lago_invoice_id: Optional[str]
47
46
  lago_true_up_fee_id: Optional[str]
48
47
  lago_true_up_parent_fee_id: Optional[str]
48
+ lago_original_fee_id: Optional[str]
49
49
  external_subscription_id: Optional[str]
50
+ lago_customer_id: Optional[str]
51
+ external_customer_id: Optional[str]
50
52
  amount_cents: Optional[int]
51
53
  amount_currency: Optional[str]
52
54
  taxes_amount_cents: Optional[int]
53
55
  taxes_rate: Optional[float]
54
56
  total_amount_cents: Optional[int]
55
- unit_amount_cents: Optional[int] # deprecated
56
57
  precise_unit_amount: Optional[str]
57
58
  sub_total_excluding_taxes_amount_cents: Optional[int]
58
59
  sub_total_excluding_taxes_precise_amount_cents: Optional[str]
59
60
  precise_amount: Optional[str]
60
61
  precise_total_amount: Optional[str]
62
+ precise_coupons_amount_cents: Optional[str]
61
63
  taxes_precise_amount: Optional[str]
62
64
  total_amount_currency: Optional[str]
63
65
  units: Optional[str]
@@ -68,7 +70,8 @@ class FeeResponse(BaseResponseModel):
68
70
  description: Optional[str]
69
71
  pay_in_advance: Optional[bool]
70
72
  invoiceable: Optional[bool]
71
- invoice_display_name: Optional[str]
73
+ self_billed: Optional[bool]
74
+ event_transaction_id: Optional[str]
72
75
  succeeded_at: Optional[str]
73
76
  failed_at: Optional[str]
74
77
  refunded_at: Optional[str]
@@ -77,7 +80,6 @@ class FeeResponse(BaseResponseModel):
77
80
  amount_details: Optional[Dict[str, Any]]
78
81
  pricing_unit_details: Optional[PricingUnitDetails]
79
82
  presentation_breakdowns: Optional[PresentationBreakdowns]
80
- billing_entity_code: Optional[str]
81
83
 
82
84
  item: Optional[InvoiceItemResponse]
83
85
  applied_taxes: Optional[FeeAppliedTaxes]
@@ -58,6 +58,7 @@ class OneOffInvoice(BaseModel):
58
58
  payment_method: Optional[PaymentMethod]
59
59
  invoice_custom_section: Optional[InvoiceCustomSectionInput]
60
60
  billing_entity_code: Optional[str]
61
+ purchase_order_number: Optional[str]
61
62
 
62
63
 
63
64
  class InvoicePreview(BaseModel):
@@ -115,6 +116,7 @@ class InvoiceResponse(BaseResponseModel):
115
116
  lago_id: str
116
117
  sequential_id: Optional[int]
117
118
  number: str
119
+ purchase_order_number: Optional[str]
118
120
  issuing_date: Optional[str]
119
121
  payment_dispute_lost_at: Optional[str]
120
122
  payment_due_date: Optional[str]
@@ -134,11 +136,17 @@ class InvoiceResponse(BaseResponseModel):
134
136
  sub_total_including_taxes_amount_cents: int
135
137
  total_amount_cents: int
136
138
  total_due_amount_cents: int
139
+ total_paid_amount_cents: Optional[int]
140
+ total_offsetted_credit_note_amount_cents: Optional[int]
137
141
  prepaid_credit_amount_cents: int
138
142
  prepaid_granted_credit_amount_cents: Optional[int]
139
143
  prepaid_purchased_credit_amount_cents: Optional[int]
144
+ self_billed: Optional[bool]
145
+ voided_at: Optional[str]
140
146
 
141
147
  file_url: Optional[str]
148
+ xml_url: Optional[str]
149
+ web_url: Optional[str]
142
150
  customer: Optional[CustomerResponse]
143
151
  billing_periods: Optional[BillingPeriodsResponse]
144
152
  subscriptions: Optional[SubscriptionsResponse]
@@ -0,0 +1,39 @@
1
+ from typing import List, Optional
2
+
3
+ from lago_python_client.base_model import BaseModel
4
+
5
+ from ..base_model import BaseResponseModel
6
+ from .quote import QuoteBillingItemsResponse
7
+
8
+
9
+ class OrderExecute(BaseModel):
10
+ execution_mode: Optional[str]
11
+
12
+
13
+ class OrderExecutionRecordResponse(BaseResponseModel):
14
+ executed_at: Optional[str]
15
+ execution_mode: Optional[str]
16
+ invoice_id: Optional[str]
17
+ subscription_ids: Optional[List[str]]
18
+ terminated_subscription_ids: Optional[List[str]]
19
+ applied_coupon_ids: Optional[List[str]]
20
+ wallet_ids: Optional[List[str]]
21
+ errors: Optional[List[str]]
22
+
23
+
24
+ class OrderResponse(BaseResponseModel):
25
+ lago_id: str
26
+ number: str
27
+ status: str
28
+ order_type: str
29
+ execution_mode: Optional[str]
30
+ currency: Optional[str]
31
+ executed_at: Optional[str]
32
+ execution_record: Optional[OrderExecutionRecordResponse]
33
+ lago_organization_id: str
34
+ lago_customer_id: str
35
+ lago_order_form_id: str
36
+ created_at: str
37
+ updated_at: str
38
+ # Omitted from the webhook payloads, being a heavy blob.
39
+ billing_snapshot: Optional[QuoteBillingItemsResponse]
@@ -0,0 +1,28 @@
1
+ from typing import Optional
2
+
3
+ from lago_python_client.base_model import BaseModel
4
+
5
+ from ..base_model import BaseResponseModel
6
+
7
+
8
+ class OrderFormMarkAsSigned(BaseModel):
9
+ signed_document: Optional[str]
10
+ execution_mode: Optional[str]
11
+ execute_at: Optional[str]
12
+
13
+
14
+ class OrderFormResponse(BaseResponseModel):
15
+ lago_id: str
16
+ number: str
17
+ status: str
18
+ void_reason: Optional[str]
19
+ expires_at: Optional[str]
20
+ signed_at: Optional[str]
21
+ voided_at: Optional[str]
22
+ signed_document_url: Optional[str]
23
+ lago_organization_id: str
24
+ lago_customer_id: str
25
+ lago_quote_id: str
26
+ lago_quote_version_id: str
27
+ created_at: str
28
+ updated_at: str
@@ -33,6 +33,7 @@ class PaymentRequestInvoiceResponse(BaseResponseModel):
33
33
  total_amount_cents: int
34
34
  prepaid_credit_amount_cents: int
35
35
  file_url: Optional[str]
36
+ web_url: Optional[str]
36
37
 
37
38
 
38
39
  class PaymentRequestInvoicesResponse(BaseResponseModel):
@@ -0,0 +1,83 @@
1
+ from typing import Any, Dict, List, Optional
2
+
3
+ from lago_python_client.base_model import BaseModel
4
+
5
+ from ..base_model import BaseResponseModel
6
+
7
+
8
+ class QuoteVersionApprove(BaseModel):
9
+ expires_at: Optional[str]
10
+
11
+
12
+ class QuoteBillingItemAddOnResponse(BaseResponseModel):
13
+ id: Optional[str]
14
+ localId: Optional[str]
15
+ type: Optional[str]
16
+ payload: Optional[Dict[str, Any]]
17
+ overrides: Optional[Dict[str, Any]]
18
+
19
+
20
+ class QuoteBillingItemPlanResponse(BaseResponseModel):
21
+ id: Optional[str]
22
+ localId: Optional[str]
23
+ type: Optional[str]
24
+ payload: Optional[Dict[str, Any]]
25
+ overrides: Optional[Dict[str, Any]]
26
+
27
+
28
+ class QuoteBillingItemCouponResponse(BaseResponseModel):
29
+ id: Optional[str]
30
+ localId: Optional[str]
31
+ type: Optional[str]
32
+ payload: Optional[Dict[str, Any]]
33
+ overrides: Optional[Dict[str, Any]]
34
+
35
+
36
+ class QuoteBillingItemWalletCreditResponse(BaseResponseModel):
37
+ localId: Optional[str]
38
+ type: Optional[str]
39
+ payload: Optional[Dict[str, Any]]
40
+
41
+
42
+ class QuoteBillingItemsResponse(BaseResponseModel):
43
+ addOns: Optional[List[QuoteBillingItemAddOnResponse]]
44
+ plans: Optional[List[QuoteBillingItemPlanResponse]]
45
+ coupons: Optional[List[QuoteBillingItemCouponResponse]]
46
+ walletCredits: Optional[List[QuoteBillingItemWalletCreditResponse]]
47
+
48
+
49
+ class QuoteVersionResponse(BaseResponseModel):
50
+ lago_id: str
51
+ lago_quote_id: str
52
+ lago_organization_id: str
53
+ version: int
54
+ status: str
55
+ currency: Optional[str]
56
+ billing_entity_code: Optional[str]
57
+ void_reason: Optional[str]
58
+ approved_at: Optional[str]
59
+ voided_at: Optional[str]
60
+ created_at: str
61
+ updated_at: str
62
+ # Only returned when a single version is retrieved.
63
+ content: Optional[str]
64
+ billing_items: Optional[QuoteBillingItemsResponse]
65
+
66
+
67
+ class QuoteOwnerResponse(BaseResponseModel):
68
+ lago_id: str
69
+ email: Optional[str]
70
+
71
+
72
+ class QuoteResponse(BaseResponseModel):
73
+ lago_id: str
74
+ number: str
75
+ order_type: str
76
+ lago_customer_id: str
77
+ lago_subscription_id: Optional[str]
78
+ lago_organization_id: str
79
+ created_at: str
80
+ updated_at: str
81
+ current_version: Optional[QuoteVersionResponse]
82
+ # Only returned when a single quote is retrieved.
83
+ owners: Optional[List[QuoteOwnerResponse]]
@@ -26,6 +26,7 @@ class Subscription(BaseModel):
26
26
  invoice_custom_section: Optional[InvoiceCustomSectionInput]
27
27
  consolidate_invoice: Optional[bool]
28
28
  billing_entity_code: Optional[str]
29
+ purchase_order_number: Optional[str]
29
30
  activation_rules: Optional[List[ActivationRuleInput]]
30
31
 
31
32
 
@@ -75,6 +76,7 @@ class SubscriptionResponse(BaseResponseModel):
75
76
  applied_invoice_custom_sections: Optional[AppliedInvoiceCustomSections]
76
77
  consolidate_invoice: Optional[bool]
77
78
  billing_entity_code: Optional[str]
79
+ purchase_order_number: Optional[str]
78
80
  cancellation_reason: Optional[str]
79
81
  activated_at: Optional[str]
80
82
  activation_rules: Optional[List[ActivationRuleResponse]]
@@ -24,6 +24,7 @@ class TaxResponse(BaseResponseModel):
24
24
  rate: float
25
25
  description: Optional[str]
26
26
  applied_to_organization: Optional[bool]
27
+ applied_to_billing_entities_codes: Optional[List[str]]
27
28
  created_at: str
28
29
 
29
30
 
@@ -22,6 +22,7 @@ class RecurringTransactionRule(BaseModel):
22
22
  transaction_name: Optional[str]
23
23
  ignore_paid_top_up_limits: Optional[bool]
24
24
  grants_target_top_up: Optional[bool]
25
+ purchase_order_number: Optional[str]
25
26
  payment_method: Optional[PaymentMethod]
26
27
  invoice_custom_section: Optional[InvoiceCustomSectionInput]
27
28
 
@@ -43,6 +44,7 @@ class RecurringTransactionRuleResponse(BaseModel):
43
44
  transaction_name: Optional[str]
44
45
  ignore_paid_top_up_limits: Optional[bool]
45
46
  grants_target_top_up: Optional[bool]
47
+ purchase_order_number: Optional[str]
46
48
  payment_method: Optional[PaymentMethod]
47
49
  applied_invoice_custom_sections: Optional[AppliedInvoiceCustomSections]
48
50
 
@@ -82,6 +84,7 @@ class Wallet(BaseModel):
82
84
  payment_method: Optional[PaymentMethod]
83
85
  invoice_custom_section: Optional[InvoiceCustomSectionInput]
84
86
  billing_entity_code: Optional[str]
87
+ purchase_order_number: Optional[str]
85
88
 
86
89
 
87
90
  class WalletResponse(BaseResponseModel):
@@ -115,3 +118,4 @@ class WalletResponse(BaseResponseModel):
115
118
  payment_method: Optional[PaymentMethod]
116
119
  applied_invoice_custom_sections: Optional[AppliedInvoiceCustomSections]
117
120
  billing_entity_code: Optional[str]
121
+ purchase_order_number: Optional[str]
@@ -16,6 +16,7 @@ class WalletTransaction(BaseModel):
16
16
  metadata: Optional[List[Dict[str, str]]]
17
17
  name: Optional[str]
18
18
  ignore_paid_top_up_limits: Optional[bool]
19
+ purchase_order_number: Optional[str]
19
20
  payment_method: Optional[PaymentMethod]
20
21
  invoice_custom_section: Optional[InvoiceCustomSectionInput]
21
22
 
@@ -41,6 +42,7 @@ class WalletTransactionResponse(BaseResponseModel):
41
42
  metadata: Optional[List[Dict[str, str]]]
42
43
  name: Optional[str]
43
44
  invoice_requires_successful_payment: Optional[bool]
45
+ purchase_order_number: Optional[str]
44
46
  payment_method: Optional[PaymentMethod]
45
47
  applied_invoice_custom_sections: Optional[AppliedInvoiceCustomSections]
46
48
 
@@ -1,4 +1,4 @@
1
- from typing import Optional
1
+ from typing import List, Optional
2
2
 
3
3
  from lago_python_client.base_model import BaseModel
4
4
 
@@ -7,6 +7,9 @@ from ..base_model import BaseResponseModel
7
7
 
8
8
  class WebhookEndpoint(BaseModel):
9
9
  webhook_url: Optional[str]
10
+ signature_algo: Optional[str]
11
+ name: Optional[str]
12
+ event_types: Optional[List[str]]
10
13
 
11
14
 
12
15
  class WebhookEndpointResponse(BaseResponseModel):
@@ -14,4 +17,6 @@ class WebhookEndpointResponse(BaseResponseModel):
14
17
  lago_organization_id: str
15
18
  webhook_url: str
16
19
  signature_algo: Optional[str]
20
+ name: Optional[str]
21
+ event_types: Optional[List[str]]
17
22
  created_at: str
@@ -0,0 +1,74 @@
1
+ from typing import ClassVar, Optional, Type
2
+
3
+ import httpx
4
+
5
+ from ..base_client import BaseClient
6
+ from ..mixins import (
7
+ DEFAULT_TIMEOUT,
8
+ FindAllCommandMixin,
9
+ FindCommandMixin,
10
+ )
11
+ from ..models.order_form import OrderFormMarkAsSigned, OrderFormResponse
12
+ from ..services.json import to_json
13
+ from ..services.request import (
14
+ make_headers,
15
+ make_url,
16
+ send_post_request,
17
+ )
18
+ from ..services.response import Response, get_response_data, prepare_object_response
19
+
20
+
21
+ class OrderFormClient(
22
+ FindCommandMixin[OrderFormResponse],
23
+ FindAllCommandMixin[OrderFormResponse],
24
+ BaseClient,
25
+ ):
26
+ API_RESOURCE: ClassVar[str] = "order_forms"
27
+ RESPONSE_MODEL: ClassVar[Type[OrderFormResponse]] = OrderFormResponse
28
+ ROOT_NAME: ClassVar[str] = "order_form"
29
+
30
+ def mark_as_signed(
31
+ self,
32
+ resource_id: str,
33
+ input_object: Optional[OrderFormMarkAsSigned] = None,
34
+ timeout: Optional[httpx.Timeout] = DEFAULT_TIMEOUT,
35
+ ) -> OrderFormResponse:
36
+ """Record the customer's signature and create the order carrying the deal out."""
37
+ payload = input_object.dict(exclude_none=True) if input_object else {}
38
+
39
+ api_response: Response = send_post_request(
40
+ url=make_url(
41
+ origin=self.base_url,
42
+ path_parts=(self.API_RESOURCE, resource_id, "mark_as_signed"),
43
+ ),
44
+ content=to_json({self.ROOT_NAME: payload}) if payload else None,
45
+ headers=make_headers(api_key=self.api_key),
46
+ timeout=timeout,
47
+ rate_limit_retry_config=self.rate_limit_retry_config,
48
+ )
49
+
50
+ return prepare_object_response(
51
+ response_model=self.RESPONSE_MODEL,
52
+ data=get_response_data(response=api_response, key=self.ROOT_NAME),
53
+ )
54
+
55
+ def void(
56
+ self,
57
+ resource_id: str,
58
+ timeout: Optional[httpx.Timeout] = DEFAULT_TIMEOUT,
59
+ ) -> OrderFormResponse:
60
+ """Void a generated order form, cascading to the quote version it came from."""
61
+ api_response: Response = send_post_request(
62
+ url=make_url(
63
+ origin=self.base_url,
64
+ path_parts=(self.API_RESOURCE, resource_id, "void"),
65
+ ),
66
+ headers=make_headers(api_key=self.api_key),
67
+ timeout=timeout,
68
+ rate_limit_retry_config=self.rate_limit_retry_config,
69
+ )
70
+
71
+ return prepare_object_response(
72
+ response_model=self.RESPONSE_MODEL,
73
+ data=get_response_data(response=api_response, key=self.ROOT_NAME),
74
+ )
@@ -0,0 +1,53 @@
1
+ from typing import ClassVar, Optional, Type
2
+
3
+ import httpx
4
+
5
+ from ..base_client import BaseClient
6
+ from ..mixins import (
7
+ DEFAULT_TIMEOUT,
8
+ FindAllCommandMixin,
9
+ FindCommandMixin,
10
+ )
11
+ from ..models.order import OrderExecute, OrderResponse
12
+ from ..services.json import to_json
13
+ from ..services.request import (
14
+ make_headers,
15
+ make_url,
16
+ send_post_request,
17
+ )
18
+ from ..services.response import Response, get_response_data, prepare_object_response
19
+
20
+
21
+ class OrderClient(
22
+ FindCommandMixin[OrderResponse],
23
+ FindAllCommandMixin[OrderResponse],
24
+ BaseClient,
25
+ ):
26
+ API_RESOURCE: ClassVar[str] = "orders"
27
+ RESPONSE_MODEL: ClassVar[Type[OrderResponse]] = OrderResponse
28
+ ROOT_NAME: ClassVar[str] = "order"
29
+
30
+ def execute(
31
+ self,
32
+ resource_id: str,
33
+ input_object: Optional[OrderExecute] = None,
34
+ timeout: Optional[httpx.Timeout] = DEFAULT_TIMEOUT,
35
+ ) -> OrderResponse:
36
+ """Carry out an order on demand, without waiting for its schedule."""
37
+ payload = input_object.dict(exclude_none=True) if input_object else {}
38
+
39
+ api_response: Response = send_post_request(
40
+ url=make_url(
41
+ origin=self.base_url,
42
+ path_parts=(self.API_RESOURCE, resource_id, "execute"),
43
+ ),
44
+ content=to_json({self.ROOT_NAME: payload}) if payload else None,
45
+ headers=make_headers(api_key=self.api_key),
46
+ timeout=timeout,
47
+ rate_limit_retry_config=self.rate_limit_retry_config,
48
+ )
49
+
50
+ return prepare_object_response(
51
+ response_model=self.RESPONSE_MODEL,
52
+ data=get_response_data(response=api_response, key=self.ROOT_NAME),
53
+ )