channel3-sdk 0.2.2__py3-none-any.whl → 2.0.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 channel3-sdk might be problematic. Click here for more details.
- channel3_sdk/__init__.py +94 -38
- channel3_sdk/_base_client.py +1995 -0
- channel3_sdk/_client.py +549 -0
- channel3_sdk/_compat.py +219 -0
- channel3_sdk/_constants.py +14 -0
- channel3_sdk/_exceptions.py +108 -0
- channel3_sdk/_files.py +123 -0
- channel3_sdk/_models.py +829 -0
- channel3_sdk/_qs.py +150 -0
- channel3_sdk/_resource.py +43 -0
- channel3_sdk/_response.py +832 -0
- channel3_sdk/_streaming.py +333 -0
- channel3_sdk/_types.py +253 -0
- channel3_sdk/_utils/__init__.py +64 -0
- channel3_sdk/_utils/_compat.py +45 -0
- channel3_sdk/_utils/_datetime_parse.py +136 -0
- channel3_sdk/_utils/_logs.py +25 -0
- channel3_sdk/_utils/_proxy.py +65 -0
- channel3_sdk/_utils/_reflection.py +42 -0
- channel3_sdk/_utils/_resources_proxy.py +24 -0
- channel3_sdk/_utils/_streams.py +12 -0
- channel3_sdk/_utils/_sync.py +86 -0
- channel3_sdk/_utils/_transform.py +457 -0
- channel3_sdk/_utils/_typing.py +156 -0
- channel3_sdk/_utils/_utils.py +421 -0
- channel3_sdk/_version.py +4 -0
- channel3_sdk/lib/.keep +4 -0
- channel3_sdk/py.typed +0 -0
- channel3_sdk/resources/__init__.py +61 -0
- channel3_sdk/resources/brands.py +268 -0
- channel3_sdk/resources/enrich.py +167 -0
- channel3_sdk/resources/products.py +163 -0
- channel3_sdk/resources/search.py +227 -0
- channel3_sdk/types/__init__.py +15 -0
- channel3_sdk/types/availability_status.py +9 -0
- channel3_sdk/types/brand.py +17 -0
- channel3_sdk/types/brand_list_params.py +16 -0
- channel3_sdk/types/brand_list_response.py +25 -0
- channel3_sdk/types/enrich_enrich_url_params.py +12 -0
- channel3_sdk/types/enrich_enrich_url_response.py +20 -0
- channel3_sdk/types/price.py +18 -0
- channel3_sdk/types/product_retrieve_response.py +39 -0
- channel3_sdk/types/search_perform_params.py +61 -0
- channel3_sdk/types/search_perform_response.py +36 -0
- channel3_sdk/types/variant.py +13 -0
- channel3_sdk-2.0.0.dist-info/METADATA +414 -0
- channel3_sdk-2.0.0.dist-info/RECORD +49 -0
- {channel3_sdk-0.2.2.dist-info → channel3_sdk-2.0.0.dist-info}/WHEEL +1 -1
- channel3_sdk-2.0.0.dist-info/licenses/LICENSE +201 -0
- channel3_sdk/client.py +0 -574
- channel3_sdk/exceptions.py +0 -48
- channel3_sdk/models.py +0 -135
- channel3_sdk-0.2.2.dist-info/METADATA +0 -284
- channel3_sdk-0.2.2.dist-info/RECORD +0 -7
|
@@ -0,0 +1,268 @@
|
|
|
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_list_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 ..types.brand import Brand
|
|
21
|
+
from .._base_client import make_request_options
|
|
22
|
+
from ..types.brand_list_response import BrandListResponse
|
|
23
|
+
|
|
24
|
+
__all__ = ["BrandsResource", "AsyncBrandsResource"]
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class BrandsResource(SyncAPIResource):
|
|
28
|
+
@cached_property
|
|
29
|
+
def with_raw_response(self) -> BrandsResourceWithRawResponse:
|
|
30
|
+
"""
|
|
31
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
32
|
+
the raw response object instead of the parsed content.
|
|
33
|
+
|
|
34
|
+
For more information, see https://www.github.com/channel3-ai/sdk-python#accessing-raw-response-data-eg-headers
|
|
35
|
+
"""
|
|
36
|
+
return BrandsResourceWithRawResponse(self)
|
|
37
|
+
|
|
38
|
+
@cached_property
|
|
39
|
+
def with_streaming_response(self) -> BrandsResourceWithStreamingResponse:
|
|
40
|
+
"""
|
|
41
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
42
|
+
|
|
43
|
+
For more information, see https://www.github.com/channel3-ai/sdk-python#with_streaming_response
|
|
44
|
+
"""
|
|
45
|
+
return BrandsResourceWithStreamingResponse(self)
|
|
46
|
+
|
|
47
|
+
def retrieve(
|
|
48
|
+
self,
|
|
49
|
+
brand_id: str,
|
|
50
|
+
*,
|
|
51
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
52
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
53
|
+
extra_headers: Headers | None = None,
|
|
54
|
+
extra_query: Query | None = None,
|
|
55
|
+
extra_body: Body | None = None,
|
|
56
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
57
|
+
) -> Brand:
|
|
58
|
+
"""
|
|
59
|
+
Get detailed information for a specific brand by its ID.
|
|
60
|
+
|
|
61
|
+
Args:
|
|
62
|
+
extra_headers: Send extra headers
|
|
63
|
+
|
|
64
|
+
extra_query: Add additional query parameters to the request
|
|
65
|
+
|
|
66
|
+
extra_body: Add additional JSON properties to the request
|
|
67
|
+
|
|
68
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
69
|
+
"""
|
|
70
|
+
if not brand_id:
|
|
71
|
+
raise ValueError(f"Expected a non-empty value for `brand_id` but received {brand_id!r}")
|
|
72
|
+
return self._get(
|
|
73
|
+
f"/v0/brands/{brand_id}",
|
|
74
|
+
options=make_request_options(
|
|
75
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
76
|
+
),
|
|
77
|
+
cast_to=Brand,
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
def list(
|
|
81
|
+
self,
|
|
82
|
+
*,
|
|
83
|
+
page: int | NotGiven = NOT_GIVEN,
|
|
84
|
+
query: Optional[str] | NotGiven = NOT_GIVEN,
|
|
85
|
+
size: int | NotGiven = NOT_GIVEN,
|
|
86
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
87
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
88
|
+
extra_headers: Headers | None = None,
|
|
89
|
+
extra_query: Query | None = None,
|
|
90
|
+
extra_body: Body | None = None,
|
|
91
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
92
|
+
) -> BrandListResponse:
|
|
93
|
+
"""
|
|
94
|
+
Get all brands that the vendor currently sells.
|
|
95
|
+
|
|
96
|
+
Args:
|
|
97
|
+
extra_headers: Send extra headers
|
|
98
|
+
|
|
99
|
+
extra_query: Add additional query parameters to the request
|
|
100
|
+
|
|
101
|
+
extra_body: Add additional JSON properties to the request
|
|
102
|
+
|
|
103
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
104
|
+
"""
|
|
105
|
+
return self._get(
|
|
106
|
+
"/v0/brands",
|
|
107
|
+
options=make_request_options(
|
|
108
|
+
extra_headers=extra_headers,
|
|
109
|
+
extra_query=extra_query,
|
|
110
|
+
extra_body=extra_body,
|
|
111
|
+
timeout=timeout,
|
|
112
|
+
query=maybe_transform(
|
|
113
|
+
{
|
|
114
|
+
"page": page,
|
|
115
|
+
"query": query,
|
|
116
|
+
"size": size,
|
|
117
|
+
},
|
|
118
|
+
brand_list_params.BrandListParams,
|
|
119
|
+
),
|
|
120
|
+
),
|
|
121
|
+
cast_to=BrandListResponse,
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
class AsyncBrandsResource(AsyncAPIResource):
|
|
126
|
+
@cached_property
|
|
127
|
+
def with_raw_response(self) -> AsyncBrandsResourceWithRawResponse:
|
|
128
|
+
"""
|
|
129
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
130
|
+
the raw response object instead of the parsed content.
|
|
131
|
+
|
|
132
|
+
For more information, see https://www.github.com/channel3-ai/sdk-python#accessing-raw-response-data-eg-headers
|
|
133
|
+
"""
|
|
134
|
+
return AsyncBrandsResourceWithRawResponse(self)
|
|
135
|
+
|
|
136
|
+
@cached_property
|
|
137
|
+
def with_streaming_response(self) -> AsyncBrandsResourceWithStreamingResponse:
|
|
138
|
+
"""
|
|
139
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
140
|
+
|
|
141
|
+
For more information, see https://www.github.com/channel3-ai/sdk-python#with_streaming_response
|
|
142
|
+
"""
|
|
143
|
+
return AsyncBrandsResourceWithStreamingResponse(self)
|
|
144
|
+
|
|
145
|
+
async def retrieve(
|
|
146
|
+
self,
|
|
147
|
+
brand_id: str,
|
|
148
|
+
*,
|
|
149
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
150
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
151
|
+
extra_headers: Headers | None = None,
|
|
152
|
+
extra_query: Query | None = None,
|
|
153
|
+
extra_body: Body | None = None,
|
|
154
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
155
|
+
) -> Brand:
|
|
156
|
+
"""
|
|
157
|
+
Get detailed information for a specific brand by its ID.
|
|
158
|
+
|
|
159
|
+
Args:
|
|
160
|
+
extra_headers: Send extra headers
|
|
161
|
+
|
|
162
|
+
extra_query: Add additional query parameters to the request
|
|
163
|
+
|
|
164
|
+
extra_body: Add additional JSON properties to the request
|
|
165
|
+
|
|
166
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
167
|
+
"""
|
|
168
|
+
if not brand_id:
|
|
169
|
+
raise ValueError(f"Expected a non-empty value for `brand_id` but received {brand_id!r}")
|
|
170
|
+
return await self._get(
|
|
171
|
+
f"/v0/brands/{brand_id}",
|
|
172
|
+
options=make_request_options(
|
|
173
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
174
|
+
),
|
|
175
|
+
cast_to=Brand,
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
async def list(
|
|
179
|
+
self,
|
|
180
|
+
*,
|
|
181
|
+
page: int | NotGiven = NOT_GIVEN,
|
|
182
|
+
query: Optional[str] | NotGiven = NOT_GIVEN,
|
|
183
|
+
size: int | NotGiven = NOT_GIVEN,
|
|
184
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
185
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
186
|
+
extra_headers: Headers | None = None,
|
|
187
|
+
extra_query: Query | None = None,
|
|
188
|
+
extra_body: Body | None = None,
|
|
189
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
190
|
+
) -> BrandListResponse:
|
|
191
|
+
"""
|
|
192
|
+
Get all brands that the vendor currently sells.
|
|
193
|
+
|
|
194
|
+
Args:
|
|
195
|
+
extra_headers: Send extra headers
|
|
196
|
+
|
|
197
|
+
extra_query: Add additional query parameters to the request
|
|
198
|
+
|
|
199
|
+
extra_body: Add additional JSON properties to the request
|
|
200
|
+
|
|
201
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
202
|
+
"""
|
|
203
|
+
return await self._get(
|
|
204
|
+
"/v0/brands",
|
|
205
|
+
options=make_request_options(
|
|
206
|
+
extra_headers=extra_headers,
|
|
207
|
+
extra_query=extra_query,
|
|
208
|
+
extra_body=extra_body,
|
|
209
|
+
timeout=timeout,
|
|
210
|
+
query=await async_maybe_transform(
|
|
211
|
+
{
|
|
212
|
+
"page": page,
|
|
213
|
+
"query": query,
|
|
214
|
+
"size": size,
|
|
215
|
+
},
|
|
216
|
+
brand_list_params.BrandListParams,
|
|
217
|
+
),
|
|
218
|
+
),
|
|
219
|
+
cast_to=BrandListResponse,
|
|
220
|
+
)
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
class BrandsResourceWithRawResponse:
|
|
224
|
+
def __init__(self, brands: BrandsResource) -> None:
|
|
225
|
+
self._brands = brands
|
|
226
|
+
|
|
227
|
+
self.retrieve = to_raw_response_wrapper(
|
|
228
|
+
brands.retrieve,
|
|
229
|
+
)
|
|
230
|
+
self.list = to_raw_response_wrapper(
|
|
231
|
+
brands.list,
|
|
232
|
+
)
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
class AsyncBrandsResourceWithRawResponse:
|
|
236
|
+
def __init__(self, brands: AsyncBrandsResource) -> None:
|
|
237
|
+
self._brands = brands
|
|
238
|
+
|
|
239
|
+
self.retrieve = async_to_raw_response_wrapper(
|
|
240
|
+
brands.retrieve,
|
|
241
|
+
)
|
|
242
|
+
self.list = async_to_raw_response_wrapper(
|
|
243
|
+
brands.list,
|
|
244
|
+
)
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
class BrandsResourceWithStreamingResponse:
|
|
248
|
+
def __init__(self, brands: BrandsResource) -> None:
|
|
249
|
+
self._brands = brands
|
|
250
|
+
|
|
251
|
+
self.retrieve = to_streamed_response_wrapper(
|
|
252
|
+
brands.retrieve,
|
|
253
|
+
)
|
|
254
|
+
self.list = to_streamed_response_wrapper(
|
|
255
|
+
brands.list,
|
|
256
|
+
)
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
class AsyncBrandsResourceWithStreamingResponse:
|
|
260
|
+
def __init__(self, brands: AsyncBrandsResource) -> None:
|
|
261
|
+
self._brands = brands
|
|
262
|
+
|
|
263
|
+
self.retrieve = async_to_streamed_response_wrapper(
|
|
264
|
+
brands.retrieve,
|
|
265
|
+
)
|
|
266
|
+
self.list = async_to_streamed_response_wrapper(
|
|
267
|
+
brands.list,
|
|
268
|
+
)
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ..types import enrich_enrich_url_params
|
|
8
|
+
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
9
|
+
from .._utils import maybe_transform, async_maybe_transform
|
|
10
|
+
from .._compat import cached_property
|
|
11
|
+
from .._resource import SyncAPIResource, AsyncAPIResource
|
|
12
|
+
from .._response import (
|
|
13
|
+
to_raw_response_wrapper,
|
|
14
|
+
to_streamed_response_wrapper,
|
|
15
|
+
async_to_raw_response_wrapper,
|
|
16
|
+
async_to_streamed_response_wrapper,
|
|
17
|
+
)
|
|
18
|
+
from .._base_client import make_request_options
|
|
19
|
+
from ..types.enrich_enrich_url_response import EnrichEnrichURLResponse
|
|
20
|
+
|
|
21
|
+
__all__ = ["EnrichResource", "AsyncEnrichResource"]
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class EnrichResource(SyncAPIResource):
|
|
25
|
+
@cached_property
|
|
26
|
+
def with_raw_response(self) -> EnrichResourceWithRawResponse:
|
|
27
|
+
"""
|
|
28
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
29
|
+
the raw response object instead of the parsed content.
|
|
30
|
+
|
|
31
|
+
For more information, see https://www.github.com/channel3-ai/sdk-python#accessing-raw-response-data-eg-headers
|
|
32
|
+
"""
|
|
33
|
+
return EnrichResourceWithRawResponse(self)
|
|
34
|
+
|
|
35
|
+
@cached_property
|
|
36
|
+
def with_streaming_response(self) -> EnrichResourceWithStreamingResponse:
|
|
37
|
+
"""
|
|
38
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
39
|
+
|
|
40
|
+
For more information, see https://www.github.com/channel3-ai/sdk-python#with_streaming_response
|
|
41
|
+
"""
|
|
42
|
+
return EnrichResourceWithStreamingResponse(self)
|
|
43
|
+
|
|
44
|
+
def enrich_url(
|
|
45
|
+
self,
|
|
46
|
+
*,
|
|
47
|
+
url: str,
|
|
48
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
49
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
50
|
+
extra_headers: Headers | None = None,
|
|
51
|
+
extra_query: Query | None = None,
|
|
52
|
+
extra_body: Body | None = None,
|
|
53
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
54
|
+
) -> EnrichEnrichURLResponse:
|
|
55
|
+
"""
|
|
56
|
+
Enrich a product URL with additional information.
|
|
57
|
+
|
|
58
|
+
Args:
|
|
59
|
+
url: The URL of the product to enrich
|
|
60
|
+
|
|
61
|
+
extra_headers: Send extra headers
|
|
62
|
+
|
|
63
|
+
extra_query: Add additional query parameters to the request
|
|
64
|
+
|
|
65
|
+
extra_body: Add additional JSON properties to the request
|
|
66
|
+
|
|
67
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
68
|
+
"""
|
|
69
|
+
return self._post(
|
|
70
|
+
"/v0/enrich",
|
|
71
|
+
body=maybe_transform({"url": url}, enrich_enrich_url_params.EnrichEnrichURLParams),
|
|
72
|
+
options=make_request_options(
|
|
73
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
74
|
+
),
|
|
75
|
+
cast_to=EnrichEnrichURLResponse,
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
class AsyncEnrichResource(AsyncAPIResource):
|
|
80
|
+
@cached_property
|
|
81
|
+
def with_raw_response(self) -> AsyncEnrichResourceWithRawResponse:
|
|
82
|
+
"""
|
|
83
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
84
|
+
the raw response object instead of the parsed content.
|
|
85
|
+
|
|
86
|
+
For more information, see https://www.github.com/channel3-ai/sdk-python#accessing-raw-response-data-eg-headers
|
|
87
|
+
"""
|
|
88
|
+
return AsyncEnrichResourceWithRawResponse(self)
|
|
89
|
+
|
|
90
|
+
@cached_property
|
|
91
|
+
def with_streaming_response(self) -> AsyncEnrichResourceWithStreamingResponse:
|
|
92
|
+
"""
|
|
93
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
94
|
+
|
|
95
|
+
For more information, see https://www.github.com/channel3-ai/sdk-python#with_streaming_response
|
|
96
|
+
"""
|
|
97
|
+
return AsyncEnrichResourceWithStreamingResponse(self)
|
|
98
|
+
|
|
99
|
+
async def enrich_url(
|
|
100
|
+
self,
|
|
101
|
+
*,
|
|
102
|
+
url: str,
|
|
103
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
104
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
105
|
+
extra_headers: Headers | None = None,
|
|
106
|
+
extra_query: Query | None = None,
|
|
107
|
+
extra_body: Body | None = None,
|
|
108
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
109
|
+
) -> EnrichEnrichURLResponse:
|
|
110
|
+
"""
|
|
111
|
+
Enrich a product URL with additional information.
|
|
112
|
+
|
|
113
|
+
Args:
|
|
114
|
+
url: The URL of the product to enrich
|
|
115
|
+
|
|
116
|
+
extra_headers: Send extra headers
|
|
117
|
+
|
|
118
|
+
extra_query: Add additional query parameters to the request
|
|
119
|
+
|
|
120
|
+
extra_body: Add additional JSON properties to the request
|
|
121
|
+
|
|
122
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
123
|
+
"""
|
|
124
|
+
return await self._post(
|
|
125
|
+
"/v0/enrich",
|
|
126
|
+
body=await async_maybe_transform({"url": url}, enrich_enrich_url_params.EnrichEnrichURLParams),
|
|
127
|
+
options=make_request_options(
|
|
128
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
129
|
+
),
|
|
130
|
+
cast_to=EnrichEnrichURLResponse,
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
class EnrichResourceWithRawResponse:
|
|
135
|
+
def __init__(self, enrich: EnrichResource) -> None:
|
|
136
|
+
self._enrich = enrich
|
|
137
|
+
|
|
138
|
+
self.enrich_url = to_raw_response_wrapper(
|
|
139
|
+
enrich.enrich_url,
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
class AsyncEnrichResourceWithRawResponse:
|
|
144
|
+
def __init__(self, enrich: AsyncEnrichResource) -> None:
|
|
145
|
+
self._enrich = enrich
|
|
146
|
+
|
|
147
|
+
self.enrich_url = async_to_raw_response_wrapper(
|
|
148
|
+
enrich.enrich_url,
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
class EnrichResourceWithStreamingResponse:
|
|
153
|
+
def __init__(self, enrich: EnrichResource) -> None:
|
|
154
|
+
self._enrich = enrich
|
|
155
|
+
|
|
156
|
+
self.enrich_url = to_streamed_response_wrapper(
|
|
157
|
+
enrich.enrich_url,
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
class AsyncEnrichResourceWithStreamingResponse:
|
|
162
|
+
def __init__(self, enrich: AsyncEnrichResource) -> None:
|
|
163
|
+
self._enrich = enrich
|
|
164
|
+
|
|
165
|
+
self.enrich_url = async_to_streamed_response_wrapper(
|
|
166
|
+
enrich.enrich_url,
|
|
167
|
+
)
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
8
|
+
from .._compat import cached_property
|
|
9
|
+
from .._resource import SyncAPIResource, AsyncAPIResource
|
|
10
|
+
from .._response import (
|
|
11
|
+
to_raw_response_wrapper,
|
|
12
|
+
to_streamed_response_wrapper,
|
|
13
|
+
async_to_raw_response_wrapper,
|
|
14
|
+
async_to_streamed_response_wrapper,
|
|
15
|
+
)
|
|
16
|
+
from .._base_client import make_request_options
|
|
17
|
+
from ..types.product_retrieve_response import ProductRetrieveResponse
|
|
18
|
+
|
|
19
|
+
__all__ = ["ProductsResource", "AsyncProductsResource"]
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class ProductsResource(SyncAPIResource):
|
|
23
|
+
@cached_property
|
|
24
|
+
def with_raw_response(self) -> ProductsResourceWithRawResponse:
|
|
25
|
+
"""
|
|
26
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
27
|
+
the raw response object instead of the parsed content.
|
|
28
|
+
|
|
29
|
+
For more information, see https://www.github.com/channel3-ai/sdk-python#accessing-raw-response-data-eg-headers
|
|
30
|
+
"""
|
|
31
|
+
return ProductsResourceWithRawResponse(self)
|
|
32
|
+
|
|
33
|
+
@cached_property
|
|
34
|
+
def with_streaming_response(self) -> ProductsResourceWithStreamingResponse:
|
|
35
|
+
"""
|
|
36
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
37
|
+
|
|
38
|
+
For more information, see https://www.github.com/channel3-ai/sdk-python#with_streaming_response
|
|
39
|
+
"""
|
|
40
|
+
return ProductsResourceWithStreamingResponse(self)
|
|
41
|
+
|
|
42
|
+
def retrieve(
|
|
43
|
+
self,
|
|
44
|
+
product_id: str,
|
|
45
|
+
*,
|
|
46
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
47
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
48
|
+
extra_headers: Headers | None = None,
|
|
49
|
+
extra_query: Query | None = None,
|
|
50
|
+
extra_body: Body | None = None,
|
|
51
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
52
|
+
) -> ProductRetrieveResponse:
|
|
53
|
+
"""
|
|
54
|
+
Get detailed information about a specific product by its ID.
|
|
55
|
+
|
|
56
|
+
Args:
|
|
57
|
+
extra_headers: Send extra headers
|
|
58
|
+
|
|
59
|
+
extra_query: Add additional query parameters to the request
|
|
60
|
+
|
|
61
|
+
extra_body: Add additional JSON properties to the request
|
|
62
|
+
|
|
63
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
64
|
+
"""
|
|
65
|
+
if not product_id:
|
|
66
|
+
raise ValueError(f"Expected a non-empty value for `product_id` but received {product_id!r}")
|
|
67
|
+
return self._get(
|
|
68
|
+
f"/v0/products/{product_id}",
|
|
69
|
+
options=make_request_options(
|
|
70
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
71
|
+
),
|
|
72
|
+
cast_to=ProductRetrieveResponse,
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
class AsyncProductsResource(AsyncAPIResource):
|
|
77
|
+
@cached_property
|
|
78
|
+
def with_raw_response(self) -> AsyncProductsResourceWithRawResponse:
|
|
79
|
+
"""
|
|
80
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
81
|
+
the raw response object instead of the parsed content.
|
|
82
|
+
|
|
83
|
+
For more information, see https://www.github.com/channel3-ai/sdk-python#accessing-raw-response-data-eg-headers
|
|
84
|
+
"""
|
|
85
|
+
return AsyncProductsResourceWithRawResponse(self)
|
|
86
|
+
|
|
87
|
+
@cached_property
|
|
88
|
+
def with_streaming_response(self) -> AsyncProductsResourceWithStreamingResponse:
|
|
89
|
+
"""
|
|
90
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
91
|
+
|
|
92
|
+
For more information, see https://www.github.com/channel3-ai/sdk-python#with_streaming_response
|
|
93
|
+
"""
|
|
94
|
+
return AsyncProductsResourceWithStreamingResponse(self)
|
|
95
|
+
|
|
96
|
+
async def retrieve(
|
|
97
|
+
self,
|
|
98
|
+
product_id: str,
|
|
99
|
+
*,
|
|
100
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
101
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
102
|
+
extra_headers: Headers | None = None,
|
|
103
|
+
extra_query: Query | None = None,
|
|
104
|
+
extra_body: Body | None = None,
|
|
105
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
106
|
+
) -> ProductRetrieveResponse:
|
|
107
|
+
"""
|
|
108
|
+
Get detailed information about a specific product by its ID.
|
|
109
|
+
|
|
110
|
+
Args:
|
|
111
|
+
extra_headers: Send extra headers
|
|
112
|
+
|
|
113
|
+
extra_query: Add additional query parameters to the request
|
|
114
|
+
|
|
115
|
+
extra_body: Add additional JSON properties to the request
|
|
116
|
+
|
|
117
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
118
|
+
"""
|
|
119
|
+
if not product_id:
|
|
120
|
+
raise ValueError(f"Expected a non-empty value for `product_id` but received {product_id!r}")
|
|
121
|
+
return await self._get(
|
|
122
|
+
f"/v0/products/{product_id}",
|
|
123
|
+
options=make_request_options(
|
|
124
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
125
|
+
),
|
|
126
|
+
cast_to=ProductRetrieveResponse,
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
class ProductsResourceWithRawResponse:
|
|
131
|
+
def __init__(self, products: ProductsResource) -> None:
|
|
132
|
+
self._products = products
|
|
133
|
+
|
|
134
|
+
self.retrieve = to_raw_response_wrapper(
|
|
135
|
+
products.retrieve,
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
class AsyncProductsResourceWithRawResponse:
|
|
140
|
+
def __init__(self, products: AsyncProductsResource) -> None:
|
|
141
|
+
self._products = products
|
|
142
|
+
|
|
143
|
+
self.retrieve = async_to_raw_response_wrapper(
|
|
144
|
+
products.retrieve,
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
class ProductsResourceWithStreamingResponse:
|
|
149
|
+
def __init__(self, products: ProductsResource) -> None:
|
|
150
|
+
self._products = products
|
|
151
|
+
|
|
152
|
+
self.retrieve = to_streamed_response_wrapper(
|
|
153
|
+
products.retrieve,
|
|
154
|
+
)
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
class AsyncProductsResourceWithStreamingResponse:
|
|
158
|
+
def __init__(self, products: AsyncProductsResource) -> None:
|
|
159
|
+
self._products = products
|
|
160
|
+
|
|
161
|
+
self.retrieve = async_to_streamed_response_wrapper(
|
|
162
|
+
products.retrieve,
|
|
163
|
+
)
|