dodopayments 1.51.1__py3-none-any.whl → 1.56.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.
Files changed (139) hide show
  1. dodopayments/__init__.py +5 -1
  2. dodopayments/_base_client.py +12 -12
  3. dodopayments/_client.py +52 -14
  4. dodopayments/_compat.py +48 -48
  5. dodopayments/_exceptions.py +4 -0
  6. dodopayments/_models.py +50 -44
  7. dodopayments/_qs.py +7 -7
  8. dodopayments/_streaming.py +4 -6
  9. dodopayments/_types.py +18 -11
  10. dodopayments/_utils/__init__.py +8 -2
  11. dodopayments/_utils/_compat.py +45 -0
  12. dodopayments/_utils/_datetime_parse.py +136 -0
  13. dodopayments/_utils/_transform.py +13 -3
  14. dodopayments/_utils/_typing.py +1 -1
  15. dodopayments/_utils/_utils.py +5 -6
  16. dodopayments/_version.py +1 -1
  17. dodopayments/resources/__init__.py +28 -0
  18. dodopayments/resources/addons.py +29 -29
  19. dodopayments/resources/brands.py +29 -29
  20. dodopayments/resources/checkout_sessions.py +110 -27
  21. dodopayments/resources/customers/__init__.py +14 -0
  22. dodopayments/resources/customers/customer_portal.py +5 -5
  23. dodopayments/resources/customers/customers.py +53 -21
  24. dodopayments/resources/customers/wallets/__init__.py +33 -0
  25. dodopayments/resources/customers/wallets/ledger_entries.py +318 -0
  26. dodopayments/resources/customers/wallets/wallets.py +191 -0
  27. dodopayments/resources/discounts.py +44 -44
  28. dodopayments/resources/disputes.py +19 -19
  29. dodopayments/resources/invoices/payments.py +83 -3
  30. dodopayments/resources/license_key_instances.py +13 -13
  31. dodopayments/resources/license_keys.py +23 -23
  32. dodopayments/resources/licenses.py +14 -14
  33. dodopayments/resources/meters.py +554 -0
  34. dodopayments/resources/misc.py +3 -3
  35. dodopayments/resources/payments.py +49 -41
  36. dodopayments/resources/payouts.py +26 -7
  37. dodopayments/resources/products/images.py +5 -5
  38. dodopayments/resources/products/products.py +82 -82
  39. dodopayments/resources/refunds.py +39 -30
  40. dodopayments/resources/subscriptions.py +316 -73
  41. dodopayments/resources/usage_events.py +597 -0
  42. dodopayments/resources/webhooks/headers.py +5 -5
  43. dodopayments/resources/webhooks/webhooks.py +119 -44
  44. dodopayments/types/__init__.py +48 -0
  45. dodopayments/types/add_meter_to_price.py +29 -0
  46. dodopayments/types/add_meter_to_price_param.py +30 -0
  47. dodopayments/types/checkout_session_create_params.py +6 -0
  48. dodopayments/types/checkout_session_status.py +35 -0
  49. dodopayments/types/customer_limited_details.py +5 -0
  50. dodopayments/types/customers/__init__.py +2 -0
  51. dodopayments/types/customers/customer_wallet.py +20 -0
  52. dodopayments/types/customers/wallet_list_response.py +15 -0
  53. dodopayments/types/customers/wallets/__init__.py +7 -0
  54. dodopayments/types/customers/wallets/customer_wallet_transaction.py +38 -0
  55. dodopayments/types/customers/wallets/ledger_entry_create_params.py +25 -0
  56. dodopayments/types/customers/wallets/ledger_entry_list_params.py +18 -0
  57. dodopayments/types/discount_create_params.py +3 -2
  58. dodopayments/types/discount_update_params.py +3 -2
  59. dodopayments/types/dispute_accepted_webhook_event.py +29 -0
  60. dodopayments/types/dispute_accepted_webhook_event1.py +29 -0
  61. dodopayments/types/dispute_cancelled_webhook_event.py +29 -0
  62. dodopayments/types/dispute_cancelled_webhook_event1.py +29 -0
  63. dodopayments/types/dispute_challenged_webhook_event.py +29 -0
  64. dodopayments/types/dispute_challenged_webhook_event1.py +29 -0
  65. dodopayments/types/dispute_expired_webhook_event.py +29 -0
  66. dodopayments/types/dispute_expired_webhook_event1.py +29 -0
  67. dodopayments/types/dispute_lost_webhook_event.py +29 -0
  68. dodopayments/types/dispute_lost_webhook_event1.py +29 -0
  69. dodopayments/types/dispute_opened_webhook_event.py +29 -0
  70. dodopayments/types/dispute_opened_webhook_event1.py +29 -0
  71. dodopayments/types/dispute_won_webhook_event.py +29 -0
  72. dodopayments/types/dispute_won_webhook_event1.py +29 -0
  73. dodopayments/types/event.py +26 -0
  74. dodopayments/types/event_input_param.py +38 -0
  75. dodopayments/types/license_activate_response.py +40 -0
  76. dodopayments/types/license_key_created_webhook_event.py +29 -0
  77. dodopayments/types/license_key_created_webhook_event1.py +29 -0
  78. dodopayments/types/meter.py +40 -0
  79. dodopayments/types/meter_aggregation.py +16 -0
  80. dodopayments/types/meter_aggregation_param.py +16 -0
  81. dodopayments/types/meter_create_params.py +31 -0
  82. dodopayments/types/meter_filter.py +131 -0
  83. dodopayments/types/meter_filter_param.py +143 -0
  84. dodopayments/types/meter_list_params.py +18 -0
  85. dodopayments/types/new_customer_param.py +7 -1
  86. dodopayments/types/payment.py +37 -2
  87. dodopayments/types/payment_cancelled_webhook_event.py +29 -0
  88. dodopayments/types/payment_cancelled_webhook_event1.py +29 -0
  89. dodopayments/types/payment_create_params.py +3 -0
  90. dodopayments/types/payment_failed_webhook_event.py +29 -0
  91. dodopayments/types/payment_failed_webhook_event1.py +29 -0
  92. dodopayments/types/payment_method_types.py +1 -0
  93. dodopayments/types/payment_processing_webhook_event.py +29 -0
  94. dodopayments/types/payment_processing_webhook_event1.py +29 -0
  95. dodopayments/types/payment_succeeded_webhook_event.py +29 -0
  96. dodopayments/types/payment_succeeded_webhook_event1.py +29 -0
  97. dodopayments/types/payout_list_params.py +11 -1
  98. dodopayments/types/price.py +52 -5
  99. dodopayments/types/price_param.py +52 -5
  100. dodopayments/types/product_create_params.py +3 -2
  101. dodopayments/types/product_update_params.py +4 -3
  102. dodopayments/types/refund.py +8 -1
  103. dodopayments/types/refund_create_params.py +4 -1
  104. dodopayments/types/refund_failed_webhook_event.py +29 -0
  105. dodopayments/types/refund_failed_webhook_event1.py +29 -0
  106. dodopayments/types/refund_list_response.py +39 -0
  107. dodopayments/types/refund_succeeded_webhook_event.py +29 -0
  108. dodopayments/types/refund_succeeded_webhook_event1.py +29 -0
  109. dodopayments/types/subscription.py +23 -1
  110. dodopayments/types/subscription_active_webhook_event.py +29 -0
  111. dodopayments/types/subscription_active_webhook_event1.py +29 -0
  112. dodopayments/types/subscription_cancelled_webhook_event.py +29 -0
  113. dodopayments/types/subscription_cancelled_webhook_event1.py +29 -0
  114. dodopayments/types/subscription_charge_params.py +12 -1
  115. dodopayments/types/subscription_create_params.py +3 -0
  116. dodopayments/types/subscription_expired_webhook_event.py +29 -0
  117. dodopayments/types/subscription_expired_webhook_event1.py +29 -0
  118. dodopayments/types/subscription_failed_webhook_event.py +29 -0
  119. dodopayments/types/subscription_failed_webhook_event1.py +29 -0
  120. dodopayments/types/subscription_list_response.py +3 -0
  121. dodopayments/types/subscription_on_hold_webhook_event.py +29 -0
  122. dodopayments/types/subscription_on_hold_webhook_event1.py +29 -0
  123. dodopayments/types/subscription_plan_changed_webhook_event.py +29 -0
  124. dodopayments/types/subscription_plan_changed_webhook_event1.py +29 -0
  125. dodopayments/types/subscription_renewed_webhook_event.py +29 -0
  126. dodopayments/types/subscription_renewed_webhook_event1.py +29 -0
  127. dodopayments/types/subscription_retrieve_usage_history_params.py +28 -0
  128. dodopayments/types/subscription_retrieve_usage_history_response.py +46 -0
  129. dodopayments/types/subscription_update_params.py +2 -0
  130. dodopayments/types/unsafe_unwrap_webhook_event.py +52 -0
  131. dodopayments/types/unwrap_webhook_event.py +52 -0
  132. dodopayments/types/usage_event_ingest_params.py +15 -0
  133. dodopayments/types/usage_event_ingest_response.py +9 -0
  134. dodopayments/types/usage_event_list_params.py +42 -0
  135. {dodopayments-1.51.1.dist-info → dodopayments-1.56.5.dist-info}/METADATA +6 -4
  136. dodopayments-1.56.5.dist-info/RECORD +239 -0
  137. dodopayments-1.51.1.dist-info/RECORD +0 -163
  138. {dodopayments-1.51.1.dist-info → dodopayments-1.56.5.dist-info}/WHEEL +0 -0
  139. {dodopayments-1.51.1.dist-info → dodopayments-1.56.5.dist-info}/licenses/LICENSE +0 -0
@@ -2,7 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import Dict, List, Optional
5
+ from typing import Dict, Optional
6
6
 
7
7
  import httpx
8
8
 
@@ -21,7 +21,7 @@ from ...types import (
21
21
  product_update_params,
22
22
  product_update_files_params,
23
23
  )
24
- from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven
24
+ from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, SequenceNotStr, omit, not_given
25
25
  from ..._utils import maybe_transform, async_maybe_transform
26
26
  from ..._compat import cached_property
27
27
  from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -72,22 +72,22 @@ class ProductsResource(SyncAPIResource):
72
72
  *,
73
73
  price: PriceParam,
74
74
  tax_category: TaxCategory,
75
- addons: Optional[List[str]] | NotGiven = NOT_GIVEN,
76
- brand_id: Optional[str] | NotGiven = NOT_GIVEN,
77
- description: Optional[str] | NotGiven = NOT_GIVEN,
78
- digital_product_delivery: Optional[product_create_params.DigitalProductDelivery] | NotGiven = NOT_GIVEN,
79
- license_key_activation_message: Optional[str] | NotGiven = NOT_GIVEN,
80
- license_key_activations_limit: Optional[int] | NotGiven = NOT_GIVEN,
81
- license_key_duration: Optional[LicenseKeyDurationParam] | NotGiven = NOT_GIVEN,
82
- license_key_enabled: Optional[bool] | NotGiven = NOT_GIVEN,
83
- metadata: Dict[str, str] | NotGiven = NOT_GIVEN,
84
- name: Optional[str] | NotGiven = NOT_GIVEN,
75
+ addons: Optional[SequenceNotStr[str]] | Omit = omit,
76
+ brand_id: Optional[str] | Omit = omit,
77
+ description: Optional[str] | Omit = omit,
78
+ digital_product_delivery: Optional[product_create_params.DigitalProductDelivery] | Omit = omit,
79
+ license_key_activation_message: Optional[str] | Omit = omit,
80
+ license_key_activations_limit: Optional[int] | Omit = omit,
81
+ license_key_duration: Optional[LicenseKeyDurationParam] | Omit = omit,
82
+ license_key_enabled: Optional[bool] | Omit = omit,
83
+ metadata: Dict[str, str] | Omit = omit,
84
+ name: Optional[str] | Omit = omit,
85
85
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
86
86
  # The extra values given here take precedence over values defined on the client or passed to this method.
87
87
  extra_headers: Headers | None = None,
88
88
  extra_query: Query | None = None,
89
89
  extra_body: Body | None = None,
90
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
90
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
91
91
  ) -> Product:
92
92
  """
93
93
  Args:
@@ -159,7 +159,7 @@ class ProductsResource(SyncAPIResource):
159
159
  extra_headers: Headers | None = None,
160
160
  extra_query: Query | None = None,
161
161
  extra_body: Body | None = None,
162
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
162
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
163
163
  ) -> Product:
164
164
  """
165
165
  Args:
@@ -185,25 +185,25 @@ class ProductsResource(SyncAPIResource):
185
185
  self,
186
186
  id: str,
187
187
  *,
188
- addons: Optional[List[str]] | NotGiven = NOT_GIVEN,
189
- brand_id: Optional[str] | NotGiven = NOT_GIVEN,
190
- description: Optional[str] | NotGiven = NOT_GIVEN,
191
- digital_product_delivery: Optional[product_update_params.DigitalProductDelivery] | NotGiven = NOT_GIVEN,
192
- image_id: Optional[str] | NotGiven = NOT_GIVEN,
193
- license_key_activation_message: Optional[str] | NotGiven = NOT_GIVEN,
194
- license_key_activations_limit: Optional[int] | NotGiven = NOT_GIVEN,
195
- license_key_duration: Optional[LicenseKeyDurationParam] | NotGiven = NOT_GIVEN,
196
- license_key_enabled: Optional[bool] | NotGiven = NOT_GIVEN,
197
- metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
198
- name: Optional[str] | NotGiven = NOT_GIVEN,
199
- price: Optional[PriceParam] | NotGiven = NOT_GIVEN,
200
- tax_category: Optional[TaxCategory] | NotGiven = NOT_GIVEN,
188
+ addons: Optional[SequenceNotStr[str]] | Omit = omit,
189
+ brand_id: Optional[str] | Omit = omit,
190
+ description: Optional[str] | Omit = omit,
191
+ digital_product_delivery: Optional[product_update_params.DigitalProductDelivery] | Omit = omit,
192
+ image_id: Optional[str] | Omit = omit,
193
+ license_key_activation_message: Optional[str] | Omit = omit,
194
+ license_key_activations_limit: Optional[int] | Omit = omit,
195
+ license_key_duration: Optional[LicenseKeyDurationParam] | Omit = omit,
196
+ license_key_enabled: Optional[bool] | Omit = omit,
197
+ metadata: Optional[Dict[str, str]] | Omit = omit,
198
+ name: Optional[str] | Omit = omit,
199
+ price: Optional[PriceParam] | Omit = omit,
200
+ tax_category: Optional[TaxCategory] | Omit = omit,
201
201
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
202
202
  # The extra values given here take precedence over values defined on the client or passed to this method.
203
203
  extra_headers: Headers | None = None,
204
204
  extra_query: Query | None = None,
205
205
  extra_body: Body | None = None,
206
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
206
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
207
207
  ) -> None:
208
208
  """
209
209
  Args:
@@ -283,17 +283,17 @@ class ProductsResource(SyncAPIResource):
283
283
  def list(
284
284
  self,
285
285
  *,
286
- archived: bool | NotGiven = NOT_GIVEN,
287
- brand_id: str | NotGiven = NOT_GIVEN,
288
- page_number: int | NotGiven = NOT_GIVEN,
289
- page_size: int | NotGiven = NOT_GIVEN,
290
- recurring: bool | NotGiven = NOT_GIVEN,
286
+ archived: bool | Omit = omit,
287
+ brand_id: str | Omit = omit,
288
+ page_number: int | Omit = omit,
289
+ page_size: int | Omit = omit,
290
+ recurring: bool | Omit = omit,
291
291
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
292
292
  # The extra values given here take precedence over values defined on the client or passed to this method.
293
293
  extra_headers: Headers | None = None,
294
294
  extra_query: Query | None = None,
295
295
  extra_body: Body | None = None,
296
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
296
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
297
297
  ) -> SyncDefaultPageNumberPagination[ProductListResponse]:
298
298
  """
299
299
  Args:
@@ -342,7 +342,7 @@ class ProductsResource(SyncAPIResource):
342
342
  model=ProductListResponse,
343
343
  )
344
344
 
345
- def delete(
345
+ def archive(
346
346
  self,
347
347
  id: str,
348
348
  *,
@@ -351,7 +351,7 @@ class ProductsResource(SyncAPIResource):
351
351
  extra_headers: Headers | None = None,
352
352
  extra_query: Query | None = None,
353
353
  extra_body: Body | None = None,
354
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
354
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
355
355
  ) -> None:
356
356
  """
357
357
  Args:
@@ -383,7 +383,7 @@ class ProductsResource(SyncAPIResource):
383
383
  extra_headers: Headers | None = None,
384
384
  extra_query: Query | None = None,
385
385
  extra_body: Body | None = None,
386
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
386
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
387
387
  ) -> None:
388
388
  """
389
389
  Args:
@@ -416,7 +416,7 @@ class ProductsResource(SyncAPIResource):
416
416
  extra_headers: Headers | None = None,
417
417
  extra_query: Query | None = None,
418
418
  extra_body: Body | None = None,
419
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
419
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
420
420
  ) -> ProductUpdateFilesResponse:
421
421
  """
422
422
  Args:
@@ -469,22 +469,22 @@ class AsyncProductsResource(AsyncAPIResource):
469
469
  *,
470
470
  price: PriceParam,
471
471
  tax_category: TaxCategory,
472
- addons: Optional[List[str]] | NotGiven = NOT_GIVEN,
473
- brand_id: Optional[str] | NotGiven = NOT_GIVEN,
474
- description: Optional[str] | NotGiven = NOT_GIVEN,
475
- digital_product_delivery: Optional[product_create_params.DigitalProductDelivery] | NotGiven = NOT_GIVEN,
476
- license_key_activation_message: Optional[str] | NotGiven = NOT_GIVEN,
477
- license_key_activations_limit: Optional[int] | NotGiven = NOT_GIVEN,
478
- license_key_duration: Optional[LicenseKeyDurationParam] | NotGiven = NOT_GIVEN,
479
- license_key_enabled: Optional[bool] | NotGiven = NOT_GIVEN,
480
- metadata: Dict[str, str] | NotGiven = NOT_GIVEN,
481
- name: Optional[str] | NotGiven = NOT_GIVEN,
472
+ addons: Optional[SequenceNotStr[str]] | Omit = omit,
473
+ brand_id: Optional[str] | Omit = omit,
474
+ description: Optional[str] | Omit = omit,
475
+ digital_product_delivery: Optional[product_create_params.DigitalProductDelivery] | Omit = omit,
476
+ license_key_activation_message: Optional[str] | Omit = omit,
477
+ license_key_activations_limit: Optional[int] | Omit = omit,
478
+ license_key_duration: Optional[LicenseKeyDurationParam] | Omit = omit,
479
+ license_key_enabled: Optional[bool] | Omit = omit,
480
+ metadata: Dict[str, str] | Omit = omit,
481
+ name: Optional[str] | Omit = omit,
482
482
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
483
483
  # The extra values given here take precedence over values defined on the client or passed to this method.
484
484
  extra_headers: Headers | None = None,
485
485
  extra_query: Query | None = None,
486
486
  extra_body: Body | None = None,
487
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
487
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
488
488
  ) -> Product:
489
489
  """
490
490
  Args:
@@ -556,7 +556,7 @@ class AsyncProductsResource(AsyncAPIResource):
556
556
  extra_headers: Headers | None = None,
557
557
  extra_query: Query | None = None,
558
558
  extra_body: Body | None = None,
559
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
559
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
560
560
  ) -> Product:
561
561
  """
562
562
  Args:
@@ -582,25 +582,25 @@ class AsyncProductsResource(AsyncAPIResource):
582
582
  self,
583
583
  id: str,
584
584
  *,
585
- addons: Optional[List[str]] | NotGiven = NOT_GIVEN,
586
- brand_id: Optional[str] | NotGiven = NOT_GIVEN,
587
- description: Optional[str] | NotGiven = NOT_GIVEN,
588
- digital_product_delivery: Optional[product_update_params.DigitalProductDelivery] | NotGiven = NOT_GIVEN,
589
- image_id: Optional[str] | NotGiven = NOT_GIVEN,
590
- license_key_activation_message: Optional[str] | NotGiven = NOT_GIVEN,
591
- license_key_activations_limit: Optional[int] | NotGiven = NOT_GIVEN,
592
- license_key_duration: Optional[LicenseKeyDurationParam] | NotGiven = NOT_GIVEN,
593
- license_key_enabled: Optional[bool] | NotGiven = NOT_GIVEN,
594
- metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
595
- name: Optional[str] | NotGiven = NOT_GIVEN,
596
- price: Optional[PriceParam] | NotGiven = NOT_GIVEN,
597
- tax_category: Optional[TaxCategory] | NotGiven = NOT_GIVEN,
585
+ addons: Optional[SequenceNotStr[str]] | Omit = omit,
586
+ brand_id: Optional[str] | Omit = omit,
587
+ description: Optional[str] | Omit = omit,
588
+ digital_product_delivery: Optional[product_update_params.DigitalProductDelivery] | Omit = omit,
589
+ image_id: Optional[str] | Omit = omit,
590
+ license_key_activation_message: Optional[str] | Omit = omit,
591
+ license_key_activations_limit: Optional[int] | Omit = omit,
592
+ license_key_duration: Optional[LicenseKeyDurationParam] | Omit = omit,
593
+ license_key_enabled: Optional[bool] | Omit = omit,
594
+ metadata: Optional[Dict[str, str]] | Omit = omit,
595
+ name: Optional[str] | Omit = omit,
596
+ price: Optional[PriceParam] | Omit = omit,
597
+ tax_category: Optional[TaxCategory] | Omit = omit,
598
598
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
599
599
  # The extra values given here take precedence over values defined on the client or passed to this method.
600
600
  extra_headers: Headers | None = None,
601
601
  extra_query: Query | None = None,
602
602
  extra_body: Body | None = None,
603
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
603
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
604
604
  ) -> None:
605
605
  """
606
606
  Args:
@@ -680,17 +680,17 @@ class AsyncProductsResource(AsyncAPIResource):
680
680
  def list(
681
681
  self,
682
682
  *,
683
- archived: bool | NotGiven = NOT_GIVEN,
684
- brand_id: str | NotGiven = NOT_GIVEN,
685
- page_number: int | NotGiven = NOT_GIVEN,
686
- page_size: int | NotGiven = NOT_GIVEN,
687
- recurring: bool | NotGiven = NOT_GIVEN,
683
+ archived: bool | Omit = omit,
684
+ brand_id: str | Omit = omit,
685
+ page_number: int | Omit = omit,
686
+ page_size: int | Omit = omit,
687
+ recurring: bool | Omit = omit,
688
688
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
689
689
  # The extra values given here take precedence over values defined on the client or passed to this method.
690
690
  extra_headers: Headers | None = None,
691
691
  extra_query: Query | None = None,
692
692
  extra_body: Body | None = None,
693
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
693
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
694
694
  ) -> AsyncPaginator[ProductListResponse, AsyncDefaultPageNumberPagination[ProductListResponse]]:
695
695
  """
696
696
  Args:
@@ -739,7 +739,7 @@ class AsyncProductsResource(AsyncAPIResource):
739
739
  model=ProductListResponse,
740
740
  )
741
741
 
742
- async def delete(
742
+ async def archive(
743
743
  self,
744
744
  id: str,
745
745
  *,
@@ -748,7 +748,7 @@ class AsyncProductsResource(AsyncAPIResource):
748
748
  extra_headers: Headers | None = None,
749
749
  extra_query: Query | None = None,
750
750
  extra_body: Body | None = None,
751
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
751
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
752
752
  ) -> None:
753
753
  """
754
754
  Args:
@@ -780,7 +780,7 @@ class AsyncProductsResource(AsyncAPIResource):
780
780
  extra_headers: Headers | None = None,
781
781
  extra_query: Query | None = None,
782
782
  extra_body: Body | None = None,
783
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
783
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
784
784
  ) -> None:
785
785
  """
786
786
  Args:
@@ -813,7 +813,7 @@ class AsyncProductsResource(AsyncAPIResource):
813
813
  extra_headers: Headers | None = None,
814
814
  extra_query: Query | None = None,
815
815
  extra_body: Body | None = None,
816
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
816
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
817
817
  ) -> ProductUpdateFilesResponse:
818
818
  """
819
819
  Args:
@@ -855,8 +855,8 @@ class ProductsResourceWithRawResponse:
855
855
  self.list = to_raw_response_wrapper(
856
856
  products.list,
857
857
  )
858
- self.delete = to_raw_response_wrapper(
859
- products.delete,
858
+ self.archive = to_raw_response_wrapper(
859
+ products.archive,
860
860
  )
861
861
  self.unarchive = to_raw_response_wrapper(
862
862
  products.unarchive,
@@ -886,8 +886,8 @@ class AsyncProductsResourceWithRawResponse:
886
886
  self.list = async_to_raw_response_wrapper(
887
887
  products.list,
888
888
  )
889
- self.delete = async_to_raw_response_wrapper(
890
- products.delete,
889
+ self.archive = async_to_raw_response_wrapper(
890
+ products.archive,
891
891
  )
892
892
  self.unarchive = async_to_raw_response_wrapper(
893
893
  products.unarchive,
@@ -917,8 +917,8 @@ class ProductsResourceWithStreamingResponse:
917
917
  self.list = to_streamed_response_wrapper(
918
918
  products.list,
919
919
  )
920
- self.delete = to_streamed_response_wrapper(
921
- products.delete,
920
+ self.archive = to_streamed_response_wrapper(
921
+ products.archive,
922
922
  )
923
923
  self.unarchive = to_streamed_response_wrapper(
924
924
  products.unarchive,
@@ -948,8 +948,8 @@ class AsyncProductsResourceWithStreamingResponse:
948
948
  self.list = async_to_streamed_response_wrapper(
949
949
  products.list,
950
950
  )
951
- self.delete = async_to_streamed_response_wrapper(
952
- products.delete,
951
+ self.archive = async_to_streamed_response_wrapper(
952
+ products.archive,
953
953
  )
954
954
  self.unarchive = async_to_streamed_response_wrapper(
955
955
  products.unarchive,
@@ -2,14 +2,14 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import Union, Iterable, Optional
5
+ from typing import Dict, Union, Iterable, Optional
6
6
  from datetime import datetime
7
7
  from typing_extensions import Literal
8
8
 
9
9
  import httpx
10
10
 
11
11
  from ..types import refund_list_params, refund_create_params
12
- from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
12
+ from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
13
13
  from .._utils import maybe_transform, async_maybe_transform
14
14
  from .._compat import cached_property
15
15
  from .._resource import SyncAPIResource, AsyncAPIResource
@@ -22,6 +22,7 @@ from .._response import (
22
22
  from ..pagination import SyncDefaultPageNumberPagination, AsyncDefaultPageNumberPagination
23
23
  from .._base_client import AsyncPaginator, make_request_options
24
24
  from ..types.refund import Refund
25
+ from ..types.refund_list_response import RefundListResponse
25
26
 
26
27
  __all__ = ["RefundsResource", "AsyncRefundsResource"]
27
28
 
@@ -50,14 +51,15 @@ class RefundsResource(SyncAPIResource):
50
51
  self,
51
52
  *,
52
53
  payment_id: str,
53
- items: Optional[Iterable[refund_create_params.Item]] | NotGiven = NOT_GIVEN,
54
- reason: Optional[str] | NotGiven = NOT_GIVEN,
54
+ items: Optional[Iterable[refund_create_params.Item]] | Omit = omit,
55
+ metadata: Dict[str, str] | Omit = omit,
56
+ reason: Optional[str] | Omit = omit,
55
57
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
56
58
  # The extra values given here take precedence over values defined on the client or passed to this method.
57
59
  extra_headers: Headers | None = None,
58
60
  extra_query: Query | None = None,
59
61
  extra_body: Body | None = None,
60
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
62
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
61
63
  ) -> Refund:
62
64
  """
63
65
  Args:
@@ -65,6 +67,8 @@ class RefundsResource(SyncAPIResource):
65
67
 
66
68
  items: Partially Refund an Individual Item
67
69
 
70
+ metadata: Additional metadata associated with the refund.
71
+
68
72
  reason: The reason for the refund, if any. Maximum length is 3000 characters. Optional.
69
73
 
70
74
  extra_headers: Send extra headers
@@ -81,6 +85,7 @@ class RefundsResource(SyncAPIResource):
81
85
  {
82
86
  "payment_id": payment_id,
83
87
  "items": items,
88
+ "metadata": metadata,
84
89
  "reason": reason,
85
90
  },
86
91
  refund_create_params.RefundCreateParams,
@@ -100,7 +105,7 @@ class RefundsResource(SyncAPIResource):
100
105
  extra_headers: Headers | None = None,
101
106
  extra_query: Query | None = None,
102
107
  extra_body: Body | None = None,
103
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
108
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
104
109
  ) -> Refund:
105
110
  """
106
111
  Args:
@@ -125,19 +130,19 @@ class RefundsResource(SyncAPIResource):
125
130
  def list(
126
131
  self,
127
132
  *,
128
- created_at_gte: Union[str, datetime] | NotGiven = NOT_GIVEN,
129
- created_at_lte: Union[str, datetime] | NotGiven = NOT_GIVEN,
130
- customer_id: str | NotGiven = NOT_GIVEN,
131
- page_number: int | NotGiven = NOT_GIVEN,
132
- page_size: int | NotGiven = NOT_GIVEN,
133
- status: Literal["succeeded", "failed", "pending", "review"] | NotGiven = NOT_GIVEN,
133
+ created_at_gte: Union[str, datetime] | Omit = omit,
134
+ created_at_lte: Union[str, datetime] | Omit = omit,
135
+ customer_id: str | Omit = omit,
136
+ page_number: int | Omit = omit,
137
+ page_size: int | Omit = omit,
138
+ status: Literal["succeeded", "failed", "pending", "review"] | Omit = omit,
134
139
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
135
140
  # The extra values given here take precedence over values defined on the client or passed to this method.
136
141
  extra_headers: Headers | None = None,
137
142
  extra_query: Query | None = None,
138
143
  extra_body: Body | None = None,
139
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
140
- ) -> SyncDefaultPageNumberPagination[Refund]:
144
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
145
+ ) -> SyncDefaultPageNumberPagination[RefundListResponse]:
141
146
  """
142
147
  Args:
143
148
  created_at_gte: Get events after this created time
@@ -162,7 +167,7 @@ class RefundsResource(SyncAPIResource):
162
167
  """
163
168
  return self._get_api_list(
164
169
  "/refunds",
165
- page=SyncDefaultPageNumberPagination[Refund],
170
+ page=SyncDefaultPageNumberPagination[RefundListResponse],
166
171
  options=make_request_options(
167
172
  extra_headers=extra_headers,
168
173
  extra_query=extra_query,
@@ -180,7 +185,7 @@ class RefundsResource(SyncAPIResource):
180
185
  refund_list_params.RefundListParams,
181
186
  ),
182
187
  ),
183
- model=Refund,
188
+ model=RefundListResponse,
184
189
  )
185
190
 
186
191
 
@@ -208,14 +213,15 @@ class AsyncRefundsResource(AsyncAPIResource):
208
213
  self,
209
214
  *,
210
215
  payment_id: str,
211
- items: Optional[Iterable[refund_create_params.Item]] | NotGiven = NOT_GIVEN,
212
- reason: Optional[str] | NotGiven = NOT_GIVEN,
216
+ items: Optional[Iterable[refund_create_params.Item]] | Omit = omit,
217
+ metadata: Dict[str, str] | Omit = omit,
218
+ reason: Optional[str] | Omit = omit,
213
219
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
214
220
  # The extra values given here take precedence over values defined on the client or passed to this method.
215
221
  extra_headers: Headers | None = None,
216
222
  extra_query: Query | None = None,
217
223
  extra_body: Body | None = None,
218
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
224
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
219
225
  ) -> Refund:
220
226
  """
221
227
  Args:
@@ -223,6 +229,8 @@ class AsyncRefundsResource(AsyncAPIResource):
223
229
 
224
230
  items: Partially Refund an Individual Item
225
231
 
232
+ metadata: Additional metadata associated with the refund.
233
+
226
234
  reason: The reason for the refund, if any. Maximum length is 3000 characters. Optional.
227
235
 
228
236
  extra_headers: Send extra headers
@@ -239,6 +247,7 @@ class AsyncRefundsResource(AsyncAPIResource):
239
247
  {
240
248
  "payment_id": payment_id,
241
249
  "items": items,
250
+ "metadata": metadata,
242
251
  "reason": reason,
243
252
  },
244
253
  refund_create_params.RefundCreateParams,
@@ -258,7 +267,7 @@ class AsyncRefundsResource(AsyncAPIResource):
258
267
  extra_headers: Headers | None = None,
259
268
  extra_query: Query | None = None,
260
269
  extra_body: Body | None = None,
261
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
270
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
262
271
  ) -> Refund:
263
272
  """
264
273
  Args:
@@ -283,19 +292,19 @@ class AsyncRefundsResource(AsyncAPIResource):
283
292
  def list(
284
293
  self,
285
294
  *,
286
- created_at_gte: Union[str, datetime] | NotGiven = NOT_GIVEN,
287
- created_at_lte: Union[str, datetime] | NotGiven = NOT_GIVEN,
288
- customer_id: str | NotGiven = NOT_GIVEN,
289
- page_number: int | NotGiven = NOT_GIVEN,
290
- page_size: int | NotGiven = NOT_GIVEN,
291
- status: Literal["succeeded", "failed", "pending", "review"] | NotGiven = NOT_GIVEN,
295
+ created_at_gte: Union[str, datetime] | Omit = omit,
296
+ created_at_lte: Union[str, datetime] | Omit = omit,
297
+ customer_id: str | Omit = omit,
298
+ page_number: int | Omit = omit,
299
+ page_size: int | Omit = omit,
300
+ status: Literal["succeeded", "failed", "pending", "review"] | Omit = omit,
292
301
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
293
302
  # The extra values given here take precedence over values defined on the client or passed to this method.
294
303
  extra_headers: Headers | None = None,
295
304
  extra_query: Query | None = None,
296
305
  extra_body: Body | None = None,
297
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
298
- ) -> AsyncPaginator[Refund, AsyncDefaultPageNumberPagination[Refund]]:
306
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
307
+ ) -> AsyncPaginator[RefundListResponse, AsyncDefaultPageNumberPagination[RefundListResponse]]:
299
308
  """
300
309
  Args:
301
310
  created_at_gte: Get events after this created time
@@ -320,7 +329,7 @@ class AsyncRefundsResource(AsyncAPIResource):
320
329
  """
321
330
  return self._get_api_list(
322
331
  "/refunds",
323
- page=AsyncDefaultPageNumberPagination[Refund],
332
+ page=AsyncDefaultPageNumberPagination[RefundListResponse],
324
333
  options=make_request_options(
325
334
  extra_headers=extra_headers,
326
335
  extra_query=extra_query,
@@ -338,7 +347,7 @@ class AsyncRefundsResource(AsyncAPIResource):
338
347
  refund_list_params.RefundListParams,
339
348
  ),
340
349
  ),
341
- model=Refund,
350
+ model=RefundListResponse,
342
351
  )
343
352
 
344
353