channel3-sdk 1.0.0__py3-none-any.whl → 2.1.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 -44
- 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 +64 -0
- channel3_sdk/types/search_perform_response.py +36 -0
- channel3_sdk/types/variant.py +13 -0
- channel3_sdk-2.1.0.dist-info/METADATA +414 -0
- channel3_sdk-2.1.0.dist-info/RECORD +49 -0
- {channel3_sdk-1.0.0.dist-info → channel3_sdk-2.1.0.dist-info}/WHEEL +1 -1
- channel3_sdk-2.1.0.dist-info/licenses/LICENSE +201 -0
- channel3_sdk/_gen/.gitignore +0 -23
- channel3_sdk/_gen/README.md +0 -124
- channel3_sdk/_gen/fast_api_client/__init__.py +0 -8
- channel3_sdk/_gen/fast_api_client/api/__init__.py +0 -1
- channel3_sdk/_gen/fast_api_client/api/channel3_api/__init__.py +0 -1
- channel3_sdk/_gen/fast_api_client/api/channel3_api/get_brand_detail_v0_brands_brand_id_get.py +0 -179
- channel3_sdk/_gen/fast_api_client/api/channel3_api/get_brands_v0_brands_get.py +0 -218
- channel3_sdk/_gen/fast_api_client/api/channel3_api/get_product_detail_v0_products_product_id_get.py +0 -179
- channel3_sdk/_gen/fast_api_client/api/channel3_api/search_v0_search_post.py +0 -193
- channel3_sdk/_gen/fast_api_client/api/default/__init__.py +0 -1
- channel3_sdk/_gen/fast_api_client/api/default/root_get.py +0 -79
- channel3_sdk/_gen/fast_api_client/client.py +0 -268
- channel3_sdk/_gen/fast_api_client/errors.py +0 -16
- channel3_sdk/_gen/fast_api_client/models/__init__.py +0 -35
- channel3_sdk/_gen/fast_api_client/models/availability_status.py +0 -15
- channel3_sdk/_gen/fast_api_client/models/brand.py +0 -109
- channel3_sdk/_gen/fast_api_client/models/error_response.py +0 -59
- channel3_sdk/_gen/fast_api_client/models/paginated_response_brand.py +0 -83
- channel3_sdk/_gen/fast_api_client/models/pagination_meta.py +0 -84
- channel3_sdk/_gen/fast_api_client/models/price.py +0 -89
- channel3_sdk/_gen/fast_api_client/models/product.py +0 -166
- channel3_sdk/_gen/fast_api_client/models/product_detail.py +0 -306
- channel3_sdk/_gen/fast_api_client/models/product_detail_gender_type_0.py +0 -10
- channel3_sdk/_gen/fast_api_client/models/search_config.py +0 -69
- channel3_sdk/_gen/fast_api_client/models/search_filter_price.py +0 -92
- channel3_sdk/_gen/fast_api_client/models/search_filters.py +0 -191
- channel3_sdk/_gen/fast_api_client/models/search_filters_gender_type_0.py +0 -10
- channel3_sdk/_gen/fast_api_client/models/search_request.py +0 -191
- channel3_sdk/_gen/fast_api_client/models/variant.py +0 -75
- channel3_sdk/_gen/fast_api_client/py.typed +0 -1
- channel3_sdk/_gen/fast_api_client/types.py +0 -54
- channel3_sdk/_gen/pyproject.toml +0 -26
- channel3_sdk/client.py +0 -361
- channel3_sdk/exceptions.py +0 -48
- channel3_sdk-1.0.0.dist-info/METADATA +0 -341
- channel3_sdk-1.0.0.dist-info/RECORD +0 -38
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
from collections.abc import Mapping
|
|
2
|
-
from typing import Any, TypeVar, Union, cast
|
|
3
|
-
|
|
4
|
-
from attrs import define as _attrs_define
|
|
5
|
-
from attrs import field as _attrs_field
|
|
6
|
-
|
|
7
|
-
from ..types import UNSET, Unset
|
|
8
|
-
|
|
9
|
-
T = TypeVar("T", bound="Price")
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
@_attrs_define
|
|
13
|
-
class Price:
|
|
14
|
-
"""
|
|
15
|
-
Attributes:
|
|
16
|
-
price (float): The current price of the product, including any discounts.
|
|
17
|
-
currency (str): The currency code of the product.
|
|
18
|
-
compare_at_price (Union[None, Unset, float]): The original price of the product before any discounts.
|
|
19
|
-
"""
|
|
20
|
-
|
|
21
|
-
price: float
|
|
22
|
-
currency: str
|
|
23
|
-
compare_at_price: Union[None, Unset, float] = UNSET
|
|
24
|
-
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
25
|
-
|
|
26
|
-
def to_dict(self) -> dict[str, Any]:
|
|
27
|
-
price = self.price
|
|
28
|
-
|
|
29
|
-
currency = self.currency
|
|
30
|
-
|
|
31
|
-
compare_at_price: Union[None, Unset, float]
|
|
32
|
-
if isinstance(self.compare_at_price, Unset):
|
|
33
|
-
compare_at_price = UNSET
|
|
34
|
-
else:
|
|
35
|
-
compare_at_price = self.compare_at_price
|
|
36
|
-
|
|
37
|
-
field_dict: dict[str, Any] = {}
|
|
38
|
-
field_dict.update(self.additional_properties)
|
|
39
|
-
field_dict.update(
|
|
40
|
-
{
|
|
41
|
-
"price": price,
|
|
42
|
-
"currency": currency,
|
|
43
|
-
}
|
|
44
|
-
)
|
|
45
|
-
if compare_at_price is not UNSET:
|
|
46
|
-
field_dict["compare_at_price"] = compare_at_price
|
|
47
|
-
|
|
48
|
-
return field_dict
|
|
49
|
-
|
|
50
|
-
@classmethod
|
|
51
|
-
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
52
|
-
d = dict(src_dict)
|
|
53
|
-
price = d.pop("price")
|
|
54
|
-
|
|
55
|
-
currency = d.pop("currency")
|
|
56
|
-
|
|
57
|
-
def _parse_compare_at_price(data: object) -> Union[None, Unset, float]:
|
|
58
|
-
if data is None:
|
|
59
|
-
return data
|
|
60
|
-
if isinstance(data, Unset):
|
|
61
|
-
return data
|
|
62
|
-
return cast(Union[None, Unset, float], data)
|
|
63
|
-
|
|
64
|
-
compare_at_price = _parse_compare_at_price(d.pop("compare_at_price", UNSET))
|
|
65
|
-
|
|
66
|
-
price = cls(
|
|
67
|
-
price=price,
|
|
68
|
-
currency=currency,
|
|
69
|
-
compare_at_price=compare_at_price,
|
|
70
|
-
)
|
|
71
|
-
|
|
72
|
-
price.additional_properties = d
|
|
73
|
-
return price
|
|
74
|
-
|
|
75
|
-
@property
|
|
76
|
-
def additional_keys(self) -> list[str]:
|
|
77
|
-
return list(self.additional_properties.keys())
|
|
78
|
-
|
|
79
|
-
def __getitem__(self, key: str) -> Any:
|
|
80
|
-
return self.additional_properties[key]
|
|
81
|
-
|
|
82
|
-
def __setitem__(self, key: str, value: Any) -> None:
|
|
83
|
-
self.additional_properties[key] = value
|
|
84
|
-
|
|
85
|
-
def __delitem__(self, key: str) -> None:
|
|
86
|
-
del self.additional_properties[key]
|
|
87
|
-
|
|
88
|
-
def __contains__(self, key: str) -> bool:
|
|
89
|
-
return key in self.additional_properties
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
from collections.abc import Mapping
|
|
2
|
-
from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
|
|
3
|
-
|
|
4
|
-
from attrs import define as _attrs_define
|
|
5
|
-
from attrs import field as _attrs_field
|
|
6
|
-
|
|
7
|
-
from ..models.availability_status import AvailabilityStatus
|
|
8
|
-
from ..types import UNSET, Unset
|
|
9
|
-
|
|
10
|
-
if TYPE_CHECKING:
|
|
11
|
-
from ..models.price import Price
|
|
12
|
-
from ..models.variant import Variant
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
T = TypeVar("T", bound="Product")
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
@_attrs_define
|
|
19
|
-
class Product:
|
|
20
|
-
"""A product
|
|
21
|
-
|
|
22
|
-
Attributes:
|
|
23
|
-
id (str):
|
|
24
|
-
score (float):
|
|
25
|
-
url (str):
|
|
26
|
-
title (str):
|
|
27
|
-
brand_name (str):
|
|
28
|
-
image_url (str):
|
|
29
|
-
price (Price):
|
|
30
|
-
availability (AvailabilityStatus):
|
|
31
|
-
description (Union[None, Unset, str]):
|
|
32
|
-
variants (Union[Unset, list['Variant']]):
|
|
33
|
-
"""
|
|
34
|
-
|
|
35
|
-
id: str
|
|
36
|
-
score: float
|
|
37
|
-
url: str
|
|
38
|
-
title: str
|
|
39
|
-
brand_name: str
|
|
40
|
-
image_url: str
|
|
41
|
-
price: "Price"
|
|
42
|
-
availability: AvailabilityStatus
|
|
43
|
-
description: Union[None, Unset, str] = UNSET
|
|
44
|
-
variants: Union[Unset, list["Variant"]] = UNSET
|
|
45
|
-
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
46
|
-
|
|
47
|
-
def to_dict(self) -> dict[str, Any]:
|
|
48
|
-
id = self.id
|
|
49
|
-
|
|
50
|
-
score = self.score
|
|
51
|
-
|
|
52
|
-
url = self.url
|
|
53
|
-
|
|
54
|
-
title = self.title
|
|
55
|
-
|
|
56
|
-
brand_name = self.brand_name
|
|
57
|
-
|
|
58
|
-
image_url = self.image_url
|
|
59
|
-
|
|
60
|
-
price = self.price.to_dict()
|
|
61
|
-
|
|
62
|
-
availability = self.availability.value
|
|
63
|
-
|
|
64
|
-
description: Union[None, Unset, str]
|
|
65
|
-
if isinstance(self.description, Unset):
|
|
66
|
-
description = UNSET
|
|
67
|
-
else:
|
|
68
|
-
description = self.description
|
|
69
|
-
|
|
70
|
-
variants: Union[Unset, list[dict[str, Any]]] = UNSET
|
|
71
|
-
if not isinstance(self.variants, Unset):
|
|
72
|
-
variants = []
|
|
73
|
-
for variants_item_data in self.variants:
|
|
74
|
-
variants_item = variants_item_data.to_dict()
|
|
75
|
-
variants.append(variants_item)
|
|
76
|
-
|
|
77
|
-
field_dict: dict[str, Any] = {}
|
|
78
|
-
field_dict.update(self.additional_properties)
|
|
79
|
-
field_dict.update(
|
|
80
|
-
{
|
|
81
|
-
"id": id,
|
|
82
|
-
"score": score,
|
|
83
|
-
"url": url,
|
|
84
|
-
"title": title,
|
|
85
|
-
"brand_name": brand_name,
|
|
86
|
-
"image_url": image_url,
|
|
87
|
-
"price": price,
|
|
88
|
-
"availability": availability,
|
|
89
|
-
}
|
|
90
|
-
)
|
|
91
|
-
if description is not UNSET:
|
|
92
|
-
field_dict["description"] = description
|
|
93
|
-
if variants is not UNSET:
|
|
94
|
-
field_dict["variants"] = variants
|
|
95
|
-
|
|
96
|
-
return field_dict
|
|
97
|
-
|
|
98
|
-
@classmethod
|
|
99
|
-
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
100
|
-
from ..models.price import Price
|
|
101
|
-
from ..models.variant import Variant
|
|
102
|
-
|
|
103
|
-
d = dict(src_dict)
|
|
104
|
-
id = d.pop("id")
|
|
105
|
-
|
|
106
|
-
score = d.pop("score")
|
|
107
|
-
|
|
108
|
-
url = d.pop("url")
|
|
109
|
-
|
|
110
|
-
title = d.pop("title")
|
|
111
|
-
|
|
112
|
-
brand_name = d.pop("brand_name")
|
|
113
|
-
|
|
114
|
-
image_url = d.pop("image_url")
|
|
115
|
-
|
|
116
|
-
price = Price.from_dict(d.pop("price"))
|
|
117
|
-
|
|
118
|
-
availability = AvailabilityStatus(d.pop("availability"))
|
|
119
|
-
|
|
120
|
-
def _parse_description(data: object) -> Union[None, Unset, str]:
|
|
121
|
-
if data is None:
|
|
122
|
-
return data
|
|
123
|
-
if isinstance(data, Unset):
|
|
124
|
-
return data
|
|
125
|
-
return cast(Union[None, Unset, str], data)
|
|
126
|
-
|
|
127
|
-
description = _parse_description(d.pop("description", UNSET))
|
|
128
|
-
|
|
129
|
-
variants = []
|
|
130
|
-
_variants = d.pop("variants", UNSET)
|
|
131
|
-
for variants_item_data in _variants or []:
|
|
132
|
-
variants_item = Variant.from_dict(variants_item_data)
|
|
133
|
-
|
|
134
|
-
variants.append(variants_item)
|
|
135
|
-
|
|
136
|
-
product = cls(
|
|
137
|
-
id=id,
|
|
138
|
-
score=score,
|
|
139
|
-
url=url,
|
|
140
|
-
title=title,
|
|
141
|
-
brand_name=brand_name,
|
|
142
|
-
image_url=image_url,
|
|
143
|
-
price=price,
|
|
144
|
-
availability=availability,
|
|
145
|
-
description=description,
|
|
146
|
-
variants=variants,
|
|
147
|
-
)
|
|
148
|
-
|
|
149
|
-
product.additional_properties = d
|
|
150
|
-
return product
|
|
151
|
-
|
|
152
|
-
@property
|
|
153
|
-
def additional_keys(self) -> list[str]:
|
|
154
|
-
return list(self.additional_properties.keys())
|
|
155
|
-
|
|
156
|
-
def __getitem__(self, key: str) -> Any:
|
|
157
|
-
return self.additional_properties[key]
|
|
158
|
-
|
|
159
|
-
def __setitem__(self, key: str, value: Any) -> None:
|
|
160
|
-
self.additional_properties[key] = value
|
|
161
|
-
|
|
162
|
-
def __delitem__(self, key: str) -> None:
|
|
163
|
-
del self.additional_properties[key]
|
|
164
|
-
|
|
165
|
-
def __contains__(self, key: str) -> bool:
|
|
166
|
-
return key in self.additional_properties
|
|
@@ -1,306 +0,0 @@
|
|
|
1
|
-
from collections.abc import Mapping
|
|
2
|
-
from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
|
|
3
|
-
|
|
4
|
-
from attrs import define as _attrs_define
|
|
5
|
-
from attrs import field as _attrs_field
|
|
6
|
-
|
|
7
|
-
from ..models.availability_status import AvailabilityStatus
|
|
8
|
-
from ..models.product_detail_gender_type_0 import ProductDetailGenderType0
|
|
9
|
-
from ..types import UNSET, Unset
|
|
10
|
-
|
|
11
|
-
if TYPE_CHECKING:
|
|
12
|
-
from ..models.price import Price
|
|
13
|
-
from ..models.variant import Variant
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
T = TypeVar("T", bound="ProductDetail")
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
@_attrs_define
|
|
20
|
-
class ProductDetail:
|
|
21
|
-
"""A product with detailed information
|
|
22
|
-
|
|
23
|
-
Attributes:
|
|
24
|
-
id (str):
|
|
25
|
-
url (str):
|
|
26
|
-
title (str):
|
|
27
|
-
price (Price):
|
|
28
|
-
availability (AvailabilityStatus):
|
|
29
|
-
description (Union[None, Unset, str]):
|
|
30
|
-
brand_id (Union[None, Unset, str]):
|
|
31
|
-
brand_name (Union[None, Unset, str]):
|
|
32
|
-
image_urls (Union[None, Unset, list[str]]):
|
|
33
|
-
gender (Union[None, ProductDetailGenderType0, Unset]):
|
|
34
|
-
materials (Union[None, Unset, list[str]]):
|
|
35
|
-
key_features (Union[None, Unset, list[str]]):
|
|
36
|
-
variants (Union[Unset, list['Variant']]):
|
|
37
|
-
"""
|
|
38
|
-
|
|
39
|
-
id: str
|
|
40
|
-
url: str
|
|
41
|
-
title: str
|
|
42
|
-
price: "Price"
|
|
43
|
-
availability: AvailabilityStatus
|
|
44
|
-
description: Union[None, Unset, str] = UNSET
|
|
45
|
-
brand_id: Union[None, Unset, str] = UNSET
|
|
46
|
-
brand_name: Union[None, Unset, str] = UNSET
|
|
47
|
-
image_urls: Union[None, Unset, list[str]] = UNSET
|
|
48
|
-
gender: Union[None, ProductDetailGenderType0, Unset] = UNSET
|
|
49
|
-
materials: Union[None, Unset, list[str]] = UNSET
|
|
50
|
-
key_features: Union[None, Unset, list[str]] = UNSET
|
|
51
|
-
variants: Union[Unset, list["Variant"]] = UNSET
|
|
52
|
-
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
53
|
-
|
|
54
|
-
def to_dict(self) -> dict[str, Any]:
|
|
55
|
-
id = self.id
|
|
56
|
-
|
|
57
|
-
url = self.url
|
|
58
|
-
|
|
59
|
-
title = self.title
|
|
60
|
-
|
|
61
|
-
price = self.price.to_dict()
|
|
62
|
-
|
|
63
|
-
availability = self.availability.value
|
|
64
|
-
|
|
65
|
-
description: Union[None, Unset, str]
|
|
66
|
-
if isinstance(self.description, Unset):
|
|
67
|
-
description = UNSET
|
|
68
|
-
else:
|
|
69
|
-
description = self.description
|
|
70
|
-
|
|
71
|
-
brand_id: Union[None, Unset, str]
|
|
72
|
-
if isinstance(self.brand_id, Unset):
|
|
73
|
-
brand_id = UNSET
|
|
74
|
-
else:
|
|
75
|
-
brand_id = self.brand_id
|
|
76
|
-
|
|
77
|
-
brand_name: Union[None, Unset, str]
|
|
78
|
-
if isinstance(self.brand_name, Unset):
|
|
79
|
-
brand_name = UNSET
|
|
80
|
-
else:
|
|
81
|
-
brand_name = self.brand_name
|
|
82
|
-
|
|
83
|
-
image_urls: Union[None, Unset, list[str]]
|
|
84
|
-
if isinstance(self.image_urls, Unset):
|
|
85
|
-
image_urls = UNSET
|
|
86
|
-
elif isinstance(self.image_urls, list):
|
|
87
|
-
image_urls = self.image_urls
|
|
88
|
-
|
|
89
|
-
else:
|
|
90
|
-
image_urls = self.image_urls
|
|
91
|
-
|
|
92
|
-
gender: Union[None, Unset, str]
|
|
93
|
-
if isinstance(self.gender, Unset):
|
|
94
|
-
gender = UNSET
|
|
95
|
-
elif isinstance(self.gender, ProductDetailGenderType0):
|
|
96
|
-
gender = self.gender.value
|
|
97
|
-
else:
|
|
98
|
-
gender = self.gender
|
|
99
|
-
|
|
100
|
-
materials: Union[None, Unset, list[str]]
|
|
101
|
-
if isinstance(self.materials, Unset):
|
|
102
|
-
materials = UNSET
|
|
103
|
-
elif isinstance(self.materials, list):
|
|
104
|
-
materials = self.materials
|
|
105
|
-
|
|
106
|
-
else:
|
|
107
|
-
materials = self.materials
|
|
108
|
-
|
|
109
|
-
key_features: Union[None, Unset, list[str]]
|
|
110
|
-
if isinstance(self.key_features, Unset):
|
|
111
|
-
key_features = UNSET
|
|
112
|
-
elif isinstance(self.key_features, list):
|
|
113
|
-
key_features = self.key_features
|
|
114
|
-
|
|
115
|
-
else:
|
|
116
|
-
key_features = self.key_features
|
|
117
|
-
|
|
118
|
-
variants: Union[Unset, list[dict[str, Any]]] = UNSET
|
|
119
|
-
if not isinstance(self.variants, Unset):
|
|
120
|
-
variants = []
|
|
121
|
-
for variants_item_data in self.variants:
|
|
122
|
-
variants_item = variants_item_data.to_dict()
|
|
123
|
-
variants.append(variants_item)
|
|
124
|
-
|
|
125
|
-
field_dict: dict[str, Any] = {}
|
|
126
|
-
field_dict.update(self.additional_properties)
|
|
127
|
-
field_dict.update(
|
|
128
|
-
{
|
|
129
|
-
"id": id,
|
|
130
|
-
"url": url,
|
|
131
|
-
"title": title,
|
|
132
|
-
"price": price,
|
|
133
|
-
"availability": availability,
|
|
134
|
-
}
|
|
135
|
-
)
|
|
136
|
-
if description is not UNSET:
|
|
137
|
-
field_dict["description"] = description
|
|
138
|
-
if brand_id is not UNSET:
|
|
139
|
-
field_dict["brand_id"] = brand_id
|
|
140
|
-
if brand_name is not UNSET:
|
|
141
|
-
field_dict["brand_name"] = brand_name
|
|
142
|
-
if image_urls is not UNSET:
|
|
143
|
-
field_dict["image_urls"] = image_urls
|
|
144
|
-
if gender is not UNSET:
|
|
145
|
-
field_dict["gender"] = gender
|
|
146
|
-
if materials is not UNSET:
|
|
147
|
-
field_dict["materials"] = materials
|
|
148
|
-
if key_features is not UNSET:
|
|
149
|
-
field_dict["key_features"] = key_features
|
|
150
|
-
if variants is not UNSET:
|
|
151
|
-
field_dict["variants"] = variants
|
|
152
|
-
|
|
153
|
-
return field_dict
|
|
154
|
-
|
|
155
|
-
@classmethod
|
|
156
|
-
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
157
|
-
from ..models.price import Price
|
|
158
|
-
from ..models.variant import Variant
|
|
159
|
-
|
|
160
|
-
d = dict(src_dict)
|
|
161
|
-
id = d.pop("id")
|
|
162
|
-
|
|
163
|
-
url = d.pop("url")
|
|
164
|
-
|
|
165
|
-
title = d.pop("title")
|
|
166
|
-
|
|
167
|
-
price = Price.from_dict(d.pop("price"))
|
|
168
|
-
|
|
169
|
-
availability = AvailabilityStatus(d.pop("availability"))
|
|
170
|
-
|
|
171
|
-
def _parse_description(data: object) -> Union[None, Unset, str]:
|
|
172
|
-
if data is None:
|
|
173
|
-
return data
|
|
174
|
-
if isinstance(data, Unset):
|
|
175
|
-
return data
|
|
176
|
-
return cast(Union[None, Unset, str], data)
|
|
177
|
-
|
|
178
|
-
description = _parse_description(d.pop("description", UNSET))
|
|
179
|
-
|
|
180
|
-
def _parse_brand_id(data: object) -> Union[None, Unset, str]:
|
|
181
|
-
if data is None:
|
|
182
|
-
return data
|
|
183
|
-
if isinstance(data, Unset):
|
|
184
|
-
return data
|
|
185
|
-
return cast(Union[None, Unset, str], data)
|
|
186
|
-
|
|
187
|
-
brand_id = _parse_brand_id(d.pop("brand_id", UNSET))
|
|
188
|
-
|
|
189
|
-
def _parse_brand_name(data: object) -> Union[None, Unset, str]:
|
|
190
|
-
if data is None:
|
|
191
|
-
return data
|
|
192
|
-
if isinstance(data, Unset):
|
|
193
|
-
return data
|
|
194
|
-
return cast(Union[None, Unset, str], data)
|
|
195
|
-
|
|
196
|
-
brand_name = _parse_brand_name(d.pop("brand_name", UNSET))
|
|
197
|
-
|
|
198
|
-
def _parse_image_urls(data: object) -> Union[None, Unset, list[str]]:
|
|
199
|
-
if data is None:
|
|
200
|
-
return data
|
|
201
|
-
if isinstance(data, Unset):
|
|
202
|
-
return data
|
|
203
|
-
try:
|
|
204
|
-
if not isinstance(data, list):
|
|
205
|
-
raise TypeError()
|
|
206
|
-
image_urls_type_0 = cast(list[str], data)
|
|
207
|
-
|
|
208
|
-
return image_urls_type_0
|
|
209
|
-
except: # noqa: E722
|
|
210
|
-
pass
|
|
211
|
-
return cast(Union[None, Unset, list[str]], data)
|
|
212
|
-
|
|
213
|
-
image_urls = _parse_image_urls(d.pop("image_urls", UNSET))
|
|
214
|
-
|
|
215
|
-
def _parse_gender(data: object) -> Union[None, ProductDetailGenderType0, Unset]:
|
|
216
|
-
if data is None:
|
|
217
|
-
return data
|
|
218
|
-
if isinstance(data, Unset):
|
|
219
|
-
return data
|
|
220
|
-
try:
|
|
221
|
-
if not isinstance(data, str):
|
|
222
|
-
raise TypeError()
|
|
223
|
-
gender_type_0 = ProductDetailGenderType0(data)
|
|
224
|
-
|
|
225
|
-
return gender_type_0
|
|
226
|
-
except: # noqa: E722
|
|
227
|
-
pass
|
|
228
|
-
return cast(Union[None, ProductDetailGenderType0, Unset], data)
|
|
229
|
-
|
|
230
|
-
gender = _parse_gender(d.pop("gender", UNSET))
|
|
231
|
-
|
|
232
|
-
def _parse_materials(data: object) -> Union[None, Unset, list[str]]:
|
|
233
|
-
if data is None:
|
|
234
|
-
return data
|
|
235
|
-
if isinstance(data, Unset):
|
|
236
|
-
return data
|
|
237
|
-
try:
|
|
238
|
-
if not isinstance(data, list):
|
|
239
|
-
raise TypeError()
|
|
240
|
-
materials_type_0 = cast(list[str], data)
|
|
241
|
-
|
|
242
|
-
return materials_type_0
|
|
243
|
-
except: # noqa: E722
|
|
244
|
-
pass
|
|
245
|
-
return cast(Union[None, Unset, list[str]], data)
|
|
246
|
-
|
|
247
|
-
materials = _parse_materials(d.pop("materials", UNSET))
|
|
248
|
-
|
|
249
|
-
def _parse_key_features(data: object) -> Union[None, Unset, list[str]]:
|
|
250
|
-
if data is None:
|
|
251
|
-
return data
|
|
252
|
-
if isinstance(data, Unset):
|
|
253
|
-
return data
|
|
254
|
-
try:
|
|
255
|
-
if not isinstance(data, list):
|
|
256
|
-
raise TypeError()
|
|
257
|
-
key_features_type_0 = cast(list[str], data)
|
|
258
|
-
|
|
259
|
-
return key_features_type_0
|
|
260
|
-
except: # noqa: E722
|
|
261
|
-
pass
|
|
262
|
-
return cast(Union[None, Unset, list[str]], data)
|
|
263
|
-
|
|
264
|
-
key_features = _parse_key_features(d.pop("key_features", UNSET))
|
|
265
|
-
|
|
266
|
-
variants = []
|
|
267
|
-
_variants = d.pop("variants", UNSET)
|
|
268
|
-
for variants_item_data in _variants or []:
|
|
269
|
-
variants_item = Variant.from_dict(variants_item_data)
|
|
270
|
-
|
|
271
|
-
variants.append(variants_item)
|
|
272
|
-
|
|
273
|
-
product_detail = cls(
|
|
274
|
-
id=id,
|
|
275
|
-
url=url,
|
|
276
|
-
title=title,
|
|
277
|
-
price=price,
|
|
278
|
-
availability=availability,
|
|
279
|
-
description=description,
|
|
280
|
-
brand_id=brand_id,
|
|
281
|
-
brand_name=brand_name,
|
|
282
|
-
image_urls=image_urls,
|
|
283
|
-
gender=gender,
|
|
284
|
-
materials=materials,
|
|
285
|
-
key_features=key_features,
|
|
286
|
-
variants=variants,
|
|
287
|
-
)
|
|
288
|
-
|
|
289
|
-
product_detail.additional_properties = d
|
|
290
|
-
return product_detail
|
|
291
|
-
|
|
292
|
-
@property
|
|
293
|
-
def additional_keys(self) -> list[str]:
|
|
294
|
-
return list(self.additional_properties.keys())
|
|
295
|
-
|
|
296
|
-
def __getitem__(self, key: str) -> Any:
|
|
297
|
-
return self.additional_properties[key]
|
|
298
|
-
|
|
299
|
-
def __setitem__(self, key: str, value: Any) -> None:
|
|
300
|
-
self.additional_properties[key] = value
|
|
301
|
-
|
|
302
|
-
def __delitem__(self, key: str) -> None:
|
|
303
|
-
del self.additional_properties[key]
|
|
304
|
-
|
|
305
|
-
def __contains__(self, key: str) -> bool:
|
|
306
|
-
return key in self.additional_properties
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
from collections.abc import Mapping
|
|
2
|
-
from typing import Any, TypeVar, Union
|
|
3
|
-
|
|
4
|
-
from attrs import define as _attrs_define
|
|
5
|
-
from attrs import field as _attrs_field
|
|
6
|
-
|
|
7
|
-
from ..types import UNSET, Unset
|
|
8
|
-
|
|
9
|
-
T = TypeVar("T", bound="SearchConfig")
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
@_attrs_define
|
|
13
|
-
class SearchConfig:
|
|
14
|
-
"""Configuration for a search request
|
|
15
|
-
|
|
16
|
-
Attributes:
|
|
17
|
-
enrich_query (Union[Unset, bool]): Default: True.
|
|
18
|
-
semantic_search (Union[Unset, bool]): Default: True.
|
|
19
|
-
"""
|
|
20
|
-
|
|
21
|
-
enrich_query: Union[Unset, bool] = True
|
|
22
|
-
semantic_search: Union[Unset, bool] = True
|
|
23
|
-
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
24
|
-
|
|
25
|
-
def to_dict(self) -> dict[str, Any]:
|
|
26
|
-
enrich_query = self.enrich_query
|
|
27
|
-
|
|
28
|
-
semantic_search = self.semantic_search
|
|
29
|
-
|
|
30
|
-
field_dict: dict[str, Any] = {}
|
|
31
|
-
field_dict.update(self.additional_properties)
|
|
32
|
-
field_dict.update({})
|
|
33
|
-
if enrich_query is not UNSET:
|
|
34
|
-
field_dict["enrich_query"] = enrich_query
|
|
35
|
-
if semantic_search is not UNSET:
|
|
36
|
-
field_dict["semantic_search"] = semantic_search
|
|
37
|
-
|
|
38
|
-
return field_dict
|
|
39
|
-
|
|
40
|
-
@classmethod
|
|
41
|
-
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
42
|
-
d = dict(src_dict)
|
|
43
|
-
enrich_query = d.pop("enrich_query", UNSET)
|
|
44
|
-
|
|
45
|
-
semantic_search = d.pop("semantic_search", UNSET)
|
|
46
|
-
|
|
47
|
-
search_config = cls(
|
|
48
|
-
enrich_query=enrich_query,
|
|
49
|
-
semantic_search=semantic_search,
|
|
50
|
-
)
|
|
51
|
-
|
|
52
|
-
search_config.additional_properties = d
|
|
53
|
-
return search_config
|
|
54
|
-
|
|
55
|
-
@property
|
|
56
|
-
def additional_keys(self) -> list[str]:
|
|
57
|
-
return list(self.additional_properties.keys())
|
|
58
|
-
|
|
59
|
-
def __getitem__(self, key: str) -> Any:
|
|
60
|
-
return self.additional_properties[key]
|
|
61
|
-
|
|
62
|
-
def __setitem__(self, key: str, value: Any) -> None:
|
|
63
|
-
self.additional_properties[key] = value
|
|
64
|
-
|
|
65
|
-
def __delitem__(self, key: str) -> None:
|
|
66
|
-
del self.additional_properties[key]
|
|
67
|
-
|
|
68
|
-
def __contains__(self, key: str) -> bool:
|
|
69
|
-
return key in self.additional_properties
|