lago-python-client 1.6.0__tar.gz → 1.9.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.6.0 → lago-python-client-1.9.0}/PKG-INFO +1 -1
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/billable_metrics/clients.py +0 -23
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/client.py +11 -5
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/fees/clients.py +2 -1
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/models/__init__.py +2 -2
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/models/applied_coupon.py +1 -1
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/models/billable_metric.py +0 -7
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/models/charge.py +2 -13
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/models/credit.py +1 -1
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/models/customer.py +11 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/models/customer_usage.py +0 -9
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/models/event.py +2 -4
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/models/fee.py +0 -1
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/models/gross_revenue.py +1 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/models/invoice_item.py +0 -2
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/models/organization.py +0 -1
- lago-python-client-1.9.0/lago_python_client/models/overdue_balance.py +14 -0
- lago-python-client-1.9.0/lago_python_client/models/payment_request.py +46 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/models/subscription.py +3 -1
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/models/wallet.py +4 -2
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/models/wallet_transaction.py +4 -1
- lago-python-client-1.9.0/lago_python_client/overdue_balances/clients.py +39 -0
- lago-python-client-1.9.0/lago_python_client/version.py +1 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client.egg-info/PKG-INFO +1 -1
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client.egg-info/SOURCES.txt +8 -3
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client.egg-info/requires.txt +1 -1
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/setup.cfg +1 -1
- lago-python-client-1.9.0/tests/__init__.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/tests/test_billable_metric_client.py +5 -5
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/tests/test_customer_client.py +17 -4
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/tests/test_event_client.py +3 -3
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/tests/test_gross_revenue_client.py +1 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/tests/test_organization_client.py +0 -1
- lago-python-client-1.9.0/tests/test_overdue_balance_client.py +28 -0
- lago-python-client-1.9.0/tests/test_payment_request_client.py +45 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/tests/test_plan_client.py +7 -6
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/tests/test_subscription_client.py +3 -3
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/tests/test_wallet_transaction_client.py +1 -1
- lago-python-client-1.6.0/lago_python_client/models/group.py +0 -17
- lago-python-client-1.6.0/lago_python_client/version.py +0 -1
- lago-python-client-1.6.0/tests/test_group_client.py +0 -27
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/LICENSE +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/README.md +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/__init__.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/add_ons/__init__.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/add_ons/clients.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/base_client.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/base_model.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/billable_metrics/__init__.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/coupons/__init__.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/coupons/clients.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/credit_notes/__init__.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/credit_notes/clients.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/customers/__init__.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/customers/clients.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/events/__init__.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/events/clients.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/exceptions.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/fees/__init__.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/functools_ext.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/gross_revenues/__init__.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/gross_revenues/clients.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/invoice_collections/__init__.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/invoice_collections/clients.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/invoiced_usages/__init__.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/invoiced_usages/clients.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/invoices/__init__.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/invoices/clients.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/mixins.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/models/add_on.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/models/coupon.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/models/credit_note.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/models/invoice.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/models/invoice_collection.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/models/invoiced_usage.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/models/minimum_commitment.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/models/mrr.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/models/plan.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/models/tax.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/models/webhook_endpoint.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/mrrs/__init__.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/mrrs/clients.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/organizations/__init__.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/organizations/clients.py +0 -0
- {lago-python-client-1.6.0/lago_python_client/plans → lago-python-client-1.9.0/lago_python_client/overdue_balances}/__init__.py +0 -0
- {lago-python-client-1.6.0/lago_python_client/services → lago-python-client-1.9.0/lago_python_client/plans}/__init__.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/plans/clients.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/py.typed +0 -0
- {lago-python-client-1.6.0/lago_python_client/subscriptions → lago-python-client-1.9.0/lago_python_client/services}/__init__.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/services/json.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/services/request.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/services/response.py +0 -0
- {lago-python-client-1.6.0/lago_python_client/taxes → lago-python-client-1.9.0/lago_python_client/subscriptions}/__init__.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/subscriptions/clients.py +0 -0
- {lago-python-client-1.6.0/lago_python_client/wallets → lago-python-client-1.9.0/lago_python_client/taxes}/__init__.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/taxes/clients.py +0 -0
- {lago-python-client-1.6.0/lago_python_client/webhook_endpoints → lago-python-client-1.9.0/lago_python_client/wallets}/__init__.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/wallets/clients.py +0 -0
- {lago-python-client-1.6.0/lago_python_client/webhooks → lago-python-client-1.9.0/lago_python_client/webhook_endpoints}/__init__.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/webhook_endpoints/clients.py +0 -0
- {lago-python-client-1.6.0/tests → lago-python-client-1.9.0/lago_python_client/webhooks}/__init__.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/webhooks/clients.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client.egg-info/dependency_links.txt +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client.egg-info/top_level.txt +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/pyproject.toml +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/tests/test_add_on_client.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/tests/test_applied_coupon_client.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/tests/test_client.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/tests/test_coupon_client.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/tests/test_credit_note_client.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/tests/test_fee_client.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/tests/test_functools_ext.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/tests/test_invoice_client.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/tests/test_invoice_collection_client.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/tests/test_invoiced_usage_client.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/tests/test_json_services.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/tests/test_mrr_client.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/tests/test_request_services.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/tests/test_response_services.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/tests/test_tax_client.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/tests/test_wallet_client.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/tests/test_webhook_client.py +0 -0
- {lago-python-client-1.6.0 → lago-python-client-1.9.0}/tests/test_webhook_endpoint_client.py +0 -0
{lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/billable_metrics/clients.py
RENAMED
|
@@ -4,7 +4,6 @@ from typing import Any, ClassVar, Type, Union
|
|
|
4
4
|
from ..base_client import BaseClient
|
|
5
5
|
from ..mixins import CreateCommandMixin, DestroyCommandMixin, FindAllCommandMixin, FindCommandMixin, UpdateCommandMixin
|
|
6
6
|
from ..models.billable_metric import BillableMetricResponse
|
|
7
|
-
from ..models.group import GroupResponse
|
|
8
7
|
from ..services.request import make_headers, make_url, send_get_request
|
|
9
8
|
from ..services.response import get_response_data, prepare_index_response, Response
|
|
10
9
|
|
|
@@ -25,25 +24,3 @@ class BillableMetricClient(
|
|
|
25
24
|
API_RESOURCE: ClassVar[str] = 'billable_metrics'
|
|
26
25
|
RESPONSE_MODEL: ClassVar[Type[BillableMetricResponse]] = BillableMetricResponse
|
|
27
26
|
ROOT_NAME: ClassVar[str] = 'billable_metric'
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
class GroupClient(BaseClient):
|
|
31
|
-
API_RESOURCE: ClassVar[str] = 'groups'
|
|
32
|
-
RESPONSE_MODEL: ClassVar[Type[GroupResponse]] = GroupResponse
|
|
33
|
-
ROOT_NAME: ClassVar[str] = 'group'
|
|
34
|
-
|
|
35
|
-
def find_all(self, metric_code: str, options: Mapping[str, Union[int, str]] = {}) -> Mapping[str, Any]:
|
|
36
|
-
api_response: Response = send_get_request(
|
|
37
|
-
url=make_url(
|
|
38
|
-
origin=self.base_url,
|
|
39
|
-
path_parts=('billable_metrics', metric_code, self.API_RESOURCE),
|
|
40
|
-
query_pairs=options,
|
|
41
|
-
),
|
|
42
|
-
headers=make_headers(api_key=self.api_key),
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
return prepare_index_response(
|
|
46
|
-
api_resource=self.API_RESOURCE,
|
|
47
|
-
response_model=self.RESPONSE_MODEL,
|
|
48
|
-
data=get_response_data(response=api_response),
|
|
49
|
-
)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from urllib.parse import urljoin
|
|
2
2
|
|
|
3
3
|
from .add_ons.clients import AddOnClient
|
|
4
|
-
from .billable_metrics.clients import BillableMetricClient
|
|
4
|
+
from .billable_metrics.clients import BillableMetricClient
|
|
5
5
|
from .coupons.clients import AppliedCouponClient, CouponClient
|
|
6
6
|
from .credit_notes.clients import CreditNoteClient
|
|
7
7
|
from .customers.clients import CustomerClient
|
|
@@ -13,6 +13,8 @@ from .invoices.clients import InvoiceClient
|
|
|
13
13
|
from .invoiced_usages.clients import InvoicedUsageClient
|
|
14
14
|
from .mrrs.clients import MrrClient
|
|
15
15
|
from .organizations.clients import OrganizationClient
|
|
16
|
+
from .overdue_balances.clients import OverdueBalanceClient
|
|
17
|
+
from .payment_requests.clients import PaymentRequestClient
|
|
16
18
|
from .invoice_collections.clients import InvoiceCollectionClient
|
|
17
19
|
from .plans.clients import PlanClient
|
|
18
20
|
from .subscriptions.clients import SubscriptionClient
|
|
@@ -47,10 +49,6 @@ class Client:
|
|
|
47
49
|
def billable_metrics(self) -> BillableMetricClient:
|
|
48
50
|
return BillableMetricClient(self.base_api_url, self.api_key)
|
|
49
51
|
|
|
50
|
-
@callable_cached_property
|
|
51
|
-
def groups(self) -> GroupClient:
|
|
52
|
-
return GroupClient(self.base_api_url, self.api_key)
|
|
53
|
-
|
|
54
52
|
@callable_cached_property
|
|
55
53
|
def coupons(self) -> CouponClient:
|
|
56
54
|
return CouponClient(self.base_api_url, self.api_key)
|
|
@@ -95,6 +93,14 @@ class Client:
|
|
|
95
93
|
def organizations(self) -> OrganizationClient:
|
|
96
94
|
return OrganizationClient(self.base_api_url, self.api_key)
|
|
97
95
|
|
|
96
|
+
@callable_cached_property
|
|
97
|
+
def overdue_balances(self) -> OverdueBalanceClient:
|
|
98
|
+
return OverdueBalanceClient(self.base_api_url, self.api_key)
|
|
99
|
+
|
|
100
|
+
@callable_cached_property
|
|
101
|
+
def payment_requests(self) -> PaymentRequestClient:
|
|
102
|
+
return PaymentRequestClient(self.base_api_url, self.api_key)
|
|
103
|
+
|
|
98
104
|
@callable_cached_property
|
|
99
105
|
def invoice_collections(self) -> InvoiceCollectionClient:
|
|
100
106
|
return InvoiceCollectionClient(self.base_api_url, self.api_key)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from typing import ClassVar, Type
|
|
2
2
|
|
|
3
3
|
from ..base_client import BaseClient
|
|
4
|
-
from ..mixins import FindCommandMixin, FindAllCommandMixin, UpdateCommandMixin
|
|
4
|
+
from ..mixins import FindCommandMixin, FindAllCommandMixin, UpdateCommandMixin, DestroyCommandMixin
|
|
5
5
|
from ..models.fee import FeeResponse
|
|
6
6
|
|
|
7
7
|
|
|
@@ -9,6 +9,7 @@ class FeeClient(
|
|
|
9
9
|
FindCommandMixin[FeeResponse],
|
|
10
10
|
FindAllCommandMixin[FeeResponse],
|
|
11
11
|
UpdateCommandMixin[FeeResponse],
|
|
12
|
+
DestroyCommandMixin[FeeResponse],
|
|
12
13
|
BaseClient,
|
|
13
14
|
):
|
|
14
15
|
API_RESOURCE: ClassVar[str] = 'fees'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from .applied_coupon import AppliedCoupon
|
|
2
|
-
from .billable_metric import BillableMetric,
|
|
2
|
+
from .billable_metric import BillableMetric, BillableMetricFilter, BillableMetricFilters
|
|
3
3
|
from .charge import Charge, Charges, ChargesResponse
|
|
4
4
|
from .coupon import Coupon, LimitationConfiguration
|
|
5
5
|
from .credit import CreditResponse, CreditsResponse
|
|
@@ -11,7 +11,7 @@ from .event import Event, BatchEvent
|
|
|
11
11
|
from .fee import Fee
|
|
12
12
|
from .customer import Customer, CustomerBillingConfiguration, Metadata, MetadataList,\
|
|
13
13
|
MetadataResponse, MetadataResponseList, IntegrationCustomer, IntegrationCustomerResponse,\
|
|
14
|
-
IntegrationCustomersResponseList, IntegrationCustomersList
|
|
14
|
+
IntegrationCustomersResponseList, IntegrationCustomersList, Address
|
|
15
15
|
from .invoice import InvoicePaymentStatusChange, Invoice, InvoiceMetadata, InvoiceMetadataList,\
|
|
16
16
|
OneOffInvoice, InvoiceFeesList, InvoiceFee
|
|
17
17
|
from .invoice_item import InvoiceItemResponse
|
{lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/models/applied_coupon.py
RENAMED
|
@@ -26,7 +26,7 @@ class AppliedCouponResponse(BaseResponseModel):
|
|
|
26
26
|
amount_cents: Optional[int]
|
|
27
27
|
amount_cents_remaining: Optional[int]
|
|
28
28
|
amount_currency: Optional[str]
|
|
29
|
-
|
|
29
|
+
expiration_at: Optional[str]
|
|
30
30
|
created_at: str
|
|
31
31
|
terminated_at: Optional[str]
|
|
32
32
|
percentage_rate: Optional[float]
|
{lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/models/billable_metric.py
RENAMED
|
@@ -5,11 +5,6 @@ from lago_python_client.base_model import BaseModel
|
|
|
5
5
|
from ..base_model import BaseResponseModel
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
class BillableMetricGroup(BaseModel):
|
|
9
|
-
key: Optional[str]
|
|
10
|
-
values: Optional[List[Union[str, Dict[str, Any]]]]
|
|
11
|
-
|
|
12
|
-
|
|
13
8
|
class BillableMetricFilter(BaseModel):
|
|
14
9
|
key: Optional[str]
|
|
15
10
|
values: Optional[List[str]]
|
|
@@ -27,7 +22,6 @@ class BillableMetric(BaseModel):
|
|
|
27
22
|
aggregation_type: Optional[str]
|
|
28
23
|
weighted_interval: Optional[str]
|
|
29
24
|
field_name: Optional[str]
|
|
30
|
-
group: Optional[BillableMetricGroup]
|
|
31
25
|
filters: Optional[BillableMetricFilters]
|
|
32
26
|
|
|
33
27
|
|
|
@@ -41,7 +35,6 @@ class BillableMetricResponse(BaseResponseModel):
|
|
|
41
35
|
weighted_interval: Optional[str]
|
|
42
36
|
field_name: Optional[str]
|
|
43
37
|
created_at: str
|
|
44
|
-
group: BillableMetricGroup
|
|
45
38
|
filters: BillableMetricFilters
|
|
46
39
|
active_subscriptions_count: int
|
|
47
40
|
draft_invoices_count: int
|
|
@@ -6,16 +6,6 @@ from .tax import TaxesResponse
|
|
|
6
6
|
from ..base_model import BaseResponseModel
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
class GroupProperties(BaseModel):
|
|
10
|
-
group_id: Optional[str]
|
|
11
|
-
values: Optional[Dict[str, Any]]
|
|
12
|
-
invoice_display_name: Optional[str]
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
class GroupPropertiesList(BaseModel):
|
|
16
|
-
__root__: List[GroupProperties]
|
|
17
|
-
|
|
18
|
-
|
|
19
9
|
class ChargeFilter(BaseModel):
|
|
20
10
|
invoice_display_name: Optional[str]
|
|
21
11
|
properties: Optional[Dict[str, Any]]
|
|
@@ -33,10 +23,10 @@ class Charge(BaseModel):
|
|
|
33
23
|
pay_in_advance: Optional[bool]
|
|
34
24
|
prorated: Optional[bool]
|
|
35
25
|
invoiceable: Optional[bool]
|
|
26
|
+
regroup_paid_fees: Optional[str]
|
|
36
27
|
invoice_display_name: Optional[str]
|
|
37
28
|
min_amount_cents: Optional[int]
|
|
38
29
|
properties: Optional[Dict[str, Any]]
|
|
39
|
-
group_properties: Optional[GroupPropertiesList]
|
|
40
30
|
filters: Optional[ChargeFilters]
|
|
41
31
|
tax_codes: Optional[List[str]]
|
|
42
32
|
|
|
@@ -53,10 +43,10 @@ class ChargeResponse(BaseResponseModel):
|
|
|
53
43
|
pay_in_advance: Optional[bool]
|
|
54
44
|
prorated: Optional[bool]
|
|
55
45
|
invoiceable: Optional[bool]
|
|
46
|
+
regroup_paid_fees: Optional[str]
|
|
56
47
|
invoice_display_name: Optional[str]
|
|
57
48
|
min_amount_cents: Optional[int]
|
|
58
49
|
properties: Optional[Dict[str, Any]]
|
|
59
|
-
group_properties: Optional[GroupPropertiesList]
|
|
60
50
|
filters: Optional[ChargeFilters]
|
|
61
51
|
taxes: Optional[TaxesResponse]
|
|
62
52
|
|
|
@@ -70,7 +60,6 @@ class ChargeOverrides(BaseModel):
|
|
|
70
60
|
invoice_display_name: Optional[str]
|
|
71
61
|
min_amount_cents: Optional[int]
|
|
72
62
|
properties: Optional[Dict[str, Any]]
|
|
73
|
-
group_properties: Optional[GroupPropertiesList]
|
|
74
63
|
filters: Optional[ChargeFilters]
|
|
75
64
|
tax_codes: Optional[List[str]]
|
|
76
65
|
|
|
@@ -18,6 +18,15 @@ class CustomerBillingConfiguration(BaseModel):
|
|
|
18
18
|
provider_payment_methods: Optional[List[str]]
|
|
19
19
|
|
|
20
20
|
|
|
21
|
+
class Address(BaseModel):
|
|
22
|
+
address_line1: Optional[str]
|
|
23
|
+
address_line2: Optional[str]
|
|
24
|
+
city: Optional[str]
|
|
25
|
+
zipcode: Optional[str]
|
|
26
|
+
state: Optional[str]
|
|
27
|
+
country: Optional[str]
|
|
28
|
+
|
|
29
|
+
|
|
21
30
|
class IntegrationCustomer(BaseModel):
|
|
22
31
|
id: Optional[str]
|
|
23
32
|
external_customer_id: Optional[str]
|
|
@@ -87,6 +96,7 @@ class Customer(BaseModel):
|
|
|
87
96
|
zipcode: Optional[str]
|
|
88
97
|
metadata: Optional[MetadataList]
|
|
89
98
|
billing_configuration: Optional[CustomerBillingConfiguration]
|
|
99
|
+
shipping_address: Optional[Address]
|
|
90
100
|
integration_customers: Optional[IntegrationCustomersList]
|
|
91
101
|
tax_codes: Optional[List[str]]
|
|
92
102
|
|
|
@@ -116,5 +126,6 @@ class CustomerResponse(BaseResponseModel):
|
|
|
116
126
|
zipcode: Optional[str]
|
|
117
127
|
metadata: Optional[MetadataResponseList]
|
|
118
128
|
billing_configuration: Optional[CustomerBillingConfiguration]
|
|
129
|
+
shipping_address: Optional[Address]
|
|
119
130
|
integration_customers: Optional[IntegrationCustomersResponseList]
|
|
120
131
|
taxes: Optional[TaxesResponse]
|
{lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/models/customer_usage.py
RENAMED
|
@@ -11,13 +11,6 @@ class Metric(BaseModel):
|
|
|
11
11
|
code: str
|
|
12
12
|
aggregation_type: str
|
|
13
13
|
|
|
14
|
-
class Group(BaseModel):
|
|
15
|
-
lago_id: str
|
|
16
|
-
key: Optional[str]
|
|
17
|
-
value: str
|
|
18
|
-
units: str
|
|
19
|
-
amount_cents: int
|
|
20
|
-
|
|
21
14
|
|
|
22
15
|
class ChargeFilterUsage(BaseModel):
|
|
23
16
|
invoice_display_name: Optional[str]
|
|
@@ -37,7 +30,6 @@ class GroupedUsage(BaseModel):
|
|
|
37
30
|
events_count: int
|
|
38
31
|
units: float
|
|
39
32
|
grouped_by: Dict[str, str]
|
|
40
|
-
groups: List[Group]
|
|
41
33
|
filters: List[ChargeFilterUsage]
|
|
42
34
|
|
|
43
35
|
class ChargeUsage(BaseModel):
|
|
@@ -47,7 +39,6 @@ class ChargeUsage(BaseModel):
|
|
|
47
39
|
amount_currency: str
|
|
48
40
|
charge: ChargeObject
|
|
49
41
|
billable_metric: Metric
|
|
50
|
-
groups: List[Group]
|
|
51
42
|
filters: List[ChargeFilterUsage]
|
|
52
43
|
grouped_usage: Optional[List[GroupedUsage]]
|
|
53
44
|
|
|
@@ -7,8 +7,7 @@ from ..base_model import BaseResponseModel
|
|
|
7
7
|
|
|
8
8
|
class Event(BaseModel):
|
|
9
9
|
transaction_id: str
|
|
10
|
-
|
|
11
|
-
external_subscription_id: Optional[str]
|
|
10
|
+
external_subscription_id: str
|
|
12
11
|
code: str
|
|
13
12
|
timestamp: Optional[Union[int, str]]
|
|
14
13
|
properties: Optional[Dict[str, Any]]
|
|
@@ -20,10 +19,9 @@ class BatchEvent(BaseModel):
|
|
|
20
19
|
class EventResponse(BaseResponseModel):
|
|
21
20
|
lago_id: str
|
|
22
21
|
transaction_id: str
|
|
23
|
-
external_customer_id: Optional[str]
|
|
24
22
|
lago_customer_id: Optional[str]
|
|
25
23
|
lago_subscription_id: Optional[str]
|
|
26
|
-
external_subscription_id:
|
|
24
|
+
external_subscription_id: str
|
|
27
25
|
code: str
|
|
28
26
|
timestamp: str
|
|
29
27
|
properties: Optional[Dict[str, Any]]
|
{lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/models/invoice_item.py
RENAMED
|
@@ -7,9 +7,7 @@ class InvoiceItemResponse(BaseResponseModel):
|
|
|
7
7
|
type: Optional[str]
|
|
8
8
|
code: Optional[str]
|
|
9
9
|
name: Optional[str]
|
|
10
|
-
lago_id: Optional[str]
|
|
11
10
|
invoice_display_name: Optional[str]
|
|
12
|
-
group_invoice_display_name: Optional[str]
|
|
13
11
|
filter_invoice_display_name: Optional[str]
|
|
14
12
|
filters: Optional[Dict[str, List[str]]]
|
|
15
13
|
lago_item_id: Optional[str]
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
from typing import List, Optional
|
|
2
|
+
|
|
3
|
+
from ..base_model import BaseModel, BaseResponseModel
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class OverdueBalanceResponse(BaseResponseModel):
|
|
7
|
+
amount_cents: int
|
|
8
|
+
currency: str
|
|
9
|
+
month: str
|
|
10
|
+
lago_invoice_ids: List[str]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class OverdueBalancesResponse(BaseResponseModel):
|
|
14
|
+
__root__: List[OverdueBalanceResponse]
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
from typing import List, Optional
|
|
2
|
+
|
|
3
|
+
from ..base_model import BaseModel, BaseResponseModel
|
|
4
|
+
from .customer import CustomerResponse
|
|
5
|
+
|
|
6
|
+
class PaymentRequestInvoiceResponse(BaseResponseModel):
|
|
7
|
+
lago_id: str
|
|
8
|
+
sequential_id: Optional[int]
|
|
9
|
+
number: str
|
|
10
|
+
issuing_date: Optional[str]
|
|
11
|
+
payment_dispute_lost_at: Optional[str]
|
|
12
|
+
payment_due_date: Optional[str]
|
|
13
|
+
payment_overdue: bool
|
|
14
|
+
net_payment_term: int
|
|
15
|
+
invoice_type: str
|
|
16
|
+
version_number: int
|
|
17
|
+
status: str
|
|
18
|
+
payment_status: str
|
|
19
|
+
currency: str
|
|
20
|
+
fees_amount_cents: int
|
|
21
|
+
coupons_amount_cents: int
|
|
22
|
+
taxes_amount_cents: int
|
|
23
|
+
credit_notes_amount_cents: int
|
|
24
|
+
sub_total_excluding_taxes_amount_cents: int
|
|
25
|
+
sub_total_including_taxes_amount_cents: int
|
|
26
|
+
total_amount_cents: int
|
|
27
|
+
prepaid_credit_amount_cents: int
|
|
28
|
+
file_url: Optional[str]
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class PaymentRequestInvoicesResponse(BaseResponseModel):
|
|
32
|
+
__root__: List[PaymentRequestInvoiceResponse]
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class PaymentRequestResponse(BaseResponseModel):
|
|
36
|
+
lago_id: str
|
|
37
|
+
email: str
|
|
38
|
+
amount_cents: int
|
|
39
|
+
amount_currency: str
|
|
40
|
+
created_at: str
|
|
41
|
+
customer: Optional[CustomerResponse]
|
|
42
|
+
invoices: Optional[PaymentRequestInvoicesResponse]
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class PaymentRequestsResponse(BaseResponseModel):
|
|
46
|
+
__root__: List[PaymentRequestResponse]
|
{lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client/models/subscription.py
RENAMED
|
@@ -10,7 +10,7 @@ class Subscription(BaseModel):
|
|
|
10
10
|
external_customer_id: Optional[str]
|
|
11
11
|
name: Optional[str]
|
|
12
12
|
external_id: Optional[str]
|
|
13
|
-
|
|
13
|
+
subscription_at: Optional[str]
|
|
14
14
|
billing_time: Optional[str]
|
|
15
15
|
ending_at: Optional[str]
|
|
16
16
|
plan_overrides: Optional[PlanOverrides]
|
|
@@ -30,7 +30,9 @@ class SubscriptionResponse(BaseResponseModel):
|
|
|
30
30
|
billing_time: Optional[str]
|
|
31
31
|
terminated_at: Optional[str]
|
|
32
32
|
ending_at: Optional[str]
|
|
33
|
+
trial_ended_at: Optional[str]
|
|
33
34
|
subscription_date: Optional[str]
|
|
35
|
+
subscription_at: Optional[str]
|
|
34
36
|
previous_plan_code: Optional[str]
|
|
35
37
|
next_plan_code: Optional[str]
|
|
36
38
|
downgrade_plan_date: Optional[str]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import List, Optional
|
|
1
|
+
from typing import List, Optional, Dict
|
|
2
2
|
|
|
3
3
|
from lago_python_client.base_model import BaseModel
|
|
4
4
|
|
|
@@ -15,6 +15,7 @@ class RecurringTransactionRule(BaseModel):
|
|
|
15
15
|
granted_credits: Optional[str]
|
|
16
16
|
started_at: Optional[str]
|
|
17
17
|
target_ongoing_balance: Optional[str]
|
|
18
|
+
transaction_metadata: Optional[List[Dict[str, str]]]
|
|
18
19
|
|
|
19
20
|
|
|
20
21
|
class RecurringTransactionRuleResponse(BaseModel):
|
|
@@ -28,6 +29,7 @@ class RecurringTransactionRuleResponse(BaseModel):
|
|
|
28
29
|
started_at: Optional[str]
|
|
29
30
|
target_ongoing_balance: Optional[str]
|
|
30
31
|
created_at: Optional[str]
|
|
32
|
+
transaction_metadata: Optional[List[Dict[str, str]]]
|
|
31
33
|
|
|
32
34
|
|
|
33
35
|
class RecurringTransactionRuleList(BaseModel):
|
|
@@ -47,6 +49,7 @@ class Wallet(BaseModel):
|
|
|
47
49
|
expiration_at: Optional[str]
|
|
48
50
|
currency: Optional[str]
|
|
49
51
|
recurring_transaction_rules: Optional[RecurringTransactionRuleList]
|
|
52
|
+
transaction_metadata: Optional[List[Dict[str, str]]]
|
|
50
53
|
|
|
51
54
|
|
|
52
55
|
class WalletResponse(BaseResponseModel):
|
|
@@ -70,4 +73,3 @@ class WalletResponse(BaseResponseModel):
|
|
|
70
73
|
ongoing_usage_balance_cents: int
|
|
71
74
|
credits_ongoing_balance: str
|
|
72
75
|
credits_ongoing_usage_balance: str
|
|
73
|
-
balance: str # NOTE(legacy)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import Optional
|
|
1
|
+
from typing import Optional, List, Dict
|
|
2
2
|
|
|
3
3
|
from lago_python_client.base_model import BaseModel
|
|
4
4
|
|
|
@@ -10,15 +10,18 @@ class WalletTransaction(BaseModel):
|
|
|
10
10
|
paid_credits: Optional[str]
|
|
11
11
|
granted_credits: Optional[str]
|
|
12
12
|
voided_credits: Optional[str]
|
|
13
|
+
metadata: Optional[List[Dict[str, str]]]
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
class WalletTransactionResponse(BaseResponseModel):
|
|
16
17
|
lago_id: str
|
|
17
18
|
lago_wallet_id: str
|
|
18
19
|
status: str
|
|
20
|
+
source: str
|
|
19
21
|
transaction_status: str
|
|
20
22
|
transaction_type: str
|
|
21
23
|
amount: str
|
|
22
24
|
credit_amount: str
|
|
23
25
|
settled_at: Optional[str]
|
|
24
26
|
created_at: str
|
|
27
|
+
metadata: Optional[List[Dict[str, str]]]
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
from typing import Any, ClassVar, Type, Union
|
|
3
|
+
|
|
4
|
+
from ..base_client import BaseClient
|
|
5
|
+
from ..mixins import FindAllCommandMixin
|
|
6
|
+
from ..models.overdue_balance import OverdueBalanceResponse
|
|
7
|
+
from ..services.request import make_headers, make_url, send_get_request
|
|
8
|
+
from ..services.response import get_response_data, prepare_index_response, Response
|
|
9
|
+
|
|
10
|
+
if sys.version_info >= (3, 9):
|
|
11
|
+
from collections.abc import Mapping
|
|
12
|
+
else:
|
|
13
|
+
from typing import Mapping
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class OverdueBalanceClient(
|
|
17
|
+
FindAllCommandMixin[OverdueBalanceResponse],
|
|
18
|
+
BaseClient,
|
|
19
|
+
):
|
|
20
|
+
API_RESOURCE: ClassVar[str] = 'overdue_balances'
|
|
21
|
+
RESPONSE_MODEL: ClassVar[Type[OverdueBalanceResponse]] = OverdueBalanceResponse
|
|
22
|
+
ROOT_NAME: ClassVar[str] = 'overdue_balance'
|
|
23
|
+
|
|
24
|
+
def find_all(self, options: Mapping[str, Union[int, str]] = {}) -> Mapping[str, Any]:
|
|
25
|
+
api_response: Response = send_get_request(
|
|
26
|
+
url=make_url(
|
|
27
|
+
origin=self.base_url,
|
|
28
|
+
path_parts=('analytics', 'overdue_balance'),
|
|
29
|
+
query_pairs=options,
|
|
30
|
+
),
|
|
31
|
+
headers=make_headers(api_key=self.api_key),
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
# Process response data
|
|
35
|
+
return prepare_index_response(
|
|
36
|
+
api_resource=self.API_RESOURCE,
|
|
37
|
+
response_model=self.RESPONSE_MODEL,
|
|
38
|
+
data=get_response_data(response=api_response),
|
|
39
|
+
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
LAGO_VERSION = '1.9.0'
|
{lago-python-client-1.6.0 → lago-python-client-1.9.0}/lago_python_client.egg-info/SOURCES.txt
RENAMED
|
@@ -46,7 +46,6 @@ setup.cfg
|
|
|
46
46
|
./lago_python_client/models/event.py
|
|
47
47
|
./lago_python_client/models/fee.py
|
|
48
48
|
./lago_python_client/models/gross_revenue.py
|
|
49
|
-
./lago_python_client/models/group.py
|
|
50
49
|
./lago_python_client/models/invoice.py
|
|
51
50
|
./lago_python_client/models/invoice_collection.py
|
|
52
51
|
./lago_python_client/models/invoice_item.py
|
|
@@ -54,6 +53,8 @@ setup.cfg
|
|
|
54
53
|
./lago_python_client/models/minimum_commitment.py
|
|
55
54
|
./lago_python_client/models/mrr.py
|
|
56
55
|
./lago_python_client/models/organization.py
|
|
56
|
+
./lago_python_client/models/overdue_balance.py
|
|
57
|
+
./lago_python_client/models/payment_request.py
|
|
57
58
|
./lago_python_client/models/plan.py
|
|
58
59
|
./lago_python_client/models/subscription.py
|
|
59
60
|
./lago_python_client/models/tax.py
|
|
@@ -64,6 +65,8 @@ setup.cfg
|
|
|
64
65
|
./lago_python_client/mrrs/clients.py
|
|
65
66
|
./lago_python_client/organizations/__init__.py
|
|
66
67
|
./lago_python_client/organizations/clients.py
|
|
68
|
+
./lago_python_client/overdue_balances/__init__.py
|
|
69
|
+
./lago_python_client/overdue_balances/clients.py
|
|
67
70
|
./lago_python_client/plans/__init__.py
|
|
68
71
|
./lago_python_client/plans/clients.py
|
|
69
72
|
./lago_python_client/services/__init__.py
|
|
@@ -92,13 +95,14 @@ setup.cfg
|
|
|
92
95
|
./tests/test_fee_client.py
|
|
93
96
|
./tests/test_functools_ext.py
|
|
94
97
|
./tests/test_gross_revenue_client.py
|
|
95
|
-
./tests/test_group_client.py
|
|
96
98
|
./tests/test_invoice_client.py
|
|
97
99
|
./tests/test_invoice_collection_client.py
|
|
98
100
|
./tests/test_invoiced_usage_client.py
|
|
99
101
|
./tests/test_json_services.py
|
|
100
102
|
./tests/test_mrr_client.py
|
|
101
103
|
./tests/test_organization_client.py
|
|
104
|
+
./tests/test_overdue_balance_client.py
|
|
105
|
+
./tests/test_payment_request_client.py
|
|
102
106
|
./tests/test_plan_client.py
|
|
103
107
|
./tests/test_request_services.py
|
|
104
108
|
./tests/test_response_services.py
|
|
@@ -124,13 +128,14 @@ tests/test_event_client.py
|
|
|
124
128
|
tests/test_fee_client.py
|
|
125
129
|
tests/test_functools_ext.py
|
|
126
130
|
tests/test_gross_revenue_client.py
|
|
127
|
-
tests/test_group_client.py
|
|
128
131
|
tests/test_invoice_client.py
|
|
129
132
|
tests/test_invoice_collection_client.py
|
|
130
133
|
tests/test_invoiced_usage_client.py
|
|
131
134
|
tests/test_json_services.py
|
|
132
135
|
tests/test_mrr_client.py
|
|
133
136
|
tests/test_organization_client.py
|
|
137
|
+
tests/test_overdue_balance_client.py
|
|
138
|
+
tests/test_payment_request_client.py
|
|
134
139
|
tests/test_plan_client.py
|
|
135
140
|
tests/test_request_services.py
|
|
136
141
|
tests/test_response_services.py
|
|
@@ -28,7 +28,7 @@ packages = find:
|
|
|
28
28
|
python_requires = >3.6
|
|
29
29
|
install_requires =
|
|
30
30
|
classes~=0.4.1 # bugfix auto updates allowed
|
|
31
|
-
httpx
|
|
31
|
+
httpx>=0.24.0,<1.0.0 # minor auto updates allowed
|
|
32
32
|
orjson~=3.8 # minor auto updates allowed
|
|
33
33
|
pydantic>=1.10,<3 # minor auto updates allowed
|
|
34
34
|
typeguard~=3.0.2 # bugfix auto updates allowed
|
|
File without changes
|
|
@@ -5,7 +5,7 @@ from pytest_httpx import HTTPXMock
|
|
|
5
5
|
|
|
6
6
|
from lago_python_client.client import Client
|
|
7
7
|
from lago_python_client.exceptions import LagoApiError
|
|
8
|
-
from lago_python_client.models import BillableMetric,
|
|
8
|
+
from lago_python_client.models import BillableMetric, BillableMetricFilter, BillableMetricFilters
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
def billable_metric_object():
|
|
@@ -16,13 +16,13 @@ def billable_metric_object():
|
|
|
16
16
|
aggregation_type='sum_agg',
|
|
17
17
|
field_name='amount_sum',
|
|
18
18
|
recurring=False,
|
|
19
|
-
|
|
19
|
+
filters=filters(),
|
|
20
20
|
weighted_interval='seconds'
|
|
21
21
|
)
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
def
|
|
25
|
-
return
|
|
24
|
+
def filters():
|
|
25
|
+
return BillableMetricFilters(__root__=[BillableMetricFilter(key='country', values=['france', 'italy', 'spain'])])
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
def mock_response():
|
|
@@ -49,7 +49,7 @@ def test_valid_create_billable_metric_request(httpx_mock: HTTPXMock):
|
|
|
49
49
|
|
|
50
50
|
assert response.lago_id == 'b7ab2926-1de8-4428-9bcd-779314ac129b'
|
|
51
51
|
assert response.code == 'bm_code'
|
|
52
|
-
assert response.
|
|
52
|
+
assert response.filters == filters()
|
|
53
53
|
|
|
54
54
|
|
|
55
55
|
def test_invalid_create_billable_metric_request(httpx_mock: HTTPXMock):
|