diff --git a/amazon_paapi/models/item_result.py b/amazon_paapi/models/item_result.py index 45e4373..4000461 100644 --- a/amazon_paapi/models/item_result.py +++ b/amazon_paapi/models/item_result.py @@ -340,6 +340,99 @@ class ApiBrowseNodeInfo(sdk_models.BrowseNodeInfo): website_sales_rank: ApiWebsiteSalesRank +class ApiMoney(sdk_models.Money): + """Money representation for OffersV2 price fields.""" + + amount: float + currency: str + display_amount: str + + +class ApiOfferAvailabilityV2(sdk_models.OfferAvailabilityV2): + """OffersV2 availability information.""" + + max_order_quantity: int + message: str + min_order_quantity: int + type: str + + +class ApiOfferConditionV2(sdk_models.OfferConditionV2): + """OffersV2 condition information.""" + + condition_note: str + sub_condition: str + value: str + + +class ApiDealDetails(sdk_models.DealDetails): + """Deal details for OffersV2 listings.""" + + access_type: str + badge: str + early_access_duration_in_milliseconds: int + end_time: str + percent_claimed: int + start_time: str + + +class ApiOfferLoyaltyPointsV2(sdk_models.OfferLoyaltyPointsV2): + """OffersV2 loyalty points information.""" + + points: int + + +class ApiOfferMerchantInfoV2(sdk_models.OfferMerchantInfoV2): + """OffersV2 merchant information.""" + + id: str + name: str + + +class ApiOfferSavingBasis(sdk_models.OfferSavingBasis): + """Saving basis information for OffersV2.""" + + money: ApiMoney + saving_basis_type: str + saving_basis_type_label: str + + +class ApiOfferSavingsV2(sdk_models.OfferSavingsV2): + """OffersV2 savings information.""" + + money: ApiMoney + percentage: int + + +class ApiOfferPriceV2(sdk_models.OfferPriceV2): + """OffersV2 price information.""" + + money: ApiMoney + price_per_unit: ApiMoney + saving_basis: ApiOfferSavingBasis + savings: ApiOfferSavingsV2 + + +class ApiListingsV2(sdk_models.OfferListingV2): + """OffersV2 listing with all details.""" + + availability: ApiOfferAvailabilityV2 + condition: ApiOfferConditionV2 + deal_details: ApiDealDetails + is_buy_box_winner: bool + loyalty_points: ApiOfferLoyaltyPointsV2 + merchant_info: ApiOfferMerchantInfoV2 + price: ApiOfferPriceV2 + type: sdk_models.OfferType + violates_map: bool + + +class ApiOffersV2(sdk_models.OffersV2): + """Container for OffersV2 listings.""" + + listings: list[ApiListingsV2] + + class Item(sdk_models.Item): """Amazon product item with all details.""" @@ -350,6 +443,7 @@ class Item(sdk_models.Item): images: ApiImages item_info: ApiItemInfo offers: ApiOffers + offers_v2: ApiOffersV2 parent_asin: str rental_offers: sdk_models.RentalOffers score: float diff --git a/amazon_paapi/sdk/__init__.py b/amazon_paapi/sdk/__init__.py index 1b3c58b..08d151f 100644 --- a/amazon_paapi/sdk/__init__.py +++ b/amazon_paapi/sdk/__init__.py @@ -5,7 +5,7 @@ from __future__ import absolute_import """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -38,6 +38,7 @@ from .configuration import Configuration # import models into sdk package from .models.availability import Availability +from .models.big_decimal import BigDecimal from .models.browse_node import BrowseNode from .models.browse_node_ancestor import BrowseNodeAncestor from .models.browse_node_child import BrowseNodeChild @@ -50,6 +51,7 @@ from .models.content_rating import ContentRating from .models.contributor import Contributor from .models.customer_reviews import CustomerReviews +from .models.deal_details import DealDetails from .models.delivery_flag import DeliveryFlag from .models.dimension_based_attribute import DimensionBasedAttribute from .models.duration_price import DurationPrice @@ -79,25 +81,39 @@ from .models.min_price import MinPrice from .models.min_reviews_rating import MinReviewsRating from .models.min_saving_percent import MinSavingPercent +from .models.money import Money from .models.multi_valued_attribute import MultiValuedAttribute from .models.offer_availability import OfferAvailability +from .models.offer_availability_v2 import OfferAvailabilityV2 from .models.offer_condition import OfferCondition from .models.offer_condition_note import OfferConditionNote +from .models.offer_condition_v2 import OfferConditionV2 from .models.offer_count import OfferCount from .models.offer_delivery_info import OfferDeliveryInfo from .models.offer_listing import OfferListing +from .models.offer_listing_v2 import OfferListingV2 +from .models.offer_listings import OfferListings +from .models.offer_listings_v2 import OfferListingsV2 from .models.offer_loyalty_points import OfferLoyaltyPoints +from .models.offer_loyalty_points_v2 import OfferLoyaltyPointsV2 from .models.offer_merchant_info import OfferMerchantInfo +from .models.offer_merchant_info_v2 import OfferMerchantInfoV2 from .models.offer_price import OfferPrice +from .models.offer_price_v2 import OfferPriceV2 from .models.offer_program_eligibility import OfferProgramEligibility from .models.offer_promotion import OfferPromotion +from .models.offer_saving_basis import OfferSavingBasis from .models.offer_savings import OfferSavings +from .models.offer_savings_v2 import OfferSavingsV2 from .models.offer_shipping_charge import OfferShippingCharge from .models.offer_sub_condition import OfferSubCondition from .models.offer_summary import OfferSummary +from .models.offer_type import OfferType from .models.offers import Offers +from .models.offers_v2 import OffersV2 from .models.partner_type import PartnerType from .models.price import Price +from .models.price_type import PriceType from .models.product_advertising_api_client_exception import ProductAdvertisingAPIClientException from .models.product_advertising_api_service_exception import ProductAdvertisingAPIServiceException from .models.product_info import ProductInfo @@ -107,6 +123,8 @@ from .models.refinement_bin import RefinementBin from .models.rental_offer_listing import RentalOfferListing from .models.rental_offers import RentalOffers +from .models.saving_basis_type import SavingBasisType +from .models.search_index import SearchIndex from .models.search_items_request import SearchItemsRequest from .models.search_items_resource import SearchItemsResource from .models.search_items_response import SearchItemsResponse diff --git a/amazon_paapi/sdk/api/__init__.py b/amazon_paapi/sdk/api/__init__.py index 0597bfa..ccf380c 100644 --- a/amazon_paapi/sdk/api/__init__.py +++ b/amazon_paapi/sdk/api/__init__.py @@ -5,7 +5,7 @@ from __future__ import absolute_import """ - Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -25,6 +25,5 @@ https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 """ - # import apis into api package -from .default_api import DefaultApi +from ..api.default_api import DefaultApi diff --git a/amazon_paapi/sdk/api/default_api.py b/amazon_paapi/sdk/api/default_api.py index ebcd6cb..4b4e0c2 100644 --- a/amazon_paapi/sdk/api/default_api.py +++ b/amazon_paapi/sdk/api/default_api.py @@ -5,7 +5,7 @@ from __future__ import absolute_import """ - Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -25,7 +25,6 @@ https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 """ - import re # noqa: F401 # python 2 and python 3 compatibility library diff --git a/amazon_paapi/sdk/api_client.py b/amazon_paapi/sdk/api_client.py index 5136bc8..d3a4e41 100644 --- a/amazon_paapi/sdk/api_client.py +++ b/amazon_paapi/sdk/api_client.py @@ -5,7 +5,7 @@ from __future__ import absolute_import """ - Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -95,7 +95,7 @@ def __init__(self, self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'paapi5-python-sdk/1.0.0' + self.user_agent = 'paapi5-python-sdk/1.2.4' self.access_key = access_key self.secret_key = secret_key @@ -103,13 +103,8 @@ def __init__(self, self.region = region def __del__(self): - try: - self.pool.close() - self.pool.join() - except (OSError, TypeError): - # Ignore errors during interpreter shutdown when file descriptors - # or other resources may already be deallocated - pass + self.pool.close() + self.pool.join() @property def user_agent(self): @@ -529,7 +524,7 @@ def update_params_for_auth(self, headers, querys, auth_settings, api_name, metho """ if not auth_settings: service = 'ProductAdvertisingAPI' - utc_timestamp = datetime.datetime.utcnow() + utc_timestamp = datetime.datetime.now(datetime.timezone.utc) headers['x-amz-target'] = 'com.amazon.paapi5.v1.ProductAdvertisingAPIv1.' + api_name headers['content-encoding'] = 'amz-1.0' headers['Content-Type'] = 'application/json; charset=utf-8' diff --git a/amazon_paapi/sdk/auth/__init__.py b/amazon_paapi/sdk/auth/__init__.py index cc76d25..b4e620f 100644 --- a/amazon_paapi/sdk/auth/__init__.py +++ b/amazon_paapi/sdk/auth/__init__.py @@ -30,4 +30,4 @@ """ # import auth into sdk package -from .sign_helper import AWSV4Auth +from ..auth.sign_helper import AWSV4Auth diff --git a/amazon_paapi/sdk/configuration.py b/amazon_paapi/sdk/configuration.py index 852399e..f2473db 100644 --- a/amazon_paapi/sdk/configuration.py +++ b/amazon_paapi/sdk/configuration.py @@ -5,7 +5,7 @@ from __future__ import absolute_import """ - Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -25,7 +25,6 @@ https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 """ - import copy import logging import multiprocessing @@ -228,6 +227,6 @@ def to_debug_report(self): return "Python SDK Debug Report:\n"\ "OS: {env}\n"\ "Python Version: {pyversion}\n"\ - "Version of the API: 1.0.0\n"\ - "SDK Package Version: 1.0.0".\ + "Version of the API: 5.0.0\n"\ + "SDK Package Version: 1.2.4".\ format(env=sys.platform, pyversion=sys.version) diff --git a/amazon_paapi/sdk/models/__init__.py b/amazon_paapi/sdk/models/__init__.py index d9fb13b..5acd701 100644 --- a/amazon_paapi/sdk/models/__init__.py +++ b/amazon_paapi/sdk/models/__init__.py @@ -5,7 +5,7 @@ from __future__ import absolute_import """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -25,93 +25,111 @@ https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 """ + # import models into model package -from .availability import Availability -from .browse_node import BrowseNode -from .browse_node_ancestor import BrowseNodeAncestor -from .browse_node_child import BrowseNodeChild -from .browse_node_info import BrowseNodeInfo -from .browse_nodes_result import BrowseNodesResult -from .by_line_info import ByLineInfo -from .classifications import Classifications -from .condition import Condition -from .content_info import ContentInfo -from .content_rating import ContentRating -from .contributor import Contributor -from .customer_reviews import CustomerReviews -from .delivery_flag import DeliveryFlag -from .dimension_based_attribute import DimensionBasedAttribute -from .duration_price import DurationPrice -from .error_data import ErrorData -from .external_ids import ExternalIds -from .get_browse_nodes_request import GetBrowseNodesRequest -from .get_browse_nodes_resource import GetBrowseNodesResource -from .get_browse_nodes_response import GetBrowseNodesResponse -from .get_items_request import GetItemsRequest -from .get_items_resource import GetItemsResource -from .get_items_response import GetItemsResponse -from .get_variations_request import GetVariationsRequest -from .get_variations_resource import GetVariationsResource -from .get_variations_response import GetVariationsResponse -from .image_size import ImageSize -from .image_type import ImageType -from .images import Images -from .item import Item -from .item_id_type import ItemIdType -from .item_info import ItemInfo -from .items_result import ItemsResult -from .language_type import LanguageType -from .languages import Languages -from .manufacture_info import ManufactureInfo -from .max_price import MaxPrice -from .merchant import Merchant -from .min_price import MinPrice -from .min_reviews_rating import MinReviewsRating -from .min_saving_percent import MinSavingPercent -from .multi_valued_attribute import MultiValuedAttribute -from .offer_availability import OfferAvailability -from .offer_condition import OfferCondition -from .offer_condition_note import OfferConditionNote -from .offer_count import OfferCount -from .offer_delivery_info import OfferDeliveryInfo -from .offer_listing import OfferListing -from .offer_loyalty_points import OfferLoyaltyPoints -from .offer_merchant_info import OfferMerchantInfo -from .offer_price import OfferPrice -from .offer_program_eligibility import OfferProgramEligibility -from .offer_promotion import OfferPromotion -from .offer_savings import OfferSavings -from .offer_shipping_charge import OfferShippingCharge -from .offer_sub_condition import OfferSubCondition -from .offer_summary import OfferSummary -from .offers import Offers -from .partner_type import PartnerType -from .price import Price -from .price_type import PriceType -from .product_advertising_api_client_exception import ProductAdvertisingAPIClientException -from .product_advertising_api_service_exception import ProductAdvertisingAPIServiceException -from .product_info import ProductInfo -from .properties import Properties -from .rating import Rating -from .refinement import Refinement -from .refinement_bin import RefinementBin -from .rental_offer_listing import RentalOfferListing -from .rental_offers import RentalOffers -from .search_items_request import SearchItemsRequest -from .search_items_resource import SearchItemsResource -from .search_items_response import SearchItemsResponse -from .search_refinements import SearchRefinements -from .search_result import SearchResult -from .single_boolean_valued_attribute import SingleBooleanValuedAttribute -from .single_integer_valued_attribute import SingleIntegerValuedAttribute -from .single_string_valued_attribute import SingleStringValuedAttribute -from .sort_by import SortBy -from .technical_info import TechnicalInfo -from .trade_in_info import TradeInInfo -from .trade_in_price import TradeInPrice -from .unit_based_attribute import UnitBasedAttribute -from .variation_attribute import VariationAttribute -from .variation_dimension import VariationDimension -from .variation_summary import VariationSummary -from .variations_result import VariationsResult -from .website_sales_rank import WebsiteSalesRank +from ..models.availability import Availability +from ..models.big_decimal import BigDecimal +from ..models.browse_node import BrowseNode +from ..models.browse_node_ancestor import BrowseNodeAncestor +from ..models.browse_node_child import BrowseNodeChild +from ..models.browse_node_info import BrowseNodeInfo +from ..models.browse_nodes_result import BrowseNodesResult +from ..models.by_line_info import ByLineInfo +from ..models.classifications import Classifications +from ..models.condition import Condition +from ..models.content_info import ContentInfo +from ..models.content_rating import ContentRating +from ..models.contributor import Contributor +from ..models.customer_reviews import CustomerReviews +from ..models.deal_details import DealDetails +from ..models.delivery_flag import DeliveryFlag +from ..models.dimension_based_attribute import DimensionBasedAttribute +from ..models.duration_price import DurationPrice +from ..models.error_data import ErrorData +from ..models.external_ids import ExternalIds +from ..models.get_browse_nodes_request import GetBrowseNodesRequest +from ..models.get_browse_nodes_resource import GetBrowseNodesResource +from ..models.get_browse_nodes_response import GetBrowseNodesResponse +from ..models.get_items_request import GetItemsRequest +from ..models.get_items_resource import GetItemsResource +from ..models.get_items_response import GetItemsResponse +from ..models.get_variations_request import GetVariationsRequest +from ..models.get_variations_resource import GetVariationsResource +from ..models.get_variations_response import GetVariationsResponse +from ..models.image_size import ImageSize +from ..models.image_type import ImageType +from ..models.images import Images +from ..models.item import Item +from ..models.item_id_type import ItemIdType +from ..models.item_info import ItemInfo +from ..models.items_result import ItemsResult +from ..models.language_type import LanguageType +from ..models.languages import Languages +from ..models.manufacture_info import ManufactureInfo +from ..models.max_price import MaxPrice +from ..models.merchant import Merchant +from ..models.min_price import MinPrice +from ..models.min_reviews_rating import MinReviewsRating +from ..models.min_saving_percent import MinSavingPercent +from ..models.money import Money +from ..models.multi_valued_attribute import MultiValuedAttribute +from ..models.offer_availability import OfferAvailability +from ..models.offer_availability_v2 import OfferAvailabilityV2 +from ..models.offer_condition import OfferCondition +from ..models.offer_condition_note import OfferConditionNote +from ..models.offer_condition_v2 import OfferConditionV2 +from ..models.offer_count import OfferCount +from ..models.offer_delivery_info import OfferDeliveryInfo +from ..models.offer_listing import OfferListing +from ..models.offer_listing_v2 import OfferListingV2 +from ..models.offer_listings import OfferListings +from ..models.offer_listings_v2 import OfferListingsV2 +from ..models.offer_loyalty_points import OfferLoyaltyPoints +from ..models.offer_loyalty_points_v2 import OfferLoyaltyPointsV2 +from ..models.offer_merchant_info import OfferMerchantInfo +from ..models.offer_merchant_info_v2 import OfferMerchantInfoV2 +from ..models.offer_price import OfferPrice +from ..models.offer_price_v2 import OfferPriceV2 +from ..models.offer_program_eligibility import OfferProgramEligibility +from ..models.offer_promotion import OfferPromotion +from ..models.offer_saving_basis import OfferSavingBasis +from ..models.offer_savings import OfferSavings +from ..models.offer_savings_v2 import OfferSavingsV2 +from ..models.offer_shipping_charge import OfferShippingCharge +from ..models.offer_sub_condition import OfferSubCondition +from ..models.offer_summary import OfferSummary +from ..models.offer_type import OfferType +from ..models.offers import Offers +from ..models.offers_v2 import OffersV2 +from ..models.partner_type import PartnerType +from ..models.price import Price +from ..models.price_type import PriceType +from ..models.product_advertising_api_client_exception import ProductAdvertisingAPIClientException +from ..models.product_advertising_api_service_exception import ProductAdvertisingAPIServiceException +from ..models.product_info import ProductInfo +from ..models.properties import Properties +from ..models.rating import Rating +from ..models.refinement import Refinement +from ..models.refinement_bin import RefinementBin +from ..models.rental_offer_listing import RentalOfferListing +from ..models.rental_offers import RentalOffers +from ..models.saving_basis_type import SavingBasisType +from ..models.search_index import SearchIndex +from ..models.search_items_request import SearchItemsRequest +from ..models.search_items_resource import SearchItemsResource +from ..models.search_items_response import SearchItemsResponse +from ..models.search_refinements import SearchRefinements +from ..models.search_result import SearchResult +from ..models.single_boolean_valued_attribute import SingleBooleanValuedAttribute +from ..models.single_integer_valued_attribute import SingleIntegerValuedAttribute +from ..models.single_string_valued_attribute import SingleStringValuedAttribute +from ..models.sort_by import SortBy +from ..models.technical_info import TechnicalInfo +from ..models.trade_in_info import TradeInInfo +from ..models.trade_in_price import TradeInPrice +from ..models.unit_based_attribute import UnitBasedAttribute +from ..models.variation_attribute import VariationAttribute +from ..models.variation_dimension import VariationDimension +from ..models.variation_summary import VariationSummary +from ..models.variations_result import VariationsResult +from ..models.website_sales_rank import WebsiteSalesRank diff --git a/amazon_paapi/sdk/models/availability.py b/amazon_paapi/sdk/models/availability.py index c59a770..97666e9 100644 --- a/amazon_paapi/sdk/models/availability.py +++ b/amazon_paapi/sdk/models/availability.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/big_decimal.py b/amazon_paapi/sdk/models/big_decimal.py new file mode 100644 index 0000000..0cabb05 --- /dev/null +++ b/amazon_paapi/sdk/models/big_decimal.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"). + You may not use this file except in compliance with the License. + A copy of the License is located at + + http://www.apache.org/licenses/LICENSE-2.0 + + or in the "license" file accompanying this file. This file is distributed + on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + express or implied. See the License for the specific language governing + permissions and limitations under the License. +""" + + +""" + ProductAdvertisingAPI + + https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 +""" + + +import pprint +import re # noqa: F401 + +import six + + +class BigDecimal(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """BigDecimal - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(BigDecimal, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, BigDecimal): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/amazon_paapi/sdk/models/browse_node.py b/amazon_paapi/sdk/models/browse_node.py index 2368305..26e0fc0 100644 --- a/amazon_paapi/sdk/models/browse_node.py +++ b/amazon_paapi/sdk/models/browse_node.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,8 +28,8 @@ import six -from .browse_node_ancestor import BrowseNodeAncestor # noqa: F401,E501 -from .browse_node_child import BrowseNodeChild # noqa: F401,E501 +from ..models.browse_node_ancestor import BrowseNodeAncestor # noqa: F401,E501 +from ..models.browse_node_child import BrowseNodeChild # noqa: F401,E501 class BrowseNode(object): diff --git a/amazon_paapi/sdk/models/browse_node_ancestor.py b/amazon_paapi/sdk/models/browse_node_ancestor.py index fa8e4bb..f574c88 100644 --- a/amazon_paapi/sdk/models/browse_node_ancestor.py +++ b/amazon_paapi/sdk/models/browse_node_ancestor.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ permissions and limitations under the License. """ - """ ProductAdvertisingAPI diff --git a/amazon_paapi/sdk/models/browse_node_child.py b/amazon_paapi/sdk/models/browse_node_child.py index 2971282..7fdb470 100644 --- a/amazon_paapi/sdk/models/browse_node_child.py +++ b/amazon_paapi/sdk/models/browse_node_child.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/browse_node_info.py b/amazon_paapi/sdk/models/browse_node_info.py index ce57b1f..11b5d26 100644 --- a/amazon_paapi/sdk/models/browse_node_info.py +++ b/amazon_paapi/sdk/models/browse_node_info.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,8 +28,8 @@ import six -from .browse_node import BrowseNode # noqa: F401,E501 -from .website_sales_rank import WebsiteSalesRank # noqa: F401,E501 +from ..models.browse_node import BrowseNode # noqa: F401,E501 +from ..models.website_sales_rank import WebsiteSalesRank # noqa: F401,E501 class BrowseNodeInfo(object): diff --git a/amazon_paapi/sdk/models/browse_nodes_result.py b/amazon_paapi/sdk/models/browse_nodes_result.py index 0efd996..db3ee7f 100644 --- a/amazon_paapi/sdk/models/browse_nodes_result.py +++ b/amazon_paapi/sdk/models/browse_nodes_result.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ import six -from .browse_node import BrowseNode # noqa: F401,E501 +from ..models.browse_node import BrowseNode # noqa: F401,E501 class BrowseNodesResult(object): diff --git a/amazon_paapi/sdk/models/by_line_info.py b/amazon_paapi/sdk/models/by_line_info.py index a2a55c8..25fa735 100644 --- a/amazon_paapi/sdk/models/by_line_info.py +++ b/amazon_paapi/sdk/models/by_line_info.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,8 +28,8 @@ import six -from .contributor import Contributor # noqa: F401,E501 -from .single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 +from ..models.contributor import Contributor # noqa: F401,E501 +from ..models.single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 class ByLineInfo(object): diff --git a/amazon_paapi/sdk/models/classifications.py b/amazon_paapi/sdk/models/classifications.py index 3f53dbf..f343a2f 100644 --- a/amazon_paapi/sdk/models/classifications.py +++ b/amazon_paapi/sdk/models/classifications.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ import six -from .single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 +from ..models.single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 class Classifications(object): diff --git a/amazon_paapi/sdk/models/condition.py b/amazon_paapi/sdk/models/condition.py index 5a24d22..cd1576d 100644 --- a/amazon_paapi/sdk/models/condition.py +++ b/amazon_paapi/sdk/models/condition.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/content_info.py b/amazon_paapi/sdk/models/content_info.py index 068c02a..478e367 100644 --- a/amazon_paapi/sdk/models/content_info.py +++ b/amazon_paapi/sdk/models/content_info.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,9 +28,9 @@ import six -from .languages import Languages # noqa: F401,E501 -from .single_integer_valued_attribute import SingleIntegerValuedAttribute # noqa: F401,E501 -from .single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 +from ..models.languages import Languages # noqa: F401,E501 +from ..models.single_integer_valued_attribute import SingleIntegerValuedAttribute # noqa: F401,E501 +from ..models.single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 class ContentInfo(object): diff --git a/amazon_paapi/sdk/models/content_rating.py b/amazon_paapi/sdk/models/content_rating.py index fd4276f..a5c8f1d 100644 --- a/amazon_paapi/sdk/models/content_rating.py +++ b/amazon_paapi/sdk/models/content_rating.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ import six -from .single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 +from ..models.single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 class ContentRating(object): diff --git a/amazon_paapi/sdk/models/contributor.py b/amazon_paapi/sdk/models/contributor.py index d00ddcf..c2d5bfa 100644 --- a/amazon_paapi/sdk/models/contributor.py +++ b/amazon_paapi/sdk/models/contributor.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/customer_reviews.py b/amazon_paapi/sdk/models/customer_reviews.py index 1ed184f..02f674e 100644 --- a/amazon_paapi/sdk/models/customer_reviews.py +++ b/amazon_paapi/sdk/models/customer_reviews.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ import six -from .rating import Rating # noqa: F401,E501 +from ..models.rating import Rating # noqa: F401,E501 class CustomerReviews(object): diff --git a/amazon_paapi/sdk/models/deal_details.py b/amazon_paapi/sdk/models/deal_details.py new file mode 100644 index 0000000..f906814 --- /dev/null +++ b/amazon_paapi/sdk/models/deal_details.py @@ -0,0 +1,257 @@ +# coding: utf-8 + +""" + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"). + You may not use this file except in compliance with the License. + A copy of the License is located at + + http://www.apache.org/licenses/LICENSE-2.0 + + or in the "license" file accompanying this file. This file is distributed + on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + express or implied. See the License for the specific language governing + permissions and limitations under the License. +""" + + +""" + ProductAdvertisingAPI + + https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 +""" + + +import pprint +import re # noqa: F401 + +import six + + +class DealDetails(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'access_type': 'str', + 'badge': 'str', + 'early_access_duration_in_milliseconds': 'int', + 'end_time': 'str', + 'percent_claimed': 'int', + 'start_time': 'str' + } + + attribute_map = { + 'access_type': 'AccessType', + 'badge': 'Badge', + 'early_access_duration_in_milliseconds': 'EarlyAccessDurationInMilliseconds', + 'end_time': 'EndTime', + 'percent_claimed': 'PercentClaimed', + 'start_time': 'StartTime' + } + + def __init__(self, access_type=None, badge=None, early_access_duration_in_milliseconds=None, end_time=None, percent_claimed=None, start_time=None): # noqa: E501 + """DealDetails - a model defined in Swagger""" # noqa: E501 + + self._access_type = None + self._badge = None + self._early_access_duration_in_milliseconds = None + self._end_time = None + self._percent_claimed = None + self._start_time = None + self.discriminator = None + + if access_type is not None: + self.access_type = access_type + if badge is not None: + self.badge = badge + if early_access_duration_in_milliseconds is not None: + self.early_access_duration_in_milliseconds = early_access_duration_in_milliseconds + if end_time is not None: + self.end_time = end_time + if percent_claimed is not None: + self.percent_claimed = percent_claimed + if start_time is not None: + self.start_time = start_time + + @property + def access_type(self): + """Gets the access_type of this DealDetails. # noqa: E501 + + + :return: The access_type of this DealDetails. # noqa: E501 + :rtype: str + """ + return self._access_type + + @access_type.setter + def access_type(self, access_type): + """Sets the access_type of this DealDetails. + + + :param access_type: The access_type of this DealDetails. # noqa: E501 + :type: str + """ + + self._access_type = access_type + + @property + def badge(self): + """Gets the badge of this DealDetails. # noqa: E501 + + + :return: The badge of this DealDetails. # noqa: E501 + :rtype: str + """ + return self._badge + + @badge.setter + def badge(self, badge): + """Sets the badge of this DealDetails. + + + :param badge: The badge of this DealDetails. # noqa: E501 + :type: str + """ + + self._badge = badge + + @property + def early_access_duration_in_milliseconds(self): + """Gets the early_access_duration_in_milliseconds of this DealDetails. # noqa: E501 + + + :return: The early_access_duration_in_milliseconds of this DealDetails. # noqa: E501 + :rtype: int + """ + return self._early_access_duration_in_milliseconds + + @early_access_duration_in_milliseconds.setter + def early_access_duration_in_milliseconds(self, early_access_duration_in_milliseconds): + """Sets the early_access_duration_in_milliseconds of this DealDetails. + + + :param early_access_duration_in_milliseconds: The early_access_duration_in_milliseconds of this DealDetails. # noqa: E501 + :type: int + """ + + self._early_access_duration_in_milliseconds = early_access_duration_in_milliseconds + + @property + def end_time(self): + """Gets the end_time of this DealDetails. # noqa: E501 + + + :return: The end_time of this DealDetails. # noqa: E501 + :rtype: str + """ + return self._end_time + + @end_time.setter + def end_time(self, end_time): + """Sets the end_time of this DealDetails. + + + :param end_time: The end_time of this DealDetails. # noqa: E501 + :type: str + """ + + self._end_time = end_time + + @property + def percent_claimed(self): + """Gets the percent_claimed of this DealDetails. # noqa: E501 + + + :return: The percent_claimed of this DealDetails. # noqa: E501 + :rtype: int + """ + return self._percent_claimed + + @percent_claimed.setter + def percent_claimed(self, percent_claimed): + """Sets the percent_claimed of this DealDetails. + + + :param percent_claimed: The percent_claimed of this DealDetails. # noqa: E501 + :type: int + """ + + self._percent_claimed = percent_claimed + + @property + def start_time(self): + """Gets the start_time of this DealDetails. # noqa: E501 + + + :return: The start_time of this DealDetails. # noqa: E501 + :rtype: str + """ + return self._start_time + + @start_time.setter + def start_time(self, start_time): + """Sets the start_time of this DealDetails. + + + :param start_time: The start_time of this DealDetails. # noqa: E501 + :type: str + """ + + self._start_time = start_time + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(DealDetails, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DealDetails): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/amazon_paapi/sdk/models/delivery_flag.py b/amazon_paapi/sdk/models/delivery_flag.py index 65b49af..035e354 100644 --- a/amazon_paapi/sdk/models/delivery_flag.py +++ b/amazon_paapi/sdk/models/delivery_flag.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/dimension_based_attribute.py b/amazon_paapi/sdk/models/dimension_based_attribute.py index b8f5e62..4503900 100644 --- a/amazon_paapi/sdk/models/dimension_based_attribute.py +++ b/amazon_paapi/sdk/models/dimension_based_attribute.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ import six -from .unit_based_attribute import UnitBasedAttribute # noqa: F401,E501 +from ..models.unit_based_attribute import UnitBasedAttribute # noqa: F401,E501 class DimensionBasedAttribute(object): diff --git a/amazon_paapi/sdk/models/duration_price.py b/amazon_paapi/sdk/models/duration_price.py index d5adfc7..79346d1 100644 --- a/amazon_paapi/sdk/models/duration_price.py +++ b/amazon_paapi/sdk/models/duration_price.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,8 +28,8 @@ import six -from .offer_price import OfferPrice # noqa: F401,E501 -from .unit_based_attribute import UnitBasedAttribute # noqa: F401,E501 +from ..models.offer_price import OfferPrice # noqa: F401,E501 +from ..models.unit_based_attribute import UnitBasedAttribute # noqa: F401,E501 class DurationPrice(object): diff --git a/amazon_paapi/sdk/models/error_data.py b/amazon_paapi/sdk/models/error_data.py index 0677aae..48b027d 100644 --- a/amazon_paapi/sdk/models/error_data.py +++ b/amazon_paapi/sdk/models/error_data.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/external_ids.py b/amazon_paapi/sdk/models/external_ids.py index ded47ea..bea77ff 100644 --- a/amazon_paapi/sdk/models/external_ids.py +++ b/amazon_paapi/sdk/models/external_ids.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ import six -from .multi_valued_attribute import MultiValuedAttribute # noqa: F401,E501 +from ..models.multi_valued_attribute import MultiValuedAttribute # noqa: F401,E501 class ExternalIds(object): diff --git a/amazon_paapi/sdk/models/get_browse_nodes_request.py b/amazon_paapi/sdk/models/get_browse_nodes_request.py index f5fe775..4031d84 100644 --- a/amazon_paapi/sdk/models/get_browse_nodes_request.py +++ b/amazon_paapi/sdk/models/get_browse_nodes_request.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,8 +28,8 @@ import six -from .get_browse_nodes_resource import GetBrowseNodesResource # noqa: F401,E501 -from .partner_type import PartnerType # noqa: F401,E501 +from ..models.get_browse_nodes_resource import GetBrowseNodesResource # noqa: F401,E501 +from ..models.partner_type import PartnerType # noqa: F401,E501 class GetBrowseNodesRequest(object): diff --git a/amazon_paapi/sdk/models/get_browse_nodes_resource.py b/amazon_paapi/sdk/models/get_browse_nodes_resource.py index 81d4fc0..abb8fbb 100644 --- a/amazon_paapi/sdk/models/get_browse_nodes_resource.py +++ b/amazon_paapi/sdk/models/get_browse_nodes_resource.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/get_browse_nodes_response.py b/amazon_paapi/sdk/models/get_browse_nodes_response.py index 2640f27..f8c786e 100644 --- a/amazon_paapi/sdk/models/get_browse_nodes_response.py +++ b/amazon_paapi/sdk/models/get_browse_nodes_response.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,8 +28,8 @@ import six -from .browse_nodes_result import BrowseNodesResult # noqa: F401,E501 -from .error_data import ErrorData # noqa: F401,E501 +from ..models.browse_nodes_result import BrowseNodesResult # noqa: F401,E501 +from ..models.error_data import ErrorData # noqa: F401,E501 class GetBrowseNodesResponse(object): diff --git a/amazon_paapi/sdk/models/get_items_request.py b/amazon_paapi/sdk/models/get_items_request.py index 2ea5ae1..80738df 100644 --- a/amazon_paapi/sdk/models/get_items_request.py +++ b/amazon_paapi/sdk/models/get_items_request.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,13 +28,13 @@ import six -from .condition import Condition # noqa: F401,E501 -from .get_items_resource import GetItemsResource # noqa: F401,E501 -from .item_id_type import ItemIdType # noqa: F401,E501 -from .merchant import Merchant # noqa: F401,E501 -from .offer_count import OfferCount # noqa: F401,E501 -from .partner_type import PartnerType # noqa: F401,E501 -from .properties import Properties # noqa: F401,E501 +from ..models.condition import Condition # noqa: F401,E501 +from ..models.get_items_resource import GetItemsResource # noqa: F401,E501 +from ..models.item_id_type import ItemIdType # noqa: F401,E501 +from ..models.merchant import Merchant # noqa: F401,E501 +from ..models.offer_count import OfferCount # noqa: F401,E501 +from ..models.partner_type import PartnerType # noqa: F401,E501 +from ..models.properties import Properties # noqa: F401,E501 class GetItemsRequest(object): diff --git a/amazon_paapi/sdk/models/get_items_resource.py b/amazon_paapi/sdk/models/get_items_resource.py index b0922ad..2cfc750 100644 --- a/amazon_paapi/sdk/models/get_items_resource.py +++ b/amazon_paapi/sdk/models/get_items_resource.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -97,6 +97,14 @@ class GetItemsResource(object): RENTALOFFERS_LISTINGS_DELIVERYINFO_ISPRIMEELIGIBLE = "RentalOffers.Listings.DeliveryInfo.IsPrimeEligible" RENTALOFFERS_LISTINGS_DELIVERYINFO_SHIPPINGCHARGES = "RentalOffers.Listings.DeliveryInfo.ShippingCharges" RENTALOFFERS_LISTINGS_MERCHANTINFO = "RentalOffers.Listings.MerchantInfo" + OFFERSV2_LISTINGS_AVAILABILITY = "OffersV2.Listings.Availability" + OFFERSV2_LISTINGS_CONDITION = "OffersV2.Listings.Condition" + OFFERSV2_LISTINGS_DEALDETAILS = "OffersV2.Listings.DealDetails" + OFFERSV2_LISTINGS_ISBUYBOXWINNER = "OffersV2.Listings.IsBuyBoxWinner" + OFFERSV2_LISTINGS_LOYALTYPOINTS = "OffersV2.Listings.LoyaltyPoints" + OFFERSV2_LISTINGS_MERCHANTINFO = "OffersV2.Listings.MerchantInfo" + OFFERSV2_LISTINGS_PRICE = "OffersV2.Listings.Price" + OFFERSV2_LISTINGS_TYPE = "OffersV2.Listings.Type" """ Attributes: diff --git a/amazon_paapi/sdk/models/get_items_response.py b/amazon_paapi/sdk/models/get_items_response.py index 0c7c958..f344a07 100644 --- a/amazon_paapi/sdk/models/get_items_response.py +++ b/amazon_paapi/sdk/models/get_items_response.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,8 +28,8 @@ import six -from .error_data import ErrorData # noqa: F401,E501 -from .items_result import ItemsResult # noqa: F401,E501 +from ..models.error_data import ErrorData # noqa: F401,E501 +from ..models.items_result import ItemsResult # noqa: F401,E501 class GetItemsResponse(object): diff --git a/amazon_paapi/sdk/models/get_variations_request.py b/amazon_paapi/sdk/models/get_variations_request.py index 1e539f5..ecc339d 100644 --- a/amazon_paapi/sdk/models/get_variations_request.py +++ b/amazon_paapi/sdk/models/get_variations_request.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,12 +28,12 @@ import six -from .condition import Condition # noqa: F401,E501 -from .get_variations_resource import GetVariationsResource # noqa: F401,E501 -from .merchant import Merchant # noqa: F401,E501 -from .offer_count import OfferCount # noqa: F401,E501 -from .partner_type import PartnerType # noqa: F401,E501 -from .properties import Properties # noqa: F401,E501 +from ..models.condition import Condition # noqa: F401,E501 +from ..models.get_variations_resource import GetVariationsResource # noqa: F401,E501 +from ..models.merchant import Merchant # noqa: F401,E501 +from ..models.offer_count import OfferCount # noqa: F401,E501 +from ..models.partner_type import PartnerType # noqa: F401,E501 +from ..models.properties import Properties # noqa: F401,E501 class GetVariationsRequest(object): diff --git a/amazon_paapi/sdk/models/get_variations_resource.py b/amazon_paapi/sdk/models/get_variations_resource.py index 773f8d2..4d7efae 100644 --- a/amazon_paapi/sdk/models/get_variations_resource.py +++ b/amazon_paapi/sdk/models/get_variations_resource.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -100,6 +100,14 @@ class GetVariationsResource(object): VARIATIONSUMMARY_PRICE_HIGHESTPRICE = "VariationSummary.Price.HighestPrice" VARIATIONSUMMARY_PRICE_LOWESTPRICE = "VariationSummary.Price.LowestPrice" VARIATIONSUMMARY_VARIATIONDIMENSION = "VariationSummary.VariationDimension" + OFFERSV2_LISTINGS_AVAILABILITY = "OffersV2.Listings.Availability" + OFFERSV2_LISTINGS_CONDITION = "OffersV2.Listings.Condition" + OFFERSV2_LISTINGS_DEALDETAILS = "OffersV2.Listings.DealDetails" + OFFERSV2_LISTINGS_ISBUYBOXWINNER = "OffersV2.Listings.IsBuyBoxWinner" + OFFERSV2_LISTINGS_LOYALTYPOINTS = "OffersV2.Listings.LoyaltyPoints" + OFFERSV2_LISTINGS_MERCHANTINFO = "OffersV2.Listings.MerchantInfo" + OFFERSV2_LISTINGS_PRICE = "OffersV2.Listings.Price" + OFFERSV2_LISTINGS_TYPE = "OffersV2.Listings.Type" """ Attributes: diff --git a/amazon_paapi/sdk/models/get_variations_response.py b/amazon_paapi/sdk/models/get_variations_response.py index a6698cd..b21b021 100644 --- a/amazon_paapi/sdk/models/get_variations_response.py +++ b/amazon_paapi/sdk/models/get_variations_response.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,8 +28,8 @@ import six -from .error_data import ErrorData # noqa: F401,E501 -from .variations_result import VariationsResult # noqa: F401,E501 +from ..models.error_data import ErrorData # noqa: F401,E501 +from ..models.variations_result import VariationsResult # noqa: F401,E501 class GetVariationsResponse(object): diff --git a/amazon_paapi/sdk/models/image_size.py b/amazon_paapi/sdk/models/image_size.py index 3466ce6..2e18b39 100644 --- a/amazon_paapi/sdk/models/image_size.py +++ b/amazon_paapi/sdk/models/image_size.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/image_type.py b/amazon_paapi/sdk/models/image_type.py index 003efea..d1300a1 100644 --- a/amazon_paapi/sdk/models/image_type.py +++ b/amazon_paapi/sdk/models/image_type.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ import six -from .image_size import ImageSize # noqa: F401,E501 +from ..models.image_size import ImageSize # noqa: F401,E501 class ImageType(object): diff --git a/amazon_paapi/sdk/models/images.py b/amazon_paapi/sdk/models/images.py index caf1370..cec86b4 100644 --- a/amazon_paapi/sdk/models/images.py +++ b/amazon_paapi/sdk/models/images.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ import six -from .image_type import ImageType # noqa: F401,E501 +from ..models.image_type import ImageType # noqa: F401,E501 class Images(object): diff --git a/amazon_paapi/sdk/models/item.py b/amazon_paapi/sdk/models/item.py index ab41162..89274c7 100644 --- a/amazon_paapi/sdk/models/item.py +++ b/amazon_paapi/sdk/models/item.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,13 +28,14 @@ import six -from .browse_node_info import BrowseNodeInfo # noqa: F401,E501 -from .customer_reviews import CustomerReviews # noqa: F401,E501 -from .images import Images # noqa: F401,E501 -from .item_info import ItemInfo # noqa: F401,E501 -from .offers import Offers # noqa: F401,E501 -from .rental_offers import RentalOffers # noqa: F401,E501 -from .variation_attribute import VariationAttribute # noqa: F401,E501 +from ..models.browse_node_info import BrowseNodeInfo # noqa: F401,E501 +from ..models.customer_reviews import CustomerReviews # noqa: F401,E501 +from ..models.images import Images # noqa: F401,E501 +from ..models.item_info import ItemInfo # noqa: F401,E501 +from ..models.offers import Offers # noqa: F401,E501 +from ..models.offers_v2 import OffersV2 # noqa: F401,E501 +from ..models.rental_offers import RentalOffers # noqa: F401,E501 +from ..models.variation_attribute import VariationAttribute # noqa: F401,E501 class Item(object): @@ -58,6 +59,7 @@ class Item(object): 'images': 'Images', 'item_info': 'ItemInfo', 'offers': 'Offers', + 'offers_v2': 'OffersV2', 'parent_asin': 'str', 'rental_offers': 'RentalOffers', 'score': 'float', @@ -72,13 +74,14 @@ class Item(object): 'images': 'Images', 'item_info': 'ItemInfo', 'offers': 'Offers', + 'offers_v2': 'OffersV2', 'parent_asin': 'ParentASIN', 'rental_offers': 'RentalOffers', 'score': 'Score', 'variation_attributes': 'VariationAttributes' } - def __init__(self, asin=None, browse_node_info=None, customer_reviews=None, detail_page_url=None, images=None, item_info=None, offers=None, parent_asin=None, rental_offers=None, score=None, variation_attributes=None): # noqa: E501 + def __init__(self, asin=None, browse_node_info=None, customer_reviews=None, detail_page_url=None, images=None, item_info=None, offers=None, offers_v2=None, parent_asin=None, rental_offers=None, score=None, variation_attributes=None): # noqa: E501 """Item - a model defined in Swagger""" # noqa: E501 self._asin = None @@ -88,6 +91,7 @@ def __init__(self, asin=None, browse_node_info=None, customer_reviews=None, deta self._images = None self._item_info = None self._offers = None + self._offers_v2 = None self._parent_asin = None self._rental_offers = None self._score = None @@ -108,6 +112,8 @@ def __init__(self, asin=None, browse_node_info=None, customer_reviews=None, deta self.item_info = item_info if offers is not None: self.offers = offers + if offers_v2 is not None: + self.offers_v2 = offers_v2 if parent_asin is not None: self.parent_asin = parent_asin if rental_offers is not None: @@ -264,6 +270,27 @@ def offers(self, offers): self._offers = offers + @property + def offers_v2(self): + """Gets the offers_v2 of this Item. # noqa: E501 + + + :return: The offers_v2 of this Item. # noqa: E501 + :rtype: OffersV2 + """ + return self._offers_v2 + + @offers_v2.setter + def offers_v2(self, offers_v2): + """Sets the offers_v2 of this Item. + + + :param offers_v2: The offers_v2 of this Item. # noqa: E501 + :type: OffersV2 + """ + + self._offers_v2 = offers_v2 + @property def parent_asin(self): """Gets the parent_asin of this Item. # noqa: E501 diff --git a/amazon_paapi/sdk/models/item_id_type.py b/amazon_paapi/sdk/models/item_id_type.py index a9d0fdc..8661d91 100644 --- a/amazon_paapi/sdk/models/item_id_type.py +++ b/amazon_paapi/sdk/models/item_id_type.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/item_info.py b/amazon_paapi/sdk/models/item_info.py index c8c6343..3900f10 100644 --- a/amazon_paapi/sdk/models/item_info.py +++ b/amazon_paapi/sdk/models/item_info.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,17 +28,17 @@ import six -from .by_line_info import ByLineInfo # noqa: F401,E501 -from .classifications import Classifications # noqa: F401,E501 -from .content_info import ContentInfo # noqa: F401,E501 -from .content_rating import ContentRating # noqa: F401,E501 -from .external_ids import ExternalIds # noqa: F401,E501 -from .manufacture_info import ManufactureInfo # noqa: F401,E501 -from .multi_valued_attribute import MultiValuedAttribute # noqa: F401,E501 -from .product_info import ProductInfo # noqa: F401,E501 -from .single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 -from .technical_info import TechnicalInfo # noqa: F401,E501 -from .trade_in_info import TradeInInfo # noqa: F401,E501 +from ..models.by_line_info import ByLineInfo # noqa: F401,E501 +from ..models.classifications import Classifications # noqa: F401,E501 +from ..models.content_info import ContentInfo # noqa: F401,E501 +from ..models.content_rating import ContentRating # noqa: F401,E501 +from ..models.external_ids import ExternalIds # noqa: F401,E501 +from ..models.manufacture_info import ManufactureInfo # noqa: F401,E501 +from ..models.multi_valued_attribute import MultiValuedAttribute # noqa: F401,E501 +from ..models.product_info import ProductInfo # noqa: F401,E501 +from ..models.single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 +from ..models.technical_info import TechnicalInfo # noqa: F401,E501 +from ..models.trade_in_info import TradeInInfo # noqa: F401,E501 class ItemInfo(object): diff --git a/amazon_paapi/sdk/models/items_result.py b/amazon_paapi/sdk/models/items_result.py index 9465dcd..6c75f86 100644 --- a/amazon_paapi/sdk/models/items_result.py +++ b/amazon_paapi/sdk/models/items_result.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ import six -from .item import Item # noqa: F401,E501 +from ..models.item import Item # noqa: F401,E501 class ItemsResult(object): diff --git a/amazon_paapi/sdk/models/language_type.py b/amazon_paapi/sdk/models/language_type.py index e120cb9..55e80de 100644 --- a/amazon_paapi/sdk/models/language_type.py +++ b/amazon_paapi/sdk/models/language_type.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/languages.py b/amazon_paapi/sdk/models/languages.py index 51b99a0..c0f7cf2 100644 --- a/amazon_paapi/sdk/models/languages.py +++ b/amazon_paapi/sdk/models/languages.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ import six -from .language_type import LanguageType # noqa: F401,E501 +from ..models.language_type import LanguageType # noqa: F401,E501 class Languages(object): diff --git a/amazon_paapi/sdk/models/manufacture_info.py b/amazon_paapi/sdk/models/manufacture_info.py index ff82b41..3ca6a8a 100644 --- a/amazon_paapi/sdk/models/manufacture_info.py +++ b/amazon_paapi/sdk/models/manufacture_info.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ import six -from .single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 +from ..models.single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 class ManufactureInfo(object): diff --git a/amazon_paapi/sdk/models/max_price.py b/amazon_paapi/sdk/models/max_price.py index 03945e9..87cb869 100644 --- a/amazon_paapi/sdk/models/max_price.py +++ b/amazon_paapi/sdk/models/max_price.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/merchant.py b/amazon_paapi/sdk/models/merchant.py index 58f8579..c20a723 100644 --- a/amazon_paapi/sdk/models/merchant.py +++ b/amazon_paapi/sdk/models/merchant.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/min_price.py b/amazon_paapi/sdk/models/min_price.py index ab65367..2d6f6b9 100644 --- a/amazon_paapi/sdk/models/min_price.py +++ b/amazon_paapi/sdk/models/min_price.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/min_reviews_rating.py b/amazon_paapi/sdk/models/min_reviews_rating.py index af6bab1..26b8ae3 100644 --- a/amazon_paapi/sdk/models/min_reviews_rating.py +++ b/amazon_paapi/sdk/models/min_reviews_rating.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/min_saving_percent.py b/amazon_paapi/sdk/models/min_saving_percent.py index d32ca9b..f006e8c 100644 --- a/amazon_paapi/sdk/models/min_saving_percent.py +++ b/amazon_paapi/sdk/models/min_saving_percent.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/money.py b/amazon_paapi/sdk/models/money.py new file mode 100644 index 0000000..07d1284 --- /dev/null +++ b/amazon_paapi/sdk/models/money.py @@ -0,0 +1,181 @@ +# coding: utf-8 + +""" + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"). + You may not use this file except in compliance with the License. + A copy of the License is located at + + http://www.apache.org/licenses/LICENSE-2.0 + + or in the "license" file accompanying this file. This file is distributed + on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + express or implied. See the License for the specific language governing + permissions and limitations under the License. +""" + + +""" + ProductAdvertisingAPI + + https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 +""" + + +import pprint +import re # noqa: F401 + +import six + +from ..models.big_decimal import BigDecimal # noqa: F401,E501 + + +class Money(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'amount': 'BigDecimal', + 'currency': 'str', + 'display_amount': 'str' + } + + attribute_map = { + 'amount': 'Amount', + 'currency': 'Currency', + 'display_amount': 'DisplayAmount' + } + + def __init__(self, amount=None, currency=None, display_amount=None): # noqa: E501 + """Money - a model defined in Swagger""" # noqa: E501 + + self._amount = None + self._currency = None + self._display_amount = None + self.discriminator = None + + if amount is not None: + self.amount = amount + if currency is not None: + self.currency = currency + if display_amount is not None: + self.display_amount = display_amount + + @property + def amount(self): + """Gets the amount of this Money. # noqa: E501 + + + :return: The amount of this Money. # noqa: E501 + :rtype: BigDecimal + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this Money. + + + :param amount: The amount of this Money. # noqa: E501 + :type: BigDecimal + """ + + self._amount = amount + + @property + def currency(self): + """Gets the currency of this Money. # noqa: E501 + + + :return: The currency of this Money. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this Money. + + + :param currency: The currency of this Money. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def display_amount(self): + """Gets the display_amount of this Money. # noqa: E501 + + + :return: The display_amount of this Money. # noqa: E501 + :rtype: str + """ + return self._display_amount + + @display_amount.setter + def display_amount(self, display_amount): + """Sets the display_amount of this Money. + + + :param display_amount: The display_amount of this Money. # noqa: E501 + :type: str + """ + + self._display_amount = display_amount + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Money, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Money): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/amazon_paapi/sdk/models/multi_valued_attribute.py b/amazon_paapi/sdk/models/multi_valued_attribute.py index a35a46f..3ebfcf7 100644 --- a/amazon_paapi/sdk/models/multi_valued_attribute.py +++ b/amazon_paapi/sdk/models/multi_valued_attribute.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/offer_availability.py b/amazon_paapi/sdk/models/offer_availability.py index 6de3acf..6a0ee57 100644 --- a/amazon_paapi/sdk/models/offer_availability.py +++ b/amazon_paapi/sdk/models/offer_availability.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/offer_availability_v2.py b/amazon_paapi/sdk/models/offer_availability_v2.py new file mode 100644 index 0000000..13c8f35 --- /dev/null +++ b/amazon_paapi/sdk/models/offer_availability_v2.py @@ -0,0 +1,205 @@ +# coding: utf-8 + +""" + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"). + You may not use this file except in compliance with the License. + A copy of the License is located at + + http://www.apache.org/licenses/LICENSE-2.0 + + or in the "license" file accompanying this file. This file is distributed + on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + express or implied. See the License for the specific language governing + permissions and limitations under the License. +""" + + +""" + ProductAdvertisingAPI + + https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 +""" + + +import pprint +import re # noqa: F401 + +import six + + +class OfferAvailabilityV2(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'message': 'str', + 'max_order_quantity': 'int', + 'min_order_quantity': 'int', + 'type': 'str' + } + + attribute_map = { + 'message': 'Message', + 'max_order_quantity': 'MaxOrderQuantity', + 'min_order_quantity': 'MinOrderQuantity', + 'type': 'Type' + } + + def __init__(self, message=None, max_order_quantity=None, min_order_quantity=None, type=None): # noqa: E501 + """OfferAvailabilityV2 - a model defined in Swagger""" # noqa: E501 + + self._message = None + self._max_order_quantity = None + self._min_order_quantity = None + self._type = None + self.discriminator = None + + if message is not None: + self.message = message + if max_order_quantity is not None: + self.max_order_quantity = max_order_quantity + if min_order_quantity is not None: + self.min_order_quantity = min_order_quantity + if type is not None: + self.type = type + + @property + def message(self): + """Gets the message of this OfferAvailabilityV2. # noqa: E501 + + + :return: The message of this OfferAvailabilityV2. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this OfferAvailabilityV2. + + + :param message: The message of this OfferAvailabilityV2. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def max_order_quantity(self): + """Gets the max_order_quantity of this OfferAvailabilityV2. # noqa: E501 + + + :return: The max_order_quantity of this OfferAvailabilityV2. # noqa: E501 + :rtype: int + """ + return self._max_order_quantity + + @max_order_quantity.setter + def max_order_quantity(self, max_order_quantity): + """Sets the max_order_quantity of this OfferAvailabilityV2. + + + :param max_order_quantity: The max_order_quantity of this OfferAvailabilityV2. # noqa: E501 + :type: int + """ + + self._max_order_quantity = max_order_quantity + + @property + def min_order_quantity(self): + """Gets the min_order_quantity of this OfferAvailabilityV2. # noqa: E501 + + + :return: The min_order_quantity of this OfferAvailabilityV2. # noqa: E501 + :rtype: int + """ + return self._min_order_quantity + + @min_order_quantity.setter + def min_order_quantity(self, min_order_quantity): + """Sets the min_order_quantity of this OfferAvailabilityV2. + + + :param min_order_quantity: The min_order_quantity of this OfferAvailabilityV2. # noqa: E501 + :type: int + """ + + self._min_order_quantity = min_order_quantity + + @property + def type(self): + """Gets the type of this OfferAvailabilityV2. # noqa: E501 + + + :return: The type of this OfferAvailabilityV2. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this OfferAvailabilityV2. + + + :param type: The type of this OfferAvailabilityV2. # noqa: E501 + :type: str + """ + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OfferAvailabilityV2, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OfferAvailabilityV2): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/amazon_paapi/sdk/models/offer_condition.py b/amazon_paapi/sdk/models/offer_condition.py index ca5a7fa..442dc01 100644 --- a/amazon_paapi/sdk/models/offer_condition.py +++ b/amazon_paapi/sdk/models/offer_condition.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,8 +28,8 @@ import six -from .offer_condition_note import OfferConditionNote # noqa: F401,E501 -from .offer_sub_condition import OfferSubCondition # noqa: F401,E501 +from ..models.offer_condition_note import OfferConditionNote # noqa: F401,E501 +from ..models.offer_sub_condition import OfferSubCondition # noqa: F401,E501 class OfferCondition(object): diff --git a/amazon_paapi/sdk/models/offer_condition_note.py b/amazon_paapi/sdk/models/offer_condition_note.py index 0b4ad19..b312791 100644 --- a/amazon_paapi/sdk/models/offer_condition_note.py +++ b/amazon_paapi/sdk/models/offer_condition_note.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/offer_condition_v2.py b/amazon_paapi/sdk/models/offer_condition_v2.py new file mode 100644 index 0000000..a69a309 --- /dev/null +++ b/amazon_paapi/sdk/models/offer_condition_v2.py @@ -0,0 +1,179 @@ +# coding: utf-8 + +""" + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"). + You may not use this file except in compliance with the License. + A copy of the License is located at + + http://www.apache.org/licenses/LICENSE-2.0 + + or in the "license" file accompanying this file. This file is distributed + on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + express or implied. See the License for the specific language governing + permissions and limitations under the License. +""" + + +""" + ProductAdvertisingAPI + + https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 +""" + + +import pprint +import re # noqa: F401 + +import six + + +class OfferConditionV2(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'value': 'str', + 'sub_condition': 'str', + 'condition_note': 'str' + } + + attribute_map = { + 'value': 'Value', + 'sub_condition': 'SubCondition', + 'condition_note': 'ConditionNote' + } + + def __init__(self, value=None, sub_condition=None, condition_note=None): # noqa: E501 + """OfferConditionV2 - a model defined in Swagger""" # noqa: E501 + + self._value = None + self._sub_condition = None + self._condition_note = None + self.discriminator = None + + if value is not None: + self.value = value + if sub_condition is not None: + self.sub_condition = sub_condition + if condition_note is not None: + self.condition_note = condition_note + + @property + def value(self): + """Gets the value of this OfferConditionV2. # noqa: E501 + + + :return: The value of this OfferConditionV2. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this OfferConditionV2. + + + :param value: The value of this OfferConditionV2. # noqa: E501 + :type: str + """ + + self._value = value + + @property + def sub_condition(self): + """Gets the sub_condition of this OfferConditionV2. # noqa: E501 + + + :return: The sub_condition of this OfferConditionV2. # noqa: E501 + :rtype: str + """ + return self._sub_condition + + @sub_condition.setter + def sub_condition(self, sub_condition): + """Sets the sub_condition of this OfferConditionV2. + + + :param sub_condition: The sub_condition of this OfferConditionV2. # noqa: E501 + :type: str + """ + + self._sub_condition = sub_condition + + @property + def condition_note(self): + """Gets the condition_note of this OfferConditionV2. # noqa: E501 + + + :return: The condition_note of this OfferConditionV2. # noqa: E501 + :rtype: str + """ + return self._condition_note + + @condition_note.setter + def condition_note(self, condition_note): + """Sets the condition_note of this OfferConditionV2. + + + :param condition_note: The condition_note of this OfferConditionV2. # noqa: E501 + :type: str + """ + + self._condition_note = condition_note + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OfferConditionV2, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OfferConditionV2): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/amazon_paapi/sdk/models/offer_count.py b/amazon_paapi/sdk/models/offer_count.py index 0e93a78..31a570b 100644 --- a/amazon_paapi/sdk/models/offer_count.py +++ b/amazon_paapi/sdk/models/offer_count.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/offer_delivery_info.py b/amazon_paapi/sdk/models/offer_delivery_info.py index 4518af9..0a40c21 100644 --- a/amazon_paapi/sdk/models/offer_delivery_info.py +++ b/amazon_paapi/sdk/models/offer_delivery_info.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ import six -from .offer_shipping_charge import OfferShippingCharge # noqa: F401,E501 +from ..models.offer_shipping_charge import OfferShippingCharge # noqa: F401,E501 class OfferDeliveryInfo(object): diff --git a/amazon_paapi/sdk/models/offer_listing.py b/amazon_paapi/sdk/models/offer_listing.py index 58f4d61..3e1d701 100644 --- a/amazon_paapi/sdk/models/offer_listing.py +++ b/amazon_paapi/sdk/models/offer_listing.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,14 +28,14 @@ import six -from .offer_availability import OfferAvailability # noqa: F401,E501 -from .offer_condition import OfferCondition # noqa: F401,E501 -from .offer_delivery_info import OfferDeliveryInfo # noqa: F401,E501 -from .offer_loyalty_points import OfferLoyaltyPoints # noqa: F401,E501 -from .offer_merchant_info import OfferMerchantInfo # noqa: F401,E501 -from .offer_price import OfferPrice # noqa: F401,E501 -from .offer_program_eligibility import OfferProgramEligibility # noqa: F401,E501 -from .offer_promotion import OfferPromotion # noqa: F401,E501 +from ..models.offer_availability import OfferAvailability # noqa: F401,E501 +from ..models.offer_condition import OfferCondition # noqa: F401,E501 +from ..models.offer_delivery_info import OfferDeliveryInfo # noqa: F401,E501 +from ..models.offer_loyalty_points import OfferLoyaltyPoints # noqa: F401,E501 +from ..models.offer_merchant_info import OfferMerchantInfo # noqa: F401,E501 +from ..models.offer_price import OfferPrice # noqa: F401,E501 +from ..models.offer_program_eligibility import OfferProgramEligibility # noqa: F401,E501 +from ..models.offer_promotion import OfferPromotion # noqa: F401,E501 class OfferListing(object): diff --git a/amazon_paapi/sdk/models/offer_listing_v2.py b/amazon_paapi/sdk/models/offer_listing_v2.py new file mode 100644 index 0000000..a8bc904 --- /dev/null +++ b/amazon_paapi/sdk/models/offer_listing_v2.py @@ -0,0 +1,343 @@ +# coding: utf-8 + +""" + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"). + You may not use this file except in compliance with the License. + A copy of the License is located at + + http://www.apache.org/licenses/LICENSE-2.0 + + or in the "license" file accompanying this file. This file is distributed + on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + express or implied. See the License for the specific language governing + permissions and limitations under the License. +""" + + +""" + ProductAdvertisingAPI + + https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 +""" + + +import pprint +import re # noqa: F401 + +import six + +from ..models.deal_details import DealDetails # noqa: F401,E501 +from ..models.offer_availability_v2 import OfferAvailabilityV2 # noqa: F401,E501 +from ..models.offer_condition_v2 import OfferConditionV2 # noqa: F401,E501 +from ..models.offer_loyalty_points_v2 import OfferLoyaltyPointsV2 # noqa: F401,E501 +from ..models.offer_merchant_info_v2 import OfferMerchantInfoV2 # noqa: F401,E501 +from ..models.offer_price_v2 import OfferPriceV2 # noqa: F401,E501 +from ..models.offer_type import OfferType # noqa: F401,E501 + + +class OfferListingV2(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'availability': 'OfferAvailabilityV2', + 'condition': 'OfferConditionV2', + 'deal_details': 'DealDetails', + 'is_buy_box_winner': 'bool', + 'loyalty_points': 'OfferLoyaltyPointsV2', + 'merchant_info': 'OfferMerchantInfoV2', + 'price': 'OfferPriceV2', + 'type': 'OfferType', + 'violates_map': 'bool' + } + + attribute_map = { + 'availability': 'Availability', + 'condition': 'Condition', + 'deal_details': 'DealDetails', + 'is_buy_box_winner': 'IsBuyBoxWinner', + 'loyalty_points': 'LoyaltyPoints', + 'merchant_info': 'MerchantInfo', + 'price': 'Price', + 'type': 'Type', + 'violates_map': 'ViolatesMAP' + } + + def __init__(self, availability=None, condition=None, deal_details=None, is_buy_box_winner=None, loyalty_points=None, merchant_info=None, price=None, type=None, violates_map=None): # noqa: E501 + """OfferListingV2 - a model defined in Swagger""" # noqa: E501 + + self._availability = None + self._condition = None + self._deal_details = None + self._is_buy_box_winner = None + self._loyalty_points = None + self._merchant_info = None + self._price = None + self._type = None + self._violates_map = None + self.discriminator = None + + if availability is not None: + self.availability = availability + if condition is not None: + self.condition = condition + if deal_details is not None: + self.deal_details = deal_details + if is_buy_box_winner is not None: + self.is_buy_box_winner = is_buy_box_winner + if loyalty_points is not None: + self.loyalty_points = loyalty_points + if merchant_info is not None: + self.merchant_info = merchant_info + if price is not None: + self.price = price + if type is not None: + self.type = type + if violates_map is not None: + self.violates_map = violates_map + + @property + def availability(self): + """Gets the availability of this OfferListingV2. # noqa: E501 + + + :return: The availability of this OfferListingV2. # noqa: E501 + :rtype: OfferAvailabilityV2 + """ + return self._availability + + @availability.setter + def availability(self, availability): + """Sets the availability of this OfferListingV2. + + + :param availability: The availability of this OfferListingV2. # noqa: E501 + :type: OfferAvailabilityV2 + """ + + self._availability = availability + + @property + def condition(self): + """Gets the condition of this OfferListingV2. # noqa: E501 + + + :return: The condition of this OfferListingV2. # noqa: E501 + :rtype: OfferConditionV2 + """ + return self._condition + + @condition.setter + def condition(self, condition): + """Sets the condition of this OfferListingV2. + + + :param condition: The condition of this OfferListingV2. # noqa: E501 + :type: OfferConditionV2 + """ + + self._condition = condition + + @property + def deal_details(self): + """Gets the deal_details of this OfferListingV2. # noqa: E501 + + + :return: The deal_details of this OfferListingV2. # noqa: E501 + :rtype: DealDetails + """ + return self._deal_details + + @deal_details.setter + def deal_details(self, deal_details): + """Sets the deal_details of this OfferListingV2. + + + :param deal_details: The deal_details of this OfferListingV2. # noqa: E501 + :type: DealDetails + """ + + self._deal_details = deal_details + + @property + def is_buy_box_winner(self): + """Gets the is_buy_box_winner of this OfferListingV2. # noqa: E501 + + + :return: The is_buy_box_winner of this OfferListingV2. # noqa: E501 + :rtype: bool + """ + return self._is_buy_box_winner + + @is_buy_box_winner.setter + def is_buy_box_winner(self, is_buy_box_winner): + """Sets the is_buy_box_winner of this OfferListingV2. + + + :param is_buy_box_winner: The is_buy_box_winner of this OfferListingV2. # noqa: E501 + :type: bool + """ + + self._is_buy_box_winner = is_buy_box_winner + + @property + def loyalty_points(self): + """Gets the loyalty_points of this OfferListingV2. # noqa: E501 + + + :return: The loyalty_points of this OfferListingV2. # noqa: E501 + :rtype: OfferLoyaltyPointsV2 + """ + return self._loyalty_points + + @loyalty_points.setter + def loyalty_points(self, loyalty_points): + """Sets the loyalty_points of this OfferListingV2. + + + :param loyalty_points: The loyalty_points of this OfferListingV2. # noqa: E501 + :type: OfferLoyaltyPointsV2 + """ + + self._loyalty_points = loyalty_points + + @property + def merchant_info(self): + """Gets the merchant_info of this OfferListingV2. # noqa: E501 + + + :return: The merchant_info of this OfferListingV2. # noqa: E501 + :rtype: OfferMerchantInfoV2 + """ + return self._merchant_info + + @merchant_info.setter + def merchant_info(self, merchant_info): + """Sets the merchant_info of this OfferListingV2. + + + :param merchant_info: The merchant_info of this OfferListingV2. # noqa: E501 + :type: OfferMerchantInfoV2 + """ + + self._merchant_info = merchant_info + + @property + def price(self): + """Gets the price of this OfferListingV2. # noqa: E501 + + + :return: The price of this OfferListingV2. # noqa: E501 + :rtype: OfferPriceV2 + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this OfferListingV2. + + + :param price: The price of this OfferListingV2. # noqa: E501 + :type: OfferPriceV2 + """ + + self._price = price + + @property + def type(self): + """Gets the type of this OfferListingV2. # noqa: E501 + + + :return: The type of this OfferListingV2. # noqa: E501 + :rtype: OfferType + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this OfferListingV2. + + + :param type: The type of this OfferListingV2. # noqa: E501 + :type: OfferType + """ + + self._type = type + + @property + def violates_map(self): + """Gets the violates_map of this OfferListingV2. # noqa: E501 + + + :return: The violates_map of this OfferListingV2. # noqa: E501 + :rtype: bool + """ + return self._violates_map + + @violates_map.setter + def violates_map(self, violates_map): + """Sets the violates_map of this OfferListingV2. + + + :param violates_map: The violates_map of this OfferListingV2. # noqa: E501 + :type: bool + """ + + self._violates_map = violates_map + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OfferListingV2, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OfferListingV2): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/amazon_paapi/sdk/models/offer_listings.py b/amazon_paapi/sdk/models/offer_listings.py new file mode 100644 index 0000000..434c386 --- /dev/null +++ b/amazon_paapi/sdk/models/offer_listings.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"). + You may not use this file except in compliance with the License. + A copy of the License is located at + + http://www.apache.org/licenses/LICENSE-2.0 + + or in the "license" file accompanying this file. This file is distributed + on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + express or implied. See the License for the specific language governing + permissions and limitations under the License. +""" + + +""" + ProductAdvertisingAPI + + https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 +""" + + +import pprint +import re # noqa: F401 + +import six + +from ..models.offer_listing import OfferListing # noqa: F401,E501 + + +class OfferListings(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """OfferListings - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OfferListings, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OfferListings): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/amazon_paapi/sdk/models/offer_listings_v2.py b/amazon_paapi/sdk/models/offer_listings_v2.py new file mode 100644 index 0000000..c873ef5 --- /dev/null +++ b/amazon_paapi/sdk/models/offer_listings_v2.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"). + You may not use this file except in compliance with the License. + A copy of the License is located at + + http://www.apache.org/licenses/LICENSE-2.0 + + or in the "license" file accompanying this file. This file is distributed + on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + express or implied. See the License for the specific language governing + permissions and limitations under the License. +""" + + +""" + ProductAdvertisingAPI + + https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 +""" + + +import pprint +import re # noqa: F401 + +import six + +from ..models.offer_listing_v2 import OfferListingV2 # noqa: F401,E501 + + +class OfferListingsV2(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """OfferListingsV2 - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OfferListingsV2, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OfferListingsV2): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/amazon_paapi/sdk/models/offer_loyalty_points.py b/amazon_paapi/sdk/models/offer_loyalty_points.py index f94ffbc..64725b9 100644 --- a/amazon_paapi/sdk/models/offer_loyalty_points.py +++ b/amazon_paapi/sdk/models/offer_loyalty_points.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/offer_loyalty_points_v2.py b/amazon_paapi/sdk/models/offer_loyalty_points_v2.py new file mode 100644 index 0000000..f1897f6 --- /dev/null +++ b/amazon_paapi/sdk/models/offer_loyalty_points_v2.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"). + You may not use this file except in compliance with the License. + A copy of the License is located at + + http://www.apache.org/licenses/LICENSE-2.0 + + or in the "license" file accompanying this file. This file is distributed + on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + express or implied. See the License for the specific language governing + permissions and limitations under the License. +""" + + +""" + ProductAdvertisingAPI + + https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 +""" + + +import pprint +import re # noqa: F401 + +import six + + +class OfferLoyaltyPointsV2(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'points': 'int' + } + + attribute_map = { + 'points': 'Points' + } + + def __init__(self, points=None): # noqa: E501 + """OfferLoyaltyPointsV2 - a model defined in Swagger""" # noqa: E501 + + self._points = None + self.discriminator = None + + if points is not None: + self.points = points + + @property + def points(self): + """Gets the points of this OfferLoyaltyPointsV2. # noqa: E501 + + + :return: The points of this OfferLoyaltyPointsV2. # noqa: E501 + :rtype: int + """ + return self._points + + @points.setter + def points(self, points): + """Sets the points of this OfferLoyaltyPointsV2. + + + :param points: The points of this OfferLoyaltyPointsV2. # noqa: E501 + :type: int + """ + + self._points = points + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OfferLoyaltyPointsV2, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OfferLoyaltyPointsV2): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/amazon_paapi/sdk/models/offer_merchant_info.py b/amazon_paapi/sdk/models/offer_merchant_info.py index 3d0a614..4bbd8cb 100644 --- a/amazon_paapi/sdk/models/offer_merchant_info.py +++ b/amazon_paapi/sdk/models/offer_merchant_info.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/offer_merchant_info_v2.py b/amazon_paapi/sdk/models/offer_merchant_info_v2.py new file mode 100644 index 0000000..ded5dd2 --- /dev/null +++ b/amazon_paapi/sdk/models/offer_merchant_info_v2.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"). + You may not use this file except in compliance with the License. + A copy of the License is located at + + http://www.apache.org/licenses/LICENSE-2.0 + + or in the "license" file accompanying this file. This file is distributed + on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + express or implied. See the License for the specific language governing + permissions and limitations under the License. +""" + + +""" + ProductAdvertisingAPI + + https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 +""" + + +import pprint +import re # noqa: F401 + +import six + + +class OfferMerchantInfoV2(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'name': 'str', + 'id': 'str' + } + + attribute_map = { + 'name': 'Name', + 'id': 'Id' + } + + def __init__(self, name=None, id=None): # noqa: E501 + """OfferMerchantInfoV2 - a model defined in Swagger""" # noqa: E501 + + self._name = None + self._id = None + self.discriminator = None + + if name is not None: + self.name = name + if id is not None: + self.id = id + + @property + def name(self): + """Gets the name of this OfferMerchantInfoV2. # noqa: E501 + + + :return: The name of this OfferMerchantInfoV2. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this OfferMerchantInfoV2. + + + :param name: The name of this OfferMerchantInfoV2. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def id(self): + """Gets the id of this OfferMerchantInfoV2. # noqa: E501 + + + :return: The id of this OfferMerchantInfoV2. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this OfferMerchantInfoV2. + + + :param id: The id of this OfferMerchantInfoV2. # noqa: E501 + :type: str + """ + + self._id = id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OfferMerchantInfoV2, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OfferMerchantInfoV2): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/amazon_paapi/sdk/models/offer_price.py b/amazon_paapi/sdk/models/offer_price.py index 926aeb0..3ea6232 100644 --- a/amazon_paapi/sdk/models/offer_price.py +++ b/amazon_paapi/sdk/models/offer_price.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,8 +28,8 @@ import six -from .offer_savings import OfferSavings # noqa: F401,E501 -from .price_type import PriceType # noqa: F401,E501 +from ..models.offer_savings import OfferSavings # noqa: F401,E501 +from ..models.price_type import PriceType # noqa: F401,E501 class OfferPrice(object): diff --git a/amazon_paapi/sdk/models/offer_price_v2.py b/amazon_paapi/sdk/models/offer_price_v2.py new file mode 100644 index 0000000..383c838 --- /dev/null +++ b/amazon_paapi/sdk/models/offer_price_v2.py @@ -0,0 +1,209 @@ +# coding: utf-8 + +""" + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"). + You may not use this file except in compliance with the License. + A copy of the License is located at + + http://www.apache.org/licenses/LICENSE-2.0 + + or in the "license" file accompanying this file. This file is distributed + on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + express or implied. See the License for the specific language governing + permissions and limitations under the License. +""" + + +""" + ProductAdvertisingAPI + + https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 +""" + + +import pprint +import re # noqa: F401 + +import six + +from ..models.money import Money # noqa: F401,E501 +from ..models.offer_saving_basis import OfferSavingBasis # noqa: F401,E501 +from ..models.offer_savings_v2 import OfferSavingsV2 # noqa: F401,E501 + + +class OfferPriceV2(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'money': 'Money', + 'price_per_unit': 'Money', + 'savings': 'OfferSavingsV2', + 'saving_basis': 'OfferSavingBasis' + } + + attribute_map = { + 'money': 'Money', + 'price_per_unit': 'PricePerUnit', + 'savings': 'Savings', + 'saving_basis': 'SavingBasis' + } + + def __init__(self, money=None, price_per_unit=None, savings=None, saving_basis=None): # noqa: E501 + """OfferPriceV2 - a model defined in Swagger""" # noqa: E501 + + self._money = None + self._price_per_unit = None + self._savings = None + self._saving_basis = None + self.discriminator = None + + if money is not None: + self.money = money + if price_per_unit is not None: + self.price_per_unit = price_per_unit + if savings is not None: + self.savings = savings + if saving_basis is not None: + self.saving_basis = saving_basis + + @property + def money(self): + """Gets the money of this OfferPriceV2. # noqa: E501 + + + :return: The money of this OfferPriceV2. # noqa: E501 + :rtype: Money + """ + return self._money + + @money.setter + def money(self, money): + """Sets the money of this OfferPriceV2. + + + :param money: The money of this OfferPriceV2. # noqa: E501 + :type: Money + """ + + self._money = money + + @property + def price_per_unit(self): + """Gets the price_per_unit of this OfferPriceV2. # noqa: E501 + + + :return: The price_per_unit of this OfferPriceV2. # noqa: E501 + :rtype: Money + """ + return self._price_per_unit + + @price_per_unit.setter + def price_per_unit(self, price_per_unit): + """Sets the price_per_unit of this OfferPriceV2. + + + :param price_per_unit: The price_per_unit of this OfferPriceV2. # noqa: E501 + :type: Money + """ + + self._price_per_unit = price_per_unit + + @property + def savings(self): + """Gets the savings of this OfferPriceV2. # noqa: E501 + + + :return: The savings of this OfferPriceV2. # noqa: E501 + :rtype: OfferSavingsV2 + """ + return self._savings + + @savings.setter + def savings(self, savings): + """Sets the savings of this OfferPriceV2. + + + :param savings: The savings of this OfferPriceV2. # noqa: E501 + :type: OfferSavingsV2 + """ + + self._savings = savings + + @property + def saving_basis(self): + """Gets the saving_basis of this OfferPriceV2. # noqa: E501 + + + :return: The saving_basis of this OfferPriceV2. # noqa: E501 + :rtype: OfferSavingBasis + """ + return self._saving_basis + + @saving_basis.setter + def saving_basis(self, saving_basis): + """Sets the saving_basis of this OfferPriceV2. + + + :param saving_basis: The saving_basis of this OfferPriceV2. # noqa: E501 + :type: OfferSavingBasis + """ + + self._saving_basis = saving_basis + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OfferPriceV2, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OfferPriceV2): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/amazon_paapi/sdk/models/offer_program_eligibility.py b/amazon_paapi/sdk/models/offer_program_eligibility.py index 2e253ed..4b890ca 100644 --- a/amazon_paapi/sdk/models/offer_program_eligibility.py +++ b/amazon_paapi/sdk/models/offer_program_eligibility.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/offer_promotion.py b/amazon_paapi/sdk/models/offer_promotion.py index e5f522e..6987972 100644 --- a/amazon_paapi/sdk/models/offer_promotion.py +++ b/amazon_paapi/sdk/models/offer_promotion.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/offer_saving_basis.py b/amazon_paapi/sdk/models/offer_saving_basis.py new file mode 100644 index 0000000..9b70591 --- /dev/null +++ b/amazon_paapi/sdk/models/offer_saving_basis.py @@ -0,0 +1,182 @@ +# coding: utf-8 + +""" + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"). + You may not use this file except in compliance with the License. + A copy of the License is located at + + http://www.apache.org/licenses/LICENSE-2.0 + + or in the "license" file accompanying this file. This file is distributed + on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + express or implied. See the License for the specific language governing + permissions and limitations under the License. +""" + + +""" + ProductAdvertisingAPI + + https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 +""" + + +import pprint +import re # noqa: F401 + +import six + +from ..models.money import Money # noqa: F401,E501 +from ..models.saving_basis_type import SavingBasisType # noqa: F401,E501 + + +class OfferSavingBasis(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'money': 'Money', + 'saving_basis_type': 'SavingBasisType', + 'saving_basis_type_label': 'str' + } + + attribute_map = { + 'money': 'Money', + 'saving_basis_type': 'SavingBasisType', + 'saving_basis_type_label': 'SavingBasisTypeLabel' + } + + def __init__(self, money=None, saving_basis_type=None, saving_basis_type_label=None): # noqa: E501 + """OfferSavingBasis - a model defined in Swagger""" # noqa: E501 + + self._money = None + self._saving_basis_type = None + self._saving_basis_type_label = None + self.discriminator = None + + if money is not None: + self.money = money + if saving_basis_type is not None: + self.saving_basis_type = saving_basis_type + if saving_basis_type_label is not None: + self.saving_basis_type_label = saving_basis_type_label + + @property + def money(self): + """Gets the money of this OfferSavingBasis. # noqa: E501 + + + :return: The money of this OfferSavingBasis. # noqa: E501 + :rtype: Money + """ + return self._money + + @money.setter + def money(self, money): + """Sets the money of this OfferSavingBasis. + + + :param money: The money of this OfferSavingBasis. # noqa: E501 + :type: Money + """ + + self._money = money + + @property + def saving_basis_type(self): + """Gets the saving_basis_type of this OfferSavingBasis. # noqa: E501 + + + :return: The saving_basis_type of this OfferSavingBasis. # noqa: E501 + :rtype: SavingBasisType + """ + return self._saving_basis_type + + @saving_basis_type.setter + def saving_basis_type(self, saving_basis_type): + """Sets the saving_basis_type of this OfferSavingBasis. + + + :param saving_basis_type: The saving_basis_type of this OfferSavingBasis. # noqa: E501 + :type: SavingBasisType + """ + + self._saving_basis_type = saving_basis_type + + @property + def saving_basis_type_label(self): + """Gets the saving_basis_type_label of this OfferSavingBasis. # noqa: E501 + + + :return: The saving_basis_type_label of this OfferSavingBasis. # noqa: E501 + :rtype: str + """ + return self._saving_basis_type_label + + @saving_basis_type_label.setter + def saving_basis_type_label(self, saving_basis_type_label): + """Sets the saving_basis_type_label of this OfferSavingBasis. + + + :param saving_basis_type_label: The saving_basis_type_label of this OfferSavingBasis. # noqa: E501 + :type: str + """ + + self._saving_basis_type_label = saving_basis_type_label + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OfferSavingBasis, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OfferSavingBasis): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/amazon_paapi/sdk/models/offer_savings.py b/amazon_paapi/sdk/models/offer_savings.py index 4200240..e706ef7 100644 --- a/amazon_paapi/sdk/models/offer_savings.py +++ b/amazon_paapi/sdk/models/offer_savings.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/offer_savings_v2.py b/amazon_paapi/sdk/models/offer_savings_v2.py new file mode 100644 index 0000000..e857046 --- /dev/null +++ b/amazon_paapi/sdk/models/offer_savings_v2.py @@ -0,0 +1,155 @@ +# coding: utf-8 + +""" + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"). + You may not use this file except in compliance with the License. + A copy of the License is located at + + http://www.apache.org/licenses/LICENSE-2.0 + + or in the "license" file accompanying this file. This file is distributed + on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + express or implied. See the License for the specific language governing + permissions and limitations under the License. +""" + + +""" + ProductAdvertisingAPI + + https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 +""" + + +import pprint +import re # noqa: F401 + +import six + +from ..models.money import Money # noqa: F401,E501 + + +class OfferSavingsV2(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'money': 'Money', + 'percentage': 'int' + } + + attribute_map = { + 'money': 'Money', + 'percentage': 'Percentage' + } + + def __init__(self, money=None, percentage=None): # noqa: E501 + """OfferSavingsV2 - a model defined in Swagger""" # noqa: E501 + + self._money = None + self._percentage = None + self.discriminator = None + + if money is not None: + self.money = money + if percentage is not None: + self.percentage = percentage + + @property + def money(self): + """Gets the money of this OfferSavingsV2. # noqa: E501 + + + :return: The money of this OfferSavingsV2. # noqa: E501 + :rtype: Money + """ + return self._money + + @money.setter + def money(self, money): + """Sets the money of this OfferSavingsV2. + + + :param money: The money of this OfferSavingsV2. # noqa: E501 + :type: Money + """ + + self._money = money + + @property + def percentage(self): + """Gets the percentage of this OfferSavingsV2. # noqa: E501 + + + :return: The percentage of this OfferSavingsV2. # noqa: E501 + :rtype: int + """ + return self._percentage + + @percentage.setter + def percentage(self, percentage): + """Sets the percentage of this OfferSavingsV2. + + + :param percentage: The percentage of this OfferSavingsV2. # noqa: E501 + :type: int + """ + + self._percentage = percentage + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OfferSavingsV2, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OfferSavingsV2): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/amazon_paapi/sdk/models/offer_shipping_charge.py b/amazon_paapi/sdk/models/offer_shipping_charge.py index 1e9e17c..57d3f51 100644 --- a/amazon_paapi/sdk/models/offer_shipping_charge.py +++ b/amazon_paapi/sdk/models/offer_shipping_charge.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/offer_sub_condition.py b/amazon_paapi/sdk/models/offer_sub_condition.py index d3d36e6..a4b0f7f 100644 --- a/amazon_paapi/sdk/models/offer_sub_condition.py +++ b/amazon_paapi/sdk/models/offer_sub_condition.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/offer_summary.py b/amazon_paapi/sdk/models/offer_summary.py index c834583..443e693 100644 --- a/amazon_paapi/sdk/models/offer_summary.py +++ b/amazon_paapi/sdk/models/offer_summary.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,8 +28,8 @@ import six -from .offer_condition import OfferCondition # noqa: F401,E501 -from .offer_price import OfferPrice # noqa: F401,E501 +from ..models.offer_condition import OfferCondition # noqa: F401,E501 +from ..models.offer_price import OfferPrice # noqa: F401,E501 class OfferSummary(object): diff --git a/amazon_paapi/sdk/models/offer_type.py b/amazon_paapi/sdk/models/offer_type.py new file mode 100644 index 0000000..ad77e89 --- /dev/null +++ b/amazon_paapi/sdk/models/offer_type.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"). + You may not use this file except in compliance with the License. + A copy of the License is located at + + http://www.apache.org/licenses/LICENSE-2.0 + + or in the "license" file accompanying this file. This file is distributed + on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + express or implied. See the License for the specific language governing + permissions and limitations under the License. +""" + + +""" + ProductAdvertisingAPI + + https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 +""" + + +import pprint +import re # noqa: F401 + +import six + + +class OfferType(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + SUBSCRIBE_AND_SAVE = "SUBSCRIBE_AND_SAVE" + LIGHTNING_DEAL = "LIGHTNING_DEAL" + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """OfferType - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OfferType, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OfferType): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/amazon_paapi/sdk/models/offers.py b/amazon_paapi/sdk/models/offers.py index 5e38c4d..5b66169 100644 --- a/amazon_paapi/sdk/models/offers.py +++ b/amazon_paapi/sdk/models/offers.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,8 +28,8 @@ import six -from .offer_listing import OfferListing # noqa: F401,E501 -from .offer_summary import OfferSummary # noqa: F401,E501 +from ..models.offer_listing import OfferListing # noqa: F401,E501 +from ..models.offer_summary import OfferSummary # noqa: F401,E501 class Offers(object): diff --git a/amazon_paapi/sdk/models/offers_v2.py b/amazon_paapi/sdk/models/offers_v2.py new file mode 100644 index 0000000..e228991 --- /dev/null +++ b/amazon_paapi/sdk/models/offers_v2.py @@ -0,0 +1,129 @@ +# coding: utf-8 + +""" + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"). + You may not use this file except in compliance with the License. + A copy of the License is located at + + http://www.apache.org/licenses/LICENSE-2.0 + + or in the "license" file accompanying this file. This file is distributed + on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + express or implied. See the License for the specific language governing + permissions and limitations under the License. +""" + + +""" + ProductAdvertisingAPI + + https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 +""" + + +import pprint +import re # noqa: F401 + +import six + +from ..models.offer_listings_v2 import OfferListingsV2 # noqa: F401,E501 + + +class OffersV2(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'listings': 'OfferListingsV2' + } + + attribute_map = { + 'listings': 'Listings' + } + + def __init__(self, listings=None): # noqa: E501 + """OffersV2 - a model defined in Swagger""" # noqa: E501 + + self._listings = None + self.discriminator = None + + if listings is not None: + self.listings = listings + + @property + def listings(self): + """Gets the listings of this OffersV2. # noqa: E501 + + + :return: The listings of this OffersV2. # noqa: E501 + :rtype: OfferListingsV2 + """ + return self._listings + + @listings.setter + def listings(self, listings): + """Sets the listings of this OffersV2. + + + :param listings: The listings of this OffersV2. # noqa: E501 + :type: OfferListingsV2 + """ + + self._listings = listings + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OffersV2, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OffersV2): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/amazon_paapi/sdk/models/partner_type.py b/amazon_paapi/sdk/models/partner_type.py index 3e974f2..11c7fb1 100644 --- a/amazon_paapi/sdk/models/partner_type.py +++ b/amazon_paapi/sdk/models/partner_type.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/price.py b/amazon_paapi/sdk/models/price.py index 08db8fe..7735e6a 100644 --- a/amazon_paapi/sdk/models/price.py +++ b/amazon_paapi/sdk/models/price.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ import six -from .offer_price import OfferPrice # noqa: F401,E501 +from ..models.offer_price import OfferPrice # noqa: F401,E501 class Price(object): diff --git a/amazon_paapi/sdk/models/price_type.py b/amazon_paapi/sdk/models/price_type.py index edddd1d..563aad3 100644 --- a/amazon_paapi/sdk/models/price_type.py +++ b/amazon_paapi/sdk/models/price_type.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/product_advertising_api_client_exception.py b/amazon_paapi/sdk/models/product_advertising_api_client_exception.py index c58001e..f81c7eb 100644 --- a/amazon_paapi/sdk/models/product_advertising_api_client_exception.py +++ b/amazon_paapi/sdk/models/product_advertising_api_client_exception.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ import six -from .error_data import ErrorData # noqa: F401,E501 +from ..models.error_data import ErrorData # noqa: F401,E501 class ProductAdvertisingAPIClientException(object): diff --git a/amazon_paapi/sdk/models/product_advertising_api_service_exception.py b/amazon_paapi/sdk/models/product_advertising_api_service_exception.py index ab67fe7..efde7f4 100644 --- a/amazon_paapi/sdk/models/product_advertising_api_service_exception.py +++ b/amazon_paapi/sdk/models/product_advertising_api_service_exception.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/product_info.py b/amazon_paapi/sdk/models/product_info.py index fbd056a..cc30195 100644 --- a/amazon_paapi/sdk/models/product_info.py +++ b/amazon_paapi/sdk/models/product_info.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,10 +28,10 @@ import six -from .dimension_based_attribute import DimensionBasedAttribute # noqa: F401,E501 -from .single_boolean_valued_attribute import SingleBooleanValuedAttribute # noqa: F401,E501 -from .single_integer_valued_attribute import SingleIntegerValuedAttribute # noqa: F401,E501 -from .single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 +from ..models.dimension_based_attribute import DimensionBasedAttribute # noqa: F401,E501 +from ..models.single_boolean_valued_attribute import SingleBooleanValuedAttribute # noqa: F401,E501 +from ..models.single_integer_valued_attribute import SingleIntegerValuedAttribute # noqa: F401,E501 +from ..models.single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 class ProductInfo(object): diff --git a/amazon_paapi/sdk/models/properties.py b/amazon_paapi/sdk/models/properties.py index 39b34cd..c380967 100644 --- a/amazon_paapi/sdk/models/properties.py +++ b/amazon_paapi/sdk/models/properties.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/rating.py b/amazon_paapi/sdk/models/rating.py index 063c19a..c585c60 100644 --- a/amazon_paapi/sdk/models/rating.py +++ b/amazon_paapi/sdk/models/rating.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/refinement.py b/amazon_paapi/sdk/models/refinement.py index edb536d..292a0c9 100644 --- a/amazon_paapi/sdk/models/refinement.py +++ b/amazon_paapi/sdk/models/refinement.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ import six -from .refinement_bin import RefinementBin # noqa: F401,E501 +from ..models.refinement_bin import RefinementBin # noqa: F401,E501 class Refinement(object): diff --git a/amazon_paapi/sdk/models/refinement_bin.py b/amazon_paapi/sdk/models/refinement_bin.py index 7158e2a..7ba9c8f 100644 --- a/amazon_paapi/sdk/models/refinement_bin.py +++ b/amazon_paapi/sdk/models/refinement_bin.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/rental_offer_listing.py b/amazon_paapi/sdk/models/rental_offer_listing.py index 239775f..1b0f9fb 100644 --- a/amazon_paapi/sdk/models/rental_offer_listing.py +++ b/amazon_paapi/sdk/models/rental_offer_listing.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,11 +28,11 @@ import six -from .duration_price import DurationPrice # noqa: F401,E501 -from .offer_availability import OfferAvailability # noqa: F401,E501 -from .offer_condition import OfferCondition # noqa: F401,E501 -from .offer_delivery_info import OfferDeliveryInfo # noqa: F401,E501 -from .offer_merchant_info import OfferMerchantInfo # noqa: F401,E501 +from ..models.duration_price import DurationPrice # noqa: F401,E501 +from ..models.offer_availability import OfferAvailability # noqa: F401,E501 +from ..models.offer_condition import OfferCondition # noqa: F401,E501 +from ..models.offer_delivery_info import OfferDeliveryInfo # noqa: F401,E501 +from ..models.offer_merchant_info import OfferMerchantInfo # noqa: F401,E501 class RentalOfferListing(object): diff --git a/amazon_paapi/sdk/models/rental_offers.py b/amazon_paapi/sdk/models/rental_offers.py index 6fefcb2..0ebaf74 100644 --- a/amazon_paapi/sdk/models/rental_offers.py +++ b/amazon_paapi/sdk/models/rental_offers.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ import six -from .rental_offer_listing import RentalOfferListing # noqa: F401,E501 +from ..models.rental_offer_listing import RentalOfferListing # noqa: F401,E501 class RentalOffers(object): diff --git a/amazon_paapi/sdk/models/saving_basis_type.py b/amazon_paapi/sdk/models/saving_basis_type.py new file mode 100644 index 0000000..eedfd4f --- /dev/null +++ b/amazon_paapi/sdk/models/saving_basis_type.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"). + You may not use this file except in compliance with the License. + A copy of the License is located at + + http://www.apache.org/licenses/LICENSE-2.0 + + or in the "license" file accompanying this file. This file is distributed + on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + express or implied. See the License for the specific language governing + permissions and limitations under the License. +""" + + +""" + ProductAdvertisingAPI + + https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 +""" + + +import pprint +import re # noqa: F401 + +import six + + +class SavingBasisType(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + LIST_PRICE = "LIST_PRICE" + LOWEST_PRICE = "LOWEST_PRICE" + LOWEST_PRICE_STRIKETHROUGH = "LOWEST_PRICE_STRIKETHROUGH" + WAS_PRICE = "WAS_PRICE" + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """SavingBasisType - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SavingBasisType, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SavingBasisType): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/amazon_paapi/sdk/models/search_index.py b/amazon_paapi/sdk/models/search_index.py new file mode 100644 index 0000000..1e6637b --- /dev/null +++ b/amazon_paapi/sdk/models/search_index.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"). + You may not use this file except in compliance with the License. + A copy of the License is located at + + http://www.apache.org/licenses/LICENSE-2.0 + + or in the "license" file accompanying this file. This file is distributed + on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + express or implied. See the License for the specific language governing + permissions and limitations under the License. +""" + + +""" + ProductAdvertisingAPI + + https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 +""" + + +import pprint +import re # noqa: F401 + +import six + + +class SearchIndex(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """SearchIndex - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SearchIndex, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SearchIndex): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/amazon_paapi/sdk/models/search_items_request.py b/amazon_paapi/sdk/models/search_items_request.py index a8c74da..ae5383a 100644 --- a/amazon_paapi/sdk/models/search_items_request.py +++ b/amazon_paapi/sdk/models/search_items_request.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,19 +28,19 @@ import six -from .availability import Availability # noqa: F401,E501 -from .condition import Condition # noqa: F401,E501 -from .delivery_flag import DeliveryFlag # noqa: F401,E501 -from .max_price import MaxPrice # noqa: F401,E501 -from .merchant import Merchant # noqa: F401,E501 -from .min_price import MinPrice # noqa: F401,E501 -from .min_reviews_rating import MinReviewsRating # noqa: F401,E501 -from .min_saving_percent import MinSavingPercent # noqa: F401,E501 -from .offer_count import OfferCount # noqa: F401,E501 -from .partner_type import PartnerType # noqa: F401,E501 -from .properties import Properties # noqa: F401,E501 -from .search_items_resource import SearchItemsResource # noqa: F401,E501 -from .sort_by import SortBy # noqa: F401,E501 +from ..models.availability import Availability # noqa: F401,E501 +from ..models.condition import Condition # noqa: F401,E501 +from ..models.delivery_flag import DeliveryFlag # noqa: F401,E501 +from ..models.max_price import MaxPrice # noqa: F401,E501 +from ..models.merchant import Merchant # noqa: F401,E501 +from ..models.min_price import MinPrice # noqa: F401,E501 +from ..models.min_reviews_rating import MinReviewsRating # noqa: F401,E501 +from ..models.min_saving_percent import MinSavingPercent # noqa: F401,E501 +from ..models.offer_count import OfferCount # noqa: F401,E501 +from ..models.partner_type import PartnerType # noqa: F401,E501 +from ..models.properties import Properties # noqa: F401,E501 +from ..models.search_items_resource import SearchItemsResource # noqa: F401,E501 +from ..models.sort_by import SortBy # noqa: F401,E501 class SearchItemsRequest(object): diff --git a/amazon_paapi/sdk/models/search_items_resource.py b/amazon_paapi/sdk/models/search_items_resource.py index 5746772..36852c0 100644 --- a/amazon_paapi/sdk/models/search_items_resource.py +++ b/amazon_paapi/sdk/models/search_items_resource.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -83,6 +83,14 @@ class SearchItemsResource(object): OFFERS_SUMMARIES_HIGHESTPRICE = "Offers.Summaries.HighestPrice" OFFERS_SUMMARIES_LOWESTPRICE = "Offers.Summaries.LowestPrice" OFFERS_SUMMARIES_OFFERCOUNT = "Offers.Summaries.OfferCount" + OFFERSV2_LISTINGS_AVAILABILITY = "OffersV2.Listings.Availability" + OFFERSV2_LISTINGS_CONDITION = "OffersV2.Listings.Condition" + OFFERSV2_LISTINGS_DEALDETAILS = "OffersV2.Listings.DealDetails" + OFFERSV2_LISTINGS_ISBUYBOXWINNER = "OffersV2.Listings.IsBuyBoxWinner" + OFFERSV2_LISTINGS_LOYALTYPOINTS = "OffersV2.Listings.LoyaltyPoints" + OFFERSV2_LISTINGS_MERCHANTINFO = "OffersV2.Listings.MerchantInfo" + OFFERSV2_LISTINGS_PRICE = "OffersV2.Listings.Price" + OFFERSV2_LISTINGS_TYPE = "OffersV2.Listings.Type" PARENTASIN = "ParentASIN" RENTALOFFERS_LISTINGS_AVAILABILITY_MAXORDERQUANTITY = "RentalOffers.Listings.Availability.MaxOrderQuantity" RENTALOFFERS_LISTINGS_AVAILABILITY_MESSAGE = "RentalOffers.Listings.Availability.Message" diff --git a/amazon_paapi/sdk/models/search_items_response.py b/amazon_paapi/sdk/models/search_items_response.py index 34727b5..0d23313 100644 --- a/amazon_paapi/sdk/models/search_items_response.py +++ b/amazon_paapi/sdk/models/search_items_response.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,8 +28,8 @@ import six -from .error_data import ErrorData # noqa: F401,E501 -from .search_result import SearchResult # noqa: F401,E501 +from ..models.error_data import ErrorData # noqa: F401,E501 +from ..models.search_result import SearchResult # noqa: F401,E501 class SearchItemsResponse(object): diff --git a/amazon_paapi/sdk/models/search_refinements.py b/amazon_paapi/sdk/models/search_refinements.py index 7722283..fe18818 100644 --- a/amazon_paapi/sdk/models/search_refinements.py +++ b/amazon_paapi/sdk/models/search_refinements.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ import six -from .refinement import Refinement # noqa: F401,E501 +from ..models.refinement import Refinement # noqa: F401,E501 class SearchRefinements(object): diff --git a/amazon_paapi/sdk/models/search_result.py b/amazon_paapi/sdk/models/search_result.py index 27a3b99..5a27751 100644 --- a/amazon_paapi/sdk/models/search_result.py +++ b/amazon_paapi/sdk/models/search_result.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,8 +28,8 @@ import six -from .item import Item # noqa: F401,E501 -from .search_refinements import SearchRefinements # noqa: F401,E501 +from ..models.item import Item # noqa: F401,E501 +from ..models.search_refinements import SearchRefinements # noqa: F401,E501 class SearchResult(object): diff --git a/amazon_paapi/sdk/models/single_boolean_valued_attribute.py b/amazon_paapi/sdk/models/single_boolean_valued_attribute.py index 99757e5..2c8c9c6 100644 --- a/amazon_paapi/sdk/models/single_boolean_valued_attribute.py +++ b/amazon_paapi/sdk/models/single_boolean_valued_attribute.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/single_integer_valued_attribute.py b/amazon_paapi/sdk/models/single_integer_valued_attribute.py index f973d94..6fa1e4a 100644 --- a/amazon_paapi/sdk/models/single_integer_valued_attribute.py +++ b/amazon_paapi/sdk/models/single_integer_valued_attribute.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/single_string_valued_attribute.py b/amazon_paapi/sdk/models/single_string_valued_attribute.py index e97ce93..3cdd8bd 100644 --- a/amazon_paapi/sdk/models/single_string_valued_attribute.py +++ b/amazon_paapi/sdk/models/single_string_valued_attribute.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/sort_by.py b/amazon_paapi/sdk/models/sort_by.py index 3cc3ac1..8c925d3 100644 --- a/amazon_paapi/sdk/models/sort_by.py +++ b/amazon_paapi/sdk/models/sort_by.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/technical_info.py b/amazon_paapi/sdk/models/technical_info.py index 11e0b18..c54f483 100644 --- a/amazon_paapi/sdk/models/technical_info.py +++ b/amazon_paapi/sdk/models/technical_info.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,8 +28,8 @@ import six -from .multi_valued_attribute import MultiValuedAttribute # noqa: F401,E501 -from .single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 +from ..models.multi_valued_attribute import MultiValuedAttribute # noqa: F401,E501 +from ..models.single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 class TechnicalInfo(object): diff --git a/amazon_paapi/sdk/models/trade_in_info.py b/amazon_paapi/sdk/models/trade_in_info.py index d7caf2b..54bd2bd 100644 --- a/amazon_paapi/sdk/models/trade_in_info.py +++ b/amazon_paapi/sdk/models/trade_in_info.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ import six -from .trade_in_price import TradeInPrice # noqa: F401,E501 +from ..models.trade_in_price import TradeInPrice # noqa: F401,E501 class TradeInInfo(object): diff --git a/amazon_paapi/sdk/models/trade_in_price.py b/amazon_paapi/sdk/models/trade_in_price.py index c5cc9f2..3c84b4d 100644 --- a/amazon_paapi/sdk/models/trade_in_price.py +++ b/amazon_paapi/sdk/models/trade_in_price.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/unit_based_attribute.py b/amazon_paapi/sdk/models/unit_based_attribute.py index 8d55764..825fb39 100644 --- a/amazon_paapi/sdk/models/unit_based_attribute.py +++ b/amazon_paapi/sdk/models/unit_based_attribute.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/variation_attribute.py b/amazon_paapi/sdk/models/variation_attribute.py index 975c10f..404abaf 100644 --- a/amazon_paapi/sdk/models/variation_attribute.py +++ b/amazon_paapi/sdk/models/variation_attribute.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/variation_dimension.py b/amazon_paapi/sdk/models/variation_dimension.py index 5d15497..52aa1d5 100644 --- a/amazon_paapi/sdk/models/variation_dimension.py +++ b/amazon_paapi/sdk/models/variation_dimension.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/models/variation_summary.py b/amazon_paapi/sdk/models/variation_summary.py index 76738d0..0fb6c9c 100644 --- a/amazon_paapi/sdk/models/variation_summary.py +++ b/amazon_paapi/sdk/models/variation_summary.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,8 +28,8 @@ import six -from .price import Price # noqa: F401,E501 -from .variation_dimension import VariationDimension # noqa: F401,E501 +from ..models.price import Price # noqa: F401,E501 +from ..models.variation_dimension import VariationDimension # noqa: F401,E501 class VariationSummary(object): diff --git a/amazon_paapi/sdk/models/variations_result.py b/amazon_paapi/sdk/models/variations_result.py index 3e9a849..fa1169e 100644 --- a/amazon_paapi/sdk/models/variations_result.py +++ b/amazon_paapi/sdk/models/variations_result.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -28,8 +28,8 @@ import six -from .item import Item # noqa: F401,E501 -from .variation_summary import VariationSummary # noqa: F401,E501 +from ..models.item import Item # noqa: F401,E501 +from ..models.variation_summary import VariationSummary # noqa: F401,E501 class VariationsResult(object): diff --git a/amazon_paapi/sdk/models/website_sales_rank.py b/amazon_paapi/sdk/models/website_sales_rank.py index dac1891..c2b0dd7 100644 --- a/amazon_paapi/sdk/models/website_sales_rank.py +++ b/amazon_paapi/sdk/models/website_sales_rank.py @@ -1,7 +1,7 @@ # coding: utf-8 """ - Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. diff --git a/amazon_paapi/sdk/rest.py b/amazon_paapi/sdk/rest.py index ed043e6..99f57bb 100644 --- a/amazon_paapi/sdk/rest.py +++ b/amazon_paapi/sdk/rest.py @@ -5,7 +5,7 @@ from __future__ import absolute_import """ - Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. @@ -25,7 +25,6 @@ https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 """ - import io import json import logging diff --git a/pyproject.toml b/pyproject.toml index 4b814b3..80b0fc3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,7 +42,13 @@ build-backend = "hatchling.build" packages = ["amazon_paapi"] [dependency-groups] -dev = ["pre-commit>=2.21.0", "pytest>=7.4.4", "pytest-cov>=4.1.0"] +dev = [ + "mypy>=1.19.1", + "pre-commit>=2.21.0", + "pytest>=7.4.4", + "pytest-cov>=4.1.0", + "ruff>=0.14.11", +] [tool.ruff] target-version = "py39" diff --git a/tests/integration_test.py b/tests/integration_test.py index 2d38faf..ba4b273 100644 --- a/tests/integration_test.py +++ b/tests/integration_test.py @@ -3,36 +3,165 @@ from __future__ import annotations import os +from typing import TYPE_CHECKING, ClassVar, cast from unittest import TestCase, skipUnless from amazon_paapi.api import AmazonApi +if TYPE_CHECKING: + from amazon_paapi.models import BrowseNode, CountryCode + from amazon_paapi.models.item_result import Item + from amazon_paapi.models.search_result import SearchResult + from amazon_paapi.models.variations_result import VariationsResult -def get_api_credentials() -> tuple[str | None, str | None, str | None, str | None]: - api_key = os.environ.get("API_KEY") - api_secret = os.environ.get("API_SECRET") - affiliate_tag = os.environ.get("AFFILIATE_TAG") - country_code = os.environ.get("COUNTRY_CODE") - return api_key, api_secret, affiliate_tag, country_code +def get_api_credentials() -> tuple[str, str, str, CountryCode]: + """Get API credentials from environment variables. + Raises: + ValueError: If any required credential is missing. + """ + credentials = { + "API_KEY": os.environ.get("API_KEY"), + "API_SECRET": os.environ.get("API_SECRET"), + "AFFILIATE_TAG": os.environ.get("AFFILIATE_TAG"), + "COUNTRY_CODE": os.environ.get("COUNTRY_CODE"), + } -@skipUnless(all(get_api_credentials()), "Needs Amazon API credentials") + missing = [key for key, value in credentials.items() if value is None] + if missing: + msg = f"Missing environment variables: {', '.join(missing)}" + raise ValueError(msg) + + return ( + cast("str", credentials["API_KEY"]), + cast("str", credentials["API_SECRET"]), + cast("str", credentials["AFFILIATE_TAG"]), + cast("CountryCode", credentials["COUNTRY_CODE"]), + ) + + +def has_api_credentials() -> bool: + """Check if all API credentials are available.""" + try: + get_api_credentials() + except ValueError: + return False + return True + + +@skipUnless(has_api_credentials(), "Needs Amazon API credentials") class IntegrationTest(TestCase): + """Integration tests that make real API calls to Amazon. + + All API results are cached at class level to minimize the number of + requests. This reduces costs and avoids rate limiting. + """ + + api: ClassVar[AmazonApi] + affiliate_tag: ClassVar[str] + search_result: ClassVar[SearchResult] + item_with_offers: ClassVar[Item] + get_items_result: ClassVar[list[Item]] + variations_result: ClassVar[VariationsResult] + browse_nodes_result: ClassVar[list[BrowseNode]] + @classmethod - def setUpClass(cls): + def setUpClass(cls) -> None: + """Set up API client and make shared API calls once for all tests.""" api_key, api_secret, affiliate_tag, country_code = get_api_credentials() + cls.api = AmazonApi(api_key, api_secret, affiliate_tag, country_code) cls.affiliate_tag = affiliate_tag - def test_search_items_and_get_information_for_the_first_one(self): - search_result = self.api.search_items(keywords="zapatillas") - searched_item = search_result.items[0] + cls.search_result = cls.api.search_items(keywords="laptop") + + cls.item_with_offers = next( + (item for item in cls.search_result.items if item.offers_v2 is not None), + cls.search_result.items[0], + ) + cls.get_items_result = cls.api.get_items(cls.item_with_offers.asin) + + item_with_variations = next( + (item for item in cls.search_result.items if item.parent_asin), + cls.search_result.items[0], + ) + cls.variations_result = cls.api.get_variations( + item_with_variations.parent_asin or item_with_variations.asin + ) + + item_with_browse_nodes = next( + ( + item + for item in cls.search_result.items + if item.browse_node_info and item.browse_node_info.browse_nodes + ), + None, + ) + if item_with_browse_nodes: + browse_node_id = item_with_browse_nodes.browse_node_info.browse_nodes[0].id + cls.browse_nodes_result = cls.api.get_browse_nodes([browse_node_id]) + else: + cls.browse_nodes_result = [] - self.assertEqual(10, len(search_result.items)) + def test_search_items_returns_expected_count(self) -> None: + """Test that search returns the default number of items.""" + self.assertEqual(10, len(self.search_result.items)) + + def test_search_items_includes_affiliate_tag(self) -> None: + """Test that search results include the affiliate tag in URLs.""" + searched_item = self.search_result.items[0] self.assertIn(self.affiliate_tag, searched_item.detail_page_url) - get_results = self.api.get_items(searched_item.asin) + def test_search_items_returns_offers_v2(self) -> None: + """Test that search results include OffersV2 data.""" + self.assertGreater(len(self.search_result.items), 0) + + item = self.item_with_offers + self.assertIsNotNone(item.offers_v2) + + if item.offers_v2.listings: + listing = item.offers_v2.listings[0] + self.assertIsNotNone(listing) + + def test_get_items_returns_single_result(self) -> None: + """Test that get_items returns exactly one item when given one ASIN.""" + self.assertEqual(1, len(self.get_items_result)) + + def test_get_items_includes_affiliate_tag(self) -> None: + """Test that get_items results include the affiliate tag in URLs.""" + self.assertIn(self.affiliate_tag, self.get_items_result[0].detail_page_url) + + def test_get_items_returns_offers_v2(self) -> None: + """Test that get_items returns OffersV2 data.""" + item = self.get_items_result[0] + self.assertIsNotNone(item.offers_v2) + + if item.offers_v2.listings: + listing = item.offers_v2.listings[0] + self.assertIsNotNone(listing) + + def test_get_variations_returns_items(self) -> None: + """Test that get_variations returns a list of variation items.""" + self.assertIsNotNone(self.variations_result) + self.assertGreater(len(self.variations_result.items), 0) + + def test_get_variations_returns_variation_summary(self) -> None: + """Test that get_variations returns variation summary.""" + self.assertIsNotNone(self.variations_result.variation_summary) + self.assertGreater(self.variations_result.variation_summary.variation_count, 0) + + def test_get_variations_items_include_affiliate_tag(self) -> None: + """Test that variation items include the affiliate tag in URLs.""" + item = self.variations_result.items[0] + self.assertIn(self.affiliate_tag, item.detail_page_url) + + def test_get_browse_nodes_returns_results(self) -> None: + """Test that get_browse_nodes returns browse node information.""" + self.assertGreater(len(self.browse_nodes_result), 0) - self.assertEqual(1, len(get_results)) - self.assertIn(self.affiliate_tag, get_results[0].detail_page_url) + def test_get_browse_nodes_returns_node_info(self) -> None: + """Test that browse nodes contain expected information.""" + node = self.browse_nodes_result[0] + self.assertIsNotNone(node.id) + self.assertIsNotNone(node.display_name) diff --git a/tests/offersv2_test.py b/tests/offersv2_test.py new file mode 100644 index 0000000..eba94c0 --- /dev/null +++ b/tests/offersv2_test.py @@ -0,0 +1,79 @@ +"""Tests for OffersV2 functionality.""" + +import unittest + +from amazon_paapi.helpers import requests +from amazon_paapi.models.item_result import ( + ApiDealDetails, + ApiListingsV2, + ApiOfferPriceV2, + ApiOfferSavingBasis, + Item, +) +from amazon_paapi.sdk.models.get_items_resource import GetItemsResource +from amazon_paapi.sdk.models.get_variations_resource import GetVariationsResource +from amazon_paapi.sdk.models.search_items_resource import SearchItemsResource + +EXPECTED_OFFERSV2_RESOURCES = [ + "OffersV2.Listings.Availability", + "OffersV2.Listings.Condition", + "OffersV2.Listings.DealDetails", + "OffersV2.Listings.IsBuyBoxWinner", + "OffersV2.Listings.LoyaltyPoints", + "OffersV2.Listings.MerchantInfo", + "OffersV2.Listings.Price", + "OffersV2.Listings.Type", +] + + +class TestOffersV2Resources(unittest.TestCase): + """Test cases for OffersV2 resource constants.""" + + def test_get_items_resources_include_all_offersv2(self) -> None: + """Verify _get_request_resources includes all OffersV2 resources.""" + resources = requests._get_request_resources(GetItemsResource) + for resource in EXPECTED_OFFERSV2_RESOURCES: + self.assertIn(resource, resources) + + def test_search_items_resources_include_all_offersv2(self) -> None: + """Verify _get_request_resources includes all OffersV2 resources for search.""" + resources = requests._get_request_resources(SearchItemsResource) + for resource in EXPECTED_OFFERSV2_RESOURCES: + self.assertIn(resource, resources) + + def test_get_variations_resources_include_all_offersv2(self) -> None: + """Verify _get_request_resources includes OffersV2 resources.""" + resources = requests._get_request_resources(GetVariationsResource) + for resource in EXPECTED_OFFERSV2_RESOURCES: + self.assertIn(resource, resources) + + +class TestOffersV2Models(unittest.TestCase): + """Test cases for OffersV2 model structure.""" + + def test_item_has_offers_v2_attribute(self) -> None: + """Verify Item class has offers_v2 typed as ApiOffersV2.""" + self.assertIn("offers_v2", Item.__annotations__) + self.assertEqual(Item.__annotations__["offers_v2"], "ApiOffersV2") + + def test_api_listings_v2_has_required_attributes(self) -> None: + """Verify ApiListingsV2 has violates_map and deal_details.""" + annotations = ApiListingsV2.__annotations__ + self.assertIn("violates_map", annotations) + self.assertIn("deal_details", annotations) + + def test_api_deal_details_has_required_attributes(self) -> None: + """Verify ApiDealDetails has badge and access_type.""" + annotations = ApiDealDetails.__annotations__ + self.assertIn("badge", annotations) + self.assertIn("access_type", annotations) + + def test_api_offer_price_v2_has_required_attributes(self) -> None: + """Verify ApiOfferPriceV2 has money and savings.""" + annotations = ApiOfferPriceV2.__annotations__ + self.assertIn("money", annotations) + self.assertIn("savings", annotations) + + def test_api_offer_saving_basis_has_saving_basis_type(self) -> None: + """Verify ApiOfferSavingBasis has saving_basis_type.""" + self.assertIn("saving_basis_type", ApiOfferSavingBasis.__annotations__)