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,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.single_string_valued_attribute import SingleStringValuedAttribute
|
|
29
|
+
from typing import Optional, Set
|
|
30
|
+
from typing_extensions import Self
|
|
31
|
+
|
|
32
|
+
class ManufactureInfo(BaseModel):
|
|
33
|
+
"""
|
|
34
|
+
Container for set of attributes that specifies manufacturing related information of a product.
|
|
35
|
+
""" # noqa: E501
|
|
36
|
+
item_part_number: Optional[SingleStringValuedAttribute] = Field(default=None, alias="itemPartNumber")
|
|
37
|
+
model: Optional[SingleStringValuedAttribute] = None
|
|
38
|
+
warranty: Optional[SingleStringValuedAttribute] = None
|
|
39
|
+
__properties: ClassVar[List[str]] = ["itemPartNumber", "model", "warranty"]
|
|
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 ManufactureInfo 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 item_part_number
|
|
80
|
+
if self.item_part_number:
|
|
81
|
+
_dict['itemPartNumber'] = self.item_part_number.to_dict()
|
|
82
|
+
# override the default output from pydantic by calling `to_dict()` of model
|
|
83
|
+
if self.model:
|
|
84
|
+
_dict['model'] = self.model.to_dict()
|
|
85
|
+
# override the default output from pydantic by calling `to_dict()` of warranty
|
|
86
|
+
if self.warranty:
|
|
87
|
+
_dict['warranty'] = self.warranty.to_dict()
|
|
88
|
+
return _dict
|
|
89
|
+
|
|
90
|
+
@classmethod
|
|
91
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
92
|
+
"""Create an instance of ManufactureInfo from a dict"""
|
|
93
|
+
if obj is None:
|
|
94
|
+
return None
|
|
95
|
+
|
|
96
|
+
if not isinstance(obj, dict):
|
|
97
|
+
return cls.model_validate(obj)
|
|
98
|
+
|
|
99
|
+
_obj = cls.model_validate({
|
|
100
|
+
"itemPartNumber": SingleStringValuedAttribute.from_dict(obj["itemPartNumber"]) if obj.get("itemPartNumber") is not None else None,
|
|
101
|
+
"model": SingleStringValuedAttribute.from_dict(obj["model"]) if obj.get("model") is not None else None,
|
|
102
|
+
"warranty": SingleStringValuedAttribute.from_dict(obj["warranty"]) if obj.get("warranty") is not None else None
|
|
103
|
+
})
|
|
104
|
+
return _obj
|
|
105
|
+
|
|
106
|
+
|
|
@@ -0,0 +1,96 @@
|
|
|
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 typing import Optional, Set
|
|
29
|
+
from typing_extensions import Self
|
|
30
|
+
|
|
31
|
+
class Money(BaseModel):
|
|
32
|
+
"""
|
|
33
|
+
Used to return the information about the Money value or amount. Consists of the integral value, the currency codes and the formatted price which can be used for display purposes.
|
|
34
|
+
""" # noqa: E501
|
|
35
|
+
amount: Optional[Union[StrictFloat, StrictInt]] = None
|
|
36
|
+
currency: Optional[StrictStr] = None
|
|
37
|
+
display_amount: Optional[StrictStr] = Field(default=None, alias="displayAmount")
|
|
38
|
+
__properties: ClassVar[List[str]] = ["amount", "currency", "displayAmount"]
|
|
39
|
+
|
|
40
|
+
model_config = ConfigDict(
|
|
41
|
+
populate_by_name=True,
|
|
42
|
+
validate_assignment=True,
|
|
43
|
+
protected_namespaces=(),
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def to_str(self) -> str:
|
|
48
|
+
"""Returns the string representation of the model using alias"""
|
|
49
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
50
|
+
|
|
51
|
+
def to_json(self) -> str:
|
|
52
|
+
"""Returns the JSON representation of the model using alias"""
|
|
53
|
+
return self.model_dump_json(by_alias=True, exclude_unset=True)
|
|
54
|
+
|
|
55
|
+
@classmethod
|
|
56
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
57
|
+
"""Create an instance of Money from a JSON string"""
|
|
58
|
+
return cls.from_dict(json.loads(json_str))
|
|
59
|
+
|
|
60
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
61
|
+
"""Return the dictionary representation of the model using alias.
|
|
62
|
+
|
|
63
|
+
This has the following differences from calling pydantic's
|
|
64
|
+
`self.model_dump(by_alias=True)`:
|
|
65
|
+
|
|
66
|
+
* `None` is only added to the output dict for nullable fields that
|
|
67
|
+
were set at model initialization. Other fields with value `None`
|
|
68
|
+
are ignored.
|
|
69
|
+
"""
|
|
70
|
+
excluded_fields: Set[str] = set([
|
|
71
|
+
])
|
|
72
|
+
|
|
73
|
+
_dict = self.model_dump(
|
|
74
|
+
by_alias=True,
|
|
75
|
+
exclude=excluded_fields,
|
|
76
|
+
exclude_none=True,
|
|
77
|
+
)
|
|
78
|
+
return _dict
|
|
79
|
+
|
|
80
|
+
@classmethod
|
|
81
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
82
|
+
"""Create an instance of Money from a dict"""
|
|
83
|
+
if obj is None:
|
|
84
|
+
return None
|
|
85
|
+
|
|
86
|
+
if not isinstance(obj, dict):
|
|
87
|
+
return cls.model_validate(obj)
|
|
88
|
+
|
|
89
|
+
_obj = cls.model_validate({
|
|
90
|
+
"amount": obj.get("amount"),
|
|
91
|
+
"currency": obj.get("currency"),
|
|
92
|
+
"displayAmount": obj.get("displayAmount")
|
|
93
|
+
})
|
|
94
|
+
return _obj
|
|
95
|
+
|
|
96
|
+
|
|
@@ -0,0 +1,96 @@
|
|
|
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, StrictStr
|
|
27
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
28
|
+
from typing import Optional, Set
|
|
29
|
+
from typing_extensions import Self
|
|
30
|
+
|
|
31
|
+
class MultiValuedAttribute(BaseModel):
|
|
32
|
+
"""
|
|
33
|
+
Container for attributes of multi-valued type.
|
|
34
|
+
""" # noqa: E501
|
|
35
|
+
display_values: Optional[List[StrictStr]] = Field(default=None, description="List of primitive string type.", alias="displayValues")
|
|
36
|
+
label: Optional[StrictStr] = None
|
|
37
|
+
locale: Optional[StrictStr] = None
|
|
38
|
+
__properties: ClassVar[List[str]] = ["displayValues", "label", "locale"]
|
|
39
|
+
|
|
40
|
+
model_config = ConfigDict(
|
|
41
|
+
populate_by_name=True,
|
|
42
|
+
validate_assignment=True,
|
|
43
|
+
protected_namespaces=(),
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def to_str(self) -> str:
|
|
48
|
+
"""Returns the string representation of the model using alias"""
|
|
49
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
50
|
+
|
|
51
|
+
def to_json(self) -> str:
|
|
52
|
+
"""Returns the JSON representation of the model using alias"""
|
|
53
|
+
return self.model_dump_json(by_alias=True, exclude_unset=True)
|
|
54
|
+
|
|
55
|
+
@classmethod
|
|
56
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
57
|
+
"""Create an instance of MultiValuedAttribute from a JSON string"""
|
|
58
|
+
return cls.from_dict(json.loads(json_str))
|
|
59
|
+
|
|
60
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
61
|
+
"""Return the dictionary representation of the model using alias.
|
|
62
|
+
|
|
63
|
+
This has the following differences from calling pydantic's
|
|
64
|
+
`self.model_dump(by_alias=True)`:
|
|
65
|
+
|
|
66
|
+
* `None` is only added to the output dict for nullable fields that
|
|
67
|
+
were set at model initialization. Other fields with value `None`
|
|
68
|
+
are ignored.
|
|
69
|
+
"""
|
|
70
|
+
excluded_fields: Set[str] = set([
|
|
71
|
+
])
|
|
72
|
+
|
|
73
|
+
_dict = self.model_dump(
|
|
74
|
+
by_alias=True,
|
|
75
|
+
exclude=excluded_fields,
|
|
76
|
+
exclude_none=True,
|
|
77
|
+
)
|
|
78
|
+
return _dict
|
|
79
|
+
|
|
80
|
+
@classmethod
|
|
81
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
82
|
+
"""Create an instance of MultiValuedAttribute from a dict"""
|
|
83
|
+
if obj is None:
|
|
84
|
+
return None
|
|
85
|
+
|
|
86
|
+
if not isinstance(obj, dict):
|
|
87
|
+
return cls.model_validate(obj)
|
|
88
|
+
|
|
89
|
+
_obj = cls.model_validate({
|
|
90
|
+
"displayValues": obj.get("displayValues"),
|
|
91
|
+
"label": obj.get("label"),
|
|
92
|
+
"locale": obj.get("locale")
|
|
93
|
+
})
|
|
94
|
+
return _obj
|
|
95
|
+
|
|
96
|
+
|
|
@@ -0,0 +1,98 @@
|
|
|
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 typing import Optional, Set
|
|
29
|
+
from typing_extensions import Self
|
|
30
|
+
|
|
31
|
+
class OfferAvailabilityV2(BaseModel):
|
|
32
|
+
"""
|
|
33
|
+
Specifies availability information about an offer.
|
|
34
|
+
""" # noqa: E501
|
|
35
|
+
message: Optional[StrictStr] = None
|
|
36
|
+
max_order_quantity: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="maxOrderQuantity")
|
|
37
|
+
min_order_quantity: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="minOrderQuantity")
|
|
38
|
+
type: Optional[StrictStr] = None
|
|
39
|
+
__properties: ClassVar[List[str]] = ["message", "maxOrderQuantity", "minOrderQuantity", "type"]
|
|
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 OfferAvailabilityV2 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
|
+
return _dict
|
|
80
|
+
|
|
81
|
+
@classmethod
|
|
82
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
83
|
+
"""Create an instance of OfferAvailabilityV2 from a dict"""
|
|
84
|
+
if obj is None:
|
|
85
|
+
return None
|
|
86
|
+
|
|
87
|
+
if not isinstance(obj, dict):
|
|
88
|
+
return cls.model_validate(obj)
|
|
89
|
+
|
|
90
|
+
_obj = cls.model_validate({
|
|
91
|
+
"message": obj.get("message"),
|
|
92
|
+
"maxOrderQuantity": obj.get("maxOrderQuantity"),
|
|
93
|
+
"minOrderQuantity": obj.get("minOrderQuantity"),
|
|
94
|
+
"type": obj.get("type")
|
|
95
|
+
})
|
|
96
|
+
return _obj
|
|
97
|
+
|
|
98
|
+
|
|
@@ -0,0 +1,96 @@
|
|
|
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, StrictStr
|
|
27
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
28
|
+
from typing import Optional, Set
|
|
29
|
+
from typing_extensions import Self
|
|
30
|
+
|
|
31
|
+
class OfferConditionV2(BaseModel):
|
|
32
|
+
"""
|
|
33
|
+
Specifies the condition of the offer.
|
|
34
|
+
""" # noqa: E501
|
|
35
|
+
value: Optional[StrictStr] = None
|
|
36
|
+
sub_condition: Optional[StrictStr] = Field(default=None, alias="subCondition")
|
|
37
|
+
condition_note: Optional[StrictStr] = Field(default=None, alias="conditionNote")
|
|
38
|
+
__properties: ClassVar[List[str]] = ["value", "subCondition", "conditionNote"]
|
|
39
|
+
|
|
40
|
+
model_config = ConfigDict(
|
|
41
|
+
populate_by_name=True,
|
|
42
|
+
validate_assignment=True,
|
|
43
|
+
protected_namespaces=(),
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def to_str(self) -> str:
|
|
48
|
+
"""Returns the string representation of the model using alias"""
|
|
49
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
50
|
+
|
|
51
|
+
def to_json(self) -> str:
|
|
52
|
+
"""Returns the JSON representation of the model using alias"""
|
|
53
|
+
return self.model_dump_json(by_alias=True, exclude_unset=True)
|
|
54
|
+
|
|
55
|
+
@classmethod
|
|
56
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
57
|
+
"""Create an instance of OfferConditionV2 from a JSON string"""
|
|
58
|
+
return cls.from_dict(json.loads(json_str))
|
|
59
|
+
|
|
60
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
61
|
+
"""Return the dictionary representation of the model using alias.
|
|
62
|
+
|
|
63
|
+
This has the following differences from calling pydantic's
|
|
64
|
+
`self.model_dump(by_alias=True)`:
|
|
65
|
+
|
|
66
|
+
* `None` is only added to the output dict for nullable fields that
|
|
67
|
+
were set at model initialization. Other fields with value `None`
|
|
68
|
+
are ignored.
|
|
69
|
+
"""
|
|
70
|
+
excluded_fields: Set[str] = set([
|
|
71
|
+
])
|
|
72
|
+
|
|
73
|
+
_dict = self.model_dump(
|
|
74
|
+
by_alias=True,
|
|
75
|
+
exclude=excluded_fields,
|
|
76
|
+
exclude_none=True,
|
|
77
|
+
)
|
|
78
|
+
return _dict
|
|
79
|
+
|
|
80
|
+
@classmethod
|
|
81
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
82
|
+
"""Create an instance of OfferConditionV2 from a dict"""
|
|
83
|
+
if obj is None:
|
|
84
|
+
return None
|
|
85
|
+
|
|
86
|
+
if not isinstance(obj, dict):
|
|
87
|
+
return cls.model_validate(obj)
|
|
88
|
+
|
|
89
|
+
_obj = cls.model_validate({
|
|
90
|
+
"value": obj.get("value"),
|
|
91
|
+
"subCondition": obj.get("subCondition"),
|
|
92
|
+
"conditionNote": obj.get("conditionNote")
|
|
93
|
+
})
|
|
94
|
+
return _obj
|
|
95
|
+
|
|
96
|
+
|
|
@@ -0,0 +1,133 @@
|
|
|
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, StrictBool
|
|
27
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
28
|
+
from creatorsapi_python_sdk.models.deal_details import DealDetails
|
|
29
|
+
from creatorsapi_python_sdk.models.offer_availability_v2 import OfferAvailabilityV2
|
|
30
|
+
from creatorsapi_python_sdk.models.offer_condition_v2 import OfferConditionV2
|
|
31
|
+
from creatorsapi_python_sdk.models.offer_loyalty_points_v2 import OfferLoyaltyPointsV2
|
|
32
|
+
from creatorsapi_python_sdk.models.offer_merchant_info_v2 import OfferMerchantInfoV2
|
|
33
|
+
from creatorsapi_python_sdk.models.offer_price_v2 import OfferPriceV2
|
|
34
|
+
from creatorsapi_python_sdk.models.offer_type import OfferType
|
|
35
|
+
from typing import Optional, Set
|
|
36
|
+
from typing_extensions import Self
|
|
37
|
+
|
|
38
|
+
class OfferListingV2(BaseModel):
|
|
39
|
+
"""
|
|
40
|
+
Specifies about various offer listings associated with the product.
|
|
41
|
+
""" # noqa: E501
|
|
42
|
+
availability: Optional[OfferAvailabilityV2] = None
|
|
43
|
+
condition: Optional[OfferConditionV2] = None
|
|
44
|
+
deal_details: Optional[DealDetails] = Field(default=None, alias="dealDetails")
|
|
45
|
+
is_buy_box_winner: Optional[StrictBool] = Field(default=None, alias="isBuyBoxWinner")
|
|
46
|
+
loyalty_points: Optional[OfferLoyaltyPointsV2] = Field(default=None, alias="loyaltyPoints")
|
|
47
|
+
merchant_info: Optional[OfferMerchantInfoV2] = Field(default=None, alias="merchantInfo")
|
|
48
|
+
price: Optional[OfferPriceV2] = None
|
|
49
|
+
type: Optional[OfferType] = None
|
|
50
|
+
violates_map: Optional[StrictBool] = Field(default=None, alias="violatesMAP")
|
|
51
|
+
__properties: ClassVar[List[str]] = ["availability", "condition", "dealDetails", "isBuyBoxWinner", "loyaltyPoints", "merchantInfo", "price", "type", "violatesMAP"]
|
|
52
|
+
|
|
53
|
+
model_config = ConfigDict(
|
|
54
|
+
populate_by_name=True,
|
|
55
|
+
validate_assignment=True,
|
|
56
|
+
protected_namespaces=(),
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def to_str(self) -> str:
|
|
61
|
+
"""Returns the string representation of the model using alias"""
|
|
62
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
63
|
+
|
|
64
|
+
def to_json(self) -> str:
|
|
65
|
+
"""Returns the JSON representation of the model using alias"""
|
|
66
|
+
return self.model_dump_json(by_alias=True, exclude_unset=True)
|
|
67
|
+
|
|
68
|
+
@classmethod
|
|
69
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
70
|
+
"""Create an instance of OfferListingV2 from a JSON string"""
|
|
71
|
+
return cls.from_dict(json.loads(json_str))
|
|
72
|
+
|
|
73
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
74
|
+
"""Return the dictionary representation of the model using alias.
|
|
75
|
+
|
|
76
|
+
This has the following differences from calling pydantic's
|
|
77
|
+
`self.model_dump(by_alias=True)`:
|
|
78
|
+
|
|
79
|
+
* `None` is only added to the output dict for nullable fields that
|
|
80
|
+
were set at model initialization. Other fields with value `None`
|
|
81
|
+
are ignored.
|
|
82
|
+
"""
|
|
83
|
+
excluded_fields: Set[str] = set([
|
|
84
|
+
])
|
|
85
|
+
|
|
86
|
+
_dict = self.model_dump(
|
|
87
|
+
by_alias=True,
|
|
88
|
+
exclude=excluded_fields,
|
|
89
|
+
exclude_none=True,
|
|
90
|
+
)
|
|
91
|
+
# override the default output from pydantic by calling `to_dict()` of availability
|
|
92
|
+
if self.availability:
|
|
93
|
+
_dict['availability'] = self.availability.to_dict()
|
|
94
|
+
# override the default output from pydantic by calling `to_dict()` of condition
|
|
95
|
+
if self.condition:
|
|
96
|
+
_dict['condition'] = self.condition.to_dict()
|
|
97
|
+
# override the default output from pydantic by calling `to_dict()` of deal_details
|
|
98
|
+
if self.deal_details:
|
|
99
|
+
_dict['dealDetails'] = self.deal_details.to_dict()
|
|
100
|
+
# override the default output from pydantic by calling `to_dict()` of loyalty_points
|
|
101
|
+
if self.loyalty_points:
|
|
102
|
+
_dict['loyaltyPoints'] = self.loyalty_points.to_dict()
|
|
103
|
+
# override the default output from pydantic by calling `to_dict()` of merchant_info
|
|
104
|
+
if self.merchant_info:
|
|
105
|
+
_dict['merchantInfo'] = self.merchant_info.to_dict()
|
|
106
|
+
# override the default output from pydantic by calling `to_dict()` of price
|
|
107
|
+
if self.price:
|
|
108
|
+
_dict['price'] = self.price.to_dict()
|
|
109
|
+
return _dict
|
|
110
|
+
|
|
111
|
+
@classmethod
|
|
112
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
113
|
+
"""Create an instance of OfferListingV2 from a dict"""
|
|
114
|
+
if obj is None:
|
|
115
|
+
return None
|
|
116
|
+
|
|
117
|
+
if not isinstance(obj, dict):
|
|
118
|
+
return cls.model_validate(obj)
|
|
119
|
+
|
|
120
|
+
_obj = cls.model_validate({
|
|
121
|
+
"availability": OfferAvailabilityV2.from_dict(obj["availability"]) if obj.get("availability") is not None else None,
|
|
122
|
+
"condition": OfferConditionV2.from_dict(obj["condition"]) if obj.get("condition") is not None else None,
|
|
123
|
+
"dealDetails": DealDetails.from_dict(obj["dealDetails"]) if obj.get("dealDetails") is not None else None,
|
|
124
|
+
"isBuyBoxWinner": obj.get("isBuyBoxWinner"),
|
|
125
|
+
"loyaltyPoints": OfferLoyaltyPointsV2.from_dict(obj["loyaltyPoints"]) if obj.get("loyaltyPoints") is not None else None,
|
|
126
|
+
"merchantInfo": OfferMerchantInfoV2.from_dict(obj["merchantInfo"]) if obj.get("merchantInfo") is not None else None,
|
|
127
|
+
"price": OfferPriceV2.from_dict(obj["price"]) if obj.get("price") is not None else None,
|
|
128
|
+
"type": obj.get("type"),
|
|
129
|
+
"violatesMAP": obj.get("violatesMAP")
|
|
130
|
+
})
|
|
131
|
+
return _obj
|
|
132
|
+
|
|
133
|
+
|