dodopayments 1.22.0__py3-none-any.whl → 1.27.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.

Files changed (35) hide show
  1. dodopayments/__init__.py +5 -0
  2. dodopayments/_client.py +9 -0
  3. dodopayments/_utils/_resources_proxy.py +24 -0
  4. dodopayments/_version.py +1 -1
  5. dodopayments/resources/__init__.py +14 -0
  6. dodopayments/resources/brands.py +495 -0
  7. dodopayments/resources/payments.py +83 -0
  8. dodopayments/resources/products/products.py +20 -0
  9. dodopayments/resources/refunds.py +9 -1
  10. dodopayments/resources/subscriptions.py +22 -2
  11. dodopayments/types/__init__.py +8 -0
  12. dodopayments/types/brand_create_params.py +20 -0
  13. dodopayments/types/brand_create_response.py +35 -0
  14. dodopayments/types/brand_list_response.py +40 -0
  15. dodopayments/types/brand_retrieve_response.py +35 -0
  16. dodopayments/types/brand_update_images_response.py +13 -0
  17. dodopayments/types/brand_update_params.py +19 -0
  18. dodopayments/types/brand_update_response.py +35 -0
  19. dodopayments/types/payment.py +3 -0
  20. dodopayments/types/payment_list_params.py +3 -0
  21. dodopayments/types/payment_list_response.py +2 -0
  22. dodopayments/types/payment_retrieve_line_items_response.py +26 -0
  23. dodopayments/types/product.py +2 -0
  24. dodopayments/types/product_create_params.py +3 -0
  25. dodopayments/types/product_list_params.py +3 -0
  26. dodopayments/types/product_update_params.py +2 -0
  27. dodopayments/types/refund.py +3 -0
  28. dodopayments/types/refund_create_params.py +16 -2
  29. dodopayments/types/subscription_charge_params.py +3 -0
  30. dodopayments/types/subscription_create_response.py +3 -0
  31. dodopayments/types/subscription_list_params.py +3 -0
  32. {dodopayments-1.22.0.dist-info → dodopayments-1.27.0.dist-info}/METADATA +2 -2
  33. {dodopayments-1.22.0.dist-info → dodopayments-1.27.0.dist-info}/RECORD +35 -25
  34. {dodopayments-1.22.0.dist-info → dodopayments-1.27.0.dist-info}/WHEEL +0 -0
  35. {dodopayments-1.22.0.dist-info → dodopayments-1.27.0.dist-info}/licenses/LICENSE +0 -0
dodopayments/__init__.py CHANGED
@@ -1,5 +1,7 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
+ import typing as _t
4
+
3
5
  from . import types
4
6
  from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes
5
7
  from ._utils import file_from_path
@@ -80,6 +82,9 @@ __all__ = [
80
82
  "DefaultAsyncHttpxClient",
81
83
  ]
82
84
 
85
+ if not _t.TYPE_CHECKING:
86
+ from ._utils._resources_proxy import resources as resources
87
+
83
88
  _setup_logging()
84
89
 
85
90
  # Update the __module__ attribute for exported symbols so that
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
@@ -0,0 +1,24 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import Any
4
+ from typing_extensions import override
5
+
6
+ from ._proxy import LazyProxy
7
+
8
+
9
+ class ResourcesProxy(LazyProxy[Any]):
10
+ """A proxy for the `dodopayments.resources` module.
11
+
12
+ This is used so that we can lazily import `dodopayments.resources` only when
13
+ needed *and* so that users can just import `dodopayments` and reference `dodopayments.resources`
14
+ """
15
+
16
+ @override
17
+ def __load__(self) -> Any:
18
+ import importlib
19
+
20
+ mod = importlib.import_module("dodopayments.resources")
21
+ return mod
22
+
23
+
24
+ resources = ResourcesProxy().__as_proxied__()
dodopayments/_version.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "dodopayments"
4
- __version__ = "1.22.0" # x-release-please-version
4
+ __version__ = "1.27.0" # x-release-please-version
@@ -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
+ )