lago-python-client 1.57.0__tar.gz → 1.57.1__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.
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/PKG-INFO +17 -1
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/README.md +16 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/__init__.py +2 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/fee.py +1 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/invoice.py +1 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/wallet.py +2 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/webhook_endpoint.py +7 -0
- lago_python_client-1.57.1/lago_python_client/v2/__init__.py +4 -0
- lago_python_client-1.57.1/lago_python_client/v2/base_client.py +135 -0
- lago_python_client-1.57.1/lago_python_client/v2/base_model.py +31 -0
- lago_python_client-1.57.1/lago_python_client/v2/client.py +210 -0
- lago_python_client-1.57.1/lago_python_client/v2/exceptions.py +29 -0
- lago_python_client-1.57.1/lago_python_client/v2/models.py +3173 -0
- lago_python_client-1.57.1/lago_python_client/v2/resources/__init__.py +1 -0
- lago_python_client-1.57.1/lago_python_client/v2/resources/activity_log.py +28 -0
- lago_python_client-1.57.1/lago_python_client/v2/resources/api_log.py +28 -0
- lago_python_client-1.57.1/lago_python_client/v2/resources/billable_metric.py +95 -0
- lago_python_client-1.57.1/lago_python_client/v2/resources/billing_entity.py +82 -0
- lago_python_client-1.57.1/lago_python_client/v2/resources/catalog_plan.py +74 -0
- lago_python_client-1.57.1/lago_python_client/v2/resources/contract.py +128 -0
- lago_python_client-1.57.1/lago_python_client/v2/resources/contract_alert.py +97 -0
- lago_python_client-1.57.1/lago_python_client/v2/resources/contract_applied_rate_card.py +109 -0
- lago_python_client-1.57.1/lago_python_client/v2/resources/contract_entitlement.py +73 -0
- lago_python_client-1.57.1/lago_python_client/v2/resources/contract_rate_phase.py +95 -0
- lago_python_client-1.57.1/lago_python_client/v2/resources/contract_wallet.py +109 -0
- lago_python_client-1.57.1/lago_python_client/v2/resources/contract_wallet_alert.py +109 -0
- lago_python_client-1.57.1/lago_python_client/v2/resources/contract_wallet_transaction.py +34 -0
- lago_python_client-1.57.1/lago_python_client/v2/resources/credit_note.py +226 -0
- lago_python_client-1.57.1/lago_python_client/v2/resources/customer.py +199 -0
- lago_python_client-1.57.1/lago_python_client/v2/resources/event.py +46 -0
- lago_python_client-1.57.1/lago_python_client/v2/resources/feature.py +83 -0
- lago_python_client-1.57.1/lago_python_client/v2/resources/feature_privilege.py +97 -0
- lago_python_client-1.57.1/lago_python_client/v2/resources/fee.py +64 -0
- lago_python_client-1.57.1/lago_python_client/v2/resources/invoice.py +182 -0
- lago_python_client-1.57.1/lago_python_client/v2/resources/organization.py +34 -0
- lago_python_client-1.57.1/lago_python_client/v2/resources/payment.py +44 -0
- lago_python_client-1.57.1/lago_python_client/v2/resources/payment_receipt.py +46 -0
- lago_python_client-1.57.1/lago_python_client/v2/resources/payment_request.py +46 -0
- lago_python_client-1.57.1/lago_python_client/v2/resources/plan_applied_rate_card.py +99 -0
- lago_python_client-1.57.1/lago_python_client/v2/resources/plan_entitlement.py +87 -0
- lago_python_client-1.57.1/lago_python_client/v2/resources/plan_rate_phase.py +83 -0
- lago_python_client-1.57.1/lago_python_client/v2/resources/plan_wallet.py +93 -0
- lago_python_client-1.57.1/lago_python_client/v2/resources/plan_wallet_alert.py +97 -0
- lago_python_client-1.57.1/lago_python_client/v2/resources/product.py +80 -0
- lago_python_client-1.57.1/lago_python_client/v2/resources/product_category.py +93 -0
- lago_python_client-1.57.1/lago_python_client/v2/resources/product_filter.py +93 -0
- lago_python_client-1.57.1/lago_python_client/v2/resources/rate_card.py +86 -0
- lago_python_client-1.57.1/lago_python_client/v2/resources/rate_card_rate.py +97 -0
- lago_python_client-1.57.1/lago_python_client/v2/resources/security_log.py +28 -0
- lago_python_client-1.57.1/lago_python_client/v2/resources/tax.py +72 -0
- lago_python_client-1.57.1/lago_python_client/v2/resources/webhook_endpoint.py +102 -0
- lago_python_client-1.57.1/lago_python_client/version.py +1 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client.egg-info/PKG-INFO +17 -1
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client.egg-info/SOURCES.txt +89 -60
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client.egg-info/top_level.txt +0 -1
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/setup.cfg +3 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_fee_client.py +1 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_invoice_client.py +19 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_wallet_client.py +34 -0
- lago_python_client-1.57.1/tests/test_webhook_endpoint_client.py +323 -0
- lago_python_client-1.57.0/lago_python_client/version.py +0 -1
- lago_python_client-1.57.0/tests/__init__.py +0 -0
- lago_python_client-1.57.0/tests/test_webhook_endpoint_client.py +0 -175
- lago_python_client-1.57.0/tests/utils/__init__.py +0 -0
- lago_python_client-1.57.0/tests/utils/mixin.py +0 -9
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/LICENSE +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/__init__.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/activity_logs/__init__.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/activity_logs/clients.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/add_ons/__init__.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/add_ons/clients.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/api_logs/__init__.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/api_logs/clients.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/base_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/base_model.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/billable_metrics/__init__.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/billable_metrics/clients.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/billing_entities/__init__.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/billing_entities/clients.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/coupons/__init__.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/coupons/clients.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/credit_notes/__init__.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/credit_notes/clients.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/customers/__init__.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/customers/applied_coupons_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/customers/clients.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/customers/credit_notes_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/customers/invoices_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/customers/payment_methods_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/customers/payment_requests_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/customers/payments_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/customers/subscriptions_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/customers/wallet_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/customers/wallets/__init__.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/customers/wallets/alert_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/customers/wallets/metadata_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/customers/wallets_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/events/__init__.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/events/clients.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/exceptions.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/fees/__init__.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/fees/clients.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/functools_ext.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/gross_revenues/__init__.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/gross_revenues/clients.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/invoice_collections/__init__.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/invoice_collections/clients.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/invoiced_usages/__init__.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/invoiced_usages/clients.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/invoices/__init__.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/invoices/clients.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/mixins.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/activity_log.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/add_on.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/alert.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/api_log.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/applied_coupon.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/billable_metric.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/billing_entity.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/billing_period.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/charge.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/coupon.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/credit.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/credit_note.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/customer.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/customer_projected_usage.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/customer_usage.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/entitlement.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/error_detail.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/event.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/fixed_charge.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/gross_revenue.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/invoice_collection.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/invoice_custom_section.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/invoice_item.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/invoiced_usage.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/lifetime_usage.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/minimum_commitment.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/mrr.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/order.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/order_form.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/organization.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/overdue_balance.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/payment.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/payment_method.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/payment_receipt.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/payment_request.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/plan.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/quote.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/subscription.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/tax.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/usage.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/usage_threshold.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/wallet_transaction.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/mrrs/__init__.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/mrrs/clients.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/observability.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/order_forms/__init__.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/order_forms/clients.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/orders/__init__.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/orders/clients.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/organizations/__init__.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/organizations/clients.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/overdue_balances/__init__.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/overdue_balances/clients.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/payment_receipts/__init__.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/payment_receipts/clients.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/payment_requests/__init__.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/payment_requests/clients.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/payments/__init__.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/payments/clients.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/plans/__init__.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/plans/charges_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/plans/clients.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/plans/fixed_charges_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/py.typed +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/quote_versions/__init__.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/quote_versions/clients.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/quotes/__init__.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/quotes/clients.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/services/__init__.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/services/json.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/services/rate_limit.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/services/request.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/services/response.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/subscriptions/__init__.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/subscriptions/alert_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/subscriptions/charges_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/subscriptions/clients.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/subscriptions/fixed_charges_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/taxes/__init__.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/taxes/clients.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/usages/__init__.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/usages/clients.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/wallets/__init__.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/wallets/clients.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/webhook_endpoints/__init__.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/webhook_endpoints/clients.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/webhooks/__init__.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/webhooks/clients.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client.egg-info/dependency_links.txt +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client.egg-info/requires.txt +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/pyproject.toml +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_activity_logs_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_add_on_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_alert_webhook_models.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_api_logs_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_applied_coupon_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_billable_metric_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_billing_entity_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_coupon_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_credit_note_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_customer_applied_coupons_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_customer_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_customer_credit_notes_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_customer_invoices_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_customer_payment_methods_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_customer_payment_requests_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_customer_payments_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_customer_sbscriptions_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_customer_wallet_alert_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_customer_wallet_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_customer_wallet_metadata_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_customer_wallets_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_event_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_find_all_children.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_functools_ext.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_gross_revenue_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_invoice_collection_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_invoiced_usage_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_json_services.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_mrr_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_order_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_order_form_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_organization_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_overdue_balance_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_payment_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_payment_receipt_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_payment_request_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_plan_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_quote_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_quote_version_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_rate_limit.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_request_services.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_response_services.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_subscription_alert_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_subscription_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_tax_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_usage_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_wallet_transaction_client.py +0 -0
- {lago_python_client-1.57.0 → lago_python_client-1.57.1}/tests/test_webhook_client.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lago-python-client
|
|
3
|
-
Version: 1.57.
|
|
3
|
+
Version: 1.57.1
|
|
4
4
|
Summary: Lago Python API Client
|
|
5
5
|
Home-page: https://github.com/getlago/lago-python-client
|
|
6
6
|
Author: Lovro Colic
|
|
@@ -61,6 +61,22 @@ Install the lago-python-client via pip from PyPI:
|
|
|
61
61
|
|
|
62
62
|
Check the [lago API reference](https://doc.getlago.com/docs/api/intro)
|
|
63
63
|
|
|
64
|
+
### API v2 (beta)
|
|
65
|
+
|
|
66
|
+
Use the v2 client and models for the native API v2 endpoints:
|
|
67
|
+
|
|
68
|
+
```python
|
|
69
|
+
from lago_python_client.v2 import Client, models
|
|
70
|
+
|
|
71
|
+
client = Client(api_key="your-api-key")
|
|
72
|
+
page = client.customers.find_all({"limit": 20})
|
|
73
|
+
customer = client.customers.find("customer-123", {"expands": ["taxes"]})
|
|
74
|
+
client.customers.patch(models.CustomerUpdate(name="Acme", description=None), "customer-123")
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
The existing `lago_python_client.Client` continues to use API v1.
|
|
78
|
+
See the [API v2 guide](docs/api-v2.md) for pagination, inputs, errors, and supported resources.
|
|
79
|
+
|
|
64
80
|
## Development
|
|
65
81
|
|
|
66
82
|
### Install the dependencies
|
|
@@ -26,6 +26,22 @@ Install the lago-python-client via pip from PyPI:
|
|
|
26
26
|
|
|
27
27
|
Check the [lago API reference](https://doc.getlago.com/docs/api/intro)
|
|
28
28
|
|
|
29
|
+
### API v2 (beta)
|
|
30
|
+
|
|
31
|
+
Use the v2 client and models for the native API v2 endpoints:
|
|
32
|
+
|
|
33
|
+
```python
|
|
34
|
+
from lago_python_client.v2 import Client, models
|
|
35
|
+
|
|
36
|
+
client = Client(api_key="your-api-key")
|
|
37
|
+
page = client.customers.find_all({"limit": 20})
|
|
38
|
+
customer = client.customers.find("customer-123", {"expands": ["taxes"]})
|
|
39
|
+
client.customers.patch(models.CustomerUpdate(name="Acme", description=None), "customer-123")
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
The existing `lago_python_client.Client` continues to use API v1.
|
|
43
|
+
See the [API v2 guide](docs/api-v2.md) for pagination, inputs, errors, and supported resources.
|
|
44
|
+
|
|
29
45
|
## Development
|
|
30
46
|
|
|
31
47
|
### Install the dependencies
|
{lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/__init__.py
RENAMED
|
@@ -354,3 +354,5 @@ from .wallet import (
|
|
|
354
354
|
)
|
|
355
355
|
from .wallet_transaction import WalletTransaction as WalletTransaction
|
|
356
356
|
from .webhook_endpoint import WebhookEndpoint as WebhookEndpoint
|
|
357
|
+
from .webhook_endpoint import WebhookEndpointResponse as WebhookEndpointResponse
|
|
358
|
+
from .webhook_endpoint import WebhookEndpointSigningKeyResponse as WebhookEndpointSigningKeyResponse
|
|
@@ -60,6 +60,7 @@ class FeeResponse(BaseResponseModel):
|
|
|
60
60
|
precise_amount: Optional[str]
|
|
61
61
|
precise_total_amount: Optional[str]
|
|
62
62
|
precise_coupons_amount_cents: Optional[str]
|
|
63
|
+
progressive_billing_credit_amount_cents: Optional[int]
|
|
63
64
|
taxes_precise_amount: Optional[str]
|
|
64
65
|
total_amount_currency: Optional[str]
|
|
65
66
|
units: Optional[str]
|
{lago_python_client-1.57.0 → lago_python_client-1.57.1}/lago_python_client/models/invoice.py
RENAMED
|
@@ -132,6 +132,7 @@ class InvoiceResponse(BaseResponseModel):
|
|
|
132
132
|
taxes_amount_cents: int
|
|
133
133
|
credit_notes_amount_cents: int
|
|
134
134
|
progressive_billing_credit_amount_cents: int
|
|
135
|
+
progressive_billing_trigger: Optional[str]
|
|
135
136
|
sub_total_excluding_taxes_amount_cents: int
|
|
136
137
|
sub_total_including_taxes_amount_cents: int
|
|
137
138
|
total_amount_cents: int
|
|
@@ -78,6 +78,7 @@ class Wallet(BaseModel):
|
|
|
78
78
|
transaction_name: Optional[str]
|
|
79
79
|
applies_to: Optional[AppliesTo]
|
|
80
80
|
invoice_requires_successful_payment: Optional[bool]
|
|
81
|
+
invoice_usage_on_expiration: Optional[bool]
|
|
81
82
|
paid_top_up_max_amount_cents: Optional[int]
|
|
82
83
|
paid_top_up_min_amount_cents: Optional[int]
|
|
83
84
|
ignore_paid_top_up_limits_on_creation: Optional[bool]
|
|
@@ -113,6 +114,7 @@ class WalletResponse(BaseResponseModel):
|
|
|
113
114
|
credits_ongoing_usage_balance: str
|
|
114
115
|
applies_to: Optional[AppliesTo]
|
|
115
116
|
invoice_requires_successful_payment: Optional[bool]
|
|
117
|
+
invoice_usage_on_expiration: Optional[bool]
|
|
116
118
|
paid_top_up_max_amount_cents: Optional[int]
|
|
117
119
|
paid_top_up_min_amount_cents: Optional[int]
|
|
118
120
|
metadata: Optional[Dict[str, Optional[str]]]
|
|
@@ -12,6 +12,12 @@ class WebhookEndpoint(BaseModel):
|
|
|
12
12
|
event_types: Optional[List[str]]
|
|
13
13
|
|
|
14
14
|
|
|
15
|
+
class WebhookEndpointSigningKeyResponse(BaseModel):
|
|
16
|
+
lago_id: str
|
|
17
|
+
secret_key: str
|
|
18
|
+
created_at: str
|
|
19
|
+
|
|
20
|
+
|
|
15
21
|
class WebhookEndpointResponse(BaseResponseModel):
|
|
16
22
|
lago_id: str
|
|
17
23
|
lago_organization_id: str
|
|
@@ -20,3 +26,4 @@ class WebhookEndpointResponse(BaseResponseModel):
|
|
|
20
26
|
name: Optional[str]
|
|
21
27
|
event_types: Optional[List[str]]
|
|
22
28
|
created_at: str
|
|
29
|
+
signing_keys: Optional[List[WebhookEndpointSigningKeyResponse]]
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import re
|
|
3
|
+
from collections.abc import Mapping, Sequence
|
|
4
|
+
from typing import Any, Optional, Type, TypeVar, Union
|
|
5
|
+
from urllib.parse import quote, urlencode
|
|
6
|
+
|
|
7
|
+
import httpx
|
|
8
|
+
|
|
9
|
+
from lago_python_client.base_model import BaseModel
|
|
10
|
+
from lago_python_client.exceptions import LagoRateLimitError
|
|
11
|
+
from lago_python_client.services.rate_limit import (
|
|
12
|
+
emit_rate_limit_info,
|
|
13
|
+
handle_rate_limit_response,
|
|
14
|
+
wait_for_retry,
|
|
15
|
+
)
|
|
16
|
+
from lago_python_client.services.request import make_headers
|
|
17
|
+
|
|
18
|
+
from .exceptions import ApiError, RateLimitError, ResponseDecodeError
|
|
19
|
+
|
|
20
|
+
Input = Union[BaseModel, Mapping[str, Any], Sequence[Any]]
|
|
21
|
+
Query = Optional[Union[Mapping[str, Any], Sequence[tuple[str, Any]]]]
|
|
22
|
+
Model = TypeVar("Model", bound=BaseModel)
|
|
23
|
+
DEFAULT_TIMEOUT = httpx.Timeout(10.0)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def serialize(value: Any) -> Any:
|
|
27
|
+
"""Omit unset model attributes and preserve explicitly supplied null values."""
|
|
28
|
+
if isinstance(value, BaseModel):
|
|
29
|
+
return serialize(value.dict(by_alias=True, exclude_unset=True))
|
|
30
|
+
if isinstance(value, Mapping):
|
|
31
|
+
return {key: serialize(item) for key, item in value.items()}
|
|
32
|
+
if isinstance(value, (list, tuple)):
|
|
33
|
+
return [serialize(item) for item in value]
|
|
34
|
+
return value
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def query_pairs(options: Query, prefix: Optional[str] = None) -> list[tuple[str, Any]]:
|
|
38
|
+
pairs = []
|
|
39
|
+
items = options.items() if isinstance(options, Mapping) else options or []
|
|
40
|
+
for key, value in items:
|
|
41
|
+
name = f"{prefix}[{key}]" if prefix else str(key)
|
|
42
|
+
if isinstance(value, Mapping):
|
|
43
|
+
pairs.extend(query_pairs(value, name))
|
|
44
|
+
elif isinstance(value, (list, tuple)):
|
|
45
|
+
array_key = name if name.endswith("[]") else f"{name}[]"
|
|
46
|
+
pairs.extend((array_key, item) for item in value)
|
|
47
|
+
elif value is not None:
|
|
48
|
+
pairs.append((name, str(value).lower() if isinstance(value, bool) else value))
|
|
49
|
+
return pairs
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class BaseClient:
|
|
53
|
+
def __init__(self, client: Any, **path_params: str):
|
|
54
|
+
self.client = client
|
|
55
|
+
self.path_params = path_params
|
|
56
|
+
|
|
57
|
+
def _url(self, path: str, options: Query, identifiers: Mapping[str, str]) -> str:
|
|
58
|
+
values = {**self.path_params, **identifiers}
|
|
59
|
+
|
|
60
|
+
def replace(match: re.Match) -> str:
|
|
61
|
+
value = values[match.group(1)]
|
|
62
|
+
if value is None or not str(value):
|
|
63
|
+
raise ValueError("Path identifiers must not be empty")
|
|
64
|
+
# Rails can interpret a period as a format separator, including in metadata keys.
|
|
65
|
+
return quote(str(value), safe="").replace(".", "%2E")
|
|
66
|
+
|
|
67
|
+
url = self.client.base_api_url + re.sub(r"\{([^}]+)\}", replace, path).lstrip("/")
|
|
68
|
+
pairs = query_pairs(options)
|
|
69
|
+
return f"{url}?{urlencode(pairs)}" if pairs else url
|
|
70
|
+
|
|
71
|
+
def _request(
|
|
72
|
+
self,
|
|
73
|
+
method: str,
|
|
74
|
+
path: str,
|
|
75
|
+
response_model: Optional[Type[Model]],
|
|
76
|
+
*,
|
|
77
|
+
input_object: Optional[Input] = None,
|
|
78
|
+
body_root: Optional[str] = None,
|
|
79
|
+
result_key: Optional[str] = None,
|
|
80
|
+
options: Query = None,
|
|
81
|
+
timeout: Optional[httpx.Timeout] = DEFAULT_TIMEOUT,
|
|
82
|
+
**identifiers: str,
|
|
83
|
+
) -> Any:
|
|
84
|
+
url = self._url(path, options, identifiers)
|
|
85
|
+
body = serialize(input_object)
|
|
86
|
+
if body_root and input_object is not None:
|
|
87
|
+
body = {body_root: body}
|
|
88
|
+
content = json.dumps(body, allow_nan=False).encode() if body is not None else None
|
|
89
|
+
attempt = 0
|
|
90
|
+
config = self.client.rate_limit_retry_config
|
|
91
|
+
while True:
|
|
92
|
+
response = httpx.request(
|
|
93
|
+
method, url, headers=make_headers(api_key=self.client.api_key), content=content, timeout=timeout
|
|
94
|
+
)
|
|
95
|
+
if response.status_code != 429:
|
|
96
|
+
emit_rate_limit_info(response, config, method=method, url=url)
|
|
97
|
+
break
|
|
98
|
+
try:
|
|
99
|
+
delay = handle_rate_limit_response(response, config, attempt)
|
|
100
|
+
except LagoRateLimitError:
|
|
101
|
+
raise self._error(response, RateLimitError) from None
|
|
102
|
+
wait_for_retry(delay)
|
|
103
|
+
attempt += 1
|
|
104
|
+
|
|
105
|
+
if not response.is_success:
|
|
106
|
+
raise self._error(response, ApiError)
|
|
107
|
+
if not response.content.strip():
|
|
108
|
+
return None
|
|
109
|
+
try:
|
|
110
|
+
data = response.json()
|
|
111
|
+
if response_model is None:
|
|
112
|
+
return data
|
|
113
|
+
parsed = response_model.parse_obj(data)
|
|
114
|
+
except ValueError as error:
|
|
115
|
+
raise ResponseDecodeError(
|
|
116
|
+
response.status_code,
|
|
117
|
+
str(response.request.url),
|
|
118
|
+
response.text,
|
|
119
|
+
detail="Could not decode API v2 response",
|
|
120
|
+
headers=response.headers,
|
|
121
|
+
) from error
|
|
122
|
+
if result_key:
|
|
123
|
+
return getattr(parsed, result_key)
|
|
124
|
+
result = dict(parsed.__dict__)
|
|
125
|
+
if "meta" in result and isinstance(result["meta"], BaseModel):
|
|
126
|
+
result["meta"] = result["meta"].dict(by_alias=True, exclude_unset=True)
|
|
127
|
+
return result
|
|
128
|
+
|
|
129
|
+
@staticmethod
|
|
130
|
+
def _error(response: httpx.Response, error_class: Type[ApiError]) -> ApiError:
|
|
131
|
+
try:
|
|
132
|
+
body = response.json()
|
|
133
|
+
except ValueError:
|
|
134
|
+
body = response.text
|
|
135
|
+
return error_class(response.status_code, str(response.request.url), body, headers=response.headers)
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
from lago_python_client.base_model import BaseModel
|
|
2
|
+
|
|
3
|
+
try:
|
|
4
|
+
from pydantic.v1 import Field, StrictBool, StrictFloat, StrictInt, StrictStr, root_validator
|
|
5
|
+
except ImportError:
|
|
6
|
+
from pydantic import Field, StrictBool, StrictFloat, StrictInt, StrictStr, root_validator
|
|
7
|
+
|
|
8
|
+
__all__ = [
|
|
9
|
+
"Field",
|
|
10
|
+
"StrictBool",
|
|
11
|
+
"StrictFloat",
|
|
12
|
+
"StrictInt",
|
|
13
|
+
"StrictStr",
|
|
14
|
+
"V2Model",
|
|
15
|
+
"V2ResponseModel",
|
|
16
|
+
"root_validator",
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class V2Model(BaseModel):
|
|
21
|
+
"""Shared configuration for the OpenAPI v2 models."""
|
|
22
|
+
|
|
23
|
+
class Config:
|
|
24
|
+
extra = "allow"
|
|
25
|
+
allow_population_by_field_name = True
|
|
26
|
+
smart_union = True
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class V2ResponseModel(V2Model):
|
|
30
|
+
class Config(V2Model.Config):
|
|
31
|
+
frozen = True
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
"""Client for the native API v2 endpoints."""
|
|
2
|
+
|
|
3
|
+
from typing import Optional
|
|
4
|
+
from urllib.parse import urljoin
|
|
5
|
+
|
|
6
|
+
from lago_python_client.services.rate_limit import RateLimitCallback, RateLimitRetryConfig
|
|
7
|
+
|
|
8
|
+
from .resources.activity_log import ActivityLogClient
|
|
9
|
+
from .resources.api_log import ApiLogClient
|
|
10
|
+
from .resources.billable_metric import BillableMetricClient
|
|
11
|
+
from .resources.billing_entity import BillingEntityClient
|
|
12
|
+
from .resources.catalog_plan import CatalogPlanClient
|
|
13
|
+
from .resources.contract import ContractClient
|
|
14
|
+
from .resources.contract_alert import ContractAlertClient
|
|
15
|
+
from .resources.contract_applied_rate_card import ContractAppliedRateCardClient
|
|
16
|
+
from .resources.contract_entitlement import ContractEntitlementClient
|
|
17
|
+
from .resources.contract_rate_phase import ContractRatePhaseClient
|
|
18
|
+
from .resources.contract_wallet import ContractWalletClient
|
|
19
|
+
from .resources.contract_wallet_alert import ContractWalletAlertClient
|
|
20
|
+
from .resources.contract_wallet_transaction import ContractWalletTransactionClient
|
|
21
|
+
from .resources.credit_note import CreditNoteClient
|
|
22
|
+
from .resources.customer import CustomerClient
|
|
23
|
+
from .resources.event import EventClient
|
|
24
|
+
from .resources.feature import FeatureClient
|
|
25
|
+
from .resources.feature_privilege import FeaturePrivilegeClient
|
|
26
|
+
from .resources.fee import FeeClient
|
|
27
|
+
from .resources.invoice import InvoiceClient
|
|
28
|
+
from .resources.organization import OrganizationClient
|
|
29
|
+
from .resources.payment import PaymentClient
|
|
30
|
+
from .resources.payment_receipt import PaymentReceiptClient
|
|
31
|
+
from .resources.payment_request import PaymentRequestClient
|
|
32
|
+
from .resources.plan_applied_rate_card import PlanAppliedRateCardClient
|
|
33
|
+
from .resources.plan_entitlement import PlanEntitlementClient
|
|
34
|
+
from .resources.plan_rate_phase import PlanRatePhaseClient
|
|
35
|
+
from .resources.plan_wallet import PlanWalletClient
|
|
36
|
+
from .resources.plan_wallet_alert import PlanWalletAlertClient
|
|
37
|
+
from .resources.product import ProductClient
|
|
38
|
+
from .resources.product_category import ProductCategoryClient
|
|
39
|
+
from .resources.product_filter import ProductFilterClient
|
|
40
|
+
from .resources.rate_card import RateCardClient
|
|
41
|
+
from .resources.rate_card_rate import RateCardRateClient
|
|
42
|
+
from .resources.security_log import SecurityLogClient
|
|
43
|
+
from .resources.tax import TaxClient
|
|
44
|
+
from .resources.webhook_endpoint import WebhookEndpointClient
|
|
45
|
+
|
|
46
|
+
OPENAPI_REVISION = "7991669dbcb1b97b6fa841b1e8114efe97d0a9b3"
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class Client:
|
|
50
|
+
BASE_URL = "https://api.getlago.com/"
|
|
51
|
+
API_PATH = "api/v2/"
|
|
52
|
+
|
|
53
|
+
def __init__(
|
|
54
|
+
self,
|
|
55
|
+
api_key: str = "",
|
|
56
|
+
api_url: str = "",
|
|
57
|
+
max_retries: int = 3,
|
|
58
|
+
retry_on_rate_limit: bool = True,
|
|
59
|
+
on_rate_limit_info: Optional[RateLimitCallback] = None,
|
|
60
|
+
):
|
|
61
|
+
self.api_key = api_key
|
|
62
|
+
self.api_url = api_url
|
|
63
|
+
self.rate_limit_retry_config = RateLimitRetryConfig(
|
|
64
|
+
max_retries=max_retries, retry_on_rate_limit=retry_on_rate_limit, on_rate_limit_info=on_rate_limit_info
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
@property
|
|
68
|
+
def base_api_url(self) -> str:
|
|
69
|
+
return urljoin(self.api_url or self.BASE_URL, self.API_PATH)
|
|
70
|
+
|
|
71
|
+
@property
|
|
72
|
+
def taxes(self) -> TaxClient:
|
|
73
|
+
return TaxClient(self)
|
|
74
|
+
|
|
75
|
+
@property
|
|
76
|
+
def product_categories(self) -> ProductCategoryClient:
|
|
77
|
+
return ProductCategoryClient(self)
|
|
78
|
+
|
|
79
|
+
@property
|
|
80
|
+
def products(self) -> ProductClient:
|
|
81
|
+
return ProductClient(self)
|
|
82
|
+
|
|
83
|
+
def product_filters(self, product_code: str) -> ProductFilterClient:
|
|
84
|
+
return ProductFilterClient(self, product_code=product_code)
|
|
85
|
+
|
|
86
|
+
@property
|
|
87
|
+
def rate_cards(self) -> RateCardClient:
|
|
88
|
+
return RateCardClient(self)
|
|
89
|
+
|
|
90
|
+
def rate_card_rates(self, rate_card_code: str) -> RateCardRateClient:
|
|
91
|
+
return RateCardRateClient(self, rate_card_code=rate_card_code)
|
|
92
|
+
|
|
93
|
+
@property
|
|
94
|
+
def plans(self) -> CatalogPlanClient:
|
|
95
|
+
return CatalogPlanClient(self)
|
|
96
|
+
|
|
97
|
+
def plan_applied_rate_cards(self, plan_code: str) -> PlanAppliedRateCardClient:
|
|
98
|
+
return PlanAppliedRateCardClient(self, plan_code=plan_code)
|
|
99
|
+
|
|
100
|
+
def plan_rate_phases(self, plan_code: str, applied_rate_card_code: str) -> PlanRatePhaseClient:
|
|
101
|
+
return PlanRatePhaseClient(self, plan_code=plan_code, applied_rate_card_code=applied_rate_card_code)
|
|
102
|
+
|
|
103
|
+
def contract_applied_rate_cards(self, contract_external_id: str) -> ContractAppliedRateCardClient:
|
|
104
|
+
return ContractAppliedRateCardClient(self, contract_external_id=contract_external_id)
|
|
105
|
+
|
|
106
|
+
def contract_rate_phases(self, contract_external_id: str, applied_rate_card_code: str) -> ContractRatePhaseClient:
|
|
107
|
+
return ContractRatePhaseClient(
|
|
108
|
+
self, contract_external_id=contract_external_id, applied_rate_card_code=applied_rate_card_code
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
@property
|
|
112
|
+
def contracts(self) -> ContractClient:
|
|
113
|
+
return ContractClient(self)
|
|
114
|
+
|
|
115
|
+
@property
|
|
116
|
+
def invoices(self) -> InvoiceClient:
|
|
117
|
+
return InvoiceClient(self)
|
|
118
|
+
|
|
119
|
+
@property
|
|
120
|
+
def fees(self) -> FeeClient:
|
|
121
|
+
return FeeClient(self)
|
|
122
|
+
|
|
123
|
+
@property
|
|
124
|
+
def payments(self) -> PaymentClient:
|
|
125
|
+
return PaymentClient(self)
|
|
126
|
+
|
|
127
|
+
@property
|
|
128
|
+
def payment_requests(self) -> PaymentRequestClient:
|
|
129
|
+
return PaymentRequestClient(self)
|
|
130
|
+
|
|
131
|
+
@property
|
|
132
|
+
def payment_receipts(self) -> PaymentReceiptClient:
|
|
133
|
+
return PaymentReceiptClient(self)
|
|
134
|
+
|
|
135
|
+
@property
|
|
136
|
+
def credit_notes(self) -> CreditNoteClient:
|
|
137
|
+
return CreditNoteClient(self)
|
|
138
|
+
|
|
139
|
+
@property
|
|
140
|
+
def customers(self) -> CustomerClient:
|
|
141
|
+
return CustomerClient(self)
|
|
142
|
+
|
|
143
|
+
@property
|
|
144
|
+
def organizations(self) -> OrganizationClient:
|
|
145
|
+
return OrganizationClient(self)
|
|
146
|
+
|
|
147
|
+
@property
|
|
148
|
+
def billing_entities(self) -> BillingEntityClient:
|
|
149
|
+
return BillingEntityClient(self)
|
|
150
|
+
|
|
151
|
+
@property
|
|
152
|
+
def billable_metrics(self) -> BillableMetricClient:
|
|
153
|
+
return BillableMetricClient(self)
|
|
154
|
+
|
|
155
|
+
@property
|
|
156
|
+
def events(self) -> EventClient:
|
|
157
|
+
return EventClient(self)
|
|
158
|
+
|
|
159
|
+
@property
|
|
160
|
+
def activity_logs(self) -> ActivityLogClient:
|
|
161
|
+
return ActivityLogClient(self)
|
|
162
|
+
|
|
163
|
+
@property
|
|
164
|
+
def api_logs(self) -> ApiLogClient:
|
|
165
|
+
return ApiLogClient(self)
|
|
166
|
+
|
|
167
|
+
@property
|
|
168
|
+
def security_logs(self) -> SecurityLogClient:
|
|
169
|
+
return SecurityLogClient(self)
|
|
170
|
+
|
|
171
|
+
@property
|
|
172
|
+
def webhook_endpoints(self) -> WebhookEndpointClient:
|
|
173
|
+
return WebhookEndpointClient(self)
|
|
174
|
+
|
|
175
|
+
@property
|
|
176
|
+
def features(self) -> FeatureClient:
|
|
177
|
+
return FeatureClient(self)
|
|
178
|
+
|
|
179
|
+
def feature_privileges(self, feature_code: str) -> FeaturePrivilegeClient:
|
|
180
|
+
return FeaturePrivilegeClient(self, feature_code=feature_code)
|
|
181
|
+
|
|
182
|
+
def plan_wallets(self, plan_code: str) -> PlanWalletClient:
|
|
183
|
+
return PlanWalletClient(self, plan_code=plan_code)
|
|
184
|
+
|
|
185
|
+
def contract_wallets(self, contract_external_id: str) -> ContractWalletClient:
|
|
186
|
+
return ContractWalletClient(self, contract_external_id=contract_external_id)
|
|
187
|
+
|
|
188
|
+
def contract_wallet_transactions(
|
|
189
|
+
self, contract_external_id: str, wallet_code: str
|
|
190
|
+
) -> ContractWalletTransactionClient:
|
|
191
|
+
return ContractWalletTransactionClient(self, contract_external_id=contract_external_id, wallet_code=wallet_code)
|
|
192
|
+
|
|
193
|
+
def plan_wallet_alerts(self, plan_code: str, wallet_code: str) -> PlanWalletAlertClient:
|
|
194
|
+
return PlanWalletAlertClient(self, plan_code=plan_code, wallet_code=wallet_code)
|
|
195
|
+
|
|
196
|
+
def contract_wallet_alerts(self, contract_external_id: str, wallet_code: str) -> ContractWalletAlertClient:
|
|
197
|
+
return ContractWalletAlertClient(self, contract_external_id=contract_external_id, wallet_code=wallet_code)
|
|
198
|
+
|
|
199
|
+
def contract_alerts(self, contract_external_id: str) -> ContractAlertClient:
|
|
200
|
+
return ContractAlertClient(self, contract_external_id=contract_external_id)
|
|
201
|
+
|
|
202
|
+
def plan_entitlements(self, plan_code: str) -> PlanEntitlementClient:
|
|
203
|
+
return PlanEntitlementClient(self, plan_code=plan_code)
|
|
204
|
+
|
|
205
|
+
def contract_entitlements(self, contract_external_id: str) -> ContractEntitlementClient:
|
|
206
|
+
return ContractEntitlementClient(self, contract_external_id=contract_external_id)
|
|
207
|
+
|
|
208
|
+
@property
|
|
209
|
+
def catalog_plans(self) -> CatalogPlanClient:
|
|
210
|
+
return self.plans
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
from typing import Any, Optional
|
|
2
|
+
|
|
3
|
+
from lago_python_client.exceptions import LagoApiError, LagoRateLimitError
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class ApiError(LagoApiError):
|
|
7
|
+
"""An HTTP failure from API v2, including its structured error details."""
|
|
8
|
+
|
|
9
|
+
def __init__(
|
|
10
|
+
self,
|
|
11
|
+
status_code: int,
|
|
12
|
+
url: Optional[str],
|
|
13
|
+
response: Any,
|
|
14
|
+
detail: Optional[str] = None,
|
|
15
|
+
headers: Any = None,
|
|
16
|
+
):
|
|
17
|
+
body = response if isinstance(response, dict) else {}
|
|
18
|
+
self.code: Optional[str] = body.get("code")
|
|
19
|
+
details = body.get("details", [])
|
|
20
|
+
self.details: list[dict[str, Any]] = details if isinstance(details, list) else []
|
|
21
|
+
super().__init__(status_code, url, response, detail or self.code or f"HTTP {status_code}", headers)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class ResponseDecodeError(ApiError):
|
|
25
|
+
"""A successful HTTP response that the client could not decode."""
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class RateLimitError(LagoRateLimitError, ApiError):
|
|
29
|
+
"""A v2 HTTP 429 failure after retries are disabled or exhausted."""
|