lago-python-client 1.27.1__tar.gz → 1.30.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.27.1 → lago_python_client-1.30.0}/PKG-INFO +2 -2
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/README.md +1 -1
- lago_python_client-1.30.0/lago_python_client/activity_logs/clients.py +18 -0
- lago_python_client-1.30.0/lago_python_client/billing_entities/clients.py +24 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/client.py +10 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/invoices/clients.py +14 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/models/__init__.py +8 -0
- lago_python_client-1.30.0/lago_python_client/models/activity_log.py +36 -0
- lago_python_client-1.30.0/lago_python_client/models/billing_entity.py +96 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/models/tax.py +1 -1
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/models/wallet.py +6 -0
- lago_python_client-1.30.0/lago_python_client/version.py +1 -0
- lago_python_client-1.30.0/lago_python_client/webhooks/__init__.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client.egg-info/PKG-INFO +2 -2
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client.egg-info/SOURCES.txt +16 -0
- lago_python_client-1.30.0/tests/__init__.py +0 -0
- lago_python_client-1.30.0/tests/test_activity_logs_client.py +100 -0
- lago_python_client-1.30.0/tests/test_billing_entity_client.py +201 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/tests/test_invoice_client.py +13 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/tests/test_wallet_client.py +4 -0
- lago_python_client-1.27.1/lago_python_client/version.py +0 -1
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/LICENSE +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/__init__.py +0 -0
- {lago_python_client-1.27.1/lago_python_client/add_ons → lago_python_client-1.30.0/lago_python_client/activity_logs}/__init__.py +0 -0
- {lago_python_client-1.27.1/lago_python_client/billable_metrics → lago_python_client-1.30.0/lago_python_client/add_ons}/__init__.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/add_ons/clients.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/base_client.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/base_model.py +0 -0
- {lago_python_client-1.27.1/lago_python_client/coupons → lago_python_client-1.30.0/lago_python_client/billable_metrics}/__init__.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/billable_metrics/clients.py +0 -0
- {lago_python_client-1.27.1/lago_python_client/credit_notes → lago_python_client-1.30.0/lago_python_client/billing_entities}/__init__.py +0 -0
- {lago_python_client-1.27.1/lago_python_client/customers → lago_python_client-1.30.0/lago_python_client/coupons}/__init__.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/coupons/clients.py +0 -0
- {lago_python_client-1.27.1/lago_python_client/events → lago_python_client-1.30.0/lago_python_client/credit_notes}/__init__.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/credit_notes/clients.py +0 -0
- {lago_python_client-1.27.1/lago_python_client/fees → lago_python_client-1.30.0/lago_python_client/customers}/__init__.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/customers/clients.py +0 -0
- {lago_python_client-1.27.1/lago_python_client/gross_revenues → lago_python_client-1.30.0/lago_python_client/events}/__init__.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/events/clients.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/exceptions.py +0 -0
- {lago_python_client-1.27.1/lago_python_client/invoice_collections → lago_python_client-1.30.0/lago_python_client/fees}/__init__.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/fees/clients.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/functools_ext.py +0 -0
- {lago_python_client-1.27.1/lago_python_client/invoiced_usages → lago_python_client-1.30.0/lago_python_client/gross_revenues}/__init__.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/gross_revenues/clients.py +0 -0
- {lago_python_client-1.27.1/lago_python_client/invoices → lago_python_client-1.30.0/lago_python_client/invoice_collections}/__init__.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/invoice_collections/clients.py +0 -0
- {lago_python_client-1.27.1/lago_python_client/mrrs → lago_python_client-1.30.0/lago_python_client/invoiced_usages}/__init__.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/invoiced_usages/clients.py +0 -0
- {lago_python_client-1.27.1/lago_python_client/organizations → lago_python_client-1.30.0/lago_python_client/invoices}/__init__.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/mixins.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/models/add_on.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/models/applied_coupon.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/models/billable_metric.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/models/billing_period.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/models/charge.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/models/coupon.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/models/credit.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/models/credit_note.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/models/customer.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/models/customer_usage.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/models/error_detail.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/models/event.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/models/fee.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/models/gross_revenue.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/models/invoice.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/models/invoice_collection.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/models/invoice_item.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/models/invoiced_usage.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/models/lifetime_usage.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/models/minimum_commitment.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/models/mrr.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/models/organization.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/models/overdue_balance.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/models/payment.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/models/payment_receipt.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/models/payment_request.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/models/plan.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/models/subscription.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/models/usage_threshold.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/models/wallet_transaction.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/models/webhook_endpoint.py +0 -0
- {lago_python_client-1.27.1/lago_python_client/overdue_balances → lago_python_client-1.30.0/lago_python_client/mrrs}/__init__.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/mrrs/clients.py +0 -0
- {lago_python_client-1.27.1/lago_python_client/payment_receipts → lago_python_client-1.30.0/lago_python_client/organizations}/__init__.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/organizations/clients.py +0 -0
- {lago_python_client-1.27.1/lago_python_client/payment_requests → lago_python_client-1.30.0/lago_python_client/overdue_balances}/__init__.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/overdue_balances/clients.py +0 -0
- {lago_python_client-1.27.1/lago_python_client/payments → lago_python_client-1.30.0/lago_python_client/payment_receipts}/__init__.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/payment_receipts/clients.py +0 -0
- {lago_python_client-1.27.1/lago_python_client/plans → lago_python_client-1.30.0/lago_python_client/payment_requests}/__init__.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/payment_requests/clients.py +0 -0
- {lago_python_client-1.27.1/lago_python_client/services → lago_python_client-1.30.0/lago_python_client/payments}/__init__.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/payments/clients.py +0 -0
- {lago_python_client-1.27.1/lago_python_client/subscriptions → lago_python_client-1.30.0/lago_python_client/plans}/__init__.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/plans/clients.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/py.typed +0 -0
- {lago_python_client-1.27.1/lago_python_client/taxes → lago_python_client-1.30.0/lago_python_client/services}/__init__.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/services/json.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/services/request.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/services/response.py +0 -0
- {lago_python_client-1.27.1/lago_python_client/wallets → lago_python_client-1.30.0/lago_python_client/subscriptions}/__init__.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/subscriptions/clients.py +0 -0
- {lago_python_client-1.27.1/lago_python_client/webhook_endpoints → lago_python_client-1.30.0/lago_python_client/taxes}/__init__.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/taxes/clients.py +0 -0
- {lago_python_client-1.27.1/lago_python_client/webhooks → lago_python_client-1.30.0/lago_python_client/wallets}/__init__.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/wallets/clients.py +0 -0
- {lago_python_client-1.27.1/tests → lago_python_client-1.30.0/lago_python_client/webhook_endpoints}/__init__.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/webhook_endpoints/clients.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/webhooks/clients.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client.egg-info/dependency_links.txt +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client.egg-info/requires.txt +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client.egg-info/top_level.txt +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/pyproject.toml +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/setup.cfg +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/tests/test_add_on_client.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/tests/test_applied_coupon_client.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/tests/test_billable_metric_client.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/tests/test_client.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/tests/test_coupon_client.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/tests/test_credit_note_client.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/tests/test_customer_client.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/tests/test_event_client.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/tests/test_fee_client.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/tests/test_functools_ext.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/tests/test_gross_revenue_client.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/tests/test_invoice_collection_client.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/tests/test_invoiced_usage_client.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/tests/test_json_services.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/tests/test_mrr_client.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/tests/test_organization_client.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/tests/test_overdue_balance_client.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/tests/test_payment_client.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/tests/test_payment_receipt_client.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/tests/test_payment_request_client.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/tests/test_plan_client.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/tests/test_request_services.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/tests/test_response_services.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/tests/test_subscription_client.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/tests/test_tax_client.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/tests/test_wallet_transaction_client.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/tests/test_webhook_client.py +0 -0
- {lago_python_client-1.27.1 → lago_python_client-1.30.0}/tests/test_webhook_endpoint_client.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lago-python-client
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.30.0
|
|
4
4
|
Summary: Lago Python API Client
|
|
5
5
|
Home-page: https://github.com/getlago/lago-python-client
|
|
6
6
|
Author: Lovro Colic
|
|
@@ -65,7 +65,7 @@ Check the [lago API reference](https://doc.getlago.com/docs/api/intro)
|
|
|
65
65
|
|
|
66
66
|
```bash
|
|
67
67
|
python -m pip install --upgrade pip setuptools wheel
|
|
68
|
-
python -m pip install .[test]
|
|
68
|
+
python -m pip install '.[test]'
|
|
69
69
|
```
|
|
70
70
|
|
|
71
71
|
### Run tests
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
from typing import ClassVar, Type
|
|
2
|
+
|
|
3
|
+
from ..base_client import BaseClient
|
|
4
|
+
from ..mixins import (
|
|
5
|
+
FindAllCommandMixin,
|
|
6
|
+
FindCommandMixin,
|
|
7
|
+
)
|
|
8
|
+
from ..models.activity_log import ActivityLogResponse
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class ActivityLogClient(
|
|
12
|
+
FindAllCommandMixin[ActivityLogResponse],
|
|
13
|
+
FindCommandMixin[ActivityLogResponse],
|
|
14
|
+
BaseClient,
|
|
15
|
+
):
|
|
16
|
+
API_RESOURCE: ClassVar[str] = "activity_logs"
|
|
17
|
+
RESPONSE_MODEL: ClassVar[Type[ActivityLogResponse]] = ActivityLogResponse
|
|
18
|
+
ROOT_NAME: ClassVar[str] = "activity_log"
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from typing import ClassVar, Type
|
|
2
|
+
|
|
3
|
+
from ..base_client import BaseClient
|
|
4
|
+
from ..mixins import (
|
|
5
|
+
CreateCommandMixin,
|
|
6
|
+
FindAllCommandMixin,
|
|
7
|
+
FindCommandMixin,
|
|
8
|
+
UpdateCommandMixin,
|
|
9
|
+
)
|
|
10
|
+
from ..models.billing_entity import (
|
|
11
|
+
BillingEntityResponse,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class BillingEntityClient(
|
|
16
|
+
CreateCommandMixin[BillingEntityResponse],
|
|
17
|
+
FindAllCommandMixin[BillingEntityResponse],
|
|
18
|
+
FindCommandMixin[BillingEntityResponse],
|
|
19
|
+
UpdateCommandMixin[BillingEntityResponse],
|
|
20
|
+
BaseClient,
|
|
21
|
+
):
|
|
22
|
+
API_RESOURCE: ClassVar[str] = "billing_entities"
|
|
23
|
+
RESPONSE_MODEL: ClassVar[Type[BillingEntityResponse]] = BillingEntityResponse
|
|
24
|
+
ROOT_NAME: ClassVar[str] = "billing_entity"
|
|
@@ -2,6 +2,7 @@ from urllib.parse import urljoin
|
|
|
2
2
|
|
|
3
3
|
from .add_ons.clients import AddOnClient
|
|
4
4
|
from .billable_metrics.clients import BillableMetricClient
|
|
5
|
+
from .billing_entities.clients import BillingEntityClient
|
|
5
6
|
from .coupons.clients import AppliedCouponClient, CouponClient
|
|
6
7
|
from .credit_notes.clients import CreditNoteClient
|
|
7
8
|
from .customers.clients import CustomerClient
|
|
@@ -24,6 +25,7 @@ from .taxes.clients import TaxClient
|
|
|
24
25
|
from .wallets.clients import WalletClient, WalletTransactionClient
|
|
25
26
|
from .webhooks.clients import WebhookClient
|
|
26
27
|
from .webhook_endpoints.clients import WebhookEndpointClient
|
|
28
|
+
from .activity_logs.clients import ActivityLogClient
|
|
27
29
|
|
|
28
30
|
try:
|
|
29
31
|
from typing import Final
|
|
@@ -68,6 +70,10 @@ class Client:
|
|
|
68
70
|
def billable_metrics(self) -> BillableMetricClient:
|
|
69
71
|
return BillableMetricClient(self.base_api_url, self.api_key)
|
|
70
72
|
|
|
73
|
+
@callable_cached_property
|
|
74
|
+
def billing_entities(self) -> BillingEntityClient:
|
|
75
|
+
return BillingEntityClient(self.base_api_url, self.api_key)
|
|
76
|
+
|
|
71
77
|
@callable_cached_property
|
|
72
78
|
def coupons(self) -> CouponClient:
|
|
73
79
|
return CouponClient(self.base_api_url, self.api_key)
|
|
@@ -159,3 +165,7 @@ class Client:
|
|
|
159
165
|
@callable_cached_property
|
|
160
166
|
def webhook_endpoints(self) -> WebhookEndpointClient:
|
|
161
167
|
return WebhookEndpointClient(self.base_api_url, self.api_key)
|
|
168
|
+
|
|
169
|
+
@callable_cached_property
|
|
170
|
+
def activity_logs(self) -> ActivityLogClient:
|
|
171
|
+
return ActivityLogClient(self.base_api_url, self.api_key)
|
{lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/invoices/clients.py
RENAMED
|
@@ -107,6 +107,20 @@ class InvoiceClient(
|
|
|
107
107
|
data=get_response_data(response=api_response, key=self.ROOT_NAME),
|
|
108
108
|
)
|
|
109
109
|
|
|
110
|
+
def void(self, resource_id: str) -> InvoiceResponse:
|
|
111
|
+
api_response: Response = send_post_request(
|
|
112
|
+
url=make_url(
|
|
113
|
+
origin=self.base_url,
|
|
114
|
+
path_parts=(self.API_RESOURCE, resource_id, "void"),
|
|
115
|
+
),
|
|
116
|
+
headers=make_headers(api_key=self.api_key),
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
return prepare_object_response(
|
|
120
|
+
response_model=self.RESPONSE_MODEL,
|
|
121
|
+
data=get_response_data(response=api_response, key=self.ROOT_NAME),
|
|
122
|
+
)
|
|
123
|
+
|
|
110
124
|
def lose_dispute(self, resource_id: str) -> InvoiceResponse:
|
|
111
125
|
api_response: Response = send_put_request(
|
|
112
126
|
url=make_url(
|
{lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client/models/__init__.py
RENAMED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from .activity_log import ActivityLog as ActivityLog, ActivityLogResponse as ActivityLogResponse
|
|
1
2
|
from .applied_coupon import AppliedCoupon as AppliedCoupon
|
|
2
3
|
from .billable_metric import (
|
|
3
4
|
BillableMetric as BillableMetric,
|
|
@@ -7,6 +8,12 @@ from .billable_metric import (
|
|
|
7
8
|
BillableMetricEvaluateExpression as BillableMetricEvaluateExpression,
|
|
8
9
|
BillableMetricEvaluateExpressionResponse as BillableMetricEvaluateExpressionResponse,
|
|
9
10
|
)
|
|
11
|
+
from .billing_entity import (
|
|
12
|
+
BillingEntity as BillingEntity,
|
|
13
|
+
BillingEntityUpdate as BillingEntityUpdate,
|
|
14
|
+
BillingEntityResponse as BillingEntityResponse,
|
|
15
|
+
BillingEntityBillingConfiguration as BillingEntityBillingConfiguration,
|
|
16
|
+
)
|
|
10
17
|
from .billing_period import (
|
|
11
18
|
BillingPeriodResponse as BillingPeriodResponse,
|
|
12
19
|
BillingPeriodsResponse as BillingPeriodsResponse,
|
|
@@ -82,6 +89,7 @@ from .wallet import (
|
|
|
82
89
|
RecurringTransactionRuleList as RecurringTransactionRuleList,
|
|
83
90
|
RecurringTransactionRuleResponse as RecurringTransactionRuleResponse,
|
|
84
91
|
RecurringTransactionRuleResponseList as RecurringTransactionRuleResponseList,
|
|
92
|
+
AppliesTo as AppliesTo,
|
|
85
93
|
)
|
|
86
94
|
from .wallet_transaction import WalletTransaction as WalletTransaction
|
|
87
95
|
from .webhook_endpoint import WebhookEndpoint as WebhookEndpoint
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
from lago_python_client.base_model import BaseModel
|
|
4
|
+
|
|
5
|
+
from ..base_model import BaseResponseModel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ActivityLog(BaseModel):
|
|
9
|
+
activity_type: str
|
|
10
|
+
activity_object: Optional[dict]
|
|
11
|
+
activity_object_changes: Optional[dict]
|
|
12
|
+
activity_source: str
|
|
13
|
+
activity_type: str
|
|
14
|
+
logged_at: str
|
|
15
|
+
resource_type: str
|
|
16
|
+
created_at: str
|
|
17
|
+
activity_id: str
|
|
18
|
+
external_customer_id: Optional[str]
|
|
19
|
+
external_subscription_id: Optional[str]
|
|
20
|
+
resource_id: str
|
|
21
|
+
user_email: Optional[str]
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class ActivityLogResponse(BaseResponseModel):
|
|
25
|
+
activity_id: str
|
|
26
|
+
activity_type: str
|
|
27
|
+
activity_source: str
|
|
28
|
+
activity_object: Optional[dict]
|
|
29
|
+
activity_object_changes: Optional[dict]
|
|
30
|
+
user_email: Optional[str]
|
|
31
|
+
resource_id: str
|
|
32
|
+
resource_type: str
|
|
33
|
+
external_customer_id: Optional[str]
|
|
34
|
+
external_subscription_id: Optional[str]
|
|
35
|
+
logged_at: str
|
|
36
|
+
created_at: str
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
from typing import Optional, List
|
|
2
|
+
from ..base_model import BaseModel, BaseResponseModel
|
|
3
|
+
from .tax import TaxesResponse
|
|
4
|
+
from datetime import datetime
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class BillingEntityBillingConfiguration(BaseModel):
|
|
8
|
+
invoice_footer: Optional[str]
|
|
9
|
+
invoice_grace_period: Optional[int]
|
|
10
|
+
document_locale: Optional[str]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class BillingEntity(BaseModel):
|
|
14
|
+
code: str
|
|
15
|
+
name: str
|
|
16
|
+
address_line1: Optional[str]
|
|
17
|
+
address_line2: Optional[str]
|
|
18
|
+
city: Optional[str]
|
|
19
|
+
state: Optional[str]
|
|
20
|
+
zipcode: Optional[str]
|
|
21
|
+
country: Optional[str]
|
|
22
|
+
email: Optional[str]
|
|
23
|
+
phone: Optional[str]
|
|
24
|
+
default_currency: Optional[str]
|
|
25
|
+
timezone: Optional[str]
|
|
26
|
+
document_numbering: Optional[str]
|
|
27
|
+
document_number_prefix: Optional[str]
|
|
28
|
+
finalize_zero_amount_invoice: Optional[bool]
|
|
29
|
+
net_payment_term: Optional[int]
|
|
30
|
+
eu_tax_management: Optional[bool]
|
|
31
|
+
logo_url: Optional[str]
|
|
32
|
+
legal_name: Optional[str]
|
|
33
|
+
legal_number: Optional[str]
|
|
34
|
+
tax_identification_number: Optional[str]
|
|
35
|
+
email_settings: Optional[List[str]]
|
|
36
|
+
billing_configuration: Optional[BillingEntityBillingConfiguration]
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class BillingEntityUpdate(BaseModel):
|
|
40
|
+
name: str
|
|
41
|
+
address_line1: Optional[str]
|
|
42
|
+
address_line2: Optional[str]
|
|
43
|
+
city: Optional[str]
|
|
44
|
+
state: Optional[str]
|
|
45
|
+
zipcode: Optional[str]
|
|
46
|
+
country: Optional[str]
|
|
47
|
+
email: Optional[str]
|
|
48
|
+
phone: Optional[str]
|
|
49
|
+
default_currency: Optional[str]
|
|
50
|
+
timezone: Optional[str]
|
|
51
|
+
document_numbering: Optional[str]
|
|
52
|
+
document_number_prefix: Optional[str]
|
|
53
|
+
finalize_zero_amount_invoice: Optional[bool]
|
|
54
|
+
net_payment_term: Optional[int]
|
|
55
|
+
eu_tax_management: Optional[bool]
|
|
56
|
+
logo_url: Optional[str]
|
|
57
|
+
legal_name: Optional[str]
|
|
58
|
+
legal_number: Optional[str]
|
|
59
|
+
tax_identification_number: Optional[str]
|
|
60
|
+
tax_codes: Optional[List[str]]
|
|
61
|
+
email_settings: Optional[List[str]]
|
|
62
|
+
billing_configuration: Optional[BillingEntityBillingConfiguration]
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
class BillingEntityResponse(BaseResponseModel):
|
|
66
|
+
lago_id: str
|
|
67
|
+
code: str
|
|
68
|
+
name: str
|
|
69
|
+
address_line1: Optional[str]
|
|
70
|
+
address_line2: Optional[str]
|
|
71
|
+
city: Optional[str]
|
|
72
|
+
state: Optional[str]
|
|
73
|
+
zipcode: Optional[str]
|
|
74
|
+
country: Optional[str]
|
|
75
|
+
email: Optional[str]
|
|
76
|
+
phone: Optional[str]
|
|
77
|
+
default_currency: Optional[str]
|
|
78
|
+
timezone: Optional[str]
|
|
79
|
+
document_numbering: Optional[str]
|
|
80
|
+
document_number_prefix: Optional[str]
|
|
81
|
+
finalize_zero_amount_invoice: Optional[bool]
|
|
82
|
+
net_payment_term: Optional[int]
|
|
83
|
+
eu_tax_management: Optional[bool]
|
|
84
|
+
logo_url: Optional[str]
|
|
85
|
+
legal_name: Optional[str]
|
|
86
|
+
legal_number: Optional[str]
|
|
87
|
+
tax_identification_number: Optional[str]
|
|
88
|
+
is_default: bool
|
|
89
|
+
logo_url: Optional[str]
|
|
90
|
+
document_locale: Optional[str]
|
|
91
|
+
invoice_footer: Optional[str]
|
|
92
|
+
invoice_grace_period: Optional[int]
|
|
93
|
+
email_settings: Optional[List[str]]
|
|
94
|
+
taxes: Optional[TaxesResponse]
|
|
95
|
+
created_at: datetime
|
|
96
|
+
updated_at: datetime
|
|
@@ -43,6 +43,10 @@ class RecurringTransactionRuleResponseList(BaseModel):
|
|
|
43
43
|
__root__: List[RecurringTransactionRuleResponse]
|
|
44
44
|
|
|
45
45
|
|
|
46
|
+
class AppliesTo(BaseModel):
|
|
47
|
+
fee_types: Optional[List[str]]
|
|
48
|
+
|
|
49
|
+
|
|
46
50
|
class Wallet(BaseModel):
|
|
47
51
|
external_customer_id: Optional[str]
|
|
48
52
|
rate_amount: Optional[str]
|
|
@@ -53,6 +57,7 @@ class Wallet(BaseModel):
|
|
|
53
57
|
currency: Optional[str]
|
|
54
58
|
recurring_transaction_rules: Optional[RecurringTransactionRuleList]
|
|
55
59
|
transaction_metadata: Optional[List[Dict[str, str]]]
|
|
60
|
+
applies_to: Optional[AppliesTo]
|
|
56
61
|
|
|
57
62
|
|
|
58
63
|
class WalletResponse(BaseResponseModel):
|
|
@@ -76,3 +81,4 @@ class WalletResponse(BaseResponseModel):
|
|
|
76
81
|
ongoing_usage_balance_cents: int
|
|
77
82
|
credits_ongoing_balance: str
|
|
78
83
|
credits_ongoing_usage_balance: str
|
|
84
|
+
applies_to: Optional[AppliesTo]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
LAGO_VERSION = "1.30.0"
|
|
File without changes
|
{lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client.egg-info/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lago-python-client
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.30.0
|
|
4
4
|
Summary: Lago Python API Client
|
|
5
5
|
Home-page: https://github.com/getlago/lago-python-client
|
|
6
6
|
Author: Lovro Colic
|
|
@@ -65,7 +65,7 @@ Check the [lago API reference](https://doc.getlago.com/docs/api/intro)
|
|
|
65
65
|
|
|
66
66
|
```bash
|
|
67
67
|
python -m pip install --upgrade pip setuptools wheel
|
|
68
|
-
python -m pip install .[test]
|
|
68
|
+
python -m pip install '.[test]'
|
|
69
69
|
```
|
|
70
70
|
|
|
71
71
|
### Run tests
|
{lago_python_client-1.27.1 → lago_python_client-1.30.0}/lago_python_client.egg-info/SOURCES.txt
RENAMED
|
@@ -11,10 +11,14 @@ setup.cfg
|
|
|
11
11
|
./lago_python_client/mixins.py
|
|
12
12
|
./lago_python_client/py.typed
|
|
13
13
|
./lago_python_client/version.py
|
|
14
|
+
./lago_python_client/activity_logs/__init__.py
|
|
15
|
+
./lago_python_client/activity_logs/clients.py
|
|
14
16
|
./lago_python_client/add_ons/__init__.py
|
|
15
17
|
./lago_python_client/add_ons/clients.py
|
|
16
18
|
./lago_python_client/billable_metrics/__init__.py
|
|
17
19
|
./lago_python_client/billable_metrics/clients.py
|
|
20
|
+
./lago_python_client/billing_entities/__init__.py
|
|
21
|
+
./lago_python_client/billing_entities/clients.py
|
|
18
22
|
./lago_python_client/coupons/__init__.py
|
|
19
23
|
./lago_python_client/coupons/clients.py
|
|
20
24
|
./lago_python_client/credit_notes/__init__.py
|
|
@@ -34,9 +38,11 @@ setup.cfg
|
|
|
34
38
|
./lago_python_client/invoices/__init__.py
|
|
35
39
|
./lago_python_client/invoices/clients.py
|
|
36
40
|
./lago_python_client/models/__init__.py
|
|
41
|
+
./lago_python_client/models/activity_log.py
|
|
37
42
|
./lago_python_client/models/add_on.py
|
|
38
43
|
./lago_python_client/models/applied_coupon.py
|
|
39
44
|
./lago_python_client/models/billable_metric.py
|
|
45
|
+
./lago_python_client/models/billing_entity.py
|
|
40
46
|
./lago_python_client/models/billing_period.py
|
|
41
47
|
./lago_python_client/models/charge.py
|
|
42
48
|
./lago_python_client/models/coupon.py
|
|
@@ -96,9 +102,11 @@ setup.cfg
|
|
|
96
102
|
./lago_python_client/webhooks/__init__.py
|
|
97
103
|
./lago_python_client/webhooks/clients.py
|
|
98
104
|
./tests/__init__.py
|
|
105
|
+
./tests/test_activity_logs_client.py
|
|
99
106
|
./tests/test_add_on_client.py
|
|
100
107
|
./tests/test_applied_coupon_client.py
|
|
101
108
|
./tests/test_billable_metric_client.py
|
|
109
|
+
./tests/test_billing_entity_client.py
|
|
102
110
|
./tests/test_client.py
|
|
103
111
|
./tests/test_coupon_client.py
|
|
104
112
|
./tests/test_credit_note_client.py
|
|
@@ -140,10 +148,14 @@ lago_python_client.egg-info/SOURCES.txt
|
|
|
140
148
|
lago_python_client.egg-info/dependency_links.txt
|
|
141
149
|
lago_python_client.egg-info/requires.txt
|
|
142
150
|
lago_python_client.egg-info/top_level.txt
|
|
151
|
+
lago_python_client/activity_logs/__init__.py
|
|
152
|
+
lago_python_client/activity_logs/clients.py
|
|
143
153
|
lago_python_client/add_ons/__init__.py
|
|
144
154
|
lago_python_client/add_ons/clients.py
|
|
145
155
|
lago_python_client/billable_metrics/__init__.py
|
|
146
156
|
lago_python_client/billable_metrics/clients.py
|
|
157
|
+
lago_python_client/billing_entities/__init__.py
|
|
158
|
+
lago_python_client/billing_entities/clients.py
|
|
147
159
|
lago_python_client/coupons/__init__.py
|
|
148
160
|
lago_python_client/coupons/clients.py
|
|
149
161
|
lago_python_client/credit_notes/__init__.py
|
|
@@ -163,9 +175,11 @@ lago_python_client/invoiced_usages/clients.py
|
|
|
163
175
|
lago_python_client/invoices/__init__.py
|
|
164
176
|
lago_python_client/invoices/clients.py
|
|
165
177
|
lago_python_client/models/__init__.py
|
|
178
|
+
lago_python_client/models/activity_log.py
|
|
166
179
|
lago_python_client/models/add_on.py
|
|
167
180
|
lago_python_client/models/applied_coupon.py
|
|
168
181
|
lago_python_client/models/billable_metric.py
|
|
182
|
+
lago_python_client/models/billing_entity.py
|
|
169
183
|
lago_python_client/models/billing_period.py
|
|
170
184
|
lago_python_client/models/charge.py
|
|
171
185
|
lago_python_client/models/coupon.py
|
|
@@ -225,9 +239,11 @@ lago_python_client/webhook_endpoints/clients.py
|
|
|
225
239
|
lago_python_client/webhooks/__init__.py
|
|
226
240
|
lago_python_client/webhooks/clients.py
|
|
227
241
|
tests/__init__.py
|
|
242
|
+
tests/test_activity_logs_client.py
|
|
228
243
|
tests/test_add_on_client.py
|
|
229
244
|
tests/test_applied_coupon_client.py
|
|
230
245
|
tests/test_billable_metric_client.py
|
|
246
|
+
tests/test_billing_entity_client.py
|
|
231
247
|
tests/test_client.py
|
|
232
248
|
tests/test_coupon_client.py
|
|
233
249
|
tests/test_credit_note_client.py
|
|
File without changes
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
from pytest_httpx import HTTPXMock
|
|
5
|
+
|
|
6
|
+
from urllib.parse import urlencode
|
|
7
|
+
|
|
8
|
+
from lago_python_client.client import Client
|
|
9
|
+
from lago_python_client.exceptions import LagoApiError
|
|
10
|
+
|
|
11
|
+
ENDPOINT = "https://api.getlago.com/api/v1/activity_logs"
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def mock_response(fixture_path):
|
|
15
|
+
this_dir = os.path.dirname(os.path.abspath(__file__))
|
|
16
|
+
data_path = os.path.join(this_dir, fixture_path)
|
|
17
|
+
|
|
18
|
+
with open(data_path, "rb") as response:
|
|
19
|
+
return response.read()
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def test_valid_find_activity_log_request(httpx_mock: HTTPXMock):
|
|
23
|
+
client = Client(api_key="886fe239-927d-4072-ab72-6dd345e8dd0d")
|
|
24
|
+
activity_id = "1262046f-ea6e-423b-8bf7-3a985232f91b"
|
|
25
|
+
|
|
26
|
+
httpx_mock.add_response(
|
|
27
|
+
method="GET",
|
|
28
|
+
url=ENDPOINT + f"/{activity_id}",
|
|
29
|
+
content=mock_response("fixtures/activity_log.json"),
|
|
30
|
+
)
|
|
31
|
+
response = client.activity_logs.find(activity_id)
|
|
32
|
+
|
|
33
|
+
assert response.activity_id == activity_id
|
|
34
|
+
assert response.activity_type == "billable_metric.created"
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def test_invalid_find_activity_log_request(httpx_mock: HTTPXMock):
|
|
38
|
+
client = Client(api_key="invalid")
|
|
39
|
+
activity_id = "invalid"
|
|
40
|
+
|
|
41
|
+
httpx_mock.add_response(
|
|
42
|
+
method="GET",
|
|
43
|
+
url=ENDPOINT + f"/{activity_id}",
|
|
44
|
+
status_code=404,
|
|
45
|
+
content=b"",
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
with pytest.raises(LagoApiError):
|
|
49
|
+
client.activity_logs.find(activity_id)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def test_valid_find_all_activity_log_request(httpx_mock: HTTPXMock):
|
|
53
|
+
client = Client(api_key="886fe239-927d-4072-ab72-6dd345e8dd0d")
|
|
54
|
+
|
|
55
|
+
httpx_mock.add_response(
|
|
56
|
+
method="GET",
|
|
57
|
+
url=ENDPOINT,
|
|
58
|
+
content=mock_response("fixtures/activity_log_index.json"),
|
|
59
|
+
)
|
|
60
|
+
response = client.activity_logs.find_all()
|
|
61
|
+
|
|
62
|
+
assert response["activity_logs"][0].activity_id == "1262046f-ea6e-423b-8bf7-3a985232f91b"
|
|
63
|
+
assert response["activity_logs"][1].activity_id == "6744ddec-3516-4e26-9c7e-dc3c30fc4e80"
|
|
64
|
+
assert response["meta"]["current_page"] == 1
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def test_valid_find_all_activity_log_request_with_options(httpx_mock: HTTPXMock):
|
|
68
|
+
client = Client(api_key="886fe239-927d-4072-ab72-6dd345e8dd0d")
|
|
69
|
+
options = {"per_page": 1, "page": 1}
|
|
70
|
+
|
|
71
|
+
httpx_mock.add_response(
|
|
72
|
+
method="GET",
|
|
73
|
+
url=ENDPOINT + f"?{urlencode(options)}",
|
|
74
|
+
content=mock_response("fixtures/activity_log_index.json"),
|
|
75
|
+
)
|
|
76
|
+
response = client.activity_logs.find_all(options)
|
|
77
|
+
|
|
78
|
+
assert response["activity_logs"][1].activity_id == "6744ddec-3516-4e26-9c7e-dc3c30fc4e80"
|
|
79
|
+
assert response["meta"]["current_page"] == 1
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def test_invalid_find_all_activity_log_request(httpx_mock: HTTPXMock):
|
|
83
|
+
client = Client(api_key="invalid")
|
|
84
|
+
|
|
85
|
+
httpx_mock.add_response(
|
|
86
|
+
method="GET",
|
|
87
|
+
url=ENDPOINT,
|
|
88
|
+
status_code=404,
|
|
89
|
+
content=b"",
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
with pytest.raises(LagoApiError):
|
|
93
|
+
client.activity_logs.find_all()
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
def test_invalid_operations_for_activity_log_request():
|
|
97
|
+
client = Client(api_key="886fe239-927d-4072-ab72-6dd345e8dd0d")
|
|
98
|
+
assert not hasattr(client.activity_logs, "create")
|
|
99
|
+
assert not hasattr(client.activity_logs, "update")
|
|
100
|
+
assert not hasattr(client.activity_logs, "destroy")
|