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,110 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
# flake8: noqa
|
|
4
|
+
"""
|
|
5
|
+
Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
6
|
+
|
|
7
|
+
Licensed under the Apache License, Version 2.0 (the "License").
|
|
8
|
+
You may not use this file except in compliance with the License.
|
|
9
|
+
A copy of the License is located at
|
|
10
|
+
|
|
11
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
|
|
13
|
+
or in the "license" file accompanying this file. This file is distributed
|
|
14
|
+
on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
|
15
|
+
express or implied. See the License for the specific language governing
|
|
16
|
+
permissions and limitations under the License.
|
|
17
|
+
|
|
18
|
+
""" # noqa: E501
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
# import models into model package
|
|
22
|
+
from creatorsapi_python_sdk.models.access_denied_exception_response_content import AccessDeniedExceptionResponseContent
|
|
23
|
+
from creatorsapi_python_sdk.models.access_denied_reason import AccessDeniedReason
|
|
24
|
+
from creatorsapi_python_sdk.models.availability import Availability
|
|
25
|
+
from creatorsapi_python_sdk.models.browse_node import BrowseNode
|
|
26
|
+
from creatorsapi_python_sdk.models.browse_node_ancestor import BrowseNodeAncestor
|
|
27
|
+
from creatorsapi_python_sdk.models.browse_node_child import BrowseNodeChild
|
|
28
|
+
from creatorsapi_python_sdk.models.browse_node_info import BrowseNodeInfo
|
|
29
|
+
from creatorsapi_python_sdk.models.browse_nodes_result import BrowseNodesResult
|
|
30
|
+
from creatorsapi_python_sdk.models.by_line_info import ByLineInfo
|
|
31
|
+
from creatorsapi_python_sdk.models.classifications import Classifications
|
|
32
|
+
from creatorsapi_python_sdk.models.condition import Condition
|
|
33
|
+
from creatorsapi_python_sdk.models.content_info import ContentInfo
|
|
34
|
+
from creatorsapi_python_sdk.models.content_rating import ContentRating
|
|
35
|
+
from creatorsapi_python_sdk.models.contributor import Contributor
|
|
36
|
+
from creatorsapi_python_sdk.models.customer_reviews import CustomerReviews
|
|
37
|
+
from creatorsapi_python_sdk.models.deal_details import DealDetails
|
|
38
|
+
from creatorsapi_python_sdk.models.delivery_flag import DeliveryFlag
|
|
39
|
+
from creatorsapi_python_sdk.models.dimension_based_attribute import DimensionBasedAttribute
|
|
40
|
+
from creatorsapi_python_sdk.models.error_data import ErrorData
|
|
41
|
+
from creatorsapi_python_sdk.models.external_ids import ExternalIds
|
|
42
|
+
from creatorsapi_python_sdk.models.feed import Feed
|
|
43
|
+
from creatorsapi_python_sdk.models.get_browse_nodes_request_content import GetBrowseNodesRequestContent
|
|
44
|
+
from creatorsapi_python_sdk.models.get_browse_nodes_resource import GetBrowseNodesResource
|
|
45
|
+
from creatorsapi_python_sdk.models.get_browse_nodes_response_content import GetBrowseNodesResponseContent
|
|
46
|
+
from creatorsapi_python_sdk.models.get_feed_request_content import GetFeedRequestContent
|
|
47
|
+
from creatorsapi_python_sdk.models.get_feed_response_content import GetFeedResponseContent
|
|
48
|
+
from creatorsapi_python_sdk.models.get_items_request_content import GetItemsRequestContent
|
|
49
|
+
from creatorsapi_python_sdk.models.get_items_resource import GetItemsResource
|
|
50
|
+
from creatorsapi_python_sdk.models.get_items_response_content import GetItemsResponseContent
|
|
51
|
+
from creatorsapi_python_sdk.models.get_report_request_content import GetReportRequestContent
|
|
52
|
+
from creatorsapi_python_sdk.models.get_report_response_content import GetReportResponseContent
|
|
53
|
+
from creatorsapi_python_sdk.models.get_variations_request_content import GetVariationsRequestContent
|
|
54
|
+
from creatorsapi_python_sdk.models.get_variations_resource import GetVariationsResource
|
|
55
|
+
from creatorsapi_python_sdk.models.get_variations_response_content import GetVariationsResponseContent
|
|
56
|
+
from creatorsapi_python_sdk.models.image_size import ImageSize
|
|
57
|
+
from creatorsapi_python_sdk.models.image_type import ImageType
|
|
58
|
+
from creatorsapi_python_sdk.models.images import Images
|
|
59
|
+
from creatorsapi_python_sdk.models.internal_server_exception_response_content import InternalServerExceptionResponseContent
|
|
60
|
+
from creatorsapi_python_sdk.models.item import Item
|
|
61
|
+
from creatorsapi_python_sdk.models.item_info import ItemInfo
|
|
62
|
+
from creatorsapi_python_sdk.models.items_result import ItemsResult
|
|
63
|
+
from creatorsapi_python_sdk.models.language_type import LanguageType
|
|
64
|
+
from creatorsapi_python_sdk.models.languages import Languages
|
|
65
|
+
from creatorsapi_python_sdk.models.list_feeds_response_content import ListFeedsResponseContent
|
|
66
|
+
from creatorsapi_python_sdk.models.list_reports_response_content import ListReportsResponseContent
|
|
67
|
+
from creatorsapi_python_sdk.models.manufacture_info import ManufactureInfo
|
|
68
|
+
from creatorsapi_python_sdk.models.money import Money
|
|
69
|
+
from creatorsapi_python_sdk.models.multi_valued_attribute import MultiValuedAttribute
|
|
70
|
+
from creatorsapi_python_sdk.models.offer_availability_v2 import OfferAvailabilityV2
|
|
71
|
+
from creatorsapi_python_sdk.models.offer_condition_v2 import OfferConditionV2
|
|
72
|
+
from creatorsapi_python_sdk.models.offer_listing_v2 import OfferListingV2
|
|
73
|
+
from creatorsapi_python_sdk.models.offer_loyalty_points_v2 import OfferLoyaltyPointsV2
|
|
74
|
+
from creatorsapi_python_sdk.models.offer_merchant_info_v2 import OfferMerchantInfoV2
|
|
75
|
+
from creatorsapi_python_sdk.models.offer_price_v2 import OfferPriceV2
|
|
76
|
+
from creatorsapi_python_sdk.models.offer_saving_basis import OfferSavingBasis
|
|
77
|
+
from creatorsapi_python_sdk.models.offer_savings import OfferSavings
|
|
78
|
+
from creatorsapi_python_sdk.models.offer_type import OfferType
|
|
79
|
+
from creatorsapi_python_sdk.models.offers_v2 import OffersV2
|
|
80
|
+
from creatorsapi_python_sdk.models.product_info import ProductInfo
|
|
81
|
+
from creatorsapi_python_sdk.models.rating import Rating
|
|
82
|
+
from creatorsapi_python_sdk.models.refinement import Refinement
|
|
83
|
+
from creatorsapi_python_sdk.models.refinement_bin import RefinementBin
|
|
84
|
+
from creatorsapi_python_sdk.models.report_metadata import ReportMetadata
|
|
85
|
+
from creatorsapi_python_sdk.models.resource_not_found_exception_response_content import ResourceNotFoundExceptionResponseContent
|
|
86
|
+
from creatorsapi_python_sdk.models.saving_basis_type import SavingBasisType
|
|
87
|
+
from creatorsapi_python_sdk.models.search_items_request_content import SearchItemsRequestContent
|
|
88
|
+
from creatorsapi_python_sdk.models.search_items_resource import SearchItemsResource
|
|
89
|
+
from creatorsapi_python_sdk.models.search_items_response_content import SearchItemsResponseContent
|
|
90
|
+
from creatorsapi_python_sdk.models.search_refinements import SearchRefinements
|
|
91
|
+
from creatorsapi_python_sdk.models.search_result import SearchResult
|
|
92
|
+
from creatorsapi_python_sdk.models.single_boolean_valued_attribute import SingleBooleanValuedAttribute
|
|
93
|
+
from creatorsapi_python_sdk.models.single_integer_valued_attribute import SingleIntegerValuedAttribute
|
|
94
|
+
from creatorsapi_python_sdk.models.single_string_valued_attribute import SingleStringValuedAttribute
|
|
95
|
+
from creatorsapi_python_sdk.models.sort_by import SortBy
|
|
96
|
+
from creatorsapi_python_sdk.models.technical_info import TechnicalInfo
|
|
97
|
+
from creatorsapi_python_sdk.models.throttle_exception_response_content import ThrottleExceptionResponseContent
|
|
98
|
+
from creatorsapi_python_sdk.models.trade_in_info import TradeInInfo
|
|
99
|
+
from creatorsapi_python_sdk.models.trade_in_price import TradeInPrice
|
|
100
|
+
from creatorsapi_python_sdk.models.unauthorized_exception_reason import UnauthorizedExceptionReason
|
|
101
|
+
from creatorsapi_python_sdk.models.unauthorized_exception_response_content import UnauthorizedExceptionResponseContent
|
|
102
|
+
from creatorsapi_python_sdk.models.unit_based_attribute import UnitBasedAttribute
|
|
103
|
+
from creatorsapi_python_sdk.models.validation_exception_field import ValidationExceptionField
|
|
104
|
+
from creatorsapi_python_sdk.models.validation_exception_reason import ValidationExceptionReason
|
|
105
|
+
from creatorsapi_python_sdk.models.validation_exception_response_content import ValidationExceptionResponseContent
|
|
106
|
+
from creatorsapi_python_sdk.models.variation_attribute import VariationAttribute
|
|
107
|
+
from creatorsapi_python_sdk.models.variation_dimension import VariationDimension
|
|
108
|
+
from creatorsapi_python_sdk.models.variation_summary import VariationSummary
|
|
109
|
+
from creatorsapi_python_sdk.models.variations_result import VariationsResult
|
|
110
|
+
from creatorsapi_python_sdk.models.website_sales_rank import WebsiteSalesRank
|
|
@@ -0,0 +1,97 @@
|
|
|
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 creatorsapi_python_sdk.models.access_denied_reason import AccessDeniedReason
|
|
29
|
+
from typing import Optional, Set
|
|
30
|
+
from typing_extensions import Self
|
|
31
|
+
|
|
32
|
+
class AccessDeniedExceptionResponseContent(BaseModel):
|
|
33
|
+
"""
|
|
34
|
+
User does not have sufficient access to perform this action.
|
|
35
|
+
""" # noqa: E501
|
|
36
|
+
type: Optional[StrictStr] = Field(default=None, description="The exception type identifier for clients to programmatically identify the exception")
|
|
37
|
+
message: StrictStr
|
|
38
|
+
reason: AccessDeniedReason
|
|
39
|
+
__properties: ClassVar[List[str]] = ["type", "message", "reason"]
|
|
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 AccessDeniedExceptionResponseContent 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 AccessDeniedExceptionResponseContent 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
|
+
"type": obj.get("type"),
|
|
92
|
+
"message": obj.get("message"),
|
|
93
|
+
"reason": obj.get("reason")
|
|
94
|
+
})
|
|
95
|
+
return _obj
|
|
96
|
+
|
|
97
|
+
|
|
@@ -0,0 +1,45 @@
|
|
|
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 AccessDeniedReason(str, Enum):
|
|
28
|
+
"""
|
|
29
|
+
Possible reasons for access denial
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
"""
|
|
33
|
+
allowed enum values
|
|
34
|
+
"""
|
|
35
|
+
ASSOCIATENOTELIGIBLE = 'AssociateNotEligible'
|
|
36
|
+
AUTHORIZATIONFAILED = 'AuthorizationFailed'
|
|
37
|
+
OTHER = 'Other'
|
|
38
|
+
|
|
39
|
+
@classmethod
|
|
40
|
+
def from_json(cls, json_str: str) -> Self:
|
|
41
|
+
"""Create an instance of AccessDeniedReason from a JSON string"""
|
|
42
|
+
return cls(json.loads(json_str))
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
@@ -0,0 +1,44 @@
|
|
|
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 Availability(str, Enum):
|
|
28
|
+
"""
|
|
29
|
+
The availability parameter filters available items on Amazon.
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
"""
|
|
33
|
+
allowed enum values
|
|
34
|
+
"""
|
|
35
|
+
AVAILABLE = 'Available'
|
|
36
|
+
INCLUDEOUTOFSTOCK = 'IncludeOutOfStock'
|
|
37
|
+
|
|
38
|
+
@classmethod
|
|
39
|
+
def from_json(cls, json_str: str) -> Self:
|
|
40
|
+
"""Create an instance of Availability from a JSON string"""
|
|
41
|
+
return cls(json.loads(json_str))
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
@@ -0,0 +1,116 @@
|
|
|
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, StrictFloat, StrictInt, StrictStr
|
|
27
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
28
|
+
from creatorsapi_python_sdk.models.browse_node_ancestor import BrowseNodeAncestor
|
|
29
|
+
from creatorsapi_python_sdk.models.browse_node_child import BrowseNodeChild
|
|
30
|
+
from typing import Optional, Set
|
|
31
|
+
from typing_extensions import Self
|
|
32
|
+
|
|
33
|
+
class BrowseNode(BaseModel):
|
|
34
|
+
"""
|
|
35
|
+
Container for BrowseNode information which includes BrowseNodeId, DisplayName, ContextFreeName, IsRoot, Ancestor, Children, SalesRank associated, etc.
|
|
36
|
+
""" # noqa: E501
|
|
37
|
+
ancestor: Optional[BrowseNodeAncestor] = None
|
|
38
|
+
children: Optional[List[BrowseNodeChild]] = Field(default=None, description="List of BrowseNode Children for a particular BrowseNode.")
|
|
39
|
+
context_free_name: Optional[StrictStr] = Field(default=None, description="Indicates a displayable name for a BrowseNode that is fully context free. For e.g. DisplayName of BrowseNodeId: 3060 in US marketplace is 'Orphans & Foster Homes'. One can not infer which root category this browse node belongs to unless we have the ancestry ladder for this browse node i.e. it requires a 'context' for being intuitive. However, the ContextFreeName of this browse node is 'Children's Orphans & Foster Homes Books'. Note that, for a BrowseNode whose DisplayName is already context free will have the same ContextFreeName as DisplayName.", alias="contextFreeName")
|
|
40
|
+
display_name: Optional[StrictStr] = Field(default=None, description="The display name of the BrowseNode as visible on the Amazon retail website.", alias="displayName")
|
|
41
|
+
id: Optional[StrictStr] = Field(default=None, description="Indicates the unique identifier of the BrowseNode")
|
|
42
|
+
is_root: Optional[StrictBool] = Field(default=None, description="Indicates if the current BrowseNode is a root category.", alias="isRoot")
|
|
43
|
+
sales_rank: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="salesRank")
|
|
44
|
+
__properties: ClassVar[List[str]] = ["ancestor", "children", "contextFreeName", "displayName", "id", "isRoot", "salesRank"]
|
|
45
|
+
|
|
46
|
+
model_config = ConfigDict(
|
|
47
|
+
populate_by_name=True,
|
|
48
|
+
validate_assignment=True,
|
|
49
|
+
protected_namespaces=(),
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def to_str(self) -> str:
|
|
54
|
+
"""Returns the string representation of the model using alias"""
|
|
55
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
56
|
+
|
|
57
|
+
def to_json(self) -> str:
|
|
58
|
+
"""Returns the JSON representation of the model using alias"""
|
|
59
|
+
return self.model_dump_json(by_alias=True, exclude_unset=True)
|
|
60
|
+
|
|
61
|
+
@classmethod
|
|
62
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
63
|
+
"""Create an instance of BrowseNode from a JSON string"""
|
|
64
|
+
return cls.from_dict(json.loads(json_str))
|
|
65
|
+
|
|
66
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
67
|
+
"""Return the dictionary representation of the model using alias.
|
|
68
|
+
|
|
69
|
+
This has the following differences from calling pydantic's
|
|
70
|
+
`self.model_dump(by_alias=True)`:
|
|
71
|
+
|
|
72
|
+
* `None` is only added to the output dict for nullable fields that
|
|
73
|
+
were set at model initialization. Other fields with value `None`
|
|
74
|
+
are ignored.
|
|
75
|
+
"""
|
|
76
|
+
excluded_fields: Set[str] = set([
|
|
77
|
+
])
|
|
78
|
+
|
|
79
|
+
_dict = self.model_dump(
|
|
80
|
+
by_alias=True,
|
|
81
|
+
exclude=excluded_fields,
|
|
82
|
+
exclude_none=True,
|
|
83
|
+
)
|
|
84
|
+
# override the default output from pydantic by calling `to_dict()` of ancestor
|
|
85
|
+
if self.ancestor:
|
|
86
|
+
_dict['ancestor'] = self.ancestor.to_dict()
|
|
87
|
+
# override the default output from pydantic by calling `to_dict()` of each item in children (list)
|
|
88
|
+
_items = []
|
|
89
|
+
if self.children:
|
|
90
|
+
for _item_children in self.children:
|
|
91
|
+
if _item_children:
|
|
92
|
+
_items.append(_item_children.to_dict())
|
|
93
|
+
_dict['children'] = _items
|
|
94
|
+
return _dict
|
|
95
|
+
|
|
96
|
+
@classmethod
|
|
97
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
98
|
+
"""Create an instance of BrowseNode from a dict"""
|
|
99
|
+
if obj is None:
|
|
100
|
+
return None
|
|
101
|
+
|
|
102
|
+
if not isinstance(obj, dict):
|
|
103
|
+
return cls.model_validate(obj)
|
|
104
|
+
|
|
105
|
+
_obj = cls.model_validate({
|
|
106
|
+
"ancestor": BrowseNodeAncestor.from_dict(obj["ancestor"]) if obj.get("ancestor") is not None else None,
|
|
107
|
+
"children": [BrowseNodeChild.from_dict(_item) for _item in obj["children"]] if obj.get("children") is not None else None,
|
|
108
|
+
"contextFreeName": obj.get("contextFreeName"),
|
|
109
|
+
"displayName": obj.get("displayName"),
|
|
110
|
+
"id": obj.get("id"),
|
|
111
|
+
"isRoot": obj.get("isRoot"),
|
|
112
|
+
"salesRank": obj.get("salesRank")
|
|
113
|
+
})
|
|
114
|
+
return _obj
|
|
115
|
+
|
|
116
|
+
|
|
@@ -0,0 +1,103 @@
|
|
|
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 BrowseNodeAncestor(BaseModel):
|
|
32
|
+
"""
|
|
33
|
+
Container for BrowseNode Ancestor information which includes BrowseNodeId, DisplayName, ContextFreeName and Ancestor information if one exists. The container is a ladder containing ancestor information up-to root browse node. That is, the last node in the ladder will be Root Node. Note that a root BrowseNode will not have any ancestor.
|
|
34
|
+
""" # noqa: E501
|
|
35
|
+
ancestor: Optional[BrowseNodeAncestor] = None
|
|
36
|
+
context_free_name: Optional[StrictStr] = Field(default=None, alias="contextFreeName")
|
|
37
|
+
display_name: Optional[StrictStr] = Field(default=None, alias="displayName")
|
|
38
|
+
id: Optional[StrictStr] = None
|
|
39
|
+
__properties: ClassVar[List[str]] = ["ancestor", "contextFreeName", "displayName", "id"]
|
|
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 BrowseNodeAncestor 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 ancestor
|
|
80
|
+
if self.ancestor:
|
|
81
|
+
_dict['ancestor'] = self.ancestor.to_dict()
|
|
82
|
+
return _dict
|
|
83
|
+
|
|
84
|
+
@classmethod
|
|
85
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
86
|
+
"""Create an instance of BrowseNodeAncestor from a dict"""
|
|
87
|
+
if obj is None:
|
|
88
|
+
return None
|
|
89
|
+
|
|
90
|
+
if not isinstance(obj, dict):
|
|
91
|
+
return cls.model_validate(obj)
|
|
92
|
+
|
|
93
|
+
_obj = cls.model_validate({
|
|
94
|
+
"ancestor": BrowseNodeAncestor.from_dict(obj["ancestor"]) if obj.get("ancestor") is not None else None,
|
|
95
|
+
"contextFreeName": obj.get("contextFreeName"),
|
|
96
|
+
"displayName": obj.get("displayName"),
|
|
97
|
+
"id": obj.get("id")
|
|
98
|
+
})
|
|
99
|
+
return _obj
|
|
100
|
+
|
|
101
|
+
# TODO: Rewrite to not use raise_errors
|
|
102
|
+
BrowseNodeAncestor.model_rebuild(raise_errors=False)
|
|
103
|
+
|
|
@@ -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 BrowseNodeChild(BaseModel):
|
|
32
|
+
"""
|
|
33
|
+
Container for BrowseNode Child information which contains BrowseNodeId, DisplayName and ContextFreeName information associated with the BrowseNode Child.
|
|
34
|
+
""" # noqa: E501
|
|
35
|
+
context_free_name: Optional[StrictStr] = Field(default=None, alias="contextFreeName")
|
|
36
|
+
display_name: Optional[StrictStr] = Field(default=None, alias="displayName")
|
|
37
|
+
id: Optional[StrictStr] = None
|
|
38
|
+
__properties: ClassVar[List[str]] = ["contextFreeName", "displayName", "id"]
|
|
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 BrowseNodeChild 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 BrowseNodeChild 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
|
+
"contextFreeName": obj.get("contextFreeName"),
|
|
91
|
+
"displayName": obj.get("displayName"),
|
|
92
|
+
"id": obj.get("id")
|
|
93
|
+
})
|
|
94
|
+
return _obj
|
|
95
|
+
|
|
96
|
+
|