lago-python-client 1.0.0__tar.gz → 1.2.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.0.0 → lago-python-client-1.2.0}/PKG-INFO +1 -1
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/invoices/clients.py +14 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/models/__init__.py +1 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/models/billable_metric.py +11 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/models/charge.py +13 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/models/customer_usage.py +11 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/models/fee.py +1 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/models/invoice.py +2 -1
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/models/invoice_item.py +3 -1
- lago-python-client-1.2.0/lago_python_client/models/minimum_commitment.py +28 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/models/plan.py +4 -0
- lago-python-client-1.2.0/lago_python_client/version.py +1 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client.egg-info/PKG-INFO +1 -1
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client.egg-info/SOURCES.txt +1 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/tests/test_invoice_client.py +9 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/tests/test_plan_client.py +12 -2
- lago-python-client-1.0.0/lago_python_client/version.py +0 -1
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/LICENSE +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/README.md +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/__init__.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/add_ons/__init__.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/add_ons/clients.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/base_client.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/base_model.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/billable_metrics/__init__.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/billable_metrics/clients.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/client.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/coupons/__init__.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/coupons/clients.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/credit_notes/__init__.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/credit_notes/clients.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/customers/__init__.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/customers/clients.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/events/__init__.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/events/clients.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/exceptions.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/fees/__init__.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/fees/clients.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/functools_ext.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/gross_revenues/__init__.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/gross_revenues/clients.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/invoice_collections/__init__.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/invoice_collections/clients.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/invoiced_usages/__init__.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/invoiced_usages/clients.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/invoices/__init__.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/mixins.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/models/add_on.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/models/applied_coupon.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/models/coupon.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/models/credit.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/models/credit_note.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/models/customer.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/models/event.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/models/gross_revenue.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/models/group.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/models/invoice_collection.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/models/invoiced_usage.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/models/mrr.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/models/organization.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/models/subscription.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/models/tax.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/models/wallet.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/models/wallet_transaction.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/models/webhook_endpoint.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/mrrs/__init__.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/mrrs/clients.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/organizations/__init__.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/organizations/clients.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/plans/__init__.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/plans/clients.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/py.typed +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/services/__init__.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/services/json.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/services/request.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/services/response.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/subscriptions/__init__.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/subscriptions/clients.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/taxes/__init__.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/taxes/clients.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/wallets/__init__.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/wallets/clients.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/webhook_endpoints/__init__.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/webhook_endpoints/clients.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/webhooks/__init__.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/webhooks/clients.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client.egg-info/dependency_links.txt +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client.egg-info/requires.txt +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client.egg-info/top_level.txt +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/pyproject.toml +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/setup.cfg +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/tests/__init__.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/tests/test_add_on_client.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/tests/test_applied_coupon_client.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/tests/test_billable_metric_client.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/tests/test_client.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/tests/test_coupon_client.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/tests/test_credit_note_client.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/tests/test_customer_client.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/tests/test_event_client.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/tests/test_fee_client.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/tests/test_functools_ext.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/tests/test_gross_revenue_client.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/tests/test_group_client.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/tests/test_invoice_collection_client.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/tests/test_invoiced_usage_client.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/tests/test_json_services.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/tests/test_mrr_client.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/tests/test_organization_client.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/tests/test_request_services.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/tests/test_response_services.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/tests/test_subscription_client.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/tests/test_tax_client.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/tests/test_wallet_client.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/tests/test_wallet_transaction_client.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/tests/test_webhook_client.py +0 -0
- {lago-python-client-1.0.0 → lago-python-client-1.2.0}/tests/test_webhook_endpoint_client.py +0 -0
{lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/invoices/clients.py
RENAMED
|
@@ -82,6 +82,20 @@ class InvoiceClient(
|
|
|
82
82
|
data=get_response_data(response=api_response, key=self.ROOT_NAME),
|
|
83
83
|
)
|
|
84
84
|
|
|
85
|
+
def lose_dispute(self, resource_id: str) -> InvoiceResponse:
|
|
86
|
+
api_response: Response = send_put_request(
|
|
87
|
+
url=make_url(
|
|
88
|
+
origin=self.base_url,
|
|
89
|
+
path_parts=(self.API_RESOURCE, resource_id, 'lose_dispute'),
|
|
90
|
+
),
|
|
91
|
+
headers=make_headers(api_key=self.api_key),
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
return prepare_object_response(
|
|
95
|
+
response_model=self.RESPONSE_MODEL,
|
|
96
|
+
data=get_response_data(response=api_response, key=self.ROOT_NAME),
|
|
97
|
+
)
|
|
98
|
+
|
|
85
99
|
def payment_url(self, resource_id: str) -> str:
|
|
86
100
|
api_response: Response = send_post_request(
|
|
87
101
|
url=make_url(
|
|
@@ -14,6 +14,7 @@ from .customer import Customer, CustomerBillingConfiguration, Metadata, Metadata
|
|
|
14
14
|
from .invoice import InvoicePaymentStatusChange, Invoice, InvoiceMetadata, InvoiceMetadataList,\
|
|
15
15
|
OneOffInvoice, InvoiceFeesList, InvoiceFee
|
|
16
16
|
from .invoice_item import InvoiceItemResponse
|
|
17
|
+
from .minimum_commitment import MinimumCommitment, MinimumCommitmentResponse
|
|
17
18
|
from .subscription import Subscription
|
|
18
19
|
from .customer_usage import Metric, ChargeObject, ChargeUsage, CustomerUsageResponse
|
|
19
20
|
from .tax import Tax, Taxes, TaxResponse, TaxesResponse
|
{lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/models/billable_metric.py
RENAMED
|
@@ -10,6 +10,15 @@ class BillableMetricGroup(BaseModel):
|
|
|
10
10
|
values: Optional[List[Union[str, Dict[str, Any]]]]
|
|
11
11
|
|
|
12
12
|
|
|
13
|
+
class BillableMetricFilter(BaseModel):
|
|
14
|
+
key: Optional[str]
|
|
15
|
+
values: Optional[List[str]]
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class BillableMetricFilters(BaseModel):
|
|
19
|
+
__root__: List[BillableMetricFilter]
|
|
20
|
+
|
|
21
|
+
|
|
13
22
|
class BillableMetric(BaseModel):
|
|
14
23
|
name: Optional[str]
|
|
15
24
|
code: Optional[str]
|
|
@@ -19,6 +28,7 @@ class BillableMetric(BaseModel):
|
|
|
19
28
|
weighted_interval: Optional[str]
|
|
20
29
|
field_name: Optional[str]
|
|
21
30
|
group: Optional[BillableMetricGroup]
|
|
31
|
+
filters: Optional[BillableMetricFilters]
|
|
22
32
|
|
|
23
33
|
|
|
24
34
|
class BillableMetricResponse(BaseResponseModel):
|
|
@@ -32,6 +42,7 @@ class BillableMetricResponse(BaseResponseModel):
|
|
|
32
42
|
field_name: Optional[str]
|
|
33
43
|
created_at: str
|
|
34
44
|
group: BillableMetricGroup
|
|
45
|
+
filters: BillableMetricFilters
|
|
35
46
|
active_subscriptions_count: int
|
|
36
47
|
draft_invoices_count: int
|
|
37
48
|
plans_count: int
|
|
@@ -16,6 +16,16 @@ class GroupPropertiesList(BaseModel):
|
|
|
16
16
|
__root__: List[GroupProperties]
|
|
17
17
|
|
|
18
18
|
|
|
19
|
+
class ChargeFilter(BaseModel):
|
|
20
|
+
invoice_display_name: Optional[str]
|
|
21
|
+
properties: Optional[Dict[str, Any]]
|
|
22
|
+
values: Optional[Dict[str, List[str]]]
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class ChargeFilters(BaseModel):
|
|
26
|
+
__root__: List[ChargeFilter]
|
|
27
|
+
|
|
28
|
+
|
|
19
29
|
class Charge(BaseModel):
|
|
20
30
|
id: Optional[str]
|
|
21
31
|
billable_metric_id: Optional[str]
|
|
@@ -27,6 +37,7 @@ class Charge(BaseModel):
|
|
|
27
37
|
min_amount_cents: Optional[int]
|
|
28
38
|
properties: Optional[Dict[str, Any]]
|
|
29
39
|
group_properties: Optional[GroupPropertiesList]
|
|
40
|
+
filters: Optional[ChargeFilters]
|
|
30
41
|
tax_codes: Optional[List[str]]
|
|
31
42
|
|
|
32
43
|
|
|
@@ -46,6 +57,7 @@ class ChargeResponse(BaseResponseModel):
|
|
|
46
57
|
min_amount_cents: Optional[int]
|
|
47
58
|
properties: Optional[Dict[str, Any]]
|
|
48
59
|
group_properties: Optional[GroupPropertiesList]
|
|
60
|
+
filters: Optional[ChargeFilters]
|
|
49
61
|
taxes: Optional[TaxesResponse]
|
|
50
62
|
|
|
51
63
|
|
|
@@ -59,6 +71,7 @@ class ChargeOverrides(BaseModel):
|
|
|
59
71
|
min_amount_cents: Optional[int]
|
|
60
72
|
properties: Optional[Dict[str, Any]]
|
|
61
73
|
group_properties: Optional[GroupPropertiesList]
|
|
74
|
+
filters: Optional[ChargeFilters]
|
|
62
75
|
tax_codes: Optional[List[str]]
|
|
63
76
|
|
|
64
77
|
|
{lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/models/customer_usage.py
RENAMED
|
@@ -18,6 +18,15 @@ class Group(BaseModel):
|
|
|
18
18
|
units: str
|
|
19
19
|
amount_cents: int
|
|
20
20
|
|
|
21
|
+
|
|
22
|
+
class ChargeFilterUsage(BaseModel):
|
|
23
|
+
invoice_display_name: Optional[str]
|
|
24
|
+
values: Dict[str, List[str]]
|
|
25
|
+
units: str
|
|
26
|
+
amount_cents: int
|
|
27
|
+
events_count: int
|
|
28
|
+
|
|
29
|
+
|
|
21
30
|
class ChargeObject(BaseModel):
|
|
22
31
|
lago_id: str
|
|
23
32
|
charge_model: str
|
|
@@ -29,6 +38,7 @@ class GroupedUsage(BaseModel):
|
|
|
29
38
|
units: float
|
|
30
39
|
grouped_by: Dict[str, str]
|
|
31
40
|
groups: List[Group]
|
|
41
|
+
filters: List[ChargeFilterUsage]
|
|
32
42
|
|
|
33
43
|
class ChargeUsage(BaseModel):
|
|
34
44
|
units: float
|
|
@@ -38,6 +48,7 @@ class ChargeUsage(BaseModel):
|
|
|
38
48
|
charge: ChargeObject
|
|
39
49
|
billable_metric: Metric
|
|
40
50
|
groups: List[Group]
|
|
51
|
+
filters: List[ChargeFilterUsage]
|
|
41
52
|
grouped_usage: Optional[List[GroupedUsage]]
|
|
42
53
|
|
|
43
54
|
|
|
@@ -28,6 +28,7 @@ class FeeAppliedTaxes(BaseResponseModel):
|
|
|
28
28
|
class FeeResponse(BaseResponseModel):
|
|
29
29
|
lago_id: Optional[str]
|
|
30
30
|
lago_group_id: Optional[str]
|
|
31
|
+
lago_charge_filter_id: Optional[str]
|
|
31
32
|
lago_invoice_id: Optional[str]
|
|
32
33
|
lago_true_up_fee_id: Optional[str]
|
|
33
34
|
lago_true_up_parent_fee_id: Optional[str]
|
|
@@ -68,9 +68,10 @@ class InvoiceAppliedTaxes(BaseResponseModel):
|
|
|
68
68
|
|
|
69
69
|
class InvoiceResponse(BaseResponseModel):
|
|
70
70
|
lago_id: str
|
|
71
|
-
sequential_id: int
|
|
71
|
+
sequential_id: Optional[int]
|
|
72
72
|
number: str
|
|
73
73
|
issuing_date: Optional[str]
|
|
74
|
+
payment_dispute_lost_at: Optional[str]
|
|
74
75
|
payment_due_date: Optional[str]
|
|
75
76
|
net_payment_term: int
|
|
76
77
|
invoice_type: str
|
{lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/models/invoice_item.py
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import Dict, Optional
|
|
1
|
+
from typing import Dict, List, Optional
|
|
2
2
|
|
|
3
3
|
from ..base_model import BaseResponseModel
|
|
4
4
|
|
|
@@ -10,6 +10,8 @@ class InvoiceItemResponse(BaseResponseModel):
|
|
|
10
10
|
lago_id: Optional[str]
|
|
11
11
|
invoice_display_name: Optional[str]
|
|
12
12
|
group_invoice_display_name: Optional[str]
|
|
13
|
+
filter_invoice_display_name: Optional[str]
|
|
14
|
+
filters: Optional[Dict[str, List[str]]]
|
|
13
15
|
lago_item_id: Optional[str]
|
|
14
16
|
item_type: Optional[str]
|
|
15
17
|
grouped_by: Optional[Dict[str, str]]
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
from typing import Any, Dict, 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
|
+
|
|
10
|
+
class MinimumCommitment(BaseModel):
|
|
11
|
+
amount_cents: Optional[int]
|
|
12
|
+
invoice_display_name: Optional[str]
|
|
13
|
+
tax_codes: Optional[List[str]]
|
|
14
|
+
|
|
15
|
+
class MinimumCommitmentResponse(BaseResponseModel):
|
|
16
|
+
lago_id: str
|
|
17
|
+
amount_cents: int
|
|
18
|
+
invoice_display_name: Optional[str]
|
|
19
|
+
interval: str
|
|
20
|
+
taxes: Optional[TaxesResponse]
|
|
21
|
+
created_at: Optional[str]
|
|
22
|
+
updated_at: Optional[str]
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class MinimumCommitmentOverrides(BaseModel):
|
|
26
|
+
amount_cents: Optional[int]
|
|
27
|
+
invoice_display_name: Optional[str]
|
|
28
|
+
tax_codes: Optional[List[str]]
|
|
@@ -3,6 +3,7 @@ from typing import List, Optional
|
|
|
3
3
|
from lago_python_client.base_model import BaseModel
|
|
4
4
|
|
|
5
5
|
from .charge import Charges, ChargesResponse, ChargesOverrides
|
|
6
|
+
from .minimum_commitment import MinimumCommitment, MinimumCommitmentResponse, MinimumCommitmentOverrides
|
|
6
7
|
from .tax import Taxes, TaxesResponse
|
|
7
8
|
from ..base_model import BaseResponseModel
|
|
8
9
|
|
|
@@ -19,6 +20,7 @@ class Plan(BaseModel):
|
|
|
19
20
|
pay_in_advance: Optional[bool]
|
|
20
21
|
bill_charges_monthly: Optional[bool]
|
|
21
22
|
charges: Optional[Charges]
|
|
23
|
+
minimum_commitment: Optional[MinimumCommitment]
|
|
22
24
|
tax_codes: Optional[List[str]]
|
|
23
25
|
|
|
24
26
|
|
|
@@ -36,6 +38,7 @@ class PlanResponse(BaseResponseModel):
|
|
|
36
38
|
pay_in_advance: Optional[bool]
|
|
37
39
|
bill_charges_monthly: Optional[bool]
|
|
38
40
|
charges: Optional[ChargesResponse]
|
|
41
|
+
minimum_commitment: Optional[MinimumCommitmentResponse]
|
|
39
42
|
active_subscriptions_count: int
|
|
40
43
|
draft_invoices_count: int
|
|
41
44
|
taxes: Optional[TaxesResponse]
|
|
@@ -48,4 +51,5 @@ class PlanOverrides(BaseModel):
|
|
|
48
51
|
amount_currency: Optional[str]
|
|
49
52
|
trial_period: Optional[float]
|
|
50
53
|
charges: Optional[ChargesOverrides]
|
|
54
|
+
minimum_commitment: Optional[MinimumCommitmentOverrides]
|
|
51
55
|
tax_codes: Optional[List[str]]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
LAGO_VERSION = '1.2.0'
|
{lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client.egg-info/SOURCES.txt
RENAMED
|
@@ -51,6 +51,7 @@ setup.cfg
|
|
|
51
51
|
./lago_python_client/models/invoice_collection.py
|
|
52
52
|
./lago_python_client/models/invoice_item.py
|
|
53
53
|
./lago_python_client/models/invoiced_usage.py
|
|
54
|
+
./lago_python_client/models/minimum_commitment.py
|
|
54
55
|
./lago_python_client/models/mrr.py
|
|
55
56
|
./lago_python_client/models/organization.py
|
|
56
57
|
./lago_python_client/models/plan.py
|
|
@@ -151,6 +151,15 @@ def test_valid_refresh_invoice_request(httpx_mock: HTTPXMock):
|
|
|
151
151
|
assert response.lago_id == '5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba'
|
|
152
152
|
|
|
153
153
|
|
|
154
|
+
def test_valid_lose_dispute_invoice_request(httpx_mock: HTTPXMock):
|
|
155
|
+
client = Client(api_key='886fe239-927d-4072-ab72-6dd345e8dd0d')
|
|
156
|
+
|
|
157
|
+
httpx_mock.add_response(method='PUT', url='https://api.getlago.com/api/v1/invoices/5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba/lose_dispute', content=mock_response())
|
|
158
|
+
response = client.invoices.lose_dispute('5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba')
|
|
159
|
+
|
|
160
|
+
assert response.lago_id == '5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba'
|
|
161
|
+
|
|
162
|
+
|
|
154
163
|
def test_valid_finalize_invoice_request(httpx_mock: HTTPXMock):
|
|
155
164
|
client = Client(api_key='886fe239-927d-4072-ab72-6dd345e8dd0d')
|
|
156
165
|
|
|
@@ -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 Plan, Charge, Charges
|
|
8
|
+
from lago_python_client.models import Plan, Charge, Charges, MinimumCommitment
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
def plan_object():
|
|
@@ -29,6 +29,11 @@ def plan_object():
|
|
|
29
29
|
)
|
|
30
30
|
charges = Charges(__root__=[charge])
|
|
31
31
|
|
|
32
|
+
minimum_commitment = MinimumCommitment(
|
|
33
|
+
amount_cents=0,
|
|
34
|
+
invoice_display_name='Commitment (C1)'
|
|
35
|
+
)
|
|
36
|
+
|
|
32
37
|
return Plan(
|
|
33
38
|
name='name',
|
|
34
39
|
invoice_display_name='invoice_display_name',
|
|
@@ -38,7 +43,8 @@ def plan_object():
|
|
|
38
43
|
description='desc',
|
|
39
44
|
interval='weekly',
|
|
40
45
|
pay_in_advance=True,
|
|
41
|
-
charges=charges
|
|
46
|
+
charges=charges,
|
|
47
|
+
minimum_commitment=minimum_commitment
|
|
42
48
|
)
|
|
43
49
|
|
|
44
50
|
|
|
@@ -113,6 +119,7 @@ def test_valid_create_plan_request(httpx_mock: HTTPXMock):
|
|
|
113
119
|
assert response.code == 'plan_code'
|
|
114
120
|
assert response.invoice_display_name == 'test plan 1'
|
|
115
121
|
assert response.charges.__root__[0].invoice_display_name == 'Setup'
|
|
122
|
+
assert response.minimum_commitment.invoice_display_name == 'Minimum commitment (C1)'
|
|
116
123
|
|
|
117
124
|
|
|
118
125
|
def test_valid_create_graduated_plan_request(httpx_mock: HTTPXMock):
|
|
@@ -145,6 +152,7 @@ def test_valid_update_plan_request(httpx_mock: HTTPXMock):
|
|
|
145
152
|
assert response.lago_id == 'b7ab2926-1de8-4428-9bcd-779314ac129b'
|
|
146
153
|
assert response.code == code
|
|
147
154
|
assert response.invoice_display_name == 'test plan 1'
|
|
155
|
+
assert response.minimum_commitment.invoice_display_name == 'Minimum commitment (C1)'
|
|
148
156
|
|
|
149
157
|
|
|
150
158
|
def test_invalid_update_plan_request(httpx_mock: HTTPXMock):
|
|
@@ -169,6 +177,7 @@ def test_valid_find_plan_request(httpx_mock: HTTPXMock):
|
|
|
169
177
|
assert response.invoice_display_name == 'test plan 1'
|
|
170
178
|
assert response.charges.__root__[0].charge_model == 'standard'
|
|
171
179
|
assert response.charges.__root__[0].min_amount_cents == 0
|
|
180
|
+
assert response.minimum_commitment.amount_cents == 1000
|
|
172
181
|
|
|
173
182
|
|
|
174
183
|
def test_invalid_find_plan_request(httpx_mock: HTTPXMock):
|
|
@@ -210,6 +219,7 @@ def test_valid_find_all_plan_request(httpx_mock: HTTPXMock):
|
|
|
210
219
|
|
|
211
220
|
assert response['plans'][0].lago_id == 'b7ab2926-1de8-4428-9bcd-779314ac1111'
|
|
212
221
|
assert response['plans'][0].invoice_display_name == 'test plan 1'
|
|
222
|
+
assert response['plans'][0].minimum_commitment.invoice_display_name == 'Minimum commitment (C2)'
|
|
213
223
|
assert response['plans'][0].charges.__root__[0].lago_id == '51c1e851-5be6-4343-a0ee-39a81d8b4ee1'
|
|
214
224
|
assert response['plans'][0].charges.__root__[0].group_properties.__root__[0].group_id == 'gfc1e851-5be6-4343-a0ee-39a81d8b4ee1'
|
|
215
225
|
assert response['plans'][0].charges.__root__[0].group_properties.__root__[0].values['amount'] == '0.22'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
LAGO_VERSION = '1.0.0'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/add_ons/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/billable_metrics/clients.py
RENAMED
|
File without changes
|
|
File without changes
|
{lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/coupons/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/credit_notes/__init__.py
RENAMED
|
File without changes
|
{lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/credit_notes/clients.py
RENAMED
|
File without changes
|
{lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/customers/__init__.py
RENAMED
|
File without changes
|
{lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/customers/clients.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/gross_revenues/__init__.py
RENAMED
|
File without changes
|
{lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/gross_revenues/clients.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/invoiced_usages/__init__.py
RENAMED
|
File without changes
|
{lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/invoiced_usages/clients.py
RENAMED
|
File without changes
|
{lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/invoices/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/models/applied_coupon.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/models/credit_note.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/models/gross_revenue.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/models/invoiced_usage.py
RENAMED
|
File without changes
|
|
File without changes
|
{lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/models/organization.py
RENAMED
|
File without changes
|
{lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/models/subscription.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/models/webhook_endpoint.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/organizations/__init__.py
RENAMED
|
File without changes
|
{lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/organizations/clients.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/services/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/services/request.py
RENAMED
|
File without changes
|
{lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/services/response.py
RENAMED
|
File without changes
|
{lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/subscriptions/__init__.py
RENAMED
|
File without changes
|
{lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/subscriptions/clients.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/wallets/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/webhooks/__init__.py
RENAMED
|
File without changes
|
{lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client/webhooks/clients.py
RENAMED
|
File without changes
|
|
File without changes
|
{lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client.egg-info/requires.txt
RENAMED
|
File without changes
|
{lago-python-client-1.0.0 → lago-python-client-1.2.0}/lago_python_client.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lago-python-client-1.0.0 → lago-python-client-1.2.0}/tests/test_invoice_collection_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lago-python-client-1.0.0 → lago-python-client-1.2.0}/tests/test_wallet_transaction_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|