dodopayments 1.25.0__py3-none-any.whl → 1.30.0__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/_client.py +9 -0
- dodopayments/_version.py +1 -1
- dodopayments/resources/__init__.py +14 -0
- dodopayments/resources/brands.py +495 -0
- dodopayments/resources/customers/customers.py +1 -19
- dodopayments/resources/payments.py +83 -0
- dodopayments/resources/products/products.py +20 -0
- dodopayments/resources/refunds.py +9 -1
- dodopayments/resources/subscriptions.py +8 -41
- dodopayments/types/__init__.py +8 -2
- dodopayments/types/{customer_update_params.py → brand_create_params.py} +9 -3
- dodopayments/types/brand_create_response.py +35 -0
- dodopayments/types/brand_list_response.py +40 -0
- dodopayments/types/brand_retrieve_response.py +35 -0
- dodopayments/types/brand_update_images_response.py +13 -0
- dodopayments/types/brand_update_params.py +19 -0
- dodopayments/types/brand_update_response.py +35 -0
- dodopayments/types/payment.py +6 -0
- dodopayments/types/payment_list_params.py +3 -0
- dodopayments/types/payment_list_response.py +2 -0
- dodopayments/types/payment_retrieve_line_items_response.py +26 -0
- dodopayments/types/product.py +2 -0
- dodopayments/types/product_create_params.py +3 -0
- dodopayments/types/product_list_params.py +3 -0
- dodopayments/types/product_update_params.py +2 -0
- dodopayments/types/refund.py +3 -0
- dodopayments/types/refund_create_params.py +16 -2
- dodopayments/types/subscription_create_response.py +3 -0
- dodopayments/types/subscription_list_params.py +3 -0
- {dodopayments-1.25.0.dist-info → dodopayments-1.30.0.dist-info}/METADATA +2 -2
- {dodopayments-1.25.0.dist-info → dodopayments-1.30.0.dist-info}/RECORD +33 -26
- dodopayments/types/subscription_change_plan_params.py +0 -30
- {dodopayments-1.25.0.dist-info → dodopayments-1.30.0.dist-info}/WHEEL +0 -0
- {dodopayments-1.25.0.dist-info → dodopayments-1.30.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -29,6 +29,7 @@ from ..types.payment_list_response import PaymentListResponse
|
|
|
29
29
|
from ..types.customer_request_param import CustomerRequestParam
|
|
30
30
|
from ..types.payment_create_response import PaymentCreateResponse
|
|
31
31
|
from ..types.one_time_product_cart_item_param import OneTimeProductCartItemParam
|
|
32
|
+
from ..types.payment_retrieve_line_items_response import PaymentRetrieveLineItemsResponse
|
|
32
33
|
|
|
33
34
|
__all__ = ["PaymentsResource", "AsyncPaymentsResource"]
|
|
34
35
|
|
|
@@ -188,6 +189,7 @@ class PaymentsResource(SyncAPIResource):
|
|
|
188
189
|
def list(
|
|
189
190
|
self,
|
|
190
191
|
*,
|
|
192
|
+
brand_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
191
193
|
created_at_gte: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
|
|
192
194
|
created_at_lte: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
|
|
193
195
|
customer_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
@@ -204,6 +206,8 @@ class PaymentsResource(SyncAPIResource):
|
|
|
204
206
|
) -> SyncDefaultPageNumberPagination[PaymentListResponse]:
|
|
205
207
|
"""
|
|
206
208
|
Args:
|
|
209
|
+
brand_id: filter by Brand id
|
|
210
|
+
|
|
207
211
|
created_at_gte: Get events after this created time
|
|
208
212
|
|
|
209
213
|
created_at_lte: Get events created before this time
|
|
@@ -236,6 +240,7 @@ class PaymentsResource(SyncAPIResource):
|
|
|
236
240
|
timeout=timeout,
|
|
237
241
|
query=maybe_transform(
|
|
238
242
|
{
|
|
243
|
+
"brand_id": brand_id,
|
|
239
244
|
"created_at_gte": created_at_gte,
|
|
240
245
|
"created_at_lte": created_at_lte,
|
|
241
246
|
"customer_id": customer_id,
|
|
@@ -250,6 +255,37 @@ class PaymentsResource(SyncAPIResource):
|
|
|
250
255
|
model=PaymentListResponse,
|
|
251
256
|
)
|
|
252
257
|
|
|
258
|
+
def retrieve_line_items(
|
|
259
|
+
self,
|
|
260
|
+
payment_id: str,
|
|
261
|
+
*,
|
|
262
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
263
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
264
|
+
extra_headers: Headers | None = None,
|
|
265
|
+
extra_query: Query | None = None,
|
|
266
|
+
extra_body: Body | None = None,
|
|
267
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
268
|
+
) -> PaymentRetrieveLineItemsResponse:
|
|
269
|
+
"""
|
|
270
|
+
Args:
|
|
271
|
+
extra_headers: Send extra headers
|
|
272
|
+
|
|
273
|
+
extra_query: Add additional query parameters to the request
|
|
274
|
+
|
|
275
|
+
extra_body: Add additional JSON properties to the request
|
|
276
|
+
|
|
277
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
278
|
+
"""
|
|
279
|
+
if not payment_id:
|
|
280
|
+
raise ValueError(f"Expected a non-empty value for `payment_id` but received {payment_id!r}")
|
|
281
|
+
return self._get(
|
|
282
|
+
f"/payments/{payment_id}/line-items",
|
|
283
|
+
options=make_request_options(
|
|
284
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
285
|
+
),
|
|
286
|
+
cast_to=PaymentRetrieveLineItemsResponse,
|
|
287
|
+
)
|
|
288
|
+
|
|
253
289
|
|
|
254
290
|
class AsyncPaymentsResource(AsyncAPIResource):
|
|
255
291
|
@cached_property
|
|
@@ -406,6 +442,7 @@ class AsyncPaymentsResource(AsyncAPIResource):
|
|
|
406
442
|
def list(
|
|
407
443
|
self,
|
|
408
444
|
*,
|
|
445
|
+
brand_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
409
446
|
created_at_gte: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
|
|
410
447
|
created_at_lte: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
|
|
411
448
|
customer_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
@@ -422,6 +459,8 @@ class AsyncPaymentsResource(AsyncAPIResource):
|
|
|
422
459
|
) -> AsyncPaginator[PaymentListResponse, AsyncDefaultPageNumberPagination[PaymentListResponse]]:
|
|
423
460
|
"""
|
|
424
461
|
Args:
|
|
462
|
+
brand_id: filter by Brand id
|
|
463
|
+
|
|
425
464
|
created_at_gte: Get events after this created time
|
|
426
465
|
|
|
427
466
|
created_at_lte: Get events created before this time
|
|
@@ -454,6 +493,7 @@ class AsyncPaymentsResource(AsyncAPIResource):
|
|
|
454
493
|
timeout=timeout,
|
|
455
494
|
query=maybe_transform(
|
|
456
495
|
{
|
|
496
|
+
"brand_id": brand_id,
|
|
457
497
|
"created_at_gte": created_at_gte,
|
|
458
498
|
"created_at_lte": created_at_lte,
|
|
459
499
|
"customer_id": customer_id,
|
|
@@ -468,6 +508,37 @@ class AsyncPaymentsResource(AsyncAPIResource):
|
|
|
468
508
|
model=PaymentListResponse,
|
|
469
509
|
)
|
|
470
510
|
|
|
511
|
+
async def retrieve_line_items(
|
|
512
|
+
self,
|
|
513
|
+
payment_id: str,
|
|
514
|
+
*,
|
|
515
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
516
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
517
|
+
extra_headers: Headers | None = None,
|
|
518
|
+
extra_query: Query | None = None,
|
|
519
|
+
extra_body: Body | None = None,
|
|
520
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
521
|
+
) -> PaymentRetrieveLineItemsResponse:
|
|
522
|
+
"""
|
|
523
|
+
Args:
|
|
524
|
+
extra_headers: Send extra headers
|
|
525
|
+
|
|
526
|
+
extra_query: Add additional query parameters to the request
|
|
527
|
+
|
|
528
|
+
extra_body: Add additional JSON properties to the request
|
|
529
|
+
|
|
530
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
531
|
+
"""
|
|
532
|
+
if not payment_id:
|
|
533
|
+
raise ValueError(f"Expected a non-empty value for `payment_id` but received {payment_id!r}")
|
|
534
|
+
return await self._get(
|
|
535
|
+
f"/payments/{payment_id}/line-items",
|
|
536
|
+
options=make_request_options(
|
|
537
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
538
|
+
),
|
|
539
|
+
cast_to=PaymentRetrieveLineItemsResponse,
|
|
540
|
+
)
|
|
541
|
+
|
|
471
542
|
|
|
472
543
|
class PaymentsResourceWithRawResponse:
|
|
473
544
|
def __init__(self, payments: PaymentsResource) -> None:
|
|
@@ -482,6 +553,9 @@ class PaymentsResourceWithRawResponse:
|
|
|
482
553
|
self.list = to_raw_response_wrapper(
|
|
483
554
|
payments.list,
|
|
484
555
|
)
|
|
556
|
+
self.retrieve_line_items = to_raw_response_wrapper(
|
|
557
|
+
payments.retrieve_line_items,
|
|
558
|
+
)
|
|
485
559
|
|
|
486
560
|
|
|
487
561
|
class AsyncPaymentsResourceWithRawResponse:
|
|
@@ -497,6 +571,9 @@ class AsyncPaymentsResourceWithRawResponse:
|
|
|
497
571
|
self.list = async_to_raw_response_wrapper(
|
|
498
572
|
payments.list,
|
|
499
573
|
)
|
|
574
|
+
self.retrieve_line_items = async_to_raw_response_wrapper(
|
|
575
|
+
payments.retrieve_line_items,
|
|
576
|
+
)
|
|
500
577
|
|
|
501
578
|
|
|
502
579
|
class PaymentsResourceWithStreamingResponse:
|
|
@@ -512,6 +589,9 @@ class PaymentsResourceWithStreamingResponse:
|
|
|
512
589
|
self.list = to_streamed_response_wrapper(
|
|
513
590
|
payments.list,
|
|
514
591
|
)
|
|
592
|
+
self.retrieve_line_items = to_streamed_response_wrapper(
|
|
593
|
+
payments.retrieve_line_items,
|
|
594
|
+
)
|
|
515
595
|
|
|
516
596
|
|
|
517
597
|
class AsyncPaymentsResourceWithStreamingResponse:
|
|
@@ -527,3 +607,6 @@ class AsyncPaymentsResourceWithStreamingResponse:
|
|
|
527
607
|
self.list = async_to_streamed_response_wrapper(
|
|
528
608
|
payments.list,
|
|
529
609
|
)
|
|
610
|
+
self.retrieve_line_items = async_to_streamed_response_wrapper(
|
|
611
|
+
payments.retrieve_line_items,
|
|
612
|
+
)
|
|
@@ -71,6 +71,7 @@ class ProductsResource(SyncAPIResource):
|
|
|
71
71
|
price: PriceParam,
|
|
72
72
|
tax_category: TaxCategory,
|
|
73
73
|
addons: Optional[List[str]] | NotGiven = NOT_GIVEN,
|
|
74
|
+
brand_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
74
75
|
description: Optional[str] | NotGiven = NOT_GIVEN,
|
|
75
76
|
license_key_activation_message: Optional[str] | NotGiven = NOT_GIVEN,
|
|
76
77
|
license_key_activations_limit: Optional[int] | NotGiven = NOT_GIVEN,
|
|
@@ -91,6 +92,8 @@ class ProductsResource(SyncAPIResource):
|
|
|
91
92
|
|
|
92
93
|
addons: Addons available for subscription product
|
|
93
94
|
|
|
95
|
+
brand_id: Brand id for the product, if not provided will default to primary brand
|
|
96
|
+
|
|
94
97
|
description: Optional description of the product
|
|
95
98
|
|
|
96
99
|
license_key_activation_message: Optional message displayed during license key activation
|
|
@@ -116,6 +119,7 @@ class ProductsResource(SyncAPIResource):
|
|
|
116
119
|
"price": price,
|
|
117
120
|
"tax_category": tax_category,
|
|
118
121
|
"addons": addons,
|
|
122
|
+
"brand_id": brand_id,
|
|
119
123
|
"description": description,
|
|
120
124
|
"license_key_activation_message": license_key_activation_message,
|
|
121
125
|
"license_key_activations_limit": license_key_activations_limit,
|
|
@@ -167,6 +171,7 @@ class ProductsResource(SyncAPIResource):
|
|
|
167
171
|
id: str,
|
|
168
172
|
*,
|
|
169
173
|
addons: Optional[List[str]] | NotGiven = NOT_GIVEN,
|
|
174
|
+
brand_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
170
175
|
description: Optional[str] | NotGiven = NOT_GIVEN,
|
|
171
176
|
image_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
172
177
|
license_key_activation_message: Optional[str] | NotGiven = NOT_GIVEN,
|
|
@@ -227,6 +232,7 @@ class ProductsResource(SyncAPIResource):
|
|
|
227
232
|
body=maybe_transform(
|
|
228
233
|
{
|
|
229
234
|
"addons": addons,
|
|
235
|
+
"brand_id": brand_id,
|
|
230
236
|
"description": description,
|
|
231
237
|
"image_id": image_id,
|
|
232
238
|
"license_key_activation_message": license_key_activation_message,
|
|
@@ -249,6 +255,7 @@ class ProductsResource(SyncAPIResource):
|
|
|
249
255
|
self,
|
|
250
256
|
*,
|
|
251
257
|
archived: bool | NotGiven = NOT_GIVEN,
|
|
258
|
+
brand_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
252
259
|
page_number: Optional[int] | NotGiven = NOT_GIVEN,
|
|
253
260
|
page_size: Optional[int] | NotGiven = NOT_GIVEN,
|
|
254
261
|
recurring: Optional[bool] | NotGiven = NOT_GIVEN,
|
|
@@ -263,6 +270,8 @@ class ProductsResource(SyncAPIResource):
|
|
|
263
270
|
Args:
|
|
264
271
|
archived: List archived products
|
|
265
272
|
|
|
273
|
+
brand_id: filter by Brand id
|
|
274
|
+
|
|
266
275
|
page_number: Page number default is 0
|
|
267
276
|
|
|
268
277
|
page_size: Page size default is 10 max is 100
|
|
@@ -293,6 +302,7 @@ class ProductsResource(SyncAPIResource):
|
|
|
293
302
|
query=maybe_transform(
|
|
294
303
|
{
|
|
295
304
|
"archived": archived,
|
|
305
|
+
"brand_id": brand_id,
|
|
296
306
|
"page_number": page_number,
|
|
297
307
|
"page_size": page_size,
|
|
298
308
|
"recurring": recurring,
|
|
@@ -398,6 +408,7 @@ class AsyncProductsResource(AsyncAPIResource):
|
|
|
398
408
|
price: PriceParam,
|
|
399
409
|
tax_category: TaxCategory,
|
|
400
410
|
addons: Optional[List[str]] | NotGiven = NOT_GIVEN,
|
|
411
|
+
brand_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
401
412
|
description: Optional[str] | NotGiven = NOT_GIVEN,
|
|
402
413
|
license_key_activation_message: Optional[str] | NotGiven = NOT_GIVEN,
|
|
403
414
|
license_key_activations_limit: Optional[int] | NotGiven = NOT_GIVEN,
|
|
@@ -418,6 +429,8 @@ class AsyncProductsResource(AsyncAPIResource):
|
|
|
418
429
|
|
|
419
430
|
addons: Addons available for subscription product
|
|
420
431
|
|
|
432
|
+
brand_id: Brand id for the product, if not provided will default to primary brand
|
|
433
|
+
|
|
421
434
|
description: Optional description of the product
|
|
422
435
|
|
|
423
436
|
license_key_activation_message: Optional message displayed during license key activation
|
|
@@ -443,6 +456,7 @@ class AsyncProductsResource(AsyncAPIResource):
|
|
|
443
456
|
"price": price,
|
|
444
457
|
"tax_category": tax_category,
|
|
445
458
|
"addons": addons,
|
|
459
|
+
"brand_id": brand_id,
|
|
446
460
|
"description": description,
|
|
447
461
|
"license_key_activation_message": license_key_activation_message,
|
|
448
462
|
"license_key_activations_limit": license_key_activations_limit,
|
|
@@ -494,6 +508,7 @@ class AsyncProductsResource(AsyncAPIResource):
|
|
|
494
508
|
id: str,
|
|
495
509
|
*,
|
|
496
510
|
addons: Optional[List[str]] | NotGiven = NOT_GIVEN,
|
|
511
|
+
brand_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
497
512
|
description: Optional[str] | NotGiven = NOT_GIVEN,
|
|
498
513
|
image_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
499
514
|
license_key_activation_message: Optional[str] | NotGiven = NOT_GIVEN,
|
|
@@ -554,6 +569,7 @@ class AsyncProductsResource(AsyncAPIResource):
|
|
|
554
569
|
body=await async_maybe_transform(
|
|
555
570
|
{
|
|
556
571
|
"addons": addons,
|
|
572
|
+
"brand_id": brand_id,
|
|
557
573
|
"description": description,
|
|
558
574
|
"image_id": image_id,
|
|
559
575
|
"license_key_activation_message": license_key_activation_message,
|
|
@@ -576,6 +592,7 @@ class AsyncProductsResource(AsyncAPIResource):
|
|
|
576
592
|
self,
|
|
577
593
|
*,
|
|
578
594
|
archived: bool | NotGiven = NOT_GIVEN,
|
|
595
|
+
brand_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
579
596
|
page_number: Optional[int] | NotGiven = NOT_GIVEN,
|
|
580
597
|
page_size: Optional[int] | NotGiven = NOT_GIVEN,
|
|
581
598
|
recurring: Optional[bool] | NotGiven = NOT_GIVEN,
|
|
@@ -590,6 +607,8 @@ class AsyncProductsResource(AsyncAPIResource):
|
|
|
590
607
|
Args:
|
|
591
608
|
archived: List archived products
|
|
592
609
|
|
|
610
|
+
brand_id: filter by Brand id
|
|
611
|
+
|
|
593
612
|
page_number: Page number default is 0
|
|
594
613
|
|
|
595
614
|
page_size: Page size default is 10 max is 100
|
|
@@ -620,6 +639,7 @@ class AsyncProductsResource(AsyncAPIResource):
|
|
|
620
639
|
query=maybe_transform(
|
|
621
640
|
{
|
|
622
641
|
"archived": archived,
|
|
642
|
+
"brand_id": brand_id,
|
|
623
643
|
"page_number": page_number,
|
|
624
644
|
"page_size": page_size,
|
|
625
645
|
"recurring": recurring,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Union, Optional
|
|
5
|
+
from typing import Union, Iterable, Optional
|
|
6
6
|
from datetime import datetime
|
|
7
7
|
|
|
8
8
|
import httpx
|
|
@@ -50,6 +50,7 @@ class RefundsResource(SyncAPIResource):
|
|
|
50
50
|
self,
|
|
51
51
|
*,
|
|
52
52
|
payment_id: str,
|
|
53
|
+
items: Optional[Iterable[refund_create_params.Item]] | NotGiven = NOT_GIVEN,
|
|
53
54
|
reason: Optional[str] | NotGiven = NOT_GIVEN,
|
|
54
55
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
55
56
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -62,6 +63,8 @@ class RefundsResource(SyncAPIResource):
|
|
|
62
63
|
Args:
|
|
63
64
|
payment_id: The unique identifier of the payment to be refunded.
|
|
64
65
|
|
|
66
|
+
items: Partially Refund an Individual Item
|
|
67
|
+
|
|
65
68
|
reason: The reason for the refund, if any. Maximum length is 3000 characters. Optional.
|
|
66
69
|
|
|
67
70
|
extra_headers: Send extra headers
|
|
@@ -77,6 +80,7 @@ class RefundsResource(SyncAPIResource):
|
|
|
77
80
|
body=maybe_transform(
|
|
78
81
|
{
|
|
79
82
|
"payment_id": payment_id,
|
|
83
|
+
"items": items,
|
|
80
84
|
"reason": reason,
|
|
81
85
|
},
|
|
82
86
|
refund_create_params.RefundCreateParams,
|
|
@@ -204,6 +208,7 @@ class AsyncRefundsResource(AsyncAPIResource):
|
|
|
204
208
|
self,
|
|
205
209
|
*,
|
|
206
210
|
payment_id: str,
|
|
211
|
+
items: Optional[Iterable[refund_create_params.Item]] | NotGiven = NOT_GIVEN,
|
|
207
212
|
reason: Optional[str] | NotGiven = NOT_GIVEN,
|
|
208
213
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
209
214
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -216,6 +221,8 @@ class AsyncRefundsResource(AsyncAPIResource):
|
|
|
216
221
|
Args:
|
|
217
222
|
payment_id: The unique identifier of the payment to be refunded.
|
|
218
223
|
|
|
224
|
+
items: Partially Refund an Individual Item
|
|
225
|
+
|
|
219
226
|
reason: The reason for the refund, if any. Maximum length is 3000 characters. Optional.
|
|
220
227
|
|
|
221
228
|
extra_headers: Send extra headers
|
|
@@ -231,6 +238,7 @@ class AsyncRefundsResource(AsyncAPIResource):
|
|
|
231
238
|
body=await async_maybe_transform(
|
|
232
239
|
{
|
|
233
240
|
"payment_id": payment_id,
|
|
241
|
+
"items": items,
|
|
234
242
|
"reason": reason,
|
|
235
243
|
},
|
|
236
244
|
refund_create_params.RefundCreateParams,
|
|
@@ -15,7 +15,6 @@ from ..types import (
|
|
|
15
15
|
subscription_charge_params,
|
|
16
16
|
subscription_create_params,
|
|
17
17
|
subscription_update_params,
|
|
18
|
-
subscription_change_plan_params,
|
|
19
18
|
)
|
|
20
19
|
from .._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven
|
|
21
20
|
from .._utils import maybe_transform, async_maybe_transform
|
|
@@ -255,6 +254,7 @@ class SubscriptionsResource(SyncAPIResource):
|
|
|
255
254
|
def list(
|
|
256
255
|
self,
|
|
257
256
|
*,
|
|
257
|
+
brand_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
258
258
|
created_at_gte: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
|
|
259
259
|
created_at_lte: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
|
|
260
260
|
customer_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
@@ -270,6 +270,8 @@ class SubscriptionsResource(SyncAPIResource):
|
|
|
270
270
|
) -> SyncDefaultPageNumberPagination[SubscriptionListResponse]:
|
|
271
271
|
"""
|
|
272
272
|
Args:
|
|
273
|
+
brand_id: filter by Brand id
|
|
274
|
+
|
|
273
275
|
created_at_gte: Get events after this created time
|
|
274
276
|
|
|
275
277
|
created_at_lte: Get events created before this time
|
|
@@ -300,6 +302,7 @@ class SubscriptionsResource(SyncAPIResource):
|
|
|
300
302
|
timeout=timeout,
|
|
301
303
|
query=maybe_transform(
|
|
302
304
|
{
|
|
305
|
+
"brand_id": brand_id,
|
|
303
306
|
"created_at_gte": created_at_gte,
|
|
304
307
|
"created_at_lte": created_at_lte,
|
|
305
308
|
"customer_id": customer_id,
|
|
@@ -317,10 +320,6 @@ class SubscriptionsResource(SyncAPIResource):
|
|
|
317
320
|
self,
|
|
318
321
|
subscription_id: str,
|
|
319
322
|
*,
|
|
320
|
-
product_id: str,
|
|
321
|
-
proration_billing_mode: Literal["prorated_immediately"],
|
|
322
|
-
quantity: int,
|
|
323
|
-
addons: Optional[Iterable[subscription_change_plan_params.Addon]] | NotGiven = NOT_GIVEN,
|
|
324
323
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
325
324
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
326
325
|
extra_headers: Headers | None = None,
|
|
@@ -330,13 +329,6 @@ class SubscriptionsResource(SyncAPIResource):
|
|
|
330
329
|
) -> None:
|
|
331
330
|
"""
|
|
332
331
|
Args:
|
|
333
|
-
product_id: Unique identifier of the product to subscribe to
|
|
334
|
-
|
|
335
|
-
quantity: Number of units to subscribe for. Must be at least 1.
|
|
336
|
-
|
|
337
|
-
addons: Addons for the new plan. Note : Leaving this empty would remove any existing
|
|
338
|
-
addons
|
|
339
|
-
|
|
340
332
|
extra_headers: Send extra headers
|
|
341
333
|
|
|
342
334
|
extra_query: Add additional query parameters to the request
|
|
@@ -350,15 +342,6 @@ class SubscriptionsResource(SyncAPIResource):
|
|
|
350
342
|
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
351
343
|
return self._post(
|
|
352
344
|
f"/subscriptions/{subscription_id}/change-plan",
|
|
353
|
-
body=maybe_transform(
|
|
354
|
-
{
|
|
355
|
-
"product_id": product_id,
|
|
356
|
-
"proration_billing_mode": proration_billing_mode,
|
|
357
|
-
"quantity": quantity,
|
|
358
|
-
"addons": addons,
|
|
359
|
-
},
|
|
360
|
-
subscription_change_plan_params.SubscriptionChangePlanParams,
|
|
361
|
-
),
|
|
362
345
|
options=make_request_options(
|
|
363
346
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
364
347
|
),
|
|
@@ -624,6 +607,7 @@ class AsyncSubscriptionsResource(AsyncAPIResource):
|
|
|
624
607
|
def list(
|
|
625
608
|
self,
|
|
626
609
|
*,
|
|
610
|
+
brand_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
627
611
|
created_at_gte: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
|
|
628
612
|
created_at_lte: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
|
|
629
613
|
customer_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
@@ -639,6 +623,8 @@ class AsyncSubscriptionsResource(AsyncAPIResource):
|
|
|
639
623
|
) -> AsyncPaginator[SubscriptionListResponse, AsyncDefaultPageNumberPagination[SubscriptionListResponse]]:
|
|
640
624
|
"""
|
|
641
625
|
Args:
|
|
626
|
+
brand_id: filter by Brand id
|
|
627
|
+
|
|
642
628
|
created_at_gte: Get events after this created time
|
|
643
629
|
|
|
644
630
|
created_at_lte: Get events created before this time
|
|
@@ -669,6 +655,7 @@ class AsyncSubscriptionsResource(AsyncAPIResource):
|
|
|
669
655
|
timeout=timeout,
|
|
670
656
|
query=maybe_transform(
|
|
671
657
|
{
|
|
658
|
+
"brand_id": brand_id,
|
|
672
659
|
"created_at_gte": created_at_gte,
|
|
673
660
|
"created_at_lte": created_at_lte,
|
|
674
661
|
"customer_id": customer_id,
|
|
@@ -686,10 +673,6 @@ class AsyncSubscriptionsResource(AsyncAPIResource):
|
|
|
686
673
|
self,
|
|
687
674
|
subscription_id: str,
|
|
688
675
|
*,
|
|
689
|
-
product_id: str,
|
|
690
|
-
proration_billing_mode: Literal["prorated_immediately"],
|
|
691
|
-
quantity: int,
|
|
692
|
-
addons: Optional[Iterable[subscription_change_plan_params.Addon]] | NotGiven = NOT_GIVEN,
|
|
693
676
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
694
677
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
695
678
|
extra_headers: Headers | None = None,
|
|
@@ -699,13 +682,6 @@ class AsyncSubscriptionsResource(AsyncAPIResource):
|
|
|
699
682
|
) -> None:
|
|
700
683
|
"""
|
|
701
684
|
Args:
|
|
702
|
-
product_id: Unique identifier of the product to subscribe to
|
|
703
|
-
|
|
704
|
-
quantity: Number of units to subscribe for. Must be at least 1.
|
|
705
|
-
|
|
706
|
-
addons: Addons for the new plan. Note : Leaving this empty would remove any existing
|
|
707
|
-
addons
|
|
708
|
-
|
|
709
685
|
extra_headers: Send extra headers
|
|
710
686
|
|
|
711
687
|
extra_query: Add additional query parameters to the request
|
|
@@ -719,15 +695,6 @@ class AsyncSubscriptionsResource(AsyncAPIResource):
|
|
|
719
695
|
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
720
696
|
return await self._post(
|
|
721
697
|
f"/subscriptions/{subscription_id}/change-plan",
|
|
722
|
-
body=await async_maybe_transform(
|
|
723
|
-
{
|
|
724
|
-
"product_id": product_id,
|
|
725
|
-
"proration_billing_mode": proration_billing_mode,
|
|
726
|
-
"quantity": quantity,
|
|
727
|
-
"addons": addons,
|
|
728
|
-
},
|
|
729
|
-
subscription_change_plan_params.SubscriptionChangePlanParams,
|
|
730
|
-
),
|
|
731
698
|
options=make_request_options(
|
|
732
699
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
733
700
|
),
|
dodopayments/types/__init__.py
CHANGED
|
@@ -30,6 +30,9 @@ from .payout_list_params import PayoutListParams as PayoutListParams
|
|
|
30
30
|
from .refund_list_params import RefundListParams as RefundListParams
|
|
31
31
|
from .addon_create_params import AddonCreateParams as AddonCreateParams
|
|
32
32
|
from .addon_update_params import AddonUpdateParams as AddonUpdateParams
|
|
33
|
+
from .brand_create_params import BrandCreateParams as BrandCreateParams
|
|
34
|
+
from .brand_list_response import BrandListResponse as BrandListResponse
|
|
35
|
+
from .brand_update_params import BrandUpdateParams as BrandUpdateParams
|
|
33
36
|
from .dispute_list_params import DisputeListParams as DisputeListParams
|
|
34
37
|
from .payment_list_params import PaymentListParams as PaymentListParams
|
|
35
38
|
from .product_list_params import ProductListParams as ProductListParams
|
|
@@ -41,6 +44,8 @@ from .license_key_instance import LicenseKeyInstance as LicenseKeyInstance
|
|
|
41
44
|
from .payout_list_response import PayoutListResponse as PayoutListResponse
|
|
42
45
|
from .refund_create_params import RefundCreateParams as RefundCreateParams
|
|
43
46
|
from .billing_address_param import BillingAddressParam as BillingAddressParam
|
|
47
|
+
from .brand_create_response import BrandCreateResponse as BrandCreateResponse
|
|
48
|
+
from .brand_update_response import BrandUpdateResponse as BrandUpdateResponse
|
|
44
49
|
from .dispute_list_response import DisputeListResponse as DisputeListResponse
|
|
45
50
|
from .payment_create_params import PaymentCreateParams as PaymentCreateParams
|
|
46
51
|
from .payment_list_response import PaymentListResponse as PaymentListResponse
|
|
@@ -49,9 +54,9 @@ from .product_list_response import ProductListResponse as ProductListResponse
|
|
|
49
54
|
from .product_update_params import ProductUpdateParams as ProductUpdateParams
|
|
50
55
|
from .customer_create_params import CustomerCreateParams as CustomerCreateParams
|
|
51
56
|
from .customer_request_param import CustomerRequestParam as CustomerRequestParam
|
|
52
|
-
from .customer_update_params import CustomerUpdateParams as CustomerUpdateParams
|
|
53
57
|
from .discount_create_params import DiscountCreateParams as DiscountCreateParams
|
|
54
58
|
from .discount_update_params import DiscountUpdateParams as DiscountUpdateParams
|
|
59
|
+
from .brand_retrieve_response import BrandRetrieveResponse as BrandRetrieveResponse
|
|
55
60
|
from .customer_portal_session import CustomerPortalSession as CustomerPortalSession
|
|
56
61
|
from .license_activate_params import LicenseActivateParams as LicenseActivateParams
|
|
57
62
|
from .license_key_list_params import LicenseKeyListParams as LicenseKeyListParams
|
|
@@ -73,13 +78,14 @@ from .subscription_create_params import SubscriptionCreateParams as Subscription
|
|
|
73
78
|
from .subscription_list_response import SubscriptionListResponse as SubscriptionListResponse
|
|
74
79
|
from .subscription_update_params import SubscriptionUpdateParams as SubscriptionUpdateParams
|
|
75
80
|
from .addon_update_images_response import AddonUpdateImagesResponse as AddonUpdateImagesResponse
|
|
81
|
+
from .brand_update_images_response import BrandUpdateImagesResponse as BrandUpdateImagesResponse
|
|
76
82
|
from .subscription_charge_response import SubscriptionChargeResponse as SubscriptionChargeResponse
|
|
77
83
|
from .subscription_create_response import SubscriptionCreateResponse as SubscriptionCreateResponse
|
|
78
84
|
from .attach_existing_customer_param import AttachExistingCustomerParam as AttachExistingCustomerParam
|
|
79
|
-
from .subscription_change_plan_params import SubscriptionChangePlanParams as SubscriptionChangePlanParams
|
|
80
85
|
from .license_key_instance_list_params import LicenseKeyInstanceListParams as LicenseKeyInstanceListParams
|
|
81
86
|
from .one_time_product_cart_item_param import OneTimeProductCartItemParam as OneTimeProductCartItemParam
|
|
82
87
|
from .license_key_instance_update_params import LicenseKeyInstanceUpdateParams as LicenseKeyInstanceUpdateParams
|
|
88
|
+
from .payment_retrieve_line_items_response import PaymentRetrieveLineItemsResponse as PaymentRetrieveLineItemsResponse
|
|
83
89
|
from .misc_list_supported_countries_response import (
|
|
84
90
|
MiscListSupportedCountriesResponse as MiscListSupportedCountriesResponse,
|
|
85
91
|
)
|
|
@@ -5,10 +5,16 @@ from __future__ import annotations
|
|
|
5
5
|
from typing import Optional
|
|
6
6
|
from typing_extensions import TypedDict
|
|
7
7
|
|
|
8
|
-
__all__ = ["
|
|
8
|
+
__all__ = ["BrandCreateParams"]
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
class
|
|
11
|
+
class BrandCreateParams(TypedDict, total=False):
|
|
12
|
+
description: Optional[str]
|
|
13
|
+
|
|
12
14
|
name: Optional[str]
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
statement_descriptor: Optional[str]
|
|
17
|
+
|
|
18
|
+
support_email: Optional[str]
|
|
19
|
+
|
|
20
|
+
url: Optional[str]
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import Optional
|
|
4
|
+
from typing_extensions import Literal
|
|
5
|
+
|
|
6
|
+
from .._models import BaseModel
|
|
7
|
+
|
|
8
|
+
__all__ = ["BrandCreateResponse"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class BrandCreateResponse(BaseModel):
|
|
12
|
+
brand_id: str
|
|
13
|
+
|
|
14
|
+
business_id: str
|
|
15
|
+
|
|
16
|
+
enabled: bool
|
|
17
|
+
|
|
18
|
+
statement_descriptor: str
|
|
19
|
+
|
|
20
|
+
verification_enabled: bool
|
|
21
|
+
|
|
22
|
+
verification_status: Literal["Success", "Fail", "Review", "Hold"]
|
|
23
|
+
|
|
24
|
+
description: Optional[str] = None
|
|
25
|
+
|
|
26
|
+
image: Optional[str] = None
|
|
27
|
+
|
|
28
|
+
name: Optional[str] = None
|
|
29
|
+
|
|
30
|
+
reason_for_hold: Optional[str] = None
|
|
31
|
+
"""Incase the brand verification fails or is put on hold"""
|
|
32
|
+
|
|
33
|
+
support_email: Optional[str] = None
|
|
34
|
+
|
|
35
|
+
url: Optional[str] = None
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import List, Optional
|
|
4
|
+
from typing_extensions import Literal
|
|
5
|
+
|
|
6
|
+
from .._models import BaseModel
|
|
7
|
+
|
|
8
|
+
__all__ = ["BrandListResponse", "Item"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Item(BaseModel):
|
|
12
|
+
brand_id: str
|
|
13
|
+
|
|
14
|
+
business_id: str
|
|
15
|
+
|
|
16
|
+
enabled: bool
|
|
17
|
+
|
|
18
|
+
statement_descriptor: str
|
|
19
|
+
|
|
20
|
+
verification_enabled: bool
|
|
21
|
+
|
|
22
|
+
verification_status: Literal["Success", "Fail", "Review", "Hold"]
|
|
23
|
+
|
|
24
|
+
description: Optional[str] = None
|
|
25
|
+
|
|
26
|
+
image: Optional[str] = None
|
|
27
|
+
|
|
28
|
+
name: Optional[str] = None
|
|
29
|
+
|
|
30
|
+
reason_for_hold: Optional[str] = None
|
|
31
|
+
"""Incase the brand verification fails or is put on hold"""
|
|
32
|
+
|
|
33
|
+
support_email: Optional[str] = None
|
|
34
|
+
|
|
35
|
+
url: Optional[str] = None
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class BrandListResponse(BaseModel):
|
|
39
|
+
items: List[Item]
|
|
40
|
+
"""List of brands for this business"""
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import Optional
|
|
4
|
+
from typing_extensions import Literal
|
|
5
|
+
|
|
6
|
+
from .._models import BaseModel
|
|
7
|
+
|
|
8
|
+
__all__ = ["BrandRetrieveResponse"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class BrandRetrieveResponse(BaseModel):
|
|
12
|
+
brand_id: str
|
|
13
|
+
|
|
14
|
+
business_id: str
|
|
15
|
+
|
|
16
|
+
enabled: bool
|
|
17
|
+
|
|
18
|
+
statement_descriptor: str
|
|
19
|
+
|
|
20
|
+
verification_enabled: bool
|
|
21
|
+
|
|
22
|
+
verification_status: Literal["Success", "Fail", "Review", "Hold"]
|
|
23
|
+
|
|
24
|
+
description: Optional[str] = None
|
|
25
|
+
|
|
26
|
+
image: Optional[str] = None
|
|
27
|
+
|
|
28
|
+
name: Optional[str] = None
|
|
29
|
+
|
|
30
|
+
reason_for_hold: Optional[str] = None
|
|
31
|
+
"""Incase the brand verification fails or is put on hold"""
|
|
32
|
+
|
|
33
|
+
support_email: Optional[str] = None
|
|
34
|
+
|
|
35
|
+
url: Optional[str] = None
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from .._models import BaseModel
|
|
4
|
+
|
|
5
|
+
__all__ = ["BrandUpdateImagesResponse"]
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class BrandUpdateImagesResponse(BaseModel):
|
|
9
|
+
image_id: str
|
|
10
|
+
"""UUID that will be used as the image identifier/key suffix"""
|
|
11
|
+
|
|
12
|
+
url: str
|
|
13
|
+
"""Presigned URL to upload the image"""
|