lago-python-client 1.34.0__tar.gz → 1.40.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.
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/PKG-INFO +1 -1
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/credit_notes/clients.py +53 -1
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/__init__.py +10 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/billing_entity.py +4 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/credit_note.py +6 -1
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/customer.py +2 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/customer_usage.py +4 -1
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/event.py +2 -2
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/fee.py +3 -1
- lago_python_client-1.40.0/lago_python_client/models/fixed_charge.py +80 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/plan.py +14 -1
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/wallet.py +11 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/wallet_transaction.py +1 -0
- lago_python_client-1.40.0/lago_python_client/plans/clients.py +83 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/services/request.py +1 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/subscriptions/clients.py +18 -1
- lago_python_client-1.40.0/lago_python_client/version.py +1 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/wallets/clients.py +60 -2
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client.egg-info/PKG-INFO +1 -1
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client.egg-info/SOURCES.txt +2 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_billing_entity_client.py +4 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_credit_note_client.py +65 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_customer_client.py +4 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_event_client.py +24 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_fee_client.py +21 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_plan_client.py +122 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_subscription_client.py +104 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_wallet_client.py +78 -0
- lago_python_client-1.34.0/lago_python_client/plans/clients.py +0 -24
- lago_python_client-1.34.0/lago_python_client/version.py +0 -1
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/LICENSE +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/README.md +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/__init__.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/activity_logs/__init__.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/activity_logs/clients.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/add_ons/__init__.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/add_ons/clients.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/api_logs/__init__.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/api_logs/clients.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/base_client.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/base_model.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/billable_metrics/__init__.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/billable_metrics/clients.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/billing_entities/__init__.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/billing_entities/clients.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/client.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/coupons/__init__.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/coupons/clients.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/credit_notes/__init__.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/customers/__init__.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/customers/applied_coupons_client.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/customers/clients.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/customers/credit_notes_client.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/customers/invoices_client.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/customers/payment_requests_client.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/customers/payments_client.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/customers/subscriptions_client.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/customers/wallets_client.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/events/__init__.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/events/clients.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/exceptions.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/fees/__init__.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/fees/clients.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/functools_ext.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/gross_revenues/__init__.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/gross_revenues/clients.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/invoice_collections/__init__.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/invoice_collections/clients.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/invoiced_usages/__init__.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/invoiced_usages/clients.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/invoices/__init__.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/invoices/clients.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/mixins.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/activity_log.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/add_on.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/api_log.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/applied_coupon.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/billable_metric.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/billing_period.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/charge.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/coupon.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/credit.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/customer_projected_usage.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/error_detail.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/gross_revenue.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/invoice.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/invoice_collection.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/invoice_custom_section.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/invoice_item.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/invoiced_usage.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/lifetime_usage.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/minimum_commitment.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/mrr.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/organization.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/overdue_balance.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/payment.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/payment_receipt.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/payment_request.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/subscription.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/tax.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/usage.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/usage_threshold.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/webhook_endpoint.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/mrrs/__init__.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/mrrs/clients.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/organizations/__init__.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/organizations/clients.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/overdue_balances/__init__.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/overdue_balances/clients.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/payment_receipts/__init__.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/payment_receipts/clients.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/payment_requests/__init__.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/payment_requests/clients.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/payments/__init__.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/payments/clients.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/plans/__init__.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/py.typed +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/services/__init__.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/services/json.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/services/response.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/subscriptions/__init__.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/taxes/__init__.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/taxes/clients.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/usages/__init__.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/usages/clients.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/wallets/__init__.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/webhook_endpoints/__init__.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/webhook_endpoints/clients.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/webhooks/__init__.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/webhooks/clients.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client.egg-info/dependency_links.txt +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client.egg-info/requires.txt +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client.egg-info/top_level.txt +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/pyproject.toml +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/setup.cfg +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/__init__.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_activity_logs_client.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_add_on_client.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_api_logs_client.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_applied_coupon_client.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_billable_metric_client.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_client.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_coupon_client.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_customer_applied_coupons_client.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_customer_credit_notes_client.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_customer_invoices_client.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_customer_payment_requests_client.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_customer_payments_client.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_customer_sbscriptions_client.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_customer_wallets_client.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_functools_ext.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_gross_revenue_client.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_invoice_client.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_invoice_collection_client.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_invoiced_usage_client.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_json_services.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_mrr_client.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_organization_client.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_overdue_balance_client.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_payment_client.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_payment_receipt_client.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_payment_request_client.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_request_services.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_response_services.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_tax_client.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_usage_client.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_wallet_transaction_client.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_webhook_client.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/test_webhook_endpoint_client.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/utils/__init__.py +0 -0
- {lago_python_client-1.34.0 → lago_python_client-1.40.0}/tests/utils/mixin.py +0 -0
{lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/credit_notes/clients.py
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import ClassVar, Optional, Type
|
|
1
|
+
from typing import ClassVar, Dict, Optional, Type
|
|
2
2
|
|
|
3
3
|
from ..base_client import BaseClient
|
|
4
4
|
from ..mixins import (
|
|
@@ -16,6 +16,8 @@ from ..services.json import to_json
|
|
|
16
16
|
from ..services.request import (
|
|
17
17
|
make_headers,
|
|
18
18
|
make_url,
|
|
19
|
+
send_delete_request,
|
|
20
|
+
send_patch_request,
|
|
19
21
|
send_post_request,
|
|
20
22
|
send_put_request,
|
|
21
23
|
)
|
|
@@ -84,3 +86,53 @@ class CreditNoteClient(
|
|
|
84
86
|
response_model=CreditNoteEstimatedResponse,
|
|
85
87
|
data=get_response_data(response=api_response, key=self.ESTIMATE_API_RESOURCE),
|
|
86
88
|
)
|
|
89
|
+
|
|
90
|
+
def replace_metadata(
|
|
91
|
+
self, resource_id: str, metadata: Dict[str, Optional[str]]
|
|
92
|
+
) -> Optional[Dict[str, Optional[str]]]:
|
|
93
|
+
api_response: Response = send_post_request(
|
|
94
|
+
url=make_url(
|
|
95
|
+
origin=self.base_url,
|
|
96
|
+
path_parts=(self.API_RESOURCE, resource_id, "metadata"),
|
|
97
|
+
),
|
|
98
|
+
content=to_json({"metadata": metadata}),
|
|
99
|
+
headers=make_headers(api_key=self.api_key),
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
return get_response_data(response=api_response, key="metadata")
|
|
103
|
+
|
|
104
|
+
def merge_metadata(
|
|
105
|
+
self, resource_id: str, metadata: Dict[str, Optional[str]]
|
|
106
|
+
) -> Optional[Dict[str, Optional[str]]]:
|
|
107
|
+
api_response: Response = send_patch_request(
|
|
108
|
+
url=make_url(
|
|
109
|
+
origin=self.base_url,
|
|
110
|
+
path_parts=(self.API_RESOURCE, resource_id, "metadata"),
|
|
111
|
+
),
|
|
112
|
+
content=to_json({"metadata": metadata}),
|
|
113
|
+
headers=make_headers(api_key=self.api_key),
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
return get_response_data(response=api_response, key="metadata")
|
|
117
|
+
|
|
118
|
+
def delete_all_metadata(self, resource_id: str) -> Optional[Dict[str, Optional[str]]]:
|
|
119
|
+
api_response: Response = send_delete_request(
|
|
120
|
+
url=make_url(
|
|
121
|
+
origin=self.base_url,
|
|
122
|
+
path_parts=(self.API_RESOURCE, resource_id, "metadata"),
|
|
123
|
+
),
|
|
124
|
+
headers=make_headers(api_key=self.api_key),
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
return get_response_data(response=api_response, key="metadata")
|
|
128
|
+
|
|
129
|
+
def delete_metadata_key(self, resource_id: str, key: str) -> Optional[Dict[str, Optional[str]]]:
|
|
130
|
+
api_response: Response = send_delete_request(
|
|
131
|
+
url=make_url(
|
|
132
|
+
origin=self.base_url,
|
|
133
|
+
path_parts=(self.API_RESOURCE, resource_id, "metadata", key),
|
|
134
|
+
),
|
|
135
|
+
headers=make_headers(api_key=self.api_key),
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
return get_response_data(response=api_response, key="metadata")
|
{lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/__init__.py
RENAMED
|
@@ -27,6 +27,16 @@ from .charge import (
|
|
|
27
27
|
ChargeFilter as ChargeFilter,
|
|
28
28
|
)
|
|
29
29
|
from .coupon import Coupon as Coupon, CouponsList as CouponsList, LimitationConfiguration as LimitationConfiguration
|
|
30
|
+
from .fixed_charge import (
|
|
31
|
+
FixedCharge as FixedCharge,
|
|
32
|
+
FixedCharges as FixedCharges,
|
|
33
|
+
FixedChargeResponse as FixedChargeResponse,
|
|
34
|
+
FixedChargesResponse as FixedChargesResponse,
|
|
35
|
+
FixedChargeProperties as FixedChargeProperties,
|
|
36
|
+
FixedChargeGraduatedRange as FixedChargeGraduatedRange,
|
|
37
|
+
FixedChargeOverrides as FixedChargeOverrides,
|
|
38
|
+
FixedChargesOverrides as FixedChargesOverrides,
|
|
39
|
+
)
|
|
30
40
|
from .credit import CreditResponse as CreditResponse, CreditsResponse as CreditsResponse
|
|
31
41
|
from .credit_note import (
|
|
32
42
|
Item as Item,
|
{lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/billing_entity.py
RENAMED
|
@@ -9,6 +9,8 @@ from .invoice_custom_section import InvoiceCustomSectionsResponseList
|
|
|
9
9
|
class BillingEntityBillingConfiguration(BaseModel):
|
|
10
10
|
invoice_footer: Optional[str]
|
|
11
11
|
invoice_grace_period: Optional[int]
|
|
12
|
+
subscription_invoice_issuing_date_anchor: Optional[str]
|
|
13
|
+
subscription_invoice_issuing_date_adjustment: Optional[str]
|
|
12
14
|
document_locale: Optional[str]
|
|
13
15
|
|
|
14
16
|
|
|
@@ -93,6 +95,8 @@ class BillingEntityResponse(BaseResponseModel):
|
|
|
93
95
|
document_locale: Optional[str]
|
|
94
96
|
invoice_footer: Optional[str]
|
|
95
97
|
invoice_grace_period: Optional[int]
|
|
98
|
+
subscription_invoice_issuing_date_anchor: Optional[str]
|
|
99
|
+
subscription_invoice_issuing_date_adjustment: Optional[str]
|
|
96
100
|
email_settings: Optional[List[str]]
|
|
97
101
|
taxes: Optional[TaxesResponse]
|
|
98
102
|
selected_invoice_custom_sections: Optional[InvoiceCustomSectionsResponseList]
|
{lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/credit_note.py
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import List, Optional
|
|
1
|
+
from typing import Dict, List, Optional
|
|
2
2
|
|
|
3
3
|
from lago_python_client.base_model import BaseModel
|
|
4
4
|
|
|
@@ -49,6 +49,7 @@ class CreditNoteResponse(BaseResponseModel):
|
|
|
49
49
|
credit_amount_cents: int
|
|
50
50
|
balance_amount_cents: int
|
|
51
51
|
refund_amount_cents: int
|
|
52
|
+
offset_amount_cents: int
|
|
52
53
|
taxes_amount_cents: str
|
|
53
54
|
taxes_rate: float
|
|
54
55
|
sub_total_excluding_taxes_amount_cents: int
|
|
@@ -58,6 +59,7 @@ class CreditNoteResponse(BaseResponseModel):
|
|
|
58
59
|
updated_at: Optional[str]
|
|
59
60
|
items: Optional[ItemsResponse]
|
|
60
61
|
applied_taxes: Optional[CreditNoteAppliedTaxes]
|
|
62
|
+
metadata: Optional[Dict[str, Optional[str]]]
|
|
61
63
|
|
|
62
64
|
|
|
63
65
|
class Item(BaseModel):
|
|
@@ -72,10 +74,12 @@ class Items(BaseModel):
|
|
|
72
74
|
class CreditNote(BaseModel):
|
|
73
75
|
reason: Optional[str]
|
|
74
76
|
items: Optional[Items]
|
|
77
|
+
metadata: Optional[Dict[str, Optional[str]]]
|
|
75
78
|
|
|
76
79
|
|
|
77
80
|
class CreditNoteUpdate(BaseModel):
|
|
78
81
|
refund_status: Optional[str]
|
|
82
|
+
metadata: Optional[Dict[str, Optional[str]]]
|
|
79
83
|
|
|
80
84
|
|
|
81
85
|
class EstimatedItemResponse(BaseResponseModel):
|
|
@@ -108,6 +112,7 @@ class CreditNoteEstimatedResponse(BaseResponseModel):
|
|
|
108
112
|
currency: str
|
|
109
113
|
max_creditable_amount_cents: int
|
|
110
114
|
max_refundable_amount_cents: int
|
|
115
|
+
max_offsettable_amount_cents: int
|
|
111
116
|
taxes_amount_cents: str
|
|
112
117
|
taxes_rate: float
|
|
113
118
|
sub_total_excluding_taxes_amount_cents: int
|
{lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/customer.py
RENAMED
|
@@ -10,6 +10,8 @@ from .invoice_custom_section import InvoiceCustomSectionsResponseList
|
|
|
10
10
|
|
|
11
11
|
class CustomerBillingConfiguration(BaseModel):
|
|
12
12
|
invoice_grace_period: Optional[int]
|
|
13
|
+
subscription_invoice_issuing_date_anchor: Optional[str]
|
|
14
|
+
subscription_invoice_issuing_date_adjustment: Optional[str]
|
|
13
15
|
payment_provider: Optional[str]
|
|
14
16
|
payment_provider_code: Optional[str]
|
|
15
17
|
provider_customer_id: Optional[str]
|
{lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/models/customer_usage.py
RENAMED
|
@@ -20,7 +20,8 @@ class PricingUnitDetails(BaseModel):
|
|
|
20
20
|
|
|
21
21
|
class ChargeFilterUsage(BaseModel):
|
|
22
22
|
invoice_display_name: Optional[str]
|
|
23
|
-
values: Dict[str, List[str]]
|
|
23
|
+
values: Optional[Dict[str, List[str]]]
|
|
24
|
+
total_aggregated_units: str
|
|
24
25
|
units: str
|
|
25
26
|
amount_cents: int
|
|
26
27
|
events_count: int
|
|
@@ -37,6 +38,7 @@ class GroupedUsage(BaseModel):
|
|
|
37
38
|
amount_cents: int
|
|
38
39
|
events_count: int
|
|
39
40
|
units: str
|
|
41
|
+
total_aggregated_units: str
|
|
40
42
|
grouped_by: Dict[str, Optional[str]]
|
|
41
43
|
filters: List[ChargeFilterUsage]
|
|
42
44
|
pricing_unit_details: Optional[PricingUnitDetails]
|
|
@@ -44,6 +46,7 @@ class GroupedUsage(BaseModel):
|
|
|
44
46
|
|
|
45
47
|
class ChargeUsage(BaseModel):
|
|
46
48
|
units: str
|
|
49
|
+
total_aggregated_units: str
|
|
47
50
|
events_count: int
|
|
48
51
|
amount_cents: int
|
|
49
52
|
amount_currency: str
|
|
@@ -19,7 +19,7 @@ class BatchEvent(BaseModel):
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
class EventResponse(BaseResponseModel):
|
|
22
|
-
lago_id: str
|
|
22
|
+
lago_id: Optional[str]
|
|
23
23
|
transaction_id: str
|
|
24
24
|
lago_customer_id: Optional[str]
|
|
25
25
|
lago_subscription_id: Optional[str]
|
|
@@ -28,7 +28,7 @@ class EventResponse(BaseResponseModel):
|
|
|
28
28
|
timestamp: str
|
|
29
29
|
precise_total_amount_cents: Optional[str]
|
|
30
30
|
properties: Optional[Dict[str, Any]]
|
|
31
|
-
created_at: str
|
|
31
|
+
created_at: Optional[str]
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
class BatchEventResponse(BaseResponseModel):
|
|
@@ -41,6 +41,7 @@ class FeeResponse(BaseResponseModel):
|
|
|
41
41
|
lago_id: Optional[str]
|
|
42
42
|
lago_charge_id: Optional[str]
|
|
43
43
|
lago_charge_filter_id: Optional[str]
|
|
44
|
+
lago_fixed_charge_id: Optional[str]
|
|
44
45
|
lago_invoice_id: Optional[str]
|
|
45
46
|
lago_true_up_fee_id: Optional[str]
|
|
46
47
|
lago_true_up_parent_fee_id: Optional[str]
|
|
@@ -56,7 +57,8 @@ class FeeResponse(BaseResponseModel):
|
|
|
56
57
|
precise_total_amount: Optional[str]
|
|
57
58
|
taxes_precise_amount: Optional[str]
|
|
58
59
|
total_amount_currency: Optional[str]
|
|
59
|
-
units: Optional[
|
|
60
|
+
units: Optional[str]
|
|
61
|
+
total_aggregated_units: Optional[str]
|
|
60
62
|
events_count: Optional[int]
|
|
61
63
|
payment_status: Optional[str]
|
|
62
64
|
created_at: Optional[str]
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
from typing import List, Optional
|
|
2
|
+
|
|
3
|
+
from lago_python_client.base_model import BaseModel
|
|
4
|
+
|
|
5
|
+
from .tax import TaxesResponse
|
|
6
|
+
from ..base_model import BaseResponseModel
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class FixedChargeGraduatedRange(BaseModel):
|
|
10
|
+
from_value: Optional[int]
|
|
11
|
+
to_value: Optional[int]
|
|
12
|
+
flat_amount: Optional[str]
|
|
13
|
+
per_unit_amount: Optional[str]
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class FixedChargeGraduatedRanges(BaseModel):
|
|
17
|
+
__root__: List[FixedChargeGraduatedRange]
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class FixedChargeProperties(BaseModel):
|
|
21
|
+
amount: Optional[str]
|
|
22
|
+
graduated_ranges: Optional[List[FixedChargeGraduatedRange]]
|
|
23
|
+
volume_ranges: Optional[List[FixedChargeGraduatedRange]]
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class FixedCharge(BaseModel):
|
|
27
|
+
id: Optional[str]
|
|
28
|
+
add_on_id: Optional[str]
|
|
29
|
+
charge_model: Optional[str]
|
|
30
|
+
code: Optional[str]
|
|
31
|
+
invoice_display_name: Optional[str]
|
|
32
|
+
units: Optional[float]
|
|
33
|
+
pay_in_advance: Optional[bool]
|
|
34
|
+
prorated: Optional[bool]
|
|
35
|
+
properties: Optional[FixedChargeProperties]
|
|
36
|
+
tax_codes: Optional[List[str]]
|
|
37
|
+
apply_units_immediately: Optional[bool]
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class FixedCharges(BaseModel):
|
|
41
|
+
__root__: List[FixedCharge]
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class FixedChargePropertiesResponse(BaseResponseModel):
|
|
45
|
+
amount: Optional[str]
|
|
46
|
+
graduated_ranges: Optional[List[FixedChargeGraduatedRange]]
|
|
47
|
+
volume_ranges: Optional[List[FixedChargeGraduatedRange]]
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
class FixedChargeResponse(BaseResponseModel):
|
|
51
|
+
lago_id: str
|
|
52
|
+
lago_add_on_id: str
|
|
53
|
+
invoice_display_name: str
|
|
54
|
+
add_on_code: str
|
|
55
|
+
created_at: str
|
|
56
|
+
code: Optional[str]
|
|
57
|
+
charge_model: str
|
|
58
|
+
pay_in_advance: bool
|
|
59
|
+
prorated: bool
|
|
60
|
+
properties: Optional[FixedChargePropertiesResponse]
|
|
61
|
+
units: Optional[float]
|
|
62
|
+
lago_parent_id: Optional[str]
|
|
63
|
+
taxes: Optional[TaxesResponse]
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
class FixedChargesResponse(BaseResponseModel):
|
|
67
|
+
__root__: List[FixedChargeResponse]
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
class FixedChargeOverrides(BaseModel):
|
|
71
|
+
id: Optional[str]
|
|
72
|
+
invoice_display_name: Optional[str]
|
|
73
|
+
units: Optional[float]
|
|
74
|
+
apply_units_immediately: Optional[bool]
|
|
75
|
+
properties: Optional[FixedChargeProperties]
|
|
76
|
+
tax_codes: Optional[List[str]]
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
class FixedChargesOverrides(BaseModel):
|
|
80
|
+
__root__: List[FixedChargeOverrides]
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
from typing import List, Optional
|
|
1
|
+
from typing import Dict, List, Optional
|
|
2
2
|
|
|
3
3
|
from lago_python_client.base_model import BaseModel
|
|
4
4
|
|
|
5
5
|
from .charge import Charges, ChargesResponse, ChargesOverrides
|
|
6
|
+
from .fixed_charge import (
|
|
7
|
+
FixedCharges,
|
|
8
|
+
FixedChargesResponse,
|
|
9
|
+
FixedChargesOverrides,
|
|
10
|
+
)
|
|
6
11
|
from .usage_threshold import (
|
|
7
12
|
UsageThresholds,
|
|
8
13
|
UsageThresholdsResponse,
|
|
@@ -28,11 +33,14 @@ class Plan(BaseModel):
|
|
|
28
33
|
trial_period: Optional[float]
|
|
29
34
|
pay_in_advance: Optional[bool]
|
|
30
35
|
bill_charges_monthly: Optional[bool]
|
|
36
|
+
bill_fixed_charges_monthly: Optional[bool]
|
|
31
37
|
charges: Optional[Charges]
|
|
38
|
+
fixed_charges: Optional[FixedCharges]
|
|
32
39
|
minimum_commitment: Optional[MinimumCommitment]
|
|
33
40
|
usage_thresholds: Optional[UsageThresholds]
|
|
34
41
|
tax_codes: Optional[List[str]]
|
|
35
42
|
cascade_updates: Optional[bool]
|
|
43
|
+
metadata: Optional[Dict[str, Optional[str]]]
|
|
36
44
|
|
|
37
45
|
|
|
38
46
|
class PlanResponse(BaseResponseModel):
|
|
@@ -48,10 +56,13 @@ class PlanResponse(BaseResponseModel):
|
|
|
48
56
|
trial_period: Optional[float]
|
|
49
57
|
pay_in_advance: Optional[bool]
|
|
50
58
|
bill_charges_monthly: Optional[bool]
|
|
59
|
+
bill_fixed_charges_monthly: Optional[bool]
|
|
51
60
|
charges: Optional[ChargesResponse]
|
|
61
|
+
fixed_charges: Optional[FixedChargesResponse]
|
|
52
62
|
minimum_commitment: Optional[MinimumCommitmentResponse]
|
|
53
63
|
usage_thresholds: Optional[UsageThresholdsResponse]
|
|
54
64
|
taxes: Optional[TaxesResponse]
|
|
65
|
+
metadata: Optional[Dict[str, Optional[str]]]
|
|
55
66
|
|
|
56
67
|
|
|
57
68
|
class PlanOverrides(BaseModel):
|
|
@@ -62,6 +73,8 @@ class PlanOverrides(BaseModel):
|
|
|
62
73
|
amount_currency: Optional[str]
|
|
63
74
|
trial_period: Optional[float]
|
|
64
75
|
charges: Optional[ChargesOverrides]
|
|
76
|
+
fixed_charges: Optional[FixedChargesOverrides]
|
|
65
77
|
minimum_commitment: Optional[MinimumCommitmentOverrides]
|
|
66
78
|
usage_thresholds: Optional[UsageThresholdsOverrides]
|
|
67
79
|
tax_codes: Optional[List[str]]
|
|
80
|
+
metadata: Optional[Dict[str, Optional[str]]]
|
|
@@ -18,6 +18,7 @@ class RecurringTransactionRule(BaseModel):
|
|
|
18
18
|
target_ongoing_balance: Optional[str]
|
|
19
19
|
transaction_metadata: Optional[List[Dict[str, str]]]
|
|
20
20
|
transaction_name: Optional[str]
|
|
21
|
+
ignore_paid_top_up_limits: Optional[bool]
|
|
21
22
|
|
|
22
23
|
|
|
23
24
|
class RecurringTransactionRuleResponse(BaseModel):
|
|
@@ -35,6 +36,7 @@ class RecurringTransactionRuleResponse(BaseModel):
|
|
|
35
36
|
created_at: Optional[str]
|
|
36
37
|
transaction_metadata: Optional[List[Dict[str, str]]]
|
|
37
38
|
transaction_name: Optional[str]
|
|
39
|
+
ignore_paid_top_up_limits: Optional[bool]
|
|
38
40
|
|
|
39
41
|
|
|
40
42
|
class RecurringTransactionRuleList(BaseModel):
|
|
@@ -54,6 +56,7 @@ class Wallet(BaseModel):
|
|
|
54
56
|
external_customer_id: Optional[str]
|
|
55
57
|
rate_amount: Optional[str]
|
|
56
58
|
name: Optional[str]
|
|
59
|
+
priority: Optional[int]
|
|
57
60
|
paid_credits: Optional[str]
|
|
58
61
|
granted_credits: Optional[str]
|
|
59
62
|
expiration_at: Optional[str]
|
|
@@ -63,6 +66,10 @@ class Wallet(BaseModel):
|
|
|
63
66
|
transaction_name: Optional[str]
|
|
64
67
|
applies_to: Optional[AppliesTo]
|
|
65
68
|
invoice_requires_successful_payment: Optional[bool]
|
|
69
|
+
paid_top_up_max_amount_cents: Optional[int]
|
|
70
|
+
paid_top_up_min_amount_cents: Optional[int]
|
|
71
|
+
ignore_paid_top_up_limits_on_creation: Optional[bool]
|
|
72
|
+
metadata: Optional[Dict[str, Optional[str]]]
|
|
66
73
|
|
|
67
74
|
|
|
68
75
|
class WalletResponse(BaseResponseModel):
|
|
@@ -72,6 +79,7 @@ class WalletResponse(BaseResponseModel):
|
|
|
72
79
|
status: str
|
|
73
80
|
currency: str
|
|
74
81
|
name: Optional[str]
|
|
82
|
+
priority: Optional[int]
|
|
75
83
|
rate_amount: str
|
|
76
84
|
credits_balance: str
|
|
77
85
|
balance_cents: int
|
|
@@ -88,3 +96,6 @@ class WalletResponse(BaseResponseModel):
|
|
|
88
96
|
credits_ongoing_usage_balance: str
|
|
89
97
|
applies_to: Optional[AppliesTo]
|
|
90
98
|
invoice_requires_successful_payment: Optional[bool]
|
|
99
|
+
paid_top_up_max_amount_cents: Optional[int]
|
|
100
|
+
paid_top_up_min_amount_cents: Optional[int]
|
|
101
|
+
metadata: Optional[Dict[str, Optional[str]]]
|
|
@@ -13,6 +13,7 @@ class WalletTransaction(BaseModel):
|
|
|
13
13
|
invoice_requires_successful_payment: Optional[bool]
|
|
14
14
|
metadata: Optional[List[Dict[str, str]]]
|
|
15
15
|
name: Optional[str]
|
|
16
|
+
ignore_paid_top_up_limits: Optional[bool]
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
class WalletTransactionResponse(BaseResponseModel):
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
from typing import ClassVar, Dict, Optional, Type
|
|
2
|
+
|
|
3
|
+
from ..base_client import BaseClient
|
|
4
|
+
from ..mixins import (
|
|
5
|
+
CreateCommandMixin,
|
|
6
|
+
DestroyCommandMixin,
|
|
7
|
+
FindAllCommandMixin,
|
|
8
|
+
FindCommandMixin,
|
|
9
|
+
UpdateCommandMixin,
|
|
10
|
+
)
|
|
11
|
+
from ..models.plan import PlanResponse
|
|
12
|
+
from ..services.json import to_json
|
|
13
|
+
from ..services.request import (
|
|
14
|
+
make_headers,
|
|
15
|
+
make_url,
|
|
16
|
+
send_delete_request,
|
|
17
|
+
send_patch_request,
|
|
18
|
+
send_post_request,
|
|
19
|
+
)
|
|
20
|
+
from ..services.response import get_response_data, Response
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class PlanClient(
|
|
24
|
+
CreateCommandMixin[PlanResponse],
|
|
25
|
+
DestroyCommandMixin[PlanResponse],
|
|
26
|
+
FindAllCommandMixin[PlanResponse],
|
|
27
|
+
FindCommandMixin[PlanResponse],
|
|
28
|
+
UpdateCommandMixin[PlanResponse],
|
|
29
|
+
BaseClient,
|
|
30
|
+
):
|
|
31
|
+
API_RESOURCE: ClassVar[str] = "plans"
|
|
32
|
+
RESPONSE_MODEL: ClassVar[Type[PlanResponse]] = PlanResponse
|
|
33
|
+
ROOT_NAME: ClassVar[str] = "plan"
|
|
34
|
+
|
|
35
|
+
def replace_metadata(
|
|
36
|
+
self, resource_id: str, metadata: Dict[str, Optional[str]]
|
|
37
|
+
) -> Optional[Dict[str, Optional[str]]]:
|
|
38
|
+
api_response: Response = send_post_request(
|
|
39
|
+
url=make_url(
|
|
40
|
+
origin=self.base_url,
|
|
41
|
+
path_parts=(self.API_RESOURCE, resource_id, "metadata"),
|
|
42
|
+
),
|
|
43
|
+
content=to_json({"metadata": metadata}),
|
|
44
|
+
headers=make_headers(api_key=self.api_key),
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
return get_response_data(response=api_response, key="metadata")
|
|
48
|
+
|
|
49
|
+
def merge_metadata(
|
|
50
|
+
self, resource_id: str, metadata: Dict[str, Optional[str]]
|
|
51
|
+
) -> Optional[Dict[str, Optional[str]]]:
|
|
52
|
+
api_response: Response = send_patch_request(
|
|
53
|
+
url=make_url(
|
|
54
|
+
origin=self.base_url,
|
|
55
|
+
path_parts=(self.API_RESOURCE, resource_id, "metadata"),
|
|
56
|
+
),
|
|
57
|
+
content=to_json({"metadata": metadata}),
|
|
58
|
+
headers=make_headers(api_key=self.api_key),
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
return get_response_data(response=api_response, key="metadata")
|
|
62
|
+
|
|
63
|
+
def delete_all_metadata(self, resource_id: str) -> Optional[Dict[str, Optional[str]]]:
|
|
64
|
+
api_response: Response = send_delete_request(
|
|
65
|
+
url=make_url(
|
|
66
|
+
origin=self.base_url,
|
|
67
|
+
path_parts=(self.API_RESOURCE, resource_id, "metadata"),
|
|
68
|
+
),
|
|
69
|
+
headers=make_headers(api_key=self.api_key),
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
return get_response_data(response=api_response, key="metadata")
|
|
73
|
+
|
|
74
|
+
def delete_metadata_key(self, resource_id: str, key: str) -> Optional[Dict[str, Optional[str]]]:
|
|
75
|
+
api_response: Response = send_delete_request(
|
|
76
|
+
url=make_url(
|
|
77
|
+
origin=self.base_url,
|
|
78
|
+
path_parts=(self.API_RESOURCE, resource_id, "metadata", key),
|
|
79
|
+
),
|
|
80
|
+
headers=make_headers(api_key=self.api_key),
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
return get_response_data(response=api_response, key="metadata")
|
{lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/subscriptions/clients.py
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import ClassVar, Type
|
|
1
|
+
from typing import Any, ClassVar, Mapping, Type
|
|
2
2
|
|
|
3
3
|
from ..base_client import BaseClient
|
|
4
4
|
from ..mixins import (
|
|
@@ -8,6 +8,7 @@ from ..mixins import (
|
|
|
8
8
|
FindCommandMixin,
|
|
9
9
|
UpdateCommandMixin,
|
|
10
10
|
)
|
|
11
|
+
from ..models.fixed_charge import FixedChargeResponse
|
|
11
12
|
from ..models.lifetime_usage import LifetimeUsageResponse
|
|
12
13
|
from ..models.subscription import SubscriptionResponse
|
|
13
14
|
from ..services.request import (
|
|
@@ -19,6 +20,7 @@ from ..services.request import (
|
|
|
19
20
|
from ..services.response import (
|
|
20
21
|
Response,
|
|
21
22
|
get_response_data,
|
|
23
|
+
prepare_index_response,
|
|
22
24
|
prepare_object_response,
|
|
23
25
|
)
|
|
24
26
|
from ..services.json import to_json
|
|
@@ -68,3 +70,18 @@ class SubscriptionClient(
|
|
|
68
70
|
response_model=LifetimeUsageResponse,
|
|
69
71
|
data=get_response_data(response=api_response, key="lifetime_usage"),
|
|
70
72
|
)
|
|
73
|
+
|
|
74
|
+
def find_all_fixed_charges(self, external_id: str) -> Mapping[str, Any]:
|
|
75
|
+
api_response: Response = send_get_request(
|
|
76
|
+
url=make_url(
|
|
77
|
+
origin=self.base_url,
|
|
78
|
+
path_parts=(self.API_RESOURCE, external_id, "fixed_charges"),
|
|
79
|
+
),
|
|
80
|
+
headers=make_headers(api_key=self.api_key),
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
return prepare_index_response(
|
|
84
|
+
api_resource="fixed_charges",
|
|
85
|
+
response_model=FixedChargeResponse,
|
|
86
|
+
data=get_response_data(response=api_response),
|
|
87
|
+
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
LAGO_VERSION = "1.40.0"
|
{lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client/wallets/clients.py
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import sys
|
|
2
|
-
from typing import Any, ClassVar, Type
|
|
2
|
+
from typing import Any, ClassVar, Dict, Optional, Type
|
|
3
3
|
|
|
4
4
|
from lago_python_client.base_model import BaseModel
|
|
5
5
|
|
|
@@ -14,7 +14,15 @@ from ..mixins import (
|
|
|
14
14
|
from ..models.wallet import WalletResponse
|
|
15
15
|
from ..models.wallet_transaction import WalletTransactionResponse
|
|
16
16
|
from ..services.json import to_json
|
|
17
|
-
from ..services.request import
|
|
17
|
+
from ..services.request import (
|
|
18
|
+
make_headers,
|
|
19
|
+
make_url,
|
|
20
|
+
send_delete_request,
|
|
21
|
+
send_get_request,
|
|
22
|
+
send_patch_request,
|
|
23
|
+
send_post_request,
|
|
24
|
+
QueryPairs,
|
|
25
|
+
)
|
|
18
26
|
from ..services.response import (
|
|
19
27
|
get_response_data,
|
|
20
28
|
prepare_object_list_response,
|
|
@@ -40,6 +48,56 @@ class WalletClient(
|
|
|
40
48
|
RESPONSE_MODEL: ClassVar[Type[WalletResponse]] = WalletResponse
|
|
41
49
|
ROOT_NAME: ClassVar[str] = "wallet"
|
|
42
50
|
|
|
51
|
+
def replace_metadata(
|
|
52
|
+
self, resource_id: str, metadata: Dict[str, Optional[str]]
|
|
53
|
+
) -> Optional[Dict[str, Optional[str]]]:
|
|
54
|
+
api_response: Response = send_post_request(
|
|
55
|
+
url=make_url(
|
|
56
|
+
origin=self.base_url,
|
|
57
|
+
path_parts=(self.API_RESOURCE, resource_id, "metadata"),
|
|
58
|
+
),
|
|
59
|
+
content=to_json({"metadata": metadata}),
|
|
60
|
+
headers=make_headers(api_key=self.api_key),
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
return get_response_data(response=api_response, key="metadata")
|
|
64
|
+
|
|
65
|
+
def merge_metadata(
|
|
66
|
+
self, resource_id: str, metadata: Dict[str, Optional[str]]
|
|
67
|
+
) -> Optional[Dict[str, Optional[str]]]:
|
|
68
|
+
api_response: Response = send_patch_request(
|
|
69
|
+
url=make_url(
|
|
70
|
+
origin=self.base_url,
|
|
71
|
+
path_parts=(self.API_RESOURCE, resource_id, "metadata"),
|
|
72
|
+
),
|
|
73
|
+
content=to_json({"metadata": metadata}),
|
|
74
|
+
headers=make_headers(api_key=self.api_key),
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
return get_response_data(response=api_response, key="metadata")
|
|
78
|
+
|
|
79
|
+
def delete_all_metadata(self, resource_id: str) -> Optional[Dict[str, Optional[str]]]:
|
|
80
|
+
api_response: Response = send_delete_request(
|
|
81
|
+
url=make_url(
|
|
82
|
+
origin=self.base_url,
|
|
83
|
+
path_parts=(self.API_RESOURCE, resource_id, "metadata"),
|
|
84
|
+
),
|
|
85
|
+
headers=make_headers(api_key=self.api_key),
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
return get_response_data(response=api_response, key="metadata")
|
|
89
|
+
|
|
90
|
+
def delete_metadata_key(self, resource_id: str, key: str) -> Optional[Dict[str, Optional[str]]]:
|
|
91
|
+
api_response: Response = send_delete_request(
|
|
92
|
+
url=make_url(
|
|
93
|
+
origin=self.base_url,
|
|
94
|
+
path_parts=(self.API_RESOURCE, resource_id, "metadata", key),
|
|
95
|
+
),
|
|
96
|
+
headers=make_headers(api_key=self.api_key),
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
return get_response_data(response=api_response, key="metadata")
|
|
100
|
+
|
|
43
101
|
|
|
44
102
|
class WalletTransactionClient(BaseClient):
|
|
45
103
|
API_RESOURCE: ClassVar[str] = "wallet_transactions"
|
{lago_python_client-1.34.0 → lago_python_client-1.40.0}/lago_python_client.egg-info/SOURCES.txt
RENAMED
|
@@ -64,6 +64,7 @@ setup.cfg
|
|
|
64
64
|
./lago_python_client/models/error_detail.py
|
|
65
65
|
./lago_python_client/models/event.py
|
|
66
66
|
./lago_python_client/models/fee.py
|
|
67
|
+
./lago_python_client/models/fixed_charge.py
|
|
67
68
|
./lago_python_client/models/gross_revenue.py
|
|
68
69
|
./lago_python_client/models/invoice.py
|
|
69
70
|
./lago_python_client/models/invoice_collection.py
|
|
@@ -227,6 +228,7 @@ lago_python_client/models/customer_usage.py
|
|
|
227
228
|
lago_python_client/models/error_detail.py
|
|
228
229
|
lago_python_client/models/event.py
|
|
229
230
|
lago_python_client/models/fee.py
|
|
231
|
+
lago_python_client/models/fixed_charge.py
|
|
230
232
|
lago_python_client/models/gross_revenue.py
|
|
231
233
|
lago_python_client/models/invoice.py
|
|
232
234
|
lago_python_client/models/invoice_collection.py
|
|
@@ -43,6 +43,8 @@ def create_billing_entity_input():
|
|
|
43
43
|
billing_configuration=BillingEntityBillingConfiguration(
|
|
44
44
|
invoice_footer="Thank you for your business",
|
|
45
45
|
invoice_grace_period=3,
|
|
46
|
+
subscription_invoice_issuing_date_anchor="current_period_end",
|
|
47
|
+
subscription_invoice_issuing_date_adjustment="keep_anchor",
|
|
46
48
|
document_locale="en",
|
|
47
49
|
),
|
|
48
50
|
)
|
|
@@ -75,6 +77,8 @@ def update_billing_entity_input():
|
|
|
75
77
|
billing_configuration=BillingEntityBillingConfiguration(
|
|
76
78
|
invoice_footer="Updated footer",
|
|
77
79
|
invoice_grace_period=5,
|
|
80
|
+
subscription_invoice_issuing_date_anchor="current_period_end",
|
|
81
|
+
subscription_invoice_issuing_date_adjustment="keep_anchor",
|
|
78
82
|
document_locale="fr",
|
|
79
83
|
),
|
|
80
84
|
invoice_custom_section_codes=["custom_section_1", "custom_section_2"],
|