amazon-creatorsapi-python-sdk 1.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.
Files changed (108) hide show
  1. amazon_creatorsapi_python_sdk-1.0.0.dist-info/METADATA +99 -0
  2. amazon_creatorsapi_python_sdk-1.0.0.dist-info/RECORD +108 -0
  3. amazon_creatorsapi_python_sdk-1.0.0.dist-info/WHEEL +5 -0
  4. amazon_creatorsapi_python_sdk-1.0.0.dist-info/licenses/LICENSE.txt +202 -0
  5. amazon_creatorsapi_python_sdk-1.0.0.dist-info/licenses/NOTICE.txt +2 -0
  6. amazon_creatorsapi_python_sdk-1.0.0.dist-info/top_level.txt +1 -0
  7. creatorsapi_python_sdk/__init__.py +127 -0
  8. creatorsapi_python_sdk/api/__init__.py +5 -0
  9. creatorsapi_python_sdk/api/default_api.py +2412 -0
  10. creatorsapi_python_sdk/api_client.py +912 -0
  11. creatorsapi_python_sdk/api_response.py +21 -0
  12. creatorsapi_python_sdk/auth/__init__.py +21 -0
  13. creatorsapi_python_sdk/auth/oauth2_config.py +123 -0
  14. creatorsapi_python_sdk/auth/oauth2_token_manager.py +120 -0
  15. creatorsapi_python_sdk/configuration.py +455 -0
  16. creatorsapi_python_sdk/exceptions.py +204 -0
  17. creatorsapi_python_sdk/models/__init__.py +110 -0
  18. creatorsapi_python_sdk/models/access_denied_exception_response_content.py +97 -0
  19. creatorsapi_python_sdk/models/access_denied_reason.py +45 -0
  20. creatorsapi_python_sdk/models/availability.py +44 -0
  21. creatorsapi_python_sdk/models/browse_node.py +116 -0
  22. creatorsapi_python_sdk/models/browse_node_ancestor.py +103 -0
  23. creatorsapi_python_sdk/models/browse_node_child.py +96 -0
  24. creatorsapi_python_sdk/models/browse_node_info.py +106 -0
  25. creatorsapi_python_sdk/models/browse_nodes_result.py +100 -0
  26. creatorsapi_python_sdk/models/by_line_info.py +111 -0
  27. creatorsapi_python_sdk/models/classifications.py +101 -0
  28. creatorsapi_python_sdk/models/condition.py +44 -0
  29. creatorsapi_python_sdk/models/content_info.py +113 -0
  30. creatorsapi_python_sdk/models/content_rating.py +96 -0
  31. creatorsapi_python_sdk/models/contributor.py +98 -0
  32. creatorsapi_python_sdk/models/customer_reviews.py +98 -0
  33. creatorsapi_python_sdk/models/deal_details.py +102 -0
  34. creatorsapi_python_sdk/models/delivery_flag.py +46 -0
  35. creatorsapi_python_sdk/models/dimension_based_attribute.py +111 -0
  36. creatorsapi_python_sdk/models/error_data.py +94 -0
  37. creatorsapi_python_sdk/models/external_ids.py +106 -0
  38. creatorsapi_python_sdk/models/feed.py +98 -0
  39. creatorsapi_python_sdk/models/get_browse_nodes_request_content.py +107 -0
  40. creatorsapi_python_sdk/models/get_browse_nodes_resource.py +44 -0
  41. creatorsapi_python_sdk/models/get_browse_nodes_response_content.py +106 -0
  42. creatorsapi_python_sdk/models/get_feed_request_content.py +93 -0
  43. creatorsapi_python_sdk/models/get_feed_response_content.py +92 -0
  44. creatorsapi_python_sdk/models/get_items_request_content.py +124 -0
  45. creatorsapi_python_sdk/models/get_items_resource.py +76 -0
  46. creatorsapi_python_sdk/models/get_items_response_content.py +106 -0
  47. creatorsapi_python_sdk/models/get_report_request_content.py +93 -0
  48. creatorsapi_python_sdk/models/get_report_response_content.py +92 -0
  49. creatorsapi_python_sdk/models/get_variations_request_content.py +135 -0
  50. creatorsapi_python_sdk/models/get_variations_resource.py +79 -0
  51. creatorsapi_python_sdk/models/get_variations_response_content.py +106 -0
  52. creatorsapi_python_sdk/models/image_size.py +96 -0
  53. creatorsapi_python_sdk/models/image_type.py +111 -0
  54. creatorsapi_python_sdk/models/images.py +105 -0
  55. creatorsapi_python_sdk/models/internal_server_exception_response_content.py +94 -0
  56. creatorsapi_python_sdk/models/item.py +138 -0
  57. creatorsapi_python_sdk/models/item_info.py +156 -0
  58. creatorsapi_python_sdk/models/items_result.py +100 -0
  59. creatorsapi_python_sdk/models/language_type.py +94 -0
  60. creatorsapi_python_sdk/models/languages.py +104 -0
  61. creatorsapi_python_sdk/models/list_feeds_response_content.py +100 -0
  62. creatorsapi_python_sdk/models/list_reports_response_content.py +100 -0
  63. creatorsapi_python_sdk/models/manufacture_info.py +106 -0
  64. creatorsapi_python_sdk/models/money.py +96 -0
  65. creatorsapi_python_sdk/models/multi_valued_attribute.py +96 -0
  66. creatorsapi_python_sdk/models/offer_availability_v2.py +98 -0
  67. creatorsapi_python_sdk/models/offer_condition_v2.py +96 -0
  68. creatorsapi_python_sdk/models/offer_listing_v2.py +133 -0
  69. creatorsapi_python_sdk/models/offer_loyalty_points_v2.py +92 -0
  70. creatorsapi_python_sdk/models/offer_merchant_info_v2.py +94 -0
  71. creatorsapi_python_sdk/models/offer_price_v2.py +113 -0
  72. creatorsapi_python_sdk/models/offer_saving_basis.py +101 -0
  73. creatorsapi_python_sdk/models/offer_savings.py +98 -0
  74. creatorsapi_python_sdk/models/offer_type.py +45 -0
  75. creatorsapi_python_sdk/models/offers_v2.py +100 -0
  76. creatorsapi_python_sdk/models/product_info.py +124 -0
  77. creatorsapi_python_sdk/models/rating.py +92 -0
  78. creatorsapi_python_sdk/models/refinement.py +104 -0
  79. creatorsapi_python_sdk/models/refinement_bin.py +94 -0
  80. creatorsapi_python_sdk/models/report_metadata.py +98 -0
  81. creatorsapi_python_sdk/models/resource_not_found_exception_response_content.py +98 -0
  82. creatorsapi_python_sdk/models/saving_basis_type.py +46 -0
  83. creatorsapi_python_sdk/models/search_items_request_content.py +242 -0
  84. creatorsapi_python_sdk/models/search_items_resource.py +77 -0
  85. creatorsapi_python_sdk/models/search_items_response_content.py +106 -0
  86. creatorsapi_python_sdk/models/search_refinements.py +110 -0
  87. creatorsapi_python_sdk/models/search_result.py +110 -0
  88. creatorsapi_python_sdk/models/single_boolean_valued_attribute.py +96 -0
  89. creatorsapi_python_sdk/models/single_integer_valued_attribute.py +96 -0
  90. creatorsapi_python_sdk/models/single_string_valued_attribute.py +96 -0
  91. creatorsapi_python_sdk/models/sort_by.py +48 -0
  92. creatorsapi_python_sdk/models/technical_info.py +102 -0
  93. creatorsapi_python_sdk/models/throttle_exception_response_content.py +98 -0
  94. creatorsapi_python_sdk/models/trade_in_info.py +98 -0
  95. creatorsapi_python_sdk/models/trade_in_price.py +96 -0
  96. creatorsapi_python_sdk/models/unauthorized_exception_reason.py +51 -0
  97. creatorsapi_python_sdk/models/unauthorized_exception_response_content.py +97 -0
  98. creatorsapi_python_sdk/models/unit_based_attribute.py +98 -0
  99. creatorsapi_python_sdk/models/validation_exception_field.py +94 -0
  100. creatorsapi_python_sdk/models/validation_exception_reason.py +48 -0
  101. creatorsapi_python_sdk/models/validation_exception_response_content.py +107 -0
  102. creatorsapi_python_sdk/models/variation_attribute.py +94 -0
  103. creatorsapi_python_sdk/models/variation_dimension.py +98 -0
  104. creatorsapi_python_sdk/models/variation_summary.py +104 -0
  105. creatorsapi_python_sdk/models/variations_result.py +106 -0
  106. creatorsapi_python_sdk/models/website_sales_rank.py +98 -0
  107. creatorsapi_python_sdk/py.typed +0 -0
  108. creatorsapi_python_sdk/rest.py +262 -0
@@ -0,0 +1,242 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
5
+
6
+ Licensed under the Apache License, Version 2.0 (the "License").
7
+ You may not use this file except in compliance with the License.
8
+ A copy of the License is located at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ or in the "license" file accompanying this file. This file is distributed
13
+ on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
14
+ express or implied. See the License for the specific language governing
15
+ permissions and limitations under the License.
16
+
17
+ """ # noqa: E501
18
+
19
+
20
+
21
+ from __future__ import annotations
22
+ import pprint
23
+ import re # noqa: F401
24
+ import json
25
+
26
+ from pydantic import BaseModel, ConfigDict, Field, field_validator
27
+ from typing import Any, ClassVar, Dict, List, Optional, Union
28
+ from typing_extensions import Annotated
29
+ from creatorsapi_python_sdk.models.availability import Availability
30
+ from creatorsapi_python_sdk.models.condition import Condition
31
+ from creatorsapi_python_sdk.models.delivery_flag import DeliveryFlag
32
+ from creatorsapi_python_sdk.models.search_items_resource import SearchItemsResource
33
+ from creatorsapi_python_sdk.models.sort_by import SortBy
34
+ from typing import Optional, Set
35
+ from typing_extensions import Self
36
+
37
+ class SearchItemsRequestContent(BaseModel):
38
+ """
39
+ The request object for the search items operation. It contains the request parameters for the search items operation.
40
+ """ # noqa: E501
41
+ actor: Optional[Annotated[str, Field(strict=True, max_length=1000)]] = Field(default=None, description="Actor name associated with the item. You can enter all or part of the name.")
42
+ artist: Optional[Annotated[str, Field(strict=True, max_length=1000)]] = Field(default=None, description="Artist name associated with the item. You can enter all or part of the name.")
43
+ author: Optional[Annotated[str, Field(strict=True, max_length=1000)]] = Field(default=None, description="Author name associated with the item. You can enter all or part of the name.")
44
+ availability: Optional[Availability] = None
45
+ brand: Optional[Annotated[str, Field(strict=True, max_length=1000)]] = Field(default=None, description="Brand name associated with the item. You can enter all or part of the name.")
46
+ browse_node_id: Optional[Annotated[str, Field(strict=True, max_length=19)]] = Field(default=None, description="A unique ID assigned by Amazon that identifies a product category/sub-category. The BrowseNodeId is a positive Long having max value upto Long.MAX_VALUE i.e. 9223372036854775807 (inclusive).", alias="browseNodeId")
47
+ condition: Optional[Condition] = None
48
+ currency_of_preference: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="Currency of preference in which the prices information should be returned in response. By default the prices are returned in the default currency of the marketplace. Expected currency code format is the ISO 4217 currency code (i.e. USD, EUR etc.).", alias="currencyOfPreference")
49
+ delivery_flags: Optional[Annotated[List[DeliveryFlag], Field(max_length=100)]] = Field(default=None, description="List of DeliveryFlag which denotes a certain delivery program.", alias="deliveryFlags")
50
+ item_count: Optional[Union[Annotated[float, Field(le=100, strict=True, ge=1)], Annotated[int, Field(le=100, strict=True, ge=1)]]] = Field(default=None, description="The number of items desired in SearchItems response.", alias="itemCount")
51
+ item_page: Optional[Union[Annotated[float, Field(le=10, strict=True, ge=1)], Annotated[int, Field(le=10, strict=True, ge=1)]]] = Field(default=None, description="The specific page of items to be returned from the available Search Results.", alias="itemPage")
52
+ keywords: Optional[Annotated[str, Field(strict=True, max_length=1000)]] = Field(default=None, description="A word or phrase that describes an item i.e. the search query.")
53
+ languages_of_preference: Optional[Annotated[List[Annotated[str, Field(strict=True, max_length=1000)]], Field(max_length=1)]] = Field(default=None, description="Languages in order of preference in which the item information should be returned in response. By default the item information is returned in the default language of the marketplace.", alias="languagesOfPreference")
54
+ max_price: Optional[Union[Annotated[float, Field(strict=True, ge=1)], Annotated[int, Field(strict=True, ge=1)]]] = Field(default=None, description="The MaxPrice parameter filters search results to items with at least one offer price below the specified value.", alias="maxPrice")
55
+ min_price: Optional[Union[Annotated[float, Field(strict=True, ge=1)], Annotated[int, Field(strict=True, ge=1)]]] = Field(default=None, description="The MinPrice parameter filters search results to items with at least one offer price above the specified value.", alias="minPrice")
56
+ min_reviews_rating: Optional[Union[Annotated[float, Field(le=4, strict=True, ge=1)], Annotated[int, Field(le=4, strict=True, ge=1)]]] = Field(default=None, description="The MinReviewsRating parameter filters search results to items with customer review ratings above specified value.", alias="minReviewsRating")
57
+ min_saving_percent: Optional[Union[Annotated[float, Field(le=99, strict=True, ge=1)], Annotated[int, Field(le=99, strict=True, ge=1)]]] = Field(default=None, description="The MinSavingPercent parameter filters search results to items with at least one offer having saving percentage above the specified value.", alias="minSavingPercent")
58
+ partner_tag: Optional[Annotated[str, Field(strict=True, max_length=64)]] = Field(default=None, description="An alphanumeric token that uniquely identifies a partner. If the value of PartnerType is Associates, enter your Store Id or tracking ID.", alias="partnerTag")
59
+ properties: Optional[Dict[str, Annotated[str, Field(strict=True)]]] = Field(default=None, description="Reserved parameter for specifying key-value pairs. This is a flexible mechanism for passing additional context or metadata to the API.")
60
+ resources: Optional[Annotated[List[SearchItemsResource], Field(max_length=100)]] = Field(default=None, description="List of resources for SearchItems operation which specify the values to return.")
61
+ search_index: Optional[Annotated[str, Field(strict=True, max_length=1000)]] = Field(default=None, description="Indicates the product category to search. SearchIndex values differ by marketplace.", alias="searchIndex")
62
+ sort_by: Optional[SortBy] = Field(default=None, alias="sortBy")
63
+ title: Optional[Annotated[str, Field(strict=True, max_length=1000)]] = Field(default=None, description="Title associated with the item.")
64
+ __properties: ClassVar[List[str]] = ["actor", "artist", "author", "availability", "brand", "browseNodeId", "condition", "currencyOfPreference", "deliveryFlags", "itemCount", "itemPage", "keywords", "languagesOfPreference", "maxPrice", "minPrice", "minReviewsRating", "minSavingPercent", "partnerTag", "properties", "resources", "searchIndex", "sortBy", "title"]
65
+
66
+ @field_validator('actor')
67
+ def actor_validate_regular_expression(cls, value):
68
+ """Validates the regular expression"""
69
+ if value is None:
70
+ return value
71
+
72
+ if not re.match(r".*\S.*", value):
73
+ raise ValueError(r"must validate the regular expression /.*\S.*/")
74
+ return value
75
+
76
+ @field_validator('artist')
77
+ def artist_validate_regular_expression(cls, value):
78
+ """Validates the regular expression"""
79
+ if value is None:
80
+ return value
81
+
82
+ if not re.match(r".*\S.*", value):
83
+ raise ValueError(r"must validate the regular expression /.*\S.*/")
84
+ return value
85
+
86
+ @field_validator('author')
87
+ def author_validate_regular_expression(cls, value):
88
+ """Validates the regular expression"""
89
+ if value is None:
90
+ return value
91
+
92
+ if not re.match(r".*\S.*", value):
93
+ raise ValueError(r"must validate the regular expression /.*\S.*/")
94
+ return value
95
+
96
+ @field_validator('brand')
97
+ def brand_validate_regular_expression(cls, value):
98
+ """Validates the regular expression"""
99
+ if value is None:
100
+ return value
101
+
102
+ if not re.match(r".*\S.*", value):
103
+ raise ValueError(r"must validate the regular expression /.*\S.*/")
104
+ return value
105
+
106
+ @field_validator('browse_node_id')
107
+ def browse_node_id_validate_regular_expression(cls, value):
108
+ """Validates the regular expression"""
109
+ if value is None:
110
+ return value
111
+
112
+ if not re.match(r"^[1-9][0-9]*$", value):
113
+ raise ValueError(r"must validate the regular expression /^[1-9][0-9]*$/")
114
+ return value
115
+
116
+ @field_validator('currency_of_preference')
117
+ def currency_of_preference_validate_regular_expression(cls, value):
118
+ """Validates the regular expression"""
119
+ if value is None:
120
+ return value
121
+
122
+ if not re.match(r".*\S.*", value):
123
+ raise ValueError(r"must validate the regular expression /.*\S.*/")
124
+ return value
125
+
126
+ @field_validator('keywords')
127
+ def keywords_validate_regular_expression(cls, value):
128
+ """Validates the regular expression"""
129
+ if value is None:
130
+ return value
131
+
132
+ if not re.match(r".*\S.*", value):
133
+ raise ValueError(r"must validate the regular expression /.*\S.*/")
134
+ return value
135
+
136
+ @field_validator('partner_tag')
137
+ def partner_tag_validate_regular_expression(cls, value):
138
+ """Validates the regular expression"""
139
+ if value is None:
140
+ return value
141
+
142
+ if not re.match(r".*\S.*", value):
143
+ raise ValueError(r"must validate the regular expression /.*\S.*/")
144
+ return value
145
+
146
+ @field_validator('search_index')
147
+ def search_index_validate_regular_expression(cls, value):
148
+ """Validates the regular expression"""
149
+ if value is None:
150
+ return value
151
+
152
+ if not re.match(r".*\S.*", value):
153
+ raise ValueError(r"must validate the regular expression /.*\S.*/")
154
+ return value
155
+
156
+ @field_validator('title')
157
+ def title_validate_regular_expression(cls, value):
158
+ """Validates the regular expression"""
159
+ if value is None:
160
+ return value
161
+
162
+ if not re.match(r".*\S.*", value):
163
+ raise ValueError(r"must validate the regular expression /.*\S.*/")
164
+ return value
165
+
166
+ model_config = ConfigDict(
167
+ populate_by_name=True,
168
+ validate_assignment=True,
169
+ protected_namespaces=(),
170
+ )
171
+
172
+
173
+ def to_str(self) -> str:
174
+ """Returns the string representation of the model using alias"""
175
+ return pprint.pformat(self.model_dump(by_alias=True))
176
+
177
+ def to_json(self) -> str:
178
+ """Returns the JSON representation of the model using alias"""
179
+ return self.model_dump_json(by_alias=True, exclude_unset=True)
180
+
181
+ @classmethod
182
+ def from_json(cls, json_str: str) -> Optional[Self]:
183
+ """Create an instance of SearchItemsRequestContent from a JSON string"""
184
+ return cls.from_dict(json.loads(json_str))
185
+
186
+ def to_dict(self) -> Dict[str, Any]:
187
+ """Return the dictionary representation of the model using alias.
188
+
189
+ This has the following differences from calling pydantic's
190
+ `self.model_dump(by_alias=True)`:
191
+
192
+ * `None` is only added to the output dict for nullable fields that
193
+ were set at model initialization. Other fields with value `None`
194
+ are ignored.
195
+ """
196
+ excluded_fields: Set[str] = set([
197
+ ])
198
+
199
+ _dict = self.model_dump(
200
+ by_alias=True,
201
+ exclude=excluded_fields,
202
+ exclude_none=True,
203
+ )
204
+ return _dict
205
+
206
+ @classmethod
207
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
208
+ """Create an instance of SearchItemsRequestContent from a dict"""
209
+ if obj is None:
210
+ return None
211
+
212
+ if not isinstance(obj, dict):
213
+ return cls.model_validate(obj)
214
+
215
+ _obj = cls.model_validate({
216
+ "actor": obj.get("actor"),
217
+ "artist": obj.get("artist"),
218
+ "author": obj.get("author"),
219
+ "availability": obj.get("availability"),
220
+ "brand": obj.get("brand"),
221
+ "browseNodeId": obj.get("browseNodeId"),
222
+ "condition": obj.get("condition"),
223
+ "currencyOfPreference": obj.get("currencyOfPreference"),
224
+ "deliveryFlags": obj.get("deliveryFlags"),
225
+ "itemCount": obj.get("itemCount"),
226
+ "itemPage": obj.get("itemPage"),
227
+ "keywords": obj.get("keywords"),
228
+ "languagesOfPreference": obj.get("languagesOfPreference"),
229
+ "maxPrice": obj.get("maxPrice"),
230
+ "minPrice": obj.get("minPrice"),
231
+ "minReviewsRating": obj.get("minReviewsRating"),
232
+ "minSavingPercent": obj.get("minSavingPercent"),
233
+ "partnerTag": obj.get("partnerTag"),
234
+ "properties": obj.get("properties"),
235
+ "resources": obj.get("resources"),
236
+ "searchIndex": obj.get("searchIndex"),
237
+ "sortBy": obj.get("sortBy"),
238
+ "title": obj.get("title")
239
+ })
240
+ return _obj
241
+
242
+
@@ -0,0 +1,77 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
5
+
6
+ Licensed under the Apache License, Version 2.0 (the "License").
7
+ You may not use this file except in compliance with the License.
8
+ A copy of the License is located at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ or in the "license" file accompanying this file. This file is distributed
13
+ on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
14
+ express or implied. See the License for the specific language governing
15
+ permissions and limitations under the License.
16
+
17
+ """ # noqa: E501
18
+
19
+
20
+
21
+ from __future__ import annotations
22
+ import json
23
+ from enum import Enum
24
+ from typing_extensions import Self
25
+
26
+
27
+ class SearchItemsResource(str, Enum):
28
+ """
29
+ SearchItemsResource
30
+ """
31
+
32
+ """
33
+ allowed enum values
34
+ """
35
+ BROWSE_NODE_INFO_DOT_BROWSE_NODES = 'browseNodeInfo.browseNodes'
36
+ BROWSE_NODE_INFO_DOT_BROWSE_NODES_DOT_ANCESTOR = 'browseNodeInfo.browseNodes.ancestor'
37
+ BROWSE_NODE_INFO_DOT_BROWSE_NODES_DOT_SALES_RANK = 'browseNodeInfo.browseNodes.salesRank'
38
+ BROWSE_NODE_INFO_DOT_WEBSITE_SALES_RANK = 'browseNodeInfo.websiteSalesRank'
39
+ CUSTOMER_REVIEWS_DOT_COUNT = 'customerReviews.count'
40
+ CUSTOMER_REVIEWS_DOT_STAR_RATING = 'customerReviews.starRating'
41
+ IMAGES_DOT_PRIMARY_DOT_SMALL = 'images.primary.small'
42
+ IMAGES_DOT_PRIMARY_DOT_MEDIUM = 'images.primary.medium'
43
+ IMAGES_DOT_PRIMARY_DOT_LARGE = 'images.primary.large'
44
+ IMAGES_DOT_PRIMARY_DOT_HIGH_RES = 'images.primary.highRes'
45
+ IMAGES_DOT_VARIANTS_DOT_SMALL = 'images.variants.small'
46
+ IMAGES_DOT_VARIANTS_DOT_MEDIUM = 'images.variants.medium'
47
+ IMAGES_DOT_VARIANTS_DOT_LARGE = 'images.variants.large'
48
+ IMAGES_DOT_VARIANTS_DOT_HIGH_RES = 'images.variants.highRes'
49
+ ITEM_INFO_DOT_BY_LINE_INFO = 'itemInfo.byLineInfo'
50
+ ITEM_INFO_DOT_CONTENT_INFO = 'itemInfo.contentInfo'
51
+ ITEM_INFO_DOT_CONTENT_RATING = 'itemInfo.contentRating'
52
+ ITEM_INFO_DOT_CLASSIFICATIONS = 'itemInfo.classifications'
53
+ ITEM_INFO_DOT_EXTERNAL_IDS = 'itemInfo.externalIds'
54
+ ITEM_INFO_DOT_FEATURES = 'itemInfo.features'
55
+ ITEM_INFO_DOT_MANUFACTURE_INFO = 'itemInfo.manufactureInfo'
56
+ ITEM_INFO_DOT_PRODUCT_INFO = 'itemInfo.productInfo'
57
+ ITEM_INFO_DOT_TECHNICAL_INFO = 'itemInfo.technicalInfo'
58
+ ITEM_INFO_DOT_TITLE = 'itemInfo.title'
59
+ ITEM_INFO_DOT_TRADE_IN_INFO = 'itemInfo.tradeInInfo'
60
+ OFFERS_V2_DOT_LISTINGS_DOT_AVAILABILITY = 'offersV2.listings.availability'
61
+ OFFERS_V2_DOT_LISTINGS_DOT_CONDITION = 'offersV2.listings.condition'
62
+ OFFERS_V2_DOT_LISTINGS_DOT_DEAL_DETAILS = 'offersV2.listings.dealDetails'
63
+ OFFERS_V2_DOT_LISTINGS_DOT_IS_BUY_BOX_WINNER = 'offersV2.listings.isBuyBoxWinner'
64
+ OFFERS_V2_DOT_LISTINGS_DOT_LOYALTY_POINTS = 'offersV2.listings.loyaltyPoints'
65
+ OFFERS_V2_DOT_LISTINGS_DOT_MERCHANT_INFO = 'offersV2.listings.merchantInfo'
66
+ OFFERS_V2_DOT_LISTINGS_DOT_PRICE = 'offersV2.listings.price'
67
+ OFFERS_V2_DOT_LISTINGS_DOT_TYPE = 'offersV2.listings.type'
68
+ PARENTASIN = 'parentASIN'
69
+ SEARCHREFINEMENTS = 'searchRefinements'
70
+
71
+ @classmethod
72
+ def from_json(cls, json_str: str) -> Self:
73
+ """Create an instance of SearchItemsResource from a JSON string"""
74
+ return cls(json.loads(json_str))
75
+
76
+
77
+
@@ -0,0 +1,106 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
5
+
6
+ Licensed under the Apache License, Version 2.0 (the "License").
7
+ You may not use this file except in compliance with the License.
8
+ A copy of the License is located at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ or in the "license" file accompanying this file. This file is distributed
13
+ on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
14
+ express or implied. See the License for the specific language governing
15
+ permissions and limitations under the License.
16
+
17
+ """ # noqa: E501
18
+
19
+
20
+
21
+ from __future__ import annotations
22
+ import pprint
23
+ import re # noqa: F401
24
+ import json
25
+
26
+ from pydantic import BaseModel, ConfigDict, Field
27
+ from typing import Any, ClassVar, Dict, List, Optional
28
+ from creatorsapi_python_sdk.models.error_data import ErrorData
29
+ from creatorsapi_python_sdk.models.search_result import SearchResult
30
+ from typing import Optional, Set
31
+ from typing_extensions import Self
32
+
33
+ class SearchItemsResponseContent(BaseModel):
34
+ """
35
+ The response object for SearchItems operation.
36
+ """ # noqa: E501
37
+ search_result: Optional[SearchResult] = Field(default=None, alias="searchResult")
38
+ errors: Optional[List[ErrorData]] = Field(default=None, description="List of partial errors encountered during request processing in an otherwise successful response")
39
+ __properties: ClassVar[List[str]] = ["searchResult", "errors"]
40
+
41
+ model_config = ConfigDict(
42
+ populate_by_name=True,
43
+ validate_assignment=True,
44
+ protected_namespaces=(),
45
+ )
46
+
47
+
48
+ def to_str(self) -> str:
49
+ """Returns the string representation of the model using alias"""
50
+ return pprint.pformat(self.model_dump(by_alias=True))
51
+
52
+ def to_json(self) -> str:
53
+ """Returns the JSON representation of the model using alias"""
54
+ return self.model_dump_json(by_alias=True, exclude_unset=True)
55
+
56
+ @classmethod
57
+ def from_json(cls, json_str: str) -> Optional[Self]:
58
+ """Create an instance of SearchItemsResponseContent from a JSON string"""
59
+ return cls.from_dict(json.loads(json_str))
60
+
61
+ def to_dict(self) -> Dict[str, Any]:
62
+ """Return the dictionary representation of the model using alias.
63
+
64
+ This has the following differences from calling pydantic's
65
+ `self.model_dump(by_alias=True)`:
66
+
67
+ * `None` is only added to the output dict for nullable fields that
68
+ were set at model initialization. Other fields with value `None`
69
+ are ignored.
70
+ """
71
+ excluded_fields: Set[str] = set([
72
+ ])
73
+
74
+ _dict = self.model_dump(
75
+ by_alias=True,
76
+ exclude=excluded_fields,
77
+ exclude_none=True,
78
+ )
79
+ # override the default output from pydantic by calling `to_dict()` of search_result
80
+ if self.search_result:
81
+ _dict['searchResult'] = self.search_result.to_dict()
82
+ # override the default output from pydantic by calling `to_dict()` of each item in errors (list)
83
+ _items = []
84
+ if self.errors:
85
+ for _item_errors in self.errors:
86
+ if _item_errors:
87
+ _items.append(_item_errors.to_dict())
88
+ _dict['errors'] = _items
89
+ return _dict
90
+
91
+ @classmethod
92
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
93
+ """Create an instance of SearchItemsResponseContent from a dict"""
94
+ if obj is None:
95
+ return None
96
+
97
+ if not isinstance(obj, dict):
98
+ return cls.model_validate(obj)
99
+
100
+ _obj = cls.model_validate({
101
+ "searchResult": SearchResult.from_dict(obj["searchResult"]) if obj.get("searchResult") is not None else None,
102
+ "errors": [ErrorData.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None
103
+ })
104
+ return _obj
105
+
106
+
@@ -0,0 +1,110 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
5
+
6
+ Licensed under the Apache License, Version 2.0 (the "License").
7
+ You may not use this file except in compliance with the License.
8
+ A copy of the License is located at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ or in the "license" file accompanying this file. This file is distributed
13
+ on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
14
+ express or implied. See the License for the specific language governing
15
+ permissions and limitations under the License.
16
+
17
+ """ # noqa: E501
18
+
19
+
20
+
21
+ from __future__ import annotations
22
+ import pprint
23
+ import re # noqa: F401
24
+ import json
25
+
26
+ from pydantic import BaseModel, ConfigDict, Field
27
+ from typing import Any, ClassVar, Dict, List, Optional
28
+ from creatorsapi_python_sdk.models.refinement import Refinement
29
+ from typing import Optional, Set
30
+ from typing_extensions import Self
31
+
32
+ class SearchRefinements(BaseModel):
33
+ """
34
+ Container for SearchRefinements resource which helps in filtering search results obtained from SearchItems operation. It contains relevant SearchIndexes, BrowseNodes and other dynamic refinements for a search request.
35
+ """ # noqa: E501
36
+ browse_node: Optional[Refinement] = Field(default=None, alias="browseNode")
37
+ other_refinements: Optional[List[Refinement]] = Field(default=None, description="List of refinements.", alias="otherRefinements")
38
+ search_index: Optional[Refinement] = Field(default=None, alias="searchIndex")
39
+ __properties: ClassVar[List[str]] = ["browseNode", "otherRefinements", "searchIndex"]
40
+
41
+ model_config = ConfigDict(
42
+ populate_by_name=True,
43
+ validate_assignment=True,
44
+ protected_namespaces=(),
45
+ )
46
+
47
+
48
+ def to_str(self) -> str:
49
+ """Returns the string representation of the model using alias"""
50
+ return pprint.pformat(self.model_dump(by_alias=True))
51
+
52
+ def to_json(self) -> str:
53
+ """Returns the JSON representation of the model using alias"""
54
+ return self.model_dump_json(by_alias=True, exclude_unset=True)
55
+
56
+ @classmethod
57
+ def from_json(cls, json_str: str) -> Optional[Self]:
58
+ """Create an instance of SearchRefinements from a JSON string"""
59
+ return cls.from_dict(json.loads(json_str))
60
+
61
+ def to_dict(self) -> Dict[str, Any]:
62
+ """Return the dictionary representation of the model using alias.
63
+
64
+ This has the following differences from calling pydantic's
65
+ `self.model_dump(by_alias=True)`:
66
+
67
+ * `None` is only added to the output dict for nullable fields that
68
+ were set at model initialization. Other fields with value `None`
69
+ are ignored.
70
+ """
71
+ excluded_fields: Set[str] = set([
72
+ ])
73
+
74
+ _dict = self.model_dump(
75
+ by_alias=True,
76
+ exclude=excluded_fields,
77
+ exclude_none=True,
78
+ )
79
+ # override the default output from pydantic by calling `to_dict()` of browse_node
80
+ if self.browse_node:
81
+ _dict['browseNode'] = self.browse_node.to_dict()
82
+ # override the default output from pydantic by calling `to_dict()` of each item in other_refinements (list)
83
+ _items = []
84
+ if self.other_refinements:
85
+ for _item_other_refinements in self.other_refinements:
86
+ if _item_other_refinements:
87
+ _items.append(_item_other_refinements.to_dict())
88
+ _dict['otherRefinements'] = _items
89
+ # override the default output from pydantic by calling `to_dict()` of search_index
90
+ if self.search_index:
91
+ _dict['searchIndex'] = self.search_index.to_dict()
92
+ return _dict
93
+
94
+ @classmethod
95
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
96
+ """Create an instance of SearchRefinements from a dict"""
97
+ if obj is None:
98
+ return None
99
+
100
+ if not isinstance(obj, dict):
101
+ return cls.model_validate(obj)
102
+
103
+ _obj = cls.model_validate({
104
+ "browseNode": Refinement.from_dict(obj["browseNode"]) if obj.get("browseNode") is not None else None,
105
+ "otherRefinements": [Refinement.from_dict(_item) for _item in obj["otherRefinements"]] if obj.get("otherRefinements") is not None else None,
106
+ "searchIndex": Refinement.from_dict(obj["searchIndex"]) if obj.get("searchIndex") is not None else None
107
+ })
108
+ return _obj
109
+
110
+
@@ -0,0 +1,110 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
5
+
6
+ Licensed under the Apache License, Version 2.0 (the "License").
7
+ You may not use this file except in compliance with the License.
8
+ A copy of the License is located at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ or in the "license" file accompanying this file. This file is distributed
13
+ on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
14
+ express or implied. See the License for the specific language governing
15
+ permissions and limitations under the License.
16
+
17
+ """ # noqa: E501
18
+
19
+
20
+
21
+ from __future__ import annotations
22
+ import pprint
23
+ import re # noqa: F401
24
+ import json
25
+
26
+ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
27
+ from typing import Any, ClassVar, Dict, List, Optional, Union
28
+ from creatorsapi_python_sdk.models.item import Item
29
+ from creatorsapi_python_sdk.models.search_refinements import SearchRefinements
30
+ from typing import Optional, Set
31
+ from typing_extensions import Self
32
+
33
+ class SearchResult(BaseModel):
34
+ """
35
+ The container for SearchItems response. It consists of search results items and some meta-data about the search result like TotalResultCount, SearchURL and SearchRefinements.
36
+ """ # noqa: E501
37
+ total_result_count: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="totalResultCount")
38
+ search_url: Optional[StrictStr] = Field(default=None, alias="searchURL")
39
+ items: Optional[List[Item]] = Field(default=None, description="List of Item which is a container for item information.")
40
+ search_refinements: Optional[SearchRefinements] = Field(default=None, alias="searchRefinements")
41
+ __properties: ClassVar[List[str]] = ["totalResultCount", "searchURL", "items", "searchRefinements"]
42
+
43
+ model_config = ConfigDict(
44
+ populate_by_name=True,
45
+ validate_assignment=True,
46
+ protected_namespaces=(),
47
+ )
48
+
49
+
50
+ def to_str(self) -> str:
51
+ """Returns the string representation of the model using alias"""
52
+ return pprint.pformat(self.model_dump(by_alias=True))
53
+
54
+ def to_json(self) -> str:
55
+ """Returns the JSON representation of the model using alias"""
56
+ return self.model_dump_json(by_alias=True, exclude_unset=True)
57
+
58
+ @classmethod
59
+ def from_json(cls, json_str: str) -> Optional[Self]:
60
+ """Create an instance of SearchResult from a JSON string"""
61
+ return cls.from_dict(json.loads(json_str))
62
+
63
+ def to_dict(self) -> Dict[str, Any]:
64
+ """Return the dictionary representation of the model using alias.
65
+
66
+ This has the following differences from calling pydantic's
67
+ `self.model_dump(by_alias=True)`:
68
+
69
+ * `None` is only added to the output dict for nullable fields that
70
+ were set at model initialization. Other fields with value `None`
71
+ are ignored.
72
+ """
73
+ excluded_fields: Set[str] = set([
74
+ ])
75
+
76
+ _dict = self.model_dump(
77
+ by_alias=True,
78
+ exclude=excluded_fields,
79
+ exclude_none=True,
80
+ )
81
+ # override the default output from pydantic by calling `to_dict()` of each item in items (list)
82
+ _items = []
83
+ if self.items:
84
+ for _item_items in self.items:
85
+ if _item_items:
86
+ _items.append(_item_items.to_dict())
87
+ _dict['items'] = _items
88
+ # override the default output from pydantic by calling `to_dict()` of search_refinements
89
+ if self.search_refinements:
90
+ _dict['searchRefinements'] = self.search_refinements.to_dict()
91
+ return _dict
92
+
93
+ @classmethod
94
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
95
+ """Create an instance of SearchResult from a dict"""
96
+ if obj is None:
97
+ return None
98
+
99
+ if not isinstance(obj, dict):
100
+ return cls.model_validate(obj)
101
+
102
+ _obj = cls.model_validate({
103
+ "totalResultCount": obj.get("totalResultCount"),
104
+ "searchURL": obj.get("searchURL"),
105
+ "items": [Item.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None,
106
+ "searchRefinements": SearchRefinements.from_dict(obj["searchRefinements"]) if obj.get("searchRefinements") is not None else None
107
+ })
108
+ return _obj
109
+
110
+