dodopayments 1.53.4__py3-none-any.whl → 1.53.5__py3-none-any.whl
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.
Potentially problematic release.
This version of dodopayments might be problematic. Click here for more details.
- dodopayments/__init__.py +3 -1
- dodopayments/_base_client.py +9 -9
- dodopayments/_client.py +12 -12
- dodopayments/_qs.py +7 -7
- dodopayments/_types.py +18 -11
- dodopayments/_utils/_transform.py +2 -2
- dodopayments/_utils/_utils.py +4 -4
- dodopayments/_version.py +1 -1
- dodopayments/resources/addons.py +29 -29
- dodopayments/resources/brands.py +29 -29
- dodopayments/resources/checkout_sessions.py +27 -27
- dodopayments/resources/customers/customer_portal.py +5 -5
- dodopayments/resources/customers/customers.py +21 -21
- dodopayments/resources/customers/wallets/ledger_entries.py +15 -15
- dodopayments/resources/customers/wallets/wallets.py +3 -3
- dodopayments/resources/discounts.py +43 -43
- dodopayments/resources/disputes.py +19 -19
- dodopayments/resources/invoices/payments.py +5 -5
- dodopayments/resources/license_key_instances.py +13 -13
- dodopayments/resources/license_keys.py +23 -23
- dodopayments/resources/licenses.py +9 -9
- dodopayments/resources/meters.py +21 -21
- dodopayments/resources/misc.py +3 -3
- dodopayments/resources/payments.py +41 -41
- dodopayments/resources/payouts.py +7 -7
- dodopayments/resources/products/images.py +5 -5
- dodopayments/resources/products/products.py +71 -71
- dodopayments/resources/refunds.py +23 -23
- dodopayments/resources/subscriptions.py +87 -87
- dodopayments/resources/usage_events.py +21 -21
- dodopayments/resources/webhooks/headers.py +5 -5
- dodopayments/resources/webhooks/webhooks.py +43 -43
- {dodopayments-1.53.4.dist-info → dodopayments-1.53.5.dist-info}/METADATA +1 -1
- {dodopayments-1.53.4.dist-info → dodopayments-1.53.5.dist-info}/RECORD +36 -36
- {dodopayments-1.53.4.dist-info → dodopayments-1.53.5.dist-info}/WHEEL +0 -0
- {dodopayments-1.53.4.dist-info → dodopayments-1.53.5.dist-info}/licenses/LICENSE +0 -0
|
@@ -18,7 +18,7 @@ from ..types import (
|
|
|
18
18
|
subscription_change_plan_params,
|
|
19
19
|
subscription_retrieve_usage_history_params,
|
|
20
20
|
)
|
|
21
|
-
from .._types import
|
|
21
|
+
from .._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given
|
|
22
22
|
from .._utils import maybe_transform, async_maybe_transform
|
|
23
23
|
from .._compat import cached_property
|
|
24
24
|
from .._resource import SyncAPIResource, AsyncAPIResource
|
|
@@ -73,23 +73,23 @@ class SubscriptionsResource(SyncAPIResource):
|
|
|
73
73
|
customer: CustomerRequestParam,
|
|
74
74
|
product_id: str,
|
|
75
75
|
quantity: int,
|
|
76
|
-
addons: Optional[Iterable[AttachAddonParam]] |
|
|
77
|
-
allowed_payment_method_types: Optional[List[PaymentMethodTypes]] |
|
|
78
|
-
billing_currency: Optional[Currency] |
|
|
79
|
-
discount_code: Optional[str] |
|
|
80
|
-
metadata: Dict[str, str] |
|
|
81
|
-
on_demand: Optional[OnDemandSubscriptionParam] |
|
|
82
|
-
payment_link: Optional[bool] |
|
|
83
|
-
return_url: Optional[str] |
|
|
84
|
-
show_saved_payment_methods: bool |
|
|
85
|
-
tax_id: Optional[str] |
|
|
86
|
-
trial_period_days: Optional[int] |
|
|
76
|
+
addons: Optional[Iterable[AttachAddonParam]] | Omit = omit,
|
|
77
|
+
allowed_payment_method_types: Optional[List[PaymentMethodTypes]] | Omit = omit,
|
|
78
|
+
billing_currency: Optional[Currency] | Omit = omit,
|
|
79
|
+
discount_code: Optional[str] | Omit = omit,
|
|
80
|
+
metadata: Dict[str, str] | Omit = omit,
|
|
81
|
+
on_demand: Optional[OnDemandSubscriptionParam] | Omit = omit,
|
|
82
|
+
payment_link: Optional[bool] | Omit = omit,
|
|
83
|
+
return_url: Optional[str] | Omit = omit,
|
|
84
|
+
show_saved_payment_methods: bool | Omit = omit,
|
|
85
|
+
tax_id: Optional[str] | Omit = omit,
|
|
86
|
+
trial_period_days: Optional[int] | Omit = omit,
|
|
87
87
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
88
88
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
89
89
|
extra_headers: Headers | None = None,
|
|
90
90
|
extra_query: Query | None = None,
|
|
91
91
|
extra_body: Body | None = None,
|
|
92
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
92
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
93
93
|
) -> SubscriptionCreateResponse:
|
|
94
94
|
"""
|
|
95
95
|
Args:
|
|
@@ -174,7 +174,7 @@ class SubscriptionsResource(SyncAPIResource):
|
|
|
174
174
|
extra_headers: Headers | None = None,
|
|
175
175
|
extra_query: Query | None = None,
|
|
176
176
|
extra_body: Body | None = None,
|
|
177
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
177
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
178
178
|
) -> Subscription:
|
|
179
179
|
"""
|
|
180
180
|
Args:
|
|
@@ -200,19 +200,19 @@ class SubscriptionsResource(SyncAPIResource):
|
|
|
200
200
|
self,
|
|
201
201
|
subscription_id: str,
|
|
202
202
|
*,
|
|
203
|
-
billing: Optional[BillingAddressParam] |
|
|
204
|
-
cancel_at_next_billing_date: Optional[bool] |
|
|
205
|
-
disable_on_demand: Optional[subscription_update_params.DisableOnDemand] |
|
|
206
|
-
metadata: Optional[Dict[str, str]] |
|
|
207
|
-
next_billing_date: Union[str, datetime, None] |
|
|
208
|
-
status: Optional[SubscriptionStatus] |
|
|
209
|
-
tax_id: Optional[str] |
|
|
203
|
+
billing: Optional[BillingAddressParam] | Omit = omit,
|
|
204
|
+
cancel_at_next_billing_date: Optional[bool] | Omit = omit,
|
|
205
|
+
disable_on_demand: Optional[subscription_update_params.DisableOnDemand] | Omit = omit,
|
|
206
|
+
metadata: Optional[Dict[str, str]] | Omit = omit,
|
|
207
|
+
next_billing_date: Union[str, datetime, None] | Omit = omit,
|
|
208
|
+
status: Optional[SubscriptionStatus] | Omit = omit,
|
|
209
|
+
tax_id: Optional[str] | Omit = omit,
|
|
210
210
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
211
211
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
212
212
|
extra_headers: Headers | None = None,
|
|
213
213
|
extra_query: Query | None = None,
|
|
214
214
|
extra_body: Body | None = None,
|
|
215
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
215
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
216
216
|
) -> Subscription:
|
|
217
217
|
"""
|
|
218
218
|
Args:
|
|
@@ -251,19 +251,19 @@ class SubscriptionsResource(SyncAPIResource):
|
|
|
251
251
|
def list(
|
|
252
252
|
self,
|
|
253
253
|
*,
|
|
254
|
-
brand_id: str |
|
|
255
|
-
created_at_gte: Union[str, datetime] |
|
|
256
|
-
created_at_lte: Union[str, datetime] |
|
|
257
|
-
customer_id: str |
|
|
258
|
-
page_number: int |
|
|
259
|
-
page_size: int |
|
|
260
|
-
status: Literal["pending", "active", "on_hold", "cancelled", "failed", "expired"] |
|
|
254
|
+
brand_id: str | Omit = omit,
|
|
255
|
+
created_at_gte: Union[str, datetime] | Omit = omit,
|
|
256
|
+
created_at_lte: Union[str, datetime] | Omit = omit,
|
|
257
|
+
customer_id: str | Omit = omit,
|
|
258
|
+
page_number: int | Omit = omit,
|
|
259
|
+
page_size: int | Omit = omit,
|
|
260
|
+
status: Literal["pending", "active", "on_hold", "cancelled", "failed", "expired"] | Omit = omit,
|
|
261
261
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
262
262
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
263
263
|
extra_headers: Headers | None = None,
|
|
264
264
|
extra_query: Query | None = None,
|
|
265
265
|
extra_body: Body | None = None,
|
|
266
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
266
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
267
267
|
) -> SyncDefaultPageNumberPagination[SubscriptionListResponse]:
|
|
268
268
|
"""
|
|
269
269
|
Args:
|
|
@@ -320,13 +320,13 @@ class SubscriptionsResource(SyncAPIResource):
|
|
|
320
320
|
product_id: str,
|
|
321
321
|
proration_billing_mode: Literal["prorated_immediately", "full_immediately", "difference_immediately"],
|
|
322
322
|
quantity: int,
|
|
323
|
-
addons: Optional[Iterable[AttachAddonParam]] |
|
|
323
|
+
addons: Optional[Iterable[AttachAddonParam]] | Omit = omit,
|
|
324
324
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
325
325
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
326
326
|
extra_headers: Headers | None = None,
|
|
327
327
|
extra_query: Query | None = None,
|
|
328
328
|
extra_body: Body | None = None,
|
|
329
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
329
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
330
330
|
) -> None:
|
|
331
331
|
"""
|
|
332
332
|
Args:
|
|
@@ -372,17 +372,17 @@ class SubscriptionsResource(SyncAPIResource):
|
|
|
372
372
|
subscription_id: str,
|
|
373
373
|
*,
|
|
374
374
|
product_price: int,
|
|
375
|
-
adaptive_currency_fees_inclusive: Optional[bool] |
|
|
376
|
-
customer_balance_config: Optional[subscription_charge_params.CustomerBalanceConfig] |
|
|
377
|
-
metadata: Optional[Dict[str, str]] |
|
|
378
|
-
product_currency: Optional[Currency] |
|
|
379
|
-
product_description: Optional[str] |
|
|
375
|
+
adaptive_currency_fees_inclusive: Optional[bool] | Omit = omit,
|
|
376
|
+
customer_balance_config: Optional[subscription_charge_params.CustomerBalanceConfig] | Omit = omit,
|
|
377
|
+
metadata: Optional[Dict[str, str]] | Omit = omit,
|
|
378
|
+
product_currency: Optional[Currency] | Omit = omit,
|
|
379
|
+
product_description: Optional[str] | Omit = omit,
|
|
380
380
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
381
381
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
382
382
|
extra_headers: Headers | None = None,
|
|
383
383
|
extra_query: Query | None = None,
|
|
384
384
|
extra_body: Body | None = None,
|
|
385
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
385
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
386
386
|
) -> SubscriptionChargeResponse:
|
|
387
387
|
"""Args:
|
|
388
388
|
product_price: The product price.
|
|
@@ -438,17 +438,17 @@ class SubscriptionsResource(SyncAPIResource):
|
|
|
438
438
|
self,
|
|
439
439
|
subscription_id: str,
|
|
440
440
|
*,
|
|
441
|
-
end_date: Union[str, datetime, None] |
|
|
442
|
-
meter_id: Optional[str] |
|
|
443
|
-
page_number: Optional[int] |
|
|
444
|
-
page_size: Optional[int] |
|
|
445
|
-
start_date: Union[str, datetime, None] |
|
|
441
|
+
end_date: Union[str, datetime, None] | Omit = omit,
|
|
442
|
+
meter_id: Optional[str] | Omit = omit,
|
|
443
|
+
page_number: Optional[int] | Omit = omit,
|
|
444
|
+
page_size: Optional[int] | Omit = omit,
|
|
445
|
+
start_date: Union[str, datetime, None] | Omit = omit,
|
|
446
446
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
447
447
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
448
448
|
extra_headers: Headers | None = None,
|
|
449
449
|
extra_query: Query | None = None,
|
|
450
450
|
extra_body: Body | None = None,
|
|
451
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
451
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
452
452
|
) -> SyncDefaultPageNumberPagination[SubscriptionRetrieveUsageHistoryResponse]:
|
|
453
453
|
"""
|
|
454
454
|
Get detailed usage history for a subscription that includes usage-based billing
|
|
@@ -565,23 +565,23 @@ class AsyncSubscriptionsResource(AsyncAPIResource):
|
|
|
565
565
|
customer: CustomerRequestParam,
|
|
566
566
|
product_id: str,
|
|
567
567
|
quantity: int,
|
|
568
|
-
addons: Optional[Iterable[AttachAddonParam]] |
|
|
569
|
-
allowed_payment_method_types: Optional[List[PaymentMethodTypes]] |
|
|
570
|
-
billing_currency: Optional[Currency] |
|
|
571
|
-
discount_code: Optional[str] |
|
|
572
|
-
metadata: Dict[str, str] |
|
|
573
|
-
on_demand: Optional[OnDemandSubscriptionParam] |
|
|
574
|
-
payment_link: Optional[bool] |
|
|
575
|
-
return_url: Optional[str] |
|
|
576
|
-
show_saved_payment_methods: bool |
|
|
577
|
-
tax_id: Optional[str] |
|
|
578
|
-
trial_period_days: Optional[int] |
|
|
568
|
+
addons: Optional[Iterable[AttachAddonParam]] | Omit = omit,
|
|
569
|
+
allowed_payment_method_types: Optional[List[PaymentMethodTypes]] | Omit = omit,
|
|
570
|
+
billing_currency: Optional[Currency] | Omit = omit,
|
|
571
|
+
discount_code: Optional[str] | Omit = omit,
|
|
572
|
+
metadata: Dict[str, str] | Omit = omit,
|
|
573
|
+
on_demand: Optional[OnDemandSubscriptionParam] | Omit = omit,
|
|
574
|
+
payment_link: Optional[bool] | Omit = omit,
|
|
575
|
+
return_url: Optional[str] | Omit = omit,
|
|
576
|
+
show_saved_payment_methods: bool | Omit = omit,
|
|
577
|
+
tax_id: Optional[str] | Omit = omit,
|
|
578
|
+
trial_period_days: Optional[int] | Omit = omit,
|
|
579
579
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
580
580
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
581
581
|
extra_headers: Headers | None = None,
|
|
582
582
|
extra_query: Query | None = None,
|
|
583
583
|
extra_body: Body | None = None,
|
|
584
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
584
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
585
585
|
) -> SubscriptionCreateResponse:
|
|
586
586
|
"""
|
|
587
587
|
Args:
|
|
@@ -666,7 +666,7 @@ class AsyncSubscriptionsResource(AsyncAPIResource):
|
|
|
666
666
|
extra_headers: Headers | None = None,
|
|
667
667
|
extra_query: Query | None = None,
|
|
668
668
|
extra_body: Body | None = None,
|
|
669
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
669
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
670
670
|
) -> Subscription:
|
|
671
671
|
"""
|
|
672
672
|
Args:
|
|
@@ -692,19 +692,19 @@ class AsyncSubscriptionsResource(AsyncAPIResource):
|
|
|
692
692
|
self,
|
|
693
693
|
subscription_id: str,
|
|
694
694
|
*,
|
|
695
|
-
billing: Optional[BillingAddressParam] |
|
|
696
|
-
cancel_at_next_billing_date: Optional[bool] |
|
|
697
|
-
disable_on_demand: Optional[subscription_update_params.DisableOnDemand] |
|
|
698
|
-
metadata: Optional[Dict[str, str]] |
|
|
699
|
-
next_billing_date: Union[str, datetime, None] |
|
|
700
|
-
status: Optional[SubscriptionStatus] |
|
|
701
|
-
tax_id: Optional[str] |
|
|
695
|
+
billing: Optional[BillingAddressParam] | Omit = omit,
|
|
696
|
+
cancel_at_next_billing_date: Optional[bool] | Omit = omit,
|
|
697
|
+
disable_on_demand: Optional[subscription_update_params.DisableOnDemand] | Omit = omit,
|
|
698
|
+
metadata: Optional[Dict[str, str]] | Omit = omit,
|
|
699
|
+
next_billing_date: Union[str, datetime, None] | Omit = omit,
|
|
700
|
+
status: Optional[SubscriptionStatus] | Omit = omit,
|
|
701
|
+
tax_id: Optional[str] | Omit = omit,
|
|
702
702
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
703
703
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
704
704
|
extra_headers: Headers | None = None,
|
|
705
705
|
extra_query: Query | None = None,
|
|
706
706
|
extra_body: Body | None = None,
|
|
707
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
707
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
708
708
|
) -> Subscription:
|
|
709
709
|
"""
|
|
710
710
|
Args:
|
|
@@ -743,19 +743,19 @@ class AsyncSubscriptionsResource(AsyncAPIResource):
|
|
|
743
743
|
def list(
|
|
744
744
|
self,
|
|
745
745
|
*,
|
|
746
|
-
brand_id: str |
|
|
747
|
-
created_at_gte: Union[str, datetime] |
|
|
748
|
-
created_at_lte: Union[str, datetime] |
|
|
749
|
-
customer_id: str |
|
|
750
|
-
page_number: int |
|
|
751
|
-
page_size: int |
|
|
752
|
-
status: Literal["pending", "active", "on_hold", "cancelled", "failed", "expired"] |
|
|
746
|
+
brand_id: str | Omit = omit,
|
|
747
|
+
created_at_gte: Union[str, datetime] | Omit = omit,
|
|
748
|
+
created_at_lte: Union[str, datetime] | Omit = omit,
|
|
749
|
+
customer_id: str | Omit = omit,
|
|
750
|
+
page_number: int | Omit = omit,
|
|
751
|
+
page_size: int | Omit = omit,
|
|
752
|
+
status: Literal["pending", "active", "on_hold", "cancelled", "failed", "expired"] | Omit = omit,
|
|
753
753
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
754
754
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
755
755
|
extra_headers: Headers | None = None,
|
|
756
756
|
extra_query: Query | None = None,
|
|
757
757
|
extra_body: Body | None = None,
|
|
758
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
758
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
759
759
|
) -> AsyncPaginator[SubscriptionListResponse, AsyncDefaultPageNumberPagination[SubscriptionListResponse]]:
|
|
760
760
|
"""
|
|
761
761
|
Args:
|
|
@@ -812,13 +812,13 @@ class AsyncSubscriptionsResource(AsyncAPIResource):
|
|
|
812
812
|
product_id: str,
|
|
813
813
|
proration_billing_mode: Literal["prorated_immediately", "full_immediately", "difference_immediately"],
|
|
814
814
|
quantity: int,
|
|
815
|
-
addons: Optional[Iterable[AttachAddonParam]] |
|
|
815
|
+
addons: Optional[Iterable[AttachAddonParam]] | Omit = omit,
|
|
816
816
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
817
817
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
818
818
|
extra_headers: Headers | None = None,
|
|
819
819
|
extra_query: Query | None = None,
|
|
820
820
|
extra_body: Body | None = None,
|
|
821
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
821
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
822
822
|
) -> None:
|
|
823
823
|
"""
|
|
824
824
|
Args:
|
|
@@ -864,17 +864,17 @@ class AsyncSubscriptionsResource(AsyncAPIResource):
|
|
|
864
864
|
subscription_id: str,
|
|
865
865
|
*,
|
|
866
866
|
product_price: int,
|
|
867
|
-
adaptive_currency_fees_inclusive: Optional[bool] |
|
|
868
|
-
customer_balance_config: Optional[subscription_charge_params.CustomerBalanceConfig] |
|
|
869
|
-
metadata: Optional[Dict[str, str]] |
|
|
870
|
-
product_currency: Optional[Currency] |
|
|
871
|
-
product_description: Optional[str] |
|
|
867
|
+
adaptive_currency_fees_inclusive: Optional[bool] | Omit = omit,
|
|
868
|
+
customer_balance_config: Optional[subscription_charge_params.CustomerBalanceConfig] | Omit = omit,
|
|
869
|
+
metadata: Optional[Dict[str, str]] | Omit = omit,
|
|
870
|
+
product_currency: Optional[Currency] | Omit = omit,
|
|
871
|
+
product_description: Optional[str] | Omit = omit,
|
|
872
872
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
873
873
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
874
874
|
extra_headers: Headers | None = None,
|
|
875
875
|
extra_query: Query | None = None,
|
|
876
876
|
extra_body: Body | None = None,
|
|
877
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
877
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
878
878
|
) -> SubscriptionChargeResponse:
|
|
879
879
|
"""Args:
|
|
880
880
|
product_price: The product price.
|
|
@@ -930,17 +930,17 @@ class AsyncSubscriptionsResource(AsyncAPIResource):
|
|
|
930
930
|
self,
|
|
931
931
|
subscription_id: str,
|
|
932
932
|
*,
|
|
933
|
-
end_date: Union[str, datetime, None] |
|
|
934
|
-
meter_id: Optional[str] |
|
|
935
|
-
page_number: Optional[int] |
|
|
936
|
-
page_size: Optional[int] |
|
|
937
|
-
start_date: Union[str, datetime, None] |
|
|
933
|
+
end_date: Union[str, datetime, None] | Omit = omit,
|
|
934
|
+
meter_id: Optional[str] | Omit = omit,
|
|
935
|
+
page_number: Optional[int] | Omit = omit,
|
|
936
|
+
page_size: Optional[int] | Omit = omit,
|
|
937
|
+
start_date: Union[str, datetime, None] | Omit = omit,
|
|
938
938
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
939
939
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
940
940
|
extra_headers: Headers | None = None,
|
|
941
941
|
extra_query: Query | None = None,
|
|
942
942
|
extra_body: Body | None = None,
|
|
943
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
943
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
944
944
|
) -> AsyncPaginator[
|
|
945
945
|
SubscriptionRetrieveUsageHistoryResponse,
|
|
946
946
|
AsyncDefaultPageNumberPagination[SubscriptionRetrieveUsageHistoryResponse],
|
|
@@ -8,7 +8,7 @@ from datetime import datetime
|
|
|
8
8
|
import httpx
|
|
9
9
|
|
|
10
10
|
from ..types import usage_event_list_params, usage_event_ingest_params
|
|
11
|
-
from .._types import
|
|
11
|
+
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
|
12
12
|
from .._utils import maybe_transform, async_maybe_transform
|
|
13
13
|
from .._compat import cached_property
|
|
14
14
|
from .._resource import SyncAPIResource, AsyncAPIResource
|
|
@@ -56,7 +56,7 @@ class UsageEventsResource(SyncAPIResource):
|
|
|
56
56
|
extra_headers: Headers | None = None,
|
|
57
57
|
extra_query: Query | None = None,
|
|
58
58
|
extra_body: Body | None = None,
|
|
59
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
59
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
60
60
|
) -> Event:
|
|
61
61
|
"""Fetch detailed information about a single event using its unique event ID.
|
|
62
62
|
|
|
@@ -111,19 +111,19 @@ class UsageEventsResource(SyncAPIResource):
|
|
|
111
111
|
def list(
|
|
112
112
|
self,
|
|
113
113
|
*,
|
|
114
|
-
customer_id: str |
|
|
115
|
-
end: Union[str, datetime] |
|
|
116
|
-
event_name: str |
|
|
117
|
-
meter_id: str |
|
|
118
|
-
page_number: int |
|
|
119
|
-
page_size: int |
|
|
120
|
-
start: Union[str, datetime] |
|
|
114
|
+
customer_id: str | Omit = omit,
|
|
115
|
+
end: Union[str, datetime] | Omit = omit,
|
|
116
|
+
event_name: str | Omit = omit,
|
|
117
|
+
meter_id: str | Omit = omit,
|
|
118
|
+
page_number: int | Omit = omit,
|
|
119
|
+
page_size: int | Omit = omit,
|
|
120
|
+
start: Union[str, datetime] | Omit = omit,
|
|
121
121
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
122
122
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
123
123
|
extra_headers: Headers | None = None,
|
|
124
124
|
extra_query: Query | None = None,
|
|
125
125
|
extra_body: Body | None = None,
|
|
126
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
126
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
127
127
|
) -> SyncDefaultPageNumberPagination[Event]:
|
|
128
128
|
"""Fetch events from your account with powerful filtering capabilities.
|
|
129
129
|
|
|
@@ -219,7 +219,7 @@ class UsageEventsResource(SyncAPIResource):
|
|
|
219
219
|
extra_headers: Headers | None = None,
|
|
220
220
|
extra_query: Query | None = None,
|
|
221
221
|
extra_body: Body | None = None,
|
|
222
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
222
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
223
223
|
) -> UsageEventIngestResponse:
|
|
224
224
|
"""
|
|
225
225
|
This endpoint allows you to ingest custom events that can be used for:
|
|
@@ -311,7 +311,7 @@ class AsyncUsageEventsResource(AsyncAPIResource):
|
|
|
311
311
|
extra_headers: Headers | None = None,
|
|
312
312
|
extra_query: Query | None = None,
|
|
313
313
|
extra_body: Body | None = None,
|
|
314
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
314
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
315
315
|
) -> Event:
|
|
316
316
|
"""Fetch detailed information about a single event using its unique event ID.
|
|
317
317
|
|
|
@@ -366,19 +366,19 @@ class AsyncUsageEventsResource(AsyncAPIResource):
|
|
|
366
366
|
def list(
|
|
367
367
|
self,
|
|
368
368
|
*,
|
|
369
|
-
customer_id: str |
|
|
370
|
-
end: Union[str, datetime] |
|
|
371
|
-
event_name: str |
|
|
372
|
-
meter_id: str |
|
|
373
|
-
page_number: int |
|
|
374
|
-
page_size: int |
|
|
375
|
-
start: Union[str, datetime] |
|
|
369
|
+
customer_id: str | Omit = omit,
|
|
370
|
+
end: Union[str, datetime] | Omit = omit,
|
|
371
|
+
event_name: str | Omit = omit,
|
|
372
|
+
meter_id: str | Omit = omit,
|
|
373
|
+
page_number: int | Omit = omit,
|
|
374
|
+
page_size: int | Omit = omit,
|
|
375
|
+
start: Union[str, datetime] | Omit = omit,
|
|
376
376
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
377
377
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
378
378
|
extra_headers: Headers | None = None,
|
|
379
379
|
extra_query: Query | None = None,
|
|
380
380
|
extra_body: Body | None = None,
|
|
381
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
381
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
382
382
|
) -> AsyncPaginator[Event, AsyncDefaultPageNumberPagination[Event]]:
|
|
383
383
|
"""Fetch events from your account with powerful filtering capabilities.
|
|
384
384
|
|
|
@@ -474,7 +474,7 @@ class AsyncUsageEventsResource(AsyncAPIResource):
|
|
|
474
474
|
extra_headers: Headers | None = None,
|
|
475
475
|
extra_query: Query | None = None,
|
|
476
476
|
extra_body: Body | None = None,
|
|
477
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
477
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
478
478
|
) -> UsageEventIngestResponse:
|
|
479
479
|
"""
|
|
480
480
|
This endpoint allows you to ingest custom events that can be used for:
|
|
@@ -6,7 +6,7 @@ from typing import Dict
|
|
|
6
6
|
|
|
7
7
|
import httpx
|
|
8
8
|
|
|
9
|
-
from ..._types import
|
|
9
|
+
from ..._types import Body, Query, Headers, NoneType, NotGiven, not_given
|
|
10
10
|
from ..._utils import maybe_transform, async_maybe_transform
|
|
11
11
|
from ..._compat import cached_property
|
|
12
12
|
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
@@ -52,7 +52,7 @@ class HeadersResource(SyncAPIResource):
|
|
|
52
52
|
extra_headers: Headers | None = None,
|
|
53
53
|
extra_query: Query | None = None,
|
|
54
54
|
extra_body: Body | None = None,
|
|
55
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
55
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
56
56
|
) -> HeaderRetrieveResponse:
|
|
57
57
|
"""
|
|
58
58
|
Get a webhook by id
|
|
@@ -86,7 +86,7 @@ class HeadersResource(SyncAPIResource):
|
|
|
86
86
|
extra_headers: Headers | None = None,
|
|
87
87
|
extra_query: Query | None = None,
|
|
88
88
|
extra_body: Body | None = None,
|
|
89
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
89
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
90
90
|
) -> None:
|
|
91
91
|
"""
|
|
92
92
|
Patch a webhook by id
|
|
@@ -144,7 +144,7 @@ class AsyncHeadersResource(AsyncAPIResource):
|
|
|
144
144
|
extra_headers: Headers | None = None,
|
|
145
145
|
extra_query: Query | None = None,
|
|
146
146
|
extra_body: Body | None = None,
|
|
147
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
147
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
148
148
|
) -> HeaderRetrieveResponse:
|
|
149
149
|
"""
|
|
150
150
|
Get a webhook by id
|
|
@@ -178,7 +178,7 @@ class AsyncHeadersResource(AsyncAPIResource):
|
|
|
178
178
|
extra_headers: Headers | None = None,
|
|
179
179
|
extra_query: Query | None = None,
|
|
180
180
|
extra_body: Body | None = None,
|
|
181
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
181
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
182
182
|
) -> None:
|
|
183
183
|
"""
|
|
184
184
|
Patch a webhook by id
|