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
dodopayments/_client.py
CHANGED
|
@@ -24,6 +24,7 @@ from ._version import __version__
|
|
|
24
24
|
from .resources import (
|
|
25
25
|
misc,
|
|
26
26
|
addons,
|
|
27
|
+
brands,
|
|
27
28
|
payouts,
|
|
28
29
|
refunds,
|
|
29
30
|
disputes,
|
|
@@ -80,6 +81,7 @@ class DodoPayments(SyncAPIClient):
|
|
|
80
81
|
misc: misc.MiscResource
|
|
81
82
|
discounts: discounts.DiscountsResource
|
|
82
83
|
addons: addons.AddonsResource
|
|
84
|
+
brands: brands.BrandsResource
|
|
83
85
|
with_raw_response: DodoPaymentsWithRawResponse
|
|
84
86
|
with_streaming_response: DodoPaymentsWithStreamedResponse
|
|
85
87
|
|
|
@@ -176,6 +178,7 @@ class DodoPayments(SyncAPIClient):
|
|
|
176
178
|
self.misc = misc.MiscResource(self)
|
|
177
179
|
self.discounts = discounts.DiscountsResource(self)
|
|
178
180
|
self.addons = addons.AddonsResource(self)
|
|
181
|
+
self.brands = brands.BrandsResource(self)
|
|
179
182
|
self.with_raw_response = DodoPaymentsWithRawResponse(self)
|
|
180
183
|
self.with_streaming_response = DodoPaymentsWithStreamedResponse(self)
|
|
181
184
|
|
|
@@ -302,6 +305,7 @@ class AsyncDodoPayments(AsyncAPIClient):
|
|
|
302
305
|
misc: misc.AsyncMiscResource
|
|
303
306
|
discounts: discounts.AsyncDiscountsResource
|
|
304
307
|
addons: addons.AsyncAddonsResource
|
|
308
|
+
brands: brands.AsyncBrandsResource
|
|
305
309
|
with_raw_response: AsyncDodoPaymentsWithRawResponse
|
|
306
310
|
with_streaming_response: AsyncDodoPaymentsWithStreamedResponse
|
|
307
311
|
|
|
@@ -398,6 +402,7 @@ class AsyncDodoPayments(AsyncAPIClient):
|
|
|
398
402
|
self.misc = misc.AsyncMiscResource(self)
|
|
399
403
|
self.discounts = discounts.AsyncDiscountsResource(self)
|
|
400
404
|
self.addons = addons.AsyncAddonsResource(self)
|
|
405
|
+
self.brands = brands.AsyncBrandsResource(self)
|
|
401
406
|
self.with_raw_response = AsyncDodoPaymentsWithRawResponse(self)
|
|
402
407
|
self.with_streaming_response = AsyncDodoPaymentsWithStreamedResponse(self)
|
|
403
408
|
|
|
@@ -527,6 +532,7 @@ class DodoPaymentsWithRawResponse:
|
|
|
527
532
|
self.misc = misc.MiscResourceWithRawResponse(client.misc)
|
|
528
533
|
self.discounts = discounts.DiscountsResourceWithRawResponse(client.discounts)
|
|
529
534
|
self.addons = addons.AddonsResourceWithRawResponse(client.addons)
|
|
535
|
+
self.brands = brands.BrandsResourceWithRawResponse(client.brands)
|
|
530
536
|
|
|
531
537
|
|
|
532
538
|
class AsyncDodoPaymentsWithRawResponse:
|
|
@@ -548,6 +554,7 @@ class AsyncDodoPaymentsWithRawResponse:
|
|
|
548
554
|
self.misc = misc.AsyncMiscResourceWithRawResponse(client.misc)
|
|
549
555
|
self.discounts = discounts.AsyncDiscountsResourceWithRawResponse(client.discounts)
|
|
550
556
|
self.addons = addons.AsyncAddonsResourceWithRawResponse(client.addons)
|
|
557
|
+
self.brands = brands.AsyncBrandsResourceWithRawResponse(client.brands)
|
|
551
558
|
|
|
552
559
|
|
|
553
560
|
class DodoPaymentsWithStreamedResponse:
|
|
@@ -569,6 +576,7 @@ class DodoPaymentsWithStreamedResponse:
|
|
|
569
576
|
self.misc = misc.MiscResourceWithStreamingResponse(client.misc)
|
|
570
577
|
self.discounts = discounts.DiscountsResourceWithStreamingResponse(client.discounts)
|
|
571
578
|
self.addons = addons.AddonsResourceWithStreamingResponse(client.addons)
|
|
579
|
+
self.brands = brands.BrandsResourceWithStreamingResponse(client.brands)
|
|
572
580
|
|
|
573
581
|
|
|
574
582
|
class AsyncDodoPaymentsWithStreamedResponse:
|
|
@@ -590,6 +598,7 @@ class AsyncDodoPaymentsWithStreamedResponse:
|
|
|
590
598
|
self.misc = misc.AsyncMiscResourceWithStreamingResponse(client.misc)
|
|
591
599
|
self.discounts = discounts.AsyncDiscountsResourceWithStreamingResponse(client.discounts)
|
|
592
600
|
self.addons = addons.AsyncAddonsResourceWithStreamingResponse(client.addons)
|
|
601
|
+
self.brands = brands.AsyncBrandsResourceWithStreamingResponse(client.brands)
|
|
593
602
|
|
|
594
603
|
|
|
595
604
|
Client = DodoPayments
|
dodopayments/_version.py
CHANGED
|
@@ -16,6 +16,14 @@ from .addons import (
|
|
|
16
16
|
AddonsResourceWithStreamingResponse,
|
|
17
17
|
AsyncAddonsResourceWithStreamingResponse,
|
|
18
18
|
)
|
|
19
|
+
from .brands import (
|
|
20
|
+
BrandsResource,
|
|
21
|
+
AsyncBrandsResource,
|
|
22
|
+
BrandsResourceWithRawResponse,
|
|
23
|
+
AsyncBrandsResourceWithRawResponse,
|
|
24
|
+
BrandsResourceWithStreamingResponse,
|
|
25
|
+
AsyncBrandsResourceWithStreamingResponse,
|
|
26
|
+
)
|
|
19
27
|
from .payouts import (
|
|
20
28
|
PayoutsResource,
|
|
21
29
|
AsyncPayoutsResource,
|
|
@@ -212,4 +220,10 @@ __all__ = [
|
|
|
212
220
|
"AsyncAddonsResourceWithRawResponse",
|
|
213
221
|
"AddonsResourceWithStreamingResponse",
|
|
214
222
|
"AsyncAddonsResourceWithStreamingResponse",
|
|
223
|
+
"BrandsResource",
|
|
224
|
+
"AsyncBrandsResource",
|
|
225
|
+
"BrandsResourceWithRawResponse",
|
|
226
|
+
"AsyncBrandsResourceWithRawResponse",
|
|
227
|
+
"BrandsResourceWithStreamingResponse",
|
|
228
|
+
"AsyncBrandsResourceWithStreamingResponse",
|
|
215
229
|
]
|
|
@@ -0,0 +1,495 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Optional
|
|
6
|
+
|
|
7
|
+
import httpx
|
|
8
|
+
|
|
9
|
+
from ..types import brand_create_params, brand_update_params
|
|
10
|
+
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
11
|
+
from .._utils import maybe_transform, async_maybe_transform
|
|
12
|
+
from .._compat import cached_property
|
|
13
|
+
from .._resource import SyncAPIResource, AsyncAPIResource
|
|
14
|
+
from .._response import (
|
|
15
|
+
to_raw_response_wrapper,
|
|
16
|
+
to_streamed_response_wrapper,
|
|
17
|
+
async_to_raw_response_wrapper,
|
|
18
|
+
async_to_streamed_response_wrapper,
|
|
19
|
+
)
|
|
20
|
+
from .._base_client import make_request_options
|
|
21
|
+
from ..types.brand_list_response import BrandListResponse
|
|
22
|
+
from ..types.brand_create_response import BrandCreateResponse
|
|
23
|
+
from ..types.brand_update_response import BrandUpdateResponse
|
|
24
|
+
from ..types.brand_retrieve_response import BrandRetrieveResponse
|
|
25
|
+
from ..types.brand_update_images_response import BrandUpdateImagesResponse
|
|
26
|
+
|
|
27
|
+
__all__ = ["BrandsResource", "AsyncBrandsResource"]
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class BrandsResource(SyncAPIResource):
|
|
31
|
+
@cached_property
|
|
32
|
+
def with_raw_response(self) -> BrandsResourceWithRawResponse:
|
|
33
|
+
"""
|
|
34
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
35
|
+
the raw response object instead of the parsed content.
|
|
36
|
+
|
|
37
|
+
For more information, see https://www.github.com/dodopayments/dodopayments-python#accessing-raw-response-data-eg-headers
|
|
38
|
+
"""
|
|
39
|
+
return BrandsResourceWithRawResponse(self)
|
|
40
|
+
|
|
41
|
+
@cached_property
|
|
42
|
+
def with_streaming_response(self) -> BrandsResourceWithStreamingResponse:
|
|
43
|
+
"""
|
|
44
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
45
|
+
|
|
46
|
+
For more information, see https://www.github.com/dodopayments/dodopayments-python#with_streaming_response
|
|
47
|
+
"""
|
|
48
|
+
return BrandsResourceWithStreamingResponse(self)
|
|
49
|
+
|
|
50
|
+
def create(
|
|
51
|
+
self,
|
|
52
|
+
*,
|
|
53
|
+
description: Optional[str] | NotGiven = NOT_GIVEN,
|
|
54
|
+
name: Optional[str] | NotGiven = NOT_GIVEN,
|
|
55
|
+
statement_descriptor: Optional[str] | NotGiven = NOT_GIVEN,
|
|
56
|
+
support_email: Optional[str] | NotGiven = NOT_GIVEN,
|
|
57
|
+
url: Optional[str] | NotGiven = NOT_GIVEN,
|
|
58
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
59
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
60
|
+
extra_headers: Headers | None = None,
|
|
61
|
+
extra_query: Query | None = None,
|
|
62
|
+
extra_body: Body | None = None,
|
|
63
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
64
|
+
) -> BrandCreateResponse:
|
|
65
|
+
"""
|
|
66
|
+
Args:
|
|
67
|
+
extra_headers: Send extra headers
|
|
68
|
+
|
|
69
|
+
extra_query: Add additional query parameters to the request
|
|
70
|
+
|
|
71
|
+
extra_body: Add additional JSON properties to the request
|
|
72
|
+
|
|
73
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
74
|
+
"""
|
|
75
|
+
return self._post(
|
|
76
|
+
"/brands",
|
|
77
|
+
body=maybe_transform(
|
|
78
|
+
{
|
|
79
|
+
"description": description,
|
|
80
|
+
"name": name,
|
|
81
|
+
"statement_descriptor": statement_descriptor,
|
|
82
|
+
"support_email": support_email,
|
|
83
|
+
"url": url,
|
|
84
|
+
},
|
|
85
|
+
brand_create_params.BrandCreateParams,
|
|
86
|
+
),
|
|
87
|
+
options=make_request_options(
|
|
88
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
89
|
+
),
|
|
90
|
+
cast_to=BrandCreateResponse,
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
def retrieve(
|
|
94
|
+
self,
|
|
95
|
+
id: str,
|
|
96
|
+
*,
|
|
97
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
98
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
99
|
+
extra_headers: Headers | None = None,
|
|
100
|
+
extra_query: Query | None = None,
|
|
101
|
+
extra_body: Body | None = None,
|
|
102
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
103
|
+
) -> BrandRetrieveResponse:
|
|
104
|
+
"""
|
|
105
|
+
Thin handler just calls `get_brand` and wraps in `Json(...)`
|
|
106
|
+
|
|
107
|
+
Args:
|
|
108
|
+
extra_headers: Send extra headers
|
|
109
|
+
|
|
110
|
+
extra_query: Add additional query parameters to the request
|
|
111
|
+
|
|
112
|
+
extra_body: Add additional JSON properties to the request
|
|
113
|
+
|
|
114
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
115
|
+
"""
|
|
116
|
+
if not id:
|
|
117
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
118
|
+
return self._get(
|
|
119
|
+
f"/brands/{id}",
|
|
120
|
+
options=make_request_options(
|
|
121
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
122
|
+
),
|
|
123
|
+
cast_to=BrandRetrieveResponse,
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
def update(
|
|
127
|
+
self,
|
|
128
|
+
id: str,
|
|
129
|
+
*,
|
|
130
|
+
image_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
131
|
+
name: Optional[str] | NotGiven = NOT_GIVEN,
|
|
132
|
+
statement_descriptor: Optional[str] | NotGiven = NOT_GIVEN,
|
|
133
|
+
support_email: Optional[str] | NotGiven = NOT_GIVEN,
|
|
134
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
135
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
136
|
+
extra_headers: Headers | None = None,
|
|
137
|
+
extra_query: Query | None = None,
|
|
138
|
+
extra_body: Body | None = None,
|
|
139
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
140
|
+
) -> BrandUpdateResponse:
|
|
141
|
+
"""
|
|
142
|
+
Args:
|
|
143
|
+
image_id: The UUID you got back from the presigned‐upload call
|
|
144
|
+
|
|
145
|
+
extra_headers: Send extra headers
|
|
146
|
+
|
|
147
|
+
extra_query: Add additional query parameters to the request
|
|
148
|
+
|
|
149
|
+
extra_body: Add additional JSON properties to the request
|
|
150
|
+
|
|
151
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
152
|
+
"""
|
|
153
|
+
if not id:
|
|
154
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
155
|
+
return self._patch(
|
|
156
|
+
f"/brands/{id}",
|
|
157
|
+
body=maybe_transform(
|
|
158
|
+
{
|
|
159
|
+
"image_id": image_id,
|
|
160
|
+
"name": name,
|
|
161
|
+
"statement_descriptor": statement_descriptor,
|
|
162
|
+
"support_email": support_email,
|
|
163
|
+
},
|
|
164
|
+
brand_update_params.BrandUpdateParams,
|
|
165
|
+
),
|
|
166
|
+
options=make_request_options(
|
|
167
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
168
|
+
),
|
|
169
|
+
cast_to=BrandUpdateResponse,
|
|
170
|
+
)
|
|
171
|
+
|
|
172
|
+
def list(
|
|
173
|
+
self,
|
|
174
|
+
*,
|
|
175
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
176
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
177
|
+
extra_headers: Headers | None = None,
|
|
178
|
+
extra_query: Query | None = None,
|
|
179
|
+
extra_body: Body | None = None,
|
|
180
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
181
|
+
) -> BrandListResponse:
|
|
182
|
+
return self._get(
|
|
183
|
+
"/brands",
|
|
184
|
+
options=make_request_options(
|
|
185
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
186
|
+
),
|
|
187
|
+
cast_to=BrandListResponse,
|
|
188
|
+
)
|
|
189
|
+
|
|
190
|
+
def update_images(
|
|
191
|
+
self,
|
|
192
|
+
id: str,
|
|
193
|
+
*,
|
|
194
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
195
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
196
|
+
extra_headers: Headers | None = None,
|
|
197
|
+
extra_query: Query | None = None,
|
|
198
|
+
extra_body: Body | None = None,
|
|
199
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
200
|
+
) -> BrandUpdateImagesResponse:
|
|
201
|
+
"""
|
|
202
|
+
Args:
|
|
203
|
+
extra_headers: Send extra headers
|
|
204
|
+
|
|
205
|
+
extra_query: Add additional query parameters to the request
|
|
206
|
+
|
|
207
|
+
extra_body: Add additional JSON properties to the request
|
|
208
|
+
|
|
209
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
210
|
+
"""
|
|
211
|
+
if not id:
|
|
212
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
213
|
+
return self._put(
|
|
214
|
+
f"/brands/{id}/images",
|
|
215
|
+
options=make_request_options(
|
|
216
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
217
|
+
),
|
|
218
|
+
cast_to=BrandUpdateImagesResponse,
|
|
219
|
+
)
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
class AsyncBrandsResource(AsyncAPIResource):
|
|
223
|
+
@cached_property
|
|
224
|
+
def with_raw_response(self) -> AsyncBrandsResourceWithRawResponse:
|
|
225
|
+
"""
|
|
226
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
227
|
+
the raw response object instead of the parsed content.
|
|
228
|
+
|
|
229
|
+
For more information, see https://www.github.com/dodopayments/dodopayments-python#accessing-raw-response-data-eg-headers
|
|
230
|
+
"""
|
|
231
|
+
return AsyncBrandsResourceWithRawResponse(self)
|
|
232
|
+
|
|
233
|
+
@cached_property
|
|
234
|
+
def with_streaming_response(self) -> AsyncBrandsResourceWithStreamingResponse:
|
|
235
|
+
"""
|
|
236
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
237
|
+
|
|
238
|
+
For more information, see https://www.github.com/dodopayments/dodopayments-python#with_streaming_response
|
|
239
|
+
"""
|
|
240
|
+
return AsyncBrandsResourceWithStreamingResponse(self)
|
|
241
|
+
|
|
242
|
+
async def create(
|
|
243
|
+
self,
|
|
244
|
+
*,
|
|
245
|
+
description: Optional[str] | NotGiven = NOT_GIVEN,
|
|
246
|
+
name: Optional[str] | NotGiven = NOT_GIVEN,
|
|
247
|
+
statement_descriptor: Optional[str] | NotGiven = NOT_GIVEN,
|
|
248
|
+
support_email: Optional[str] | NotGiven = NOT_GIVEN,
|
|
249
|
+
url: Optional[str] | NotGiven = NOT_GIVEN,
|
|
250
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
251
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
252
|
+
extra_headers: Headers | None = None,
|
|
253
|
+
extra_query: Query | None = None,
|
|
254
|
+
extra_body: Body | None = None,
|
|
255
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
256
|
+
) -> BrandCreateResponse:
|
|
257
|
+
"""
|
|
258
|
+
Args:
|
|
259
|
+
extra_headers: Send extra headers
|
|
260
|
+
|
|
261
|
+
extra_query: Add additional query parameters to the request
|
|
262
|
+
|
|
263
|
+
extra_body: Add additional JSON properties to the request
|
|
264
|
+
|
|
265
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
266
|
+
"""
|
|
267
|
+
return await self._post(
|
|
268
|
+
"/brands",
|
|
269
|
+
body=await async_maybe_transform(
|
|
270
|
+
{
|
|
271
|
+
"description": description,
|
|
272
|
+
"name": name,
|
|
273
|
+
"statement_descriptor": statement_descriptor,
|
|
274
|
+
"support_email": support_email,
|
|
275
|
+
"url": url,
|
|
276
|
+
},
|
|
277
|
+
brand_create_params.BrandCreateParams,
|
|
278
|
+
),
|
|
279
|
+
options=make_request_options(
|
|
280
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
281
|
+
),
|
|
282
|
+
cast_to=BrandCreateResponse,
|
|
283
|
+
)
|
|
284
|
+
|
|
285
|
+
async def retrieve(
|
|
286
|
+
self,
|
|
287
|
+
id: str,
|
|
288
|
+
*,
|
|
289
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
290
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
291
|
+
extra_headers: Headers | None = None,
|
|
292
|
+
extra_query: Query | None = None,
|
|
293
|
+
extra_body: Body | None = None,
|
|
294
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
295
|
+
) -> BrandRetrieveResponse:
|
|
296
|
+
"""
|
|
297
|
+
Thin handler just calls `get_brand` and wraps in `Json(...)`
|
|
298
|
+
|
|
299
|
+
Args:
|
|
300
|
+
extra_headers: Send extra headers
|
|
301
|
+
|
|
302
|
+
extra_query: Add additional query parameters to the request
|
|
303
|
+
|
|
304
|
+
extra_body: Add additional JSON properties to the request
|
|
305
|
+
|
|
306
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
307
|
+
"""
|
|
308
|
+
if not id:
|
|
309
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
310
|
+
return await self._get(
|
|
311
|
+
f"/brands/{id}",
|
|
312
|
+
options=make_request_options(
|
|
313
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
314
|
+
),
|
|
315
|
+
cast_to=BrandRetrieveResponse,
|
|
316
|
+
)
|
|
317
|
+
|
|
318
|
+
async def update(
|
|
319
|
+
self,
|
|
320
|
+
id: str,
|
|
321
|
+
*,
|
|
322
|
+
image_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
323
|
+
name: Optional[str] | NotGiven = NOT_GIVEN,
|
|
324
|
+
statement_descriptor: Optional[str] | NotGiven = NOT_GIVEN,
|
|
325
|
+
support_email: Optional[str] | NotGiven = NOT_GIVEN,
|
|
326
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
327
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
328
|
+
extra_headers: Headers | None = None,
|
|
329
|
+
extra_query: Query | None = None,
|
|
330
|
+
extra_body: Body | None = None,
|
|
331
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
332
|
+
) -> BrandUpdateResponse:
|
|
333
|
+
"""
|
|
334
|
+
Args:
|
|
335
|
+
image_id: The UUID you got back from the presigned‐upload call
|
|
336
|
+
|
|
337
|
+
extra_headers: Send extra headers
|
|
338
|
+
|
|
339
|
+
extra_query: Add additional query parameters to the request
|
|
340
|
+
|
|
341
|
+
extra_body: Add additional JSON properties to the request
|
|
342
|
+
|
|
343
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
344
|
+
"""
|
|
345
|
+
if not id:
|
|
346
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
347
|
+
return await self._patch(
|
|
348
|
+
f"/brands/{id}",
|
|
349
|
+
body=await async_maybe_transform(
|
|
350
|
+
{
|
|
351
|
+
"image_id": image_id,
|
|
352
|
+
"name": name,
|
|
353
|
+
"statement_descriptor": statement_descriptor,
|
|
354
|
+
"support_email": support_email,
|
|
355
|
+
},
|
|
356
|
+
brand_update_params.BrandUpdateParams,
|
|
357
|
+
),
|
|
358
|
+
options=make_request_options(
|
|
359
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
360
|
+
),
|
|
361
|
+
cast_to=BrandUpdateResponse,
|
|
362
|
+
)
|
|
363
|
+
|
|
364
|
+
async def list(
|
|
365
|
+
self,
|
|
366
|
+
*,
|
|
367
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
368
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
369
|
+
extra_headers: Headers | None = None,
|
|
370
|
+
extra_query: Query | None = None,
|
|
371
|
+
extra_body: Body | None = None,
|
|
372
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
373
|
+
) -> BrandListResponse:
|
|
374
|
+
return await self._get(
|
|
375
|
+
"/brands",
|
|
376
|
+
options=make_request_options(
|
|
377
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
378
|
+
),
|
|
379
|
+
cast_to=BrandListResponse,
|
|
380
|
+
)
|
|
381
|
+
|
|
382
|
+
async def update_images(
|
|
383
|
+
self,
|
|
384
|
+
id: str,
|
|
385
|
+
*,
|
|
386
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
387
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
388
|
+
extra_headers: Headers | None = None,
|
|
389
|
+
extra_query: Query | None = None,
|
|
390
|
+
extra_body: Body | None = None,
|
|
391
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
392
|
+
) -> BrandUpdateImagesResponse:
|
|
393
|
+
"""
|
|
394
|
+
Args:
|
|
395
|
+
extra_headers: Send extra headers
|
|
396
|
+
|
|
397
|
+
extra_query: Add additional query parameters to the request
|
|
398
|
+
|
|
399
|
+
extra_body: Add additional JSON properties to the request
|
|
400
|
+
|
|
401
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
402
|
+
"""
|
|
403
|
+
if not id:
|
|
404
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
405
|
+
return await self._put(
|
|
406
|
+
f"/brands/{id}/images",
|
|
407
|
+
options=make_request_options(
|
|
408
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
409
|
+
),
|
|
410
|
+
cast_to=BrandUpdateImagesResponse,
|
|
411
|
+
)
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
class BrandsResourceWithRawResponse:
|
|
415
|
+
def __init__(self, brands: BrandsResource) -> None:
|
|
416
|
+
self._brands = brands
|
|
417
|
+
|
|
418
|
+
self.create = to_raw_response_wrapper(
|
|
419
|
+
brands.create,
|
|
420
|
+
)
|
|
421
|
+
self.retrieve = to_raw_response_wrapper(
|
|
422
|
+
brands.retrieve,
|
|
423
|
+
)
|
|
424
|
+
self.update = to_raw_response_wrapper(
|
|
425
|
+
brands.update,
|
|
426
|
+
)
|
|
427
|
+
self.list = to_raw_response_wrapper(
|
|
428
|
+
brands.list,
|
|
429
|
+
)
|
|
430
|
+
self.update_images = to_raw_response_wrapper(
|
|
431
|
+
brands.update_images,
|
|
432
|
+
)
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
class AsyncBrandsResourceWithRawResponse:
|
|
436
|
+
def __init__(self, brands: AsyncBrandsResource) -> None:
|
|
437
|
+
self._brands = brands
|
|
438
|
+
|
|
439
|
+
self.create = async_to_raw_response_wrapper(
|
|
440
|
+
brands.create,
|
|
441
|
+
)
|
|
442
|
+
self.retrieve = async_to_raw_response_wrapper(
|
|
443
|
+
brands.retrieve,
|
|
444
|
+
)
|
|
445
|
+
self.update = async_to_raw_response_wrapper(
|
|
446
|
+
brands.update,
|
|
447
|
+
)
|
|
448
|
+
self.list = async_to_raw_response_wrapper(
|
|
449
|
+
brands.list,
|
|
450
|
+
)
|
|
451
|
+
self.update_images = async_to_raw_response_wrapper(
|
|
452
|
+
brands.update_images,
|
|
453
|
+
)
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
class BrandsResourceWithStreamingResponse:
|
|
457
|
+
def __init__(self, brands: BrandsResource) -> None:
|
|
458
|
+
self._brands = brands
|
|
459
|
+
|
|
460
|
+
self.create = to_streamed_response_wrapper(
|
|
461
|
+
brands.create,
|
|
462
|
+
)
|
|
463
|
+
self.retrieve = to_streamed_response_wrapper(
|
|
464
|
+
brands.retrieve,
|
|
465
|
+
)
|
|
466
|
+
self.update = to_streamed_response_wrapper(
|
|
467
|
+
brands.update,
|
|
468
|
+
)
|
|
469
|
+
self.list = to_streamed_response_wrapper(
|
|
470
|
+
brands.list,
|
|
471
|
+
)
|
|
472
|
+
self.update_images = to_streamed_response_wrapper(
|
|
473
|
+
brands.update_images,
|
|
474
|
+
)
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
class AsyncBrandsResourceWithStreamingResponse:
|
|
478
|
+
def __init__(self, brands: AsyncBrandsResource) -> None:
|
|
479
|
+
self._brands = brands
|
|
480
|
+
|
|
481
|
+
self.create = async_to_streamed_response_wrapper(
|
|
482
|
+
brands.create,
|
|
483
|
+
)
|
|
484
|
+
self.retrieve = async_to_streamed_response_wrapper(
|
|
485
|
+
brands.retrieve,
|
|
486
|
+
)
|
|
487
|
+
self.update = async_to_streamed_response_wrapper(
|
|
488
|
+
brands.update,
|
|
489
|
+
)
|
|
490
|
+
self.list = async_to_streamed_response_wrapper(
|
|
491
|
+
brands.list,
|
|
492
|
+
)
|
|
493
|
+
self.update_images = async_to_streamed_response_wrapper(
|
|
494
|
+
brands.update_images,
|
|
495
|
+
)
|
|
@@ -6,7 +6,7 @@ from typing import Optional
|
|
|
6
6
|
|
|
7
7
|
import httpx
|
|
8
8
|
|
|
9
|
-
from ...types import customer_list_params, customer_create_params
|
|
9
|
+
from ...types import customer_list_params, customer_create_params
|
|
10
10
|
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
11
11
|
from ..._utils import maybe_transform, async_maybe_transform
|
|
12
12
|
from ..._compat import cached_property
|
|
@@ -130,8 +130,6 @@ class CustomersResource(SyncAPIResource):
|
|
|
130
130
|
self,
|
|
131
131
|
customer_id: str,
|
|
132
132
|
*,
|
|
133
|
-
name: Optional[str] | NotGiven = NOT_GIVEN,
|
|
134
|
-
phone_number: Optional[str] | NotGiven = NOT_GIVEN,
|
|
135
133
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
136
134
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
137
135
|
extra_headers: Headers | None = None,
|
|
@@ -153,13 +151,6 @@ class CustomersResource(SyncAPIResource):
|
|
|
153
151
|
raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}")
|
|
154
152
|
return self._patch(
|
|
155
153
|
f"/customers/{customer_id}",
|
|
156
|
-
body=maybe_transform(
|
|
157
|
-
{
|
|
158
|
-
"name": name,
|
|
159
|
-
"phone_number": phone_number,
|
|
160
|
-
},
|
|
161
|
-
customer_update_params.CustomerUpdateParams,
|
|
162
|
-
),
|
|
163
154
|
options=make_request_options(
|
|
164
155
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
165
156
|
),
|
|
@@ -310,8 +301,6 @@ class AsyncCustomersResource(AsyncAPIResource):
|
|
|
310
301
|
self,
|
|
311
302
|
customer_id: str,
|
|
312
303
|
*,
|
|
313
|
-
name: Optional[str] | NotGiven = NOT_GIVEN,
|
|
314
|
-
phone_number: Optional[str] | NotGiven = NOT_GIVEN,
|
|
315
304
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
316
305
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
317
306
|
extra_headers: Headers | None = None,
|
|
@@ -333,13 +322,6 @@ class AsyncCustomersResource(AsyncAPIResource):
|
|
|
333
322
|
raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}")
|
|
334
323
|
return await self._patch(
|
|
335
324
|
f"/customers/{customer_id}",
|
|
336
|
-
body=await async_maybe_transform(
|
|
337
|
-
{
|
|
338
|
-
"name": name,
|
|
339
|
-
"phone_number": phone_number,
|
|
340
|
-
},
|
|
341
|
-
customer_update_params.CustomerUpdateParams,
|
|
342
|
-
),
|
|
343
325
|
options=make_request_options(
|
|
344
326
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
345
327
|
),
|