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.
- amazon_creatorsapi_python_sdk-1.0.0.dist-info/METADATA +99 -0
- amazon_creatorsapi_python_sdk-1.0.0.dist-info/RECORD +108 -0
- amazon_creatorsapi_python_sdk-1.0.0.dist-info/WHEEL +5 -0
- amazon_creatorsapi_python_sdk-1.0.0.dist-info/licenses/LICENSE.txt +202 -0
- amazon_creatorsapi_python_sdk-1.0.0.dist-info/licenses/NOTICE.txt +2 -0
- amazon_creatorsapi_python_sdk-1.0.0.dist-info/top_level.txt +1 -0
- creatorsapi_python_sdk/__init__.py +127 -0
- creatorsapi_python_sdk/api/__init__.py +5 -0
- creatorsapi_python_sdk/api/default_api.py +2412 -0
- creatorsapi_python_sdk/api_client.py +912 -0
- creatorsapi_python_sdk/api_response.py +21 -0
- creatorsapi_python_sdk/auth/__init__.py +21 -0
- creatorsapi_python_sdk/auth/oauth2_config.py +123 -0
- creatorsapi_python_sdk/auth/oauth2_token_manager.py +120 -0
- creatorsapi_python_sdk/configuration.py +455 -0
- creatorsapi_python_sdk/exceptions.py +204 -0
- creatorsapi_python_sdk/models/__init__.py +110 -0
- creatorsapi_python_sdk/models/access_denied_exception_response_content.py +97 -0
- creatorsapi_python_sdk/models/access_denied_reason.py +45 -0
- creatorsapi_python_sdk/models/availability.py +44 -0
- creatorsapi_python_sdk/models/browse_node.py +116 -0
- creatorsapi_python_sdk/models/browse_node_ancestor.py +103 -0
- creatorsapi_python_sdk/models/browse_node_child.py +96 -0
- creatorsapi_python_sdk/models/browse_node_info.py +106 -0
- creatorsapi_python_sdk/models/browse_nodes_result.py +100 -0
- creatorsapi_python_sdk/models/by_line_info.py +111 -0
- creatorsapi_python_sdk/models/classifications.py +101 -0
- creatorsapi_python_sdk/models/condition.py +44 -0
- creatorsapi_python_sdk/models/content_info.py +113 -0
- creatorsapi_python_sdk/models/content_rating.py +96 -0
- creatorsapi_python_sdk/models/contributor.py +98 -0
- creatorsapi_python_sdk/models/customer_reviews.py +98 -0
- creatorsapi_python_sdk/models/deal_details.py +102 -0
- creatorsapi_python_sdk/models/delivery_flag.py +46 -0
- creatorsapi_python_sdk/models/dimension_based_attribute.py +111 -0
- creatorsapi_python_sdk/models/error_data.py +94 -0
- creatorsapi_python_sdk/models/external_ids.py +106 -0
- creatorsapi_python_sdk/models/feed.py +98 -0
- creatorsapi_python_sdk/models/get_browse_nodes_request_content.py +107 -0
- creatorsapi_python_sdk/models/get_browse_nodes_resource.py +44 -0
- creatorsapi_python_sdk/models/get_browse_nodes_response_content.py +106 -0
- creatorsapi_python_sdk/models/get_feed_request_content.py +93 -0
- creatorsapi_python_sdk/models/get_feed_response_content.py +92 -0
- creatorsapi_python_sdk/models/get_items_request_content.py +124 -0
- creatorsapi_python_sdk/models/get_items_resource.py +76 -0
- creatorsapi_python_sdk/models/get_items_response_content.py +106 -0
- creatorsapi_python_sdk/models/get_report_request_content.py +93 -0
- creatorsapi_python_sdk/models/get_report_response_content.py +92 -0
- creatorsapi_python_sdk/models/get_variations_request_content.py +135 -0
- creatorsapi_python_sdk/models/get_variations_resource.py +79 -0
- creatorsapi_python_sdk/models/get_variations_response_content.py +106 -0
- creatorsapi_python_sdk/models/image_size.py +96 -0
- creatorsapi_python_sdk/models/image_type.py +111 -0
- creatorsapi_python_sdk/models/images.py +105 -0
- creatorsapi_python_sdk/models/internal_server_exception_response_content.py +94 -0
- creatorsapi_python_sdk/models/item.py +138 -0
- creatorsapi_python_sdk/models/item_info.py +156 -0
- creatorsapi_python_sdk/models/items_result.py +100 -0
- creatorsapi_python_sdk/models/language_type.py +94 -0
- creatorsapi_python_sdk/models/languages.py +104 -0
- creatorsapi_python_sdk/models/list_feeds_response_content.py +100 -0
- creatorsapi_python_sdk/models/list_reports_response_content.py +100 -0
- creatorsapi_python_sdk/models/manufacture_info.py +106 -0
- creatorsapi_python_sdk/models/money.py +96 -0
- creatorsapi_python_sdk/models/multi_valued_attribute.py +96 -0
- creatorsapi_python_sdk/models/offer_availability_v2.py +98 -0
- creatorsapi_python_sdk/models/offer_condition_v2.py +96 -0
- creatorsapi_python_sdk/models/offer_listing_v2.py +133 -0
- creatorsapi_python_sdk/models/offer_loyalty_points_v2.py +92 -0
- creatorsapi_python_sdk/models/offer_merchant_info_v2.py +94 -0
- creatorsapi_python_sdk/models/offer_price_v2.py +113 -0
- creatorsapi_python_sdk/models/offer_saving_basis.py +101 -0
- creatorsapi_python_sdk/models/offer_savings.py +98 -0
- creatorsapi_python_sdk/models/offer_type.py +45 -0
- creatorsapi_python_sdk/models/offers_v2.py +100 -0
- creatorsapi_python_sdk/models/product_info.py +124 -0
- creatorsapi_python_sdk/models/rating.py +92 -0
- creatorsapi_python_sdk/models/refinement.py +104 -0
- creatorsapi_python_sdk/models/refinement_bin.py +94 -0
- creatorsapi_python_sdk/models/report_metadata.py +98 -0
- creatorsapi_python_sdk/models/resource_not_found_exception_response_content.py +98 -0
- creatorsapi_python_sdk/models/saving_basis_type.py +46 -0
- creatorsapi_python_sdk/models/search_items_request_content.py +242 -0
- creatorsapi_python_sdk/models/search_items_resource.py +77 -0
- creatorsapi_python_sdk/models/search_items_response_content.py +106 -0
- creatorsapi_python_sdk/models/search_refinements.py +110 -0
- creatorsapi_python_sdk/models/search_result.py +110 -0
- creatorsapi_python_sdk/models/single_boolean_valued_attribute.py +96 -0
- creatorsapi_python_sdk/models/single_integer_valued_attribute.py +96 -0
- creatorsapi_python_sdk/models/single_string_valued_attribute.py +96 -0
- creatorsapi_python_sdk/models/sort_by.py +48 -0
- creatorsapi_python_sdk/models/technical_info.py +102 -0
- creatorsapi_python_sdk/models/throttle_exception_response_content.py +98 -0
- creatorsapi_python_sdk/models/trade_in_info.py +98 -0
- creatorsapi_python_sdk/models/trade_in_price.py +96 -0
- creatorsapi_python_sdk/models/unauthorized_exception_reason.py +51 -0
- creatorsapi_python_sdk/models/unauthorized_exception_response_content.py +97 -0
- creatorsapi_python_sdk/models/unit_based_attribute.py +98 -0
- creatorsapi_python_sdk/models/validation_exception_field.py +94 -0
- creatorsapi_python_sdk/models/validation_exception_reason.py +48 -0
- creatorsapi_python_sdk/models/validation_exception_response_content.py +107 -0
- creatorsapi_python_sdk/models/variation_attribute.py +94 -0
- creatorsapi_python_sdk/models/variation_dimension.py +98 -0
- creatorsapi_python_sdk/models/variation_summary.py +104 -0
- creatorsapi_python_sdk/models/variations_result.py +106 -0
- creatorsapi_python_sdk/models/website_sales_rank.py +98 -0
- creatorsapi_python_sdk/py.typed +0 -0
- creatorsapi_python_sdk/rest.py +262 -0
|
@@ -0,0 +1,76 @@
|
|
|
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 GetItemsResource(str, Enum):
|
|
28
|
+
"""
|
|
29
|
+
GetItemsResource
|
|
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
|
+
PARENTASIN = 'parentASIN'
|
|
61
|
+
OFFERS_V2_DOT_LISTINGS_DOT_AVAILABILITY = 'offersV2.listings.availability'
|
|
62
|
+
OFFERS_V2_DOT_LISTINGS_DOT_CONDITION = 'offersV2.listings.condition'
|
|
63
|
+
OFFERS_V2_DOT_LISTINGS_DOT_DEAL_DETAILS = 'offersV2.listings.dealDetails'
|
|
64
|
+
OFFERS_V2_DOT_LISTINGS_DOT_IS_BUY_BOX_WINNER = 'offersV2.listings.isBuyBoxWinner'
|
|
65
|
+
OFFERS_V2_DOT_LISTINGS_DOT_LOYALTY_POINTS = 'offersV2.listings.loyaltyPoints'
|
|
66
|
+
OFFERS_V2_DOT_LISTINGS_DOT_MERCHANT_INFO = 'offersV2.listings.merchantInfo'
|
|
67
|
+
OFFERS_V2_DOT_LISTINGS_DOT_PRICE = 'offersV2.listings.price'
|
|
68
|
+
OFFERS_V2_DOT_LISTINGS_DOT_TYPE = 'offersV2.listings.type'
|
|
69
|
+
|
|
70
|
+
@classmethod
|
|
71
|
+
def from_json(cls, json_str: str) -> Self:
|
|
72
|
+
"""Create an instance of GetItemsResource from a JSON string"""
|
|
73
|
+
return cls(json.loads(json_str))
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
@@ -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.items_result import ItemsResult
|
|
30
|
+
from typing import Optional, Set
|
|
31
|
+
from typing_extensions import Self
|
|
32
|
+
|
|
33
|
+
class GetItemsResponseContent(BaseModel):
|
|
34
|
+
"""
|
|
35
|
+
The response object for the get items operation.
|
|
36
|
+
""" # noqa: E501
|
|
37
|
+
items_result: Optional[ItemsResult] = Field(default=None, alias="itemsResult")
|
|
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]] = ["itemsResult", "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 GetItemsResponseContent 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 items_result
|
|
80
|
+
if self.items_result:
|
|
81
|
+
_dict['itemsResult'] = self.items_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 GetItemsResponseContent 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
|
+
"itemsResult": ItemsResult.from_dict(obj["itemsResult"]) if obj.get("itemsResult") 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,93 @@
|
|
|
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
|
|
28
|
+
from typing_extensions import Annotated
|
|
29
|
+
from typing import Optional, Set
|
|
30
|
+
from typing_extensions import Self
|
|
31
|
+
|
|
32
|
+
class GetReportRequestContent(BaseModel):
|
|
33
|
+
"""
|
|
34
|
+
GetReportRequestContent
|
|
35
|
+
""" # noqa: E501
|
|
36
|
+
filename: Annotated[str, Field(min_length=1, strict=True)]
|
|
37
|
+
__properties: ClassVar[List[str]] = ["filename"]
|
|
38
|
+
|
|
39
|
+
model_config = ConfigDict(
|
|
40
|
+
populate_by_name=True,
|
|
41
|
+
validate_assignment=True,
|
|
42
|
+
protected_namespaces=(),
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def to_str(self) -> str:
|
|
47
|
+
"""Returns the string representation of the model using alias"""
|
|
48
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
49
|
+
|
|
50
|
+
def to_json(self) -> str:
|
|
51
|
+
"""Returns the JSON representation of the model using alias"""
|
|
52
|
+
return self.model_dump_json(by_alias=True, exclude_unset=True)
|
|
53
|
+
|
|
54
|
+
@classmethod
|
|
55
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
56
|
+
"""Create an instance of GetReportRequestContent from a JSON string"""
|
|
57
|
+
return cls.from_dict(json.loads(json_str))
|
|
58
|
+
|
|
59
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
60
|
+
"""Return the dictionary representation of the model using alias.
|
|
61
|
+
|
|
62
|
+
This has the following differences from calling pydantic's
|
|
63
|
+
`self.model_dump(by_alias=True)`:
|
|
64
|
+
|
|
65
|
+
* `None` is only added to the output dict for nullable fields that
|
|
66
|
+
were set at model initialization. Other fields with value `None`
|
|
67
|
+
are ignored.
|
|
68
|
+
"""
|
|
69
|
+
excluded_fields: Set[str] = set([
|
|
70
|
+
])
|
|
71
|
+
|
|
72
|
+
_dict = self.model_dump(
|
|
73
|
+
by_alias=True,
|
|
74
|
+
exclude=excluded_fields,
|
|
75
|
+
exclude_none=True,
|
|
76
|
+
)
|
|
77
|
+
return _dict
|
|
78
|
+
|
|
79
|
+
@classmethod
|
|
80
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
81
|
+
"""Create an instance of GetReportRequestContent from a dict"""
|
|
82
|
+
if obj is None:
|
|
83
|
+
return None
|
|
84
|
+
|
|
85
|
+
if not isinstance(obj, dict):
|
|
86
|
+
return cls.model_validate(obj)
|
|
87
|
+
|
|
88
|
+
_obj = cls.model_validate({
|
|
89
|
+
"filename": obj.get("filename")
|
|
90
|
+
})
|
|
91
|
+
return _obj
|
|
92
|
+
|
|
93
|
+
|
|
@@ -0,0 +1,92 @@
|
|
|
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, StrictStr
|
|
27
|
+
from typing import Any, ClassVar, Dict, List
|
|
28
|
+
from typing import Optional, Set
|
|
29
|
+
from typing_extensions import Self
|
|
30
|
+
|
|
31
|
+
class GetReportResponseContent(BaseModel):
|
|
32
|
+
"""
|
|
33
|
+
GetReportResponseContent
|
|
34
|
+
""" # noqa: E501
|
|
35
|
+
url: StrictStr
|
|
36
|
+
__properties: ClassVar[List[str]] = ["url"]
|
|
37
|
+
|
|
38
|
+
model_config = ConfigDict(
|
|
39
|
+
populate_by_name=True,
|
|
40
|
+
validate_assignment=True,
|
|
41
|
+
protected_namespaces=(),
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def to_str(self) -> str:
|
|
46
|
+
"""Returns the string representation of the model using alias"""
|
|
47
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
48
|
+
|
|
49
|
+
def to_json(self) -> str:
|
|
50
|
+
"""Returns the JSON representation of the model using alias"""
|
|
51
|
+
return self.model_dump_json(by_alias=True, exclude_unset=True)
|
|
52
|
+
|
|
53
|
+
@classmethod
|
|
54
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
55
|
+
"""Create an instance of GetReportResponseContent from a JSON string"""
|
|
56
|
+
return cls.from_dict(json.loads(json_str))
|
|
57
|
+
|
|
58
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
59
|
+
"""Return the dictionary representation of the model using alias.
|
|
60
|
+
|
|
61
|
+
This has the following differences from calling pydantic's
|
|
62
|
+
`self.model_dump(by_alias=True)`:
|
|
63
|
+
|
|
64
|
+
* `None` is only added to the output dict for nullable fields that
|
|
65
|
+
were set at model initialization. Other fields with value `None`
|
|
66
|
+
are ignored.
|
|
67
|
+
"""
|
|
68
|
+
excluded_fields: Set[str] = set([
|
|
69
|
+
])
|
|
70
|
+
|
|
71
|
+
_dict = self.model_dump(
|
|
72
|
+
by_alias=True,
|
|
73
|
+
exclude=excluded_fields,
|
|
74
|
+
exclude_none=True,
|
|
75
|
+
)
|
|
76
|
+
return _dict
|
|
77
|
+
|
|
78
|
+
@classmethod
|
|
79
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
80
|
+
"""Create an instance of GetReportResponseContent from a dict"""
|
|
81
|
+
if obj is None:
|
|
82
|
+
return None
|
|
83
|
+
|
|
84
|
+
if not isinstance(obj, dict):
|
|
85
|
+
return cls.model_validate(obj)
|
|
86
|
+
|
|
87
|
+
_obj = cls.model_validate({
|
|
88
|
+
"url": obj.get("url")
|
|
89
|
+
})
|
|
90
|
+
return _obj
|
|
91
|
+
|
|
92
|
+
|
|
@@ -0,0 +1,135 @@
|
|
|
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.condition import Condition
|
|
30
|
+
from creatorsapi_python_sdk.models.get_variations_resource import GetVariationsResource
|
|
31
|
+
from typing import Optional, Set
|
|
32
|
+
from typing_extensions import Self
|
|
33
|
+
|
|
34
|
+
class GetVariationsRequestContent(BaseModel):
|
|
35
|
+
"""
|
|
36
|
+
Input for the GetVariations operation to retrieve product variation information.
|
|
37
|
+
""" # noqa: E501
|
|
38
|
+
partner_tag: Annotated[str, Field(strict=True, max_length=64)] = Field(description="Unique Id for a partner. This is used to identify the associate tag for tracking affiliate commissions. Example: 'xyz-20'", alias="partnerTag")
|
|
39
|
+
asin: Annotated[str, Field(strict=True)] = Field(description="Amazon Standard Identification Number. This can be either a parent ASIN (to retrieve all variations) or a child ASIN (to retrieve sibling variations). Type: Non-Empty String. Example: 'B0199980K4'")
|
|
40
|
+
condition: Optional[Condition] = None
|
|
41
|
+
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.). Example: 'USD'", alias="currencyOfPreference")
|
|
42
|
+
languages_of_preference: Optional[Annotated[List[Annotated[str, Field(strict=True, max_length=1000)]], Field(max_length=1)]] = Field(default=None, description="Languages of preference in which the information should be returned in response. By default the information is returned in the default language of the marketplace. Expected locale format is the ISO 639 language code followed by underscore followed by the ISO 3166 country code (i.e. en_US, fr_CA etc.). Currently only single language of preference is supported. Example: ['en_US']", alias="languagesOfPreference")
|
|
43
|
+
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.")
|
|
44
|
+
resources: Optional[Annotated[List[GetVariationsResource], Field(max_length=100)]] = Field(default=None, description="Specifies the types of values to return. You can specify multiple resources in one request. Supports high-level resources such as: - BrowseNodeInfo resources (browse nodes, ancestor, sales rank, website sales rank) - Images resources (primary and variant images in small, medium, large sizes) - ItemInfo resources (title, features, product info, technical info, etc.) - OffersV2 resources (availability, condition, price, merchant info, deal details) - VariationSummary resources (price range, variation dimensions) - ParentASIN Default: ['ItemInfo.Title']")
|
|
45
|
+
variation_count: Optional[Union[Annotated[float, Field(le=10, strict=True, ge=1)], Annotated[int, Field(le=10, strict=True, ge=1)]]] = Field(default=None, description="Number of variations to be returned per page in GetVariations. By default, GetVariations returns 10 variations per page. Valid range: 1-10. Type: Positive Integer Less than or equal to 10 Default: 10 Example: 10 Use this parameter to control how many variations are returned in each response. When combined with VariationPage, you can paginate through all available variations.", alias="variationCount")
|
|
46
|
+
variation_page: Optional[Union[Annotated[float, Field(strict=True, ge=1)], Annotated[int, Field(strict=True, ge=1)]]] = Field(default=None, description="Page number of variations returned by GetVariations. By default, GetVariations returns the first page. Use VariationPage to return a subsection of the response. By default, there are 10 variations per page (configurable via VariationCount). Type: Positive Integer Default: 1 Example: 1", alias="variationPage")
|
|
47
|
+
__properties: ClassVar[List[str]] = ["partnerTag", "asin", "condition", "currencyOfPreference", "languagesOfPreference", "properties", "resources", "variationCount", "variationPage"]
|
|
48
|
+
|
|
49
|
+
@field_validator('partner_tag')
|
|
50
|
+
def partner_tag_validate_regular_expression(cls, value):
|
|
51
|
+
"""Validates the regular expression"""
|
|
52
|
+
if not re.match(r".*\S.*", value):
|
|
53
|
+
raise ValueError(r"must validate the regular expression /.*\S.*/")
|
|
54
|
+
return value
|
|
55
|
+
|
|
56
|
+
@field_validator('asin')
|
|
57
|
+
def asin_validate_regular_expression(cls, value):
|
|
58
|
+
"""Validates the regular expression"""
|
|
59
|
+
if not re.match(r"^[0-9]{9}[0-9X]|[A-Z][A-Z0-9]{9}$", value):
|
|
60
|
+
raise ValueError(r"must validate the regular expression /^[0-9]{9}[0-9X]|[A-Z][A-Z0-9]{9}$/")
|
|
61
|
+
return value
|
|
62
|
+
|
|
63
|
+
@field_validator('currency_of_preference')
|
|
64
|
+
def currency_of_preference_validate_regular_expression(cls, value):
|
|
65
|
+
"""Validates the regular expression"""
|
|
66
|
+
if value is None:
|
|
67
|
+
return value
|
|
68
|
+
|
|
69
|
+
if not re.match(r".*\S.*", value):
|
|
70
|
+
raise ValueError(r"must validate the regular expression /.*\S.*/")
|
|
71
|
+
return value
|
|
72
|
+
|
|
73
|
+
model_config = ConfigDict(
|
|
74
|
+
populate_by_name=True,
|
|
75
|
+
validate_assignment=True,
|
|
76
|
+
protected_namespaces=(),
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def to_str(self) -> str:
|
|
81
|
+
"""Returns the string representation of the model using alias"""
|
|
82
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
83
|
+
|
|
84
|
+
def to_json(self) -> str:
|
|
85
|
+
"""Returns the JSON representation of the model using alias"""
|
|
86
|
+
return self.model_dump_json(by_alias=True, exclude_unset=True)
|
|
87
|
+
|
|
88
|
+
@classmethod
|
|
89
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
90
|
+
"""Create an instance of GetVariationsRequestContent from a JSON string"""
|
|
91
|
+
return cls.from_dict(json.loads(json_str))
|
|
92
|
+
|
|
93
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
94
|
+
"""Return the dictionary representation of the model using alias.
|
|
95
|
+
|
|
96
|
+
This has the following differences from calling pydantic's
|
|
97
|
+
`self.model_dump(by_alias=True)`:
|
|
98
|
+
|
|
99
|
+
* `None` is only added to the output dict for nullable fields that
|
|
100
|
+
were set at model initialization. Other fields with value `None`
|
|
101
|
+
are ignored.
|
|
102
|
+
"""
|
|
103
|
+
excluded_fields: Set[str] = set([
|
|
104
|
+
])
|
|
105
|
+
|
|
106
|
+
_dict = self.model_dump(
|
|
107
|
+
by_alias=True,
|
|
108
|
+
exclude=excluded_fields,
|
|
109
|
+
exclude_none=True,
|
|
110
|
+
)
|
|
111
|
+
return _dict
|
|
112
|
+
|
|
113
|
+
@classmethod
|
|
114
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
115
|
+
"""Create an instance of GetVariationsRequestContent from a dict"""
|
|
116
|
+
if obj is None:
|
|
117
|
+
return None
|
|
118
|
+
|
|
119
|
+
if not isinstance(obj, dict):
|
|
120
|
+
return cls.model_validate(obj)
|
|
121
|
+
|
|
122
|
+
_obj = cls.model_validate({
|
|
123
|
+
"partnerTag": obj.get("partnerTag"),
|
|
124
|
+
"asin": obj.get("asin"),
|
|
125
|
+
"condition": obj.get("condition"),
|
|
126
|
+
"currencyOfPreference": obj.get("currencyOfPreference"),
|
|
127
|
+
"languagesOfPreference": obj.get("languagesOfPreference"),
|
|
128
|
+
"properties": obj.get("properties"),
|
|
129
|
+
"resources": obj.get("resources"),
|
|
130
|
+
"variationCount": obj.get("variationCount"),
|
|
131
|
+
"variationPage": obj.get("variationPage")
|
|
132
|
+
})
|
|
133
|
+
return _obj
|
|
134
|
+
|
|
135
|
+
|
|
@@ -0,0 +1,79 @@
|
|
|
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 GetVariationsResource(str, Enum):
|
|
28
|
+
"""
|
|
29
|
+
GetVariationsResource
|
|
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
|
+
PARENTASIN = 'parentASIN'
|
|
61
|
+
OFFERS_V2_DOT_LISTINGS_DOT_AVAILABILITY = 'offersV2.listings.availability'
|
|
62
|
+
OFFERS_V2_DOT_LISTINGS_DOT_CONDITION = 'offersV2.listings.condition'
|
|
63
|
+
OFFERS_V2_DOT_LISTINGS_DOT_DEAL_DETAILS = 'offersV2.listings.dealDetails'
|
|
64
|
+
OFFERS_V2_DOT_LISTINGS_DOT_IS_BUY_BOX_WINNER = 'offersV2.listings.isBuyBoxWinner'
|
|
65
|
+
OFFERS_V2_DOT_LISTINGS_DOT_LOYALTY_POINTS = 'offersV2.listings.loyaltyPoints'
|
|
66
|
+
OFFERS_V2_DOT_LISTINGS_DOT_MERCHANT_INFO = 'offersV2.listings.merchantInfo'
|
|
67
|
+
OFFERS_V2_DOT_LISTINGS_DOT_PRICE = 'offersV2.listings.price'
|
|
68
|
+
OFFERS_V2_DOT_LISTINGS_DOT_TYPE = 'offersV2.listings.type'
|
|
69
|
+
VARIATION_SUMMARY_DOT_PRICE_DOT_HIGHEST_PRICE = 'variationSummary.price.highestPrice'
|
|
70
|
+
VARIATION_SUMMARY_DOT_PRICE_DOT_LOWEST_PRICE = 'variationSummary.price.lowestPrice'
|
|
71
|
+
VARIATION_SUMMARY_DOT_VARIATION_DIMENSION = 'variationSummary.variationDimension'
|
|
72
|
+
|
|
73
|
+
@classmethod
|
|
74
|
+
def from_json(cls, json_str: str) -> Self:
|
|
75
|
+
"""Create an instance of GetVariationsResource from a JSON string"""
|
|
76
|
+
return cls(json.loads(json_str))
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|