From dfbac1f47452a385022996dc90e7590dae0bf258 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Wed, 7 Jul 2021 00:05:43 +0200 Subject: [PATCH 01/67] Updated main class docstrings --- amazon_paapi/api.py | 55 ++++++++++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 20 deletions(-) diff --git a/amazon_paapi/api.py b/amazon_paapi/api.py index 56cf2fa..434197d 100644 --- a/amazon_paapi/api.py +++ b/amazon_paapi/api.py @@ -22,18 +22,19 @@ class AmazonApi: - """Creates an instance containing your API credentials. + """Provides methods to get information from Amazon using your API credentials. Args: key (str): Your API key. secret (str): Your API secret. - tag (str): The tag you want to use for the URL. - country (str): Country code. Use one of the following: + tag (str): Your affiliate tracking id, used to create the affiliate link. + country (str): Country code for your affiliate account. Compatible with AU, BR, CA, FR, DE, IN, IT, JP, MX, NL, PL, SG, SA, ES, TR, AE, UK, US, SE. - throttling (float, optional): It should be greater than 0 or False to disable throttling. - This value determines wait time between API calls. + throttling (float, optional): Wait time in seconds between API calls. Use it to avoid + reaching Amazon limits. Defaults to 1 second. """ - def __init__(self, key, secret, tag, country, throttling=0.8): + + def __init__(self, key: str, secret: str, tag: str, country: str, throttling: float = 1, **kwargs): self.key = key self.secret = secret self.tag = tag @@ -47,7 +48,8 @@ def __init__(self, key, secret, tag, country, throttling=0.8): if self.throttling <= 0: raise ValueError except ValueError: - raise AmazonException('ValueError', 'Throttling should be False or greater than 0') + raise AmazonException( + 'ValueError', 'Throttling should be False or greater than 0') self.country = country try: self.host = 'webservices.amazon.' + constants.DOMAINS[country] @@ -61,7 +63,8 @@ def __init__(self, key, secret, tag, country, throttling=0.8): def _throttle(self): if self.throttling: - wait_time = 1 / self.throttling - (time.time() - self.last_query_time) + wait_time = 1 / self.throttling - \ + (time.time() - self.last_query_time) if wait_time > 0: time.sleep(wait_time) self.last_query_time = time.time() @@ -91,7 +94,8 @@ def get_products(self, product_ids, condition='Any', merchant='All', if isinstance(product_ids, str): product_ids = [x.strip() for x in product_ids.split(',')] elif not isinstance(product_ids, list): - raise AmazonException('TypeError', 'Arg product_ids should be a list or string') + raise AmazonException( + 'TypeError', 'Arg product_ids should be a list or string') asin_full_list = list(set([get_asin(x) for x in product_ids])) asin_full_list = list(chunks(asin_full_list, 10)) @@ -225,11 +229,14 @@ def search_products(self, item_count=10, item_page=1, items_per_page=10, keyword or None if no results. """ if items_per_page > 10 or items_per_page < 1: - raise AmazonException('ValueError', 'Arg items_per_page should be between 1 and 10') + raise AmazonException( + 'ValueError', 'Arg items_per_page should be between 1 and 10') if item_count > 100 or item_count < 1: - raise AmazonException('ValueError', 'Arg item_count should be between 1 and 100') + raise AmazonException( + 'ValueError', 'Arg item_count should be between 1 and 100') if item_page < 1: - raise AmazonException('ValueError', 'Arg item_page should be 1 or higher') + raise AmazonException( + 'ValueError', 'Arg item_page should be 1 or higher') if not keywords and not actor and not artist and not author and not brand and not title and not browse_node and not search_index: raise AmazonException('ValueError', 'At least one of the following args must be ' 'provided: keywords, actor, artist, author, brand, ' @@ -291,7 +298,8 @@ def search_products(self, item_count=10, item_page=1, items_per_page=10, keyword else: break if response.errors is not None: - raise AmazonException(response.errors[0].code, response.errors[0].message) + raise AmazonException( + response.errors[0].code, response.errors[0].message) except Exception as e: if e.status == "NoResults": break @@ -330,11 +338,14 @@ def get_variations(self, asin, item_count=10, item_page=1, items_per_page=10, co or None if no results. """ if items_per_page > 10 or items_per_page < 1: - raise AmazonException('ValueError', 'Arg items_per_page should be between 1 and 10') + raise AmazonException( + 'ValueError', 'Arg items_per_page should be between 1 and 10') if item_count > 100 or item_count < 1: - raise AmazonException('ValueError', 'Arg item_count should be between 1 and 100') + raise AmazonException( + 'ValueError', 'Arg item_count should be between 1 and 100') if item_page < 1: - raise AmazonException('ValueError', 'Arg item_page should be 1 or higher') + raise AmazonException( + 'ValueError', 'Arg item_page should be 1 or higher') results = [] while len(results) < item_count: @@ -360,7 +371,8 @@ def get_variations(self, asin, item_count=10, item_page=1, items_per_page=10, co # Send the request and create results self._throttle() if async_req: - thread = self.api.get_variations(request, async_req=True) + thread = self.api.get_variations( + request, async_req=True) response = thread.get() else: response = self.api.get_variations(request) @@ -380,7 +392,8 @@ def get_variations(self, asin, item_count=10, item_page=1, items_per_page=10, co else: break if response.errors is not None: - raise AmazonException(response.errors[0].code, response.errors[0].message) + raise AmazonException( + response.errors[0].code, response.errors[0].message) except Exception as e: raise AmazonException('ResponseError', e) item_page += 1 @@ -430,10 +443,12 @@ def get_browsenodes(self, browse_nodes, async_req=False): try: if response.browse_nodes_result is not None: - res = [AmazonBrowseNode(item) for item in response.browse_nodes_result.browse_nodes] + res = [AmazonBrowseNode( + item) for item in response.browse_nodes_result.browse_nodes] return parse_browsenode(res) if response.errors is not None: - raise AmazonException(response.errors[0].code, response.errors[0].message) + raise AmazonException( + response.errors[0].code, response.errors[0].message) except TypeError as e: raise AmazonException("TypeError", e) except ValueError as e: From 74556e959d7902e2c7f56fa15ef9516dc4b1e195 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Wed, 7 Jul 2021 01:06:35 +0200 Subject: [PATCH 02/67] Changed exceptions and added InvalidArgumentException --- amazon_paapi/exceptions.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/amazon_paapi/exceptions.py b/amazon_paapi/exceptions.py index b0f7965..c3e1a67 100644 --- a/amazon_paapi/exceptions.py +++ b/amazon_paapi/exceptions.py @@ -1,11 +1,16 @@ -"""Custom exceptions class.""" +"""Custom exceptions module""" class AmazonException(Exception): - """Custom exceptions class for Amazon Product Advertising API.""" - def __init__(self, status=None, reason=None): - self.status = status - self.reason = reason + """Common base class for all Amazon API exceptions.""" + def __init__(self, message: str): + super().__init__() + self.message = message - def __str__(self): - return '%s: %s' % (self.status, self.reason) + def __str__(self) -> str: + return '%s' % self.message + + +class InvalidArgumentException(AmazonException): + """Raised when arguments are not correct.""" + pass From b4b9f5fd123d4d97daaf5e4ab45328ade7eea56d Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Wed, 7 Jul 2021 01:07:10 +0200 Subject: [PATCH 03/67] Made AmazonApi attributes private --- amazon_paapi/api.py | 75 +++++++++++++++++++-------------------------- 1 file changed, 32 insertions(+), 43 deletions(-) diff --git a/amazon_paapi/api.py b/amazon_paapi/api.py index 434197d..c960b0d 100644 --- a/amazon_paapi/api.py +++ b/amazon_paapi/api.py @@ -14,7 +14,7 @@ from .sdk.rest import ApiException from . import constants -from .exceptions import AmazonException +from .exceptions import AmazonException, InvalidArgumentException from .parse import parse_product, AmazonBrowseNode, parse_browsenode from .tools import get_asin, chunks @@ -35,39 +35,28 @@ class AmazonApi: """ def __init__(self, key: str, secret: str, tag: str, country: str, throttling: float = 1, **kwargs): - self.key = key - self.secret = secret - self.tag = tag - try: - if throttling is True: - raise ValueError - elif throttling is False: - self.throttling = False - else: - self.throttling = float(throttling) - if self.throttling <= 0: - raise ValueError - except ValueError: - raise AmazonException( - 'ValueError', 'Throttling should be False or greater than 0') - self.country = country + self._key = key + self._secret = secret + self._tag = tag + self._country = country + self._throttling = float(throttling) + self._last_query_time = time.time() - throttling + try: - self.host = 'webservices.amazon.' + constants.DOMAINS[country] - self.region = constants.REGIONS[country] - self.marketplace = 'www.amazon.' + constants.DOMAINS[country] + self._host = 'webservices.amazon.' + constants.DOMAINS[country] + self._region = constants.REGIONS[country] + self._marketplace = 'www.amazon.' + constants.DOMAINS[country] except KeyError: - raise AmazonException('KeyError', 'Invalid country code') - self.last_query_time = time.time() - self.api = DefaultApi(access_key=self.key, secret_key=self.secret, host=self.host, - region=self.region) + raise InvalidArgumentException('Country code is not correct') + + self._api = DefaultApi(key, secret, self._host, self._region) def _throttle(self): - if self.throttling: - wait_time = 1 / self.throttling - \ - (time.time() - self.last_query_time) + if self._throttling: + wait_time = self._throttling - (time.time() - self._last_query_time) if wait_time > 0: time.sleep(wait_time) - self.last_query_time = time.time() + self._last_query_time = time.time() def get_products(self, product_ids, condition='Any', merchant='All', async_req=False): @@ -102,9 +91,9 @@ def get_products(self, product_ids, condition='Any', merchant='All', results = [] for asin_list in asin_full_list: try: - request = GetItemsRequest(partner_tag=self.tag, + request = GetItemsRequest(partner_tag=self._tag, partner_type=PartnerType.ASSOCIATES, - marketplace=self.marketplace, + marketplace=self._marketplace, merchant=merchant, condition=constants.CONDITION[condition], item_ids=asin_list, @@ -119,10 +108,10 @@ def get_products(self, product_ids, condition='Any', merchant='All', # Send the request and create results self._throttle() if async_req: - thread = self.api.get_items(request, async_req=True) + thread = self._api.get_items(request, async_req=True) response = thread.get() else: - response = self.api.get_items(request) + response = self._api.get_items(request) break except ApiException as e: if x == 2: @@ -245,7 +234,7 @@ def search_products(self, item_count=10, item_page=1, items_per_page=10, keyword while len(results) < item_count: try: request = SearchItemsRequest( - partner_tag=self.tag, + partner_tag=self._tag, partner_type=PartnerType.ASSOCIATES, actor=actor, artist=artist, @@ -278,10 +267,10 @@ def search_products(self, item_count=10, item_page=1, items_per_page=10, keyword # Send the request and create results self._throttle() if async_req: - thread = self.api.search_items(request, async_req=True) + thread = self._api.search_items(request, async_req=True) response = thread.get() else: - response = self.api.search_items(request) + response = self._api.search_items(request) break except ApiException as e: if x == 2: @@ -351,9 +340,9 @@ def get_variations(self, asin, item_count=10, item_page=1, items_per_page=10, co while len(results) < item_count: try: request = GetVariationsRequest( - partner_tag=self.tag, + partner_tag=self._tag, partner_type=PartnerType.ASSOCIATES, - marketplace=self.marketplace, + marketplace=self._marketplace, asin=get_asin(asin), condition=constants.CONDITION[condition], merchant=merchant, @@ -371,11 +360,11 @@ def get_variations(self, asin, item_count=10, item_page=1, items_per_page=10, co # Send the request and create results self._throttle() if async_req: - thread = self.api.get_variations( + thread = self._api.get_variations( request, async_req=True) response = thread.get() else: - response = self.api.get_variations(request) + response = self._api.get_variations(request) break except ApiException as e: if x == 2: @@ -422,9 +411,9 @@ def get_browsenodes(self, browse_nodes, async_req=False): try: request = GetBrowseNodesRequest( - partner_tag=self.tag, + partner_tag=self._tag, partner_type=PartnerType.ASSOCIATES, - marketplace=self.marketplace, + marketplace=self._marketplace, browse_node_ids=browse_nodes, languages_of_preference=None, resources=constants.BROWSE_RESOURCES) @@ -434,10 +423,10 @@ def get_browsenodes(self, browse_nodes, async_req=False): try: self._throttle() if async_req: - thread = self.api.get_browse_nodes(request, async_req=True) + thread = self._api.get_browse_nodes(request, async_req=True) response = thread.get() else: - response = self.api.get_browse_nodes(request) + response = self._api.get_browse_nodes(request) except ApiException as e: raise AmazonException('ApiException', e) From 1e3a6010730a1af061b3a9d7b15708f762cdd9ce Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Wed, 7 Jul 2021 01:12:07 +0200 Subject: [PATCH 04/67] Moved and refactored throttle method --- amazon_paapi/api.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/amazon_paapi/api.py b/amazon_paapi/api.py index c960b0d..cc7801b 100644 --- a/amazon_paapi/api.py +++ b/amazon_paapi/api.py @@ -51,13 +51,6 @@ def __init__(self, key: str, secret: str, tag: str, country: str, throttling: fl self._api = DefaultApi(key, secret, self._host, self._region) - def _throttle(self): - if self._throttling: - wait_time = self._throttling - (time.time() - self._last_query_time) - if wait_time > 0: - time.sleep(wait_time) - self._last_query_time = time.time() - def get_products(self, product_ids, condition='Any', merchant='All', async_req=False): """Find product information for multiple products on Amazon. @@ -446,3 +439,9 @@ def get_browsenodes(self, browse_nodes, async_req=False): raise AmazonException(e.status, e.reason) except Exception as e: raise AmazonException("General", e) + + def _throttle(self): + wait_time = self._throttling - (time.time() - self._last_query_time) + if wait_time > 0: + time.sleep(wait_time) + self._last_query_time = time.time() From 49743169b88fb5fadc023f31e9ee3d95ec90833c Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Wed, 7 Jul 2021 01:23:37 +0200 Subject: [PATCH 05/67] Updated docstrings for get_products --- amazon_paapi/api.py | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/amazon_paapi/api.py b/amazon_paapi/api.py index cc7801b..22bc353 100644 --- a/amazon_paapi/api.py +++ b/amazon_paapi/api.py @@ -18,6 +18,7 @@ from .parse import parse_product, AmazonBrowseNode, parse_browsenode from .tools import get_asin, chunks +from typing import Union import time @@ -51,25 +52,19 @@ def __init__(self, key: str, secret: str, tag: str, country: str, throttling: fl self._api = DefaultApi(key, secret, self._host, self._region) - def get_products(self, product_ids, condition='Any', merchant='All', - async_req=False): + def get_products(self, product_ids: Union[str, list], condition='Any', merchant='All', **kwargs): """Find product information for multiple products on Amazon. Args: - product_ids (str|list): One or more item IDs like ASIN or product URL. - Use a string separated by comma or as a list. - condition (str, optional): Specify the product condition. - Allowed values: Any, Collectible, New, Refurbished, Used. - Defaults to Any. - merchant (str, optional): Filters search results to return items - having at least one offer sold by target merchant. Allowed values: - All, Amazon. Defaults to All. - async_req (bool, optional): Specify if a thread should be created to - run the request. Defaults to False. + product_ids (str|list): One or more item IDs like ASIN or product URL. Use a string + separated by comma or a list of strings. + condition (str, optional): Specify the product condition. Allowed values are + Any, Collectible, New, Refurbished and Used. Defaults to Any. + merchant (str, optional): Filters search results to return items having at least one + offer sold by the target merchant. Allowed values are All and Amazon. Defaults to All. Returns: - list of instances: A list containing 1 instance for each product - or None if no results. + list: A list containing 1 instance for each product or None if no results. """ # Clean up input data and remove 10 items limit from Amazon API From 35e3e3845411d15519d7a7f438266beb0b9e32ef Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Wed, 7 Jul 2021 19:06:42 +0200 Subject: [PATCH 06/67] Added tests for get_asin --- amazon_paapi/tools.py | 17 +++++------------ tests/__init__.py | 0 tests/test_tools.py | 9 +++++++++ 3 files changed, 14 insertions(+), 12 deletions(-) create mode 100644 tests/__init__.py create mode 100644 tests/test_tools.py diff --git a/amazon_paapi/tools.py b/amazon_paapi/tools.py index c67e29f..edaf988 100644 --- a/amazon_paapi/tools.py +++ b/amazon_paapi/tools.py @@ -3,20 +3,13 @@ import re -def get_asin(url: str): - """Find the ASIN from a given URL. - - Args: - url (str): The URL containing the product ASIN. - - Returns: - str: Product ASIN. None if ASIN not found. - """ +def get_asin(text: str) -> str: + """Returns the ASIN from a given text. Raises AsinNotFoundException on fail.""" # Return if url parameter already is the ASIN - if re.search(r'^[A-Z0-9]{10}$', url): - return url + if re.search(r'^[A-Z0-9]{10}$', text): + return text # Extract ASIN from URL searching for alphanumeric and 10 digits - have_asin = re.search(r'(dp|gp/product|gp/aw/d|dp/product)/([a-zA-Z0-9]{10})', url) + have_asin = re.search(r'(dp|gp/product|gp/aw/d|dp/product)/([a-zA-Z0-9]{10})', text) return have_asin.group(2) if have_asin else None diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_tools.py b/tests/test_tools.py new file mode 100644 index 0000000..b468be8 --- /dev/null +++ b/tests/test_tools.py @@ -0,0 +1,9 @@ +from amazon_paapi.tools import get_asin + + +def test_get_asin(): + assert get_asin('B01N5IB20Q') == 'B01N5IB20Q' + assert get_asin('https://www.amazon.es/gp/product/B07PHPXHQS') == 'B07PHPXHQS' + assert get_asin('https://www.amazon.es/dp/B07PKW4CKF?_encoding=UTF8&ref_=pocs_dp_m_sp_multi_c_more_nooffers_B08D1G2XVX') == 'B07PKW4CKF' + assert get_asin('https://www.amazon.es/dp/B07PKW4CKF') == 'B07PKW4CKF' + assert get_asin('https://www.amazon.es/gp/product/B07PHPXHQS?pf_rd_r=3FXDZDV1W6KY83KEE2Z4&pf_rd_p=c6fa5af0-ec7c-40de-8332-fd1421de4244&pd_rd_r=58786171-de0f-4fe1-a2df-ee335d6715ee&pd_rd_w=KND7A&pd_rd_wg=kIr5z&ref_=pd_gw_unk') == 'B07PHPXHQS' From c89f8433289729983070160a589b55d194fec171 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Wed, 7 Jul 2021 19:29:09 +0200 Subject: [PATCH 07/67] Finished tests for get_asin --- tests/test_tools.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/test_tools.py b/tests/test_tools.py index b468be8..9edf55d 100644 --- a/tests/test_tools.py +++ b/tests/test_tools.py @@ -1,9 +1,15 @@ +from amazon_paapi.exceptions import AsinNotFoundException from amazon_paapi.tools import get_asin +import pytest def test_get_asin(): assert get_asin('B01N5IB20Q') == 'B01N5IB20Q' assert get_asin('https://www.amazon.es/gp/product/B07PHPXHQS') == 'B07PHPXHQS' - assert get_asin('https://www.amazon.es/dp/B07PKW4CKF?_encoding=UTF8&ref_=pocs_dp_m_sp_multi_c_more_nooffers_B08D1G2XVX') == 'B07PKW4CKF' - assert get_asin('https://www.amazon.es/dp/B07PKW4CKF') == 'B07PKW4CKF' assert get_asin('https://www.amazon.es/gp/product/B07PHPXHQS?pf_rd_r=3FXDZDV1W6KY83KEE2Z4&pf_rd_p=c6fa5af0-ec7c-40de-8332-fd1421de4244&pd_rd_r=58786171-de0f-4fe1-a2df-ee335d6715ee&pd_rd_w=KND7A&pd_rd_wg=kIr5z&ref_=pd_gw_unk') == 'B07PHPXHQS' + assert get_asin('https://www.amazon.es/dp/B07PKW4CKF') == 'B07PKW4CKF' + assert get_asin('https://www.amazon.es/dp/B07PKW4CKF?_encoding=UTF8&ref_=pocs_dp_m_sp_multi_c_more_nooffers_B08D1G2XVX') == 'B07PKW4CKF' + with pytest.raises(AsinNotFoundException): + get_asin('https://www.amazon.es/gp/') + with pytest.raises(AsinNotFoundException): + get_asin('this is not even a URL') From fc48bdd8c9850f87e4155f4c07c4dc1a5e39ae2b Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Wed, 7 Jul 2021 19:29:28 +0200 Subject: [PATCH 08/67] Rafactored get_asin function --- amazon_paapi/tools.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/amazon_paapi/tools.py b/amazon_paapi/tools.py index edaf988..82a0e81 100644 --- a/amazon_paapi/tools.py +++ b/amazon_paapi/tools.py @@ -1,19 +1,18 @@ """Some useful tools.""" +from amazon_paapi.exceptions import AsinNotFoundException import re def get_asin(text: str) -> str: """Returns the ASIN from a given text. Raises AsinNotFoundException on fail.""" - # Return if url parameter already is the ASIN + # Return if text is an ASIN if re.search(r'^[A-Z0-9]{10}$', text): return text - # Extract ASIN from URL searching for alphanumeric and 10 digits - have_asin = re.search(r'(dp|gp/product|gp/aw/d|dp/product)/([a-zA-Z0-9]{10})', text) - return have_asin.group(2) if have_asin else None - -def chunks(lst, n): - """Yield successive n-sized chunks from lst.""" - for i in range(0, len(lst), n): - yield lst[i:i + n] + # Extract ASIN from URL searching for alphanumeric and 10 digits + asin = re.search(r'(dp|gp/product|gp/aw/d|dp/product)/([a-zA-Z0-9]{10})', text) + if asin: + return asin.group(2) + else: + raise AsinNotFoundException('Asin not found found') From 33ed4e4f530189a996a2dccf080457bfde472326 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Wed, 7 Jul 2021 19:29:46 +0200 Subject: [PATCH 09/67] Added generators module under helpers --- amazon_paapi/helpers/generators.py | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 amazon_paapi/helpers/generators.py diff --git a/amazon_paapi/helpers/generators.py b/amazon_paapi/helpers/generators.py new file mode 100644 index 0000000..fda23f1 --- /dev/null +++ b/amazon_paapi/helpers/generators.py @@ -0,0 +1,4 @@ +def chunks(lst, n): + """Yield successive n-sized chunks from lst.""" + for i in range(0, len(lst), n): + yield lst[i:i + n] From 6651ba46000ef82fd68497baa57e00223138cb01 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Wed, 7 Jul 2021 19:30:01 +0200 Subject: [PATCH 10/67] Added AsinNotFoundException --- amazon_paapi/exceptions.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/amazon_paapi/exceptions.py b/amazon_paapi/exceptions.py index c3e1a67..fa3dc3c 100644 --- a/amazon_paapi/exceptions.py +++ b/amazon_paapi/exceptions.py @@ -14,3 +14,8 @@ def __str__(self) -> str: class InvalidArgumentException(AmazonException): """Raised when arguments are not correct.""" pass + + +class AsinNotFoundException(AmazonException): + """Raised if the ASIN for an item is not found.""" + pass From 4e0f34e42222aa61e4f0ba5f1e2339d0a6b96661 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Wed, 7 Jul 2021 19:40:54 +0200 Subject: [PATCH 11/67] Added tests for get_items_ids --- tests/test_helpers_arguments.py | 17 +++++++++++++++++ tests/test_tools.py | 1 + 2 files changed, 18 insertions(+) create mode 100644 tests/test_helpers_arguments.py diff --git a/tests/test_helpers_arguments.py b/tests/test_helpers_arguments.py new file mode 100644 index 0000000..56c5371 --- /dev/null +++ b/tests/test_helpers_arguments.py @@ -0,0 +1,17 @@ +from amazon_paapi.exceptions import AsinNotFoundException, InvalidArgumentException +from amazon_paapi.helpers.arguments import get_items_ids +import pytest + + +def test_get_items_ids(): + amazon_url = 'https://www.amazon.es/gp/product/B07PHPXHQS' + assert get_items_ids('B01N5IB20Q') == ['B01N5IB20Q'] + assert get_items_ids('B01N5IB20Q,B01N5IB20Q,B01N5IB20Q') == ['B01N5IB20Q','B01N5IB20Q','B01N5IB20Q'] + assert get_items_ids(['B01N5IB20Q','B01N5IB20Q','B01N5IB20Q']) == ['B01N5IB20Q','B01N5IB20Q','B01N5IB20Q'] + assert get_items_ids(amazon_url) == ['B07PHPXHQS'] + assert get_items_ids([amazon_url,amazon_url]) == ['B07PHPXHQS', 'B07PHPXHQS'] + + with pytest.raises(AsinNotFoundException): + get_items_ids('https://www.amazon.es/gp/') + with pytest.raises(InvalidArgumentException): + get_items_ids(34) diff --git a/tests/test_tools.py b/tests/test_tools.py index 9edf55d..a8faf18 100644 --- a/tests/test_tools.py +++ b/tests/test_tools.py @@ -9,6 +9,7 @@ def test_get_asin(): assert get_asin('https://www.amazon.es/gp/product/B07PHPXHQS?pf_rd_r=3FXDZDV1W6KY83KEE2Z4&pf_rd_p=c6fa5af0-ec7c-40de-8332-fd1421de4244&pd_rd_r=58786171-de0f-4fe1-a2df-ee335d6715ee&pd_rd_w=KND7A&pd_rd_wg=kIr5z&ref_=pd_gw_unk') == 'B07PHPXHQS' assert get_asin('https://www.amazon.es/dp/B07PKW4CKF') == 'B07PKW4CKF' assert get_asin('https://www.amazon.es/dp/B07PKW4CKF?_encoding=UTF8&ref_=pocs_dp_m_sp_multi_c_more_nooffers_B08D1G2XVX') == 'B07PKW4CKF' + with pytest.raises(AsinNotFoundException): get_asin('https://www.amazon.es/gp/') with pytest.raises(AsinNotFoundException): From 558526352c7124fcd799a8631477cd4222206b46 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Wed, 7 Jul 2021 19:41:09 +0200 Subject: [PATCH 12/67] Added function get_items_ids --- amazon_paapi/helpers/arguments.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 amazon_paapi/helpers/arguments.py diff --git a/amazon_paapi/helpers/arguments.py b/amazon_paapi/helpers/arguments.py new file mode 100644 index 0000000..3e22198 --- /dev/null +++ b/amazon_paapi/helpers/arguments.py @@ -0,0 +1,18 @@ +"""Module with helper functions for managing arguments.""" + + +from ..tools import get_asin +from ..exceptions import InvalidArgumentException +from typing import Union + + +def get_items_ids(items: Union[str, list[str]]) -> list[str]: + if not isinstance(items, str) and not isinstance(items, list): + raise InvalidArgumentException('Invalid products argument, it should be a string or list of strings') + + if isinstance(items, str): + items_ids = items.split(',') + return [get_asin(x.strip()) for x in items_ids] + + else: + return [get_asin(x.strip()) for x in items] From 6255e5bf790b9da7c9c8427497dd8c2dc415ff41 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Wed, 7 Jul 2021 20:25:00 +0200 Subject: [PATCH 13/67] Refactored get_items method --- amazon_paapi/api.py | 69 +++++--------------- amazon_paapi/exceptions.py | 12 ++++ amazon_paapi/helpers/generators.py | 11 ++-- amazon_paapi/{parse.py => helpers/parser.py} | 0 amazon_paapi/helpers/requests.py | 32 +++++++++ 5 files changed, 69 insertions(+), 55 deletions(-) rename amazon_paapi/{parse.py => helpers/parser.py} (100%) create mode 100644 amazon_paapi/helpers/requests.py diff --git a/amazon_paapi/api.py b/amazon_paapi/api.py index 22bc353..b706614 100644 --- a/amazon_paapi/api.py +++ b/amazon_paapi/api.py @@ -5,6 +5,7 @@ an easier way. """ +from amazon_paapi.helpers.requests import get_items_request, get_items_response from .sdk.api.default_api import DefaultApi from .sdk.models.get_items_request import GetItemsRequest from .sdk.models.search_items_request import SearchItemsRequest @@ -14,9 +15,11 @@ from .sdk.rest import ApiException from . import constants -from .exceptions import AmazonException, InvalidArgumentException -from .parse import parse_product, AmazonBrowseNode, parse_browsenode -from .tools import get_asin, chunks +from .helpers.arguments import get_items_ids +from .exceptions import AmazonException, InvalidArgumentException, MalformedRequestException +from .helpers.parser import parse_product, AmazonBrowseNode, parse_browsenode +from .helpers.generators import get_list_chunks +from .tools import get_asin from typing import Union import time @@ -52,11 +55,11 @@ def __init__(self, key: str, secret: str, tag: str, country: str, throttling: fl self._api = DefaultApi(key, secret, self._host, self._region) - def get_products(self, product_ids: Union[str, list], condition='Any', merchant='All', **kwargs): + def get_items(self, items: Union[str, list[str]], **kwargs) -> list: """Find product information for multiple products on Amazon. Args: - product_ids (str|list): One or more item IDs like ASIN or product URL. Use a string + items (str | list[str]): One or more item IDs like ASIN or product URL. Use a string separated by comma or a list of strings. condition (str, optional): Specify the product condition. Allowed values are Any, Collectible, New, Refurbished and Used. Defaults to Any. @@ -67,55 +70,19 @@ def get_products(self, product_ids: Union[str, list], condition='Any', merchant= list: A list containing 1 instance for each product or None if no results. """ - # Clean up input data and remove 10 items limit from Amazon API - if isinstance(product_ids, str): - product_ids = [x.strip() for x in product_ids.split(',')] - elif not isinstance(product_ids, list): - raise AmazonException( - 'TypeError', 'Arg product_ids should be a list or string') - asin_full_list = list(set([get_asin(x) for x in product_ids])) - asin_full_list = list(chunks(asin_full_list, 10)) - + items_ids = get_items_ids(items) results = [] - for asin_list in asin_full_list: - try: - request = GetItemsRequest(partner_tag=self._tag, - partner_type=PartnerType.ASSOCIATES, - marketplace=self._marketplace, - merchant=merchant, - condition=constants.CONDITION[condition], - item_ids=asin_list, - resources=constants.PRODUCT_RESOURCES) - except KeyError: - raise AmazonException('KeyError', 'Invalid condition value') - except Exception as e: - raise AmazonException('GetItemsError', e) - for x in range(3): - try: - # Send the request and create results - self._throttle() - if async_req: - thread = self._api.get_items(request, async_req=True) - response = thread.get() - else: - response = self._api.get_items(request) - break - except ApiException as e: - if x == 2: - raise AmazonException('ApiException', e) - try: - if response.items_result is not None: - if len(response.items_result.items) > 0: - for item in response.items_result.items: - results.append(parse_product(item)) - except Exception as e: - raise AmazonException('ResponseError', e) + for asin_chunk in get_list_chunks(items_ids, 10): + request = get_items_request(self, asin_chunk, **kwargs) + self._throttle() + items_response = get_items_response(self, request) + + for item in items_response: + results.append(parse_product(item)) + + return results - if results: - return results - else: - return None def get_product(self, product_id, condition='Any', merchant='All', async_req=False): diff --git a/amazon_paapi/exceptions.py b/amazon_paapi/exceptions.py index fa3dc3c..a90e0d8 100644 --- a/amazon_paapi/exceptions.py +++ b/amazon_paapi/exceptions.py @@ -19,3 +19,15 @@ class InvalidArgumentException(AmazonException): class AsinNotFoundException(AmazonException): """Raised if the ASIN for an item is not found.""" pass + +class ApiRequestException(AmazonException): + """Raised if the request to Amazon API fails""" + pass + +class MalformedRequestException(AmazonException): + """Raised if the request for Amazon API is not correctly formed""" + pass + +class ItemsNotFoudException(AmazonException): + """Raised if no items are found""" + pass diff --git a/amazon_paapi/helpers/generators.py b/amazon_paapi/helpers/generators.py index fda23f1..ab54cc8 100644 --- a/amazon_paapi/helpers/generators.py +++ b/amazon_paapi/helpers/generators.py @@ -1,4 +1,7 @@ -def chunks(lst, n): - """Yield successive n-sized chunks from lst.""" - for i in range(0, len(lst), n): - yield lst[i:i + n] +"""Module with helper functions for making generators.""" + + +def get_list_chunks(full_list, chunk_size): + """Yield successive chunks from list.""" + for i in range(0, len(full_list), chunk_size): + yield full_list[i:i + chunk_size] diff --git a/amazon_paapi/parse.py b/amazon_paapi/helpers/parser.py similarity index 100% rename from amazon_paapi/parse.py rename to amazon_paapi/helpers/parser.py diff --git a/amazon_paapi/helpers/requests.py b/amazon_paapi/helpers/requests.py new file mode 100644 index 0000000..198a4ed --- /dev/null +++ b/amazon_paapi/helpers/requests.py @@ -0,0 +1,32 @@ +"""Module with helper functions for creating requests.""" + + +from ..sdk.rest import ApiException +from ..sdk.models.partner_type import PartnerType +from ..sdk.models.get_items_request import GetItemsRequest +from ..exceptions import ApiRequestException, ItemsNotFoudException, MalformedRequestException +from .. import constants + + +def get_items_request(self, asin_chunk, **kwargs): + try: + return GetItemsRequest(resources=constants.PRODUCT_RESOURCES, + partner_type=PartnerType.ASSOCIATES, + marketplace=self._marketplace, + partner_tag=self._tag, + item_ids=asin_chunk, + **kwargs) + except TypeError: + raise MalformedRequestException('Parameters for get_items request are not correct') + + +def get_items_response(self, request): + try: + response = self._api.get_items(request) + except ApiException as e: + raise ApiRequestException('Error getting a response from Amazon API: ' + str(e)) + + if response.items_result == None: + raise ItemsNotFoudException('No items have been found') + + return response.items_result.items From 21acc1cf335b6481ef59baf0b227f14feb680788 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Wed, 7 Jul 2021 20:41:48 +0200 Subject: [PATCH 14/67] Added country enum to constants --- amazon_paapi/api.py | 6 +++--- amazon_paapi/constants.py | 27 +++++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/amazon_paapi/api.py b/amazon_paapi/api.py index b706614..97724b7 100644 --- a/amazon_paapi/api.py +++ b/amazon_paapi/api.py @@ -47,9 +47,9 @@ def __init__(self, key: str, secret: str, tag: str, country: str, throttling: fl self._last_query_time = time.time() - throttling try: - self._host = 'webservices.amazon.' + constants.DOMAINS[country] - self._region = constants.REGIONS[country] - self._marketplace = 'www.amazon.' + constants.DOMAINS[country] + self._host = 'webservices.amazon.' + constants._DOMAINS[country] + self._region = constants._REGIONS[country] + self._marketplace = 'www.amazon.' + constants._DOMAINS[country] except KeyError: raise InvalidArgumentException('Country code is not correct') diff --git a/amazon_paapi/constants.py b/amazon_paapi/constants.py index 358a678..3221712 100644 --- a/amazon_paapi/constants.py +++ b/amazon_paapi/constants.py @@ -6,8 +6,31 @@ from .sdk.models.get_browse_nodes_resource import GetBrowseNodesResource from .sdk.models.condition import Condition + +class COUNTRY(object): + AU = 'AU' + BR = 'BR' + CA = 'CA' + FR = 'FR' + DE = 'DE' + IN = 'IN' + IT = 'IT' + JP = 'JP' + MX = 'MX' + NL = 'NL' + PL = 'PL' + SG = 'SG' + SA = 'SA' + ES = 'ES' + SE = 'SE' + TR = 'TR' + AE = 'AE' + UK = 'UK' + US = 'US' + + """Available regions for the Amazon API.""" -REGIONS = { +_REGIONS = { 'AU': 'us-west-2', 'BR': 'us-east-1', 'CA': 'us-east-1', @@ -30,7 +53,7 @@ } """Domains for each region on the Amazon API.""" -DOMAINS = { +_DOMAINS = { 'AU': 'com.au', 'BR': 'com.br', 'CA': 'ca', From 3bf7e5a773a41248cfabc3eafec6934e493dbb37 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Wed, 7 Jul 2021 22:31:02 +0200 Subject: [PATCH 15/67] Adjusted Country enum --- amazon_paapi/api.py | 2 +- amazon_paapi/constants.py | 71 +-------------------------------------- 2 files changed, 2 insertions(+), 71 deletions(-) diff --git a/amazon_paapi/api.py b/amazon_paapi/api.py index 97724b7..38df021 100644 --- a/amazon_paapi/api.py +++ b/amazon_paapi/api.py @@ -38,7 +38,7 @@ class AmazonApi: reaching Amazon limits. Defaults to 1 second. """ - def __init__(self, key: str, secret: str, tag: str, country: str, throttling: float = 1, **kwargs): + def __init__(self, key: str, secret: str, tag: str, country: constants.Country, throttling: float = 1, **kwargs): self._key = key self._secret = secret self._tag = tag diff --git a/amazon_paapi/constants.py b/amazon_paapi/constants.py index 3221712..9bcb92e 100644 --- a/amazon_paapi/constants.py +++ b/amazon_paapi/constants.py @@ -1,13 +1,11 @@ """Module containing all the constants.""" -from .sdk.models.get_items_resource import GetItemsResource from .sdk.models.search_items_resource import SearchItemsResource from .sdk.models.get_variations_resource import GetVariationsResource from .sdk.models.get_browse_nodes_resource import GetBrowseNodesResource -from .sdk.models.condition import Condition -class COUNTRY(object): +class Country(object): AU = 'AU' BR = 'BR' CA = 'CA' @@ -75,73 +73,6 @@ class COUNTRY(object): 'US': 'com', } -"""Condition values.""" -CONDITION = { - 'Any': Condition.ANY, - 'Collectible': Condition.COLLECTIBLE, - 'New': Condition.NEW, - 'Refurbished': Condition.REFURBISHED, - 'Used': Condition.USED -} - -"""Product resources to get from Amazon API.""" -PRODUCT_RESOURCES = [ - GetItemsResource.BROWSENODEINFO_BROWSENODES, - GetItemsResource.BROWSENODEINFO_BROWSENODES_ANCESTOR, - GetItemsResource.BROWSENODEINFO_BROWSENODES_SALESRANK, - GetItemsResource.BROWSENODEINFO_WEBSITESALESRANK, - GetItemsResource.IMAGES_PRIMARY_SMALL, - GetItemsResource.IMAGES_PRIMARY_MEDIUM, - GetItemsResource.IMAGES_PRIMARY_LARGE, - GetItemsResource.IMAGES_VARIANTS_SMALL, - GetItemsResource.IMAGES_VARIANTS_MEDIUM, - GetItemsResource.IMAGES_VARIANTS_LARGE, - GetItemsResource.ITEMINFO_BYLINEINFO, - GetItemsResource.ITEMINFO_CONTENTINFO, - GetItemsResource.ITEMINFO_CONTENTRATING, - GetItemsResource.ITEMINFO_CLASSIFICATIONS, - GetItemsResource.ITEMINFO_EXTERNALIDS, - GetItemsResource.ITEMINFO_FEATURES, - GetItemsResource.ITEMINFO_MANUFACTUREINFO, - GetItemsResource.ITEMINFO_PRODUCTINFO, - GetItemsResource.ITEMINFO_TECHNICALINFO, - GetItemsResource.ITEMINFO_TITLE, - GetItemsResource.ITEMINFO_TRADEININFO, - GetItemsResource.OFFERS_LISTINGS_AVAILABILITY_MAXORDERQUANTITY, - GetItemsResource.OFFERS_LISTINGS_AVAILABILITY_MESSAGE, - GetItemsResource.OFFERS_LISTINGS_AVAILABILITY_MINORDERQUANTITY, - GetItemsResource.OFFERS_LISTINGS_AVAILABILITY_TYPE, - GetItemsResource.OFFERS_LISTINGS_CONDITION, - GetItemsResource.OFFERS_LISTINGS_CONDITION_SUBCONDITION, - GetItemsResource.OFFERS_LISTINGS_DELIVERYINFO_ISAMAZONFULFILLED, - GetItemsResource.OFFERS_LISTINGS_DELIVERYINFO_ISFREESHIPPINGELIGIBLE, - GetItemsResource.OFFERS_LISTINGS_DELIVERYINFO_ISPRIMEELIGIBLE, - GetItemsResource.OFFERS_LISTINGS_DELIVERYINFO_SHIPPINGCHARGES, - GetItemsResource.OFFERS_LISTINGS_ISBUYBOXWINNER, - GetItemsResource.OFFERS_LISTINGS_LOYALTYPOINTS_POINTS, - GetItemsResource.OFFERS_LISTINGS_MERCHANTINFO, - GetItemsResource.OFFERS_LISTINGS_PRICE, - GetItemsResource.OFFERS_LISTINGS_PROGRAMELIGIBILITY_ISPRIMEEXCLUSIVE, - GetItemsResource.OFFERS_LISTINGS_PROGRAMELIGIBILITY_ISPRIMEPANTRY, - GetItemsResource.OFFERS_LISTINGS_PROMOTIONS, - GetItemsResource.OFFERS_LISTINGS_SAVINGBASIS, - GetItemsResource.OFFERS_SUMMARIES_HIGHESTPRICE, - GetItemsResource.OFFERS_SUMMARIES_LOWESTPRICE, - GetItemsResource.OFFERS_SUMMARIES_OFFERCOUNT, - GetItemsResource.PARENTASIN, - GetItemsResource.RENTALOFFERS_LISTINGS_AVAILABILITY_MAXORDERQUANTITY, - GetItemsResource.RENTALOFFERS_LISTINGS_AVAILABILITY_MESSAGE, - GetItemsResource.RENTALOFFERS_LISTINGS_AVAILABILITY_MINORDERQUANTITY, - GetItemsResource.RENTALOFFERS_LISTINGS_AVAILABILITY_TYPE, - GetItemsResource.RENTALOFFERS_LISTINGS_BASEPRICE, - GetItemsResource.RENTALOFFERS_LISTINGS_CONDITION, - GetItemsResource.RENTALOFFERS_LISTINGS_CONDITION_SUBCONDITION, - GetItemsResource.RENTALOFFERS_LISTINGS_DELIVERYINFO_ISAMAZONFULFILLED, - GetItemsResource.RENTALOFFERS_LISTINGS_DELIVERYINFO_ISFREESHIPPINGELIGIBLE, - GetItemsResource.RENTALOFFERS_LISTINGS_DELIVERYINFO_ISPRIMEELIGIBLE, - GetItemsResource.RENTALOFFERS_LISTINGS_DELIVERYINFO_SHIPPINGCHARGES, - GetItemsResource.RENTALOFFERS_LISTINGS_MERCHANTINFO] - """Search resources to get from Amazon API.""" SEARCH_RESOURCES = [ SearchItemsResource.BROWSENODEINFO_BROWSENODES, From 004d66b439ed4fba2c2437f3d0919b4e7b783c14 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Wed, 7 Jul 2021 22:31:30 +0200 Subject: [PATCH 16/67] Get request resources for get_items dinamically --- amazon_paapi/helpers/requests.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/amazon_paapi/helpers/requests.py b/amazon_paapi/helpers/requests.py index 198a4ed..919f6d7 100644 --- a/amazon_paapi/helpers/requests.py +++ b/amazon_paapi/helpers/requests.py @@ -1,25 +1,32 @@ """Module with helper functions for creating requests.""" +from amazon_paapi.sdk.models.get_items_resource import GetItemsResource from ..sdk.rest import ApiException from ..sdk.models.partner_type import PartnerType from ..sdk.models.get_items_request import GetItemsRequest from ..exceptions import ApiRequestException, ItemsNotFoudException, MalformedRequestException -from .. import constants +import inspect def get_items_request(self, asin_chunk, **kwargs): try: - return GetItemsRequest(resources=constants.PRODUCT_RESOURCES, - partner_type=PartnerType.ASSOCIATES, - marketplace=self._marketplace, - partner_tag=self._tag, - item_ids=asin_chunk, - **kwargs) + return GetItemsRequest(resources=_get_request_resources(), + partner_type=PartnerType.ASSOCIATES, + marketplace=self._marketplace, + partner_tag=self._tag, + item_ids=asin_chunk, + **kwargs) except TypeError: raise MalformedRequestException('Parameters for get_items request are not correct') +def _get_request_resources(): + resources = inspect.getmembers(GetItemsResource, lambda a:not(inspect.isroutine(a))) + resources = [x[-1] for x in resources if isinstance(x[-1], str) and x[0][0:2] != '__'] + return resources + + def get_items_response(self, request): try: response = self._api.get_items(request) From d7c2f382eb91b3988d9c19e8640bf3b9d2df6607 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Wed, 7 Jul 2021 22:39:44 +0200 Subject: [PATCH 17/67] Added get_asin to __init__ and adjusted function name --- amazon_paapi/__init__.py | 1 + amazon_paapi/helpers/requests.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/amazon_paapi/__init__.py b/amazon_paapi/__init__.py index dc57f67..621b9a5 100644 --- a/amazon_paapi/__init__.py +++ b/amazon_paapi/__init__.py @@ -3,3 +3,4 @@ __author__ = 'Sergio Abad' from .api import AmazonApi +from .tools import get_asin diff --git a/amazon_paapi/helpers/requests.py b/amazon_paapi/helpers/requests.py index 919f6d7..e067277 100644 --- a/amazon_paapi/helpers/requests.py +++ b/amazon_paapi/helpers/requests.py @@ -11,7 +11,7 @@ def get_items_request(self, asin_chunk, **kwargs): try: - return GetItemsRequest(resources=_get_request_resources(), + return GetItemsRequest(resources=_get_items_request_resources(), partner_type=PartnerType.ASSOCIATES, marketplace=self._marketplace, partner_tag=self._tag, @@ -21,7 +21,7 @@ def get_items_request(self, asin_chunk, **kwargs): raise MalformedRequestException('Parameters for get_items request are not correct') -def _get_request_resources(): +def _get_items_request_resources(): resources = inspect.getmembers(GetItemsResource, lambda a:not(inspect.isroutine(a))) resources = [x[-1] for x in resources if isinstance(x[-1], str) and x[0][0:2] != '__'] return resources From 930b593d1aaf68a8da64eb6f286c7a2b01f20bd7 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Wed, 7 Jul 2021 23:05:42 +0200 Subject: [PATCH 18/67] Created models module and import from SDK --- amazon_paapi/api.py | 21 ++- amazon_paapi/constants.py | 201 --------------------------- amazon_paapi/models/__init__.py | 2 + amazon_paapi/models/custom_models.py | 70 ++++++++++ 4 files changed, 82 insertions(+), 212 deletions(-) delete mode 100644 amazon_paapi/constants.py create mode 100644 amazon_paapi/models/__init__.py create mode 100644 amazon_paapi/models/custom_models.py diff --git a/amazon_paapi/api.py b/amazon_paapi/api.py index 38df021..3de7979 100644 --- a/amazon_paapi/api.py +++ b/amazon_paapi/api.py @@ -7,14 +7,13 @@ from amazon_paapi.helpers.requests import get_items_request, get_items_response from .sdk.api.default_api import DefaultApi -from .sdk.models.get_items_request import GetItemsRequest from .sdk.models.search_items_request import SearchItemsRequest from .sdk.models.get_variations_request import GetVariationsRequest from .sdk.models.get_browse_nodes_request import GetBrowseNodesRequest from .sdk.models.partner_type import PartnerType from .sdk.rest import ApiException -from . import constants +from . import models from .helpers.arguments import get_items_ids from .exceptions import AmazonException, InvalidArgumentException, MalformedRequestException from .helpers.parser import parse_product, AmazonBrowseNode, parse_browsenode @@ -38,7 +37,7 @@ class AmazonApi: reaching Amazon limits. Defaults to 1 second. """ - def __init__(self, key: str, secret: str, tag: str, country: constants.Country, throttling: float = 1, **kwargs): + def __init__(self, key: str, secret: str, tag: str, country: models.Country, throttling: float = 1, **kwargs): self._key = key self._secret = secret self._tag = tag @@ -47,9 +46,9 @@ def __init__(self, key: str, secret: str, tag: str, country: constants.Country, self._last_query_time = time.time() - throttling try: - self._host = 'webservices.amazon.' + constants._DOMAINS[country] - self._region = constants._REGIONS[country] - self._marketplace = 'www.amazon.' + constants._DOMAINS[country] + self._host = 'webservices.amazon.' + models._DOMAINS[country] + self._region = models._REGIONS[country] + self._marketplace = 'www.amazon.' + models._DOMAINS[country] except KeyError: raise InvalidArgumentException('Country code is not correct') @@ -197,7 +196,7 @@ def search_products(self, item_count=10, item_page=1, items_per_page=10, keyword availability=availability, brand=brand, browse_node_id=browse_node, - condition=constants.CONDITION[condition], + condition=models.CONDITION[condition], delivery_flags=delivery, item_count=items_per_page, item_page=item_page, @@ -208,7 +207,7 @@ def search_products(self, item_count=10, item_page=1, items_per_page=10, keyword min_reviews_rating=min_rating, min_saving_percent=min_discount, offer_count=1, - resources=constants.SEARCH_RESOURCES, + resources=models.SEARCH_RESOURCES, search_index=search_index, sort_by=sort_by, title=title) @@ -299,12 +298,12 @@ def get_variations(self, asin, item_count=10, item_page=1, items_per_page=10, co partner_type=PartnerType.ASSOCIATES, marketplace=self._marketplace, asin=get_asin(asin), - condition=constants.CONDITION[condition], + condition=models.CONDITION[condition], merchant=merchant, offer_count=1, variation_count=items_per_page, variation_page=item_page, - resources=constants.VARIATION_RESOURCES) + resources=models.VARIATION_RESOURCES) except KeyError: raise AmazonException('KeyError', 'Invalid condition value') except Exception as e: @@ -371,7 +370,7 @@ def get_browsenodes(self, browse_nodes, async_req=False): marketplace=self._marketplace, browse_node_ids=browse_nodes, languages_of_preference=None, - resources=constants.BROWSE_RESOURCES) + resources=models.BROWSE_RESOURCES) except ValueError as e: raise AmazonException("ValueError", e) diff --git a/amazon_paapi/constants.py b/amazon_paapi/constants.py deleted file mode 100644 index 9bcb92e..0000000 --- a/amazon_paapi/constants.py +++ /dev/null @@ -1,201 +0,0 @@ -"""Module containing all the constants.""" - -from .sdk.models.search_items_resource import SearchItemsResource -from .sdk.models.get_variations_resource import GetVariationsResource -from .sdk.models.get_browse_nodes_resource import GetBrowseNodesResource - - -class Country(object): - AU = 'AU' - BR = 'BR' - CA = 'CA' - FR = 'FR' - DE = 'DE' - IN = 'IN' - IT = 'IT' - JP = 'JP' - MX = 'MX' - NL = 'NL' - PL = 'PL' - SG = 'SG' - SA = 'SA' - ES = 'ES' - SE = 'SE' - TR = 'TR' - AE = 'AE' - UK = 'UK' - US = 'US' - - -"""Available regions for the Amazon API.""" -_REGIONS = { - 'AU': 'us-west-2', - 'BR': 'us-east-1', - 'CA': 'us-east-1', - 'FR': 'eu-west-1', - 'DE': 'eu-west-1', - 'IN': 'eu-west-1', - 'IT': 'eu-west-1', - 'JP': 'us-west-2', - 'MX': 'us-east-1', - 'NL': 'eu-west-1', - 'PL': 'eu-west-1', - 'SG': 'us-west-2', - 'SA': 'eu-west-1', - 'ES': 'eu-west-1', - 'SE': 'eu-west-1', - 'TR': 'eu-west-1', - 'AE': 'eu-west-1', - 'UK': 'eu-west-1', - 'US': 'us-east-1' -} - -"""Domains for each region on the Amazon API.""" -_DOMAINS = { - 'AU': 'com.au', - 'BR': 'com.br', - 'CA': 'ca', - 'FR': 'fr', - 'DE': 'de', - 'IN': 'in', - 'IT': 'it', - 'JP': 'co.jp', - 'MX': 'com.mx', - 'NL': 'nl', - 'PL': 'pl', - 'SG': 'sg', - 'SA': 'sa', - 'ES': 'es', - 'SE': 'se', - 'TR': 'com.tr', - 'AE': 'ae', - 'UK': 'co.uk', - 'US': 'com', -} - -"""Search resources to get from Amazon API.""" -SEARCH_RESOURCES = [ - SearchItemsResource.BROWSENODEINFO_BROWSENODES, - SearchItemsResource.BROWSENODEINFO_BROWSENODES_ANCESTOR, - SearchItemsResource.BROWSENODEINFO_BROWSENODES_SALESRANK, - SearchItemsResource.BROWSENODEINFO_WEBSITESALESRANK, - SearchItemsResource.IMAGES_PRIMARY_SMALL, - SearchItemsResource.IMAGES_PRIMARY_MEDIUM, - SearchItemsResource.IMAGES_PRIMARY_LARGE, - SearchItemsResource.IMAGES_VARIANTS_SMALL, - SearchItemsResource.IMAGES_VARIANTS_MEDIUM, - SearchItemsResource.IMAGES_VARIANTS_LARGE, - SearchItemsResource.ITEMINFO_BYLINEINFO, - SearchItemsResource.ITEMINFO_CONTENTINFO, - SearchItemsResource.ITEMINFO_CONTENTRATING, - SearchItemsResource.ITEMINFO_CLASSIFICATIONS, - SearchItemsResource.ITEMINFO_EXTERNALIDS, - SearchItemsResource.ITEMINFO_FEATURES, - SearchItemsResource.ITEMINFO_MANUFACTUREINFO, - SearchItemsResource.ITEMINFO_PRODUCTINFO, - SearchItemsResource.ITEMINFO_TECHNICALINFO, - SearchItemsResource.ITEMINFO_TITLE, - SearchItemsResource.ITEMINFO_TRADEININFO, - SearchItemsResource.OFFERS_LISTINGS_AVAILABILITY_MAXORDERQUANTITY, - SearchItemsResource.OFFERS_LISTINGS_AVAILABILITY_MESSAGE, - SearchItemsResource.OFFERS_LISTINGS_AVAILABILITY_MINORDERQUANTITY, - SearchItemsResource.OFFERS_LISTINGS_AVAILABILITY_TYPE, - SearchItemsResource.OFFERS_LISTINGS_CONDITION, - SearchItemsResource.OFFERS_LISTINGS_CONDITION_SUBCONDITION, - SearchItemsResource.OFFERS_LISTINGS_DELIVERYINFO_ISAMAZONFULFILLED, - SearchItemsResource.OFFERS_LISTINGS_DELIVERYINFO_ISFREESHIPPINGELIGIBLE, - SearchItemsResource.OFFERS_LISTINGS_DELIVERYINFO_ISPRIMEELIGIBLE, - SearchItemsResource.OFFERS_LISTINGS_DELIVERYINFO_SHIPPINGCHARGES, - SearchItemsResource.OFFERS_LISTINGS_ISBUYBOXWINNER, - SearchItemsResource.OFFERS_LISTINGS_LOYALTYPOINTS_POINTS, - SearchItemsResource.OFFERS_LISTINGS_MERCHANTINFO, - SearchItemsResource.OFFERS_LISTINGS_PRICE, - SearchItemsResource.OFFERS_LISTINGS_PROGRAMELIGIBILITY_ISPRIMEEXCLUSIVE, - SearchItemsResource.OFFERS_LISTINGS_PROGRAMELIGIBILITY_ISPRIMEPANTRY, - SearchItemsResource.OFFERS_LISTINGS_PROMOTIONS, - SearchItemsResource.OFFERS_LISTINGS_SAVINGBASIS, - SearchItemsResource.OFFERS_SUMMARIES_HIGHESTPRICE, - SearchItemsResource.OFFERS_SUMMARIES_LOWESTPRICE, - SearchItemsResource.OFFERS_SUMMARIES_OFFERCOUNT, - SearchItemsResource.PARENTASIN, - SearchItemsResource.RENTALOFFERS_LISTINGS_AVAILABILITY_MAXORDERQUANTITY, - SearchItemsResource.RENTALOFFERS_LISTINGS_AVAILABILITY_MESSAGE, - SearchItemsResource.RENTALOFFERS_LISTINGS_AVAILABILITY_MINORDERQUANTITY, - SearchItemsResource.RENTALOFFERS_LISTINGS_AVAILABILITY_TYPE, - SearchItemsResource.RENTALOFFERS_LISTINGS_BASEPRICE, - SearchItemsResource.RENTALOFFERS_LISTINGS_CONDITION, - SearchItemsResource.RENTALOFFERS_LISTINGS_CONDITION_SUBCONDITION, - SearchItemsResource.RENTALOFFERS_LISTINGS_DELIVERYINFO_ISAMAZONFULFILLED, - SearchItemsResource.RENTALOFFERS_LISTINGS_DELIVERYINFO_ISFREESHIPPINGELIGIBLE, - SearchItemsResource.RENTALOFFERS_LISTINGS_DELIVERYINFO_ISPRIMEELIGIBLE, - SearchItemsResource.RENTALOFFERS_LISTINGS_DELIVERYINFO_SHIPPINGCHARGES, - SearchItemsResource.RENTALOFFERS_LISTINGS_MERCHANTINFO, - SearchItemsResource.SEARCHREFINEMENTS] - -"""Variation resources to get from Amazon API.""" -VARIATION_RESOURCES = [ - GetVariationsResource.BROWSENODEINFO_BROWSENODES, - GetVariationsResource.BROWSENODEINFO_BROWSENODES_ANCESTOR, - GetVariationsResource.BROWSENODEINFO_BROWSENODES_SALESRANK, - GetVariationsResource.BROWSENODEINFO_WEBSITESALESRANK, - GetVariationsResource.IMAGES_PRIMARY_SMALL, - GetVariationsResource.IMAGES_PRIMARY_MEDIUM, - GetVariationsResource.IMAGES_PRIMARY_LARGE, - GetVariationsResource.IMAGES_VARIANTS_SMALL, - GetVariationsResource.IMAGES_VARIANTS_MEDIUM, - GetVariationsResource.IMAGES_VARIANTS_LARGE, - GetVariationsResource.ITEMINFO_BYLINEINFO, - GetVariationsResource.ITEMINFO_CONTENTINFO, - GetVariationsResource.ITEMINFO_CONTENTRATING, - GetVariationsResource.ITEMINFO_CLASSIFICATIONS, - GetVariationsResource.ITEMINFO_EXTERNALIDS, - GetVariationsResource.ITEMINFO_FEATURES, - GetVariationsResource.ITEMINFO_MANUFACTUREINFO, - GetVariationsResource.ITEMINFO_PRODUCTINFO, - GetVariationsResource.ITEMINFO_TECHNICALINFO, - GetVariationsResource.ITEMINFO_TITLE, - GetVariationsResource.ITEMINFO_TRADEININFO, - GetVariationsResource.OFFERS_LISTINGS_AVAILABILITY_MAXORDERQUANTITY, - GetVariationsResource.OFFERS_LISTINGS_AVAILABILITY_MESSAGE, - GetVariationsResource.OFFERS_LISTINGS_AVAILABILITY_MINORDERQUANTITY, - GetVariationsResource.OFFERS_LISTINGS_AVAILABILITY_TYPE, - GetVariationsResource.OFFERS_LISTINGS_CONDITION, - GetVariationsResource.OFFERS_LISTINGS_CONDITION_SUBCONDITION, - GetVariationsResource.OFFERS_LISTINGS_DELIVERYINFO_ISAMAZONFULFILLED, - GetVariationsResource.OFFERS_LISTINGS_DELIVERYINFO_ISFREESHIPPINGELIGIBLE, - GetVariationsResource.OFFERS_LISTINGS_DELIVERYINFO_ISPRIMEELIGIBLE, - GetVariationsResource.OFFERS_LISTINGS_DELIVERYINFO_SHIPPINGCHARGES, - GetVariationsResource.OFFERS_LISTINGS_ISBUYBOXWINNER, - GetVariationsResource.OFFERS_LISTINGS_LOYALTYPOINTS_POINTS, - GetVariationsResource.OFFERS_LISTINGS_MERCHANTINFO, - GetVariationsResource.OFFERS_LISTINGS_PRICE, - GetVariationsResource.OFFERS_LISTINGS_PROGRAMELIGIBILITY_ISPRIMEEXCLUSIVE, - GetVariationsResource.OFFERS_LISTINGS_PROGRAMELIGIBILITY_ISPRIMEPANTRY, - GetVariationsResource.OFFERS_LISTINGS_PROMOTIONS, - GetVariationsResource.OFFERS_LISTINGS_SAVINGBASIS, - GetVariationsResource.OFFERS_SUMMARIES_HIGHESTPRICE, - GetVariationsResource.OFFERS_SUMMARIES_LOWESTPRICE, - GetVariationsResource.OFFERS_SUMMARIES_OFFERCOUNT, - GetVariationsResource.PARENTASIN, - GetVariationsResource.RENTALOFFERS_LISTINGS_AVAILABILITY_MAXORDERQUANTITY, - GetVariationsResource.RENTALOFFERS_LISTINGS_AVAILABILITY_MESSAGE, - GetVariationsResource.RENTALOFFERS_LISTINGS_AVAILABILITY_MINORDERQUANTITY, - GetVariationsResource.RENTALOFFERS_LISTINGS_AVAILABILITY_TYPE, - GetVariationsResource.RENTALOFFERS_LISTINGS_BASEPRICE, - GetVariationsResource.RENTALOFFERS_LISTINGS_CONDITION, - GetVariationsResource.RENTALOFFERS_LISTINGS_CONDITION_SUBCONDITION, - GetVariationsResource.RENTALOFFERS_LISTINGS_DELIVERYINFO_ISAMAZONFULFILLED, - GetVariationsResource.RENTALOFFERS_LISTINGS_DELIVERYINFO_ISFREESHIPPINGELIGIBLE, - GetVariationsResource.RENTALOFFERS_LISTINGS_DELIVERYINFO_ISPRIMEELIGIBLE, - GetVariationsResource.RENTALOFFERS_LISTINGS_DELIVERYINFO_SHIPPINGCHARGES, - GetVariationsResource.RENTALOFFERS_LISTINGS_MERCHANTINFO, - GetVariationsResource.VARIATIONSUMMARY_PRICE_HIGHESTPRICE, - GetVariationsResource.VARIATIONSUMMARY_PRICE_LOWESTPRICE, - GetVariationsResource.VARIATIONSUMMARY_VARIATIONDIMENSION -] - -"""Browse Node resources to get from Amazon API.""" -BROWSE_RESOURCES = [ - GetBrowseNodesResource.ANCESTOR, - GetBrowseNodesResource.CHILDREN -] diff --git a/amazon_paapi/models/__init__.py b/amazon_paapi/models/__init__.py new file mode 100644 index 0000000..c44365c --- /dev/null +++ b/amazon_paapi/models/__init__.py @@ -0,0 +1,2 @@ +from ..sdk.models import * +from .custom_models import * diff --git a/amazon_paapi/models/custom_models.py b/amazon_paapi/models/custom_models.py new file mode 100644 index 0000000..f4813d4 --- /dev/null +++ b/amazon_paapi/models/custom_models.py @@ -0,0 +1,70 @@ +"""Module containing all the models.""" + + +class Country(object): + AU = 'AU' + BR = 'BR' + CA = 'CA' + FR = 'FR' + DE = 'DE' + IN = 'IN' + IT = 'IT' + JP = 'JP' + MX = 'MX' + NL = 'NL' + PL = 'PL' + SG = 'SG' + SA = 'SA' + ES = 'ES' + SE = 'SE' + TR = 'TR' + AE = 'AE' + UK = 'UK' + US = 'US' + + +"""Available regions for the Amazon API.""" +_REGIONS = { + 'AU': 'us-west-2', + 'BR': 'us-east-1', + 'CA': 'us-east-1', + 'FR': 'eu-west-1', + 'DE': 'eu-west-1', + 'IN': 'eu-west-1', + 'IT': 'eu-west-1', + 'JP': 'us-west-2', + 'MX': 'us-east-1', + 'NL': 'eu-west-1', + 'PL': 'eu-west-1', + 'SG': 'us-west-2', + 'SA': 'eu-west-1', + 'ES': 'eu-west-1', + 'SE': 'eu-west-1', + 'TR': 'eu-west-1', + 'AE': 'eu-west-1', + 'UK': 'eu-west-1', + 'US': 'us-east-1' +} + +"""Domains for each region on the Amazon API.""" +_DOMAINS = { + 'AU': 'com.au', + 'BR': 'com.br', + 'CA': 'ca', + 'FR': 'fr', + 'DE': 'de', + 'IN': 'in', + 'IT': 'it', + 'JP': 'co.jp', + 'MX': 'com.mx', + 'NL': 'nl', + 'PL': 'pl', + 'SG': 'sg', + 'SA': 'sa', + 'ES': 'es', + 'SE': 'se', + 'TR': 'com.tr', + 'AE': 'ae', + 'UK': 'co.uk', + 'US': 'com', +} From 5b2c6d1c5a498819fc968615c65938854fe7906a Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Wed, 7 Jul 2021 23:38:14 +0200 Subject: [PATCH 19/67] Updated get_items docstrings --- amazon_paapi/api.py | 26 +++++++++++++++++--------- amazon_paapi/models/custom_models.py | 4 ++-- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/amazon_paapi/api.py b/amazon_paapi/api.py index 3de7979..bda99e5 100644 --- a/amazon_paapi/api.py +++ b/amazon_paapi/api.py @@ -46,27 +46,35 @@ def __init__(self, key: str, secret: str, tag: str, country: models.Country, thr self._last_query_time = time.time() - throttling try: - self._host = 'webservices.amazon.' + models._DOMAINS[country] - self._region = models._REGIONS[country] - self._marketplace = 'www.amazon.' + models._DOMAINS[country] + self._host = 'webservices.amazon.' + models.DOMAINS[country] + self._region = models.REGIONS[country] + self._marketplace = 'www.amazon.' + models.DOMAINS[country] except KeyError: raise InvalidArgumentException('Country code is not correct') self._api = DefaultApi(key, secret, self._host, self._region) def get_items(self, items: Union[str, list[str]], **kwargs) -> list: - """Find product information for multiple products on Amazon. + """Get items information from Amazon. + Full official documentation [here](https://webservices.amazon.com/paapi5/documentation/get-items.html#ItemLookup-rp). Args: - items (str | list[str]): One or more item IDs like ASIN or product URL. Use a string + items (str | list[str]): One or more items using ASIN or product URL. Use a string separated by comma or a list of strings. - condition (str, optional): Specify the product condition. Allowed values are - Any, Collectible, New, Refurbished and Used. Defaults to Any. + condition (str, optional): The condition parameter filters offers by condition type. + Available values in models.Condition. Defaults to Any. + currency_of_preference (str, optional): Currency of preference in which the prices + information should be returned in response. By default the prices are returned + in the default currency of the marketplace. Expected currency code format is + ISO 4217. + languages_of_preference (list[str], optional): Languages in order of preference in + which the item information should be returned in response. By default the item + information is returned in the default language of the marketplace. merchant (str, optional): Filters search results to return items having at least one - offer sold by the target merchant. Allowed values are All and Amazon. Defaults to All. + offer sold by target merchant. Available values in models.Merchant. Defaults to All. Returns: - list: A list containing 1 instance for each product or None if no results. + list: A list of items. """ items_ids = get_items_ids(items) diff --git a/amazon_paapi/models/custom_models.py b/amazon_paapi/models/custom_models.py index f4813d4..eedfd5e 100644 --- a/amazon_paapi/models/custom_models.py +++ b/amazon_paapi/models/custom_models.py @@ -24,7 +24,7 @@ class Country(object): """Available regions for the Amazon API.""" -_REGIONS = { +REGIONS = { 'AU': 'us-west-2', 'BR': 'us-east-1', 'CA': 'us-east-1', @@ -47,7 +47,7 @@ class Country(object): } """Domains for each region on the Amazon API.""" -_DOMAINS = { +DOMAINS = { 'AU': 'com.au', 'BR': 'com.br', 'CA': 'ca', From c86ac63f5e284a4e919a0234a105cdacfb8c18cd Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Wed, 7 Jul 2021 23:46:52 +0200 Subject: [PATCH 20/67] Removed get_item method --- amazon_paapi/api.py | 32 ------------------------------- amazon_paapi/helpers/arguments.py | 2 +- 2 files changed, 1 insertion(+), 33 deletions(-) diff --git a/amazon_paapi/api.py b/amazon_paapi/api.py index bda99e5..7cafd00 100644 --- a/amazon_paapi/api.py +++ b/amazon_paapi/api.py @@ -90,38 +90,6 @@ def get_items(self, items: Union[str, list[str]], **kwargs) -> list: return results - - def get_product(self, product_id, condition='Any', merchant='All', - async_req=False): - """Find product information for a specific product on Amazon. - - Args: - product_id (str, list): One item ID like ASIN or product URL. - condition (str, optional): Specify the product condition. - Allowed values: Any, Collectible, New, Refurbished, Used. - Defaults to Any. - merchant (str, optional): Filters search results to return items - having at least one offer sold by target merchant. Allowed values: - All, Amazon. Defaults to All. - async_req (bool, optional): Specify if a thread should be created to - run the request. Defaults to False. - - Returns: - instance: An instance containing all the available information - for the product or None if no results. - """ - if isinstance(product_id, list): - product_id = product_id[0] - if isinstance(product_id, str): - product_id = product_id.split(',')[0] - - product = self.get_products(product_id, condition=condition, merchant=merchant, - async_req=async_req) - if product: - return product[0] - else: - return None - def search_products(self, item_count=10, item_page=1, items_per_page=10, keywords=None, actor=None, artist=None, author=None, brand=None, title=None, availability='Available', browse_node=None, condition='Any', delivery=None, diff --git a/amazon_paapi/helpers/arguments.py b/amazon_paapi/helpers/arguments.py index 3e22198..0409f3c 100644 --- a/amazon_paapi/helpers/arguments.py +++ b/amazon_paapi/helpers/arguments.py @@ -8,7 +8,7 @@ def get_items_ids(items: Union[str, list[str]]) -> list[str]: if not isinstance(items, str) and not isinstance(items, list): - raise InvalidArgumentException('Invalid products argument, it should be a string or list of strings') + raise InvalidArgumentException('Invalid items argument, it should be a string or list of strings') if isinstance(items, str): items_ids = items.split(',') From e4639c00ca993a5aa581aa55332184c8d8e4f1e7 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Thu, 8 Jul 2021 00:47:19 +0200 Subject: [PATCH 21/67] Removed parse item --- amazon_paapi/api.py | 10 ++++------ example.py | 7 ++++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/amazon_paapi/api.py b/amazon_paapi/api.py index 7cafd00..5588361 100644 --- a/amazon_paapi/api.py +++ b/amazon_paapi/api.py @@ -16,7 +16,7 @@ from . import models from .helpers.arguments import get_items_ids from .exceptions import AmazonException, InvalidArgumentException, MalformedRequestException -from .helpers.parser import parse_product, AmazonBrowseNode, parse_browsenode +from .helpers.parser import get_parsed_item, AmazonBrowseNode, parse_browsenode from .helpers.generators import get_list_chunks from .tools import get_asin @@ -84,9 +84,7 @@ def get_items(self, items: Union[str, list[str]], **kwargs) -> list: request = get_items_request(self, asin_chunk, **kwargs) self._throttle() items_response = get_items_response(self, request) - - for item in items_response: - results.append(parse_product(item)) + results.extend(items_response) return results @@ -209,7 +207,7 @@ def search_products(self, item_count=10, item_page=1, items_per_page=10, keyword if response.search_result is not None: if response.search_result.items is not None: for item in response.search_result.items: - results.append(parse_product(item)) + results.append(get_parsed_item(item)) if len(results) >= item_count: break if len(response.search_result.items) < items_per_page: @@ -303,7 +301,7 @@ def get_variations(self, asin, item_count=10, item_page=1, items_per_page=10, co if response.variations_result is not None: if response.variations_result.items is not None: for item in response.variations_result.items: - results.append(parse_product(item)) + results.append(get_parsed_item(item)) if len(results) >= item_count: break if len(response.variations_result.items) < items_per_page: diff --git a/example.py b/example.py index a12ffb2..e49add1 100644 --- a/example.py +++ b/example.py @@ -1,7 +1,8 @@ +from amazon_paapi.sdk.models import condition, merchant from amazon_paapi import AmazonApi import secrets - +from amazon_paapi.models import Condition amazon = AmazonApi(secrets.KEY, secrets.SECRET, secrets.TAG, secrets.COUNTRY) -product = amazon.get_product('B01N5IB20Q') -print(product.title) +product = amazon.get_items('B01N5IB20Q', condition=Condition.NEW) +print(product[0].item_info.title.display_value) From 90e0564edd8184256d4d8e9cf0f3b12c068e8088 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Thu, 8 Jul 2021 01:00:00 +0200 Subject: [PATCH 22/67] Removed parsed module --- amazon_paapi/helpers/parser.py | 550 --------------------------------- 1 file changed, 550 deletions(-) delete mode 100644 amazon_paapi/helpers/parser.py diff --git a/amazon_paapi/helpers/parser.py b/amazon_paapi/helpers/parser.py deleted file mode 100644 index 1f65cf3..0000000 --- a/amazon_paapi/helpers/parser.py +++ /dev/null @@ -1,550 +0,0 @@ -"""Data parser for instance creation.""" -import pprint - -import six - -class Class: - """Base class for creating the product instance.""" - pass - - -class AmazonBrowseNode(): - swagger_types = { - 'ancestor': 'BrowseNodeAncestor', - 'children': 'BrowseNodeChildren', - 'context_free_name': 'str', - 'display_name': 'str', - 'id': 'str', - 'is_root': 'bool', - 'sales_rank': 'int' - } - - def __init__(self, node): - self.ancestor = node.ancestor - self.children = node.children - self.context_free_name = node.context_free_name - self.display_name = node.display_name - self.id = node.id - self.is_root = node.is_root - self.sales_rank = node.sales_rank - - def to_dict(self): - 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(AmazonBrowseNode, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - return pprint.pformat(self.to_dict()) - - def __repr__(self): - return self.to_str() - - def __eq__(self, other): - if not isinstance(other, AmazonBrowseNode): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not self == other - - -def parse_browsenode(browse_nodes_response): - """Parse browse node data and creates a dict. - - Args: - browse_nodes_response (list): List of browse nodes responses. - - Returns: - dict: Dict with browse node information. - """ - mapped_response = {} - for browse_node in browse_nodes_response: - mapped_response[browse_node.id] = browse_node - return mapped_response - - -def parse_product(item): - """Parse item data and creates product instance. - - Args: - item (instance): The instance with the data from Amazon API. - - Returns: - instance: Product instance with parsed data. - """ - product = Class() - product.raw_info = item - - # Main - product.asin = item.asin - try: - product.url = item.detail_page_url - except Exception: - product.url = None - try: - product.title = item.item_info.title.display_value - except Exception: - product.title = None - try: - product.parent_asin = item.parent_asin - except Exception: - product.parent_asin = None - - # Info - product.info = Class() - try: - product.info.contributors = [] - for x in item.item_info.by_line_info.contributors: - contributor = Class() - contributor.name = x.name - contributor.role = x.role - product.info.contributors.append(contributor) - except Exception: - product.info.contributors = None - try: - product.info.manufacturer = item.item_info.by_line_info.manufacturer.display_value - except Exception: - product.info.manufacturer = None - try: - product.info.brand = item.item_info.by_line_info.brand.display_value - except Exception: - product.info.brand = None - try: - product.info.product_group = item.item_info.classifications.product_group.display_value - except Exception: - product.info.product_group = None - try: - product.info.binding = item.item_info.classifications.binding.display_value - except Exception: - product.info.binding = None - try: - product.info.is_adult = item.item_info.product_info.is_adult_product.display_value - except Exception: - product.info.is_adult = None - try: - product.info.edition = item.item_info.content_info.edition.display_value - except Exception: - product.info.edition = None - try: - product.info.warranty = item.item_info.manufacture_info.warranty.display_value - except Exception: - product.info.warranty = None - try: - product.info.audience_rating = item.item_info.content_rating.audience_rating.display_value - except Exception: - product.info.audience_rating = None - try: - product.info.part_number = item.item_info.manufacture_info.item_part_number.display_value - except Exception: - product.info.part_number = None - try: - product.info.model = item.item_info.manufacture_info.model.display_value - except Exception: - product.info.model = None - try: - product.info.publication_date = item.item_info.content_info.publication_date.display_value - except Exception: - product.info.publication_date = None - try: - product.info.release_date = item.item_info.product_info.release_date.display_value - except Exception: - product.info.release_date = None - product.info.external_ids = Class() - try: - product.info.external_ids.ean = item.item_info.external_ids.ea_ns.display_values - except Exception: - product.info.external_ids.ean = None - try: - product.info.external_ids.isbn = item.item_info.external_ids.isb_ns.display_values - except Exception: - product.info.external_ids.isbn = None - try: - product.info.external_ids.upc = item.item_info.external_ids.up_cs.display_values - except Exception: - product.info.external_ids.upc = None - - # Product - product.product = Class() - try: - product.product.features = item.item_info.features.display_values - except Exception: - product.product.features = None - try: - product.product.languages = [] - for x in item.item_info.content_info.languages.display_values: - product.product.languages.append(x.display_value + ' ' + x.type) - except Exception: - product.product.languages = None - try: - product.product.pages_count = item.item_info.content_info.pages_count.display_value - except Exception: - product.product.pages_count = None - try: - product.product.formats = item.item_info.technical_info.formats.display_values - except Exception: - product.product.formats = None - try: - product.product.color = item.item_info.product_info.color.display_value - except Exception: - product.product.color = None - try: - product.product.unit_count = item.item_info.product_info.unit_count.display_value - except Exception: - product.product.unit_count = None - product.product.dimensions = Class() - try: - product.product.size = item.item_info.product_info.size.display_value - except Exception: - product.product.size = None - product.product.dimensions.height = Class() - try: - product.product.dimensions.height.value = item.item_info.product_info.item_dimensions.height.display_value - except Exception: - product.product.dimensions.height.value = None - try: - product.product.dimensions.height.unit = item.item_info.product_info.item_dimensions.height.unit - except Exception: - product.product.dimensions.height.unit = None - product.product.dimensions.length = Class() - try: - product.product.dimensions.length.value = item.item_info.product_info.item_dimensions.length.display_value - except Exception: - product.product.dimensions.length.value = None - try: - product.product.dimensions.length.unit = item.item_info.product_info.item_dimensions.length.unit - except Exception: - product.product.dimensions.length.unit = None - product.product.dimensions.width = Class() - try: - product.product.dimensions.width.value = item.item_info.product_info.item_dimensions.width.display_value - except Exception: - product.product.dimensions.width.value = None - try: - product.product.dimensions.width.unit = item.item_info.product_info.item_dimensions.width.unit - except Exception: - product.product.dimensions.width.unit = None - product.product.weight = Class() - try: - product.product.weight.value = item.item_info.product_info.item_dimensions.weight.display_value - except Exception: - product.product.weight.value = None - try: - product.product.weight.unit = item.item_info.product_info.item_dimensions.weight.unit - except Exception: - product.product.weight.unit = None - - # Images - product.images = Class() - try: - product.images.large = item.images.primary.large.url - except Exception: - product.images.large = None - try: - product.images.medium = item.images.primary.medium.url - except Exception: - product.images.medium = None - try: - product.images.small = item.images.primary.small.url - except Exception: - product.images.small = None - try: - product.images.variants = Class() - product.images.variants.small = [] - product.images.variants.medium = [] - product.images.variants.large = [] - for variant in item.images.variants: - try: - product.images.variants.large.append(variant.large.url) - product.images.variants.medium.append(variant.medium.url) - product.images.variants.small.append(variant.small.url) - except Exception: - pass - if not product.images.variants.small and not product.images.variants.medium and not product.images.variants.large: - product.images.variants = None - except Exception: - product.images.variants = None - product.images.cropped = Class() - product.images.cropped.small = [] - product.images.cropped.medium = [] - product.images.cropped.large = [] - try: - product.images.cropped.small.append(product.images.small.replace('_SL', '_AC')) - except Exception: - pass - try: - product.images.cropped.medium.append(product.images.medium.replace('_SL', '_AC')) - except Exception: - pass - try: - product.images.cropped.large.append(product.images.large.replace('.jpg', '._AC_.jpg')) - except Exception: - pass - try: - for x in product.images.variants.small: - product.images.cropped.small.append(x.replace('_SL', '_AC')) - except Exception: - pass - try: - for x in product.images.variants.medium: - product.images.cropped.medium.append(x.replace('_SL', '_AC')) - except Exception: - pass - try: - for x in product.images.variants.large: - product.images.cropped.large.append(x.replace('.jpg', '._AC_.jpg')) - except Exception: - pass - - # Trade In - product.trade_in = Class() - try: - product.trade_in.eligible = item.item_info.trade_in_info.is_eligible_for_trade_in - except Exception: - product.trade_in.eligible = None - try: - product.trade_in.price = item.item_info.trade_in_info.price.amount - except Exception: - product.trade_in.price = None - try: - product.trade_in.currency = item.item_info.trade_in_info.price.currency - except Exception: - product.trade_in.currency = None - if not product.trade_in.eligible and not product.trade_in.price and not product.trade_in.currency: - product.trade_in = None - - # Prices - try: - listings = item.offers.listings[0] - except Exception: - listings = None - product.prices = Class() - product.prices.price = Class() - try: - product.prices.price.value = listings.price.amount - except Exception: - product.prices.price.value = None - try: - product.prices.price.currency = listings.price.currency - except Exception: - product.prices.price.currency = None - try: - product.prices.price.per_unit = listings.price.price_per_unit - except Exception: - product.prices.price.per_unit = None - try: - product.prices.price.display = listings.price.display_amount - except Exception: - product.prices.price.display = None - product.prices.price.savings = Class() - try: - product.prices.price.savings.value = listings.price.savings.amount - except Exception: - product.prices.price.savings.value = None - try: - product.prices.price.savings.currency = listings.price.savings.currency - except Exception: - product.prices.price.savings.currency = None - try: - product.prices.price.savings.per_unit = listings.price.savings.price_per_unit - except Exception: - product.prices.price.savings.per_unit = None - try: - product.prices.price.savings.display = listings.price.savings.display_amount - except Exception: - product.prices.price.savings.display = None - try: - product.prices.price.savings.percentage = listings.price.savings.percentage - except Exception: - product.prices.price.savings.percentage = None - product.prices.pvp = Class() - try: - product.prices.pvp.value = listings.saving_basis.amount - except Exception: - product.prices.pvp.value = None - try: - product.prices.pvp.currency = listings.saving_basis.currency - except Exception: - product.prices.pvp.currency = None - try: - product.prices.pvp.per_unit = listings.saving_basis.price_per_unit - except Exception: - product.prices.pvp.per_unit = None - try: - product.prices.pvp.display = listings.saving_basis.display_amount - except Exception: - product.prices.pvp.display = None - product.prices.availability = Class() - try: - product.prices.availability.message = listings.availability.message - except Exception: - product.prices.availability.message = None - try: - product.prices.availability.type = listings.availability.type - except Exception: - product.prices.availability.type = None - try: - product.prices.availability.max_order_quantity = listings.availability.max_order_quantity - except Exception: - product.prices.availability.max_order_quantity = None - try: - product.prices.availability.min_order_quantity = listings.availability.min_order_quantity - except Exception: - product.prices.availability.min_order_quantity = None - product.prices.condition = Class() - try: - product.prices.condition.condition = listings.condition.value - except Exception: - product.prices.condition = None - try: - product.prices.condition.condition_display = listings.condition.display_value - except Exception: - product.prices.condition_display = None - try: - product.prices.condition.sub_condition = listings.condition.sub_condition.value - except Exception: - product.prices.sub_condition = None - try: - product.prices.condition.sub_condition_display = listings.condition.sub_condition.display_value - except Exception: - product.prices.sub_condition_display = None - product.prices.merchant = Class() - try: - product.prices.merchant.default_shipping_country = listings.merchant_info.default_shipping_country - except Exception: - product.prices.merchant.default_shipping_country = None - try: - product.prices.merchant.merchant_id = listings.merchant_info.id - except Exception: - product.prices.merchant.merchant_id = None - try: - product.prices.merchant.name = listings.merchant_info.name - except Exception: - product.prices.merchant.name = None - product.prices.other = Class() - try: - product.prices.other.buybox_winner = listings.is_buy_box_winner - except Exception: - product.prices.other.buybox_winner = None - try: - product.prices.other.loyalty_points = listings.loyalty_points - except Exception: - product.prices.other.loyalty_points = None - try: - product.prices.other.amazon_fulfilled = listings.delivery_info.is_amazon_fulfilled - except Exception: - product.prices.other.amazon_fulfilled = None - try: - product.prices.other.free_shipping_eligible = listings.delivery_info.is_free_shipping_eligible - except Exception: - product.prices.other.free_shipping_eligible = None - try: - product.prices.other.prime_eligible = listings.delivery_info.is_prime_eligible - except Exception: - product.prices.other.prime_eligible = None - try: - product.prices.other.prime_exclusive = listings.program_eligibility.is_prime_exclusive - except Exception: - product.prices.other.prime_exclusive = None - try: - product.prices.other.prime_pantry = listings.program_eligibility.is_prime_pantry - except Exception: - product.prices.other.prime_pantry = None - try: - product.prices.other.violates_map = listings.violates_map - except Exception: - product.prices.other.violates_map = None - try: - product.prices.other.offer_id = listings.id - except Exception: - product.prices.other.offer_id = None - - # Offers Summary - try: - summaries = item.offers.summaries - product.offers_summary = [] - except Exception: - summaries = None - product.offers_summary = None - if summaries: - for x in summaries: - offer = Class() - offer.highest_price = Class() - offer.lowest_price = Class() - try: - offer.highest_price.value = x.highest_price.amount - except Exception: - offer.highest_price.value = None - try: - offer.highest_price.currency = x.highest_price.currency - except Exception: - offer.highest_price.currency = None - try: - offer.highest_price.per_unit = x.highest_price.price_per_unit - except Exception: - offer.highest_price.per_unit = None - try: - offer.highest_price.display = x.highest_price.display_amount - except Exception: - offer.highest_price.display = None - try: - offer.lowest_price.value = x.lowest_price.amount - except Exception: - offer.lowest_price.value = None - try: - offer.lowest_price.currency = x.lowest_price.currency - except Exception: - offer.lowest_price.currency = None - try: - offer.lowest_price.per_unit = x.lowest_price.price_per_unit - except Exception: - offer.lowest_price.per_unit = None - try: - offer.lowest_price.display = x.lowest_price.display_amount - except Exception: - offer.lowest_price.display = None - offer.condition = Class() - try: - offer.condition.condition = x.condition.value - except Exception: - offer.condition.condition = None - try: - offer.condition.condition.condition_display = x.condition.display_value - except Exception: - offer.condition.condition_display = None - try: - offer.condition.condition.sub_condition = x.condition.sub_condition.value - except Exception: - offer.condition.sub_condition = None - try: - offer.condition.condition.sub_condition_display = x.condition.sub_condition.display_value - except Exception: - offer.condition.sub_condition_display = None - try: - offer.offer_count = x.offer_count - except Exception: - offer.offer_count = None - product.offers_summary.append(offer) - - return product From eb059efa87a687807bfa833094880c4e851c52ef Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Thu, 8 Jul 2021 20:18:17 +0200 Subject: [PATCH 23/67] Added all args and improved type hinting --- amazon_paapi/api.py | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/amazon_paapi/api.py b/amazon_paapi/api.py index 5588361..8fad97b 100644 --- a/amazon_paapi/api.py +++ b/amazon_paapi/api.py @@ -15,8 +15,7 @@ from . import models from .helpers.arguments import get_items_ids -from .exceptions import AmazonException, InvalidArgumentException, MalformedRequestException -from .helpers.parser import get_parsed_item, AmazonBrowseNode, parse_browsenode +from .exceptions import AmazonException, InvalidArgumentException from .helpers.generators import get_list_chunks from .tools import get_asin @@ -31,8 +30,7 @@ class AmazonApi: key (str): Your API key. secret (str): Your API secret. tag (str): Your affiliate tracking id, used to create the affiliate link. - country (str): Country code for your affiliate account. Compatible with - AU, BR, CA, FR, DE, IN, IT, JP, MX, NL, PL, SG, SA, ES, TR, AE, UK, US, SE. + country (str): Country code for your affiliate account. Available values in models.Country. throttling (float, optional): Wait time in seconds between API calls. Use it to avoid reaching Amazon limits. Defaults to 1 second. """ @@ -54,7 +52,14 @@ def __init__(self, key: str, secret: str, tag: str, country: models.Country, thr self._api = DefaultApi(key, secret, self._host, self._region) - def get_items(self, items: Union[str, list[str]], **kwargs) -> list: + + def get_items(self, + items: Union[str, list[str]], + condition: models.Condition = None, + merchant: models.Merchant = None, + currency_of_preference: str = None, + languages_of_preference: list[str] = None, + **kwargs) -> list[models.Item]: """Get items information from Amazon. Full official documentation [here](https://webservices.amazon.com/paapi5/documentation/get-items.html#ItemLookup-rp). @@ -63,6 +68,8 @@ def get_items(self, items: Union[str, list[str]], **kwargs) -> list: separated by comma or a list of strings. condition (str, optional): The condition parameter filters offers by condition type. Available values in models.Condition. Defaults to Any. + merchant (str, optional): Filters search results to return items having at least one + offer sold by target merchant. Available values in models.Merchant. Defaults to All. currency_of_preference (str, optional): Currency of preference in which the prices information should be returned in response. By default the prices are returned in the default currency of the marketplace. Expected currency code format is @@ -70,13 +77,19 @@ def get_items(self, items: Union[str, list[str]], **kwargs) -> list: languages_of_preference (list[str], optional): Languages in order of preference in which the item information should be returned in response. By default the item information is returned in the default language of the marketplace. - merchant (str, optional): Filters search results to return items having at least one - offer sold by target merchant. Available values in models.Merchant. Defaults to All. + kwargs (any): Any other parameters supported by Amazon API for the GetItems operation. Returns: - list: A list of items. + list[Item]: A list of items with Amazon information. """ + kwargs.update({ + 'condition': condition, + 'merchant': merchant, + 'currency_of_preference': currency_of_preference, + 'languages_of_preference': languages_of_preference + }) + items_ids = get_items_ids(items) results = [] @@ -88,7 +101,7 @@ def get_items(self, items: Union[str, list[str]], **kwargs) -> list: return results - def search_products(self, item_count=10, item_page=1, items_per_page=10, keywords=None, + def search_items(self, item_count=10, item_page=1, items_per_page=10, keywords=None, actor=None, artist=None, author=None, brand=None, title=None, availability='Available', browse_node=None, condition='Any', delivery=None, max_price=None, min_price=None, min_rating=None, min_discount=None, From 59ce181487191e6dff314e0bcc1a15c01d44085e Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Thu, 8 Jul 2021 20:40:30 +0200 Subject: [PATCH 24/67] Added more type hints --- amazon_paapi/api.py | 4 ++-- amazon_paapi/helpers/generators.py | 5 ++++- amazon_paapi/helpers/requests.py | 9 +++++---- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/amazon_paapi/api.py b/amazon_paapi/api.py index 8fad97b..78f87d5 100644 --- a/amazon_paapi/api.py +++ b/amazon_paapi/api.py @@ -5,7 +5,6 @@ an easier way. """ -from amazon_paapi.helpers.requests import get_items_request, get_items_response from .sdk.api.default_api import DefaultApi from .sdk.models.search_items_request import SearchItemsRequest from .sdk.models.get_variations_request import GetVariationsRequest @@ -15,8 +14,9 @@ from . import models from .helpers.arguments import get_items_ids -from .exceptions import AmazonException, InvalidArgumentException +from .helpers.requests import get_items_request, get_items_response from .helpers.generators import get_list_chunks +from .exceptions import AmazonException, InvalidArgumentException from .tools import get_asin from typing import Union diff --git a/amazon_paapi/helpers/generators.py b/amazon_paapi/helpers/generators.py index ab54cc8..ae30f2c 100644 --- a/amazon_paapi/helpers/generators.py +++ b/amazon_paapi/helpers/generators.py @@ -1,7 +1,10 @@ """Module with helper functions for making generators.""" -def get_list_chunks(full_list, chunk_size): +from typing import Generator + + +def get_list_chunks(full_list: list[str], chunk_size: int) -> Generator[list[str], None, None]: """Yield successive chunks from list.""" for i in range(0, len(full_list), chunk_size): yield full_list[i:i + chunk_size] diff --git a/amazon_paapi/helpers/requests.py b/amazon_paapi/helpers/requests.py index e067277..1b6d883 100644 --- a/amazon_paapi/helpers/requests.py +++ b/amazon_paapi/helpers/requests.py @@ -1,7 +1,8 @@ """Module with helper functions for creating requests.""" -from amazon_paapi.sdk.models.get_items_resource import GetItemsResource +from .. import models +from ..sdk.models.get_items_resource import GetItemsResource from ..sdk.rest import ApiException from ..sdk.models.partner_type import PartnerType from ..sdk.models.get_items_request import GetItemsRequest @@ -9,7 +10,7 @@ import inspect -def get_items_request(self, asin_chunk, **kwargs): +def get_items_request(self, asin_chunk: list[str], **kwargs) -> models.GetItemsRequest: try: return GetItemsRequest(resources=_get_items_request_resources(), partner_type=PartnerType.ASSOCIATES, @@ -21,13 +22,13 @@ def get_items_request(self, asin_chunk, **kwargs): raise MalformedRequestException('Parameters for get_items request are not correct') -def _get_items_request_resources(): +def _get_items_request_resources() -> list[models.GetItemsResource]: resources = inspect.getmembers(GetItemsResource, lambda a:not(inspect.isroutine(a))) resources = [x[-1] for x in resources if isinstance(x[-1], str) and x[0][0:2] != '__'] return resources -def get_items_response(self, request): +def get_items_response(self, request: models.GetItemsRequest) -> list[models.Item]: try: response = self._api.get_items(request) except ApiException as e: From 81f770d1b4d8b3e932b3e79c85d2ee00242239b7 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Thu, 8 Jul 2021 21:06:39 +0200 Subject: [PATCH 25/67] Added type hints for images --- amazon_paapi/api.py | 4 ++-- amazon_paapi/helpers/requests.py | 2 +- amazon_paapi/helpers/types.py | 21 +++++++++++++++++++++ amazon_paapi/models/__init__.py | 1 + 4 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 amazon_paapi/helpers/types.py diff --git a/amazon_paapi/api.py b/amazon_paapi/api.py index 78f87d5..fc2648d 100644 --- a/amazon_paapi/api.py +++ b/amazon_paapi/api.py @@ -59,7 +59,7 @@ def get_items(self, merchant: models.Merchant = None, currency_of_preference: str = None, languages_of_preference: list[str] = None, - **kwargs) -> list[models.Item]: + **kwargs) -> list[models.AmazonItem]: """Get items information from Amazon. Full official documentation [here](https://webservices.amazon.com/paapi5/documentation/get-items.html#ItemLookup-rp). @@ -80,7 +80,7 @@ def get_items(self, kwargs (any): Any other parameters supported by Amazon API for the GetItems operation. Returns: - list[Item]: A list of items with Amazon information. + list[AmazonItem]: A list of items with Amazon information. """ kwargs.update({ diff --git a/amazon_paapi/helpers/requests.py b/amazon_paapi/helpers/requests.py index 1b6d883..d267d8f 100644 --- a/amazon_paapi/helpers/requests.py +++ b/amazon_paapi/helpers/requests.py @@ -28,7 +28,7 @@ def _get_items_request_resources() -> list[models.GetItemsResource]: return resources -def get_items_response(self, request: models.GetItemsRequest) -> list[models.Item]: +def get_items_response(self, request: models.GetItemsRequest) -> list[models.AmazonItem]: try: response = self._api.get_items(request) except ApiException as e: diff --git a/amazon_paapi/helpers/types.py b/amazon_paapi/helpers/types.py new file mode 100644 index 0000000..79233c1 --- /dev/null +++ b/amazon_paapi/helpers/types.py @@ -0,0 +1,21 @@ +from .. import models + + +class ApiImageType(models.ImageType): + large: models.ImageSize + medium: models.ImageSize + small: models.ImageSize + + +class ApiImages(models.Images): + primary: ApiImageType + variants: list[ApiImageType] + + +class AmazonItem(models.Item): + item_info: models.ItemInfo + images: ApiImages + offers: models.Offers + browse_node_info: models.BrowseNodeInfo + + models.Images.primary diff --git a/amazon_paapi/models/__init__.py b/amazon_paapi/models/__init__.py index c44365c..140ca18 100644 --- a/amazon_paapi/models/__init__.py +++ b/amazon_paapi/models/__init__.py @@ -1,2 +1,3 @@ from ..sdk.models import * from .custom_models import * +from ..helpers.types import * From 5d1fdfb0713fb1fd757f1e37503945486f03d3cc Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Thu, 8 Jul 2021 22:21:00 +0200 Subject: [PATCH 26/67] Changed api_item to models folder --- amazon_paapi/api.py | 2 +- amazon_paapi/helpers/requests.py | 2 +- amazon_paapi/helpers/types.py | 21 ---------- amazon_paapi/models/__init__.py | 4 +- amazon_paapi/models/api_item.py | 41 +++++++++++++++++++ .../models/{custom_models.py => regions.py} | 3 -- 6 files changed, 45 insertions(+), 28 deletions(-) delete mode 100644 amazon_paapi/helpers/types.py create mode 100644 amazon_paapi/models/api_item.py rename amazon_paapi/models/{custom_models.py => regions.py} (96%) diff --git a/amazon_paapi/api.py b/amazon_paapi/api.py index fc2648d..7a01987 100644 --- a/amazon_paapi/api.py +++ b/amazon_paapi/api.py @@ -59,7 +59,7 @@ def get_items(self, merchant: models.Merchant = None, currency_of_preference: str = None, languages_of_preference: list[str] = None, - **kwargs) -> list[models.AmazonItem]: + **kwargs) -> list[models.ApiItem]: """Get items information from Amazon. Full official documentation [here](https://webservices.amazon.com/paapi5/documentation/get-items.html#ItemLookup-rp). diff --git a/amazon_paapi/helpers/requests.py b/amazon_paapi/helpers/requests.py index d267d8f..4c5f30f 100644 --- a/amazon_paapi/helpers/requests.py +++ b/amazon_paapi/helpers/requests.py @@ -28,7 +28,7 @@ def _get_items_request_resources() -> list[models.GetItemsResource]: return resources -def get_items_response(self, request: models.GetItemsRequest) -> list[models.AmazonItem]: +def get_items_response(self, request: models.GetItemsRequest) -> list[models.ApiItem]: try: response = self._api.get_items(request) except ApiException as e: diff --git a/amazon_paapi/helpers/types.py b/amazon_paapi/helpers/types.py deleted file mode 100644 index 79233c1..0000000 --- a/amazon_paapi/helpers/types.py +++ /dev/null @@ -1,21 +0,0 @@ -from .. import models - - -class ApiImageType(models.ImageType): - large: models.ImageSize - medium: models.ImageSize - small: models.ImageSize - - -class ApiImages(models.Images): - primary: ApiImageType - variants: list[ApiImageType] - - -class AmazonItem(models.Item): - item_info: models.ItemInfo - images: ApiImages - offers: models.Offers - browse_node_info: models.BrowseNodeInfo - - models.Images.primary diff --git a/amazon_paapi/models/__init__.py b/amazon_paapi/models/__init__.py index 140ca18..4e1ec0e 100644 --- a/amazon_paapi/models/__init__.py +++ b/amazon_paapi/models/__init__.py @@ -1,3 +1,3 @@ from ..sdk.models import * -from .custom_models import * -from ..helpers.types import * +from .regions import * +from .api_item import * diff --git a/amazon_paapi/models/api_item.py b/amazon_paapi/models/api_item.py new file mode 100644 index 0000000..b128af2 --- /dev/null +++ b/amazon_paapi/models/api_item.py @@ -0,0 +1,41 @@ +from .. import models + + +class ApiImageType(models.ImageType): + large: models.ImageSize + medium: models.ImageSize + small: models.ImageSize + + +class ApiImages(models.Images): + primary: ApiImageType + variants: list[ApiImageType] + + +class ApiByLineInfo(models.ByLineInfo): + brand: models.SingleStringValuedAttribute + contributors: models.SingleStringValuedAttribute + manufacturer: models.SingleStringValuedAttribute + + +class ApiClassifications(models.Classifications): + binding: models.SingleStringValuedAttribute + product_group: models.SingleStringValuedAttribute + + +class ApiContentInfo(models.ContentInfo): + edition: models.SingleStringValuedAttribute + languages: models.MultiValuedAttribute + + +class ApiItemInfo(models.ItemInfo): + by_line_info: ApiByLineInfo + classifications: ApiClassifications + content_info: ApiContentInfo + + +class ApiItem(models.Item): + item_info: ApiItemInfo + images: ApiImages + offers: models.Offers + browse_node_info: models.BrowseNodeInfo diff --git a/amazon_paapi/models/custom_models.py b/amazon_paapi/models/regions.py similarity index 96% rename from amazon_paapi/models/custom_models.py rename to amazon_paapi/models/regions.py index eedfd5e..36bc387 100644 --- a/amazon_paapi/models/custom_models.py +++ b/amazon_paapi/models/regions.py @@ -1,6 +1,3 @@ -"""Module containing all the models.""" - - class Country(object): AU = 'AU' BR = 'BR' From de10b8132a626f1c8408a9105e439afcd4cc64b4 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Thu, 8 Jul 2021 22:28:01 +0200 Subject: [PATCH 27/67] Updated structure --- amazon_paapi/__init__.py | 1 - amazon_paapi/api.py | 2 +- amazon_paapi/errors/__init__.py | 1 + amazon_paapi/{ => errors}/exceptions.py | 0 amazon_paapi/helpers/arguments.py | 2 +- amazon_paapi/helpers/requests.py | 2 +- .../serializer/dango_rest_framework.py | 156 ------------------ amazon_paapi/tools/__init__.py | 1 + amazon_paapi/{tools.py => tools/asin.py} | 2 +- 9 files changed, 6 insertions(+), 161 deletions(-) create mode 100644 amazon_paapi/errors/__init__.py rename amazon_paapi/{ => errors}/exceptions.py (100%) delete mode 100644 amazon_paapi/serializer/dango_rest_framework.py create mode 100644 amazon_paapi/tools/__init__.py rename amazon_paapi/{tools.py => tools/asin.py} (89%) diff --git a/amazon_paapi/__init__.py b/amazon_paapi/__init__.py index 621b9a5..dc57f67 100644 --- a/amazon_paapi/__init__.py +++ b/amazon_paapi/__init__.py @@ -3,4 +3,3 @@ __author__ = 'Sergio Abad' from .api import AmazonApi -from .tools import get_asin diff --git a/amazon_paapi/api.py b/amazon_paapi/api.py index 7a01987..da39174 100644 --- a/amazon_paapi/api.py +++ b/amazon_paapi/api.py @@ -16,7 +16,7 @@ from .helpers.arguments import get_items_ids from .helpers.requests import get_items_request, get_items_response from .helpers.generators import get_list_chunks -from .exceptions import AmazonException, InvalidArgumentException +from .errors import AmazonException, InvalidArgumentException from .tools import get_asin from typing import Union diff --git a/amazon_paapi/errors/__init__.py b/amazon_paapi/errors/__init__.py new file mode 100644 index 0000000..281c8b3 --- /dev/null +++ b/amazon_paapi/errors/__init__.py @@ -0,0 +1 @@ +from .exceptions import * diff --git a/amazon_paapi/exceptions.py b/amazon_paapi/errors/exceptions.py similarity index 100% rename from amazon_paapi/exceptions.py rename to amazon_paapi/errors/exceptions.py diff --git a/amazon_paapi/helpers/arguments.py b/amazon_paapi/helpers/arguments.py index 0409f3c..b3f51a0 100644 --- a/amazon_paapi/helpers/arguments.py +++ b/amazon_paapi/helpers/arguments.py @@ -2,7 +2,7 @@ from ..tools import get_asin -from ..exceptions import InvalidArgumentException +from ..errors import InvalidArgumentException from typing import Union diff --git a/amazon_paapi/helpers/requests.py b/amazon_paapi/helpers/requests.py index 4c5f30f..f63e27b 100644 --- a/amazon_paapi/helpers/requests.py +++ b/amazon_paapi/helpers/requests.py @@ -6,7 +6,7 @@ from ..sdk.rest import ApiException from ..sdk.models.partner_type import PartnerType from ..sdk.models.get_items_request import GetItemsRequest -from ..exceptions import ApiRequestException, ItemsNotFoudException, MalformedRequestException +from ..errors import ApiRequestException, ItemsNotFoudException, MalformedRequestException import inspect diff --git a/amazon_paapi/serializer/dango_rest_framework.py b/amazon_paapi/serializer/dango_rest_framework.py deleted file mode 100644 index 8988c15..0000000 --- a/amazon_paapi/serializer/dango_rest_framework.py +++ /dev/null @@ -1,156 +0,0 @@ -from rest_framework import serializers - - -class _AmazonValueUnitSerializer(serializers.Serializer): - value = serializers.FloatField() - unit = serializers.CharField() - - -class _AmazonDimensionsSerializer(serializers.Serializer): - height = _AmazonValueUnitSerializer() - length = _AmazonValueUnitSerializer() - width = _AmazonValueUnitSerializer() - - -class _AmazonProductSerializer(serializers.Serializer): - features = serializers.ListField() - languages = serializers.ListField() - formats = serializers.ListField() - pages_count = serializers.ListField() - color = serializers.CharField() - unit_count = serializers.IntegerField() - size = serializers.CharField() - dimensions = _AmazonDimensionsSerializer() - weight = _AmazonValueUnitSerializer() - - -class _AmazonContributorsSerializer(serializers.Serializer): - name = serializers.CharField() - role = serializers.CharField() - - -class _AmazonExternalIdsSerializer(serializers.Serializer): - ean = serializers.ListField() - isbn = serializers.ListField() - upc = serializers.ListField() - - -class _AmazonInfoSerializer(serializers.Serializer): - contributors = _AmazonContributorsSerializer(many=True) - manufacturer = serializers.CharField() - brand = serializers.CharField() - model = serializers.CharField() - part_number = serializers.CharField() - product_group = serializers.CharField() - binding = serializers.CharField() - is_adult = serializers.BooleanField() - audience_rating = serializers.CharField() - edition = serializers.CharField() - warranty = serializers.CharField() - publication_date = serializers.CharField() - release_date = serializers.CharField() - external_ids = _AmazonExternalIdsSerializer() - - -class _AmazonImageVariantsSerializer(serializers.Serializer): - small = serializers.ListField() - medium = serializers.ListField() - large = serializers.ListField() - - -class _AmazonImagesSerializer(serializers.Serializer): - small = serializers.CharField() - medium = serializers.CharField() - large = serializers.CharField() - cropped = _AmazonImageVariantsSerializer() - variants = _AmazonImageVariantsSerializer() - - -class _AmazonTradeInSerializer(serializers.Serializer): - elegible = serializers.BooleanField() - price = serializers.FloatField() - currency = serializers.CharField() - - -class _AmazonSavingsSerializer(serializers.Serializer): - value = serializers.FloatField() - currency = serializers.CharField() - per_unit = serializers.FloatField() - display = serializers.CharField() - percentage = serializers.FloatField() - - -class _AmazonPriceSerializer(serializers.Serializer): - value = serializers.FloatField() - currency = serializers.CharField() - per_unit = serializers.FloatField() - display = serializers.CharField() - savings = _AmazonSavingsSerializer() - - -class _AmazonPvpSerializer(serializers.Serializer): - value = serializers.FloatField() - currency = serializers.CharField() - per_unit = serializers.FloatField() - display = serializers.CharField() - - -class _AmazonAvailabilitySerializer(serializers.Serializer): - max_order_quantity = serializers.IntegerField() - min_order_quantity = serializers.IntegerField() - type = serializers.CharField() - message = serializers.CharField() - - -class _AmazonConditionSerializer(serializers.Serializer): - condition = serializers.CharField() - condition_display = serializers.CharField() - sub_condition = serializers.CharField() - sub_condition_display = serializers.CharField() - - -class _AmazonMerchantSerializer(serializers.Serializer): - default_shipping_country = serializers.CharField() - merchant_id = serializers.CharField() - name = serializers.CharField() - - -class _AmazonOtherSerializer(serializers.Serializer): - buybox_winner = serializers.BooleanField() - loyalty_points = serializers.IntegerField() - amazon_fulfilled = serializers.BooleanField() - free_shipping_eligible = serializers.BooleanField() - prime_eligible = serializers.BooleanField() - prime_exclusive = serializers.BooleanField() - prime_pantry = serializers.BooleanField() - violates_map = serializers.BooleanField() - offer_id = serializers.CharField() - - -class _AmazonPricesSerializer(serializers.Serializer): - price = _AmazonPriceSerializer() - pvp = _AmazonPvpSerializer() - availability = _AmazonAvailabilitySerializer() - condition = _AmazonConditionSerializer() - merchant = _AmazonMerchantSerializer() - other = _AmazonOtherSerializer() - - -class _AmazonOffersSummarySerializer(serializers.Serializer): - highest_price = _AmazonPvpSerializer() - lowest_price = _AmazonPvpSerializer() - condition = _AmazonConditionSerializer() - offer_count = serializers.IntegerField() - - -class AmazonProductSerializer(serializers.Serializer): - asin = serializers.CharField(max_length=10) - parent_asin = serializers.CharField(max_length=10) - title = serializers.CharField() - url = serializers.CharField() - product = _AmazonProductSerializer() - info = _AmazonInfoSerializer() - images = _AmazonImagesSerializer() - trade_in = _AmazonTradeInSerializer() - prices = _AmazonPricesSerializer() - offers_summary = _AmazonOffersSummarySerializer(many=True) diff --git a/amazon_paapi/tools/__init__.py b/amazon_paapi/tools/__init__.py new file mode 100644 index 0000000..279d187 --- /dev/null +++ b/amazon_paapi/tools/__init__.py @@ -0,0 +1 @@ +from .asin import get_asin diff --git a/amazon_paapi/tools.py b/amazon_paapi/tools/asin.py similarity index 89% rename from amazon_paapi/tools.py rename to amazon_paapi/tools/asin.py index 82a0e81..fafc680 100644 --- a/amazon_paapi/tools.py +++ b/amazon_paapi/tools/asin.py @@ -1,6 +1,6 @@ """Some useful tools.""" -from amazon_paapi.exceptions import AsinNotFoundException +from ..errors import AsinNotFoundException import re From dc71db0f9c0ed9ac730658b46ae9b3cef191cdc8 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Thu, 8 Jul 2021 23:10:52 +0200 Subject: [PATCH 28/67] Finished item_info type hints --- amazon_paapi/models/__init__.py | 2 +- amazon_paapi/models/api_item.py | 65 ++++++++++++++++++++++++++++++--- 2 files changed, 60 insertions(+), 7 deletions(-) diff --git a/amazon_paapi/models/__init__.py b/amazon_paapi/models/__init__.py index 4e1ec0e..c0d58aa 100644 --- a/amazon_paapi/models/__init__.py +++ b/amazon_paapi/models/__init__.py @@ -1,3 +1,3 @@ from ..sdk.models import * from .regions import * -from .api_item import * +from .api_item import ApiItem diff --git a/amazon_paapi/models/api_item.py b/amazon_paapi/models/api_item.py index b128af2..6e8729f 100644 --- a/amazon_paapi/models/api_item.py +++ b/amazon_paapi/models/api_item.py @@ -1,39 +1,92 @@ from .. import models +"""Shared models""" +class ApiMultiValuedAttributeStr(models.MultiValuedAttribute): + display_values: list[str] +class ApiDisplayValuesType: + display_value: str + type: str + +class ApiMultiValuedAttributeType(models.MultiValuedAttribute): + display_values: list[ApiDisplayValuesType] + +"""Image models""" class ApiImageType(models.ImageType): large: models.ImageSize medium: models.ImageSize small: models.ImageSize - class ApiImages(models.Images): primary: ApiImageType variants: list[ApiImageType] - +"""Item info models""" class ApiByLineInfo(models.ByLineInfo): brand: models.SingleStringValuedAttribute contributors: models.SingleStringValuedAttribute manufacturer: models.SingleStringValuedAttribute - class ApiClassifications(models.Classifications): binding: models.SingleStringValuedAttribute product_group: models.SingleStringValuedAttribute - class ApiContentInfo(models.ContentInfo): edition: models.SingleStringValuedAttribute - languages: models.MultiValuedAttribute + languages: ApiMultiValuedAttributeType + +class ApiContentRating(models.ContentRating): + audience_rating: models.SingleStringValuedAttribute +class ApiExternalIds(models.ExternalIds): + ea_ns: ApiMultiValuedAttributeStr + isb_ns: ApiMultiValuedAttributeStr + up_cs: ApiMultiValuedAttributeStr + +class ApiFeatures(): + features: ApiMultiValuedAttributeStr + +class ApiManufactureInfo(models.ManufactureInfo): + item_part_number: models.SingleStringValuedAttribute + model: models.SingleStringValuedAttribute + warranty: models.SingleStringValuedAttribute + +class ApiItemDimensions(models.DimensionBasedAttribute): + height: models.SingleIntegerValuedAttribute + length: models.SingleIntegerValuedAttribute + weight: models.SingleIntegerValuedAttribute + width: models.SingleIntegerValuedAttribute + +class ApiProductInfo(models.ProductInfo): + color: models.SingleStringValuedAttribute + is_adult_product: models.SingleBooleanValuedAttribute + item_dimensions: ApiItemDimensions + release_date: models.SingleStringValuedAttribute + size: models.SingleStringValuedAttribute + unit_count: models.SingleIntegerValuedAttribute + +class ApiTechnicalInfo(models.TechnicalInfo): + formats: ApiMultiValuedAttributeStr + energy_efficiency_class: models.SingleStringValuedAttribute + +class ApiTradeInInfo(models.TradeInInfo): + is_eligible_for_trade_in: bool + price: models.TradeInPrice class ApiItemInfo(models.ItemInfo): by_line_info: ApiByLineInfo classifications: ApiClassifications content_info: ApiContentInfo + content_rating: ApiContentRating + external_ids: ApiExternalIds + features: ApiFeatures + manufacture_info: ApiManufactureInfo + product_info: ApiProductInfo + technical_info: ApiTechnicalInfo + title: models.SingleStringValuedAttribute + trade_in_info: ApiTradeInInfo - +"""Main model""" class ApiItem(models.Item): item_info: ApiItemInfo images: ApiImages From 67895dbd7f1f3627ec056bb328ff899314f784b8 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Thu, 8 Jul 2021 23:35:20 +0200 Subject: [PATCH 29/67] Added type hints for all values --- amazon_paapi/models/api_item.py | 106 +++++++++++++++++++++++--------- 1 file changed, 77 insertions(+), 29 deletions(-) diff --git a/amazon_paapi/models/api_item.py b/amazon_paapi/models/api_item.py index 6e8729f..09efd0d 100644 --- a/amazon_paapi/models/api_item.py +++ b/amazon_paapi/models/api_item.py @@ -1,21 +1,43 @@ from .. import models """Shared models""" -class ApiMultiValuedAttributeStr(models.MultiValuedAttribute): +class ApiLabelLocale: + label: str + locale: str + +class ApiMultiValuedAttributeStr(ApiLabelLocale, models.MultiValuedAttribute): display_values: list[str] class ApiDisplayValuesType: display_value: str type: str -class ApiMultiValuedAttributeType(models.MultiValuedAttribute): +class ApiMultiValuedAttributeType(ApiLabelLocale, models.MultiValuedAttribute): display_values: list[ApiDisplayValuesType] +class ApiUnitBasedAttribute(ApiLabelLocale, models.UnitBasedAttribute): + display_value: float + unit: str + +class ApiSingleStringValuedAttribute(ApiLabelLocale, models.SingleStringValuedAttribute): + display_value: str + +class ApiSingleBooleanValuedAttribute(ApiLabelLocale, models.SingleBooleanValuedAttribute): + display_value: bool + +class ApiSingleIntegerValuedAttribute(ApiLabelLocale, models.SingleIntegerValuedAttribute): + display_value: float + """Image models""" +class ApiImageSize(models.ImageSize): + url: str + height: str + width: str + class ApiImageType(models.ImageType): - large: models.ImageSize - medium: models.ImageSize - small: models.ImageSize + large: ApiImageSize + medium: ApiImageSize + small: ApiImageSize class ApiImages(models.Images): primary: ApiImageType @@ -23,20 +45,20 @@ class ApiImages(models.Images): """Item info models""" class ApiByLineInfo(models.ByLineInfo): - brand: models.SingleStringValuedAttribute - contributors: models.SingleStringValuedAttribute - manufacturer: models.SingleStringValuedAttribute + brand: ApiSingleStringValuedAttribute + contributors: ApiSingleStringValuedAttribute + manufacturer: ApiSingleStringValuedAttribute class ApiClassifications(models.Classifications): - binding: models.SingleStringValuedAttribute - product_group: models.SingleStringValuedAttribute + binding: ApiSingleStringValuedAttribute + product_group: ApiSingleStringValuedAttribute class ApiContentInfo(models.ContentInfo): - edition: models.SingleStringValuedAttribute + edition: ApiSingleStringValuedAttribute languages: ApiMultiValuedAttributeType class ApiContentRating(models.ContentRating): - audience_rating: models.SingleStringValuedAttribute + audience_rating: ApiSingleStringValuedAttribute class ApiExternalIds(models.ExternalIds): ea_ns: ApiMultiValuedAttributeStr @@ -47,31 +69,36 @@ class ApiFeatures(): features: ApiMultiValuedAttributeStr class ApiManufactureInfo(models.ManufactureInfo): - item_part_number: models.SingleStringValuedAttribute - model: models.SingleStringValuedAttribute - warranty: models.SingleStringValuedAttribute + item_part_number: ApiSingleStringValuedAttribute + model: ApiSingleStringValuedAttribute + warranty: ApiSingleStringValuedAttribute class ApiItemDimensions(models.DimensionBasedAttribute): - height: models.SingleIntegerValuedAttribute - length: models.SingleIntegerValuedAttribute - weight: models.SingleIntegerValuedAttribute - width: models.SingleIntegerValuedAttribute + height: ApiUnitBasedAttribute + length: ApiUnitBasedAttribute + weight: ApiUnitBasedAttribute + width: ApiUnitBasedAttribute class ApiProductInfo(models.ProductInfo): - color: models.SingleStringValuedAttribute - is_adult_product: models.SingleBooleanValuedAttribute + color: ApiSingleStringValuedAttribute + is_adult_product: ApiSingleBooleanValuedAttribute item_dimensions: ApiItemDimensions - release_date: models.SingleStringValuedAttribute - size: models.SingleStringValuedAttribute - unit_count: models.SingleIntegerValuedAttribute + release_date: ApiSingleStringValuedAttribute + size: ApiSingleStringValuedAttribute + unit_count: ApiSingleIntegerValuedAttribute class ApiTechnicalInfo(models.TechnicalInfo): formats: ApiMultiValuedAttributeStr - energy_efficiency_class: models.SingleStringValuedAttribute + energy_efficiency_class: ApiSingleStringValuedAttribute + +class ApiTradeInPrice(models.TradeInPrice): + amount: float + currency: str + display_amount: str class ApiTradeInInfo(models.TradeInInfo): is_eligible_for_trade_in: bool - price: models.TradeInPrice + price: ApiTradeInPrice class ApiItemInfo(models.ItemInfo): by_line_info: ApiByLineInfo @@ -83,12 +110,33 @@ class ApiItemInfo(models.ItemInfo): manufacture_info: ApiManufactureInfo product_info: ApiProductInfo technical_info: ApiTechnicalInfo - title: models.SingleStringValuedAttribute + title: ApiSingleStringValuedAttribute trade_in_info: ApiTradeInInfo +"""Offers model""" +class ApiOfferCondition(models.OfferCondition): + sub_condition: models.OfferSubCondition + condition_note: models.OfferConditionNote + +class ApiListings(models.OfferListing): + availability: models.Availability + condition: ApiOfferCondition + delivery_info: models.OfferDeliveryInfo + id: str + is_buy_box_winner: bool + + +class ApiOffers(models.Offers): + listings: list[ApiListings] + + +"""Browse node info model""" +class ApiBrowseNodeInfo(models.BrowseNodeInfo): + pass + """Main model""" class ApiItem(models.Item): item_info: ApiItemInfo images: ApiImages - offers: models.Offers - browse_node_info: models.BrowseNodeInfo + offers: ApiOffers + browse_node_info: ApiBrowseNodeInfo From b208fea3a4690f246934962b481020863026aedd Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Thu, 8 Jul 2021 23:45:51 +0200 Subject: [PATCH 30/67] All type hints correct at the moment --- amazon_paapi/models/api_item.py | 34 ++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/amazon_paapi/models/api_item.py b/amazon_paapi/models/api_item.py index 09efd0d..e639d1e 100644 --- a/amazon_paapi/models/api_item.py +++ b/amazon_paapi/models/api_item.py @@ -114,14 +114,38 @@ class ApiItemInfo(models.ItemInfo): trade_in_info: ApiTradeInInfo """Offers model""" -class ApiOfferCondition(models.OfferCondition): - sub_condition: models.OfferSubCondition - condition_note: models.OfferConditionNote +class ApiOfferAvailability(models.OfferAvailability): + max_order_quantity: int + message: str + min_order_quantity: int + type: str + +class ApiOfferConditionInfo: + display_value: str + label: str + locale: str + value: str + +class ApiOfferSubCondition(ApiOfferConditionInfo, models.OfferSubCondition): + pass + +class ApiOfferConditionNote(models.OfferConditionNote): + locale: str + value: str + +class ApiOfferCondition(ApiOfferConditionInfo, models.OfferCondition): + sub_condition: ApiOfferSubCondition + condition_note: ApiOfferConditionNote + +class ApiOfferDeliveryInfo(models.OfferDeliveryInfo): + is_amazon_fulfilled: bool + is_free_shipping_eligible: bool + is_prime_eligible: bool class ApiListings(models.OfferListing): - availability: models.Availability + availability: ApiOfferAvailability condition: ApiOfferCondition - delivery_info: models.OfferDeliveryInfo + delivery_info: ApiOfferDeliveryInfo id: str is_buy_box_winner: bool From 17c053e9ada72b7f599c7726f9838ba3fb4a1918 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Thu, 8 Jul 2021 23:58:41 +0200 Subject: [PATCH 31/67] Finished with offers type hints --- amazon_paapi/models/api_item.py | 39 +++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/amazon_paapi/models/api_item.py b/amazon_paapi/models/api_item.py index e639d1e..29180e0 100644 --- a/amazon_paapi/models/api_item.py +++ b/amazon_paapi/models/api_item.py @@ -28,6 +28,12 @@ class ApiSingleBooleanValuedAttribute(ApiLabelLocale, models.SingleBooleanValued class ApiSingleIntegerValuedAttribute(ApiLabelLocale, models.SingleIntegerValuedAttribute): display_value: float +class ApiPrice: + amount: float + currency: str + price_per_unit: float + display_amount: str + """Image models""" class ApiImageSize(models.ImageSize): url: str @@ -142,18 +148,47 @@ class ApiOfferDeliveryInfo(models.OfferDeliveryInfo): is_free_shipping_eligible: bool is_prime_eligible: bool +class ApiOfferLoyaltyPoints(models.OfferLoyaltyPoints): + points: int + +class ApiOfferMerchantInfo(models.OfferMerchantInfo): + default_shipping_country: str + feedback_count: int + feedback_rating: float + id: str + name: str + +class ApiOfferSavings(ApiPrice, models.OfferSavings): + percentage: float + +class ApiOfferPrice(ApiPrice, models.OfferPrice): + savings: models.OfferSavings + +class ApiOfferProgramEligibility(models.OfferProgramEligibility): + is_prime_exclusive: bool + is_prime_pantry: bool + +class ApiPromotion(ApiPrice, models.OfferPromotion): + type: str + discount_percent: float + class ApiListings(models.OfferListing): availability: ApiOfferAvailability condition: ApiOfferCondition delivery_info: ApiOfferDeliveryInfo id: str is_buy_box_winner: bool - + loyalty_points: ApiOfferLoyaltyPoints + merchant_info: ApiOfferMerchantInfo + price: ApiOfferPrice + program_eligibility: ApiOfferProgramEligibility + promotions: list[ApiPromotion] + saving_basis: ApiPrice + violates_map: bool class ApiOffers(models.Offers): listings: list[ApiListings] - """Browse node info model""" class ApiBrowseNodeInfo(models.BrowseNodeInfo): pass From be838c66535441aebc9949216df5eb8d9a03d8a4 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Fri, 9 Jul 2021 00:03:03 +0200 Subject: [PATCH 32/67] Finished browse nodes type hints --- amazon_paapi/models/api_item.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/amazon_paapi/models/api_item.py b/amazon_paapi/models/api_item.py index 29180e0..53f42e4 100644 --- a/amazon_paapi/models/api_item.py +++ b/amazon_paapi/models/api_item.py @@ -190,8 +190,22 @@ class ApiOffers(models.Offers): listings: list[ApiListings] """Browse node info model""" +class ApiBrowseNode(models.BrowseNode): + ancestor: str + context_free_name: str + display_name: str + id: str + is_root: str + sales_rank: str + +class ApiWebsiteSalesRank(models.WebsiteSalesRank): + context_free_name: str + display_name: str + sales_rank: str + class ApiBrowseNodeInfo(models.BrowseNodeInfo): - pass + browse_nodes: list[ApiBrowseNode] + website_sales_rank: ApiWebsiteSalesRank """Main model""" class ApiItem(models.Item): From c95171fedc0c7f7191d57c613445b046c3359e97 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Fri, 9 Jul 2021 00:11:44 +0200 Subject: [PATCH 33/67] Added some missing type hints to ApiItem --- amazon_paapi/models/api_item.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/amazon_paapi/models/api_item.py b/amazon_paapi/models/api_item.py index 53f42e4..836917c 100644 --- a/amazon_paapi/models/api_item.py +++ b/amazon_paapi/models/api_item.py @@ -213,3 +213,10 @@ class ApiItem(models.Item): images: ApiImages offers: ApiOffers browse_node_info: ApiBrowseNodeInfo + asin: str + detail_page_url: str + parent_asin: str + score: float + rental_offers: models.RentalOffers + customer_reviews: models.CustomerReviews + variation_attributes: list[models.VariationAttribute] From ebeaab2bc4f639b1eb36f2833ac4fb54c24c712e Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Fri, 9 Jul 2021 00:13:13 +0200 Subject: [PATCH 34/67] Fixed docstrings error --- amazon_paapi/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/amazon_paapi/api.py b/amazon_paapi/api.py index da39174..48fcf24 100644 --- a/amazon_paapi/api.py +++ b/amazon_paapi/api.py @@ -80,7 +80,7 @@ def get_items(self, kwargs (any): Any other parameters supported by Amazon API for the GetItems operation. Returns: - list[AmazonItem]: A list of items with Amazon information. + list[ApiItem]: A list of items with Amazon information. """ kwargs.update({ From efe9175edb3b68015c5d34a72518b756419cd5a3 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Fri, 9 Jul 2021 00:33:59 +0200 Subject: [PATCH 35/67] Updated arguments and type hints for search_items --- amazon_paapi/api.py | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/amazon_paapi/api.py b/amazon_paapi/api.py index 48fcf24..daa3e5f 100644 --- a/amazon_paapi/api.py +++ b/amazon_paapi/api.py @@ -93,7 +93,7 @@ def get_items(self, items_ids = get_items_ids(items) results = [] - for asin_chunk in get_list_chunks(items_ids, 10): + for asin_chunk in get_list_chunks(items_ids, chunk_size=10): request = get_items_request(self, asin_chunk, **kwargs) self._throttle() items_response = get_items_response(self, request) @@ -101,11 +101,31 @@ def get_items(self, return results - def search_items(self, item_count=10, item_page=1, items_per_page=10, keywords=None, - actor=None, artist=None, author=None, brand=None, title=None, - availability='Available', browse_node=None, condition='Any', delivery=None, - max_price=None, min_price=None, min_rating=None, min_discount=None, - merchant='All', search_index='All', sort_by=None, async_req=False): +#TODO Ver paginación + + def search_items(self, + actor: str = None, + artist: str = None, + author: str = None, + availability: str = None, + brand: str = None, + browse_node_id: str = None, + condition: str = None, + currency_of_preference: str = None, + delivery_flags: list[str] = None, + item_count: int = None, + item_page: int = None, + keywords: str = None, + languages_of_preference: list[str] = None, + max_price: int = None, + merchant: str = None, + min_price: int = None, + min_reviews_rating: int = None, + min_saving_percent: int = None, + search_index: str = None, + sort_by: str = None, + title: str = None, + **kwargs) -> list[models.ApiItem]: """Search products on Amazon using different parameters. At least one of the following parameters should be used: keywords, actor, artist, author, brand, title. From 94e2e484f159be3d8850a2cb8db5bdb097ec3291 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Fri, 9 Jul 2021 16:48:33 +0200 Subject: [PATCH 36/67] Added correct types to search items arguments --- amazon_paapi/api.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/amazon_paapi/api.py b/amazon_paapi/api.py index daa3e5f..e9fc084 100644 --- a/amazon_paapi/api.py +++ b/amazon_paapi/api.py @@ -107,10 +107,10 @@ def search_items(self, actor: str = None, artist: str = None, author: str = None, - availability: str = None, + availability: models.Availability = None, brand: str = None, browse_node_id: str = None, - condition: str = None, + condition: models.Condition = None, currency_of_preference: str = None, delivery_flags: list[str] = None, item_count: int = None, @@ -118,12 +118,12 @@ def search_items(self, keywords: str = None, languages_of_preference: list[str] = None, max_price: int = None, - merchant: str = None, + merchant: models.Merchant = None, min_price: int = None, min_reviews_rating: int = None, min_saving_percent: int = None, search_index: str = None, - sort_by: str = None, + sort_by: models.SortBy = None, title: str = None, **kwargs) -> list[models.ApiItem]: """Search products on Amazon using different parameters. At least one of the From eb8df28e780a87c606afd144c44cfa8809861263 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Fri, 9 Jul 2021 17:31:10 +0200 Subject: [PATCH 37/67] Added args checking to search items --- amazon_paapi/api.py | 56 +++++++++++++++++++------------ amazon_paapi/helpers/arguments.py | 21 ++++++++++++ 2 files changed, 56 insertions(+), 21 deletions(-) diff --git a/amazon_paapi/api.py b/amazon_paapi/api.py index e9fc084..c8b7dc3 100644 --- a/amazon_paapi/api.py +++ b/amazon_paapi/api.py @@ -13,7 +13,7 @@ from .sdk.rest import ApiException from . import models -from .helpers.arguments import get_items_ids +from .helpers.arguments import check_search_args, get_items_ids from .helpers.requests import get_items_request, get_items_response from .helpers.generators import get_list_chunks from .errors import AmazonException, InvalidArgumentException @@ -60,8 +60,8 @@ def get_items(self, currency_of_preference: str = None, languages_of_preference: list[str] = None, **kwargs) -> list[models.ApiItem]: + """Get items information from Amazon. - Full official documentation [here](https://webservices.amazon.com/paapi5/documentation/get-items.html#ItemLookup-rp). Args: items (str | list[str]): One or more items using ASIN or product URL. Use a string @@ -101,21 +101,21 @@ def get_items(self, return results -#TODO Ver paginación def search_items(self, + item_count: int = None, + item_page: int = None, actor: str = None, artist: str = None, author: str = None, - availability: models.Availability = None, brand: str = None, + keywords: str = None, + title: str = None, + availability: models.Availability = None, browse_node_id: str = None, condition: models.Condition = None, currency_of_preference: str = None, delivery_flags: list[str] = None, - item_count: int = None, - item_page: int = None, - keywords: str = None, languages_of_preference: list[str] = None, max_price: int = None, merchant: models.Merchant = None, @@ -124,7 +124,6 @@ def search_items(self, min_saving_percent: int = None, search_index: str = None, sort_by: models.SortBy = None, - title: str = None, **kwargs) -> list[models.ApiItem]: """Search products on Amazon using different parameters. At least one of the following parameters should be used: keywords, actor, artist, author, brand, @@ -178,19 +177,34 @@ def search_items(self, list of instances: A list containing 1 instance for each product or None if no results. """ - if items_per_page > 10 or items_per_page < 1: - raise AmazonException( - 'ValueError', 'Arg items_per_page should be between 1 and 10') - if item_count > 100 or item_count < 1: - raise AmazonException( - 'ValueError', 'Arg item_count should be between 1 and 100') - if item_page < 1: - raise AmazonException( - 'ValueError', 'Arg item_page should be 1 or higher') - if not keywords and not actor and not artist and not author and not brand and not title and not browse_node and not search_index: - raise AmazonException('ValueError', 'At least one of the following args must be ' - 'provided: keywords, actor, artist, author, brand, ' - 'title, browse_node, search_index') + + kwargs.update({ + 'item_count': item_count, + 'item_page': item_page, + 'actor': actor, + 'artist': artist, + 'author': author, + 'brand': brand, + 'keywords': keywords, + 'title': title, + 'availability': availability, + 'browse_node_id': browse_node_id, + 'condition': condition, + 'currency_of_preference': currency_of_preference, + 'delivery_flags': delivery_flags, + 'languages_of_preference': languages_of_preference, + 'max_price': max_price, + 'merchant': merchant, + 'min_price': min_price, + 'min_reviews_rating': min_reviews_rating, + 'min_saving_percent': min_saving_percent, + 'search_index': search_index, + 'sort_by': sort_by, + }) + + check_search_args(**kwargs) + + results = [] while len(results) < item_count: try: diff --git a/amazon_paapi/helpers/arguments.py b/amazon_paapi/helpers/arguments.py index b3f51a0..37d92c3 100644 --- a/amazon_paapi/helpers/arguments.py +++ b/amazon_paapi/helpers/arguments.py @@ -16,3 +16,24 @@ def get_items_ids(items: Union[str, list[str]]) -> list[str]: else: return [get_asin(x.strip()) for x in items] + + +def check_search_args(**kwargs): + _check_search_mandatory_args(**kwargs) + _check_search_pagination_args(**kwargs) + + +def _check_search_mandatory_args(**kwargs): + mandatory_args = [kwargs['keywords'], kwargs['actor'], kwargs['artist'], + kwargs['author'],kwargs['brand'], kwargs['title']] + if all(arg is None for arg in mandatory_args): + error_message = ('At least one of the following args should be provided: ' + 'keywords, actor, artist, author, brand or title.') + raise InvalidArgumentException(error_message) + + +def _check_search_pagination_args(**kwargs): + pagination_args = [kwargs['item_count'], kwargs['item_page']] + if not all(1 <= arg <= 10 and isinstance(arg, int) for arg in pagination_args): + error_message = ('Args item_count and item_page should be integers between 1 and 10.') + raise InvalidArgumentException(error_message) From 1a17641594f8fa65ab26494bea1f57eff9f71bce Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Fri, 9 Jul 2021 17:57:33 +0200 Subject: [PATCH 38/67] Finished search_items method --- amazon_paapi/api.py | 77 +++---------------------------- amazon_paapi/helpers/arguments.py | 3 ++ amazon_paapi/helpers/requests.py | 50 ++++++++++++++------ 3 files changed, 46 insertions(+), 84 deletions(-) diff --git a/amazon_paapi/api.py b/amazon_paapi/api.py index c8b7dc3..089f6ab 100644 --- a/amazon_paapi/api.py +++ b/amazon_paapi/api.py @@ -14,7 +14,7 @@ from . import models from .helpers.arguments import check_search_args, get_items_ids -from .helpers.requests import get_items_request, get_items_response +from .helpers.requests import get_items_request, get_items_response, get_search_items_request, get_search_items_response from .helpers.generators import get_list_chunks from .errors import AmazonException, InvalidArgumentException from .tools import get_asin @@ -22,6 +22,8 @@ from typing import Union import time +from amazon_paapi.sdk.models import search_items_request + class AmazonApi: """Provides methods to get information from Amazon using your API credentials. @@ -203,78 +205,11 @@ def search_items(self, }) check_search_args(**kwargs) + request = get_search_items_request(self, **kwargs) + self._throttle() + return get_search_items_response(self, request) - results = [] - while len(results) < item_count: - try: - request = SearchItemsRequest( - partner_tag=self._tag, - partner_type=PartnerType.ASSOCIATES, - actor=actor, - artist=artist, - author=author, - availability=availability, - brand=brand, - browse_node_id=browse_node, - condition=models.CONDITION[condition], - delivery_flags=delivery, - item_count=items_per_page, - item_page=item_page, - keywords=keywords, - max_price=max_price, - merchant=merchant, - min_price=min_price, - min_reviews_rating=min_rating, - min_saving_percent=min_discount, - offer_count=1, - resources=models.SEARCH_RESOURCES, - search_index=search_index, - sort_by=sort_by, - title=title) - except KeyError: - raise AmazonException('KeyError', 'Invalid condition value') - except Exception as e: - raise AmazonException('SearchItemsError', e) - - for x in range(3): - try: - # Send the request and create results - self._throttle() - if async_req: - thread = self._api.search_items(request, async_req=True) - response = thread.get() - else: - response = self._api.search_items(request) - break - except ApiException as e: - if x == 2: - raise AmazonException('ApiException', e) - try: - if response.search_result is not None: - if response.search_result.items is not None: - for item in response.search_result.items: - results.append(get_parsed_item(item)) - if len(results) >= item_count: - break - if len(response.search_result.items) < items_per_page: - break - else: - break - if response.errors is not None: - raise AmazonException( - response.errors[0].code, response.errors[0].message) - except Exception as e: - if e.status == "NoResults": - break - raise AmazonException('ResponseError', e) - item_page += 1 - - if results: - return results - else: - return None - def get_variations(self, asin, item_count=10, item_page=1, items_per_page=10, condition='Any', merchant='All', async_req=False): """Returns a set of items that are the same product, but differ according to a diff --git a/amazon_paapi/helpers/arguments.py b/amazon_paapi/helpers/arguments.py index 37d92c3..27889a2 100644 --- a/amazon_paapi/helpers/arguments.py +++ b/amazon_paapi/helpers/arguments.py @@ -34,6 +34,9 @@ def _check_search_mandatory_args(**kwargs): def _check_search_pagination_args(**kwargs): pagination_args = [kwargs['item_count'], kwargs['item_page']] + if all(arg is None for arg in pagination_args): + return + if not all(1 <= arg <= 10 and isinstance(arg, int) for arg in pagination_args): error_message = ('Args item_count and item_page should be integers between 1 and 10.') raise InvalidArgumentException(error_message) diff --git a/amazon_paapi/helpers/requests.py b/amazon_paapi/helpers/requests.py index f63e27b..74c130e 100644 --- a/amazon_paapi/helpers/requests.py +++ b/amazon_paapi/helpers/requests.py @@ -2,30 +2,25 @@ from .. import models +from ..errors import ApiRequestException, ItemsNotFoudException, MalformedRequestException from ..sdk.models.get_items_resource import GetItemsResource -from ..sdk.rest import ApiException -from ..sdk.models.partner_type import PartnerType from ..sdk.models.get_items_request import GetItemsRequest -from ..errors import ApiRequestException, ItemsNotFoudException, MalformedRequestException +from ..sdk.models.search_items_resource import SearchItemsResource +from ..sdk.models.search_items_request import SearchItemsRequest +from ..sdk.rest import ApiException import inspect def get_items_request(self, asin_chunk: list[str], **kwargs) -> models.GetItemsRequest: try: - return GetItemsRequest(resources=_get_items_request_resources(), - partner_type=PartnerType.ASSOCIATES, + return GetItemsRequest(resources=_get_request_resources(GetItemsResource), + partner_type=models.PartnerType.ASSOCIATES, marketplace=self._marketplace, partner_tag=self._tag, item_ids=asin_chunk, **kwargs) - except TypeError: - raise MalformedRequestException('Parameters for get_items request are not correct') - - -def _get_items_request_resources() -> list[models.GetItemsResource]: - resources = inspect.getmembers(GetItemsResource, lambda a:not(inspect.isroutine(a))) - resources = [x[-1] for x in resources if isinstance(x[-1], str) and x[0][0:2] != '__'] - return resources + except TypeError as e: + raise MalformedRequestException('Parameters for get_items request are not correct: ' + str(e)) def get_items_response(self, request: models.GetItemsRequest) -> list[models.ApiItem]: @@ -38,3 +33,32 @@ def get_items_response(self, request: models.GetItemsRequest) -> list[models.Api raise ItemsNotFoudException('No items have been found') return response.items_result.items + + +def get_search_items_request(self, **kwargs) -> models.SearchItemsResource: + try: + return SearchItemsRequest(resources=_get_request_resources(SearchItemsResource), + partner_type=models.PartnerType.ASSOCIATES, + marketplace=self._marketplace, + partner_tag=self._tag, + **kwargs) + except TypeError as e: + raise MalformedRequestException('Parameters for search_items request are not correct: ' + str(e)) + + +def get_search_items_response(self, request: models.SearchItemsRequest) -> list[models.ApiItem]: + try: + response = self._api.search_items(request) + except ApiException as e: + raise ApiRequestException('Error getting a response from Amazon API: ' + str(e)) + + if response.search_result == None: + raise ItemsNotFoudException('No items have been found') + + return response.search_result.items + + +def _get_request_resources(resources) -> list[str]: + resources = inspect.getmembers(resources, lambda a:not(inspect.isroutine(a))) + resources = [x[-1] for x in resources if isinstance(x[-1], str) and x[0][0:2] != '__'] + return resources From d2d09ae09425ca24a41ec817c1d6e5672f2723d1 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Fri, 9 Jul 2021 18:02:33 +0200 Subject: [PATCH 39/67] Solved bug with _check_search_pagination_args --- amazon_paapi/helpers/arguments.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/amazon_paapi/helpers/arguments.py b/amazon_paapi/helpers/arguments.py index 27889a2..0a8f83c 100644 --- a/amazon_paapi/helpers/arguments.py +++ b/amazon_paapi/helpers/arguments.py @@ -34,9 +34,7 @@ def _check_search_mandatory_args(**kwargs): def _check_search_pagination_args(**kwargs): pagination_args = [kwargs['item_count'], kwargs['item_page']] - if all(arg is None for arg in pagination_args): - return - + pagination_args = [arg for arg in pagination_args if arg] if not all(1 <= arg <= 10 and isinstance(arg, int) for arg in pagination_args): error_message = ('Args item_count and item_page should be integers between 1 and 10.') raise InvalidArgumentException(error_message) From 9b9f96826556bac04739cb18cda8824f8953bb74 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Fri, 9 Jul 2021 18:33:52 +0200 Subject: [PATCH 40/67] Updated seach_index docstrings --- amazon_paapi/api.py | 89 +++++++++++++++++++++------------------------ 1 file changed, 41 insertions(+), 48 deletions(-) diff --git a/amazon_paapi/api.py b/amazon_paapi/api.py index 089f6ab..754f63b 100644 --- a/amazon_paapi/api.py +++ b/amazon_paapi/api.py @@ -68,10 +68,9 @@ def get_items(self, Args: items (str | list[str]): One or more items using ASIN or product URL. Use a string separated by comma or a list of strings. - condition (str, optional): The condition parameter filters offers by condition type. - Available values in models.Condition. Defaults to Any. - merchant (str, optional): Filters search results to return items having at least one - offer sold by target merchant. Available values in models.Merchant. Defaults to All. + condition (Condition, optional): Filters offers by condition type. Defaults to Any. + merchant (Merchant, optional): Filters search results to return items having at least one + offer sold by target merchant. Defaults to All. currency_of_preference (str, optional): Currency of preference in which the prices information should be returned in response. By default the prices are returned in the default currency of the marketplace. Expected currency code format is @@ -119,65 +118,59 @@ def search_items(self, currency_of_preference: str = None, delivery_flags: list[str] = None, languages_of_preference: list[str] = None, - max_price: int = None, merchant: models.Merchant = None, + max_price: int = None, min_price: int = None, - min_reviews_rating: int = None, min_saving_percent: int = None, + min_reviews_rating: int = None, search_index: str = None, sort_by: models.SortBy = None, **kwargs) -> list[models.ApiItem]: - """Search products on Amazon using different parameters. At least one of the - following parameters should be used: keywords, actor, artist, author, brand, - title. + """Searches for items on Amazon based on a search query. At least one of the following + parameters should be specified: keywords, actor, artist, author, brand or title. Args: - item_count (int, optional): The total number of products to get. Should be between - 1 and 100. Defaults to 10. - item_page (int, optional): The page where the results start from. Should be between - 1 and 10. Defaults to 1. - items_per_page (int, optional): Products on each page. Should be between - 1 and 10. Defaults to 10. - keywords (str, optional): A word or phrase that describes an item. + item_count (int, optional): The number of items returned. Should be between 1 and 10. + Defaults to 10. + item_page (int, optional): The specific page of items to be returned from the available + results. Should be between 1 and 10. Defaults to 1. actor (str, optional): Actor name associated with the item. artist (str, optional): Artist name associated with the item. author (str, optional): Author name associated with the item. brand (str, optional): Brand name associated with the item. + keywords (str, optional): A word or phrase that describes an item. title (str, optional): Title associated with the item. - availability (str, optional): Filters available items on Amazon. Allowed values: - Available, IncludeOutOfStock. Defaults to Available. - browse_node (str, optional): A unique ID assigned by Amazon that - identifies a product category or subcategory. - condition (str, optional): The condition parameter filters offers by - condition type. Allowed values: Any, Collectible, New, Refurbished, Used. - Defaults to Any. - delivery (list, optional): The delivery flag filters items which - satisfy a certain delivery program promoted by the specific - Amazon Marketplace. Allowed values: AmazonGlobal, FreeShipping, - FulfilledByAmazon, Prime. - max_price (int, optional): Filters search results to items with at - least one offer price below the specified value. - min_price (int, optional): Filters search results to items with at - least one offer price above the specified value. - min_rating (int, optional): Filters search results to items with - customer review ratings above specified value. - min_discount (int, optional): Filters search results to items with - at least one offer having saving percentage above the specified - value. - merchant (str, optional): Filters search results to return items - having at least one offer sold by target merchant. Allowed values: - All, Amazon. Defaults to All. - search_index (str, optional): Indicates the product category to - search. Defaults to All. - sort_by (str, optional): The way in which items in the response - are sorted. Allowed values: AvgCustomerReviews, Featured, - NewestArrivals, Price:HighToLow, Price:LowToHigh, Relevance. - async_req (bool, optional): Specify if a thread should be created to - run the request. Defaults to False. + availability (Availability, optional): Filters available items on Amazon. + Defaults to Available. + browse_node_id (str, optional): A unique ID assigned by Amazon that identifies a product + category or subcategory. + condition (Condition, optional): Filters offers by condition type. Defaults to Any. + currency_of_preference (str, optional): Currency of preference in which the prices + information should be returned in response. By default the prices are returned + in the default currency of the marketplace. Expected currency code format is + ISO 4217. + delivery_flags (list[str]): Filters items which satisfy a certain delivery program. + languages_of_preference (list[str], optional): Languages in order of preference in + which the item information should be returned in response. By default the item + information is returned in the default language of the marketplace. + merchant (Merchant, optional): Filters search results to return items having at least one + offer sold by target merchant. Defaults to All. + max_price (int, optional): Filters search results to items with at least one offer price + below the specified value. Prices appear in lowest currency denomination. + For example, $31.41 should be passed as 3141 or 28.00€ should be 2800. + min_price (int, optional): Filters search results to items with at least one offer price + above the specified value. Prices appear in lowest currency denomination. + For example, $31.41 should be passed as 3141 or 28.00€ should be 2800. + min_saving_percent (int, optional): Filters search results to items with at least one + offer having saving percentage above the specified value. Value should be + positive integer less than 100. + min_reviews_rating (int, optional): Filters search results to items with customer review + ratings above specified value. Value should be positive integer less than 5. + search_index (str, optional): Indicates the product category to search. Defaults to All. + sort_by (SortBy, optional): The way in which items are sorted. Returns: - list of instances: A list containing 1 instance for each product - or None if no results. + list[ApiItem]: A list of items with Amazon information. """ kwargs.update({ From a7281bb6c49163efd0381427e848fd90fe4b1526 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Fri, 9 Jul 2021 18:40:00 +0200 Subject: [PATCH 41/67] Added format and raised exceptions to init docstrings --- amazon_paapi/api.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/amazon_paapi/api.py b/amazon_paapi/api.py index 754f63b..8a2d0e5 100644 --- a/amazon_paapi/api.py +++ b/amazon_paapi/api.py @@ -29,12 +29,15 @@ class AmazonApi: """Provides methods to get information from Amazon using your API credentials. Args: - key (str): Your API key. - secret (str): Your API secret. - tag (str): Your affiliate tracking id, used to create the affiliate link. - country (str): Country code for your affiliate account. Available values in models.Country. - throttling (float, optional): Wait time in seconds between API calls. Use it to avoid + key (``str``): Your API key. + secret (``str``): Your API secret. + tag (``str``): Your affiliate tracking id, used to create the affiliate link. + country (``models.Country``): Country code for your affiliate account. + throttling (``float``, optional): Wait time in seconds between API calls. Use it to avoid reaching Amazon limits. Defaults to 1 second. + + Raises: + ``InvalidArgumentException`` """ def __init__(self, key: str, secret: str, tag: str, country: models.Country, throttling: float = 1, **kwargs): From 3e395db0aa33adda12581810d92fdbf7509eea0f Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Fri, 9 Jul 2021 18:52:42 +0200 Subject: [PATCH 42/67] Updated get_items docstrings format --- amazon_paapi/api.py | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/amazon_paapi/api.py b/amazon_paapi/api.py index 8a2d0e5..bc89008 100644 --- a/amazon_paapi/api.py +++ b/amazon_paapi/api.py @@ -34,7 +34,7 @@ class AmazonApi: tag (``str``): Your affiliate tracking id, used to create the affiliate link. country (``models.Country``): Country code for your affiliate account. throttling (``float``, optional): Wait time in seconds between API calls. Use it to avoid - reaching Amazon limits. Defaults to 1 second. + reaching Amazon limits. Defaults to ``1`` second. Raises: ``InvalidArgumentException`` @@ -69,22 +69,20 @@ def get_items(self, """Get items information from Amazon. Args: - items (str | list[str]): One or more items using ASIN or product URL. Use a string - separated by comma or a list of strings. - condition (Condition, optional): Filters offers by condition type. Defaults to Any. - merchant (Merchant, optional): Filters search results to return items having at least one - offer sold by target merchant. Defaults to All. - currency_of_preference (str, optional): Currency of preference in which the prices - information should be returned in response. By default the prices are returned - in the default currency of the marketplace. Expected currency code format is - ISO 4217. - languages_of_preference (list[str], optional): Languages in order of preference in - which the item information should be returned in response. By default the item - information is returned in the default language of the marketplace. - kwargs (any): Any other parameters supported by Amazon API for the GetItems operation. + items (``str`` | ``list[str]``): One or more items, using ASIN or product URL. Items + in string format should be separated by commas. + condition (``models.Condition``, optional): Filters offers by condition type. + Defaults to Any. + merchant (``models.Merchant``, optional): Filters search results to return items having + at least one offer sold by target merchant. Defaults to ``All``. + currency_of_preference (``str``, optional): Currency of preference in which the prices + information should be returned. Expected currency code format is ISO 4217. + languages_of_preference (``list[str]``, optional): Languages in order of preference in + which the item information should be returned. + kwargs (``dict``, optional): Any other arguments to be passed to the Amazon API. Returns: - list[ApiItem]: A list of items with Amazon information. + ``list[ApiItem]``: A list of items with Amazon information. """ kwargs.update({ @@ -148,10 +146,8 @@ def search_items(self, browse_node_id (str, optional): A unique ID assigned by Amazon that identifies a product category or subcategory. condition (Condition, optional): Filters offers by condition type. Defaults to Any. - currency_of_preference (str, optional): Currency of preference in which the prices - information should be returned in response. By default the prices are returned - in the default currency of the marketplace. Expected currency code format is - ISO 4217. + currency_of_preference (``str``, optional): Currency of preference in which the prices + information should be returned. Expected currency code format is ISO 4217. delivery_flags (list[str]): Filters items which satisfy a certain delivery program. languages_of_preference (list[str], optional): Languages in order of preference in which the item information should be returned in response. By default the item From f2c2fbc05dfdf4bda1e0613e83f049f61cfaeddb Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Fri, 9 Jul 2021 18:57:36 +0200 Subject: [PATCH 43/67] Added exceptions to get_items docstrings --- amazon_paapi/api.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/amazon_paapi/api.py b/amazon_paapi/api.py index bc89008..05b43eb 100644 --- a/amazon_paapi/api.py +++ b/amazon_paapi/api.py @@ -72,7 +72,7 @@ def get_items(self, items (``str`` | ``list[str]``): One or more items, using ASIN or product URL. Items in string format should be separated by commas. condition (``models.Condition``, optional): Filters offers by condition type. - Defaults to Any. + Defaults to ``Any``. merchant (``models.Merchant``, optional): Filters search results to return items having at least one offer sold by target merchant. Defaults to ``All``. currency_of_preference (``str``, optional): Currency of preference in which the prices @@ -83,6 +83,12 @@ def get_items(self, Returns: ``list[ApiItem]``: A list of items with Amazon information. + + Raises: + ``InvalidArgumentException`` + ``MalformedRequestException`` + ``ApiRequestException`` + ``ItemsNotFoudException`` """ kwargs.update({ @@ -149,9 +155,8 @@ def search_items(self, currency_of_preference (``str``, optional): Currency of preference in which the prices information should be returned. Expected currency code format is ISO 4217. delivery_flags (list[str]): Filters items which satisfy a certain delivery program. - languages_of_preference (list[str], optional): Languages in order of preference in - which the item information should be returned in response. By default the item - information is returned in the default language of the marketplace. + languages_of_preference (``list[str]``, optional): Languages in order of preference in + which the item information should be returned. merchant (Merchant, optional): Filters search results to return items having at least one offer sold by target merchant. Defaults to All. max_price (int, optional): Filters search results to items with at least one offer price @@ -167,6 +172,7 @@ def search_items(self, ratings above specified value. Value should be positive integer less than 5. search_index (str, optional): Indicates the product category to search. Defaults to All. sort_by (SortBy, optional): The way in which items are sorted. + kwargs (``dict``, optional): Any other arguments to be passed to the Amazon API. Returns: list[ApiItem]: A list of items with Amazon information. From 1640ae34f6379651be01476354b55794aea097d1 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Fri, 9 Jul 2021 19:03:57 +0200 Subject: [PATCH 44/67] Updated docstrings style for search_items --- amazon_paapi/api.py | 65 +++++++++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 29 deletions(-) diff --git a/amazon_paapi/api.py b/amazon_paapi/api.py index 05b43eb..ad38bdf 100644 --- a/amazon_paapi/api.py +++ b/amazon_paapi/api.py @@ -134,48 +134,55 @@ def search_items(self, sort_by: models.SortBy = None, **kwargs) -> list[models.ApiItem]: """Searches for items on Amazon based on a search query. At least one of the following - parameters should be specified: keywords, actor, artist, author, brand or title. + parameters should be specified: ``keywords``, ``actor``, ``artist``, ``author``, + ``brand`` or ``title``. Args: - item_count (int, optional): The number of items returned. Should be between 1 and 10. - Defaults to 10. - item_page (int, optional): The specific page of items to be returned from the available - results. Should be between 1 and 10. Defaults to 1. - actor (str, optional): Actor name associated with the item. - artist (str, optional): Artist name associated with the item. - author (str, optional): Author name associated with the item. - brand (str, optional): Brand name associated with the item. - keywords (str, optional): A word or phrase that describes an item. - title (str, optional): Title associated with the item. - availability (Availability, optional): Filters available items on Amazon. - Defaults to Available. - browse_node_id (str, optional): A unique ID assigned by Amazon that identifies a product + item_count (``int``, optional): Number of items returned. Should be between ``1`` and ``10``. + Defaults to ``10``. + item_page (``int``, optional): The specific page of items to be returned from the available + results. Should be between ``1`` and ``10``. Defaults to ``1``. + actor (``str``, optional): Actor name associated with the item. + artist (``str``, optional): Artist name associated with the item. + author (``str``, optional): Author name associated with the item. + brand (``str``, optional): Brand name associated with the item. + keywords (``str``, optional): A word or phrase that describes an item. + title (``str``, optional): Title associated with the item. + availability (``models.Availability``, optional): Filters available items on Amazon. + Defaults to ``Available``. + browse_node_id (``str``, optional): A unique ID assigned by Amazon that identifies a product category or subcategory. - condition (Condition, optional): Filters offers by condition type. Defaults to Any. + condition (``models.Condition``, optional): Filters offers by condition type. Defaults to ``Any``. currency_of_preference (``str``, optional): Currency of preference in which the prices information should be returned. Expected currency code format is ISO 4217. - delivery_flags (list[str]): Filters items which satisfy a certain delivery program. + delivery_flags (``list[str]``): Filters items which satisfy a certain delivery program. languages_of_preference (``list[str]``, optional): Languages in order of preference in which the item information should be returned. - merchant (Merchant, optional): Filters search results to return items having at least one - offer sold by target merchant. Defaults to All. - max_price (int, optional): Filters search results to items with at least one offer price + merchant (``models.Merchant``, optional): Filters search results to return items having + at least one offer sold by target merchant. Defaults to ``All``. + max_price (``int``, optional): Filters search results to items with at least one offer price below the specified value. Prices appear in lowest currency denomination. - For example, $31.41 should be passed as 3141 or 28.00€ should be 2800. - min_price (int, optional): Filters search results to items with at least one offer price + For example, $31.41 should be passed as ``3141`` or 28.00€ should be ``2800``. + min_price (``int``, optional): Filters search results to items with at least one offer price above the specified value. Prices appear in lowest currency denomination. - For example, $31.41 should be passed as 3141 or 28.00€ should be 2800. - min_saving_percent (int, optional): Filters search results to items with at least one + For example, $31.41 should be passed as ``3141`` or 28.00€ should be ``2800``. + min_saving_percent (``int``, optional): Filters search results to items with at least one offer having saving percentage above the specified value. Value should be - positive integer less than 100. - min_reviews_rating (int, optional): Filters search results to items with customer review - ratings above specified value. Value should be positive integer less than 5. - search_index (str, optional): Indicates the product category to search. Defaults to All. - sort_by (SortBy, optional): The way in which items are sorted. + ``positive integer less than 100``. + min_reviews_rating (``int``, optional): Filters search results to items with customer review + ratings above specified value. Value should be ``positive integer less than 5``. + search_index (``str``, optional): Indicates the product category to search. Defaults to ``All``. + sort_by (``models.SortBy``, optional): The way in which items are sorted. kwargs (``dict``, optional): Any other arguments to be passed to the Amazon API. Returns: - list[ApiItem]: A list of items with Amazon information. + ``list[ApiItem]``: A list of items with Amazon information. + + Raises: + ``InvalidArgumentException`` + ``MalformedRequestException`` + ``ApiRequestException`` + ``ItemsNotFoudException`` """ kwargs.update({ From bb0080fb236bdce8a47ea8b2a0008abdfa554893 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Fri, 9 Jul 2021 19:49:36 +0200 Subject: [PATCH 45/67] Started with get_variations refactor --- amazon_paapi/api.py | 159 +++++++++++++++++------------- amazon_paapi/helpers/arguments.py | 8 ++ 2 files changed, 96 insertions(+), 71 deletions(-) diff --git a/amazon_paapi/api.py b/amazon_paapi/api.py index ad38bdf..8020829 100644 --- a/amazon_paapi/api.py +++ b/amazon_paapi/api.py @@ -6,14 +6,12 @@ """ from .sdk.api.default_api import DefaultApi -from .sdk.models.search_items_request import SearchItemsRequest -from .sdk.models.get_variations_request import GetVariationsRequest from .sdk.models.get_browse_nodes_request import GetBrowseNodesRequest from .sdk.models.partner_type import PartnerType from .sdk.rest import ApiException from . import models -from .helpers.arguments import check_search_args, get_items_ids +from .helpers.arguments import check_search_args, check_variations_args, get_items_ids from .helpers.requests import get_items_request, get_items_response, get_search_items_request, get_search_items_response from .helpers.generators import get_list_chunks from .errors import AmazonException, InvalidArgumentException @@ -22,8 +20,6 @@ from typing import Union import time -from amazon_paapi.sdk.models import search_items_request - class AmazonApi: """Provides methods to get information from Amazon using your API credentials. @@ -215,8 +211,14 @@ def search_items(self, return get_search_items_response(self, request) - def get_variations(self, asin, item_count=10, item_page=1, items_per_page=10, condition='Any', - merchant='All', async_req=False): + def get_variations(self, + asin: str, + variation_count: int = None, + variation_page: int = None, + condition: models.Condition = None, + currency_of_preference: str = None, + merchant: models.Merchant = None, + **kwargs) -> list[models.ApiItem]: """Returns a set of items that are the same product, but differ according to a consistent theme, for example size and color. @@ -241,71 +243,86 @@ def get_variations(self, asin, item_count=10, item_page=1, items_per_page=10, co list of instances: A list containing 1 instance for each product or None if no results. """ - if items_per_page > 10 or items_per_page < 1: - raise AmazonException( - 'ValueError', 'Arg items_per_page should be between 1 and 10') - if item_count > 100 or item_count < 1: - raise AmazonException( - 'ValueError', 'Arg item_count should be between 1 and 100') - if item_page < 1: - raise AmazonException( - 'ValueError', 'Arg item_page should be 1 or higher') - results = [] - while len(results) < item_count: - try: - request = GetVariationsRequest( - partner_tag=self._tag, - partner_type=PartnerType.ASSOCIATES, - marketplace=self._marketplace, - asin=get_asin(asin), - condition=models.CONDITION[condition], - merchant=merchant, - offer_count=1, - variation_count=items_per_page, - variation_page=item_page, - resources=models.VARIATION_RESOURCES) - except KeyError: - raise AmazonException('KeyError', 'Invalid condition value') - except Exception as e: - raise AmazonException('GetVariationsError', e) - - for x in range(3): - try: - # Send the request and create results - self._throttle() - if async_req: - thread = self._api.get_variations( - request, async_req=True) - response = thread.get() - else: - response = self._api.get_variations(request) - break - except ApiException as e: - if x == 2: - raise AmazonException('ApiException', e) - try: - if response.variations_result is not None: - if response.variations_result.items is not None: - for item in response.variations_result.items: - results.append(get_parsed_item(item)) - if len(results) >= item_count: - break - if len(response.variations_result.items) < items_per_page: - break - else: - break - if response.errors is not None: - raise AmazonException( - response.errors[0].code, response.errors[0].message) - except Exception as e: - raise AmazonException('ResponseError', e) - item_page += 1 - - if results: - return results - else: - return None + kwargs.update({ + 'asin': asin, + 'variation_count': variation_count, + 'variation_page': variation_page, + 'condition': condition, + 'currency_of_preference': currency_of_preference, + 'merchant': merchant + }) + + check_variations_args(**kwargs) + request = get_variations_request(self, **kwargs) + self._throttle() + return get_variations_response(self, request) + + # if items_per_page > 10 or items_per_page < 1: + # raise AmazonException( + # 'ValueError', 'Arg items_per_page should be between 1 and 10') + # if item_count > 100 or item_count < 1: + # raise AmazonException( + # 'ValueError', 'Arg item_count should be between 1 and 100') + # if item_page < 1: + # raise AmazonException( + # 'ValueError', 'Arg item_page should be 1 or higher') + + # results = [] + # while len(results) < item_count: + # try: + # request = GetVariationsRequest( + # partner_tag=self._tag, + # partner_type=PartnerType.ASSOCIATES, + # marketplace=self._marketplace, + # asin=get_asin(asin), + # condition=models.CONDITION[condition], + # merchant=merchant, + # offer_count=1, + # variation_count=items_per_page, + # variation_page=item_page, + # resources=models.VARIATION_RESOURCES) + # except KeyError: + # raise AmazonException('KeyError', 'Invalid condition value') + # except Exception as e: + # raise AmazonException('GetVariationsError', e) + + # for x in range(3): + # try: + # # Send the request and create results + # self._throttle() + # if async_req: + # thread = self._api.get_variations( + # request, async_req=True) + # response = thread.get() + # else: + # response = self._api.get_variations(request) + # break + # except ApiException as e: + # if x == 2: + # raise AmazonException('ApiException', e) + # try: + # if response.variations_result is not None: + # if response.variations_result.items is not None: + # for item in response.variations_result.items: + # results.append(get_parsed_item(item)) + # if len(results) >= item_count: + # break + # if len(response.variations_result.items) < items_per_page: + # break + # else: + # break + # if response.errors is not None: + # raise AmazonException( + # response.errors[0].code, response.errors[0].message) + # except Exception as e: + # raise AmazonException('ResponseError', e) + # item_page += 1 + + # if results: + # return results + # else: + # return None def get_browsenodes(self, browse_nodes, async_req=False): """Get browse nodes information from Amazon. diff --git a/amazon_paapi/helpers/arguments.py b/amazon_paapi/helpers/arguments.py index 0a8f83c..2753b64 100644 --- a/amazon_paapi/helpers/arguments.py +++ b/amazon_paapi/helpers/arguments.py @@ -38,3 +38,11 @@ def _check_search_pagination_args(**kwargs): if not all(1 <= arg <= 10 and isinstance(arg, int) for arg in pagination_args): error_message = ('Args item_count and item_page should be integers between 1 and 10.') raise InvalidArgumentException(error_message) + + +def check_variations_args(**kwargs): + pagination_args = [kwargs['variation_count'], kwargs['variation_page']] + pagination_args = [arg for arg in pagination_args if arg] + if not all(1 <= arg <= 10 and isinstance(arg, int) for arg in pagination_args): + error_message = ('Args variation_count and variation_page should be integers between 1 and 10.') + raise InvalidArgumentException(error_message) From ccf99fbe8efbf9c2ac512aeeb07e0bcf8361b744 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Mon, 12 Jul 2021 20:06:49 +0200 Subject: [PATCH 46/67] Implemented get_variations and expose only needed models --- amazon_paapi/api.py | 81 ++++---------------------------- amazon_paapi/helpers/requests.py | 58 ++++++++++++++++------- amazon_paapi/models/__init__.py | 6 +-- amazon_paapi/models/api_item.py | 4 +- 4 files changed, 56 insertions(+), 93 deletions(-) diff --git a/amazon_paapi/api.py b/amazon_paapi/api.py index 8020829..99e1afd 100644 --- a/amazon_paapi/api.py +++ b/amazon_paapi/api.py @@ -12,7 +12,7 @@ from . import models from .helpers.arguments import check_search_args, check_variations_args, get_items_ids -from .helpers.requests import get_items_request, get_items_response, get_search_items_request, get_search_items_response +from .helpers.requests import get_items_request, get_items_response, get_search_items_request, get_search_items_response, get_variations_request, get_variations_response from .helpers.generators import get_list_chunks from .errors import AmazonException, InvalidArgumentException from .tools import get_asin @@ -45,9 +45,9 @@ def __init__(self, key: str, secret: str, tag: str, country: models.Country, thr self._last_query_time = time.time() - throttling try: - self._host = 'webservices.amazon.' + models.DOMAINS[country] - self._region = models.REGIONS[country] - self._marketplace = 'www.amazon.' + models.DOMAINS[country] + self._host = 'webservices.amazon.' + models.regions.DOMAINS[country] + self._region = models.regions.REGIONS[country] + self._marketplace = 'www.amazon.' + models.regions.DOMAINS[country] except KeyError: raise InvalidArgumentException('Country code is not correct') @@ -60,7 +60,7 @@ def get_items(self, merchant: models.Merchant = None, currency_of_preference: str = None, languages_of_preference: list[str] = None, - **kwargs) -> list[models.ApiItem]: + **kwargs) -> list[models.Item]: """Get items information from Amazon. @@ -128,7 +128,7 @@ def search_items(self, min_reviews_rating: int = None, search_index: str = None, sort_by: models.SortBy = None, - **kwargs) -> list[models.ApiItem]: + **kwargs) -> list[models.Item]: """Searches for items on Amazon based on a search query. At least one of the following parameters should be specified: ``keywords``, ``actor``, ``artist``, ``author``, ``brand`` or ``title``. @@ -217,8 +217,9 @@ def get_variations(self, variation_page: int = None, condition: models.Condition = None, currency_of_preference: str = None, + languages_of_preference: list[str] = None, merchant: models.Merchant = None, - **kwargs) -> list[models.ApiItem]: + **kwargs) -> list[models.Item]: """Returns a set of items that are the same product, but differ according to a consistent theme, for example size and color. @@ -250,6 +251,7 @@ def get_variations(self, 'variation_page': variation_page, 'condition': condition, 'currency_of_preference': currency_of_preference, + 'languages_of_preference': languages_of_preference, 'merchant': merchant }) @@ -258,71 +260,6 @@ def get_variations(self, self._throttle() return get_variations_response(self, request) - # if items_per_page > 10 or items_per_page < 1: - # raise AmazonException( - # 'ValueError', 'Arg items_per_page should be between 1 and 10') - # if item_count > 100 or item_count < 1: - # raise AmazonException( - # 'ValueError', 'Arg item_count should be between 1 and 100') - # if item_page < 1: - # raise AmazonException( - # 'ValueError', 'Arg item_page should be 1 or higher') - - # results = [] - # while len(results) < item_count: - # try: - # request = GetVariationsRequest( - # partner_tag=self._tag, - # partner_type=PartnerType.ASSOCIATES, - # marketplace=self._marketplace, - # asin=get_asin(asin), - # condition=models.CONDITION[condition], - # merchant=merchant, - # offer_count=1, - # variation_count=items_per_page, - # variation_page=item_page, - # resources=models.VARIATION_RESOURCES) - # except KeyError: - # raise AmazonException('KeyError', 'Invalid condition value') - # except Exception as e: - # raise AmazonException('GetVariationsError', e) - - # for x in range(3): - # try: - # # Send the request and create results - # self._throttle() - # if async_req: - # thread = self._api.get_variations( - # request, async_req=True) - # response = thread.get() - # else: - # response = self._api.get_variations(request) - # break - # except ApiException as e: - # if x == 2: - # raise AmazonException('ApiException', e) - # try: - # if response.variations_result is not None: - # if response.variations_result.items is not None: - # for item in response.variations_result.items: - # results.append(get_parsed_item(item)) - # if len(results) >= item_count: - # break - # if len(response.variations_result.items) < items_per_page: - # break - # else: - # break - # if response.errors is not None: - # raise AmazonException( - # response.errors[0].code, response.errors[0].message) - # except Exception as e: - # raise AmazonException('ResponseError', e) - # item_page += 1 - - # if results: - # return results - # else: - # return None def get_browsenodes(self, browse_nodes, async_req=False): """Get browse nodes information from Amazon. diff --git a/amazon_paapi/helpers/requests.py b/amazon_paapi/helpers/requests.py index 74c130e..8017f7d 100644 --- a/amazon_paapi/helpers/requests.py +++ b/amazon_paapi/helpers/requests.py @@ -1,33 +1,36 @@ """Module with helper functions for creating requests.""" -from .. import models +from ..models.api_item import Item from ..errors import ApiRequestException, ItemsNotFoudException, MalformedRequestException +from ..sdk.models.partner_type import PartnerType from ..sdk.models.get_items_resource import GetItemsResource from ..sdk.models.get_items_request import GetItemsRequest from ..sdk.models.search_items_resource import SearchItemsResource from ..sdk.models.search_items_request import SearchItemsRequest +from ..sdk.models.get_variations_resource import GetVariationsResource +from ..sdk.models.get_variations_request import GetVariationsRequest from ..sdk.rest import ApiException import inspect -def get_items_request(self, asin_chunk: list[str], **kwargs) -> models.GetItemsRequest: +def get_items_request(amazon_api, asin_chunk: list[str], **kwargs) -> GetItemsRequest: try: return GetItemsRequest(resources=_get_request_resources(GetItemsResource), - partner_type=models.PartnerType.ASSOCIATES, - marketplace=self._marketplace, - partner_tag=self._tag, + partner_type=PartnerType.ASSOCIATES, + marketplace=amazon_api._marketplace, + partner_tag=amazon_api._tag, item_ids=asin_chunk, **kwargs) except TypeError as e: raise MalformedRequestException('Parameters for get_items request are not correct: ' + str(e)) -def get_items_response(self, request: models.GetItemsRequest) -> list[models.ApiItem]: +def get_items_response(amazon_api, request: GetItemsRequest) -> list[Item]: try: - response = self._api.get_items(request) + response = amazon_api._api.get_items(request) except ApiException as e: - raise ApiRequestException('Error getting a response from Amazon API: ' + str(e)) + raise ApiRequestException('Error getting response for get_items from Amazon API: ' + str(e)) if response.items_result == None: raise ItemsNotFoudException('No items have been found') @@ -35,22 +38,22 @@ def get_items_response(self, request: models.GetItemsRequest) -> list[models.Api return response.items_result.items -def get_search_items_request(self, **kwargs) -> models.SearchItemsResource: +def get_search_items_request(amazon_api, **kwargs) -> SearchItemsRequest: try: return SearchItemsRequest(resources=_get_request_resources(SearchItemsResource), - partner_type=models.PartnerType.ASSOCIATES, - marketplace=self._marketplace, - partner_tag=self._tag, - **kwargs) + partner_type=PartnerType.ASSOCIATES, + marketplace=amazon_api._marketplace, + partner_tag=amazon_api._tag, + **kwargs) except TypeError as e: raise MalformedRequestException('Parameters for search_items request are not correct: ' + str(e)) -def get_search_items_response(self, request: models.SearchItemsRequest) -> list[models.ApiItem]: +def get_search_items_response(amazon_api, request: SearchItemsRequest) -> list[Item]: try: - response = self._api.search_items(request) + response = amazon_api._api.search_items(request) except ApiException as e: - raise ApiRequestException('Error getting a response from Amazon API: ' + str(e)) + raise ApiRequestException('Error getting response for search_items from Amazon API: ' + str(e)) if response.search_result == None: raise ItemsNotFoudException('No items have been found') @@ -58,6 +61,29 @@ def get_search_items_response(self, request: models.SearchItemsRequest) -> list[ return response.search_result.items +def get_variations_request(amazon_api, **kwargs) -> GetVariationsRequest: + try: + return GetVariationsRequest(resources=_get_request_resources(GetVariationsResource), + partner_type=PartnerType.ASSOCIATES, + marketplace=amazon_api._marketplace, + partner_tag=amazon_api._tag, + **kwargs) + except TypeError as e: + raise MalformedRequestException('Parameters for get_variations request are not correct: ' + str(e)) + + +def get_variations_response(amazon_api, request: GetVariationsRequest) -> list[Item]: + try: + response = amazon_api._api.get_variations(request) + except ApiException as e: + raise ApiRequestException('Error getting response for get_variations from Amazon API: ' + str(e)) + + if response.variations_result == None: + raise ItemsNotFoudException('No variation items have been found') + + return response.variations_result.items + + def _get_request_resources(resources) -> list[str]: resources = inspect.getmembers(resources, lambda a:not(inspect.isroutine(a))) resources = [x[-1] for x in resources if isinstance(x[-1], str) and x[0][0:2] != '__'] diff --git a/amazon_paapi/models/__init__.py b/amazon_paapi/models/__init__.py index c0d58aa..1c56a9e 100644 --- a/amazon_paapi/models/__init__.py +++ b/amazon_paapi/models/__init__.py @@ -1,3 +1,3 @@ -from ..sdk.models import * -from .regions import * -from .api_item import ApiItem +from .regions import Country +from .api_item import Item +from ..sdk.models import Availability, Condition, Merchant, SortBy diff --git a/amazon_paapi/models/api_item.py b/amazon_paapi/models/api_item.py index 836917c..4e06e72 100644 --- a/amazon_paapi/models/api_item.py +++ b/amazon_paapi/models/api_item.py @@ -1,4 +1,4 @@ -from .. import models +from ..sdk import models """Shared models""" class ApiLabelLocale: @@ -208,7 +208,7 @@ class ApiBrowseNodeInfo(models.BrowseNodeInfo): website_sales_rank: ApiWebsiteSalesRank """Main model""" -class ApiItem(models.Item): +class Item(models.Item): item_info: ApiItemInfo images: ApiImages offers: ApiOffers From 7cdbe6835505f0537bb11bffdad3f98966540ce7 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Mon, 12 Jul 2021 20:23:33 +0200 Subject: [PATCH 47/67] Implemented get_browse_nodes --- amazon_paapi/api.py | 67 +++++++++---------------------- amazon_paapi/helpers/arguments.py | 6 +++ amazon_paapi/helpers/requests.py | 25 ++++++++++++ 3 files changed, 49 insertions(+), 49 deletions(-) diff --git a/amazon_paapi/api.py b/amazon_paapi/api.py index 99e1afd..64ee594 100644 --- a/amazon_paapi/api.py +++ b/amazon_paapi/api.py @@ -5,17 +5,15 @@ an easier way. """ -from .sdk.api.default_api import DefaultApi -from .sdk.models.get_browse_nodes_request import GetBrowseNodesRequest -from .sdk.models.partner_type import PartnerType -from .sdk.rest import ApiException from . import models -from .helpers.arguments import check_search_args, check_variations_args, get_items_ids -from .helpers.requests import get_items_request, get_items_response, get_search_items_request, get_search_items_response, get_variations_request, get_variations_response +from .sdk.api.default_api import DefaultApi +from .errors import InvalidArgumentException +from .helpers.arguments import check_browse_nodes_args, check_search_args, check_variations_args, get_items_ids +from .helpers.requests import (get_browse_nodes_request, get_browse_nodes_response, get_items_request, + get_items_response, get_search_items_request, get_search_items_response, + get_variations_request, get_variations_response) from .helpers.generators import get_list_chunks -from .errors import AmazonException, InvalidArgumentException -from .tools import get_asin from typing import Union import time @@ -261,7 +259,10 @@ def get_variations(self, return get_variations_response(self, request) - def get_browsenodes(self, browse_nodes, async_req=False): + def get_browse_nodes(self, + browse_node_ids: list[str], + languages_of_preference: list[str] = None, + **kwargs): """Get browse nodes information from Amazon. Args: @@ -273,48 +274,16 @@ def get_browsenodes(self, browse_nodes, async_req=False): dict: A dictionary containing the browse node information. """ - if isinstance(browse_nodes, list) is False: - raise Exception('Browse nodes parameter should be a list') - elif not browse_nodes: - raise Exception('Browse nodes parameter can\'t be empty') - - try: - request = GetBrowseNodesRequest( - partner_tag=self._tag, - partner_type=PartnerType.ASSOCIATES, - marketplace=self._marketplace, - browse_node_ids=browse_nodes, - languages_of_preference=None, - resources=models.BROWSE_RESOURCES) - except ValueError as e: - raise AmazonException("ValueError", e) + kwargs.update({ + 'browse_node_ids': browse_node_ids, + 'languages_of_preference': languages_of_preference + }) - try: - self._throttle() - if async_req: - thread = self._api.get_browse_nodes(request, async_req=True) - response = thread.get() - else: - response = self._api.get_browse_nodes(request) - except ApiException as e: - raise AmazonException('ApiException', e) + check_browse_nodes_args(**kwargs) + request = get_browse_nodes_request(self, **kwargs) + self._throttle() + return get_browse_nodes_response(self, request) - try: - if response.browse_nodes_result is not None: - res = [AmazonBrowseNode( - item) for item in response.browse_nodes_result.browse_nodes] - return parse_browsenode(res) - if response.errors is not None: - raise AmazonException( - response.errors[0].code, response.errors[0].message) - except TypeError as e: - raise AmazonException("TypeError", e) - except ValueError as e: - raise AmazonException(ValueError, e) - except AmazonException as e: - raise AmazonException(e.status, e.reason) - except Exception as e: - raise AmazonException("General", e) def _throttle(self): wait_time = self._throttling - (time.time() - self._last_query_time) diff --git a/amazon_paapi/helpers/arguments.py b/amazon_paapi/helpers/arguments.py index 2753b64..f23a355 100644 --- a/amazon_paapi/helpers/arguments.py +++ b/amazon_paapi/helpers/arguments.py @@ -46,3 +46,9 @@ def check_variations_args(**kwargs): if not all(1 <= arg <= 10 and isinstance(arg, int) for arg in pagination_args): error_message = ('Args variation_count and variation_page should be integers between 1 and 10.') raise InvalidArgumentException(error_message) + + +def check_browse_nodes_args(**kwargs): + if not isinstance(kwargs['browse_node_ids'], list): + error_message = 'Argument browse_node_ids should be a list of strings.' + raise InvalidArgumentException(error_message) diff --git a/amazon_paapi/helpers/requests.py b/amazon_paapi/helpers/requests.py index 8017f7d..90dbb53 100644 --- a/amazon_paapi/helpers/requests.py +++ b/amazon_paapi/helpers/requests.py @@ -1,6 +1,8 @@ """Module with helper functions for creating requests.""" +from amazon_paapi.sdk.models.get_browse_nodes_resource import GetBrowseNodesResource +from amazon_paapi.sdk.models.get_browse_nodes_request import GetBrowseNodesRequest from ..models.api_item import Item from ..errors import ApiRequestException, ItemsNotFoudException, MalformedRequestException from ..sdk.models.partner_type import PartnerType @@ -84,6 +86,29 @@ def get_variations_response(amazon_api, request: GetVariationsRequest) -> list[I return response.variations_result.items +def get_browse_nodes_request(amazon_api, **kwargs) -> GetBrowseNodesRequest: + try: + return GetBrowseNodesRequest(resources=_get_request_resources(GetBrowseNodesResource), + partner_type=PartnerType.ASSOCIATES, + marketplace=amazon_api._marketplace, + partner_tag=amazon_api._tag, + **kwargs) + except TypeError as e: + raise MalformedRequestException('Parameters for get_browse_nodes request are not correct: ' + str(e)) + + +def get_browse_nodes_response(amazon_api, request: GetBrowseNodesRequest) -> list[Item]: + try: + response = amazon_api._api.get_browse_nodes(request) + except ApiException as e: + raise ApiRequestException('Error getting response for get_browse_nodes from Amazon API: ' + str(e)) + + if response.browse_nodes_result == None: + raise ItemsNotFoudException('No browse nodes have been found') + + return response.browse_nodes_result.browse_nodes + + def _get_request_resources(resources) -> list[str]: resources = inspect.getmembers(resources, lambda a:not(inspect.isroutine(a))) resources = [x[-1] for x in resources if isinstance(x[-1], str) and x[0][0:2] != '__'] From 9c0b069a1407bfdc7d53e9f6afa372bccd201f71 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Mon, 12 Jul 2021 20:41:50 +0200 Subject: [PATCH 48/67] Solved import bug --- amazon_paapi/helpers/requests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/amazon_paapi/helpers/requests.py b/amazon_paapi/helpers/requests.py index 90dbb53..ae92ee9 100644 --- a/amazon_paapi/helpers/requests.py +++ b/amazon_paapi/helpers/requests.py @@ -1,8 +1,8 @@ """Module with helper functions for creating requests.""" -from amazon_paapi.sdk.models.get_browse_nodes_resource import GetBrowseNodesResource -from amazon_paapi.sdk.models.get_browse_nodes_request import GetBrowseNodesRequest +from ..sdk.models.get_browse_nodes_resource import GetBrowseNodesResource +from ..sdk.models.get_browse_nodes_request import GetBrowseNodesRequest from ..models.api_item import Item from ..errors import ApiRequestException, ItemsNotFoudException, MalformedRequestException from ..sdk.models.partner_type import PartnerType From f90ceb2af395584421c56634ec9242f4a775ded1 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Mon, 12 Jul 2021 20:52:03 +0200 Subject: [PATCH 49/67] Added search result model --- amazon_paapi/api.py | 2 +- amazon_paapi/helpers/requests.py | 5 +++-- amazon_paapi/models/__init__.py | 1 + amazon_paapi/models/search_result.py | 7 +++++++ 4 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 amazon_paapi/models/search_result.py diff --git a/amazon_paapi/api.py b/amazon_paapi/api.py index 64ee594..c57e314 100644 --- a/amazon_paapi/api.py +++ b/amazon_paapi/api.py @@ -126,7 +126,7 @@ def search_items(self, min_reviews_rating: int = None, search_index: str = None, sort_by: models.SortBy = None, - **kwargs) -> list[models.Item]: + **kwargs) -> models.SearchResult: """Searches for items on Amazon based on a search query. At least one of the following parameters should be specified: ``keywords``, ``actor``, ``artist``, ``author``, ``brand`` or ``title``. diff --git a/amazon_paapi/helpers/requests.py b/amazon_paapi/helpers/requests.py index ae92ee9..8ad7858 100644 --- a/amazon_paapi/helpers/requests.py +++ b/amazon_paapi/helpers/requests.py @@ -4,6 +4,7 @@ from ..sdk.models.get_browse_nodes_resource import GetBrowseNodesResource from ..sdk.models.get_browse_nodes_request import GetBrowseNodesRequest from ..models.api_item import Item +from ..models.search_result import SearchResult from ..errors import ApiRequestException, ItemsNotFoudException, MalformedRequestException from ..sdk.models.partner_type import PartnerType from ..sdk.models.get_items_resource import GetItemsResource @@ -51,7 +52,7 @@ def get_search_items_request(amazon_api, **kwargs) -> SearchItemsRequest: raise MalformedRequestException('Parameters for search_items request are not correct: ' + str(e)) -def get_search_items_response(amazon_api, request: SearchItemsRequest) -> list[Item]: +def get_search_items_response(amazon_api, request: SearchItemsRequest) -> SearchResult: try: response = amazon_api._api.search_items(request) except ApiException as e: @@ -60,7 +61,7 @@ def get_search_items_response(amazon_api, request: SearchItemsRequest) -> list[I if response.search_result == None: raise ItemsNotFoudException('No items have been found') - return response.search_result.items + return response.search_result def get_variations_request(amazon_api, **kwargs) -> GetVariationsRequest: diff --git a/amazon_paapi/models/__init__.py b/amazon_paapi/models/__init__.py index 1c56a9e..8f0a9ce 100644 --- a/amazon_paapi/models/__init__.py +++ b/amazon_paapi/models/__init__.py @@ -1,3 +1,4 @@ from .regions import Country from .api_item import Item +from .search_result import SearchResult from ..sdk.models import Availability, Condition, Merchant, SortBy diff --git a/amazon_paapi/models/search_result.py b/amazon_paapi/models/search_result.py new file mode 100644 index 0000000..cf0063b --- /dev/null +++ b/amazon_paapi/models/search_result.py @@ -0,0 +1,7 @@ +from .api_item import Item +from ..sdk.models import SearchResult + +class SearchResult(SearchResult): + items: list[Item] + total_result_count: int + search_url: str From 4f88f4700ffa97ed34041cc9868738bb870311b7 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Mon, 12 Jul 2021 21:03:54 +0200 Subject: [PATCH 50/67] Added VariationsResult model --- amazon_paapi/api.py | 2 +- amazon_paapi/helpers/requests.py | 3 ++- amazon_paapi/models/__init__.py | 1 + amazon_paapi/models/variations_result.py | 29 ++++++++++++++++++++++++ 4 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 amazon_paapi/models/variations_result.py diff --git a/amazon_paapi/api.py b/amazon_paapi/api.py index c57e314..ca8f97e 100644 --- a/amazon_paapi/api.py +++ b/amazon_paapi/api.py @@ -217,7 +217,7 @@ def get_variations(self, currency_of_preference: str = None, languages_of_preference: list[str] = None, merchant: models.Merchant = None, - **kwargs) -> list[models.Item]: + **kwargs) -> models.VariationsResult: """Returns a set of items that are the same product, but differ according to a consistent theme, for example size and color. diff --git a/amazon_paapi/helpers/requests.py b/amazon_paapi/helpers/requests.py index 8ad7858..9305ddf 100644 --- a/amazon_paapi/helpers/requests.py +++ b/amazon_paapi/helpers/requests.py @@ -5,6 +5,7 @@ from ..sdk.models.get_browse_nodes_request import GetBrowseNodesRequest from ..models.api_item import Item from ..models.search_result import SearchResult +from ..models.variations_result import VariationsResult from ..errors import ApiRequestException, ItemsNotFoudException, MalformedRequestException from ..sdk.models.partner_type import PartnerType from ..sdk.models.get_items_resource import GetItemsResource @@ -75,7 +76,7 @@ def get_variations_request(amazon_api, **kwargs) -> GetVariationsRequest: raise MalformedRequestException('Parameters for get_variations request are not correct: ' + str(e)) -def get_variations_response(amazon_api, request: GetVariationsRequest) -> list[Item]: +def get_variations_response(amazon_api, request: GetVariationsRequest) -> VariationsResult: try: response = amazon_api._api.get_variations(request) except ApiException as e: diff --git a/amazon_paapi/models/__init__.py b/amazon_paapi/models/__init__.py index 8f0a9ce..2b2bb4a 100644 --- a/amazon_paapi/models/__init__.py +++ b/amazon_paapi/models/__init__.py @@ -1,4 +1,5 @@ from .regions import Country from .api_item import Item from .search_result import SearchResult +from .variations_result import VariationsResult from ..sdk.models import Availability, Condition, Merchant, SortBy diff --git a/amazon_paapi/models/variations_result.py b/amazon_paapi/models/variations_result.py new file mode 100644 index 0000000..ae97f34 --- /dev/null +++ b/amazon_paapi/models/variations_result.py @@ -0,0 +1,29 @@ +from .api_item import Item +from ..sdk.models import VariationsResult, VariationSummary + +class ApiPrice: + amount: float + currency: str + display_amount: str + + +class ApiVariationDimension: + display_name: str + name: str + values: list[str] + + +class ApiVariationPrice: + highest_price: ApiPrice + lowest_price: ApiPrice + +class ApiVariationSummary(VariationSummary): + page_count: int + price: ApiVariationPrice + variation_count: int + variation_dimensions: list[ApiVariationDimension] + + +class VariationsResult(VariationsResult): + items: list[Item] + variation_summary: ApiVariationSummary From 515166b34efd4b0b55d606a86392cbb67ad38f9d Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Mon, 12 Jul 2021 21:05:02 +0200 Subject: [PATCH 51/67] Removed old files --- PRODUCT.md | 128 - tests/data/dump.json | 7823 ------------------------------------------ 2 files changed, 7951 deletions(-) delete mode 100644 PRODUCT.md delete mode 100644 tests/data/dump.json diff --git a/PRODUCT.md b/PRODUCT.md deleted file mode 100644 index edcabed..0000000 --- a/PRODUCT.md +++ /dev/null @@ -1,128 +0,0 @@ - product - asin - parent_asin - title - url - raw_info - - product - features = [] - languages = [] - formats = [] - pages_count - color - unit_count - size - dimensions - height - value - unit - length - value - unit - width - value - unit - weight - value - unit - - info - contributors = [] - name - role - manufacturer - brand - model - part_number - product_group - binding - is_adult - audience_rating - edition - warranty - publication_date - release_date - external_ids - ean = [] - isbn = [] - upc = [] - - images - small - medium - large - cropped - small = [] - medium = [] - large = [] - variants - small = [] - medium = [] - large = [] - - trade_in - elegible - price - currency - - - prices - price - value - currency - per_unit - display - savings - value - currency - per_unit - display - percentage - pvp - value - currency - per_unit - display - availability - max_order_quantity - min_order_quantity - type - message - condition - condition - condition_display - sub_condition - sub_condition_display - merchant - default_shipping_country - merchant_id - name - other - buybox_winner - loyalty_points - amazon_fulfilled - free_shipping_eligible - prime_eligible - prime_exclusive - prime_pantry - violates_map - offer_id - - offers_summary = [] - highest_price - value - currency - per_unit - display - lowest_price - value - currency - per_unit - display - condition - condition - condition_display - sub_condition - sub_condition_display - offer_count \ No newline at end of file diff --git a/tests/data/dump.json b/tests/data/dump.json deleted file mode 100644 index cb87398..0000000 --- a/tests/data/dump.json +++ /dev/null @@ -1,7823 +0,0 @@ -[ - { - "asin": "B00JGV1JW2", - "parent_asin": null, - "title": "Harry Potter und der Stein der Weisen [dt./OV]", - "url": "https://www.amazon.de/dp/B00JGV1JW2?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": null, - "languages": [ - "Deutsch Untertitelt", - "Englisch Untertitelt", - "Deutsch Gesprochen", - "Englisch Gesprochen", - "Deutsch Unbekannt" - ], - "formats": null, - "pages_count": null, - "color": null, - "unit_count": null, - "size": null, - "dimensions": { - "height": { - "value": null, - "unit": null - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": null, - "unit": null - } - }, - "weight": { - "value": null, - "unit": null - } - }, - "info": { - "contributors": [ - { - "name": "Daniel Radcliffe", - "role": "Darsteller" - }, - { - "name": "Rupert Grint", - "role": "Darsteller" - }, - { - "name": "Emma Watson", - "role": "Darsteller" - }, - { - "name": "John Cleese", - "role": "Darsteller" - }, - { - "name": "Robbie Coltrane", - "role": "Darsteller" - }, - { - "name": "Chris Columbus", - "role": "Regisseur" - }, - { - "name": "Steve Kloves", - "role": "Autor" - }, - { - "name": "J.K. Rowling", - "role": "Autor" - }, - { - "name": "David Heyman", - "role": "Produzent" - } - ], - "manufacturer": null, - "brand": null, - "model": null, - "part_number": null, - "product_group": "Video On Demand", - "binding": "Prime Video", - "is_adult": false, - "audience_rating": "Freigegeben ab 6 Jahren", - "edition": null, - "warranty": null, - "publication_date": null, - "release_date": "2014-02-26T01:00:00.000Z", - "external_ids": { - "ean": null, - "isbn": null, - "upc": null - } - }, - "images": { - "small": "https://m.media-amazon.com/images/I/51+FnV4rG+L._SL75_.jpg", - "medium": "https://m.media-amazon.com/images/I/51+FnV4rG+L._SL160_.jpg", - "large": "https://m.media-amazon.com/images/I/51+FnV4rG+L.jpg", - "cropped": { - "small": [ - "https://m.media-amazon.com/images/I/51+FnV4rG+L._AC75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/51+FnV4rG+L._AC160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/51+FnV4rG+L._AC_.jpg" - ] - }, - "variants": null - }, - "trade_in": null, - "prices": { - "price": { - "value": 3.99, - "currency": "EUR", - "per_unit": null, - "display": "3,99 €", - "savings": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "percentage": null - } - }, - "pvp": { - "value": null, - "currency": null, - "per_unit": null, - "display": null - }, - "availability": { - "max_order_quantity": null, - "min_order_quantity": 1, - "type": "Now", - "message": "Auf Lager." - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": "New", - "sub_condition_display": null - }, - "merchant": { - "default_shipping_country": "GB", - "merchant_id": "A3HBS5CIENBL3I", - "name": "Amazon Digital Germany GmbH" - }, - "other": { - "buybox_winner": true, - "loyalty_points": null, - "amazon_fulfilled": false, - "free_shipping_eligible": false, - "prime_eligible": false, - "prime_exclusive": false, - "prime_pantry": false, - "violates_map": false, - "offer_id": "8oGIh%2FQafMllHPFJLBLy6X5A51dcSIvY8IB4scUQ2%2FrCl0V2iedrXE%2FnG8J8ozbGd8MFK5YnXN3klEyIpymgRZfUaTpTv%2FqBl%2Bk%2F4vA6svV91uwgNJxFSsMtUhY7AxrzOISI6Y0BU457wJgmCXog71gOduFgkv5e" - } - }, - "offers_summary": [ - { - "highest_price": { - "value": 3.99, - "currency": "EUR", - "per_unit": null, - "display": "3,99 €" - }, - "lowest_price": { - "value": 3.99, - "currency": "EUR", - "per_unit": null, - "display": "3,99 €" - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 1 - } - ] - }, - { - "asin": "B00EVAU29E", - "parent_asin": null, - "title": "Harry Potter und der Feuerkelch [dt./OV]", - "url": "https://www.amazon.de/dp/B00EVAU29E?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": null, - "languages": [ - "Deutsch Gesprochen", - "Englisch Gesprochen", - "Deutsch Untertitelt", - "Englisch Untertitelt", - "Deutsch Originalsprache" - ], - "formats": null, - "pages_count": null, - "color": null, - "unit_count": null, - "size": null, - "dimensions": { - "height": { - "value": null, - "unit": null - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": null, - "unit": null - } - }, - "weight": { - "value": null, - "unit": null - } - }, - "info": { - "contributors": [ - { - "name": "Daniel Radcliffe", - "role": "Darsteller" - }, - { - "name": "Rupert Grint", - "role": "Darsteller" - }, - { - "name": "Emma Watson", - "role": "Darsteller" - }, - { - "name": "Ralph Fiennes", - "role": "Darsteller" - }, - { - "name": "Michael Gambon", - "role": "Darsteller" - }, - { - "name": "Brendan Gleeson", - "role": "Darsteller" - }, - { - "name": "Jason Isaacs", - "role": "Darsteller" - }, - { - "name": "Gary Oldman", - "role": "Darsteller" - }, - { - "name": "Miranda Richardson", - "role": "Darsteller" - }, - { - "name": "Alan Rickman", - "role": "Darsteller" - }, - { - "name": "Maggie Smith", - "role": "Darsteller" - }, - { - "name": "Timothy Spall", - "role": "Darsteller" - }, - { - "name": "David Bradley", - "role": "Darsteller" - }, - { - "name": "Jarvis Cocker", - "role": "Darsteller" - }, - { - "name": "Warwick Da", - "role": "Darsteller" - }, - { - "name": "Afshan Azad", - "role": "Darsteller" - }, - { - "name": "T", - "role": "Darsteller" - }, - { - "name": "Tiana Benjamin", - "role": "Darsteller" - }, - { - "name": "Mike Newell", - "role": "Regisseur" - } - ], - "manufacturer": null, - "brand": null, - "model": null, - "part_number": null, - "product_group": "Video On Demand", - "binding": "Prime Video", - "is_adult": false, - "audience_rating": "Freigegeben ab 12 Jahren", - "edition": null, - "warranty": null, - "publication_date": null, - "release_date": "2014-02-26T01:00:00.000Z", - "external_ids": { - "ean": null, - "isbn": null, - "upc": null - } - }, - "images": { - "small": "https://m.media-amazon.com/images/I/51fKIYYi6jL._SL75_.jpg", - "medium": "https://m.media-amazon.com/images/I/51fKIYYi6jL._SL160_.jpg", - "large": "https://m.media-amazon.com/images/I/51fKIYYi6jL.jpg", - "cropped": { - "small": [ - "https://m.media-amazon.com/images/I/51fKIYYi6jL._AC75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/51fKIYYi6jL._AC160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/51fKIYYi6jL._AC_.jpg" - ] - }, - "variants": null - }, - "trade_in": null, - "prices": { - "price": { - "value": 3.99, - "currency": "EUR", - "per_unit": null, - "display": "3,99 €", - "savings": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "percentage": null - } - }, - "pvp": { - "value": null, - "currency": null, - "per_unit": null, - "display": null - }, - "availability": { - "max_order_quantity": null, - "min_order_quantity": 1, - "type": "Now", - "message": "Auf Lager." - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": "New", - "sub_condition_display": null - }, - "merchant": { - "default_shipping_country": "GB", - "merchant_id": "A3HBS5CIENBL3I", - "name": "Amazon Digital Germany GmbH" - }, - "other": { - "buybox_winner": true, - "loyalty_points": null, - "amazon_fulfilled": false, - "free_shipping_eligible": false, - "prime_eligible": false, - "prime_exclusive": false, - "prime_pantry": false, - "violates_map": false, - "offer_id": "8oGIh%2FQafMllHPFJLBLy6UHPT7YerIEdlAYD3mRLofojY5YuRPkBeacwqGwUXoMTHtDp3tEdGOWnptp6%2Bb%2Fx1SjHcEbvft5Jbsm3zdarRNI5jNgSQH9ManwNAQOfdni4Nm1RTVSQIP5wK47mms6pcwBj9NlfZDlX" - } - }, - "offers_summary": [ - { - "highest_price": { - "value": 3.99, - "currency": "EUR", - "per_unit": null, - "display": "3,99 €" - }, - "lowest_price": { - "value": 3.99, - "currency": "EUR", - "per_unit": null, - "display": "3,99 €" - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 1 - } - ] - }, - { - "asin": "B00FYULGTK", - "parent_asin": null, - "title": "Harry Potter und der Gefangene von Askaban [dt./OV]", - "url": "https://www.amazon.de/dp/B00FYULGTK?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": null, - "languages": [ - "Deutsch Gesprochen", - "Englisch Gesprochen", - "Deutsch Untertitelt", - "Englisch Untertitelt", - "Deutsch Originalsprache" - ], - "formats": null, - "pages_count": null, - "color": null, - "unit_count": null, - "size": null, - "dimensions": { - "height": { - "value": null, - "unit": null - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": null, - "unit": null - } - }, - "weight": { - "value": null, - "unit": null - } - }, - "info": { - "contributors": [ - { - "name": "Daniel Radcliffe", - "role": "Darsteller" - }, - { - "name": "Rupert Grint", - "role": "Darsteller" - }, - { - "name": "Emma Watson", - "role": "Darsteller" - }, - { - "name": "Robbie Coltrane", - "role": "Darsteller" - }, - { - "name": "Michael Gambon", - "role": "Darsteller" - }, - { - "name": "Richard Griffiths", - "role": "Darsteller" - }, - { - "name": "Gary Oldman", - "role": "Darsteller" - }, - { - "name": "Alan Rickman", - "role": "Darsteller" - }, - { - "name": "Alfonso Cuarón", - "role": "Regisseur" - } - ], - "manufacturer": null, - "brand": null, - "model": null, - "part_number": null, - "product_group": "Video On Demand", - "binding": "Prime Video", - "is_adult": false, - "audience_rating": "Freigegeben ab 12 Jahren", - "edition": null, - "warranty": null, - "publication_date": null, - "release_date": "2014-02-26T01:00:00.000Z", - "external_ids": { - "ean": null, - "isbn": null, - "upc": null - } - }, - "images": { - "small": "https://m.media-amazon.com/images/I/51l06eGxU7L._SL75_.jpg", - "medium": "https://m.media-amazon.com/images/I/51l06eGxU7L._SL160_.jpg", - "large": "https://m.media-amazon.com/images/I/51l06eGxU7L.jpg", - "cropped": { - "small": [ - "https://m.media-amazon.com/images/I/51l06eGxU7L._AC75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/51l06eGxU7L._AC160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/51l06eGxU7L._AC_.jpg" - ] - }, - "variants": null - }, - "trade_in": null, - "prices": { - "price": { - "value": 10.49, - "currency": "EUR", - "per_unit": null, - "display": "10,49 €", - "savings": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "percentage": null - } - }, - "pvp": { - "value": null, - "currency": null, - "per_unit": null, - "display": null - }, - "availability": { - "max_order_quantity": null, - "min_order_quantity": 1, - "type": "Now", - "message": "Auf Lager." - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": "New", - "sub_condition_display": null - }, - "merchant": { - "default_shipping_country": "GB", - "merchant_id": "A3HBS5CIENBL3I", - "name": "Amazon Digital Germany GmbH" - }, - "other": { - "buybox_winner": true, - "loyalty_points": null, - "amazon_fulfilled": false, - "free_shipping_eligible": false, - "prime_eligible": false, - "prime_exclusive": false, - "prime_pantry": false, - "violates_map": false, - "offer_id": "8oGIh%2FQafMllHPFJLBLy6Xbl47Vb5DBmuLpN%2F7UHV2dfFB7z2MzLxci8VFQX5zhclXLaXTDr0WoYBWKgVp9dhcMY335PNnyxOOk1rIzEa3thwJNyivozylO9ogVxdgQH8I4%2BJUHag1Hd%2FV2uCxde4072rT0vW8Rm" - } - }, - "offers_summary": [ - { - "highest_price": { - "value": 10.49, - "currency": "EUR", - "per_unit": null, - "display": "10,49 €" - }, - "lowest_price": { - "value": 10.49, - "currency": "EUR", - "per_unit": null, - "display": "10,49 €" - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 1 - } - ] - }, - { - "asin": "B00IKEOUHM", - "parent_asin": null, - "title": "Harry Potter und die Heiligtümer des Todes - Teil 1 [dt./OV]", - "url": "https://www.amazon.de/dp/B00IKEOUHM?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": null, - "languages": [ - "Deutsch Untertitelt", - "Englisch Untertitelt", - "Deutsch Gesprochen", - "Englisch Gesprochen", - "Deutsch Unbekannt" - ], - "formats": null, - "pages_count": null, - "color": null, - "unit_count": null, - "size": null, - "dimensions": { - "height": { - "value": null, - "unit": null - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": null, - "unit": null - } - }, - "weight": { - "value": null, - "unit": null - } - }, - "info": { - "contributors": [ - { - "name": "Daniel Radcliffe", - "role": "Darsteller" - }, - { - "name": "Rupert Grint", - "role": "Darsteller" - }, - { - "name": "Emma Watson", - "role": "Darsteller" - }, - { - "name": "Helena Bonham Carter", - "role": "Darsteller" - }, - { - "name": "Robbie Coltrane", - "role": "Darsteller" - }, - { - "name": "David Yates", - "role": "Regisseur" - }, - { - "name": "J.K. Rowling", - "role": "Autor" - }, - { - "name": "Steve Kloves", - "role": "Autor" - }, - { - "name": "David Heyman", - "role": "Produzent" - }, - { - "name": "David Barron", - "role": "Produzent" - }, - { - "name": "J.K. Rowling", - "role": "Produzent" - } - ], - "manufacturer": null, - "brand": null, - "model": null, - "part_number": null, - "product_group": "Video On Demand", - "binding": "Prime Video", - "is_adult": false, - "audience_rating": "Freigegeben ab 12 Jahren", - "edition": null, - "warranty": null, - "publication_date": null, - "release_date": "2014-02-26T01:00:00.000Z", - "external_ids": { - "ean": null, - "isbn": null, - "upc": null - } - }, - "images": { - "small": "https://m.media-amazon.com/images/I/51O+e8wf5kL._SL75_.jpg", - "medium": "https://m.media-amazon.com/images/I/51O+e8wf5kL._SL160_.jpg", - "large": "https://m.media-amazon.com/images/I/51O+e8wf5kL.jpg", - "cropped": { - "small": [ - "https://m.media-amazon.com/images/I/51O+e8wf5kL._AC75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/51O+e8wf5kL._AC160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/51O+e8wf5kL._AC_.jpg" - ] - }, - "variants": null - }, - "trade_in": null, - "prices": { - "price": { - "value": 3.99, - "currency": "EUR", - "per_unit": null, - "display": "3,99 €", - "savings": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "percentage": null - } - }, - "pvp": { - "value": null, - "currency": null, - "per_unit": null, - "display": null - }, - "availability": { - "max_order_quantity": null, - "min_order_quantity": 1, - "type": "Now", - "message": "Auf Lager." - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": "New", - "sub_condition_display": null - }, - "merchant": { - "default_shipping_country": "GB", - "merchant_id": "A3HBS5CIENBL3I", - "name": "Amazon Digital Germany GmbH" - }, - "other": { - "buybox_winner": true, - "loyalty_points": null, - "amazon_fulfilled": false, - "free_shipping_eligible": false, - "prime_eligible": false, - "prime_exclusive": false, - "prime_pantry": false, - "violates_map": false, - "offer_id": "8oGIh%2FQafMllHPFJLBLy6bziDDy0xax0G7LoTE%2FWmFPY%2FucSU5FNeW6bkZr4Oe0b%2FVJYkoPF6CICGuBcLetuK6ydZCkA%2BE8KwoHeb3DFDuyXFOpiXnn83HO1Ejbnbpyc3ulAxfCgt%2B7aWMhpGrMmRDjKgz2mprTt" - } - }, - "offers_summary": [ - { - "highest_price": { - "value": 3.99, - "currency": "EUR", - "per_unit": null, - "display": "3,99 €" - }, - "lowest_price": { - "value": 3.99, - "currency": "EUR", - "per_unit": null, - "display": "3,99 €" - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 1 - } - ] - }, - { - "asin": "B00IKBTWCS", - "parent_asin": null, - "title": "Harry Potter und die Heiligtümer des Todes - Teil 2 [dt./OV]", - "url": "https://www.amazon.de/dp/B00IKBTWCS?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": null, - "languages": [ - "Deutsch Untertitelt", - "Englisch Untertitelt", - "Deutsch Gesprochen", - "Englisch Gesprochen", - "Deutsch Unbekannt" - ], - "formats": null, - "pages_count": null, - "color": null, - "unit_count": null, - "size": null, - "dimensions": { - "height": { - "value": null, - "unit": null - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": null, - "unit": null - } - }, - "weight": { - "value": null, - "unit": null - } - }, - "info": { - "contributors": [ - { - "name": "Daniel Radcliffe", - "role": "Darsteller" - }, - { - "name": "Rupert Grint", - "role": "Darsteller" - }, - { - "name": "Emma Watson", - "role": "Darsteller" - }, - { - "name": "Helena Bonham Carter", - "role": "Darsteller" - }, - { - "name": "Robbie Coltrane", - "role": "Darsteller" - }, - { - "name": "David Yates", - "role": "Regisseur" - }, - { - "name": "David Heyman", - "role": "Produzent" - }, - { - "name": "David Barron", - "role": "Produzent" - }, - { - "name": "J.K. Rowling", - "role": "Produzent" - } - ], - "manufacturer": null, - "brand": null, - "model": null, - "part_number": null, - "product_group": "Video On Demand", - "binding": "Prime Video", - "is_adult": false, - "audience_rating": "Freigegeben ab 12 Jahren", - "edition": null, - "warranty": null, - "publication_date": null, - "release_date": "2014-02-26T01:00:00.000Z", - "external_ids": { - "ean": null, - "isbn": null, - "upc": null - } - }, - "images": { - "small": "https://m.media-amazon.com/images/I/513cq-mGjvL._SL75_.jpg", - "medium": "https://m.media-amazon.com/images/I/513cq-mGjvL._SL160_.jpg", - "large": "https://m.media-amazon.com/images/I/513cq-mGjvL.jpg", - "cropped": { - "small": [ - "https://m.media-amazon.com/images/I/513cq-mGjvL._AC75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/513cq-mGjvL._AC160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/513cq-mGjvL._AC_.jpg" - ] - }, - "variants": null - }, - "trade_in": null, - "prices": { - "price": { - "value": 3.99, - "currency": "EUR", - "per_unit": null, - "display": "3,99 €", - "savings": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "percentage": null - } - }, - "pvp": { - "value": null, - "currency": null, - "per_unit": null, - "display": null - }, - "availability": { - "max_order_quantity": null, - "min_order_quantity": 1, - "type": "Now", - "message": "Auf Lager." - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": "New", - "sub_condition_display": null - }, - "merchant": { - "default_shipping_country": "GB", - "merchant_id": "A3HBS5CIENBL3I", - "name": "Amazon Digital Germany GmbH" - }, - "other": { - "buybox_winner": true, - "loyalty_points": null, - "amazon_fulfilled": false, - "free_shipping_eligible": false, - "prime_eligible": false, - "prime_exclusive": false, - "prime_pantry": false, - "violates_map": false, - "offer_id": "8oGIh%2FQafMllHPFJLBLy6aoyBd8D%2FIx4O7wj7Dgqiq0MewLDnoTehH3cXVVg7NlSY00ZZRl4Teo4TUzzlEw3Msz6qY8rFTNXKM1pd7f1m%2B3f5Y5FJ5vY53NRMHPryJ8jaiTQawThbppU2oKPsJf1Vf8rAE1iyKCc" - } - }, - "offers_summary": [ - { - "highest_price": { - "value": 3.99, - "currency": "EUR", - "per_unit": null, - "display": "3,99 €" - }, - "lowest_price": { - "value": 3.99, - "currency": "EUR", - "per_unit": null, - "display": "3,99 €" - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 1 - } - ] - }, - { - "asin": "B00FZ29U04", - "parent_asin": null, - "title": "Harry Potter und der Halbblutprinz [dt./OV]", - "url": "https://www.amazon.de/dp/B00FZ29U04?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": null, - "languages": [ - "Deutsch Gesprochen", - "Englisch Gesprochen", - "Deutsch Untertitelt", - "Englisch Untertitelt", - "Deutsch Originalsprache" - ], - "formats": null, - "pages_count": null, - "color": null, - "unit_count": null, - "size": null, - "dimensions": { - "height": { - "value": null, - "unit": null - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": null, - "unit": null - } - }, - "weight": { - "value": null, - "unit": null - } - }, - "info": { - "contributors": [ - { - "name": "Daniel Radcliffe", - "role": "Darsteller" - }, - { - "name": "Emma Watson", - "role": "Darsteller" - }, - { - "name": "Rupert Grint", - "role": "Darsteller" - }, - { - "name": "Helena Bonham Carter", - "role": "Darsteller" - }, - { - "name": "Jim Broadbent", - "role": "Darsteller" - }, - { - "name": "Tom Felton", - "role": "Darsteller" - }, - { - "name": "Helen McCrory", - "role": "Darsteller" - }, - { - "name": "David Thewlis", - "role": "Darsteller" - }, - { - "name": "David Yates", - "role": "Regisseur" - } - ], - "manufacturer": null, - "brand": null, - "model": null, - "part_number": null, - "product_group": "Video On Demand", - "binding": "Prime Video", - "is_adult": false, - "audience_rating": "Freigegeben ab 12 Jahren", - "edition": null, - "warranty": null, - "publication_date": null, - "release_date": "2014-02-26T01:00:00.000Z", - "external_ids": { - "ean": null, - "isbn": null, - "upc": null - } - }, - "images": { - "small": "https://m.media-amazon.com/images/I/519SA+3e7CL._SL75_.jpg", - "medium": "https://m.media-amazon.com/images/I/519SA+3e7CL._SL160_.jpg", - "large": "https://m.media-amazon.com/images/I/519SA+3e7CL.jpg", - "cropped": { - "small": [ - "https://m.media-amazon.com/images/I/519SA+3e7CL._AC75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/519SA+3e7CL._AC160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/519SA+3e7CL._AC_.jpg" - ] - }, - "variants": null - }, - "trade_in": null, - "prices": { - "price": { - "value": 3.99, - "currency": "EUR", - "per_unit": null, - "display": "3,99 €", - "savings": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "percentage": null - } - }, - "pvp": { - "value": null, - "currency": null, - "per_unit": null, - "display": null - }, - "availability": { - "max_order_quantity": null, - "min_order_quantity": 1, - "type": "Now", - "message": "Auf Lager." - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": "New", - "sub_condition_display": null - }, - "merchant": { - "default_shipping_country": "GB", - "merchant_id": "A3HBS5CIENBL3I", - "name": "Amazon Digital Germany GmbH" - }, - "other": { - "buybox_winner": true, - "loyalty_points": null, - "amazon_fulfilled": false, - "free_shipping_eligible": false, - "prime_eligible": false, - "prime_exclusive": false, - "prime_pantry": false, - "violates_map": false, - "offer_id": "8oGIh%2FQafMllHPFJLBLy6SohSiGWLJOZUTLyjKCqPb0m7MKaPWz46nsh%2F6pDb3ORNTKtVYwOnT%2BtrkkmjMC3UoRKG%2FmDlN5KJYQpSOj1UA6beLOKeI7CCuFHbPHHA36EvJNKhsgG5Z9LJt3i0fBdqRXY%2FYKhNXwj" - } - }, - "offers_summary": [ - { - "highest_price": { - "value": 3.99, - "currency": "EUR", - "per_unit": null, - "display": "3,99 €" - }, - "lowest_price": { - "value": 3.99, - "currency": "EUR", - "per_unit": null, - "display": "3,99 €" - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 1 - } - ] - }, - { - "asin": "B00RYENTOY", - "parent_asin": null, - "title": "Harry Potter und der Orden des Phönix [dt./OV]", - "url": "https://www.amazon.de/dp/B00RYENTOY?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": null, - "languages": [ - "Deutsch Gesprochen", - "Englisch Gesprochen", - "Deutsch Untertitelt", - "Englisch Untertitelt", - "Deutsch Unbekannt" - ], - "formats": null, - "pages_count": null, - "color": null, - "unit_count": null, - "size": null, - "dimensions": { - "height": { - "value": null, - "unit": null - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": null, - "unit": null - } - }, - "weight": { - "value": null, - "unit": null - } - }, - "info": { - "contributors": [ - { - "name": "Daniel Radcliffe", - "role": "Darsteller" - }, - { - "name": "Rupert Grint", - "role": "Darsteller" - }, - { - "name": "Emma Watson", - "role": "Darsteller" - }, - { - "name": "Helena Bonham Carter", - "role": "Darsteller" - }, - { - "name": "David Bradley", - "role": "Darsteller" - }, - { - "name": "Robbie Coltrane", - "role": "Darsteller" - }, - { - "name": "Warwick Davis", - "role": "Darsteller" - }, - { - "name": "Ralph Fiennes", - "role": "Darsteller" - }, - { - "name": "Michael Gambon", - "role": "Darsteller" - }, - { - "name": "Brendan Gleeson", - "role": "Darsteller" - }, - { - "name": "Richard Griffiths", - "role": "Darsteller" - }, - { - "name": "Robert Hardy", - "role": "Darsteller" - }, - { - "name": "George Harris", - "role": "Darsteller" - }, - { - "name": "Kathryn Hunter", - "role": "Darsteller" - }, - { - "name": "Jason Isaacs", - "role": "Darsteller" - }, - { - "name": "Evanna Lynch", - "role": "Darsteller" - }, - { - "name": "Gary Oldman", - "role": "Darsteller" - }, - { - "name": "Alan Rickman", - "role": "Darsteller" - }, - { - "name": "Fiona Shaw", - "role": "Darsteller" - }, - { - "name": "Maggie Smith", - "role": "Darsteller" - }, - { - "name": "Imelda Staunton", - "role": "Darsteller" - }, - { - "name": "Natalia Tena", - "role": "Darsteller" - }, - { - "name": "David Thewlis", - "role": "Darsteller" - }, - { - "name": "Emma Thompson", - "role": "Darsteller" - }, - { - "name": "Julie Walters", - "role": "Darsteller" - }, - { - "name": "Mark Williams", - "role": "Darsteller" - }, - { - "name": "David Yates", - "role": "Regisseur" - }, - { - "name": "Michael Goldenberg", - "role": "Autor" - }, - { - "name": "David Heyman", - "role": "Produzent" - }, - { - "name": "David Barron", - "role": "Produzent" - } - ], - "manufacturer": null, - "brand": null, - "model": null, - "part_number": null, - "product_group": "Video On Demand", - "binding": "Prime Video", - "is_adult": false, - "audience_rating": "Freigegeben ab 12 Jahren", - "edition": null, - "warranty": null, - "publication_date": null, - "release_date": "2014-02-26T01:00:00.000Z", - "external_ids": { - "ean": null, - "isbn": null, - "upc": null - } - }, - "images": { - "small": "https://m.media-amazon.com/images/I/51ihrPF9t2L._SL75_.jpg", - "medium": "https://m.media-amazon.com/images/I/51ihrPF9t2L._SL160_.jpg", - "large": "https://m.media-amazon.com/images/I/51ihrPF9t2L.jpg", - "cropped": { - "small": [ - "https://m.media-amazon.com/images/I/51ihrPF9t2L._AC75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/51ihrPF9t2L._AC160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/51ihrPF9t2L._AC_.jpg" - ] - }, - "variants": null - }, - "trade_in": null, - "prices": { - "price": { - "value": 3.99, - "currency": "EUR", - "per_unit": null, - "display": "3,99 €", - "savings": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "percentage": null - } - }, - "pvp": { - "value": null, - "currency": null, - "per_unit": null, - "display": null - }, - "availability": { - "max_order_quantity": null, - "min_order_quantity": 1, - "type": "Now", - "message": "Auf Lager." - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": "New", - "sub_condition_display": null - }, - "merchant": { - "default_shipping_country": "GB", - "merchant_id": "A3HBS5CIENBL3I", - "name": "Amazon Digital Germany GmbH" - }, - "other": { - "buybox_winner": true, - "loyalty_points": null, - "amazon_fulfilled": false, - "free_shipping_eligible": false, - "prime_eligible": false, - "prime_exclusive": false, - "prime_pantry": false, - "violates_map": false, - "offer_id": "8oGIh%2FQafMllHPFJLBLy6Y%2BCzSRP%2FB67FRcNvqggJ6AA%2BhUQsz1pb33vD8o6X%2Bxk%2FM4%2BCkC3J%2FEe1hKEJrSfHDVrdgvPkqBYx9Ra5Khkw9k4wE6ChROnOwviCu3GM2Hfos5mwZ%2BgD4W%2FvfVWvbsWjJ7ftPYUsLhm" - } - }, - "offers_summary": [ - { - "highest_price": { - "value": 3.99, - "currency": "EUR", - "per_unit": null, - "display": "3,99 €" - }, - "lowest_price": { - "value": 3.99, - "currency": "EUR", - "per_unit": null, - "display": "3,99 €" - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 1 - } - ] - }, - { - "asin": "B00HX2J48C", - "parent_asin": null, - "title": "Harry Potter und die Kammer des Schreckens", - "url": "https://www.amazon.de/dp/B00HX2J48C?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": null, - "languages": [ - "Deutsch Gesprochen", - "Deutsch Originalsprache" - ], - "formats": null, - "pages_count": null, - "color": null, - "unit_count": null, - "size": null, - "dimensions": { - "height": { - "value": null, - "unit": null - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": null, - "unit": null - } - }, - "weight": { - "value": null, - "unit": null - } - }, - "info": { - "contributors": [ - { - "name": "Daniel Radcliffe (Harry Potter)", - "role": "Darsteller" - }, - { - "name": "Rupert Grint (Ron Weasley)", - "role": "Darsteller" - }, - { - "name": "Emma Watson (Hermine Granger)", - "role": "Darsteller" - }, - { - "name": "Tom Felton (Draco Malfoy)", - "role": "Darsteller" - }, - { - "name": "Bonnie Wright (Ginny Weasley)", - "role": "Darsteller" - }, - { - "name": "Chris Columbus", - "role": "Regisseur" - } - ], - "manufacturer": null, - "brand": null, - "model": null, - "part_number": null, - "product_group": "Video On Demand", - "binding": "Prime Video", - "is_adult": false, - "audience_rating": "Freigegeben ab 12 Jahren", - "edition": null, - "warranty": null, - "publication_date": null, - "release_date": "2014-02-26T01:00:00.000Z", - "external_ids": { - "ean": null, - "isbn": null, - "upc": null - } - }, - "images": { - "small": "https://m.media-amazon.com/images/I/51z6rcxEoSL._SL75_.jpg", - "medium": "https://m.media-amazon.com/images/I/51z6rcxEoSL._SL160_.jpg", - "large": "https://m.media-amazon.com/images/I/51z6rcxEoSL.jpg", - "cropped": { - "small": [ - "https://m.media-amazon.com/images/I/51z6rcxEoSL._AC75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/51z6rcxEoSL._AC160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/51z6rcxEoSL._AC_.jpg" - ] - }, - "variants": null - }, - "trade_in": null, - "prices": { - "price": { - "value": 3.99, - "currency": "EUR", - "per_unit": null, - "display": "3,99 €", - "savings": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "percentage": null - } - }, - "pvp": { - "value": null, - "currency": null, - "per_unit": null, - "display": null - }, - "availability": { - "max_order_quantity": null, - "min_order_quantity": 1, - "type": "Now", - "message": "Auf Lager." - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": "New", - "sub_condition_display": null - }, - "merchant": { - "default_shipping_country": "GB", - "merchant_id": "A3HBS5CIENBL3I", - "name": "Amazon Digital Germany GmbH" - }, - "other": { - "buybox_winner": true, - "loyalty_points": null, - "amazon_fulfilled": false, - "free_shipping_eligible": false, - "prime_eligible": false, - "prime_exclusive": false, - "prime_pantry": false, - "violates_map": false, - "offer_id": "8oGIh%2FQafMllHPFJLBLy6dov2Jywb%2FsNON1WXeNF%2FI4gdSD8wcvfimyPPBZ98Wc%2BKuzaxGJzhkUzLJkEApR2cnbbp6ApORtD4UcF%2B5BjSDIi9iRfNcXm3WNeFIMlP80RlM5yK0gO0zwNP2J2kHV9UannUy5vCNjQ" - } - }, - "offers_summary": [ - { - "highest_price": { - "value": 3.99, - "currency": "EUR", - "per_unit": null, - "display": "3,99 €" - }, - "lowest_price": { - "value": 3.99, - "currency": "EUR", - "per_unit": null, - "display": "3,99 €" - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 1 - } - ] - }, - { - "asin": "B00ILWH73C", - "parent_asin": null, - "title": "Der Hobbit: Eine unerwartete Reise (Extended Edition) [dt./OV]", - "url": "https://www.amazon.de/dp/B00ILWH73C?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": null, - "languages": [ - "Deutsch Untertitelt", - "Deutsch Gesprochen", - "Englisch Gesprochen", - "Deutsch Unbekannt" - ], - "formats": null, - "pages_count": null, - "color": null, - "unit_count": null, - "size": null, - "dimensions": { - "height": { - "value": null, - "unit": null - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": null, - "unit": null - } - }, - "weight": { - "value": null, - "unit": null - } - }, - "info": { - "contributors": [ - { - "name": "Ian Mckellen", - "role": "Darsteller" - }, - { - "name": "Martin Freeman", - "role": "Darsteller" - }, - { - "name": "Richard Armitage", - "role": "Darsteller" - }, - { - "name": "Cate Blanchett", - "role": "Darsteller" - }, - { - "name": "Ian Holm", - "role": "Darsteller" - }, - { - "name": "Peter Jackson", - "role": "Regisseur" - }, - { - "name": "Philippa Boyens", - "role": "Autor" - }, - { - "name": "Peter Jackson", - "role": "Autor" - }, - { - "name": "Fran Walsh", - "role": "Autor" - }, - { - "name": "Guillermo Del Toro", - "role": "Autor" - }, - { - "name": "Peter Jackson", - "role": "Produzent" - }, - { - "name": "Carolynne Cunningham", - "role": "Produzent" - }, - { - "name": "Zane Weiner", - "role": "Produzent" - }, - { - "name": "Fran Walsh", - "role": "Produzent" - } - ], - "manufacturer": null, - "brand": null, - "model": null, - "part_number": null, - "product_group": "Video On Demand", - "binding": "Prime Video", - "is_adult": false, - "audience_rating": "Freigegeben ab 12 Jahren", - "edition": null, - "warranty": null, - "publication_date": null, - "release_date": "2014-02-26T01:00:00.000Z", - "external_ids": { - "ean": null, - "isbn": null, - "upc": null - } - }, - "images": { - "small": "https://m.media-amazon.com/images/I/51LTyXtL-rL._SL75_.jpg", - "medium": "https://m.media-amazon.com/images/I/51LTyXtL-rL._SL160_.jpg", - "large": "https://m.media-amazon.com/images/I/51LTyXtL-rL.jpg", - "cropped": { - "small": [ - "https://m.media-amazon.com/images/I/51LTyXtL-rL._AC75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/51LTyXtL-rL._AC160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/51LTyXtL-rL._AC_.jpg" - ] - }, - "variants": null - }, - "trade_in": null, - "prices": { - "price": { - "value": 9.99, - "currency": "EUR", - "per_unit": null, - "display": "9,99 €", - "savings": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "percentage": null - } - }, - "pvp": { - "value": null, - "currency": null, - "per_unit": null, - "display": null - }, - "availability": { - "max_order_quantity": null, - "min_order_quantity": 1, - "type": "Now", - "message": "Auf Lager." - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": "New", - "sub_condition_display": null - }, - "merchant": { - "default_shipping_country": "GB", - "merchant_id": "A3HBS5CIENBL3I", - "name": "Amazon Digital Germany GmbH" - }, - "other": { - "buybox_winner": true, - "loyalty_points": null, - "amazon_fulfilled": false, - "free_shipping_eligible": false, - "prime_eligible": false, - "prime_exclusive": false, - "prime_pantry": false, - "violates_map": false, - "offer_id": "8oGIh%2FQafMllHPFJLBLy6fp%2BeSf94kP%2Bhrnr6Ou7GEpZrgQC1OQcpdPxmk9ncKh8vESj6Zak4XT1N1LqMGG6jSb%2BD1P5LarnxWv0HwwpvsCeNYP%2F0zyqN4uCtTHnTNsQYCM1EMXiIGVxXwTLMExVTsZdbOeQSrjI" - } - }, - "offers_summary": [ - { - "highest_price": { - "value": 9.99, - "currency": "EUR", - "per_unit": null, - "display": "9,99 €" - }, - "lowest_price": { - "value": 9.99, - "currency": "EUR", - "per_unit": null, - "display": "9,99 €" - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 1 - } - ] - }, - { - "asin": "B0192CTMVY", - "parent_asin": null, - "title": "Harry Potter und der Stein der Weisen", - "url": "https://www.amazon.de/dp/B0192CTMVY?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": null, - "languages": [ - "Deutsch Veröffentlicht" - ], - "formats": [ - "Kindle eBook" - ], - "pages_count": null, - "color": null, - "unit_count": null, - "size": null, - "dimensions": { - "height": { - "value": null, - "unit": null - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": null, - "unit": null - } - }, - "weight": { - "value": null, - "unit": null - } - }, - "info": { - "contributors": [ - { - "name": "Rowling, J.K.", - "role": "Autor" - }, - { - "name": "Fritz, Klaus", - "role": "Übersetzer" - } - ], - "manufacturer": "Pottermore Publishing", - "brand": null, - "model": null, - "part_number": null, - "product_group": "Digital Ebook Purchas", - "binding": "Kindle Ausgabe", - "is_adult": null, - "audience_rating": null, - "edition": null, - "warranty": null, - "publication_date": "2015-12-08T00:00:00.000Z", - "release_date": "2015-12-08T00:00:00.000Z", - "external_ids": { - "ean": null, - "isbn": null, - "upc": null - } - }, - "images": { - "small": "https://m.media-amazon.com/images/I/51gETDWOHnL._SL75_.jpg", - "medium": "https://m.media-amazon.com/images/I/51gETDWOHnL._SL160_.jpg", - "large": "https://m.media-amazon.com/images/I/51gETDWOHnL.jpg", - "cropped": { - "small": [ - "https://m.media-amazon.com/images/I/51gETDWOHnL._AC75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/51gETDWOHnL._AC160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/51gETDWOHnL._AC_.jpg" - ] - }, - "variants": null - }, - "trade_in": null, - "prices": { - "price": { - "value": 8.99, - "currency": "EUR", - "per_unit": null, - "display": "8,99 €", - "savings": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "percentage": null - } - }, - "pvp": { - "value": null, - "currency": null, - "per_unit": null, - "display": null - }, - "availability": { - "max_order_quantity": null, - "min_order_quantity": 1, - "type": "Now", - "message": "Jetzt als Download verfügbar." - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": "New", - "sub_condition_display": null - }, - "merchant": { - "default_shipping_country": "DE", - "merchant_id": "A2X9BIRDIKC20I", - "name": "Amazon Media EU S.à r.l." - }, - "other": { - "buybox_winner": true, - "loyalty_points": null, - "amazon_fulfilled": false, - "free_shipping_eligible": false, - "prime_eligible": false, - "prime_exclusive": false, - "prime_pantry": false, - "violates_map": false, - "offer_id": "8oGIh%2FQafMmx%2B1djcfUKzwsyBc0ThWyYhUGZpv5wk4AsVZgqhlUHNPKizmDg1dBVe56XIBXKEqA%2Fg%2BPgRrNtnUN2H%2FQYajEkWUHd9jvC3aXJZE9Jd4dEbJ%2BPqa61J66Dny1RX8duCHSRDzqlOMfA8m7niVZP%2FAomhk3h8mh%2Bn6F3%2F%2BNQqJRP%2BA%3D%3D" - } - }, - "offers_summary": [ - { - "highest_price": { - "value": 8.99, - "currency": "EUR", - "per_unit": null, - "display": "8,99 €" - }, - "lowest_price": { - "value": 8.99, - "currency": "EUR", - "per_unit": null, - "display": "8,99 €" - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 1 - } - ] - }, - { - "asin": "3551557403", - "parent_asin": null, - "title": "Harry Potter: Band 1-7 im Schuber – mit exklusivem Extra! (Harry Potter)", - "url": "https://www.amazon.de/dp/3551557403?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": [ - "offiziell lizenzierte Harry Potter Sammlerausgabe", - "Band 1 - 7 in neuer Auflage, Lieferung in prachtvollem Schuber", - "inklusive Schmuckschachtel mit Harry, Ron und Hermine als kleine Standfiguren", - "7 gebundene Ausgaben mit insgesamt 4192 Seiten", - "Autorin: J.K. Rowling, Übersetzer: Klaus Fritz" - ], - "languages": [ - "Deutsch Veröffentlicht", - "Deutsch Originalsprache" - ], - "formats": null, - "pages_count": null, - "color": "Grey", - "unit_count": null, - "size": null, - "dimensions": { - "height": { - "value": 13.03147, - "unit": "Zoll" - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": 6.49605, - "unit": "Zoll" - } - }, - "weight": { - "value": null, - "unit": null - } - }, - "info": { - "contributors": [ - { - "name": "Rowling, J.K.", - "role": "Autor" - }, - { - "name": "Fritz, Klaus", - "role": "Übersetzer" - } - ], - "manufacturer": "Carlsen", - "brand": "Carlsen", - "model": null, - "part_number": "56248016", - "product_group": "Book", - "binding": "Gebundene Ausgabe", - "is_adult": null, - "audience_rating": null, - "edition": "3.", - "warranty": null, - "publication_date": "2019-10-05T00:00:01Z", - "release_date": "2019-10-05T00:00:01Z", - "external_ids": { - "ean": [ - "9783551557407" - ], - "isbn": [ - "3551557403" - ], - "upc": null - } - }, - "images": { - "small": "https://m.media-amazon.com/images/I/51Qk7iioFyL._SL75_.jpg", - "medium": "https://m.media-amazon.com/images/I/51Qk7iioFyL._SL160_.jpg", - "large": "https://m.media-amazon.com/images/I/51Qk7iioFyL.jpg", - "cropped": { - "small": [ - "https://m.media-amazon.com/images/I/51Qk7iioFyL._AC75_.jpg", - "https://m.media-amazon.com/images/I/5157bQhVXRL._AC75_.jpg", - "https://m.media-amazon.com/images/I/51axFDCORkL._AC75_.jpg", - "https://m.media-amazon.com/images/I/518lVjw0m3L._AC75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/51Qk7iioFyL._AC160_.jpg", - "https://m.media-amazon.com/images/I/5157bQhVXRL._AC160_.jpg", - "https://m.media-amazon.com/images/I/51axFDCORkL._AC160_.jpg", - "https://m.media-amazon.com/images/I/518lVjw0m3L._AC160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/51Qk7iioFyL._AC_.jpg", - "https://m.media-amazon.com/images/I/5157bQhVXRL._AC_.jpg", - "https://m.media-amazon.com/images/I/51axFDCORkL._AC_.jpg", - "https://m.media-amazon.com/images/I/518lVjw0m3L._AC_.jpg" - ] - }, - "variants": { - "small": [ - "https://m.media-amazon.com/images/I/5157bQhVXRL._SL75_.jpg", - "https://m.media-amazon.com/images/I/51axFDCORkL._SL75_.jpg", - "https://m.media-amazon.com/images/I/518lVjw0m3L._SL75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/5157bQhVXRL._SL160_.jpg", - "https://m.media-amazon.com/images/I/51axFDCORkL._SL160_.jpg", - "https://m.media-amazon.com/images/I/518lVjw0m3L._SL160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/5157bQhVXRL.jpg", - "https://m.media-amazon.com/images/I/51axFDCORkL.jpg", - "https://m.media-amazon.com/images/I/518lVjw0m3L.jpg" - ] - } - }, - "trade_in": null, - "prices": { - "price": { - "value": 149.0, - "currency": "EUR", - "per_unit": null, - "display": "149,00 €", - "savings": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "percentage": null - } - }, - "pvp": { - "value": null, - "currency": null, - "per_unit": null, - "display": null - }, - "availability": { - "max_order_quantity": null, - "min_order_quantity": 1, - "type": "Now", - "message": "Auf Lager." - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": "New", - "sub_condition_display": null - }, - "merchant": { - "default_shipping_country": null, - "merchant_id": "A3JWKAKR8XB7XF", - "name": "Amazon.de" - }, - "other": { - "buybox_winner": true, - "loyalty_points": null, - "amazon_fulfilled": true, - "free_shipping_eligible": true, - "prime_eligible": true, - "prime_exclusive": false, - "prime_pantry": false, - "violates_map": false, - "offer_id": "mZYvE1sWc1DcvOHVyPBzbStIdfjT%2FkgapSTYEIYXxkSjjiwEXS9Mo0fVYp03CkYoDPapBuSH%2FLQWLJvNtdP%2BMh0IrxPSAfaQKUkjVOsYElE%3D" - } - }, - "offers_summary": [ - { - "highest_price": { - "value": 149.0, - "currency": "EUR", - "per_unit": null, - "display": "149,00 €" - }, - "lowest_price": { - "value": 149.0, - "currency": "EUR", - "per_unit": null, - "display": "149,00 €" - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 33 - }, - { - "highest_price": { - "value": 149.0, - "currency": "EUR", - "per_unit": null, - "display": "149,00 €" - }, - "lowest_price": { - "value": 145.99, - "currency": "EUR", - "per_unit": null, - "display": "145,99 €" - }, - "condition": { - "condition": "Used", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 5 - } - ] - }, - { - "asin": "B00FYWPEF0", - "parent_asin": null, - "title": "Mamma Mia! - Der Film [dt./OV]", - "url": "https://www.amazon.de/dp/B00FYWPEF0?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": null, - "languages": [ - "Deutsch Untertitelt", - "Englisch Untertitelt", - "Deutsch Gesprochen", - "Englisch Gesprochen", - "Deutsch Originalsprache" - ], - "formats": null, - "pages_count": null, - "color": null, - "unit_count": null, - "size": null, - "dimensions": { - "height": { - "value": null, - "unit": null - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": null, - "unit": null - } - }, - "weight": { - "value": null, - "unit": null - } - }, - "info": { - "contributors": [ - { - "name": "Meryl Streep", - "role": "Darsteller" - }, - { - "name": "Pierce Brosnan", - "role": "Darsteller" - }, - { - "name": "Colin Firth", - "role": "Darsteller" - }, - { - "name": "Stellan SkarsgåRd", - "role": "Darsteller" - }, - { - "name": "Dominic Cooper", - "role": "Darsteller" - }, - { - "name": "Phyllida Lloyd", - "role": "Regisseur" - } - ], - "manufacturer": null, - "brand": null, - "model": null, - "part_number": null, - "product_group": "Video On Demand", - "binding": "Prime Video", - "is_adult": false, - "audience_rating": "Freigegeben ohne Altersbeschränkung", - "edition": null, - "warranty": null, - "publication_date": null, - "release_date": "2014-02-26T01:00:00.000Z", - "external_ids": { - "ean": null, - "isbn": null, - "upc": null - } - }, - "images": { - "small": "https://m.media-amazon.com/images/I/51BwpGvC15L._SL75_.jpg", - "medium": "https://m.media-amazon.com/images/I/51BwpGvC15L._SL160_.jpg", - "large": "https://m.media-amazon.com/images/I/51BwpGvC15L.jpg", - "cropped": { - "small": [ - "https://m.media-amazon.com/images/I/51BwpGvC15L._AC75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/51BwpGvC15L._AC160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/51BwpGvC15L._AC_.jpg" - ] - }, - "variants": null - }, - "trade_in": null, - "prices": { - "price": { - "value": 2.99, - "currency": "EUR", - "per_unit": null, - "display": "2,99 €", - "savings": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "percentage": null - } - }, - "pvp": { - "value": null, - "currency": null, - "per_unit": null, - "display": null - }, - "availability": { - "max_order_quantity": null, - "min_order_quantity": 1, - "type": "Now", - "message": "Auf Lager." - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": "New", - "sub_condition_display": null - }, - "merchant": { - "default_shipping_country": "GB", - "merchant_id": "A3HBS5CIENBL3I", - "name": "Amazon Digital Germany GmbH" - }, - "other": { - "buybox_winner": true, - "loyalty_points": null, - "amazon_fulfilled": false, - "free_shipping_eligible": false, - "prime_eligible": false, - "prime_exclusive": false, - "prime_pantry": false, - "violates_map": false, - "offer_id": "mZYvE1sWc1A6BotCpF2t0qEzfSkp%2Fg6n3EYGxJOsDLsu4O8uIrlMrixoxv10i30jKj1%2FXxZSX3V8koujLMNOtxSIFS1B49DpUs9%2FP%2FwUkBbl5tLaUJFLAvrpHV9jJrGXMSHuNhs9Kk6xvaC4T9M%2Bdl7lSzC8tRCy" - } - }, - "offers_summary": [ - { - "highest_price": { - "value": 2.99, - "currency": "EUR", - "per_unit": null, - "display": "2,99 €" - }, - "lowest_price": { - "value": 2.99, - "currency": "EUR", - "per_unit": null, - "display": "2,99 €" - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 1 - } - ] - }, - { - "asin": "B01LXWRKQQ", - "parent_asin": null, - "title": "Voll erschrocken", - "url": "https://www.amazon.de/dp/B01LXWRKQQ?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": null, - "languages": [ - "Deutsch Gesprochen", - "Englisch Gesprochen", - "Englisch Originalsprache", - "Englisch Unbekannt" - ], - "formats": null, - "pages_count": null, - "color": null, - "unit_count": null, - "size": null, - "dimensions": { - "height": { - "value": null, - "unit": null - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": null, - "unit": null - } - }, - "weight": { - "value": null, - "unit": null - } - }, - "info": { - "contributors": null, - "manufacturer": null, - "brand": null, - "model": null, - "part_number": null, - "product_group": "Video On Demand", - "binding": "Prime Video", - "is_adult": false, - "audience_rating": "Freigegeben ohne Altersbeschränkung", - "edition": null, - "warranty": null, - "publication_date": null, - "release_date": "2016-09-30T00:00:00.000Z", - "external_ids": { - "ean": null, - "isbn": null, - "upc": null - } - }, - "images": { - "small": "https://m.media-amazon.com/images/I/51cHWjkRuqL._SL75_.jpg", - "medium": "https://m.media-amazon.com/images/I/51cHWjkRuqL._SL160_.jpg", - "large": "https://m.media-amazon.com/images/I/51cHWjkRuqL.jpg", - "cropped": { - "small": [ - "https://m.media-amazon.com/images/I/51cHWjkRuqL._AC75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/51cHWjkRuqL._AC160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/51cHWjkRuqL._AC_.jpg" - ] - }, - "variants": null - }, - "trade_in": null, - "prices": { - "price": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "savings": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "percentage": null - } - }, - "pvp": { - "value": null, - "currency": null, - "per_unit": null, - "display": null - }, - "availability": { - "max_order_quantity": null, - "min_order_quantity": null, - "type": null, - "message": null - }, - "condition": null, - "merchant": { - "default_shipping_country": null, - "merchant_id": null, - "name": null - }, - "other": { - "buybox_winner": null, - "loyalty_points": null, - "amazon_fulfilled": null, - "free_shipping_eligible": null, - "prime_eligible": null, - "prime_exclusive": null, - "prime_pantry": null, - "violates_map": null, - "offer_id": null - } - }, - "offers_summary": null - }, - { - "asin": "1408856778", - "parent_asin": null, - "title": "Harry Potter-Kindersammlung", - "url": "https://www.amazon.de/dp/1408856778?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": null, - "languages": [ - "Englisch Veröffentlicht", - "Englisch Originalsprache", - "Englisch Unbekannt" - ], - "formats": null, - "pages_count": null, - "color": null, - "unit_count": 7, - "size": null, - "dimensions": { - "height": { - "value": 8.0, - "unit": "Zoll" - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": 5.25, - "unit": "Zoll" - } - }, - "weight": { - "value": 6.5697754076, - "unit": "Pfund" - } - }, - "info": { - "contributors": [ - { - "name": "Rowling, J.K.", - "role": "Autor" - } - ], - "manufacturer": "Bloomsbury Children's Books", - "brand": "Bloomsbury UK", - "model": "2724309564565", - "part_number": "9781408856772", - "product_group": "Book", - "binding": "Taschenbuch", - "is_adult": false, - "audience_rating": null, - "edition": "01", - "warranty": null, - "publication_date": "2014-10-09T00:00:01Z", - "release_date": "2014-10-09T00:00:01Z", - "external_ids": { - "ean": [ - "9781408856772", - "8601410696429" - ], - "isbn": [ - "9781408856772", - "1408856778" - ], - "upc": null - } - }, - "images": { - "small": "https://m.media-amazon.com/images/I/51grtVWQzIL._SL75_.jpg", - "medium": "https://m.media-amazon.com/images/I/51grtVWQzIL._SL160_.jpg", - "large": "https://m.media-amazon.com/images/I/51grtVWQzIL.jpg", - "cropped": { - "small": [ - "https://m.media-amazon.com/images/I/51grtVWQzIL._AC75_.jpg", - "https://m.media-amazon.com/images/I/51dleZa49gL._AC75_.jpg", - "https://m.media-amazon.com/images/I/31SqzHwI6RL._AC75_.jpg", - "https://m.media-amazon.com/images/I/51WTDu2LwBL._AC75_.jpg", - "https://m.media-amazon.com/images/I/516ijdZ09FL._AC75_.jpg", - "https://m.media-amazon.com/images/I/51NcwglC+AL._AC75_.jpg", - "https://m.media-amazon.com/images/I/515N-LSlVvL._AC75_.jpg", - "https://m.media-amazon.com/images/I/51P30zhn6kL._AC75_.jpg", - "https://m.media-amazon.com/images/I/51VVY-LGHJL._AC75_.jpg", - "https://m.media-amazon.com/images/I/51hmr83+JaL._AC75_.jpg", - "https://m.media-amazon.com/images/I/518UaanaWIL._AC75_.jpg", - "https://m.media-amazon.com/images/I/51ikTBucs+L._AC75_.jpg", - "https://m.media-amazon.com/images/I/51kOgDiT4gL._AC75_.jpg", - "https://m.media-amazon.com/images/I/51SIomTD83L._AC75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/51grtVWQzIL._AC160_.jpg", - "https://m.media-amazon.com/images/I/51dleZa49gL._AC160_.jpg", - "https://m.media-amazon.com/images/I/31SqzHwI6RL._AC160_.jpg", - "https://m.media-amazon.com/images/I/51WTDu2LwBL._AC160_.jpg", - "https://m.media-amazon.com/images/I/516ijdZ09FL._AC160_.jpg", - "https://m.media-amazon.com/images/I/51NcwglC+AL._AC160_.jpg", - "https://m.media-amazon.com/images/I/515N-LSlVvL._AC160_.jpg", - "https://m.media-amazon.com/images/I/51P30zhn6kL._AC160_.jpg", - "https://m.media-amazon.com/images/I/51VVY-LGHJL._AC160_.jpg", - "https://m.media-amazon.com/images/I/51hmr83+JaL._AC160_.jpg", - "https://m.media-amazon.com/images/I/518UaanaWIL._AC160_.jpg", - "https://m.media-amazon.com/images/I/51ikTBucs+L._AC160_.jpg", - "https://m.media-amazon.com/images/I/51kOgDiT4gL._AC160_.jpg", - "https://m.media-amazon.com/images/I/51SIomTD83L._AC160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/51grtVWQzIL._AC_.jpg", - "https://m.media-amazon.com/images/I/51dleZa49gL._AC_.jpg", - "https://m.media-amazon.com/images/I/31SqzHwI6RL._AC_.jpg", - "https://m.media-amazon.com/images/I/51WTDu2LwBL._AC_.jpg", - "https://m.media-amazon.com/images/I/516ijdZ09FL._AC_.jpg", - "https://m.media-amazon.com/images/I/51NcwglC+AL._AC_.jpg", - "https://m.media-amazon.com/images/I/515N-LSlVvL._AC_.jpg", - "https://m.media-amazon.com/images/I/51P30zhn6kL._AC_.jpg", - "https://m.media-amazon.com/images/I/51VVY-LGHJL._AC_.jpg", - "https://m.media-amazon.com/images/I/51hmr83+JaL._AC_.jpg", - "https://m.media-amazon.com/images/I/518UaanaWIL._AC_.jpg", - "https://m.media-amazon.com/images/I/51ikTBucs+L._AC_.jpg", - "https://m.media-amazon.com/images/I/51kOgDiT4gL._AC_.jpg", - "https://m.media-amazon.com/images/I/51SIomTD83L._AC_.jpg" - ] - }, - "variants": { - "small": [ - "https://m.media-amazon.com/images/I/51dleZa49gL._SL75_.jpg", - "https://m.media-amazon.com/images/I/31SqzHwI6RL._SL75_.jpg", - "https://m.media-amazon.com/images/I/51WTDu2LwBL._SL75_.jpg", - "https://m.media-amazon.com/images/I/516ijdZ09FL._SL75_.jpg", - "https://m.media-amazon.com/images/I/51NcwglC+AL._SL75_.jpg", - "https://m.media-amazon.com/images/I/515N-LSlVvL._SL75_.jpg", - "https://m.media-amazon.com/images/I/51P30zhn6kL._SL75_.jpg", - "https://m.media-amazon.com/images/I/51VVY-LGHJL._SL75_.jpg", - "https://m.media-amazon.com/images/I/51hmr83+JaL._SL75_.jpg", - "https://m.media-amazon.com/images/I/518UaanaWIL._SL75_.jpg", - "https://m.media-amazon.com/images/I/51ikTBucs+L._SL75_.jpg", - "https://m.media-amazon.com/images/I/51kOgDiT4gL._SL75_.jpg", - "https://m.media-amazon.com/images/I/51SIomTD83L._SL75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/51dleZa49gL._SL160_.jpg", - "https://m.media-amazon.com/images/I/31SqzHwI6RL._SL160_.jpg", - "https://m.media-amazon.com/images/I/51WTDu2LwBL._SL160_.jpg", - "https://m.media-amazon.com/images/I/516ijdZ09FL._SL160_.jpg", - "https://m.media-amazon.com/images/I/51NcwglC+AL._SL160_.jpg", - "https://m.media-amazon.com/images/I/515N-LSlVvL._SL160_.jpg", - "https://m.media-amazon.com/images/I/51P30zhn6kL._SL160_.jpg", - "https://m.media-amazon.com/images/I/51VVY-LGHJL._SL160_.jpg", - "https://m.media-amazon.com/images/I/51hmr83+JaL._SL160_.jpg", - "https://m.media-amazon.com/images/I/518UaanaWIL._SL160_.jpg", - "https://m.media-amazon.com/images/I/51ikTBucs+L._SL160_.jpg", - "https://m.media-amazon.com/images/I/51kOgDiT4gL._SL160_.jpg", - "https://m.media-amazon.com/images/I/51SIomTD83L._SL160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/51dleZa49gL.jpg", - "https://m.media-amazon.com/images/I/31SqzHwI6RL.jpg", - "https://m.media-amazon.com/images/I/51WTDu2LwBL.jpg", - "https://m.media-amazon.com/images/I/516ijdZ09FL.jpg", - "https://m.media-amazon.com/images/I/51NcwglC+AL.jpg", - "https://m.media-amazon.com/images/I/515N-LSlVvL.jpg", - "https://m.media-amazon.com/images/I/51P30zhn6kL.jpg", - "https://m.media-amazon.com/images/I/51VVY-LGHJL.jpg", - "https://m.media-amazon.com/images/I/51hmr83+JaL.jpg", - "https://m.media-amazon.com/images/I/518UaanaWIL.jpg", - "https://m.media-amazon.com/images/I/51ikTBucs+L.jpg", - "https://m.media-amazon.com/images/I/51kOgDiT4gL.jpg", - "https://m.media-amazon.com/images/I/51SIomTD83L.jpg" - ] - } - }, - "trade_in": null, - "prices": { - "price": { - "value": 49.99, - "currency": "EUR", - "per_unit": null, - "display": "49,99 €", - "savings": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "percentage": null - } - }, - "pvp": { - "value": null, - "currency": null, - "per_unit": null, - "display": null - }, - "availability": { - "max_order_quantity": null, - "min_order_quantity": 1, - "type": "Now", - "message": "Auf Lager." - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": "New", - "sub_condition_display": null - }, - "merchant": { - "default_shipping_country": null, - "merchant_id": "A3JWKAKR8XB7XF", - "name": "Amazon.de" - }, - "other": { - "buybox_winner": true, - "loyalty_points": null, - "amazon_fulfilled": true, - "free_shipping_eligible": true, - "prime_eligible": true, - "prime_exclusive": false, - "prime_pantry": false, - "violates_map": false, - "offer_id": "mZYvE1sWc1Atm0OGHE7f3YRKucCljOTNFVw5d2RPiDm3VYwzyiTjtj%2BvZjbBSfbkepUrZPhw5T%2FXLcPyftYzHACncwM8%2BOJVxLvuvW4gA7g%3D" - } - }, - "offers_summary": [ - { - "highest_price": { - "value": 84.81, - "currency": "EUR", - "per_unit": null, - "display": "84,81 €" - }, - "lowest_price": { - "value": 44.99, - "currency": "EUR", - "per_unit": null, - "display": "44,99 €" - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 25 - }, - { - "highest_price": { - "value": 77.5, - "currency": "EUR", - "per_unit": null, - "display": "77,50 €" - }, - "lowest_price": { - "value": 64.64, - "currency": "EUR", - "per_unit": null, - "display": "64,64 €" - }, - "condition": { - "condition": "Used", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 3 - } - ] - }, - { - "asin": "B0797VTF8K", - "parent_asin": null, - "title": "Emily", - "url": "https://www.amazon.de/dp/B0797VTF8K?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": null, - "languages": [ - "Deutsch Gesprochen", - "Englisch Gesprochen", - "Deutsch Untertitelt", - "Englisch Originalsprache", - "Deutsch Unbekannt" - ], - "formats": null, - "pages_count": null, - "color": null, - "unit_count": null, - "size": null, - "dimensions": { - "height": { - "value": null, - "unit": null - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": null, - "unit": null - } - }, - "weight": { - "value": null, - "unit": null - } - }, - "info": { - "contributors": [ - { - "name": "Oded Ruskin", - "role": "Regisseur" - }, - { - "name": "Oded Ruskin", - "role": "Produzent" - }, - { - "name": "Stana Katic", - "role": "Produzent" - }, - { - "name": "Matt Cirulnick", - "role": "Produzent" - }, - { - "name": "Julie Glucksman", - "role": "Produzent" - }, - { - "name": "Maria Feldman", - "role": "Produzent" - } - ], - "manufacturer": null, - "brand": null, - "model": null, - "part_number": null, - "product_group": "Video On Demand", - "binding": "Prime Video", - "is_adult": false, - "audience_rating": "Freigegeben ab 16 Jahren", - "edition": null, - "warranty": null, - "publication_date": null, - "release_date": null, - "external_ids": { - "ean": null, - "isbn": null, - "upc": null - } - }, - "images": { - "small": "https://m.media-amazon.com/images/I/51qVb9UdXXL._SL75_.jpg", - "medium": "https://m.media-amazon.com/images/I/51qVb9UdXXL._SL160_.jpg", - "large": "https://m.media-amazon.com/images/I/51qVb9UdXXL.jpg", - "cropped": { - "small": [ - "https://m.media-amazon.com/images/I/51qVb9UdXXL._AC75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/51qVb9UdXXL._AC160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/51qVb9UdXXL._AC_.jpg" - ] - }, - "variants": null - }, - "trade_in": null, - "prices": { - "price": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "savings": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "percentage": null - } - }, - "pvp": { - "value": null, - "currency": null, - "per_unit": null, - "display": null - }, - "availability": { - "max_order_quantity": null, - "min_order_quantity": null, - "type": null, - "message": null - }, - "condition": null, - "merchant": { - "default_shipping_country": null, - "merchant_id": null, - "name": null - }, - "other": { - "buybox_winner": null, - "loyalty_points": null, - "amazon_fulfilled": null, - "free_shipping_eligible": null, - "prime_eligible": null, - "prime_exclusive": null, - "prime_pantry": null, - "violates_map": null, - "offer_id": null - } - }, - "offers_summary": null - }, - { - "asin": "B01GE5LY3G", - "parent_asin": null, - "title": "Harry Potter Bertie Bott´s Beans, Beutel, 1er Pack (1 x 54 g)", - "url": "https://www.amazon.de/dp/B01GE5LY3G?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": [ - "Wer dachte sich nicht einmal wie toll es doch wäre die Bohnen aus Harry Potter auch einmal zu probieren.", - "Das ist der große Spaß für die ganze Familie! Geschmacksabenteuer mit spaßgarantie!", - "Banane (Banana), schwarzer Pfeffer (Black Pepper), Blaubeere (Blueberry), popel (booger), Zuckerwatte (Candy floss), Kirsche (Cherry), Zimt (cinnamon).", - "Erde (dirt), Regenwurm (earthworm), Ohrenschmalz (earwax), Gras (Grass), Grüner Apfel (Green Apple), gerösteter Marshmallow (toasted Marshmallow).", - "Fauliges Ei (Rotten egg), Wurst (sausage), Zitrone (Lemon), Seife (soap), Tutti Frutti, Erbrochenes (vom IT), Wassermelone (Watermelon)." - ], - "languages": [ - "Deutsch Unbekannt" - ], - "formats": null, - "pages_count": null, - "color": null, - "unit_count": 1, - "size": null, - "dimensions": { - "height": { - "value": 5.6299212541, - "unit": "Zoll" - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": 3.93700787, - "unit": "Zoll" - } - }, - "weight": { - "value": 0.00011904962148, - "unit": "Pfund" - } - }, - "info": { - "contributors": null, - "manufacturer": "Jelly Belly Candy Company", - "brand": "Jelly Belly", - "model": "42500-DE", - "part_number": "42500-DE", - "product_group": "Grocery", - "binding": "Lebensmittel & Getränke", - "is_adult": null, - "audience_rating": null, - "edition": null, - "warranty": null, - "publication_date": null, - "release_date": "2020-01-28T00:00:01Z", - "external_ids": { - "ean": [ - "0071570000615", - "0071570001094" - ], - "isbn": null, - "upc": [ - "071570001094", - "071570000615" - ] - } - }, - "images": { - "small": "https://m.media-amazon.com/images/I/51zYvyQ58yL._SL75_.jpg", - "medium": "https://m.media-amazon.com/images/I/51zYvyQ58yL._SL160_.jpg", - "large": "https://m.media-amazon.com/images/I/51zYvyQ58yL.jpg", - "cropped": { - "small": [ - "https://m.media-amazon.com/images/I/51zYvyQ58yL._AC75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/51zYvyQ58yL._AC160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/51zYvyQ58yL._AC_.jpg" - ] - }, - "variants": null - }, - "trade_in": null, - "prices": { - "price": { - "value": 3.29, - "currency": "EUR", - "per_unit": 6.09, - "display": "3,29 € (6,09 € / 100 g)", - "savings": { - "value": 1.7, - "currency": "EUR", - "per_unit": 3.15, - "display": "1,70 € (34%)", - "percentage": 34.0 - } - }, - "pvp": { - "value": 4.99, - "currency": "EUR", - "per_unit": 9.24, - "display": "4,99 € (9,24 € / 100 g)" - }, - "availability": { - "max_order_quantity": 6, - "min_order_quantity": 1, - "type": "Now", - "message": "Auf Lager." - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": "New", - "sub_condition_display": null - }, - "merchant": { - "default_shipping_country": null, - "merchant_id": "A3JWKAKR8XB7XF", - "name": "Amazon.de" - }, - "other": { - "buybox_winner": true, - "loyalty_points": null, - "amazon_fulfilled": true, - "free_shipping_eligible": true, - "prime_eligible": true, - "prime_exclusive": false, - "prime_pantry": false, - "violates_map": false, - "offer_id": "mZYvE1sWc1CFgok3CiS5agJlLvDyesfMyp%2F8abK4tKZmHz47Gxf3Q1REfSEqZzY%2Fv%2B8MZmoSX3yupkbotDDXRlKrNyHTsLYDeMoUICoxqtE%3D" - } - }, - "offers_summary": [ - { - "highest_price": { - "value": 5.99, - "currency": "EUR", - "per_unit": 11.09, - "display": "5,99 € (11,09 € / 100 g)" - }, - "lowest_price": { - "value": 3.29, - "currency": "EUR", - "per_unit": 6.09, - "display": "3,29 € (6,09 € / 100 g)" - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 11 - } - ] - }, - { - "asin": "B00K7AYK1I", - "parent_asin": null, - "title": "Harry Potter and the Chamber of Secrets [OV]", - "url": "https://www.amazon.de/dp/B00K7AYK1I?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": null, - "languages": [ - "Deutsch Gesprochen", - "Englisch Gesprochen", - "Deutsch Untertitelt", - "Englisch Untertitelt", - "Deutsch Unbekannt" - ], - "formats": null, - "pages_count": null, - "color": null, - "unit_count": null, - "size": null, - "dimensions": { - "height": { - "value": null, - "unit": null - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": null, - "unit": null - } - }, - "weight": { - "value": null, - "unit": null - } - }, - "info": { - "contributors": [ - { - "name": "Daniel Radcliffe", - "role": "Darsteller" - }, - { - "name": "Rupert Grint", - "role": "Darsteller" - }, - { - "name": "Emma Watson", - "role": "Darsteller" - }, - { - "name": "Kenneth Branagh", - "role": "Darsteller" - }, - { - "name": "John Cleese", - "role": "Darsteller" - }, - { - "name": "Robbie Coltrane", - "role": "Darsteller" - }, - { - "name": "Warwick Davis", - "role": "Darsteller" - }, - { - "name": "Richard Griffiths", - "role": "Darsteller" - }, - { - "name": "Richard Harris", - "role": "Darsteller" - }, - { - "name": "Jason Isaacs", - "role": "Darsteller" - }, - { - "name": "Alan Rickman", - "role": "Darsteller" - }, - { - "name": "Fiona Shaw", - "role": "Darsteller" - }, - { - "name": "Dame Maggie Smith", - "role": "Darsteller" - }, - { - "name": "Julie Walters", - "role": "Darsteller" - }, - { - "name": "Chris Columbus", - "role": "Regisseur" - }, - { - "name": "Steve Kloves", - "role": "Autor" - }, - { - "name": "David Heyman", - "role": "Produzent" - } - ], - "manufacturer": null, - "brand": null, - "model": null, - "part_number": null, - "product_group": "Video On Demand", - "binding": "Prime Video", - "is_adult": false, - "audience_rating": "Freigegeben ab 16 Jahren", - "edition": null, - "warranty": null, - "publication_date": null, - "release_date": "2014-02-26T01:00:00.000Z", - "external_ids": { - "ean": null, - "isbn": null, - "upc": null - } - }, - "images": { - "small": "https://m.media-amazon.com/images/I/51yHuCwfRHL._SL75_.jpg", - "medium": "https://m.media-amazon.com/images/I/51yHuCwfRHL._SL160_.jpg", - "large": "https://m.media-amazon.com/images/I/51yHuCwfRHL.jpg", - "cropped": { - "small": [ - "https://m.media-amazon.com/images/I/51yHuCwfRHL._AC75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/51yHuCwfRHL._AC160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/51yHuCwfRHL._AC_.jpg" - ] - }, - "variants": null - }, - "trade_in": null, - "prices": { - "price": { - "value": 10.49, - "currency": "EUR", - "per_unit": null, - "display": "10,49 €", - "savings": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "percentage": null - } - }, - "pvp": { - "value": null, - "currency": null, - "per_unit": null, - "display": null - }, - "availability": { - "max_order_quantity": null, - "min_order_quantity": 1, - "type": "Now", - "message": "Auf Lager." - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": "New", - "sub_condition_display": null - }, - "merchant": { - "default_shipping_country": "GB", - "merchant_id": "A3HBS5CIENBL3I", - "name": "Amazon Digital Germany GmbH" - }, - "other": { - "buybox_winner": true, - "loyalty_points": null, - "amazon_fulfilled": false, - "free_shipping_eligible": false, - "prime_eligible": false, - "prime_exclusive": false, - "prime_pantry": false, - "violates_map": false, - "offer_id": "mZYvE1sWc1A6BotCpF2t0kq5VGIEF4UQE5C9YOMTb9imY8JcFejoYeu5F3pZmjdVtDlyIpnATZixhQKaolC1v2u5EFcCpwiz%2BwicHnarlLAVwWGTHAV50pow68j7b%2FYFNthyOThGgc5KgxyVvWhhFIEgtDsiFOzT" - } - }, - "offers_summary": [ - { - "highest_price": { - "value": 10.49, - "currency": "EUR", - "per_unit": null, - "display": "10,49 €" - }, - "lowest_price": { - "value": 10.49, - "currency": "EUR", - "per_unit": null, - "display": "10,49 €" - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 1 - } - ] - }, - { - "asin": "B07NNQTKJT", - "parent_asin": null, - "title": "Phantastische Tierwesen: Grindelwalds Verbrechen [dt./OV]", - "url": "https://www.amazon.de/dp/B07NNQTKJT?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": null, - "languages": [ - "Deutsch Gesprochen", - "Englisch Gesprochen", - "Deutsch Untertitelt", - "Englisch Untertitelt", - "Deutsch Unbekannt" - ], - "formats": null, - "pages_count": null, - "color": null, - "unit_count": null, - "size": null, - "dimensions": { - "height": { - "value": null, - "unit": null - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": null, - "unit": null - } - }, - "weight": { - "value": null, - "unit": null - } - }, - "info": { - "contributors": [ - { - "name": "Eddie Redmayne", - "role": "Darsteller" - }, - { - "name": "Katherine Waterston", - "role": "Darsteller" - }, - { - "name": "Dan Fogler", - "role": "Darsteller" - }, - { - "name": "Alison Sudol", - "role": "Darsteller" - }, - { - "name": "Ezra Miller", - "role": "Darsteller" - }, - { - "name": "David Yates", - "role": "Regisseur" - }, - { - "name": "J.K. Rowling", - "role": "Autor" - }, - { - "name": "David Heyman", - "role": "Produzent" - }, - { - "name": "J.K. Rowling", - "role": "Produzent" - }, - { - "name": "Steve Kloves", - "role": "Produzent" - }, - { - "name": "Lionel Wigram", - "role": "Produzent" - } - ], - "manufacturer": null, - "brand": null, - "model": null, - "part_number": null, - "product_group": "Video On Demand", - "binding": "Prime Video", - "is_adult": false, - "audience_rating": "Freigegeben ab 12 Jahren", - "edition": null, - "warranty": null, - "publication_date": null, - "release_date": "2019-03-29T00:00:00.000Z", - "external_ids": { - "ean": null, - "isbn": null, - "upc": null - } - }, - "images": { - "small": "https://m.media-amazon.com/images/I/51mOpsDmzGL._SL75_.jpg", - "medium": "https://m.media-amazon.com/images/I/51mOpsDmzGL._SL160_.jpg", - "large": "https://m.media-amazon.com/images/I/51mOpsDmzGL.jpg", - "cropped": { - "small": [ - "https://m.media-amazon.com/images/I/51mOpsDmzGL._AC75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/51mOpsDmzGL._AC160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/51mOpsDmzGL._AC_.jpg" - ] - }, - "variants": null - }, - "trade_in": null, - "prices": { - "price": { - "value": 14.99, - "currency": "EUR", - "per_unit": null, - "display": "14,99 €", - "savings": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "percentage": null - } - }, - "pvp": { - "value": null, - "currency": null, - "per_unit": null, - "display": null - }, - "availability": { - "max_order_quantity": null, - "min_order_quantity": 1, - "type": "Now", - "message": "Auf Lager." - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": "New", - "sub_condition_display": null - }, - "merchant": { - "default_shipping_country": "GB", - "merchant_id": "A3HBS5CIENBL3I", - "name": "Amazon Digital Germany GmbH" - }, - "other": { - "buybox_winner": true, - "loyalty_points": null, - "amazon_fulfilled": false, - "free_shipping_eligible": false, - "prime_eligible": false, - "prime_exclusive": false, - "prime_pantry": false, - "violates_map": false, - "offer_id": "mZYvE1sWc1DPxwYHgwjGW%2Fr8vaDwAQCUr5J94WD7UBP1jUZj55QpZduBHl780rfjZOVywFogTNxMuA0zxAgJEhZLUoF2YYHyah2gvRjBxSdmWWsEJas%2F41x0R9yzLfR9u632O%2Bz3eBuEn9hT6AyidFaebBiR4KHB" - } - }, - "offers_summary": [ - { - "highest_price": { - "value": 14.99, - "currency": "EUR", - "per_unit": null, - "display": "14,99 €" - }, - "lowest_price": { - "value": 14.99, - "currency": "EUR", - "per_unit": null, - "display": "14,99 €" - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 1 - } - ] - }, - { - "asin": "B01N3XBNI1", - "parent_asin": null, - "title": "Phantastische Tierwesen und wo sie zu finden sind [dt./OV]", - "url": "https://www.amazon.de/dp/B01N3XBNI1?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": null, - "languages": [ - "Deutsch Gesprochen", - "Englisch Gesprochen", - "Deutsch Untertitelt", - "Englisch Untertitelt", - "Deutsch Unbekannt" - ], - "formats": null, - "pages_count": null, - "color": null, - "unit_count": null, - "size": null, - "dimensions": { - "height": { - "value": null, - "unit": null - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": null, - "unit": null - } - }, - "weight": { - "value": null, - "unit": null - } - }, - "info": { - "contributors": [ - { - "name": "Eddie Redmayne", - "role": "Darsteller" - }, - { - "name": "Katherine Waterston", - "role": "Darsteller" - }, - { - "name": "Dan Fogler", - "role": "Darsteller" - }, - { - "name": "Alison Sudol", - "role": "Darsteller" - }, - { - "name": "Ezra Miller", - "role": "Darsteller" - }, - { - "name": "David Yates", - "role": "Regisseur" - }, - { - "name": "J.K. Rowling", - "role": "Autor" - }, - { - "name": "David Heyman", - "role": "Produzent" - }, - { - "name": "J.K. Rowling", - "role": "Produzent" - }, - { - "name": "Steve Kloves", - "role": "Produzent" - }, - { - "name": "Lionel Wigram", - "role": "Produzent" - } - ], - "manufacturer": null, - "brand": null, - "model": null, - "part_number": null, - "product_group": "Video On Demand", - "binding": "Prime Video", - "is_adult": false, - "audience_rating": "Freigegeben ab 6 Jahren", - "edition": null, - "warranty": null, - "publication_date": null, - "release_date": "2016-11-17T00:00:00.000Z", - "external_ids": { - "ean": null, - "isbn": null, - "upc": null - } - }, - "images": { - "small": "https://m.media-amazon.com/images/I/513lBiNHJlL._SL75_.jpg", - "medium": "https://m.media-amazon.com/images/I/513lBiNHJlL._SL160_.jpg", - "large": "https://m.media-amazon.com/images/I/513lBiNHJlL.jpg", - "cropped": { - "small": [ - "https://m.media-amazon.com/images/I/513lBiNHJlL._AC75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/513lBiNHJlL._AC160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/513lBiNHJlL._AC_.jpg" - ] - }, - "variants": null - }, - "trade_in": null, - "prices": { - "price": { - "value": 10.49, - "currency": "EUR", - "per_unit": null, - "display": "10,49 €", - "savings": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "percentage": null - } - }, - "pvp": { - "value": null, - "currency": null, - "per_unit": null, - "display": null - }, - "availability": { - "max_order_quantity": null, - "min_order_quantity": 1, - "type": "Now", - "message": "Auf Lager." - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": "New", - "sub_condition_display": null - }, - "merchant": { - "default_shipping_country": "GB", - "merchant_id": "A3HBS5CIENBL3I", - "name": "Amazon Digital Germany GmbH" - }, - "other": { - "buybox_winner": true, - "loyalty_points": null, - "amazon_fulfilled": false, - "free_shipping_eligible": false, - "prime_eligible": false, - "prime_exclusive": false, - "prime_pantry": false, - "violates_map": false, - "offer_id": "mZYvE1sWc1CFgok3CiS5aiLu%2BKmHwKMXrj85V8afgPnX6uja8SM0z%2BMlJhrYeAIrbbtk18M97KtK9DMpL%2FcrBxe0gTiBZG6kZIeOdNJuM7IJfltIWuX5GyJecJPT7Zcy6Q5vkYodovm9%2BQwAGyOjeJurTrlhsWpf" - } - }, - "offers_summary": [ - { - "highest_price": { - "value": 10.49, - "currency": "EUR", - "per_unit": null, - "display": "10,49 €" - }, - "lowest_price": { - "value": 10.49, - "currency": "EUR", - "per_unit": null, - "display": "10,49 €" - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 1 - } - ] - }, - { - "asin": "B078K3YS79", - "parent_asin": null, - "title": "Clip: Zeichnung Harry Potter", - "url": "https://www.amazon.de/dp/B078K3YS79?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": null, - "languages": [ - "Englisch Untertitelt", - "Deutsch Gesprochen" - ], - "formats": null, - "pages_count": null, - "color": null, - "unit_count": null, - "size": null, - "dimensions": { - "height": { - "value": null, - "unit": null - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": null, - "unit": null - } - }, - "weight": { - "value": null, - "unit": null - } - }, - "info": { - "contributors": [ - { - "name": "Jasmina Susak", - "role": "Regisseur" - } - ], - "manufacturer": null, - "brand": null, - "model": null, - "part_number": null, - "product_group": "Video On Demand", - "binding": "Prime Video", - "is_adult": false, - "audience_rating": "Freigegeben ohne Altersbeschränkung", - "edition": null, - "warranty": null, - "publication_date": null, - "release_date": "2017-12-21T19:51:53.881Z", - "external_ids": { - "ean": null, - "isbn": null, - "upc": null - } - }, - "images": { - "small": "https://m.media-amazon.com/images/I/51rspkkcrpL._SL75_.jpg", - "medium": "https://m.media-amazon.com/images/I/51rspkkcrpL._SL160_.jpg", - "large": "https://m.media-amazon.com/images/I/51rspkkcrpL.jpg", - "cropped": { - "small": [ - "https://m.media-amazon.com/images/I/51rspkkcrpL._AC75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/51rspkkcrpL._AC160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/51rspkkcrpL._AC_.jpg" - ] - }, - "variants": null - }, - "trade_in": null, - "prices": { - "price": { - "value": 11.99, - "currency": "EUR", - "per_unit": null, - "display": "11,99 €", - "savings": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "percentage": null - } - }, - "pvp": { - "value": null, - "currency": null, - "per_unit": null, - "display": null - }, - "availability": { - "max_order_quantity": null, - "min_order_quantity": 1, - "type": "Now", - "message": "Auf Lager." - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": "New", - "sub_condition_display": null - }, - "merchant": { - "default_shipping_country": "GB", - "merchant_id": "A3HBS5CIENBL3I", - "name": "Amazon Digital Germany GmbH" - }, - "other": { - "buybox_winner": true, - "loyalty_points": null, - "amazon_fulfilled": false, - "free_shipping_eligible": false, - "prime_eligible": false, - "prime_exclusive": false, - "prime_pantry": false, - "violates_map": false, - "offer_id": "mZYvE1sWc1DPxwYHgwjGW7pciB4wCNzUMlQxQpA9XzB872nuRZ47LWc5QRJTZJnE%2F1QnDDrYBCa7MWlVKyNuDvDlBXlokmaUoxP1Ly5WpGKKSv3ciYK4O%2FXlFero1%2BxXyapxvnUQFsY7wRRLDemp5Vqj4JQoVssq" - } - }, - "offers_summary": [ - { - "highest_price": { - "value": 11.99, - "currency": "EUR", - "per_unit": null, - "display": "11,99 €" - }, - "lowest_price": { - "value": 11.99, - "currency": "EUR", - "per_unit": null, - "display": "11,99 €" - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 1 - } - ] - }, - { - "asin": "B00EVZNIBI", - "parent_asin": null, - "title": "Lügen", - "url": "https://www.amazon.de/dp/B00EVZNIBI?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": null, - "languages": [ - "Deutsch Gesprochen", - "Englisch Gesprochen", - "Deutsch Untertitelt", - "Englisch Untertitelt", - "Deutsch Originalsprache" - ], - "formats": null, - "pages_count": null, - "color": null, - "unit_count": null, - "size": null, - "dimensions": { - "height": { - "value": null, - "unit": null - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": null, - "unit": null - } - }, - "weight": { - "value": null, - "unit": null - } - }, - "info": { - "contributors": [ - { - "name": "Adam Davidson", - "role": "Regisseur" - }, - { - "name": "Ellen Pompeo", - "role": "Guest Actor" - }, - { - "name": "Patrick Dempsey", - "role": "Guest Actor" - }, - { - "name": "Katherine Heigl", - "role": "Guest Actor" - }, - { - "name": "Justin Chambers", - "role": "Guest Actor" - }, - { - "name": "T.R. Knight", - "role": "Guest Actor" - }, - { - "name": "Chandra Wilson", - "role": "Guest Actor" - }, - { - "name": "James Pickens Jr.", - "role": "Guest Actor" - }, - { - "name": "Sandra Oh", - "role": "Guest Actor" - }, - { - "name": "Isaiah Washington", - "role": "Guest Actor" - }, - { - "name": "Kate Walsh", - "role": "Guest Actor" - } - ], - "manufacturer": null, - "brand": null, - "model": null, - "part_number": null, - "product_group": "Video On Demand", - "binding": "Prime Video", - "is_adult": false, - "audience_rating": "Freigegeben ab 16 Jahren", - "edition": null, - "warranty": null, - "publication_date": null, - "release_date": "2014-02-26T01:00:00.000Z", - "external_ids": { - "ean": null, - "isbn": null, - "upc": null - } - }, - "images": { - "small": "https://m.media-amazon.com/images/I/41utoMPMYAL._SL75_.jpg", - "medium": "https://m.media-amazon.com/images/I/41utoMPMYAL._SL160_.jpg", - "large": "https://m.media-amazon.com/images/I/41utoMPMYAL.jpg", - "cropped": { - "small": [ - "https://m.media-amazon.com/images/I/41utoMPMYAL._AC75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/41utoMPMYAL._AC160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/41utoMPMYAL._AC_.jpg" - ] - }, - "variants": null - }, - "trade_in": null, - "prices": { - "price": { - "value": 2.49, - "currency": "EUR", - "per_unit": null, - "display": "2,49 €", - "savings": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "percentage": null - } - }, - "pvp": { - "value": null, - "currency": null, - "per_unit": null, - "display": null - }, - "availability": { - "max_order_quantity": null, - "min_order_quantity": 1, - "type": "Now", - "message": "Auf Lager." - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": "New", - "sub_condition_display": null - }, - "merchant": { - "default_shipping_country": "GB", - "merchant_id": "A3HBS5CIENBL3I", - "name": "Amazon Digital Germany GmbH" - }, - "other": { - "buybox_winner": true, - "loyalty_points": null, - "amazon_fulfilled": false, - "free_shipping_eligible": false, - "prime_eligible": false, - "prime_exclusive": false, - "prime_pantry": false, - "violates_map": false, - "offer_id": "ahM%2FWYaVsrRyW9Hb32NBMKl786Ir7ioKImD8NVKSaPlaIyRJhaR%2FZ2UoWjclGPDQ24eDKBo7gzTms6oas%2FnbJ2EXU4PkG0AGEIgH0WMvzHFRtUugWEj7ls91PQVNNh0FZ9QpPiySIiivfjqvF0tvyqPU9EM1laLK" - } - }, - "offers_summary": [ - { - "highest_price": { - "value": 2.49, - "currency": "EUR", - "per_unit": null, - "display": "2,49 €" - }, - "lowest_price": { - "value": 2.49, - "currency": "EUR", - "per_unit": null, - "display": "2,49 €" - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 1 - } - ] - }, - { - "asin": "B017Y4V20G", - "parent_asin": null, - "title": "Der Hobbit: Die Schlacht der funf Heere - Extended Edition [dt./OV]", - "url": "https://www.amazon.de/dp/B017Y4V20G?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": null, - "languages": [ - "Deutsch Gesprochen", - "Englisch Gesprochen", - "Deutsch Untertitelt" - ], - "formats": null, - "pages_count": null, - "color": null, - "unit_count": null, - "size": null, - "dimensions": { - "height": { - "value": null, - "unit": null - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": null, - "unit": null - } - }, - "weight": { - "value": null, - "unit": null - } - }, - "info": { - "contributors": [ - { - "name": "Ian McKellen", - "role": "Darsteller" - }, - { - "name": "Martin Freeman", - "role": "Darsteller" - }, - { - "name": "Richard Armitage", - "role": "Darsteller" - }, - { - "name": "Ken Stott", - "role": "Darsteller" - }, - { - "name": "Graham McTavish", - "role": "Darsteller" - }, - { - "name": "William Kircher", - "role": "Darsteller" - }, - { - "name": "James Nesbitt", - "role": "Darsteller" - }, - { - "name": "Peter Jackson", - "role": "Regisseur" - }, - { - "name": "Carolynne Cunningham", - "role": "Produzent" - }, - { - "name": "Zane Weiner", - "role": "Produzent" - }, - { - "name": "Fran Walsh", - "role": "Produzent" - }, - { - "name": "Peter Jackson", - "role": "Produzent" - } - ], - "manufacturer": null, - "brand": null, - "model": null, - "part_number": null, - "product_group": "Video On Demand", - "binding": "Prime Video", - "is_adult": false, - "audience_rating": "Freigegeben ab 12 Jahren", - "edition": null, - "warranty": null, - "publication_date": null, - "release_date": "2015-11-12T00:00:00.000Z", - "external_ids": { - "ean": null, - "isbn": null, - "upc": null - } - }, - "images": { - "small": "https://m.media-amazon.com/images/I/51-asgkrX5L._SL75_.jpg", - "medium": "https://m.media-amazon.com/images/I/51-asgkrX5L._SL160_.jpg", - "large": "https://m.media-amazon.com/images/I/51-asgkrX5L.jpg", - "cropped": { - "small": [ - "https://m.media-amazon.com/images/I/51-asgkrX5L._AC75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/51-asgkrX5L._AC160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/51-asgkrX5L._AC_.jpg" - ] - }, - "variants": null - }, - "trade_in": null, - "prices": { - "price": { - "value": 10.49, - "currency": "EUR", - "per_unit": null, - "display": "10,49 €", - "savings": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "percentage": null - } - }, - "pvp": { - "value": null, - "currency": null, - "per_unit": null, - "display": null - }, - "availability": { - "max_order_quantity": null, - "min_order_quantity": 1, - "type": "Now", - "message": "Auf Lager." - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": "New", - "sub_condition_display": null - }, - "merchant": { - "default_shipping_country": "GB", - "merchant_id": "A3HBS5CIENBL3I", - "name": "Amazon Digital Germany GmbH" - }, - "other": { - "buybox_winner": true, - "loyalty_points": null, - "amazon_fulfilled": false, - "free_shipping_eligible": false, - "prime_eligible": false, - "prime_exclusive": false, - "prime_pantry": false, - "violates_map": false, - "offer_id": "ahM%2FWYaVsrToTtjY7Qcs9rB3u1W1oNwRTwOvnSdSj9lF51coam1n5a2vfxvIqMYxOeSs2HrTitcBdKXOdczT1mKlgaE7qG81KJ8zCAvHlKYkfWyLcmvSUthodZzQNo7%2B7MWzUbRtOmEqx7PQcJnp0B%2BJ7lOYmqR2" - } - }, - "offers_summary": [ - { - "highest_price": { - "value": 10.49, - "currency": "EUR", - "per_unit": null, - "display": "10,49 €" - }, - "lowest_price": { - "value": 10.49, - "currency": "EUR", - "per_unit": null, - "display": "10,49 €" - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 1 - } - ] - }, - { - "asin": "B01H6ZXLNE", - "parent_asin": null, - "title": "Harry G - Leben mit dem Isarpreiß", - "url": "https://www.amazon.de/dp/B01H6ZXLNE?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": null, - "languages": [ - "Deutsch Gesprochen", - "Deutsch Originalsprache", - "Deutsch Unbekannt" - ], - "formats": null, - "pages_count": null, - "color": null, - "unit_count": null, - "size": null, - "dimensions": { - "height": { - "value": null, - "unit": null - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": null, - "unit": null - } - }, - "weight": { - "value": null, - "unit": null - } - }, - "info": { - "contributors": [ - { - "name": "Harry G", - "role": "Darsteller" - }, - { - "name": "Harry G", - "role": "Regisseur" - } - ], - "manufacturer": null, - "brand": null, - "model": null, - "part_number": null, - "product_group": "Video On Demand", - "binding": "Prime Video", - "is_adult": false, - "audience_rating": "Freigegeben ohne Altersbeschränkung", - "edition": null, - "warranty": null, - "publication_date": null, - "release_date": "2016-06-01T00:00:00.000Z", - "external_ids": { - "ean": null, - "isbn": null, - "upc": null - } - }, - "images": { - "small": "https://m.media-amazon.com/images/I/51uqRjCgl5L._SL75_.jpg", - "medium": "https://m.media-amazon.com/images/I/51uqRjCgl5L._SL160_.jpg", - "large": "https://m.media-amazon.com/images/I/51uqRjCgl5L.jpg", - "cropped": { - "small": [ - "https://m.media-amazon.com/images/I/51uqRjCgl5L._AC75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/51uqRjCgl5L._AC160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/51uqRjCgl5L._AC_.jpg" - ] - }, - "variants": null - }, - "trade_in": null, - "prices": { - "price": { - "value": 7.99, - "currency": "EUR", - "per_unit": null, - "display": "7,99 €", - "savings": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "percentage": null - } - }, - "pvp": { - "value": null, - "currency": null, - "per_unit": null, - "display": null - }, - "availability": { - "max_order_quantity": null, - "min_order_quantity": 1, - "type": "Now", - "message": "Auf Lager." - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": "New", - "sub_condition_display": null - }, - "merchant": { - "default_shipping_country": "GB", - "merchant_id": "A3HBS5CIENBL3I", - "name": "Amazon Digital Germany GmbH" - }, - "other": { - "buybox_winner": true, - "loyalty_points": null, - "amazon_fulfilled": false, - "free_shipping_eligible": false, - "prime_eligible": false, - "prime_exclusive": false, - "prime_pantry": false, - "violates_map": false, - "offer_id": "ahM%2FWYaVsrToTtjY7Qcs9jo6BsREDXO0TRmhTK7nrHiNfEdi3UqdO00k4cZK%2FCDrBaoqiYe346y2OmY%2Fb2i8rLuKMetiHnbKLj3H7igvjdLD6Rxyd9CuBwHwkqlvYtJRzAcUIi9yB3GENyLEd4bZ4WvX1ApwLuXa" - } - }, - "offers_summary": [ - { - "highest_price": { - "value": 7.99, - "currency": "EUR", - "per_unit": null, - "display": "7,99 €" - }, - "lowest_price": { - "value": 7.99, - "currency": "EUR", - "per_unit": null, - "display": "7,99 €" - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 1 - } - ] - }, - { - "asin": "B079S1JPRM", - "parent_asin": null, - "title": "Harry G - #HarrydieEhre", - "url": "https://www.amazon.de/dp/B079S1JPRM?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": null, - "languages": [ - "Deutsch Gesprochen", - "Deutsch Originalsprache", - "Deutsch Unbekannt" - ], - "formats": null, - "pages_count": null, - "color": null, - "unit_count": null, - "size": null, - "dimensions": { - "height": { - "value": null, - "unit": null - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": null, - "unit": null - } - }, - "weight": { - "value": null, - "unit": null - } - }, - "info": { - "contributors": [ - { - "name": "Harry G.", - "role": "Darsteller" - }, - { - "name": "Philipp Lenner", - "role": "Regisseur" - }, - { - "name": "Philipp Lenner", - "role": "Produzent" - }, - { - "name": "Rocketstudios", - "role": "Produzent" - } - ], - "manufacturer": null, - "brand": null, - "model": null, - "part_number": null, - "product_group": "Video On Demand", - "binding": "Prime Video", - "is_adult": false, - "audience_rating": "Freigegeben ab 12 Jahren", - "edition": null, - "warranty": null, - "publication_date": null, - "release_date": "2018-02-16T00:00:00.000Z", - "external_ids": { - "ean": null, - "isbn": null, - "upc": null - } - }, - "images": { - "small": "https://m.media-amazon.com/images/I/51ciljUClkL._SL75_.jpg", - "medium": "https://m.media-amazon.com/images/I/51ciljUClkL._SL160_.jpg", - "large": "https://m.media-amazon.com/images/I/51ciljUClkL.jpg", - "cropped": { - "small": [ - "https://m.media-amazon.com/images/I/51ciljUClkL._AC75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/51ciljUClkL._AC160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/51ciljUClkL._AC_.jpg" - ] - }, - "variants": null - }, - "trade_in": null, - "prices": { - "price": { - "value": 13.99, - "currency": "EUR", - "per_unit": null, - "display": "13,99 €", - "savings": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "percentage": null - } - }, - "pvp": { - "value": null, - "currency": null, - "per_unit": null, - "display": null - }, - "availability": { - "max_order_quantity": null, - "min_order_quantity": 1, - "type": "Now", - "message": "Auf Lager." - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": "New", - "sub_condition_display": null - }, - "merchant": { - "default_shipping_country": "GB", - "merchant_id": "A3HBS5CIENBL3I", - "name": "Amazon Digital Germany GmbH" - }, - "other": { - "buybox_winner": true, - "loyalty_points": null, - "amazon_fulfilled": false, - "free_shipping_eligible": false, - "prime_eligible": false, - "prime_exclusive": false, - "prime_pantry": false, - "violates_map": false, - "offer_id": "ahM%2FWYaVsrTXEeFrVaBc75LF3cbA%2Bhs%2BeTE6IG4B7XIS2u%2B2iuvI9Wq%2Fe%2F4w%2FWbpXbCKvMg49zFxNGh%2BLE%2Fob2DgkaxzIjxzlsF8DmzbLonlS2BLsFw%2FiPr6XY23JKJvF3Psp8LXJVU%2FwRQebuizmMZqCRAaK26k" - } - }, - "offers_summary": [ - { - "highest_price": { - "value": 13.99, - "currency": "EUR", - "per_unit": null, - "display": "13,99 €" - }, - "lowest_price": { - "value": 13.99, - "currency": "EUR", - "per_unit": null, - "display": "13,99 €" - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 1 - } - ] - }, - { - "asin": "B07KTCFDPN", - "parent_asin": null, - "title": "Espen und die Legende vom Bergkönig", - "url": "https://www.amazon.de/dp/B07KTCFDPN?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": null, - "languages": [ - "Deutsch Gesprochen", - "Norwegisch Originalsprache", - "Deutsch Unbekannt" - ], - "formats": null, - "pages_count": null, - "color": null, - "unit_count": null, - "size": null, - "dimensions": { - "height": { - "value": null, - "unit": null - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": null, - "unit": null - } - }, - "weight": { - "value": null, - "unit": null - } - }, - "info": { - "contributors": [ - { - "name": "Vebjørn Enger", - "role": "Darsteller" - }, - { - "name": "Eili Harboe", - "role": "Darsteller" - }, - { - "name": "Mads Sjøgård Pettersen", - "role": "Darsteller" - }, - { - "name": "Elias Holmen Sørensen", - "role": "Darsteller" - }, - { - "name": "Allan Hyde", - "role": "Darsteller" - }, - { - "name": "Mikkel Brænne Sandemose", - "role": "Regisseur" - }, - { - "name": "Aleksander Kirkwood Brown", - "role": "Autor" - }, - { - "name": "Espen Enger", - "role": "Autor" - }, - { - "name": "Synnøve Hørsdal", - "role": "Produzent" - }, - { - "name": "Åshild Ariane Ramborg", - "role": "Produzent" - } - ], - "manufacturer": null, - "brand": null, - "model": null, - "part_number": null, - "product_group": "Video On Demand", - "binding": "Prime Video", - "is_adult": false, - "audience_rating": "Freigegeben ab 6 Jahren", - "edition": null, - "warranty": null, - "publication_date": null, - "release_date": "2018-11-27T00:00:00.000Z", - "external_ids": { - "ean": null, - "isbn": null, - "upc": null - } - }, - "images": { - "small": "https://m.media-amazon.com/images/I/61b6g0lcvrL._SL75_.jpg", - "medium": "https://m.media-amazon.com/images/I/61b6g0lcvrL._SL160_.jpg", - "large": "https://m.media-amazon.com/images/I/61b6g0lcvrL.jpg", - "cropped": { - "small": [ - "https://m.media-amazon.com/images/I/61b6g0lcvrL._AC75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/61b6g0lcvrL._AC160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/61b6g0lcvrL._AC_.jpg" - ] - }, - "variants": null - }, - "trade_in": null, - "prices": { - "price": { - "value": 9.99, - "currency": "EUR", - "per_unit": null, - "display": "9,99 €", - "savings": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "percentage": null - } - }, - "pvp": { - "value": null, - "currency": null, - "per_unit": null, - "display": null - }, - "availability": { - "max_order_quantity": null, - "min_order_quantity": 1, - "type": "Now", - "message": "Auf Lager." - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": "New", - "sub_condition_display": null - }, - "merchant": { - "default_shipping_country": "GB", - "merchant_id": "A3HBS5CIENBL3I", - "name": "Amazon Digital Germany GmbH" - }, - "other": { - "buybox_winner": true, - "loyalty_points": null, - "amazon_fulfilled": false, - "free_shipping_eligible": false, - "prime_eligible": false, - "prime_exclusive": false, - "prime_pantry": false, - "violates_map": false, - "offer_id": "ahM%2FWYaVsrTXEeFrVaBc75gLPbmcBWWQ812R9KPwN6jcZL6BIjfGVNv6RSTzfcILjjRXDkqfcvkor8piquj9dbXqn0AmfGer8Ca7HBEsTpbnwtKC9vZHzXdZVTV7FJ0CyzlNtar0CUfQ4sA6qUjNlWN8ea5EW%2Ftx" - } - }, - "offers_summary": [ - { - "highest_price": { - "value": 9.99, - "currency": "EUR", - "per_unit": null, - "display": "9,99 €" - }, - "lowest_price": { - "value": 9.99, - "currency": "EUR", - "per_unit": null, - "display": "9,99 €" - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 1 - } - ] - }, - { - "asin": "B01KWGN698", - "parent_asin": null, - "title": "Die Hüterin der Wahrheit — Dinas Bestimmung", - "url": "https://www.amazon.de/dp/B01KWGN698?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": null, - "languages": [ - "Deutsch Gesprochen", - "Dänisch Originalsprache", - "Deutsch Unbekannt" - ], - "formats": null, - "pages_count": null, - "color": null, - "unit_count": null, - "size": null, - "dimensions": { - "height": { - "value": null, - "unit": null - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": null, - "unit": null - } - }, - "weight": { - "value": null, - "unit": null - } - }, - "info": { - "contributors": [ - { - "name": "Rebecca Emilie Sattrup", - "role": "Darsteller" - }, - { - "name": "Petra Maria Scott", - "role": "Darsteller" - }, - { - "name": "Allan Hyde", - "role": "Darsteller" - }, - { - "name": "Jakob Oftebro", - "role": "Darsteller" - }, - { - "name": "Maria Bonnevie", - "role": "Darsteller" - }, - { - "name": "Søren Malling", - "role": "Darsteller" - }, - { - "name": "Stina Ekblad", - "role": "Darsteller" - }, - { - "name": "Lado Hadzic", - "role": "Darsteller" - }, - { - "name": "Adam Ild Rohweder", - "role": "Darsteller" - }, - { - "name": "Peter Plaugborg", - "role": "Darsteller" - }, - { - "name": "Kenneth Kainz", - "role": "Regisseur" - }, - { - "name": "Anders Thomas Jensen", - "role": "Autor" - }, - { - "name": "Nina Lyng", - "role": "Produzent" - }, - { - "name": "Eva Juel Hammerich", - "role": "Produzent" - } - ], - "manufacturer": null, - "brand": null, - "model": null, - "part_number": null, - "product_group": "Video On Demand", - "binding": "Prime Video", - "is_adult": false, - "audience_rating": "Freigegeben ab 12 Jahren", - "edition": null, - "warranty": null, - "publication_date": null, - "release_date": "2016-08-26T00:00:00.000Z", - "external_ids": { - "ean": null, - "isbn": null, - "upc": null - } - }, - "images": { - "small": "https://m.media-amazon.com/images/I/51QC8-sIblL._SL75_.jpg", - "medium": "https://m.media-amazon.com/images/I/51QC8-sIblL._SL160_.jpg", - "large": "https://m.media-amazon.com/images/I/51QC8-sIblL.jpg", - "cropped": { - "small": [ - "https://m.media-amazon.com/images/I/51QC8-sIblL._AC75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/51QC8-sIblL._AC160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/51QC8-sIblL._AC_.jpg" - ] - }, - "variants": null - }, - "trade_in": null, - "prices": { - "price": { - "value": 3.98, - "currency": "EUR", - "per_unit": null, - "display": "3,98 €", - "savings": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "percentage": null - } - }, - "pvp": { - "value": null, - "currency": null, - "per_unit": null, - "display": null - }, - "availability": { - "max_order_quantity": null, - "min_order_quantity": 1, - "type": "Now", - "message": "Auf Lager." - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": "New", - "sub_condition_display": null - }, - "merchant": { - "default_shipping_country": "GB", - "merchant_id": "A3HBS5CIENBL3I", - "name": "Amazon Digital Germany GmbH" - }, - "other": { - "buybox_winner": true, - "loyalty_points": null, - "amazon_fulfilled": false, - "free_shipping_eligible": false, - "prime_eligible": false, - "prime_exclusive": false, - "prime_pantry": false, - "violates_map": false, - "offer_id": "ahM%2FWYaVsrToTtjY7Qcs9j6HLSIm1HkK4uifVuo872UCOkzdMOkHEt0RYwno9LQrO%2BTHXtMPc50bZggA1z%2B8poFXBXZmhlY7OEr96I%2B99lqwd02QOOUyG1k7e52LIKuoSL7pO4HT7hh5X7JBZN%2B%2BDT8Y%2BU85nz%2By" - } - }, - "offers_summary": [ - { - "highest_price": { - "value": 3.98, - "currency": "EUR", - "per_unit": null, - "display": "3,98 €" - }, - "lowest_price": { - "value": 3.98, - "currency": "EUR", - "per_unit": null, - "display": "3,98 €" - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 1 - } - ] - }, - { - "asin": "B07FQ7G1T2", - "parent_asin": null, - "title": "Clip: Zeichnung Ron Weasley, Harry Potter und Hermione Granger", - "url": "https://www.amazon.de/dp/B07FQ7G1T2?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": null, - "languages": [ - "Deutsch Untertitelt", - "Deutsch Gesprochen" - ], - "formats": null, - "pages_count": null, - "color": null, - "unit_count": null, - "size": null, - "dimensions": { - "height": { - "value": null, - "unit": null - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": null, - "unit": null - } - }, - "weight": { - "value": null, - "unit": null - } - }, - "info": { - "contributors": [ - { - "name": "Jasmina Susak", - "role": "Regisseur" - } - ], - "manufacturer": null, - "brand": null, - "model": null, - "part_number": null, - "product_group": "Video On Demand", - "binding": "Prime Video", - "is_adult": false, - "audience_rating": "Freigegeben ohne Altersbeschränkung", - "edition": null, - "warranty": null, - "publication_date": null, - "release_date": "2018-07-19T14:25:01.178Z", - "external_ids": { - "ean": null, - "isbn": null, - "upc": null - } - }, - "images": { - "small": "https://m.media-amazon.com/images/I/51JcboN57aL._SL75_.jpg", - "medium": "https://m.media-amazon.com/images/I/51JcboN57aL._SL160_.jpg", - "large": "https://m.media-amazon.com/images/I/51JcboN57aL.jpg", - "cropped": { - "small": [ - "https://m.media-amazon.com/images/I/51JcboN57aL._AC75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/51JcboN57aL._AC160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/51JcboN57aL._AC_.jpg" - ] - }, - "variants": null - }, - "trade_in": null, - "prices": { - "price": { - "value": 0.99, - "currency": "EUR", - "per_unit": null, - "display": "0,99 €", - "savings": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "percentage": null - } - }, - "pvp": { - "value": null, - "currency": null, - "per_unit": null, - "display": null - }, - "availability": { - "max_order_quantity": null, - "min_order_quantity": 1, - "type": "Now", - "message": "Auf Lager." - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": "New", - "sub_condition_display": null - }, - "merchant": { - "default_shipping_country": "GB", - "merchant_id": "A3HBS5CIENBL3I", - "name": "Amazon Digital Germany GmbH" - }, - "other": { - "buybox_winner": true, - "loyalty_points": null, - "amazon_fulfilled": false, - "free_shipping_eligible": false, - "prime_eligible": false, - "prime_exclusive": false, - "prime_pantry": false, - "violates_map": false, - "offer_id": "ahM%2FWYaVsrTXEeFrVaBc7%2F1YG3OTidp8qLZw98Tfvgf3SURdxKHEVavxYdiqhGehbYKgF1UHL0RoMQVJ2GgZj2ndpwE55MqO%2B%2F2zGwvRAwuwpPNOS8Yplop23AOFrce5y94%2BcHwctHYex4JhdL%2BRyps8h68PB5fb" - } - }, - "offers_summary": [ - { - "highest_price": { - "value": 0.99, - "currency": "EUR", - "per_unit": null, - "display": "0,99 €" - }, - "lowest_price": { - "value": 0.99, - "currency": "EUR", - "per_unit": null, - "display": "0,99 €" - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 1 - } - ] - }, - { - "asin": "B07QBR6932", - "parent_asin": null, - "title": "Ballet Shoes", - "url": "https://www.amazon.de/dp/B07QBR6932?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": null, - "languages": [ - "Deutsch Gesprochen" - ], - "formats": null, - "pages_count": null, - "color": null, - "unit_count": null, - "size": null, - "dimensions": { - "height": { - "value": null, - "unit": null - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": null, - "unit": null - } - }, - "weight": { - "value": null, - "unit": null - } - }, - "info": { - "contributors": [ - { - "name": "Emma Watson", - "role": "Darsteller" - }, - { - "name": "Lucy Boynton", - "role": "Darsteller" - }, - { - "name": "Yasmin Paige", - "role": "Darsteller" - }, - { - "name": "Emilia Fox", - "role": "Darsteller" - }, - { - "name": "Richard Griffiths", - "role": "Darsteller" - }, - { - "name": "Eileen Atkins", - "role": "Darsteller" - }, - { - "name": "Marc Warren", - "role": "Darsteller" - }, - { - "name": "Victoria Wood", - "role": "Darsteller" - }, - { - "name": "Sandra Goldbacher", - "role": "Regisseur" - }, - { - "name": "Heidi Thomas", - "role": "Autor" - }, - { - "name": "Piers Wenger", - "role": "Produzent" - } - ], - "manufacturer": null, - "brand": null, - "model": null, - "part_number": null, - "product_group": "Video On Demand", - "binding": "Prime Video", - "is_adult": false, - "audience_rating": "Freigegeben ohne Altersbeschränkung", - "edition": null, - "warranty": null, - "publication_date": null, - "release_date": "2019-04-14T00:00:00.000Z", - "external_ids": { - "ean": null, - "isbn": null, - "upc": null - } - }, - "images": { - "small": "https://m.media-amazon.com/images/I/516V4ESEZuL._SL75_.jpg", - "medium": "https://m.media-amazon.com/images/I/516V4ESEZuL._SL160_.jpg", - "large": "https://m.media-amazon.com/images/I/516V4ESEZuL.jpg", - "cropped": { - "small": [ - "https://m.media-amazon.com/images/I/516V4ESEZuL._AC75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/516V4ESEZuL._AC160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/516V4ESEZuL._AC_.jpg" - ] - }, - "variants": null - }, - "trade_in": null, - "prices": { - "price": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "savings": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "percentage": null - } - }, - "pvp": { - "value": null, - "currency": null, - "per_unit": null, - "display": null - }, - "availability": { - "max_order_quantity": null, - "min_order_quantity": null, - "type": null, - "message": null - }, - "condition": null, - "merchant": { - "default_shipping_country": null, - "merchant_id": null, - "name": null - }, - "other": { - "buybox_winner": null, - "loyalty_points": null, - "amazon_fulfilled": null, - "free_shipping_eligible": null, - "prime_eligible": null, - "prime_exclusive": null, - "prime_pantry": null, - "violates_map": null, - "offer_id": null - } - }, - "offers_summary": null - }, - { - "asin": "B01L32RIHG", - "parent_asin": null, - "title": "Als die Frauen noch Schwänze hatten", - "url": "https://www.amazon.de/dp/B01L32RIHG?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": null, - "languages": [ - "Deutsch Gesprochen", - "Italienisch Originalsprache" - ], - "formats": null, - "pages_count": null, - "color": null, - "unit_count": null, - "size": null, - "dimensions": { - "height": { - "value": null, - "unit": null - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": null, - "unit": null - } - }, - "weight": { - "value": null, - "unit": null - } - }, - "info": { - "contributors": [ - { - "name": "Senta Berger", - "role": "Darsteller" - }, - { - "name": "Giuliano Gemma", - "role": "Darsteller" - }, - { - "name": "Frank Wolff", - "role": "Darsteller" - }, - { - "name": "Renzo Montagnani", - "role": "Darsteller" - }, - { - "name": "Lino Toffolo", - "role": "Darsteller" - }, - { - "name": "Francesco Mulé", - "role": "Darsteller" - }, - { - "name": "Aldo Giuffrè", - "role": "Darsteller" - }, - { - "name": "Pasquale Festa Campanile", - "role": "Regisseur" - }, - { - "name": "Lina Wertmüller", - "role": "Autor" - }, - { - "name": "Pasquale Festa Campanile", - "role": "Autor" - } - ], - "manufacturer": null, - "brand": null, - "model": null, - "part_number": null, - "product_group": "Video On Demand", - "binding": "Prime Video", - "is_adult": false, - "audience_rating": "Freigegeben ab 16 Jahren", - "edition": null, - "warranty": null, - "publication_date": null, - "release_date": "2016-09-06T00:00:00.000Z", - "external_ids": { - "ean": null, - "isbn": null, - "upc": null - } - }, - "images": { - "small": "https://m.media-amazon.com/images/I/61RC-7kvzkL._SL75_.jpg", - "medium": "https://m.media-amazon.com/images/I/61RC-7kvzkL._SL160_.jpg", - "large": "https://m.media-amazon.com/images/I/61RC-7kvzkL.jpg", - "cropped": { - "small": [ - "https://m.media-amazon.com/images/I/61RC-7kvzkL._AC75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/61RC-7kvzkL._AC160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/61RC-7kvzkL._AC_.jpg" - ] - }, - "variants": null - }, - "trade_in": null, - "prices": { - "price": { - "value": 3.99, - "currency": "EUR", - "per_unit": null, - "display": "3,99 €", - "savings": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "percentage": null - } - }, - "pvp": { - "value": null, - "currency": null, - "per_unit": null, - "display": null - }, - "availability": { - "max_order_quantity": null, - "min_order_quantity": 1, - "type": "Now", - "message": "Auf Lager." - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": "New", - "sub_condition_display": null - }, - "merchant": { - "default_shipping_country": "GB", - "merchant_id": "A3HBS5CIENBL3I", - "name": "Amazon Digital Germany GmbH" - }, - "other": { - "buybox_winner": true, - "loyalty_points": null, - "amazon_fulfilled": false, - "free_shipping_eligible": false, - "prime_eligible": false, - "prime_exclusive": false, - "prime_pantry": false, - "violates_map": false, - "offer_id": "ahM%2FWYaVsrToTtjY7Qcs9gggdZ4UiL85TBfzN5IJ2yQ46W6%2BxWvndbseRmVBrgouKASw%2Bp65a2JAVx%2B7gZB4vKwp3UyVQ3zD8tDc3FrYlas3%2BPBaVPAe89t3Vgrxm%2BUDijBE7%2Fp%2BI1h85pn3tm02nMVmQN%2Fk0iTQ" - } - }, - "offers_summary": [ - { - "highest_price": { - "value": 3.99, - "currency": "EUR", - "per_unit": null, - "display": "3,99 €" - }, - "lowest_price": { - "value": 3.99, - "currency": "EUR", - "per_unit": null, - "display": "3,99 €" - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 1 - } - ] - }, - { - "asin": "B01BX2FMWE", - "parent_asin": null, - "title": "Harry und Sally [dt./OV]", - "url": "https://www.amazon.de/dp/B01BX2FMWE?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": null, - "languages": [ - "Deutsch Gesprochen", - "Englisch Gesprochen", - "Deutsch Untertitelt", - "Englisch Originalsprache", - "Deutsch Unbekannt" - ], - "formats": null, - "pages_count": null, - "color": null, - "unit_count": null, - "size": null, - "dimensions": { - "height": { - "value": null, - "unit": null - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": null, - "unit": null - } - }, - "weight": { - "value": null, - "unit": null - } - }, - "info": { - "contributors": [ - { - "name": "Billy Crystal", - "role": "Darsteller" - }, - { - "name": "Meg Ryan", - "role": "Darsteller" - }, - { - "name": "Bruno Kirby", - "role": "Darsteller" - }, - { - "name": "Carrie Fisher", - "role": "Darsteller" - }, - { - "name": "Steven Ford", - "role": "Darsteller" - }, - { - "name": "Rob Reiner", - "role": "Regisseur" - }, - { - "name": "Nora Ephron", - "role": "Autor" - }, - { - "name": "Andrew Scheinman", - "role": "Produzent" - }, - { - "name": "Jeffrey Stott", - "role": "Produzent" - }, - { - "name": "Nora Ephron", - "role": "Produzent" - }, - { - "name": "Rob Reiner", - "role": "Produzent" - }, - { - "name": "Steve Nicolaides", - "role": "Produzent" - } - ], - "manufacturer": null, - "brand": null, - "model": null, - "part_number": null, - "product_group": "Video On Demand", - "binding": "Prime Video", - "is_adult": false, - "audience_rating": "Freigegeben ab 16 Jahren", - "edition": null, - "warranty": null, - "publication_date": null, - "release_date": "2014-12-01T00:00:00.000Z", - "external_ids": { - "ean": null, - "isbn": null, - "upc": null - } - }, - "images": { - "small": "https://m.media-amazon.com/images/I/51HowL7x4NL._SL75_.jpg", - "medium": "https://m.media-amazon.com/images/I/51HowL7x4NL._SL160_.jpg", - "large": "https://m.media-amazon.com/images/I/51HowL7x4NL.jpg", - "cropped": { - "small": [ - "https://m.media-amazon.com/images/I/51HowL7x4NL._AC75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/51HowL7x4NL._AC160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/51HowL7x4NL._AC_.jpg" - ] - }, - "variants": null - }, - "trade_in": null, - "prices": { - "price": { - "value": 2.99, - "currency": "EUR", - "per_unit": null, - "display": "2,99 €", - "savings": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "percentage": null - } - }, - "pvp": { - "value": null, - "currency": null, - "per_unit": null, - "display": null - }, - "availability": { - "max_order_quantity": null, - "min_order_quantity": 1, - "type": "Now", - "message": "Auf Lager." - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": "New", - "sub_condition_display": null - }, - "merchant": { - "default_shipping_country": "GB", - "merchant_id": "A3HBS5CIENBL3I", - "name": "Amazon Digital Germany GmbH" - }, - "other": { - "buybox_winner": true, - "loyalty_points": null, - "amazon_fulfilled": false, - "free_shipping_eligible": false, - "prime_eligible": false, - "prime_exclusive": false, - "prime_pantry": false, - "violates_map": false, - "offer_id": "ahM%2FWYaVsrToTtjY7Qcs9jGk7MEKEgqpWT%2FawQoVaOzBLTAsuv3hrmUUgfVS8WZkc8eZTZ74pUikJq1lo9esUKNA83WQgi%2BZ0h6d3ix%2BiaVeABzpOygeYRpa1lffpqLJT8Hm2fwqUS%2FuxhkfiTFAM3zs5gN2fBuk" - } - }, - "offers_summary": [ - { - "highest_price": { - "value": 2.99, - "currency": "EUR", - "per_unit": null, - "display": "2,99 €" - }, - "lowest_price": { - "value": 2.99, - "currency": "EUR", - "per_unit": null, - "display": "2,99 €" - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 1 - } - ] - }, - { - "asin": "B07FPW3ZBN", - "parent_asin": null, - "title": "Mamma Mia! Here We Go Again [dt./OV]", - "url": "https://www.amazon.de/dp/B07FPW3ZBN?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": null, - "languages": [ - "Deutsch Gesprochen", - "Englisch Gesprochen", - "Deutsch Untertitelt", - "Englisch Untertitelt", - "Deutsch Unbekannt" - ], - "formats": null, - "pages_count": null, - "color": null, - "unit_count": null, - "size": null, - "dimensions": { - "height": { - "value": null, - "unit": null - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": null, - "unit": null - } - }, - "weight": { - "value": null, - "unit": null - } - }, - "info": { - "contributors": [ - { - "name": "Meryl Streep", - "role": "Darsteller" - }, - { - "name": "Pierce Brosnan", - "role": "Darsteller" - }, - { - "name": "Colin Firth", - "role": "Darsteller" - }, - { - "name": "Stellan Skarsgård", - "role": "Darsteller" - }, - { - "name": "Julie Walters", - "role": "Darsteller" - }, - { - "name": "Dominic Cooper", - "role": "Darsteller" - }, - { - "name": "Amanda Seyfried", - "role": "Darsteller" - }, - { - "name": "Christine Baranski", - "role": "Darsteller" - }, - { - "name": "Lily James", - "role": "Darsteller" - }, - { - "name": "Josh Dylan", - "role": "Darsteller" - }, - { - "name": "Hugh Skinner", - "role": "Darsteller" - }, - { - "name": "Jeremy Irvine", - "role": "Darsteller" - }, - { - "name": "Alexa Davies", - "role": "Darsteller" - }, - { - "name": "Jessica Keenan Wynn", - "role": "Darsteller" - }, - { - "name": "Andy Garcia", - "role": "Darsteller" - }, - { - "name": "Cher", - "role": "Darsteller" - }, - { - "name": "Ol Parker", - "role": "Regisseur" - }, - { - "name": "Ol Parker", - "role": "Autor" - }, - { - "name": "Judy Craymer", - "role": "Produzent" - }, - { - "name": "Gary Goetzman", - "role": "Produzent" - } - ], - "manufacturer": null, - "brand": null, - "model": null, - "part_number": null, - "product_group": "Video On Demand", - "binding": "Prime Video", - "is_adult": false, - "audience_rating": "Freigegeben ohne Altersbeschränkung", - "edition": null, - "warranty": null, - "publication_date": null, - "release_date": "2019-05-22T00:00:00.000Z", - "external_ids": { - "ean": null, - "isbn": null, - "upc": null - } - }, - "images": { - "small": "https://m.media-amazon.com/images/I/51bV6Et+czL._SL75_.jpg", - "medium": "https://m.media-amazon.com/images/I/51bV6Et+czL._SL160_.jpg", - "large": "https://m.media-amazon.com/images/I/51bV6Et+czL.jpg", - "cropped": { - "small": [ - "https://m.media-amazon.com/images/I/51bV6Et+czL._AC75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/51bV6Et+czL._AC160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/51bV6Et+czL._AC_.jpg" - ] - }, - "variants": null - }, - "trade_in": null, - "prices": { - "price": { - "value": 9.99, - "currency": "EUR", - "per_unit": null, - "display": "9,99 €", - "savings": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "percentage": null - } - }, - "pvp": { - "value": null, - "currency": null, - "per_unit": null, - "display": null - }, - "availability": { - "max_order_quantity": null, - "min_order_quantity": 1, - "type": "Now", - "message": "Auf Lager." - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": "New", - "sub_condition_display": null - }, - "merchant": { - "default_shipping_country": "GB", - "merchant_id": "A3HBS5CIENBL3I", - "name": "Amazon Digital Germany GmbH" - }, - "other": { - "buybox_winner": true, - "loyalty_points": null, - "amazon_fulfilled": false, - "free_shipping_eligible": false, - "prime_eligible": false, - "prime_exclusive": false, - "prime_pantry": false, - "violates_map": false, - "offer_id": "Cbs%2BK1qemv58L5GvBnRjSlTMiPJedBiIjbti5MRyRpVBCEfhJmqibs6cgbHLsSmw54Y1MRLWJIo%2Bh8c9VKNOmpkuAt%2F9Fsf74%2BYwdDCw0KkRDjJ6V5R5NuhncO5Kb0RLUtdHsQr%2FkH8wuoW42fEK2c8f9MLzFig%2F" - } - }, - "offers_summary": [ - { - "highest_price": { - "value": 9.99, - "currency": "EUR", - "per_unit": null, - "display": "9,99 €" - }, - "lowest_price": { - "value": 9.99, - "currency": "EUR", - "per_unit": null, - "display": "9,99 €" - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 1 - } - ] - }, - { - "asin": "B07DY2M7Y2", - "parent_asin": null, - "title": "Harry Potter: The Complete Collection [8 DVDs]", - "url": "https://www.amazon.de/dp/B07DY2M7Y2?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": null, - "languages": [ - "Englisch Veröffentlicht", - "Deutsch Veröffentlicht", - "Englisch Veröffentlicht", - "Deutsch Veröffentlicht", - "Englisch Veröffentlicht", - "Deutsch Veröffentlicht", - "Deutsch Untertitelt", - "Englisch Untertitelt", - "Französisch Untertitelt", - "Niederländisch Untertitelt", - "Deutsch Originalsprache", - "Englisch Originalsprache", - "Französisch Originalsprache", - "Niederländisch Originalsprache" - ], - "formats": [ - "Dolby", - "PAL" - ], - "pages_count": null, - "color": null, - "unit_count": 8, - "size": null, - "dimensions": { - "height": { - "value": 7.67715, - "unit": "Zoll" - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": 4.76377, - "unit": "Zoll" - } - }, - "weight": { - "value": 1.1904962148, - "unit": "Pfund" - } - }, - "info": { - "contributors": [ - { - "name": "Daniel Radcliffe", - "role": "Darsteller" - }, - { - "name": "Emma Watson", - "role": "Darsteller" - }, - { - "name": "Rupert Grint", - "role": "Darsteller" - }, - { - "name": "Chris Columbus", - "role": "Regisseur" - }, - { - "name": "Alfonso Cuarón", - "role": "Regisseur" - }, - { - "name": "Mike Newell", - "role": "Regisseur" - }, - { - "name": "David Yates", - "role": "Regisseur" - }, - { - "name": "Daniel Radcliffe", - "role": "Hauptdarsteller" - }, - { - "name": "Emma Watson", - "role": "Hauptdarsteller" - } - ], - "manufacturer": "Warner Home Video - DVD", - "brand": "Warner Home Video", - "model": null, - "part_number": "1000726852", - "product_group": "DVD", - "binding": "DVD", - "is_adult": null, - "audience_rating": "Freigegeben ab 12 Jahren", - "edition": "Standard Version", - "warranty": null, - "publication_date": "2018-09-06T00:00:01Z", - "release_date": "2018-09-06T00:00:01Z", - "external_ids": { - "ean": [ - "5051890315960" - ], - "isbn": null, - "upc": null - } - }, - "images": { - "small": "https://m.media-amazon.com/images/I/51YH9w-Q0hL._SL75_.jpg", - "medium": "https://m.media-amazon.com/images/I/51YH9w-Q0hL._SL160_.jpg", - "large": "https://m.media-amazon.com/images/I/51YH9w-Q0hL.jpg", - "cropped": { - "small": [ - "https://m.media-amazon.com/images/I/51YH9w-Q0hL._AC75_.jpg", - "https://m.media-amazon.com/images/I/51WIBChefSL._AC75_.jpg", - "https://m.media-amazon.com/images/I/41UVT7hB3SL._AC75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/51YH9w-Q0hL._AC160_.jpg", - "https://m.media-amazon.com/images/I/51WIBChefSL._AC160_.jpg", - "https://m.media-amazon.com/images/I/41UVT7hB3SL._AC160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/51YH9w-Q0hL._AC_.jpg", - "https://m.media-amazon.com/images/I/51WIBChefSL._AC_.jpg", - "https://m.media-amazon.com/images/I/41UVT7hB3SL._AC_.jpg" - ] - }, - "variants": { - "small": [ - "https://m.media-amazon.com/images/I/51WIBChefSL._SL75_.jpg", - "https://m.media-amazon.com/images/I/41UVT7hB3SL._SL75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/51WIBChefSL._SL160_.jpg", - "https://m.media-amazon.com/images/I/41UVT7hB3SL._SL160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/51WIBChefSL.jpg", - "https://m.media-amazon.com/images/I/41UVT7hB3SL.jpg" - ] - } - }, - "trade_in": null, - "prices": { - "price": { - "value": 28.99, - "currency": "EUR", - "per_unit": null, - "display": "28,99 €", - "savings": { - "value": 1.0, - "currency": "EUR", - "per_unit": null, - "display": "1,00 € (3%)", - "percentage": 3.0 - } - }, - "pvp": { - "value": 29.99, - "currency": "EUR", - "per_unit": null, - "display": "29,99 €" - }, - "availability": { - "max_order_quantity": 3, - "min_order_quantity": 1, - "type": "Now", - "message": "Auf Lager." - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": "New", - "sub_condition_display": null - }, - "merchant": { - "default_shipping_country": null, - "merchant_id": "A3JWKAKR8XB7XF", - "name": "Amazon.de" - }, - "other": { - "buybox_winner": true, - "loyalty_points": null, - "amazon_fulfilled": true, - "free_shipping_eligible": true, - "prime_eligible": true, - "prime_exclusive": false, - "prime_pantry": false, - "violates_map": false, - "offer_id": "Cbs%2BK1qemv58L5GvBnRjSl40NqAqOzfpHXhD4n1JeQxoHIJfzKYLm9Q5aAlB1RyalGfu4MRibaTpB%2B%2B%2BTJgJp%2B0XIslVnIA9aourwFzi46w%3D" - } - }, - "offers_summary": [ - { - "highest_price": { - "value": 50.11, - "currency": "EUR", - "per_unit": null, - "display": "50,11 €" - }, - "lowest_price": { - "value": 28.99, - "currency": "EUR", - "per_unit": null, - "display": "28,99 €" - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 8 - }, - { - "highest_price": { - "value": 33.76, - "currency": "EUR", - "per_unit": null, - "display": "33,76 €" - }, - "lowest_price": { - "value": 32.0, - "currency": "EUR", - "per_unit": null, - "display": "32,00 €" - }, - "condition": { - "condition": "Used", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 2 - } - ] - }, - { - "asin": "B00FYU986S", - "parent_asin": null, - "title": "Zurück in die Zukunft [dt./OV]", - "url": "https://www.amazon.de/dp/B00FYU986S?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": null, - "languages": [ - "Deutsch Gesprochen", - "Englisch Gesprochen", - "Deutsch Untertitelt", - "Deutsch Originalsprache" - ], - "formats": null, - "pages_count": null, - "color": null, - "unit_count": null, - "size": null, - "dimensions": { - "height": { - "value": null, - "unit": null - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": null, - "unit": null - } - }, - "weight": { - "value": null, - "unit": null - } - }, - "info": { - "contributors": [ - { - "name": "Michael J. Fox", - "role": "Darsteller" - }, - { - "name": "Christopher Lloyd", - "role": "Darsteller" - }, - { - "name": "Lea Thompson", - "role": "Darsteller" - }, - { - "name": "Crispin Glover", - "role": "Darsteller" - }, - { - "name": "Thomas F. Wilson", - "role": "Darsteller" - }, - { - "name": "Claudia Wells", - "role": "Darsteller" - }, - { - "name": "Marc McClure", - "role": "Darsteller" - }, - { - "name": "Wendie Jo Sperber", - "role": "Darsteller" - }, - { - "name": "George DiCenzo", - "role": "Darsteller" - }, - { - "name": "Frances Lee McCain", - "role": "Darsteller" - }, - { - "name": "James Tolkan", - "role": "Darsteller" - }, - { - "name": "J.J. Cohen", - "role": "Darsteller" - }, - { - "name": "Casey Siemaszko", - "role": "Darsteller" - }, - { - "name": "Billy Zane", - "role": "Darsteller" - }, - { - "name": "Harry Waters Jr.", - "role": "Darsteller" - }, - { - "name": "Robert Zemeckis", - "role": "Regisseur" - } - ], - "manufacturer": null, - "brand": null, - "model": null, - "part_number": null, - "product_group": "Video On Demand", - "binding": "Prime Video", - "is_adult": false, - "audience_rating": "Freigegeben ab 12 Jahren", - "edition": null, - "warranty": null, - "publication_date": null, - "release_date": "2014-02-26T01:00:00.000Z", - "external_ids": { - "ean": null, - "isbn": null, - "upc": null - } - }, - "images": { - "small": "https://m.media-amazon.com/images/I/51Zo+7Ye+BL._SL75_.jpg", - "medium": "https://m.media-amazon.com/images/I/51Zo+7Ye+BL._SL160_.jpg", - "large": "https://m.media-amazon.com/images/I/51Zo+7Ye+BL.jpg", - "cropped": { - "small": [ - "https://m.media-amazon.com/images/I/51Zo+7Ye+BL._AC75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/51Zo+7Ye+BL._AC160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/51Zo+7Ye+BL._AC_.jpg" - ] - }, - "variants": null - }, - "trade_in": null, - "prices": { - "price": { - "value": 2.99, - "currency": "EUR", - "per_unit": null, - "display": "2,99 €", - "savings": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "percentage": null - } - }, - "pvp": { - "value": null, - "currency": null, - "per_unit": null, - "display": null - }, - "availability": { - "max_order_quantity": null, - "min_order_quantity": 1, - "type": "Now", - "message": "Auf Lager." - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": "New", - "sub_condition_display": null - }, - "merchant": { - "default_shipping_country": "GB", - "merchant_id": "A3HBS5CIENBL3I", - "name": "Amazon Digital Germany GmbH" - }, - "other": { - "buybox_winner": true, - "loyalty_points": null, - "amazon_fulfilled": false, - "free_shipping_eligible": false, - "prime_eligible": false, - "prime_exclusive": false, - "prime_pantry": false, - "violates_map": false, - "offer_id": "Cbs%2BK1qemv7rLmyzIMrF%2Bt262JcIl3%2FU1kHXzXUXjw4oh5cG0OenWd1PiN4VvEh28gcPo6dvqRYQ5n1Ew5ga7T4qspdhzcZzwMV988XdBDrQw4uTXo33Zgtc%2BAQVOthXCYou3kINMLks6sWRQjbYlGT6yNzBiz7Y" - } - }, - "offers_summary": [ - { - "highest_price": { - "value": 2.99, - "currency": "EUR", - "per_unit": null, - "display": "2,99 €" - }, - "lowest_price": { - "value": 2.99, - "currency": "EUR", - "per_unit": null, - "display": "2,99 €" - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 1 - } - ] - }, - { - "asin": "B01LZQTGKP", - "parent_asin": null, - "title": "Harry Potter und der Orden des Phönix - Gesprochen von Rufus Beck: Harry Potter 5", - "url": "https://www.amazon.de/dp/B01LZQTGKP?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": null, - "languages": [ - "Deutsch Veröffentlicht", - "Deutsch Unbekannt" - ], - "formats": [ - "Ungekürzte Ausgabe" - ], - "pages_count": null, - "color": null, - "unit_count": null, - "size": null, - "dimensions": { - "height": { - "value": null, - "unit": null - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": null, - "unit": null - } - }, - "weight": { - "value": null, - "unit": null - } - }, - "info": { - "contributors": [ - { - "name": "J.K. Rowling", - "role": "Autor" - }, - { - "name": "Rufus Beck", - "role": "Erzähler" - }, - { - "name": "Pottermore Publishing", - "role": "Verlag" - } - ], - "manufacturer": "Pottermore Publishing", - "brand": null, - "model": null, - "part_number": null, - "product_group": "Audible", - "binding": "Audible Hörbuch", - "is_adult": false, - "audience_rating": null, - "edition": null, - "warranty": null, - "publication_date": "2016-10-18T00:00:00Z", - "release_date": "2016-10-18T00:00:00-00:00", - "external_ids": { - "ean": null, - "isbn": null, - "upc": null - } - }, - "images": { - "small": "https://m.media-amazon.com/images/I/51UerUBzjGL._SL75_.jpg", - "medium": "https://m.media-amazon.com/images/I/51UerUBzjGL._SL160_.jpg", - "large": "https://m.media-amazon.com/images/I/51UerUBzjGL.jpg", - "cropped": { - "small": [ - "https://m.media-amazon.com/images/I/51UerUBzjGL._AC75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/51UerUBzjGL._AC160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/51UerUBzjGL._AC_.jpg" - ] - }, - "variants": null - }, - "trade_in": null, - "prices": { - "price": { - "value": 39.95, - "currency": "EUR", - "per_unit": null, - "display": "39,95 €", - "savings": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "percentage": null - } - }, - "pvp": { - "value": null, - "currency": null, - "per_unit": null, - "display": null - }, - "availability": { - "max_order_quantity": null, - "min_order_quantity": 1, - "type": "Now", - "message": "Jetzt als Download verfügbar." - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": "New", - "sub_condition_display": null - }, - "merchant": { - "default_shipping_country": null, - "merchant_id": "ALQGD0RUJOUO0", - "name": "Audible GmbH" - }, - "other": { - "buybox_winner": true, - "loyalty_points": null, - "amazon_fulfilled": false, - "free_shipping_eligible": false, - "prime_eligible": false, - "prime_exclusive": false, - "prime_pantry": false, - "violates_map": false, - "offer_id": "Cbs%2BK1qemv7QM3DJQf2adoIWoTdIgRYrcKGWf74TlJ0iUnfn0bdlXSkD7pD7nGJZf9PF%2FqsBuI%2FsGgRbFdliX4bEvACw5zPzw%2FPDZ%2FpB7xGj3YHJybL8TKT2eHRvFit%2ByeH5G2bRLkRP%2Bu3p6T3DBw%3D%3D" - } - }, - "offers_summary": [ - { - "highest_price": { - "value": 39.95, - "currency": "EUR", - "per_unit": null, - "display": "39,95 €" - }, - "lowest_price": { - "value": 39.95, - "currency": "EUR", - "per_unit": null, - "display": "39,95 €" - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 1 - } - ] - }, - { - "asin": "B00P1VF84G", - "parent_asin": null, - "title": "Der Hobbit: Smaugs Einöde - Extended Edition [dt./OV]", - "url": "https://www.amazon.de/dp/B00P1VF84G?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": null, - "languages": [ - "Deutsch Untertitelt", - "Deutsch Gesprochen", - "Englisch Gesprochen", - "Englisch Originalsprache", - "Deutsch Unbekannt" - ], - "formats": null, - "pages_count": null, - "color": null, - "unit_count": null, - "size": null, - "dimensions": { - "height": { - "value": null, - "unit": null - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": null, - "unit": null - } - }, - "weight": { - "value": null, - "unit": null - } - }, - "info": { - "contributors": [ - { - "name": "Ian McKellen", - "role": "Darsteller" - }, - { - "name": "Martin Freeman", - "role": "Darsteller" - }, - { - "name": "Richard Armitage", - "role": "Darsteller" - }, - { - "name": "Benedict Cumberbatch", - "role": "Darsteller" - }, - { - "name": "Evangeline Lilly", - "role": "Darsteller" - }, - { - "name": "Lee Pace", - "role": "Darsteller" - }, - { - "name": "Luke Evans", - "role": "Darsteller" - }, - { - "name": "Peter Jackson", - "role": "Regisseur" - }, - { - "name": "Fran Walsh", - "role": "Autor" - }, - { - "name": "Philippa Boyens", - "role": "Autor" - }, - { - "name": "Guillermo Del Toro", - "role": "Autor" - }, - { - "name": "Peter Jackson", - "role": "Autor" - }, - { - "name": "Peter Jackson", - "role": "Produzent" - }, - { - "name": "Fran Walsh", - "role": "Produzent" - }, - { - "name": "Zane Weiner", - "role": "Produzent" - }, - { - "name": "Carolynne Cunningham", - "role": "Produzent" - } - ], - "manufacturer": null, - "brand": null, - "model": null, - "part_number": null, - "product_group": "Video On Demand", - "binding": "Prime Video", - "is_adult": false, - "audience_rating": "Freigegeben ab 12 Jahren", - "edition": null, - "warranty": null, - "publication_date": null, - "release_date": "2014-10-28T00:00:00.000Z", - "external_ids": { - "ean": null, - "isbn": null, - "upc": null - } - }, - "images": { - "small": "https://m.media-amazon.com/images/I/51xwpgi2TUL._SL75_.jpg", - "medium": "https://m.media-amazon.com/images/I/51xwpgi2TUL._SL160_.jpg", - "large": "https://m.media-amazon.com/images/I/51xwpgi2TUL.jpg", - "cropped": { - "small": [ - "https://m.media-amazon.com/images/I/51xwpgi2TUL._AC75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/51xwpgi2TUL._AC160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/51xwpgi2TUL._AC_.jpg" - ] - }, - "variants": null - }, - "trade_in": null, - "prices": { - "price": { - "value": 10.49, - "currency": "EUR", - "per_unit": null, - "display": "10,49 €", - "savings": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "percentage": null - } - }, - "pvp": { - "value": null, - "currency": null, - "per_unit": null, - "display": null - }, - "availability": { - "max_order_quantity": null, - "min_order_quantity": 1, - "type": "Now", - "message": "Auf Lager." - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": "New", - "sub_condition_display": null - }, - "merchant": { - "default_shipping_country": "GB", - "merchant_id": "A3HBS5CIENBL3I", - "name": "Amazon Digital Germany GmbH" - }, - "other": { - "buybox_winner": true, - "loyalty_points": null, - "amazon_fulfilled": false, - "free_shipping_eligible": false, - "prime_eligible": false, - "prime_exclusive": false, - "prime_pantry": false, - "violates_map": false, - "offer_id": "Cbs%2BK1qemv7rLmyzIMrF%2BmXviTres2V%2Fu64aZlUcxXzFZRrKDY8xCBlkmHepAxEjbXLNFXqoq416ENsB3lP6JZTFMrLJUFbGk1KELE9eqF7B%2B3eSF%2Bl%2BQd1wNdY%2FxaMTTsOs7Z2G8eXfJAXVJ4%2Fhx4ziKYvFS3lP" - } - }, - "offers_summary": [ - { - "highest_price": { - "value": 10.49, - "currency": "EUR", - "per_unit": null, - "display": "10,49 €" - }, - "lowest_price": { - "value": 10.49, - "currency": "EUR", - "per_unit": null, - "display": "10,49 €" - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 1 - } - ] - }, - { - "asin": "B07ZKP6QZM", - "parent_asin": null, - "title": "Überraschung für Mania", - "url": "https://www.amazon.de/dp/B07ZKP6QZM?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": null, - "languages": [ - "Deutsch Gesprochen" - ], - "formats": null, - "pages_count": null, - "color": null, - "unit_count": null, - "size": null, - "dimensions": { - "height": { - "value": null, - "unit": null - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": null, - "unit": null - } - }, - "weight": { - "value": null, - "unit": null - } - }, - "info": { - "contributors": [ - { - "name": "Not specified", - "role": "Produzent" - } - ], - "manufacturer": null, - "brand": null, - "model": null, - "part_number": null, - "product_group": "Video On Demand", - "binding": "Prime Video", - "is_adult": false, - "audience_rating": "Freigegeben ohne Altersbeschränkung", - "edition": null, - "warranty": null, - "publication_date": null, - "release_date": "2019-10-28T00:00:00.000Z", - "external_ids": { - "ean": null, - "isbn": null, - "upc": null - } - }, - "images": { - "small": null, - "medium": null, - "large": null, - "cropped": { - "small": [], - "medium": [], - "large": [] - }, - "variants": null - }, - "trade_in": null, - "prices": { - "price": { - "value": 1.99, - "currency": "EUR", - "per_unit": null, - "display": "1,99 €", - "savings": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "percentage": null - } - }, - "pvp": { - "value": null, - "currency": null, - "per_unit": null, - "display": null - }, - "availability": { - "max_order_quantity": null, - "min_order_quantity": 1, - "type": "Now", - "message": "Auf Lager." - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": "New", - "sub_condition_display": null - }, - "merchant": { - "default_shipping_country": "GB", - "merchant_id": "A3HBS5CIENBL3I", - "name": "Amazon Digital Germany GmbH" - }, - "other": { - "buybox_winner": true, - "loyalty_points": null, - "amazon_fulfilled": false, - "free_shipping_eligible": false, - "prime_eligible": false, - "prime_exclusive": false, - "prime_pantry": false, - "violates_map": false, - "offer_id": "Cbs%2BK1qemv58L5GvBnRjSpj0AirJ8eZ2Xnm%2F6yIWo8EgX1w0YAHS60yOgenY2bNKxGowPtHcQCnnHyZR5obZAYICgNavkSUGbBLx%2BPv7KiCDYgW4ipe79z2o8%2BG%2B0Utsw1z%2BG0rZzaU8D2WwDLAgc2iCc%2FdbJE4Q" - } - }, - "offers_summary": [ - { - "highest_price": { - "value": 1.99, - "currency": "EUR", - "per_unit": null, - "display": "1,99 €" - }, - "lowest_price": { - "value": 1.99, - "currency": "EUR", - "per_unit": null, - "display": "1,99 €" - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 1 - } - ] - }, - { - "asin": "B0792QK8GL", - "parent_asin": "B07QLJ7WPL", - "title": "LEGO Harry Potter und die Kammer des Schreckens – Die Peitschende Weide von Hogwarts (75953) Bauset (753 Teile)", - "url": "https://www.amazon.de/dp/B0792QK8GL?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": [ - "Mit eine baubaren Modell der Peitschenden Weide, des Ford Anglia und eines Bereichs von Schloss Hogwarts.", - "Der dreistöckige Schlossbereich von Hogwarts besteht aus einem Tor, einem Wehrgang, 3 Türmen, einem Schlafsaal mit 2 Betten, ein Zaubertränke-Klassenzimmer mit Arbeitstisch und dem Büro von Severus Snape.", - "Drehe die Äste der Peitschenden Weide, um das Auto einzufangen, und wirf es dann auf den Boden, damit Ron und Harry durch das Schlosstor fahren können.", - "Die Zubehörteile umfassen Zaubertränke, Kessel, 2 Koffer, 5 Zauberstäbe, Kerzen, eine Laterne, eine Ausgabe des Tagespropheten und ein magisches Zauberspruch-Blatt, einen Besen, Tische, einen Stuhl, Werkzeuge und 2 Tintenfässer mit einer Feder.", - "Der Schlossbereich von Hogwarts ist über 27 cm hoch, 35 cm breit und 8 cm tief." - ], - "languages": [ - "Italienisch Handbuch", - "Deutsch Handbuch", - "Französisch Handbuch", - "Englisch Handbuch", - "Spanisch Handbuch", - "Deutsch Unbekannt", - "Englisch Unbekannt", - "Dänisch Unbekannt", - "Französisch Unbekannt", - "Italienisch Unbekannt", - "Spanisch Unbekannt" - ], - "formats": null, - "pages_count": null, - "color": "Keine", - "unit_count": 1, - "size": null, - "dimensions": { - "height": { - "value": 11.1023621934, - "unit": "Zoll" - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": 2.9133858238, - "unit": "Zoll" - } - }, - "weight": { - "value": 2.27517054384, - "unit": "Pfund" - } - }, - "info": { - "contributors": [ - { - "name": "LEGO", - "role": "Designer" - } - ], - "manufacturer": "LEGO", - "brand": "LEGO", - "model": "75953", - "part_number": "75953", - "product_group": "Toy", - "binding": "Spielzeug", - "is_adult": false, - "audience_rating": null, - "edition": null, - "warranty": "2 Jahre", - "publication_date": null, - "release_date": "2018-09-28T00:00:01Z", - "external_ids": { - "ean": [ - "5702016110364" - ], - "isbn": null, - "upc": null - } - }, - "images": { - "small": "https://m.media-amazon.com/images/I/51FyQUatZTL._SL75_.jpg", - "medium": "https://m.media-amazon.com/images/I/51FyQUatZTL._SL160_.jpg", - "large": "https://m.media-amazon.com/images/I/51FyQUatZTL.jpg", - "cropped": { - "small": [ - "https://m.media-amazon.com/images/I/51FyQUatZTL._AC75_.jpg", - "https://m.media-amazon.com/images/I/51vgr9N9hZL._AC75_.jpg", - "https://m.media-amazon.com/images/I/51NeKyrAYtL._AC75_.jpg", - "https://m.media-amazon.com/images/I/51ximg2P99L._AC75_.jpg", - "https://m.media-amazon.com/images/I/511tS-JufIL._AC75_.jpg", - "https://m.media-amazon.com/images/I/51QvxHPMyLL._AC75_.jpg", - "https://m.media-amazon.com/images/I/51pDpjPLS8L._AC75_.jpg", - "https://m.media-amazon.com/images/I/41irNkPwOaL._AC75_.jpg", - "https://m.media-amazon.com/images/I/51+aEjs3XXL._AC75_.jpg", - "https://m.media-amazon.com/images/I/51GgPk4kk7L._AC75_.jpg", - "https://m.media-amazon.com/images/I/51P0HP1uKOL._AC75_.jpg", - "https://m.media-amazon.com/images/I/51LrBHeVmuL._AC75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/51FyQUatZTL._AC160_.jpg", - "https://m.media-amazon.com/images/I/51vgr9N9hZL._AC160_.jpg", - "https://m.media-amazon.com/images/I/51NeKyrAYtL._AC160_.jpg", - "https://m.media-amazon.com/images/I/51ximg2P99L._AC160_.jpg", - "https://m.media-amazon.com/images/I/511tS-JufIL._AC160_.jpg", - "https://m.media-amazon.com/images/I/51QvxHPMyLL._AC160_.jpg", - "https://m.media-amazon.com/images/I/51pDpjPLS8L._AC160_.jpg", - "https://m.media-amazon.com/images/I/41irNkPwOaL._AC160_.jpg", - "https://m.media-amazon.com/images/I/51+aEjs3XXL._AC160_.jpg", - "https://m.media-amazon.com/images/I/51GgPk4kk7L._AC160_.jpg", - "https://m.media-amazon.com/images/I/51P0HP1uKOL._AC160_.jpg", - "https://m.media-amazon.com/images/I/51LrBHeVmuL._AC160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/51FyQUatZTL._AC_.jpg", - "https://m.media-amazon.com/images/I/51vgr9N9hZL._AC_.jpg", - "https://m.media-amazon.com/images/I/51NeKyrAYtL._AC_.jpg", - "https://m.media-amazon.com/images/I/51ximg2P99L._AC_.jpg", - "https://m.media-amazon.com/images/I/511tS-JufIL._AC_.jpg", - "https://m.media-amazon.com/images/I/51QvxHPMyLL._AC_.jpg", - "https://m.media-amazon.com/images/I/51pDpjPLS8L._AC_.jpg", - "https://m.media-amazon.com/images/I/41irNkPwOaL._AC_.jpg", - "https://m.media-amazon.com/images/I/51+aEjs3XXL._AC_.jpg", - "https://m.media-amazon.com/images/I/51GgPk4kk7L._AC_.jpg", - "https://m.media-amazon.com/images/I/51P0HP1uKOL._AC_.jpg", - "https://m.media-amazon.com/images/I/51LrBHeVmuL._AC_.jpg" - ] - }, - "variants": { - "small": [ - "https://m.media-amazon.com/images/I/51vgr9N9hZL._SL75_.jpg", - "https://m.media-amazon.com/images/I/51NeKyrAYtL._SL75_.jpg", - "https://m.media-amazon.com/images/I/51ximg2P99L._SL75_.jpg", - "https://m.media-amazon.com/images/I/511tS-JufIL._SL75_.jpg", - "https://m.media-amazon.com/images/I/51QvxHPMyLL._SL75_.jpg", - "https://m.media-amazon.com/images/I/51pDpjPLS8L._SL75_.jpg", - "https://m.media-amazon.com/images/I/41irNkPwOaL._SL75_.jpg", - "https://m.media-amazon.com/images/I/51+aEjs3XXL._SL75_.jpg", - "https://m.media-amazon.com/images/I/51GgPk4kk7L._SL75_.jpg", - "https://m.media-amazon.com/images/I/51P0HP1uKOL._SL75_.jpg", - "https://m.media-amazon.com/images/I/51LrBHeVmuL._SL75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/51vgr9N9hZL._SL160_.jpg", - "https://m.media-amazon.com/images/I/51NeKyrAYtL._SL160_.jpg", - "https://m.media-amazon.com/images/I/51ximg2P99L._SL160_.jpg", - "https://m.media-amazon.com/images/I/511tS-JufIL._SL160_.jpg", - "https://m.media-amazon.com/images/I/51QvxHPMyLL._SL160_.jpg", - "https://m.media-amazon.com/images/I/51pDpjPLS8L._SL160_.jpg", - "https://m.media-amazon.com/images/I/41irNkPwOaL._SL160_.jpg", - "https://m.media-amazon.com/images/I/51+aEjs3XXL._SL160_.jpg", - "https://m.media-amazon.com/images/I/51GgPk4kk7L._SL160_.jpg", - "https://m.media-amazon.com/images/I/51P0HP1uKOL._SL160_.jpg", - "https://m.media-amazon.com/images/I/51LrBHeVmuL._SL160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/51vgr9N9hZL.jpg", - "https://m.media-amazon.com/images/I/51NeKyrAYtL.jpg", - "https://m.media-amazon.com/images/I/51ximg2P99L.jpg", - "https://m.media-amazon.com/images/I/511tS-JufIL.jpg", - "https://m.media-amazon.com/images/I/51QvxHPMyLL.jpg", - "https://m.media-amazon.com/images/I/51pDpjPLS8L.jpg", - "https://m.media-amazon.com/images/I/41irNkPwOaL.jpg", - "https://m.media-amazon.com/images/I/51+aEjs3XXL.jpg", - "https://m.media-amazon.com/images/I/51GgPk4kk7L.jpg", - "https://m.media-amazon.com/images/I/51P0HP1uKOL.jpg", - "https://m.media-amazon.com/images/I/51LrBHeVmuL.jpg" - ] - } - }, - "trade_in": null, - "prices": { - "price": { - "value": 50.77, - "currency": "EUR", - "per_unit": null, - "display": "50,77 €", - "savings": { - "value": 19.22, - "currency": "EUR", - "per_unit": null, - "display": "19,22 € (27%)", - "percentage": 27.0 - } - }, - "pvp": { - "value": 69.99, - "currency": "EUR", - "per_unit": null, - "display": "69,99 €" - }, - "availability": { - "max_order_quantity": 2, - "min_order_quantity": 1, - "type": "Now", - "message": "Auf Lager." - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": "New", - "sub_condition_display": null - }, - "merchant": { - "default_shipping_country": null, - "merchant_id": "A3JWKAKR8XB7XF", - "name": "Amazon.de" - }, - "other": { - "buybox_winner": true, - "loyalty_points": null, - "amazon_fulfilled": true, - "free_shipping_eligible": true, - "prime_eligible": true, - "prime_exclusive": false, - "prime_pantry": false, - "violates_map": false, - "offer_id": "Cbs%2BK1qemv58L5GvBnRjSopZdzoAc0TE8Ld1ZaYa%2BCVT1PTRUnVqv0afCiH72JUZCPcmxg1JGIGOHujRbb%2BocDr8g9QEVs311ZMgIhadq4Q%3D" - } - }, - "offers_summary": [ - { - "highest_price": { - "value": 129.95, - "currency": "EUR", - "per_unit": null, - "display": "129,95 €" - }, - "lowest_price": { - "value": 50.77, - "currency": "EUR", - "per_unit": null, - "display": "50,77 €" - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 85 - }, - { - "highest_price": { - "value": 69.0, - "currency": "EUR", - "per_unit": null, - "display": "69,00 €" - }, - "lowest_price": { - "value": 59.9, - "currency": "EUR", - "per_unit": null, - "display": "59,90 €" - }, - "condition": { - "condition": "Used", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 2 - } - ] - }, - { - "asin": "B0874Y2T4C", - "parent_asin": null, - "title": "Trittbrettfahrer", - "url": "https://www.amazon.de/dp/B0874Y2T4C?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": null, - "languages": [ - "Deutsch Untertitelt", - "Englisch Untertitelt", - "Deutsch Gesprochen", - "Englisch Gesprochen", - "Englisch Originalsprache", - "Deutsch Unbekannt" - ], - "formats": null, - "pages_count": null, - "color": null, - "unit_count": null, - "size": null, - "dimensions": { - "height": { - "value": null, - "unit": null - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": null, - "unit": null - } - }, - "weight": { - "value": null, - "unit": null - } - }, - "info": { - "contributors": [ - { - "name": "Amy Aquino", - "role": "Darsteller" - }, - { - "name": "Titus Welliver", - "role": "Darsteller" - }, - { - "name": "Lance Reddick", - "role": "Darsteller" - }, - { - "name": "Madison Lintz", - "role": "Darsteller" - }, - { - "name": "Jamie Hector", - "role": "Darsteller" - }, - { - "name": "Ernest Dickerson", - "role": "Regisseur" - }, - { - "name": "Eric Overmyer & Alex Meenehan", - "role": "Autor" - }, - { - "name": "Titus Welliver", - "role": "Produzent" - }, - { - "name": "Daniel Pyne", - "role": "Produzent" - }, - { - "name": "Tom Bernardo", - "role": "Produzent" - }, - { - "name": "Francesco Tignini", - "role": "Produzent" - }, - { - "name": "Henrik Pabst", - "role": "Produzent" - }, - { - "name": "Hold Fast Productions LLC", - "role": "Produzent" - }, - { - "name": "Henrik Bastin", - "role": "Produzent" - }, - { - "name": "Jamie Boscardin Martin", - "role": "Produzent" - }, - { - "name": "Mark Douglas", - "role": "Produzent" - }, - { - "name": "Jeffrey Fiskin", - "role": "Produzent" - }, - { - "name": "Eric Overmyer", - "role": "Produzent" - }, - { - "name": "James Baker", - "role": "Produzent" - }, - { - "name": "Bo Stehmeier", - "role": "Produzent" - }, - { - "name": "Michael Connelly", - "role": "Produzent" - }, - { - "name": "Pieter Jan Brugge", - "role": "Produzent" - }, - { - "name": "Eric Overmyer", - "role": "Idee" - }, - { - "name": "Michael Connelly", - "role": "Idee" - }, - { - "name": "Linda Park", - "role": "Guest Actor" - }, - { - "name": "Scott Klace", - "role": "Guest Actor" - }, - { - "name": "Jon Fletcher", - "role": "Guest Actor" - }, - { - "name": "Mary-Bonner Baker", - "role": "Guest Actor" - }, - { - "name": "Daya Vaidya", - "role": "Guest Actor" - }, - { - "name": "Cynthia Kaye McWilliams", - "role": "Guest Actor" - }, - { - "name": "Treva Eitienne", - "role": "Guest Actor" - }, - { - "name": "Tzi Ma", - "role": "Guest Actor" - }, - { - "name": "Bambadjan Bamba", - "role": "Guest Actor" - }, - { - "name": "Jamie Anne Allman", - "role": "Guest Actor" - }, - { - "name": "Mitchell Fink", - "role": "Guest Actor" - }, - { - "name": "Abby Brammell", - "role": "Guest Actor" - }, - { - "name": "Jacqueline Obradors", - "role": "Guest Actor" - }, - { - "name": "DaJuan Johnson", - "role": "Guest Actor" - }, - { - "name": "Richard Brooks", - "role": "Guest Actor" - }, - { - "name": "David Marciano", - "role": "Guest Actor" - }, - { - "name": "Bess Armstrong", - "role": "Guest Actor" - }, - { - "name": "Mimi Rogers", - "role": "Guest Actor" - }, - { - "name": "Lynn Collins", - "role": "Guest Actor" - }, - { - "name": "Amir Talai", - "role": "Guest Actor" - }, - { - "name": "Gregory Scott Cummins", - "role": "Guest Actor" - }, - { - "name": "Troy Evans", - "role": "Guest Actor" - }, - { - "name": "Celestino Cornielle", - "role": "Guest Actor" - }, - { - "name": "Eric Ladin", - "role": "Guest Actor" - }, - { - "name": "Ashton Holmes", - "role": "Guest Actor" - }, - { - "name": "Kristen Ariza", - "role": "Guest Actor" - } - ], - "manufacturer": null, - "brand": null, - "model": null, - "part_number": null, - "product_group": "Video On Demand", - "binding": "Prime Video", - "is_adult": false, - "audience_rating": "Freigegeben ab 12 Jahren", - "edition": null, - "warranty": null, - "publication_date": null, - "release_date": null, - "external_ids": { - "ean": null, - "isbn": null, - "upc": null - } - }, - "images": { - "small": "https://m.media-amazon.com/images/I/41C1gZcP+jL._SL75_.jpg", - "medium": "https://m.media-amazon.com/images/I/41C1gZcP+jL._SL160_.jpg", - "large": "https://m.media-amazon.com/images/I/41C1gZcP+jL.jpg", - "cropped": { - "small": [ - "https://m.media-amazon.com/images/I/41C1gZcP+jL._AC75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/41C1gZcP+jL._AC160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/41C1gZcP+jL._AC_.jpg" - ] - }, - "variants": null - }, - "trade_in": null, - "prices": { - "price": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "savings": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "percentage": null - } - }, - "pvp": { - "value": null, - "currency": null, - "per_unit": null, - "display": null - }, - "availability": { - "max_order_quantity": null, - "min_order_quantity": null, - "type": null, - "message": null - }, - "condition": null, - "merchant": { - "default_shipping_country": null, - "merchant_id": null, - "name": null - }, - "other": { - "buybox_winner": null, - "loyalty_points": null, - "amazon_fulfilled": null, - "free_shipping_eligible": null, - "prime_eligible": null, - "prime_exclusive": null, - "prime_pantry": null, - "violates_map": null, - "offer_id": null - } - }, - "offers_summary": null - }, - { - "asin": "3844530533", - "parent_asin": null, - "title": "Harry Potter. Die große Box zum Jubiläum. Alle 7 Bände.: Gelesen von Rufus Beck", - "url": "https://www.amazon.de/dp/3844530533?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": null, - "languages": [ - "Deutsch Veröffentlicht", - "Deutsch Originalsprache" - ], - "formats": [ - "Hörbuch", - "MP3-Audio", - "Ungekürzte Ausgabe" - ], - "pages_count": null, - "color": "Brown", - "unit_count": null, - "size": null, - "dimensions": { - "height": { - "value": 5.9055, - "unit": "Zoll" - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": 2.91338, - "unit": "Zoll" - } - }, - "weight": { - "value": 1.9290447925, - "unit": "Pfund" - } - }, - "info": { - "contributors": [ - { - "name": "Rowling, J.K.", - "role": "Autor" - }, - { - "name": "Kübrich, Angela", - "role": "Regisseur" - }, - { - "name": "Beck, Rufus", - "role": "Sprecher" - }, - { - "name": "Fritz, Klaus", - "role": "Übersetzer" - } - ], - "manufacturer": "der Hörverlag", - "brand": "Dhv Der Hörverlag", - "model": null, - "part_number": "52391587", - "product_group": "Book", - "binding": "MP3 CD", - "is_adult": null, - "audience_rating": null, - "edition": "Ungekürzte Lesung", - "warranty": null, - "publication_date": "2018-08-27T00:00:01Z", - "release_date": "2018-08-27T00:00:01Z", - "external_ids": { - "ean": [ - "9783844530537" - ], - "isbn": [ - "3844530533" - ], - "upc": null - } - }, - "images": { - "small": "https://m.media-amazon.com/images/I/61RlR8Q3lKL._SL75_.jpg", - "medium": "https://m.media-amazon.com/images/I/61RlR8Q3lKL._SL160_.jpg", - "large": "https://m.media-amazon.com/images/I/61RlR8Q3lKL.jpg", - "cropped": { - "small": [ - "https://m.media-amazon.com/images/I/61RlR8Q3lKL._AC75_.jpg", - "https://m.media-amazon.com/images/I/6157JFrGCCL._AC75_.jpg", - "https://m.media-amazon.com/images/I/61Vws0MNp5L._AC75_.jpg", - "https://m.media-amazon.com/images/I/615runZ4PGL._AC75_.jpg", - "https://m.media-amazon.com/images/I/61k89qbVUoL._AC75_.jpg", - "https://m.media-amazon.com/images/I/61GwCV3BfBL._AC75_.jpg", - "https://m.media-amazon.com/images/I/615Aj-qvOSL._AC75_.jpg", - "https://m.media-amazon.com/images/I/61xpdNEL1RL._AC75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/61RlR8Q3lKL._AC160_.jpg", - "https://m.media-amazon.com/images/I/6157JFrGCCL._AC160_.jpg", - "https://m.media-amazon.com/images/I/61Vws0MNp5L._AC160_.jpg", - "https://m.media-amazon.com/images/I/615runZ4PGL._AC160_.jpg", - "https://m.media-amazon.com/images/I/61k89qbVUoL._AC160_.jpg", - "https://m.media-amazon.com/images/I/61GwCV3BfBL._AC160_.jpg", - "https://m.media-amazon.com/images/I/615Aj-qvOSL._AC160_.jpg", - "https://m.media-amazon.com/images/I/61xpdNEL1RL._AC160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/61RlR8Q3lKL._AC_.jpg", - "https://m.media-amazon.com/images/I/6157JFrGCCL._AC_.jpg", - "https://m.media-amazon.com/images/I/61Vws0MNp5L._AC_.jpg", - "https://m.media-amazon.com/images/I/615runZ4PGL._AC_.jpg", - "https://m.media-amazon.com/images/I/61k89qbVUoL._AC_.jpg", - "https://m.media-amazon.com/images/I/61GwCV3BfBL._AC_.jpg", - "https://m.media-amazon.com/images/I/615Aj-qvOSL._AC_.jpg", - "https://m.media-amazon.com/images/I/61xpdNEL1RL._AC_.jpg" - ] - }, - "variants": { - "small": [ - "https://m.media-amazon.com/images/I/6157JFrGCCL._SL75_.jpg", - "https://m.media-amazon.com/images/I/61Vws0MNp5L._SL75_.jpg", - "https://m.media-amazon.com/images/I/615runZ4PGL._SL75_.jpg", - "https://m.media-amazon.com/images/I/61k89qbVUoL._SL75_.jpg", - "https://m.media-amazon.com/images/I/61GwCV3BfBL._SL75_.jpg", - "https://m.media-amazon.com/images/I/615Aj-qvOSL._SL75_.jpg", - "https://m.media-amazon.com/images/I/61xpdNEL1RL._SL75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/6157JFrGCCL._SL160_.jpg", - "https://m.media-amazon.com/images/I/61Vws0MNp5L._SL160_.jpg", - "https://m.media-amazon.com/images/I/615runZ4PGL._SL160_.jpg", - "https://m.media-amazon.com/images/I/61k89qbVUoL._SL160_.jpg", - "https://m.media-amazon.com/images/I/61GwCV3BfBL._SL160_.jpg", - "https://m.media-amazon.com/images/I/615Aj-qvOSL._SL160_.jpg", - "https://m.media-amazon.com/images/I/61xpdNEL1RL._SL160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/6157JFrGCCL.jpg", - "https://m.media-amazon.com/images/I/61Vws0MNp5L.jpg", - "https://m.media-amazon.com/images/I/615runZ4PGL.jpg", - "https://m.media-amazon.com/images/I/61k89qbVUoL.jpg", - "https://m.media-amazon.com/images/I/61GwCV3BfBL.jpg", - "https://m.media-amazon.com/images/I/615Aj-qvOSL.jpg", - "https://m.media-amazon.com/images/I/61xpdNEL1RL.jpg" - ] - } - }, - "trade_in": null, - "prices": { - "price": { - "value": 62.45, - "currency": "EUR", - "per_unit": null, - "display": "62,45 €", - "savings": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "percentage": null - } - }, - "pvp": { - "value": null, - "currency": null, - "per_unit": null, - "display": null - }, - "availability": { - "max_order_quantity": null, - "min_order_quantity": 1, - "type": "Now", - "message": "Auf Lager." - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": "New", - "sub_condition_display": null - }, - "merchant": { - "default_shipping_country": null, - "merchant_id": "A3JWKAKR8XB7XF", - "name": "Amazon.de" - }, - "other": { - "buybox_winner": true, - "loyalty_points": null, - "amazon_fulfilled": true, - "free_shipping_eligible": true, - "prime_eligible": true, - "prime_exclusive": false, - "prime_pantry": false, - "violates_map": false, - "offer_id": "Cbs%2BK1qemv7y%2Bgb%2F3benH1lef5bBgwd%2BjVW%2F%2FmC9A8JClwu0g%2F9aAGodE5DuKYnLIEG00yxFMHefA5fN3K4e0pNK%2FOyhha3Gak7Lq%2BD1r1U%3D" - } - }, - "offers_summary": [ - { - "highest_price": { - "value": 131.61, - "currency": "EUR", - "per_unit": null, - "display": "131,61 €" - }, - "lowest_price": { - "value": 62.45, - "currency": "EUR", - "per_unit": null, - "display": "62,45 €" - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 31 - }, - { - "highest_price": { - "value": 99.0, - "currency": "EUR", - "per_unit": null, - "display": "99,00 €" - }, - "lowest_price": { - "value": 78.44, - "currency": "EUR", - "per_unit": null, - "display": "78,44 €" - }, - "condition": { - "condition": "Used", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 2 - } - ] - }, - { - "asin": "B07ZVXCJ2Z", - "parent_asin": null, - "title": "Harry Potter Winter Socken - 1 Paar Kuschelsocken Flauschige - Damen Mädchen Herren Hausschuhsocken mit Rutschfester ABS Sohle und Flauschigem Sherpa-Futter Warm Kuschelig Thermosocken - Größe 36-41", - "url": "https://www.amazon.de/dp/B07ZVXCJ2Z?tag=dw05c-21&linkCode=osi&th=1&psc=1", - "product": { - "features": [ - "✔ WARM UND AUSSEN RUTSCHSICHER --- Alle die ständig kalte Füße haben sollten etwas dagegen tu. Diese dick gestrickte Wintersocken ist durch ihren hohen sherpa anteil sehr angenehm zu tragen und mit einer rutsch festen. Sie können unsere Socken als Geburtstags- und Weihnachtsgeschenk wählen, um Dankbarkeit und Sorge für Ihre Mutter, Freundin, Tochter, Frau auszudrücken.", - "✔ HARRY POTTER ZUBEHÖR --- Harry Potter Official Gryffindor Damen Socken Winter Der Markenname: Harry Potter Qualitätsprodukt Ideal als Geschenk von Warner Bros Entertainment Studios.", - "✔ MIT FLAUSCHIGEM SHERPA-FUTTER --- die kuschelig weiche Socke mit extra sherpa angerauter Innenseite Sie warm halten. Originelle Geschenkideen für Männer und Frauen", - "🌱 PRIME QUALITÄT --- Jedes Paar Socken Damen ist mit den besten Materialien hergestellt, um eine dauerhafte Verwendung zu gewährleisten und um mehrere Wäschen zu überstehen, ohne seinen Charme zu verlieren, um eine dauerhafte Verwendung zu gewährleisten.", - "🎁 PERFEKTES HARRY POTTER GESCHENK --- Eine wunderschöne Geschenkidee für Frauen. Diese Dicken Wintersocken halten super warm und sind angenehm zu tragen. Wir lieben die Gryffindor Farben. Harry Potter Fans, Kinder oder Erwachsene werden diesen Entwurf lieben. Ein tolles Geschenk für einen Geburtstag oder Weihnachten." - ], - "languages": null, - "formats": null, - "pages_count": null, - "color": "Orange", - "unit_count": null, - "size": "Einheitsgröße", - "dimensions": { - "height": { - "value": null, - "unit": null - }, - "length": { - "value": null, - "unit": null - }, - "width": { - "value": null, - "unit": null - } - }, - "weight": { - "value": null, - "unit": null - } - }, - "info": { - "contributors": null, - "manufacturer": null, - "brand": "Harry Potter", - "model": null, - "part_number": null, - "product_group": "Apparel", - "binding": "Textilien", - "is_adult": false, - "audience_rating": null, - "edition": null, - "warranty": null, - "publication_date": null, - "release_date": null, - "external_ids": { - "ean": [ - "5056225437287" - ], - "isbn": null, - "upc": null - } - }, - "images": { - "small": "https://m.media-amazon.com/images/I/51mA2YyGIkL._SL75_.jpg", - "medium": "https://m.media-amazon.com/images/I/51mA2YyGIkL._SL160_.jpg", - "large": "https://m.media-amazon.com/images/I/51mA2YyGIkL.jpg", - "cropped": { - "small": [ - "https://m.media-amazon.com/images/I/51mA2YyGIkL._AC75_.jpg", - "https://m.media-amazon.com/images/I/51auRlS+nYL._AC75_.jpg", - "https://m.media-amazon.com/images/I/51jCCVOcIdL._AC75_.jpg", - "https://m.media-amazon.com/images/I/51VV8lB9YxL._AC75_.jpg", - "https://m.media-amazon.com/images/I/51N9aRjaxvL._AC75_.jpg", - "https://m.media-amazon.com/images/I/51GMI-RPS6L._AC75_.jpg", - "https://m.media-amazon.com/images/I/51ed4kcuQ3L._AC75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/51mA2YyGIkL._AC160_.jpg", - "https://m.media-amazon.com/images/I/51auRlS+nYL._AC160_.jpg", - "https://m.media-amazon.com/images/I/51jCCVOcIdL._AC160_.jpg", - "https://m.media-amazon.com/images/I/51VV8lB9YxL._AC160_.jpg", - "https://m.media-amazon.com/images/I/51N9aRjaxvL._AC160_.jpg", - "https://m.media-amazon.com/images/I/51GMI-RPS6L._AC160_.jpg", - "https://m.media-amazon.com/images/I/51ed4kcuQ3L._AC160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/51mA2YyGIkL._AC_.jpg", - "https://m.media-amazon.com/images/I/51auRlS+nYL._AC_.jpg", - "https://m.media-amazon.com/images/I/51jCCVOcIdL._AC_.jpg", - "https://m.media-amazon.com/images/I/51VV8lB9YxL._AC_.jpg", - "https://m.media-amazon.com/images/I/51N9aRjaxvL._AC_.jpg", - "https://m.media-amazon.com/images/I/51GMI-RPS6L._AC_.jpg", - "https://m.media-amazon.com/images/I/51ed4kcuQ3L._AC_.jpg" - ] - }, - "variants": { - "small": [ - "https://m.media-amazon.com/images/I/51auRlS+nYL._SL75_.jpg", - "https://m.media-amazon.com/images/I/51jCCVOcIdL._SL75_.jpg", - "https://m.media-amazon.com/images/I/51VV8lB9YxL._SL75_.jpg", - "https://m.media-amazon.com/images/I/51N9aRjaxvL._SL75_.jpg", - "https://m.media-amazon.com/images/I/51GMI-RPS6L._SL75_.jpg", - "https://m.media-amazon.com/images/I/51ed4kcuQ3L._SL75_.jpg" - ], - "medium": [ - "https://m.media-amazon.com/images/I/51auRlS+nYL._SL160_.jpg", - "https://m.media-amazon.com/images/I/51jCCVOcIdL._SL160_.jpg", - "https://m.media-amazon.com/images/I/51VV8lB9YxL._SL160_.jpg", - "https://m.media-amazon.com/images/I/51N9aRjaxvL._SL160_.jpg", - "https://m.media-amazon.com/images/I/51GMI-RPS6L._SL160_.jpg", - "https://m.media-amazon.com/images/I/51ed4kcuQ3L._SL160_.jpg" - ], - "large": [ - "https://m.media-amazon.com/images/I/51auRlS+nYL.jpg", - "https://m.media-amazon.com/images/I/51jCCVOcIdL.jpg", - "https://m.media-amazon.com/images/I/51VV8lB9YxL.jpg", - "https://m.media-amazon.com/images/I/51N9aRjaxvL.jpg", - "https://m.media-amazon.com/images/I/51GMI-RPS6L.jpg", - "https://m.media-amazon.com/images/I/51ed4kcuQ3L.jpg" - ] - } - }, - "trade_in": null, - "prices": { - "price": { - "value": 14.95, - "currency": "EUR", - "per_unit": null, - "display": "14,95 €", - "savings": { - "value": null, - "currency": null, - "per_unit": null, - "display": null, - "percentage": null - } - }, - "pvp": { - "value": null, - "currency": null, - "per_unit": null, - "display": null - }, - "availability": { - "max_order_quantity": null, - "min_order_quantity": 1, - "type": "Now", - "message": "Auf Lager." - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": "New", - "sub_condition_display": null - }, - "merchant": { - "default_shipping_country": "GB", - "merchant_id": "A3EILMNSO2CTEL", - "name": "F & F Stores" - }, - "other": { - "buybox_winner": true, - "loyalty_points": null, - "amazon_fulfilled": true, - "free_shipping_eligible": true, - "prime_eligible": true, - "prime_exclusive": false, - "prime_pantry": false, - "violates_map": false, - "offer_id": "Cbs%2BK1qemv58L5GvBnRjSk%2FSyA5Lz%2BcJPnxeFRs4B4i6Xm%2BnWT8bIHQ09GnQ93p4yfneDfDh3w1dTm%2BtxygZkum4yQWQ5uH%2BS74LCnWOhraY3423FSa2Nj%2F94j%2F%2FzNQMyNgHMasOXCCIs4b%2BrcJbww%3D%3D" - } - }, - "offers_summary": [ - { - "highest_price": { - "value": 14.95, - "currency": "EUR", - "per_unit": null, - "display": "14,95 €" - }, - "lowest_price": { - "value": 14.95, - "currency": "EUR", - "per_unit": null, - "display": "14,95 €" - }, - "condition": { - "condition": "New", - "condition_display": null, - "sub_condition": null, - "sub_condition_display": null - }, - "offer_count": 1 - } - ] - } -] From 7451afe610f1f9074bda720274de152760968a8d Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Mon, 12 Jul 2021 21:13:07 +0200 Subject: [PATCH 52/67] Added BrowseNode model --- amazon_paapi/api.py | 2 +- amazon_paapi/helpers/requests.py | 3 ++- amazon_paapi/models/__init__.py | 1 + amazon_paapi/models/browse_nodes_result.py | 20 ++++++++++++++++++++ 4 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 amazon_paapi/models/browse_nodes_result.py diff --git a/amazon_paapi/api.py b/amazon_paapi/api.py index ca8f97e..b2826da 100644 --- a/amazon_paapi/api.py +++ b/amazon_paapi/api.py @@ -262,7 +262,7 @@ def get_variations(self, def get_browse_nodes(self, browse_node_ids: list[str], languages_of_preference: list[str] = None, - **kwargs): + **kwargs) -> list[models.BrowseNode]: """Get browse nodes information from Amazon. Args: diff --git a/amazon_paapi/helpers/requests.py b/amazon_paapi/helpers/requests.py index 9305ddf..d457078 100644 --- a/amazon_paapi/helpers/requests.py +++ b/amazon_paapi/helpers/requests.py @@ -6,6 +6,7 @@ from ..models.api_item import Item from ..models.search_result import SearchResult from ..models.variations_result import VariationsResult +from ..models.browse_nodes_result import BrowseNode from ..errors import ApiRequestException, ItemsNotFoudException, MalformedRequestException from ..sdk.models.partner_type import PartnerType from ..sdk.models.get_items_resource import GetItemsResource @@ -99,7 +100,7 @@ def get_browse_nodes_request(amazon_api, **kwargs) -> GetBrowseNodesRequest: raise MalformedRequestException('Parameters for get_browse_nodes request are not correct: ' + str(e)) -def get_browse_nodes_response(amazon_api, request: GetBrowseNodesRequest) -> list[Item]: +def get_browse_nodes_response(amazon_api, request: GetBrowseNodesRequest) -> list[BrowseNode]: try: response = amazon_api._api.get_browse_nodes(request) except ApiException as e: diff --git a/amazon_paapi/models/__init__.py b/amazon_paapi/models/__init__.py index 2b2bb4a..06a2327 100644 --- a/amazon_paapi/models/__init__.py +++ b/amazon_paapi/models/__init__.py @@ -1,5 +1,6 @@ from .regions import Country from .api_item import Item from .search_result import SearchResult +from .browse_nodes_result import BrowseNode from .variations_result import VariationsResult from ..sdk.models import Availability, Condition, Merchant, SortBy diff --git a/amazon_paapi/models/browse_nodes_result.py b/amazon_paapi/models/browse_nodes_result.py new file mode 100644 index 0000000..01e55ed --- /dev/null +++ b/amazon_paapi/models/browse_nodes_result.py @@ -0,0 +1,20 @@ +from ..sdk import models + + +class BrowseNodeChild(models.BrowseNodeChild): + context_free_name: str + display_name: str + id: str + + +class BrowseNodeAncestor(BrowseNodeChild, models.BrowseNodeAncestor): + ancestor: BrowseNodeChild + + +class BrowseNode(models.BrowseNode): + display_name: str + id: str + is_root: bool + context_free_name: str + children: list[BrowseNodeChild] + ancestor: BrowseNodeAncestor From 3b5cfa3cc1450b5feac7c8622434ff2af6db27a7 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Tue, 13 Jul 2021 18:18:32 +0200 Subject: [PATCH 53/67] Adjusted item_result name --- amazon_paapi/helpers/requests.py | 2 +- amazon_paapi/models/__init__.py | 2 +- amazon_paapi/models/{api_item.py => item_result.py} | 12 ++++++------ amazon_paapi/models/search_result.py | 2 +- amazon_paapi/models/variations_result.py | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) rename amazon_paapi/models/{api_item.py => item_result.py} (100%) diff --git a/amazon_paapi/helpers/requests.py b/amazon_paapi/helpers/requests.py index d457078..41791c9 100644 --- a/amazon_paapi/helpers/requests.py +++ b/amazon_paapi/helpers/requests.py @@ -3,7 +3,7 @@ from ..sdk.models.get_browse_nodes_resource import GetBrowseNodesResource from ..sdk.models.get_browse_nodes_request import GetBrowseNodesRequest -from ..models.api_item import Item +from ..models.item_result import Item from ..models.search_result import SearchResult from ..models.variations_result import VariationsResult from ..models.browse_nodes_result import BrowseNode diff --git a/amazon_paapi/models/__init__.py b/amazon_paapi/models/__init__.py index 06a2327..dd7ee13 100644 --- a/amazon_paapi/models/__init__.py +++ b/amazon_paapi/models/__init__.py @@ -1,5 +1,5 @@ from .regions import Country -from .api_item import Item +from .item_result import Item from .search_result import SearchResult from .browse_nodes_result import BrowseNode from .variations_result import VariationsResult diff --git a/amazon_paapi/models/api_item.py b/amazon_paapi/models/item_result.py similarity index 100% rename from amazon_paapi/models/api_item.py rename to amazon_paapi/models/item_result.py index 4e06e72..13f8100 100644 --- a/amazon_paapi/models/api_item.py +++ b/amazon_paapi/models/item_result.py @@ -209,14 +209,14 @@ class ApiBrowseNodeInfo(models.BrowseNodeInfo): """Main model""" class Item(models.Item): - item_info: ApiItemInfo - images: ApiImages - offers: ApiOffers - browse_node_info: ApiBrowseNodeInfo asin: str + browse_node_info: ApiBrowseNodeInfo + customer_reviews: models.CustomerReviews detail_page_url: str + images: ApiImages + item_info: ApiItemInfo + offers: ApiOffers parent_asin: str - score: float rental_offers: models.RentalOffers - customer_reviews: models.CustomerReviews + score: float variation_attributes: list[models.VariationAttribute] diff --git a/amazon_paapi/models/search_result.py b/amazon_paapi/models/search_result.py index cf0063b..c922282 100644 --- a/amazon_paapi/models/search_result.py +++ b/amazon_paapi/models/search_result.py @@ -1,4 +1,4 @@ -from .api_item import Item +from .item_result import Item from ..sdk.models import SearchResult class SearchResult(SearchResult): diff --git a/amazon_paapi/models/variations_result.py b/amazon_paapi/models/variations_result.py index ae97f34..fb0c07c 100644 --- a/amazon_paapi/models/variations_result.py +++ b/amazon_paapi/models/variations_result.py @@ -1,4 +1,4 @@ -from .api_item import Item +from .item_result import Item from ..sdk.models import VariationsResult, VariationSummary class ApiPrice: From c1be36149a1b6c94574a7d0e588527e42e535b42 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Tue, 13 Jul 2021 18:23:31 +0200 Subject: [PATCH 54/67] Adjusted imports order --- amazon_paapi/helpers/requests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/amazon_paapi/helpers/requests.py b/amazon_paapi/helpers/requests.py index 41791c9..56b488b 100644 --- a/amazon_paapi/helpers/requests.py +++ b/amazon_paapi/helpers/requests.py @@ -1,8 +1,6 @@ """Module with helper functions for creating requests.""" -from ..sdk.models.get_browse_nodes_resource import GetBrowseNodesResource -from ..sdk.models.get_browse_nodes_request import GetBrowseNodesRequest from ..models.item_result import Item from ..models.search_result import SearchResult from ..models.variations_result import VariationsResult @@ -15,6 +13,8 @@ from ..sdk.models.search_items_request import SearchItemsRequest from ..sdk.models.get_variations_resource import GetVariationsResource from ..sdk.models.get_variations_request import GetVariationsRequest +from ..sdk.models.get_browse_nodes_resource import GetBrowseNodesResource +from ..sdk.models.get_browse_nodes_request import GetBrowseNodesRequest from ..sdk.rest import ApiException import inspect From e9be3bf008f87c36b9c1b0b0b6d39056e7a9a24a Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Tue, 13 Jul 2021 18:29:53 +0200 Subject: [PATCH 55/67] Solved bug in variations request --- amazon_paapi/helpers/requests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/amazon_paapi/helpers/requests.py b/amazon_paapi/helpers/requests.py index 56b488b..618930c 100644 --- a/amazon_paapi/helpers/requests.py +++ b/amazon_paapi/helpers/requests.py @@ -86,7 +86,7 @@ def get_variations_response(amazon_api, request: GetVariationsRequest) -> Variat if response.variations_result == None: raise ItemsNotFoudException('No variation items have been found') - return response.variations_result.items + return response.variations_result def get_browse_nodes_request(amazon_api, **kwargs) -> GetBrowseNodesRequest: From 5a115e0d44617330825902dc48cf9d22d33297e7 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Tue, 13 Jul 2021 18:34:03 +0200 Subject: [PATCH 56/67] Changed imports in main file --- amazon_paapi/api.py | 30 ++++++++++++++---------------- amazon_paapi/helpers/__init__.py | 0 2 files changed, 14 insertions(+), 16 deletions(-) create mode 100644 amazon_paapi/helpers/__init__.py diff --git a/amazon_paapi/api.py b/amazon_paapi/api.py index b2826da..675668e 100644 --- a/amazon_paapi/api.py +++ b/amazon_paapi/api.py @@ -9,10 +9,8 @@ from . import models from .sdk.api.default_api import DefaultApi from .errors import InvalidArgumentException -from .helpers.arguments import check_browse_nodes_args, check_search_args, check_variations_args, get_items_ids -from .helpers.requests import (get_browse_nodes_request, get_browse_nodes_response, get_items_request, - get_items_response, get_search_items_request, get_search_items_response, - get_variations_request, get_variations_response) +from .helpers import arguments +from .helpers import requests from .helpers.generators import get_list_chunks from typing import Union @@ -92,13 +90,13 @@ def get_items(self, 'languages_of_preference': languages_of_preference }) - items_ids = get_items_ids(items) + items_ids = arguments.get_items_ids(items) results = [] for asin_chunk in get_list_chunks(items_ids, chunk_size=10): - request = get_items_request(self, asin_chunk, **kwargs) + request = requests.get_items_request(self, asin_chunk, **kwargs) self._throttle() - items_response = get_items_response(self, request) + items_response = requests.get_items_response(self, request) results.extend(items_response) return results @@ -203,10 +201,10 @@ def search_items(self, 'sort_by': sort_by, }) - check_search_args(**kwargs) - request = get_search_items_request(self, **kwargs) + arguments.check_search_args(**kwargs) + request = requests.get_search_items_request(self, **kwargs) self._throttle() - return get_search_items_response(self, request) + return requests.get_search_items_response(self, request) def get_variations(self, @@ -253,10 +251,10 @@ def get_variations(self, 'merchant': merchant }) - check_variations_args(**kwargs) - request = get_variations_request(self, **kwargs) + arguments.check_variations_args(**kwargs) + request = requests.get_variations_request(self, **kwargs) self._throttle() - return get_variations_response(self, request) + return requests.get_variations_response(self, request) def get_browse_nodes(self, @@ -279,10 +277,10 @@ def get_browse_nodes(self, 'languages_of_preference': languages_of_preference }) - check_browse_nodes_args(**kwargs) - request = get_browse_nodes_request(self, **kwargs) + arguments.check_browse_nodes_args(**kwargs) + request = requests.get_browse_nodes_request(self, **kwargs) self._throttle() - return get_browse_nodes_response(self, request) + return requests.get_browse_nodes_response(self, request) def _throttle(self): diff --git a/amazon_paapi/helpers/__init__.py b/amazon_paapi/helpers/__init__.py new file mode 100644 index 0000000..e69de29 From ac9649055df6021306b94dce54c66c67e93a5fa7 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Tue, 13 Jul 2021 18:54:27 +0200 Subject: [PATCH 57/67] Finished docstrings for all methods --- amazon_paapi/api.py | 93 +++++++++++++++++++++++++-------------------- 1 file changed, 52 insertions(+), 41 deletions(-) diff --git a/amazon_paapi/api.py b/amazon_paapi/api.py index 675668e..da625f6 100644 --- a/amazon_paapi/api.py +++ b/amazon_paapi/api.py @@ -1,8 +1,6 @@ """Amazon Product Advertising API wrapper for Python A simple Python wrapper for the last version of the Amazon Product Advertising API. -This module allows to get product information from Amazon using the official API in -an easier way. """ @@ -26,7 +24,7 @@ class AmazonApi: tag (``str``): Your affiliate tracking id, used to create the affiliate link. country (``models.Country``): Country code for your affiliate account. throttling (``float``, optional): Wait time in seconds between API calls. Use it to avoid - reaching Amazon limits. Defaults to ``1`` second. + reaching Amazon limits. Defaults to 1 second. Raises: ``InvalidArgumentException`` @@ -64,9 +62,9 @@ def get_items(self, items (``str`` | ``list[str]``): One or more items, using ASIN or product URL. Items in string format should be separated by commas. condition (``models.Condition``, optional): Filters offers by condition type. - Defaults to ``Any``. + Defaults to Any. merchant (``models.Merchant``, optional): Filters search results to return items having - at least one offer sold by target merchant. Defaults to ``All``. + at least one offer sold by target merchant. Defaults to All. currency_of_preference (``str``, optional): Currency of preference in which the prices information should be returned. Expected currency code format is ISO 4217. languages_of_preference (``list[str]``, optional): Languages in order of preference in @@ -74,7 +72,7 @@ def get_items(self, kwargs (``dict``, optional): Any other arguments to be passed to the Amazon API. Returns: - ``list[ApiItem]``: A list of items with Amazon information. + ``list[models.Item]``: A list of items with Amazon information. Raises: ``InvalidArgumentException`` @@ -130,10 +128,10 @@ def search_items(self, ``brand`` or ``title``. Args: - item_count (``int``, optional): Number of items returned. Should be between ``1`` and ``10``. - Defaults to ``10``. + item_count (``int``, optional): Number of items returned. Should be between 1 and 10. + Defaults to 10. item_page (``int``, optional): The specific page of items to be returned from the available - results. Should be between ``1`` and ``10``. Defaults to ``1``. + results. Should be between 1 and 10. Defaults to 1. actor (``str``, optional): Actor name associated with the item. artist (``str``, optional): Artist name associated with the item. author (``str``, optional): Author name associated with the item. @@ -141,34 +139,34 @@ def search_items(self, keywords (``str``, optional): A word or phrase that describes an item. title (``str``, optional): Title associated with the item. availability (``models.Availability``, optional): Filters available items on Amazon. - Defaults to ``Available``. + Defaults to Available. browse_node_id (``str``, optional): A unique ID assigned by Amazon that identifies a product category or subcategory. - condition (``models.Condition``, optional): Filters offers by condition type. Defaults to ``Any``. + condition (``models.Condition``, optional): Filters offers by condition type. Defaults to Any. currency_of_preference (``str``, optional): Currency of preference in which the prices information should be returned. Expected currency code format is ISO 4217. delivery_flags (``list[str]``): Filters items which satisfy a certain delivery program. languages_of_preference (``list[str]``, optional): Languages in order of preference in which the item information should be returned. merchant (``models.Merchant``, optional): Filters search results to return items having - at least one offer sold by target merchant. Defaults to ``All``. + at least one offer sold by target merchant. Defaults to All. max_price (``int``, optional): Filters search results to items with at least one offer price below the specified value. Prices appear in lowest currency denomination. - For example, $31.41 should be passed as ``3141`` or 28.00€ should be ``2800``. + For example, $31.41 should be passed as 3141 or 28.00€ should be 2800. min_price (``int``, optional): Filters search results to items with at least one offer price above the specified value. Prices appear in lowest currency denomination. - For example, $31.41 should be passed as ``3141`` or 28.00€ should be ``2800``. + For example, $31.41 should be passed as 3141 or 28.00€ should be 2800. min_saving_percent (``int``, optional): Filters search results to items with at least one offer having saving percentage above the specified value. Value should be - ``positive integer less than 100``. + positive integer less than 100. min_reviews_rating (``int``, optional): Filters search results to items with customer review - ratings above specified value. Value should be ``positive integer less than 5``. - search_index (``str``, optional): Indicates the product category to search. Defaults to ``All``. + ratings above specified value. Value should be positive integer less than 5. + search_index (``str``, optional): Indicates the product category to search. Defaults to All. sort_by (``models.SortBy``, optional): The way in which items are sorted. kwargs (``dict``, optional): Any other arguments to be passed to the Amazon API. Returns: - ``list[ApiItem]``: A list of items with Amazon information. + ``models.SearchResult``: The search result containing the list of items. Raises: ``InvalidArgumentException`` @@ -217,30 +215,35 @@ def get_variations(self, merchant: models.Merchant = None, **kwargs) -> models.VariationsResult: """Returns a set of items that are the same product, but differ according to a - consistent theme, for example size and color. + consistent theme, for example size and color. A variation is a child ASIN. Args: - asin (str): One item ID like ASIN or product URL. - item_count (int, optional): The total number of products to get. Should be between - 1 and 100. Defaults to 10. - item_page (int, optional): The page where the results start from. Should be between - 1 and 10. Defaults to 1. - items_per_page (int, optional): Products on each page. Should be between - 1 and 10. Defaults to 10. - condition (str, optional): The condition parameter filters offers by - condition type. Allowed values: Any, Collectible, New, Refurbished, Used. - Defaults to Any. - merchant (str, optional): Filters search results to return items - having at least one offer sold by target merchant. Allowed values: - All, Amazon. Defaults to All. - async_req (bool, optional): Specify if a thread should be created to - run the request. Defaults to False. + asin (``str``): One item, using ASIN or product URL. + variation_count (``int``, optional): Number of items returned. Should be between 1 and 10. + Defaults to 10. + variation_page (``int``, optional): The specific page of items to be returned from the available + results. Should be between 1 and 10. Defaults to 1. + condition (``models.Condition``, optional): Filters offers by condition type. Defaults to Any. + currency_of_preference (``str``, optional): Currency of preference in which the prices + information should be returned. Expected currency code format is ISO 4217. + languages_of_preference (``list[str]``, optional): Languages in order of preference in + which the item information should be returned. + merchant (``models.Merchant``, optional): Filters search results to return items having + at least one offer sold by target merchant. Defaults to All. + kwargs (``dict``, optional): Any other arguments to be passed to the Amazon API. Returns: - list of instances: A list containing 1 instance for each product - or None if no results. + ``models.VariationsResult``: The variations result containing the list of items. + + Raises: + ``InvalidArgumentException`` + ``MalformedRequestException`` + ``ApiRequestException`` + ``ItemsNotFoudException`` """ + asin = arguments.get_items_ids(asin)[0] + kwargs.update({ 'asin': asin, 'variation_count': variation_count, @@ -261,15 +264,23 @@ def get_browse_nodes(self, browse_node_ids: list[str], languages_of_preference: list[str] = None, **kwargs) -> list[models.BrowseNode]: - """Get browse nodes information from Amazon. + """Returns the specified browse node's information like name, children and ancestors. Args: - browse_nodes (list): List of strings containing the browse node ids. - async_req (bool, optional): Specify if a thread should be created to - run the request. Defaults to False. + browse_node_ids (``list[str]``): List of browse node ids. A browse node id is a unique + ID assigned by Amazon that identifies a product category/sub-category. + languages_of_preference (``list[str]``, optional): Languages in order of preference in + which the item information should be returned. + kwargs (``dict``, optional): Any other arguments to be passed to the Amazon API. Returns: - dict: A dictionary containing the browse node information. + ``list[models.BrowseNode]``: A list of browse nodes. + + Raises: + ``InvalidArgumentException`` + ``MalformedRequestException`` + ``ApiRequestException`` + ``ItemsNotFoudException`` """ kwargs.update({ From 169a18e56042a22e415c5ee741cf47d3e2db2c15 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Tue, 13 Jul 2021 18:54:42 +0200 Subject: [PATCH 58/67] Added raise exception if not ASIN is found --- amazon_paapi/helpers/arguments.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/amazon_paapi/helpers/arguments.py b/amazon_paapi/helpers/arguments.py index f23a355..5386de5 100644 --- a/amazon_paapi/helpers/arguments.py +++ b/amazon_paapi/helpers/arguments.py @@ -2,7 +2,7 @@ from ..tools import get_asin -from ..errors import InvalidArgumentException +from ..errors import InvalidArgumentException, AsinNotFoundException from typing import Union @@ -12,10 +12,15 @@ def get_items_ids(items: Union[str, list[str]]) -> list[str]: if isinstance(items, str): items_ids = items.split(',') - return [get_asin(x.strip()) for x in items_ids] + items_ids = [get_asin(x.strip()) for x in items_ids] else: - return [get_asin(x.strip()) for x in items] + items_ids = [get_asin(x.strip()) for x in items] + + if items_ids: + return items_ids + else: + raise AsinNotFoundException('No ASIN codes have been found.') def check_search_args(**kwargs): From 8eaf0f02d4a4ab8bbdc3a89c923019507af70a0e Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Tue, 13 Jul 2021 19:01:10 +0200 Subject: [PATCH 59/67] Updated version to 4.0.0 and removed examples --- example.py | 8 -------- setup.py | 4 ++-- 2 files changed, 2 insertions(+), 10 deletions(-) delete mode 100644 example.py diff --git a/example.py b/example.py deleted file mode 100644 index e49add1..0000000 --- a/example.py +++ /dev/null @@ -1,8 +0,0 @@ -from amazon_paapi.sdk.models import condition, merchant -from amazon_paapi import AmazonApi -import secrets -from amazon_paapi.models import Condition - -amazon = AmazonApi(secrets.KEY, secrets.SECRET, secrets.TAG, secrets.COUNTRY) -product = amazon.get_items('B01N5IB20Q', condition=Condition.NEW) -print(product[0].item_info.title.display_value) diff --git a/setup.py b/setup.py index 91b35e0..30f5bce 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name='python-amazon-paapi', - version='3.3.4', + version='4.0.0', author='Sergio Abad', author_email='sergio.abad@bytelix.com', description='Amazon Product Advertising API 5.0 wrapper for Python', @@ -24,5 +24,5 @@ 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', ], - python_requires='>=2.7', + python_requires='>=3.6', ) From 4efc91786a3ed0f821846daa482ba41065b61fc9 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Tue, 13 Jul 2021 19:12:42 +0200 Subject: [PATCH 60/67] Added previous version and included warning for deprecated version --- amazon/__init__.py | 4 + amazon/constant.py | 241 ++++++ amazon/exception.py | 11 + amazon/paapi.py | 457 ++++++++++ amazon/parse.py | 550 ++++++++++++ amazon/serializer/dango_rest_framework.py | 156 ++++ amazon/tools.py | 26 + paapi5_python_sdk/COPYING.txt | 202 +++++ paapi5_python_sdk/LICENSE.txt | 202 +++++ paapi5_python_sdk/NOTICE.txt | 2 + paapi5_python_sdk/__init__.py | 123 +++ paapi5_python_sdk/api/__init__.py | 29 + paapi5_python_sdk/api/default_api.py | 428 +++++++++ paapi5_python_sdk/api_client.py | 685 +++++++++++++++ paapi5_python_sdk/auth/__init__.py | 29 + paapi5_python_sdk/auth/sig_v4.py | 149 ++++ paapi5_python_sdk/availability.py | 104 +++ paapi5_python_sdk/browse_node.py | 285 ++++++ paapi5_python_sdk/browse_node_ancestor.py | 204 +++++ paapi5_python_sdk/browse_node_child.py | 178 ++++ paapi5_python_sdk/browse_node_children.py | 100 +++ paapi5_python_sdk/browse_node_info.py | 155 ++++ paapi5_python_sdk/browse_nodes_result.py | 128 +++ paapi5_python_sdk/by_line_info.py | 181 ++++ paapi5_python_sdk/classifications.py | 154 ++++ paapi5_python_sdk/condition.py | 107 +++ paapi5_python_sdk/configuration.py | 230 +++++ paapi5_python_sdk/content_info.py | 208 +++++ paapi5_python_sdk/content_rating.py | 128 +++ paapi5_python_sdk/contributor.py | 178 ++++ paapi5_python_sdk/delivery_flag.py | 106 +++ .../dimension_based_attribute.py | 206 +++++ paapi5_python_sdk/duration_price.py | 155 ++++ paapi5_python_sdk/error_data.py | 152 ++++ paapi5_python_sdk/external_ids.py | 180 ++++ paapi5_python_sdk/get_browse_nodes_request.py | 262 ++++++ .../get_browse_nodes_resource.py | 104 +++ .../get_browse_nodes_response.py | 155 ++++ paapi5_python_sdk/get_items_request.py | 423 +++++++++ paapi5_python_sdk/get_items_resource.py | 157 ++++ paapi5_python_sdk/get_items_response.py | 155 ++++ paapi5_python_sdk/get_variations_request.py | 448 ++++++++++ paapi5_python_sdk/get_variations_resource.py | 160 ++++ paapi5_python_sdk/get_variations_response.py | 155 ++++ paapi5_python_sdk/image_size.py | 178 ++++ paapi5_python_sdk/image_type.py | 180 ++++ paapi5_python_sdk/images.py | 154 ++++ paapi5_python_sdk/item.py | 367 ++++++++ paapi5_python_sdk/item_id_type.py | 103 +++ paapi5_python_sdk/item_info.py | 398 +++++++++ paapi5_python_sdk/items_result.py | 128 +++ paapi5_python_sdk/language_type.py | 152 ++++ paapi5_python_sdk/languages.py | 180 ++++ paapi5_python_sdk/manufacture_info.py | 180 ++++ paapi5_python_sdk/max_price.py | 98 +++ paapi5_python_sdk/merchant.py | 104 +++ paapi5_python_sdk/min_price.py | 98 +++ paapi5_python_sdk/min_reviews_rating.py | 98 +++ paapi5_python_sdk/min_saving_percent.py | 98 +++ paapi5_python_sdk/multi_valued_attribute.py | 178 ++++ paapi5_python_sdk/offer_availability.py | 203 +++++ paapi5_python_sdk/offer_condition.py | 232 +++++ paapi5_python_sdk/offer_count.py | 98 +++ paapi5_python_sdk/offer_delivery_info.py | 206 +++++ paapi5_python_sdk/offer_listing.py | 421 +++++++++ paapi5_python_sdk/offer_loyalty_points.py | 126 +++ paapi5_python_sdk/offer_merchant_info.py | 178 ++++ paapi5_python_sdk/offer_price.py | 232 +++++ .../offer_program_eligibility.py | 152 ++++ paapi5_python_sdk/offer_promotion.py | 255 ++++++ paapi5_python_sdk/offer_savings.py | 230 +++++ paapi5_python_sdk/offer_shipping_charge.py | 229 +++++ paapi5_python_sdk/offer_sub_condition.py | 204 +++++ paapi5_python_sdk/offer_summary.py | 207 +++++ paapi5_python_sdk/offers.py | 155 ++++ paapi5_python_sdk/partner_type.py | 103 +++ paapi5_python_sdk/price.py | 154 ++++ ...roduct_advertising_api_client_exception.py | 128 +++ ...oduct_advertising_api_service_exception.py | 126 +++ paapi5_python_sdk/product_info.py | 261 ++++++ paapi5_python_sdk/properties.py | 83 ++ paapi5_python_sdk/refinement.py | 180 ++++ paapi5_python_sdk/refinement_bin.py | 152 ++++ paapi5_python_sdk/rental_offer_listing.py | 262 ++++++ paapi5_python_sdk/rental_offers.py | 128 +++ paapi5_python_sdk/rest.py | 333 +++++++ paapi5_python_sdk/search_items_request.py | 818 ++++++++++++++++++ paapi5_python_sdk/search_items_resource.py | 158 ++++ paapi5_python_sdk/search_items_response.py | 155 ++++ paapi5_python_sdk/search_refinements.py | 180 ++++ paapi5_python_sdk/search_result.py | 207 +++++ .../single_boolean_valued_attribute.py | 178 ++++ .../single_integer_valued_attribute.py | 178 ++++ .../single_string_valued_attribute.py | 178 ++++ paapi5_python_sdk/sort_by.py | 108 +++ paapi5_python_sdk/technical_info.py | 128 +++ paapi5_python_sdk/trade_in_info.py | 154 ++++ paapi5_python_sdk/trade_in_price.py | 178 ++++ paapi5_python_sdk/unit_based_attribute.py | 204 +++++ paapi5_python_sdk/variation_attribute.py | 152 ++++ paapi5_python_sdk/variation_dimension.py | 204 +++++ paapi5_python_sdk/variation_summary.py | 207 +++++ paapi5_python_sdk/variations_result.py | 155 ++++ paapi5_python_sdk/website_sales_rank.py | 204 +++++ 104 files changed, 19930 insertions(+) create mode 100644 amazon/__init__.py create mode 100644 amazon/constant.py create mode 100644 amazon/exception.py create mode 100644 amazon/paapi.py create mode 100644 amazon/parse.py create mode 100644 amazon/serializer/dango_rest_framework.py create mode 100644 amazon/tools.py create mode 100644 paapi5_python_sdk/COPYING.txt create mode 100644 paapi5_python_sdk/LICENSE.txt create mode 100644 paapi5_python_sdk/NOTICE.txt create mode 100644 paapi5_python_sdk/__init__.py create mode 100644 paapi5_python_sdk/api/__init__.py create mode 100644 paapi5_python_sdk/api/default_api.py create mode 100644 paapi5_python_sdk/api_client.py create mode 100644 paapi5_python_sdk/auth/__init__.py create mode 100644 paapi5_python_sdk/auth/sig_v4.py create mode 100644 paapi5_python_sdk/availability.py create mode 100644 paapi5_python_sdk/browse_node.py create mode 100644 paapi5_python_sdk/browse_node_ancestor.py create mode 100644 paapi5_python_sdk/browse_node_child.py create mode 100644 paapi5_python_sdk/browse_node_children.py create mode 100644 paapi5_python_sdk/browse_node_info.py create mode 100644 paapi5_python_sdk/browse_nodes_result.py create mode 100644 paapi5_python_sdk/by_line_info.py create mode 100644 paapi5_python_sdk/classifications.py create mode 100644 paapi5_python_sdk/condition.py create mode 100644 paapi5_python_sdk/configuration.py create mode 100644 paapi5_python_sdk/content_info.py create mode 100644 paapi5_python_sdk/content_rating.py create mode 100644 paapi5_python_sdk/contributor.py create mode 100644 paapi5_python_sdk/delivery_flag.py create mode 100644 paapi5_python_sdk/dimension_based_attribute.py create mode 100644 paapi5_python_sdk/duration_price.py create mode 100644 paapi5_python_sdk/error_data.py create mode 100644 paapi5_python_sdk/external_ids.py create mode 100644 paapi5_python_sdk/get_browse_nodes_request.py create mode 100644 paapi5_python_sdk/get_browse_nodes_resource.py create mode 100644 paapi5_python_sdk/get_browse_nodes_response.py create mode 100644 paapi5_python_sdk/get_items_request.py create mode 100644 paapi5_python_sdk/get_items_resource.py create mode 100644 paapi5_python_sdk/get_items_response.py create mode 100644 paapi5_python_sdk/get_variations_request.py create mode 100644 paapi5_python_sdk/get_variations_resource.py create mode 100644 paapi5_python_sdk/get_variations_response.py create mode 100644 paapi5_python_sdk/image_size.py create mode 100644 paapi5_python_sdk/image_type.py create mode 100644 paapi5_python_sdk/images.py create mode 100644 paapi5_python_sdk/item.py create mode 100644 paapi5_python_sdk/item_id_type.py create mode 100644 paapi5_python_sdk/item_info.py create mode 100644 paapi5_python_sdk/items_result.py create mode 100644 paapi5_python_sdk/language_type.py create mode 100644 paapi5_python_sdk/languages.py create mode 100644 paapi5_python_sdk/manufacture_info.py create mode 100644 paapi5_python_sdk/max_price.py create mode 100644 paapi5_python_sdk/merchant.py create mode 100644 paapi5_python_sdk/min_price.py create mode 100644 paapi5_python_sdk/min_reviews_rating.py create mode 100644 paapi5_python_sdk/min_saving_percent.py create mode 100644 paapi5_python_sdk/multi_valued_attribute.py create mode 100644 paapi5_python_sdk/offer_availability.py create mode 100644 paapi5_python_sdk/offer_condition.py create mode 100644 paapi5_python_sdk/offer_count.py create mode 100644 paapi5_python_sdk/offer_delivery_info.py create mode 100644 paapi5_python_sdk/offer_listing.py create mode 100644 paapi5_python_sdk/offer_loyalty_points.py create mode 100644 paapi5_python_sdk/offer_merchant_info.py create mode 100644 paapi5_python_sdk/offer_price.py create mode 100644 paapi5_python_sdk/offer_program_eligibility.py create mode 100644 paapi5_python_sdk/offer_promotion.py create mode 100644 paapi5_python_sdk/offer_savings.py create mode 100644 paapi5_python_sdk/offer_shipping_charge.py create mode 100644 paapi5_python_sdk/offer_sub_condition.py create mode 100644 paapi5_python_sdk/offer_summary.py create mode 100644 paapi5_python_sdk/offers.py create mode 100644 paapi5_python_sdk/partner_type.py create mode 100644 paapi5_python_sdk/price.py create mode 100644 paapi5_python_sdk/product_advertising_api_client_exception.py create mode 100644 paapi5_python_sdk/product_advertising_api_service_exception.py create mode 100644 paapi5_python_sdk/product_info.py create mode 100644 paapi5_python_sdk/properties.py create mode 100644 paapi5_python_sdk/refinement.py create mode 100644 paapi5_python_sdk/refinement_bin.py create mode 100644 paapi5_python_sdk/rental_offer_listing.py create mode 100644 paapi5_python_sdk/rental_offers.py create mode 100644 paapi5_python_sdk/rest.py create mode 100644 paapi5_python_sdk/search_items_request.py create mode 100644 paapi5_python_sdk/search_items_resource.py create mode 100644 paapi5_python_sdk/search_items_response.py create mode 100644 paapi5_python_sdk/search_refinements.py create mode 100644 paapi5_python_sdk/search_result.py create mode 100644 paapi5_python_sdk/single_boolean_valued_attribute.py create mode 100644 paapi5_python_sdk/single_integer_valued_attribute.py create mode 100644 paapi5_python_sdk/single_string_valued_attribute.py create mode 100644 paapi5_python_sdk/sort_by.py create mode 100644 paapi5_python_sdk/technical_info.py create mode 100644 paapi5_python_sdk/trade_in_info.py create mode 100644 paapi5_python_sdk/trade_in_price.py create mode 100644 paapi5_python_sdk/unit_based_attribute.py create mode 100644 paapi5_python_sdk/variation_attribute.py create mode 100644 paapi5_python_sdk/variation_dimension.py create mode 100644 paapi5_python_sdk/variation_summary.py create mode 100644 paapi5_python_sdk/variations_result.py create mode 100644 paapi5_python_sdk/website_sales_rank.py diff --git a/amazon/__init__.py b/amazon/__init__.py new file mode 100644 index 0000000..17c61a2 --- /dev/null +++ b/amazon/__init__.py @@ -0,0 +1,4 @@ +"""Amazon Product Advertising API wrapper for Python""" + +__version__ = '3.3.3' +__author__ = 'Sergio Abad' diff --git a/amazon/constant.py b/amazon/constant.py new file mode 100644 index 0000000..f8faed6 --- /dev/null +++ b/amazon/constant.py @@ -0,0 +1,241 @@ +"""Module containing all the constants.""" + +from paapi5_python_sdk.get_items_resource import GetItemsResource +from paapi5_python_sdk.search_items_resource import SearchItemsResource +from paapi5_python_sdk.get_variations_resource import GetVariationsResource +from paapi5_python_sdk.get_browse_nodes_resource import GetBrowseNodesResource +from paapi5_python_sdk.condition import Condition + +"""Available regions for the Amazon API.""" +REGIONS = { + 'AU': 'us-west-2', + 'BR': 'us-east-1', + 'CA': 'us-east-1', + 'FR': 'eu-west-1', + 'DE': 'eu-west-1', + 'NL': 'eu-west-1', + 'IN': 'eu-west-1', + 'IT': 'eu-west-1', + 'JP': 'us-west-2', + 'MX': 'us-east-1', + 'ES': 'eu-west-1', + 'TR': 'eu-west-1', + 'AE': 'eu-west-1', + 'UK': 'eu-west-1', + 'US': 'us-east-1', + 'SE': 'eu-west-1' +} + +"""Domains for each region on the Amazon API.""" +DOMAINS = { + 'AU': 'com.au', + 'BR': 'com.br', + 'CA': 'ca', + 'FR': 'fr', + 'DE': 'de', + 'NL': 'nl', + 'IN': 'in', + 'IT': 'it', + 'JP': 'co.jp', + 'MX': 'com.mx', + 'ES': 'es', + 'TR': 'com.tr', + 'AE': 'ae', + 'UK': 'co.uk', + 'US': 'com', + 'SE': 'se' +} + +"""Condition values.""" +CONDITION = { + 'Any': Condition.ANY, + 'Collectible': Condition.COLLECTIBLE, + 'New': Condition.NEW, + 'Refurbished': Condition.REFURBISHED, + 'Used': Condition.USED +} + +"""Product resources to get from Amazon API.""" +PRODUCT_RESOURCES = [ + GetItemsResource.BROWSENODEINFO_BROWSENODES, + GetItemsResource.BROWSENODEINFO_BROWSENODES_ANCESTOR, + GetItemsResource.BROWSENODEINFO_BROWSENODES_SALESRANK, + GetItemsResource.BROWSENODEINFO_WEBSITESALESRANK, + GetItemsResource.IMAGES_PRIMARY_SMALL, + GetItemsResource.IMAGES_PRIMARY_MEDIUM, + GetItemsResource.IMAGES_PRIMARY_LARGE, + GetItemsResource.IMAGES_VARIANTS_SMALL, + GetItemsResource.IMAGES_VARIANTS_MEDIUM, + GetItemsResource.IMAGES_VARIANTS_LARGE, + GetItemsResource.ITEMINFO_BYLINEINFO, + GetItemsResource.ITEMINFO_CONTENTINFO, + GetItemsResource.ITEMINFO_CONTENTRATING, + GetItemsResource.ITEMINFO_CLASSIFICATIONS, + GetItemsResource.ITEMINFO_EXTERNALIDS, + GetItemsResource.ITEMINFO_FEATURES, + GetItemsResource.ITEMINFO_MANUFACTUREINFO, + GetItemsResource.ITEMINFO_PRODUCTINFO, + GetItemsResource.ITEMINFO_TECHNICALINFO, + GetItemsResource.ITEMINFO_TITLE, + GetItemsResource.ITEMINFO_TRADEININFO, + GetItemsResource.OFFERS_LISTINGS_AVAILABILITY_MAXORDERQUANTITY, + GetItemsResource.OFFERS_LISTINGS_AVAILABILITY_MESSAGE, + GetItemsResource.OFFERS_LISTINGS_AVAILABILITY_MINORDERQUANTITY, + GetItemsResource.OFFERS_LISTINGS_AVAILABILITY_TYPE, + GetItemsResource.OFFERS_LISTINGS_CONDITION, + GetItemsResource.OFFERS_LISTINGS_CONDITION_SUBCONDITION, + GetItemsResource.OFFERS_LISTINGS_DELIVERYINFO_ISAMAZONFULFILLED, + GetItemsResource.OFFERS_LISTINGS_DELIVERYINFO_ISFREESHIPPINGELIGIBLE, + GetItemsResource.OFFERS_LISTINGS_DELIVERYINFO_ISPRIMEELIGIBLE, + GetItemsResource.OFFERS_LISTINGS_DELIVERYINFO_SHIPPINGCHARGES, + GetItemsResource.OFFERS_LISTINGS_ISBUYBOXWINNER, + GetItemsResource.OFFERS_LISTINGS_LOYALTYPOINTS_POINTS, + GetItemsResource.OFFERS_LISTINGS_MERCHANTINFO, + GetItemsResource.OFFERS_LISTINGS_PRICE, + GetItemsResource.OFFERS_LISTINGS_PROGRAMELIGIBILITY_ISPRIMEEXCLUSIVE, + GetItemsResource.OFFERS_LISTINGS_PROGRAMELIGIBILITY_ISPRIMEPANTRY, + GetItemsResource.OFFERS_LISTINGS_PROMOTIONS, + GetItemsResource.OFFERS_LISTINGS_SAVINGBASIS, + GetItemsResource.OFFERS_SUMMARIES_HIGHESTPRICE, + GetItemsResource.OFFERS_SUMMARIES_LOWESTPRICE, + GetItemsResource.OFFERS_SUMMARIES_OFFERCOUNT, + GetItemsResource.PARENTASIN, + GetItemsResource.RENTALOFFERS_LISTINGS_AVAILABILITY_MAXORDERQUANTITY, + GetItemsResource.RENTALOFFERS_LISTINGS_AVAILABILITY_MESSAGE, + GetItemsResource.RENTALOFFERS_LISTINGS_AVAILABILITY_MINORDERQUANTITY, + GetItemsResource.RENTALOFFERS_LISTINGS_AVAILABILITY_TYPE, + GetItemsResource.RENTALOFFERS_LISTINGS_BASEPRICE, + GetItemsResource.RENTALOFFERS_LISTINGS_CONDITION, + GetItemsResource.RENTALOFFERS_LISTINGS_CONDITION_SUBCONDITION, + GetItemsResource.RENTALOFFERS_LISTINGS_DELIVERYINFO_ISAMAZONFULFILLED, + GetItemsResource.RENTALOFFERS_LISTINGS_DELIVERYINFO_ISFREESHIPPINGELIGIBLE, + GetItemsResource.RENTALOFFERS_LISTINGS_DELIVERYINFO_ISPRIMEELIGIBLE, + GetItemsResource.RENTALOFFERS_LISTINGS_DELIVERYINFO_SHIPPINGCHARGES, + GetItemsResource.RENTALOFFERS_LISTINGS_MERCHANTINFO] + +"""Search resources to get from Amazon API.""" +SEARCH_RESOURCES = [ + SearchItemsResource.BROWSENODEINFO_BROWSENODES, + SearchItemsResource.BROWSENODEINFO_BROWSENODES_ANCESTOR, + SearchItemsResource.BROWSENODEINFO_BROWSENODES_SALESRANK, + SearchItemsResource.BROWSENODEINFO_WEBSITESALESRANK, + SearchItemsResource.IMAGES_PRIMARY_SMALL, + SearchItemsResource.IMAGES_PRIMARY_MEDIUM, + SearchItemsResource.IMAGES_PRIMARY_LARGE, + SearchItemsResource.IMAGES_VARIANTS_SMALL, + SearchItemsResource.IMAGES_VARIANTS_MEDIUM, + SearchItemsResource.IMAGES_VARIANTS_LARGE, + SearchItemsResource.ITEMINFO_BYLINEINFO, + SearchItemsResource.ITEMINFO_CONTENTINFO, + SearchItemsResource.ITEMINFO_CONTENTRATING, + SearchItemsResource.ITEMINFO_CLASSIFICATIONS, + SearchItemsResource.ITEMINFO_EXTERNALIDS, + SearchItemsResource.ITEMINFO_FEATURES, + SearchItemsResource.ITEMINFO_MANUFACTUREINFO, + SearchItemsResource.ITEMINFO_PRODUCTINFO, + SearchItemsResource.ITEMINFO_TECHNICALINFO, + SearchItemsResource.ITEMINFO_TITLE, + SearchItemsResource.ITEMINFO_TRADEININFO, + SearchItemsResource.OFFERS_LISTINGS_AVAILABILITY_MAXORDERQUANTITY, + SearchItemsResource.OFFERS_LISTINGS_AVAILABILITY_MESSAGE, + SearchItemsResource.OFFERS_LISTINGS_AVAILABILITY_MINORDERQUANTITY, + SearchItemsResource.OFFERS_LISTINGS_AVAILABILITY_TYPE, + SearchItemsResource.OFFERS_LISTINGS_CONDITION, + SearchItemsResource.OFFERS_LISTINGS_CONDITION_SUBCONDITION, + SearchItemsResource.OFFERS_LISTINGS_DELIVERYINFO_ISAMAZONFULFILLED, + SearchItemsResource.OFFERS_LISTINGS_DELIVERYINFO_ISFREESHIPPINGELIGIBLE, + SearchItemsResource.OFFERS_LISTINGS_DELIVERYINFO_ISPRIMEELIGIBLE, + SearchItemsResource.OFFERS_LISTINGS_DELIVERYINFO_SHIPPINGCHARGES, + SearchItemsResource.OFFERS_LISTINGS_ISBUYBOXWINNER, + SearchItemsResource.OFFERS_LISTINGS_LOYALTYPOINTS_POINTS, + SearchItemsResource.OFFERS_LISTINGS_MERCHANTINFO, + SearchItemsResource.OFFERS_LISTINGS_PRICE, + SearchItemsResource.OFFERS_LISTINGS_PROGRAMELIGIBILITY_ISPRIMEEXCLUSIVE, + SearchItemsResource.OFFERS_LISTINGS_PROGRAMELIGIBILITY_ISPRIMEPANTRY, + SearchItemsResource.OFFERS_LISTINGS_PROMOTIONS, + SearchItemsResource.OFFERS_LISTINGS_SAVINGBASIS, + SearchItemsResource.OFFERS_SUMMARIES_HIGHESTPRICE, + SearchItemsResource.OFFERS_SUMMARIES_LOWESTPRICE, + SearchItemsResource.OFFERS_SUMMARIES_OFFERCOUNT, + SearchItemsResource.PARENTASIN, + SearchItemsResource.RENTALOFFERS_LISTINGS_AVAILABILITY_MAXORDERQUANTITY, + SearchItemsResource.RENTALOFFERS_LISTINGS_AVAILABILITY_MESSAGE, + SearchItemsResource.RENTALOFFERS_LISTINGS_AVAILABILITY_MINORDERQUANTITY, + SearchItemsResource.RENTALOFFERS_LISTINGS_AVAILABILITY_TYPE, + SearchItemsResource.RENTALOFFERS_LISTINGS_BASEPRICE, + SearchItemsResource.RENTALOFFERS_LISTINGS_CONDITION, + SearchItemsResource.RENTALOFFERS_LISTINGS_CONDITION_SUBCONDITION, + SearchItemsResource.RENTALOFFERS_LISTINGS_DELIVERYINFO_ISAMAZONFULFILLED, + SearchItemsResource.RENTALOFFERS_LISTINGS_DELIVERYINFO_ISFREESHIPPINGELIGIBLE, + SearchItemsResource.RENTALOFFERS_LISTINGS_DELIVERYINFO_ISPRIMEELIGIBLE, + SearchItemsResource.RENTALOFFERS_LISTINGS_DELIVERYINFO_SHIPPINGCHARGES, + SearchItemsResource.RENTALOFFERS_LISTINGS_MERCHANTINFO, + SearchItemsResource.SEARCHREFINEMENTS] + +"""Variation resources to get from Amazon API.""" +VARIATION_RESOURCES = [ + GetVariationsResource.BROWSENODEINFO_BROWSENODES, + GetVariationsResource.BROWSENODEINFO_BROWSENODES_ANCESTOR, + GetVariationsResource.BROWSENODEINFO_BROWSENODES_SALESRANK, + GetVariationsResource.BROWSENODEINFO_WEBSITESALESRANK, + GetVariationsResource.IMAGES_PRIMARY_SMALL, + GetVariationsResource.IMAGES_PRIMARY_MEDIUM, + GetVariationsResource.IMAGES_PRIMARY_LARGE, + GetVariationsResource.IMAGES_VARIANTS_SMALL, + GetVariationsResource.IMAGES_VARIANTS_MEDIUM, + GetVariationsResource.IMAGES_VARIANTS_LARGE, + GetVariationsResource.ITEMINFO_BYLINEINFO, + GetVariationsResource.ITEMINFO_CONTENTINFO, + GetVariationsResource.ITEMINFO_CONTENTRATING, + GetVariationsResource.ITEMINFO_CLASSIFICATIONS, + GetVariationsResource.ITEMINFO_EXTERNALIDS, + GetVariationsResource.ITEMINFO_FEATURES, + GetVariationsResource.ITEMINFO_MANUFACTUREINFO, + GetVariationsResource.ITEMINFO_PRODUCTINFO, + GetVariationsResource.ITEMINFO_TECHNICALINFO, + GetVariationsResource.ITEMINFO_TITLE, + GetVariationsResource.ITEMINFO_TRADEININFO, + GetVariationsResource.OFFERS_LISTINGS_AVAILABILITY_MAXORDERQUANTITY, + GetVariationsResource.OFFERS_LISTINGS_AVAILABILITY_MESSAGE, + GetVariationsResource.OFFERS_LISTINGS_AVAILABILITY_MINORDERQUANTITY, + GetVariationsResource.OFFERS_LISTINGS_AVAILABILITY_TYPE, + GetVariationsResource.OFFERS_LISTINGS_CONDITION, + GetVariationsResource.OFFERS_LISTINGS_CONDITION_SUBCONDITION, + GetVariationsResource.OFFERS_LISTINGS_DELIVERYINFO_ISAMAZONFULFILLED, + GetVariationsResource.OFFERS_LISTINGS_DELIVERYINFO_ISFREESHIPPINGELIGIBLE, + GetVariationsResource.OFFERS_LISTINGS_DELIVERYINFO_ISPRIMEELIGIBLE, + GetVariationsResource.OFFERS_LISTINGS_DELIVERYINFO_SHIPPINGCHARGES, + GetVariationsResource.OFFERS_LISTINGS_ISBUYBOXWINNER, + GetVariationsResource.OFFERS_LISTINGS_LOYALTYPOINTS_POINTS, + GetVariationsResource.OFFERS_LISTINGS_MERCHANTINFO, + GetVariationsResource.OFFERS_LISTINGS_PRICE, + GetVariationsResource.OFFERS_LISTINGS_PROGRAMELIGIBILITY_ISPRIMEEXCLUSIVE, + GetVariationsResource.OFFERS_LISTINGS_PROGRAMELIGIBILITY_ISPRIMEPANTRY, + GetVariationsResource.OFFERS_LISTINGS_PROMOTIONS, + GetVariationsResource.OFFERS_LISTINGS_SAVINGBASIS, + GetVariationsResource.OFFERS_SUMMARIES_HIGHESTPRICE, + GetVariationsResource.OFFERS_SUMMARIES_LOWESTPRICE, + GetVariationsResource.OFFERS_SUMMARIES_OFFERCOUNT, + GetVariationsResource.PARENTASIN, + GetVariationsResource.RENTALOFFERS_LISTINGS_AVAILABILITY_MAXORDERQUANTITY, + GetVariationsResource.RENTALOFFERS_LISTINGS_AVAILABILITY_MESSAGE, + GetVariationsResource.RENTALOFFERS_LISTINGS_AVAILABILITY_MINORDERQUANTITY, + GetVariationsResource.RENTALOFFERS_LISTINGS_AVAILABILITY_TYPE, + GetVariationsResource.RENTALOFFERS_LISTINGS_BASEPRICE, + GetVariationsResource.RENTALOFFERS_LISTINGS_CONDITION, + GetVariationsResource.RENTALOFFERS_LISTINGS_CONDITION_SUBCONDITION, + GetVariationsResource.RENTALOFFERS_LISTINGS_DELIVERYINFO_ISAMAZONFULFILLED, + GetVariationsResource.RENTALOFFERS_LISTINGS_DELIVERYINFO_ISFREESHIPPINGELIGIBLE, + GetVariationsResource.RENTALOFFERS_LISTINGS_DELIVERYINFO_ISPRIMEELIGIBLE, + GetVariationsResource.RENTALOFFERS_LISTINGS_DELIVERYINFO_SHIPPINGCHARGES, + GetVariationsResource.RENTALOFFERS_LISTINGS_MERCHANTINFO, + GetVariationsResource.VARIATIONSUMMARY_PRICE_HIGHESTPRICE, + GetVariationsResource.VARIATIONSUMMARY_PRICE_LOWESTPRICE, + GetVariationsResource.VARIATIONSUMMARY_VARIATIONDIMENSION +] + +"""Browse Node resources to get from Amazon API.""" +BROWSE_RESOURCES = [ + GetBrowseNodesResource.ANCESTOR, + GetBrowseNodesResource.CHILDREN +] diff --git a/amazon/exception.py b/amazon/exception.py new file mode 100644 index 0000000..c9af2df --- /dev/null +++ b/amazon/exception.py @@ -0,0 +1,11 @@ +"""Custom exception class.""" + + +class AmazonException(Exception): + """Custom exception class for Amazon Product Advertising API.""" + def __init__(self, status=None, reason=None): + self.status = status + self.reason = reason + + def __str__(self): + return '%s: %s' % (self.status, self.reason) diff --git a/amazon/paapi.py b/amazon/paapi.py new file mode 100644 index 0000000..31d8046 --- /dev/null +++ b/amazon/paapi.py @@ -0,0 +1,457 @@ +"""Amazon Product Advertising API wrapper for Python + +A simple Python wrapper for the last version of the Amazon Product Advertising API. +This module allows to get product information from Amazon using the official API in +an easier way. +""" + +from paapi5_python_sdk.api.default_api import DefaultApi +from paapi5_python_sdk.get_items_request import GetItemsRequest +from paapi5_python_sdk.search_items_request import SearchItemsRequest +from paapi5_python_sdk.get_variations_request import GetVariationsRequest +from paapi5_python_sdk.get_browse_nodes_request import GetBrowseNodesRequest +from paapi5_python_sdk.partner_type import PartnerType +from paapi5_python_sdk.rest import ApiException + +from amazon.constant import DOMAINS, REGIONS, CONDITION +from amazon.constant import PRODUCT_RESOURCES, SEARCH_RESOURCES, VARIATION_RESOURCES +from amazon.constant import BROWSE_RESOURCES +from amazon.exception import AmazonException +from amazon.parse import parse_product, AmazonBrowseNode, parse_browsenode +from amazon.tools import get_asin, chunks + +import logging +import time + + +logger = logging.getLogger(__name__) + + +class AmazonAPI: + """Creates an instance containing your API credentials. + + Args: + key (str): Your API key. + secret (str): Your API secret. + tag (str): The tag you want to use for the URL. + country (str): Country code. Use one of the following: + AU, BR, CA, FR, DE, IN, NL, IT, JP, MX, ES, TR, AE, UK, US, SE. + throttling (float, optional): It should be greater than 0 or False to disable throttling. + This value determines wait time between API calls. + """ + def __init__(self, key, secret, tag, country, throttling=0.8): + logger.warning('This version of the module is deprecated and it will be removed in future updates. Please upgrade to version 4.0.0 or higher.') + self.key = key + self.secret = secret + self.tag = tag + try: + if throttling is True: + raise ValueError + elif throttling is False: + self.throttling = False + else: + self.throttling = float(throttling) + if self.throttling <= 0: + raise ValueError + except ValueError: + raise AmazonException('ValueError', 'Throttling should be False or greater than 0') + self.country = country + try: + self.host = 'webservices.amazon.' + DOMAINS[country] + self.region = REGIONS[country] + self.marketplace = 'www.amazon.' + DOMAINS[country] + except KeyError: + raise AmazonException('KeyError', 'Invalid country code') + self.last_query_time = time.time() + self.api = DefaultApi(access_key=self.key, secret_key=self.secret, host=self.host, + region=self.region) + + def _throttle(self): + if self.throttling: + wait_time = 1 / self.throttling - (time.time() - self.last_query_time) + if wait_time > 0: + time.sleep(wait_time) + self.last_query_time = time.time() + + def get_products(self, product_ids, condition='Any', merchant='All', + async_req=False): + """Find product information for multiple products on Amazon. + + Args: + product_ids (str|list): One or more item IDs like ASIN or product URL. + Use a string separated by comma or as a list. + condition (str, optional): Specify the product condition. + Allowed values: Any, Collectible, New, Refurbished, Used. + Defaults to Any. + merchant (str, optional): Filters search results to return items + having at least one offer sold by target merchant. Allowed values: + All, Amazon. Defaults to All. + async_req (bool, optional): Specify if a thread should be created to + run the request. Defaults to False. + + Returns: + list of instances: A list containing 1 instance for each product + or None if no results. + """ + + logger.warning('This version of the module is deprecated and it will be removed in future updates. Please upgrade to version 4.0.0 or higher.') + # Clean up input data and remove 10 items limit from Amazon API + if isinstance(product_ids, str): + product_ids = [x.strip() for x in product_ids.split(',')] + elif not isinstance(product_ids, list): + raise AmazonException('TypeError', 'Arg product_ids should be a list or string') + asin_full_list = list(set([get_asin(x) for x in product_ids])) + asin_full_list = list(chunks(asin_full_list, 10)) + + results = [] + for asin_list in asin_full_list: + try: + request = GetItemsRequest(partner_tag=self.tag, + partner_type=PartnerType.ASSOCIATES, + marketplace=self.marketplace, + merchant=merchant, + condition=CONDITION[condition], + item_ids=asin_list, + resources=PRODUCT_RESOURCES) + except KeyError: + raise AmazonException('KeyError', 'Invalid condition value') + except Exception as e: + raise AmazonException('GetItemsError', e) + + for x in range(3): + try: + # Send the request and create results + self._throttle() + if async_req: + thread = self.api.get_items(request, async_req=True) + response = thread.get() + else: + response = self.api.get_items(request) + break + except ApiException as e: + if x == 2: + raise AmazonException('ApiException', e) + try: + if response.items_result is not None: + if len(response.items_result.items) > 0: + for item in response.items_result.items: + results.append(parse_product(item)) + except Exception as e: + raise AmazonException('ResponseError', e) + + if results: + return results + else: + return None + + def get_product(self, product_id, condition='Any', merchant='All', + async_req=False): + """Find product information for a specific product on Amazon. + + Args: + product_id (str, list): One item ID like ASIN or product URL. + condition (str, optional): Specify the product condition. + Allowed values: Any, Collectible, New, Refurbished, Used. + Defaults to Any. + merchant (str, optional): Filters search results to return items + having at least one offer sold by target merchant. Allowed values: + All, Amazon. Defaults to All. + async_req (bool, optional): Specify if a thread should be created to + run the request. Defaults to False. + + Returns: + instance: An instance containing all the available information + for the product or None if no results. + """ + if isinstance(product_id, list): + product_id = product_id[0] + if isinstance(product_id, str): + product_id = product_id.split(',')[0] + + product = self.get_products(product_id, condition=condition, merchant=merchant, + async_req=async_req) + if product: + return product[0] + else: + return None + + def search_products(self, item_count=10, item_page=1, items_per_page=10, keywords=None, + actor=None, artist=None, author=None, brand=None, title=None, + availability='Available', browse_node=None, condition='Any', delivery=None, + max_price=None, min_price=None, min_rating=None, min_discount=None, + merchant='All', search_index='All', sort_by=None, async_req=False): + """Search products on Amazon using different parameters. At least one of the + following parameters should be used: keywords, actor, artist, author, brand, + title. + + Args: + item_count (int, optional): The total number of products to get. Should be between + 1 and 100. Defaults to 10. + item_page (int, optional): The page where the results start from. Should be between + 1 and 10. Defaults to 1. + items_per_page (int, optional): Products on each page. Should be between + 1 and 10. Defaults to 10. + keywords (str, optional): A word or phrase that describes an item. + actor (str, optional): Actor name associated with the item. + artist (str, optional): Artist name associated with the item. + author (str, optional): Author name associated with the item. + brand (str, optional): Brand name associated with the item. + title (str, optional): Title associated with the item. + availability (str, optional): Filters available items on Amazon. Allowed values: + Available, IncludeOutOfStock. Defaults to Available. + browse_node (str, optional): A unique ID assigned by Amazon that + identifies a product category or subcategory. + condition (str, optional): The condition parameter filters offers by + condition type. Allowed values: Any, Collectible, New, Refurbished, Used. + Defaults to Any. + delivery (list, optional): The delivery flag filters items which + satisfy a certain delivery program promoted by the specific + Amazon Marketplace. Allowed values: AmazonGlobal, FreeShipping, + FulfilledByAmazon, Prime. + max_price (int, optional): Filters search results to items with at + least one offer price below the specified value. + min_price (int, optional): Filters search results to items with at + least one offer price above the specified value. + min_rating (int, optional): Filters search results to items with + customer review ratings above specified value. + min_discount (int, optional): Filters search results to items with + at least one offer having saving percentage above the specified + value. + merchant (str, optional): Filters search results to return items + having at least one offer sold by target merchant. Allowed values: + All, Amazon. Defaults to All. + search_index (str, optional): Indicates the product category to + search. Defaults to All. + sort_by (str, optional): The way in which items in the response + are sorted. Allowed values: AvgCustomerReviews, Featured, + NewestArrivals, Price:HighToLow, Price:LowToHigh, Relevance. + async_req (bool, optional): Specify if a thread should be created to + run the request. Defaults to False. + + Returns: + list of instances: A list containing 1 instance for each product + or None if no results. + """ + + logger.warning('This version of the module is deprecated and it will be removed in future updates. Please upgrade to version 4.0.0 or higher.') + if items_per_page > 10 or items_per_page < 1: + raise AmazonException('ValueError', 'Arg items_per_page should be between 1 and 10') + if item_count > 100 or item_count < 1: + raise AmazonException('ValueError', 'Arg item_count should be between 1 and 100') + if item_page < 1: + raise AmazonException('ValueError', 'Arg item_page should be 1 or higher') + if not keywords and not actor and not artist and not author and not brand and not title and not browse_node and not search_index: + raise AmazonException('ValueError', 'At least one of the following args must be ' + 'provided: keywords, actor, artist, author, brand, ' + 'title, browse_node, search_index') + results = [] + while len(results) < item_count: + try: + request = SearchItemsRequest( + partner_tag=self.tag, + partner_type=PartnerType.ASSOCIATES, + actor=actor, + artist=artist, + author=author, + availability=availability, + brand=brand, + browse_node_id=browse_node, + condition=CONDITION[condition], + delivery_flags=delivery, + item_count=items_per_page, + item_page=item_page, + keywords=keywords, + max_price=max_price, + merchant=merchant, + min_price=min_price, + min_reviews_rating=min_rating, + min_saving_percent=min_discount, + offer_count=1, + resources=SEARCH_RESOURCES, + search_index=search_index, + sort_by=sort_by, + title=title) + except KeyError: + raise AmazonException('KeyError', 'Invalid condition value') + except Exception as e: + raise AmazonException('SearchItemsError', e) + + for x in range(3): + try: + # Send the request and create results + self._throttle() + if async_req: + thread = self.api.search_items(request, async_req=True) + response = thread.get() + else: + response = self.api.search_items(request) + break + except ApiException as e: + if x == 2: + raise AmazonException('ApiException', e) + try: + if response.search_result is not None: + if response.search_result.items is not None: + for item in response.search_result.items: + results.append(parse_product(item)) + if len(results) >= item_count: + break + if len(response.search_result.items) < items_per_page: + break + else: + break + if response.errors is not None: + raise AmazonException(response.errors[0].code, response.errors[0].message) + except Exception as e: + if e.status == "NoResults": + break + raise AmazonException('ResponseError', e) + item_page += 1 + + if results: + return results + else: + return None + + def get_variations(self, asin, item_count=10, item_page=1, items_per_page=10, condition='Any', + merchant='All', async_req=False): + """Returns a set of items that are the same product, but differ according to a + consistent theme, for example size and color. + + Args: + asin (str): One item ID like ASIN or product URL. + item_count (int, optional): The total number of products to get. Should be between + 1 and 100. Defaults to 10. + item_page (int, optional): The page where the results start from. Should be between + 1 and 10. Defaults to 1. + items_per_page (int, optional): Products on each page. Should be between + 1 and 10. Defaults to 10. + condition (str, optional): The condition parameter filters offers by + condition type. Allowed values: Any, Collectible, New, Refurbished, Used. + Defaults to Any. + merchant (str, optional): Filters search results to return items + having at least one offer sold by target merchant. Allowed values: + All, Amazon. Defaults to All. + async_req (bool, optional): Specify if a thread should be created to + run the request. Defaults to False. + + Returns: + list of instances: A list containing 1 instance for each product + or None if no results. + """ + + logger.warning('This version of the module is deprecated and it will be removed in future updates. Please upgrade to version 4.0.0 or higher.') + if items_per_page > 10 or items_per_page < 1: + raise AmazonException('ValueError', 'Arg items_per_page should be between 1 and 10') + if item_count > 100 or item_count < 1: + raise AmazonException('ValueError', 'Arg item_count should be between 1 and 100') + if item_page < 1: + raise AmazonException('ValueError', 'Arg item_page should be 1 or higher') + + results = [] + while len(results) < item_count: + try: + request = GetVariationsRequest( + partner_tag=self.tag, + partner_type=PartnerType.ASSOCIATES, + marketplace=self.marketplace, + asin=get_asin(asin), + condition=CONDITION[condition], + merchant=merchant, + offer_count=1, + variation_count=items_per_page, + variation_page=item_page, + resources=VARIATION_RESOURCES) + except KeyError: + raise AmazonException('KeyError', 'Invalid condition value') + except Exception as e: + raise AmazonException('GetVariationsError', e) + + for x in range(3): + try: + # Send the request and create results + self._throttle() + if async_req: + thread = self.api.get_variations(request, async_req=True) + response = thread.get() + else: + response = self.api.get_variations(request) + break + except ApiException as e: + if x == 2: + raise AmazonException('ApiException', e) + try: + if response.variations_result is not None: + if response.variations_result.items is not None: + for item in response.variations_result.items: + results.append(parse_product(item)) + if len(results) >= item_count: + break + if len(response.variations_result.items) < items_per_page: + break + else: + break + if response.errors is not None: + raise AmazonException(response.errors[0].code, response.errors[0].message) + except Exception as e: + raise AmazonException('ResponseError', e) + item_page += 1 + + if results: + return results + else: + return None + + def get_browsenodes(self, browse_nodes, async_req=False): + """Get browse nodes information from Amazon. + + Args: + browse_nodes (list): List of strings containing the browse node ids. + async_req (bool, optional): Specify if a thread should be created to + run the request. Defaults to False. + + Returns: + dict: A dictionary containing the browse node information. + """ + + logger.warning('This version of the module is deprecated and it will be removed in future updates. Please upgrade to version 4.0.0 or higher.') + if isinstance(browse_nodes, list) is False: + raise Exception('Browse nodes parameter should be a list') + elif not browse_nodes: + raise Exception('Browse nodes parameter can\'t be empty') + + try: + request = GetBrowseNodesRequest( + partner_tag=self.tag, + partner_type=PartnerType.ASSOCIATES, + marketplace=self.marketplace, + browse_node_ids=browse_nodes, + languages_of_preference=None, + resources=BROWSE_RESOURCES) + except ValueError as e: + raise AmazonException("ValueError", e) + + try: + self._throttle() + if async_req: + thread = self.api.get_browse_nodes(request, async_req=True) + response = thread.get() + else: + response = self.api.get_browse_nodes(request) + except ApiException as e: + raise AmazonException('ApiException', e) + + try: + if response.browse_nodes_result is not None: + res = [AmazonBrowseNode(item) for item in response.browse_nodes_result.browse_nodes] + return parse_browsenode(res) + if response.errors is not None: + raise AmazonException(response.errors[0].code, response.errors[0].message) + except TypeError as e: + raise AmazonException("TypeError", e) + except ValueError as e: + raise AmazonException(ValueError, e) + except AmazonException as e: + raise AmazonException(e.status, e.reason) + except Exception as e: + raise AmazonException("General", e) diff --git a/amazon/parse.py b/amazon/parse.py new file mode 100644 index 0000000..1f65cf3 --- /dev/null +++ b/amazon/parse.py @@ -0,0 +1,550 @@ +"""Data parser for instance creation.""" +import pprint + +import six + +class Class: + """Base class for creating the product instance.""" + pass + + +class AmazonBrowseNode(): + swagger_types = { + 'ancestor': 'BrowseNodeAncestor', + 'children': 'BrowseNodeChildren', + 'context_free_name': 'str', + 'display_name': 'str', + 'id': 'str', + 'is_root': 'bool', + 'sales_rank': 'int' + } + + def __init__(self, node): + self.ancestor = node.ancestor + self.children = node.children + self.context_free_name = node.context_free_name + self.display_name = node.display_name + self.id = node.id + self.is_root = node.is_root + self.sales_rank = node.sales_rank + + def to_dict(self): + 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(AmazonBrowseNode, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + return pprint.pformat(self.to_dict()) + + def __repr__(self): + return self.to_str() + + def __eq__(self, other): + if not isinstance(other, AmazonBrowseNode): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not self == other + + +def parse_browsenode(browse_nodes_response): + """Parse browse node data and creates a dict. + + Args: + browse_nodes_response (list): List of browse nodes responses. + + Returns: + dict: Dict with browse node information. + """ + mapped_response = {} + for browse_node in browse_nodes_response: + mapped_response[browse_node.id] = browse_node + return mapped_response + + +def parse_product(item): + """Parse item data and creates product instance. + + Args: + item (instance): The instance with the data from Amazon API. + + Returns: + instance: Product instance with parsed data. + """ + product = Class() + product.raw_info = item + + # Main + product.asin = item.asin + try: + product.url = item.detail_page_url + except Exception: + product.url = None + try: + product.title = item.item_info.title.display_value + except Exception: + product.title = None + try: + product.parent_asin = item.parent_asin + except Exception: + product.parent_asin = None + + # Info + product.info = Class() + try: + product.info.contributors = [] + for x in item.item_info.by_line_info.contributors: + contributor = Class() + contributor.name = x.name + contributor.role = x.role + product.info.contributors.append(contributor) + except Exception: + product.info.contributors = None + try: + product.info.manufacturer = item.item_info.by_line_info.manufacturer.display_value + except Exception: + product.info.manufacturer = None + try: + product.info.brand = item.item_info.by_line_info.brand.display_value + except Exception: + product.info.brand = None + try: + product.info.product_group = item.item_info.classifications.product_group.display_value + except Exception: + product.info.product_group = None + try: + product.info.binding = item.item_info.classifications.binding.display_value + except Exception: + product.info.binding = None + try: + product.info.is_adult = item.item_info.product_info.is_adult_product.display_value + except Exception: + product.info.is_adult = None + try: + product.info.edition = item.item_info.content_info.edition.display_value + except Exception: + product.info.edition = None + try: + product.info.warranty = item.item_info.manufacture_info.warranty.display_value + except Exception: + product.info.warranty = None + try: + product.info.audience_rating = item.item_info.content_rating.audience_rating.display_value + except Exception: + product.info.audience_rating = None + try: + product.info.part_number = item.item_info.manufacture_info.item_part_number.display_value + except Exception: + product.info.part_number = None + try: + product.info.model = item.item_info.manufacture_info.model.display_value + except Exception: + product.info.model = None + try: + product.info.publication_date = item.item_info.content_info.publication_date.display_value + except Exception: + product.info.publication_date = None + try: + product.info.release_date = item.item_info.product_info.release_date.display_value + except Exception: + product.info.release_date = None + product.info.external_ids = Class() + try: + product.info.external_ids.ean = item.item_info.external_ids.ea_ns.display_values + except Exception: + product.info.external_ids.ean = None + try: + product.info.external_ids.isbn = item.item_info.external_ids.isb_ns.display_values + except Exception: + product.info.external_ids.isbn = None + try: + product.info.external_ids.upc = item.item_info.external_ids.up_cs.display_values + except Exception: + product.info.external_ids.upc = None + + # Product + product.product = Class() + try: + product.product.features = item.item_info.features.display_values + except Exception: + product.product.features = None + try: + product.product.languages = [] + for x in item.item_info.content_info.languages.display_values: + product.product.languages.append(x.display_value + ' ' + x.type) + except Exception: + product.product.languages = None + try: + product.product.pages_count = item.item_info.content_info.pages_count.display_value + except Exception: + product.product.pages_count = None + try: + product.product.formats = item.item_info.technical_info.formats.display_values + except Exception: + product.product.formats = None + try: + product.product.color = item.item_info.product_info.color.display_value + except Exception: + product.product.color = None + try: + product.product.unit_count = item.item_info.product_info.unit_count.display_value + except Exception: + product.product.unit_count = None + product.product.dimensions = Class() + try: + product.product.size = item.item_info.product_info.size.display_value + except Exception: + product.product.size = None + product.product.dimensions.height = Class() + try: + product.product.dimensions.height.value = item.item_info.product_info.item_dimensions.height.display_value + except Exception: + product.product.dimensions.height.value = None + try: + product.product.dimensions.height.unit = item.item_info.product_info.item_dimensions.height.unit + except Exception: + product.product.dimensions.height.unit = None + product.product.dimensions.length = Class() + try: + product.product.dimensions.length.value = item.item_info.product_info.item_dimensions.length.display_value + except Exception: + product.product.dimensions.length.value = None + try: + product.product.dimensions.length.unit = item.item_info.product_info.item_dimensions.length.unit + except Exception: + product.product.dimensions.length.unit = None + product.product.dimensions.width = Class() + try: + product.product.dimensions.width.value = item.item_info.product_info.item_dimensions.width.display_value + except Exception: + product.product.dimensions.width.value = None + try: + product.product.dimensions.width.unit = item.item_info.product_info.item_dimensions.width.unit + except Exception: + product.product.dimensions.width.unit = None + product.product.weight = Class() + try: + product.product.weight.value = item.item_info.product_info.item_dimensions.weight.display_value + except Exception: + product.product.weight.value = None + try: + product.product.weight.unit = item.item_info.product_info.item_dimensions.weight.unit + except Exception: + product.product.weight.unit = None + + # Images + product.images = Class() + try: + product.images.large = item.images.primary.large.url + except Exception: + product.images.large = None + try: + product.images.medium = item.images.primary.medium.url + except Exception: + product.images.medium = None + try: + product.images.small = item.images.primary.small.url + except Exception: + product.images.small = None + try: + product.images.variants = Class() + product.images.variants.small = [] + product.images.variants.medium = [] + product.images.variants.large = [] + for variant in item.images.variants: + try: + product.images.variants.large.append(variant.large.url) + product.images.variants.medium.append(variant.medium.url) + product.images.variants.small.append(variant.small.url) + except Exception: + pass + if not product.images.variants.small and not product.images.variants.medium and not product.images.variants.large: + product.images.variants = None + except Exception: + product.images.variants = None + product.images.cropped = Class() + product.images.cropped.small = [] + product.images.cropped.medium = [] + product.images.cropped.large = [] + try: + product.images.cropped.small.append(product.images.small.replace('_SL', '_AC')) + except Exception: + pass + try: + product.images.cropped.medium.append(product.images.medium.replace('_SL', '_AC')) + except Exception: + pass + try: + product.images.cropped.large.append(product.images.large.replace('.jpg', '._AC_.jpg')) + except Exception: + pass + try: + for x in product.images.variants.small: + product.images.cropped.small.append(x.replace('_SL', '_AC')) + except Exception: + pass + try: + for x in product.images.variants.medium: + product.images.cropped.medium.append(x.replace('_SL', '_AC')) + except Exception: + pass + try: + for x in product.images.variants.large: + product.images.cropped.large.append(x.replace('.jpg', '._AC_.jpg')) + except Exception: + pass + + # Trade In + product.trade_in = Class() + try: + product.trade_in.eligible = item.item_info.trade_in_info.is_eligible_for_trade_in + except Exception: + product.trade_in.eligible = None + try: + product.trade_in.price = item.item_info.trade_in_info.price.amount + except Exception: + product.trade_in.price = None + try: + product.trade_in.currency = item.item_info.trade_in_info.price.currency + except Exception: + product.trade_in.currency = None + if not product.trade_in.eligible and not product.trade_in.price and not product.trade_in.currency: + product.trade_in = None + + # Prices + try: + listings = item.offers.listings[0] + except Exception: + listings = None + product.prices = Class() + product.prices.price = Class() + try: + product.prices.price.value = listings.price.amount + except Exception: + product.prices.price.value = None + try: + product.prices.price.currency = listings.price.currency + except Exception: + product.prices.price.currency = None + try: + product.prices.price.per_unit = listings.price.price_per_unit + except Exception: + product.prices.price.per_unit = None + try: + product.prices.price.display = listings.price.display_amount + except Exception: + product.prices.price.display = None + product.prices.price.savings = Class() + try: + product.prices.price.savings.value = listings.price.savings.amount + except Exception: + product.prices.price.savings.value = None + try: + product.prices.price.savings.currency = listings.price.savings.currency + except Exception: + product.prices.price.savings.currency = None + try: + product.prices.price.savings.per_unit = listings.price.savings.price_per_unit + except Exception: + product.prices.price.savings.per_unit = None + try: + product.prices.price.savings.display = listings.price.savings.display_amount + except Exception: + product.prices.price.savings.display = None + try: + product.prices.price.savings.percentage = listings.price.savings.percentage + except Exception: + product.prices.price.savings.percentage = None + product.prices.pvp = Class() + try: + product.prices.pvp.value = listings.saving_basis.amount + except Exception: + product.prices.pvp.value = None + try: + product.prices.pvp.currency = listings.saving_basis.currency + except Exception: + product.prices.pvp.currency = None + try: + product.prices.pvp.per_unit = listings.saving_basis.price_per_unit + except Exception: + product.prices.pvp.per_unit = None + try: + product.prices.pvp.display = listings.saving_basis.display_amount + except Exception: + product.prices.pvp.display = None + product.prices.availability = Class() + try: + product.prices.availability.message = listings.availability.message + except Exception: + product.prices.availability.message = None + try: + product.prices.availability.type = listings.availability.type + except Exception: + product.prices.availability.type = None + try: + product.prices.availability.max_order_quantity = listings.availability.max_order_quantity + except Exception: + product.prices.availability.max_order_quantity = None + try: + product.prices.availability.min_order_quantity = listings.availability.min_order_quantity + except Exception: + product.prices.availability.min_order_quantity = None + product.prices.condition = Class() + try: + product.prices.condition.condition = listings.condition.value + except Exception: + product.prices.condition = None + try: + product.prices.condition.condition_display = listings.condition.display_value + except Exception: + product.prices.condition_display = None + try: + product.prices.condition.sub_condition = listings.condition.sub_condition.value + except Exception: + product.prices.sub_condition = None + try: + product.prices.condition.sub_condition_display = listings.condition.sub_condition.display_value + except Exception: + product.prices.sub_condition_display = None + product.prices.merchant = Class() + try: + product.prices.merchant.default_shipping_country = listings.merchant_info.default_shipping_country + except Exception: + product.prices.merchant.default_shipping_country = None + try: + product.prices.merchant.merchant_id = listings.merchant_info.id + except Exception: + product.prices.merchant.merchant_id = None + try: + product.prices.merchant.name = listings.merchant_info.name + except Exception: + product.prices.merchant.name = None + product.prices.other = Class() + try: + product.prices.other.buybox_winner = listings.is_buy_box_winner + except Exception: + product.prices.other.buybox_winner = None + try: + product.prices.other.loyalty_points = listings.loyalty_points + except Exception: + product.prices.other.loyalty_points = None + try: + product.prices.other.amazon_fulfilled = listings.delivery_info.is_amazon_fulfilled + except Exception: + product.prices.other.amazon_fulfilled = None + try: + product.prices.other.free_shipping_eligible = listings.delivery_info.is_free_shipping_eligible + except Exception: + product.prices.other.free_shipping_eligible = None + try: + product.prices.other.prime_eligible = listings.delivery_info.is_prime_eligible + except Exception: + product.prices.other.prime_eligible = None + try: + product.prices.other.prime_exclusive = listings.program_eligibility.is_prime_exclusive + except Exception: + product.prices.other.prime_exclusive = None + try: + product.prices.other.prime_pantry = listings.program_eligibility.is_prime_pantry + except Exception: + product.prices.other.prime_pantry = None + try: + product.prices.other.violates_map = listings.violates_map + except Exception: + product.prices.other.violates_map = None + try: + product.prices.other.offer_id = listings.id + except Exception: + product.prices.other.offer_id = None + + # Offers Summary + try: + summaries = item.offers.summaries + product.offers_summary = [] + except Exception: + summaries = None + product.offers_summary = None + if summaries: + for x in summaries: + offer = Class() + offer.highest_price = Class() + offer.lowest_price = Class() + try: + offer.highest_price.value = x.highest_price.amount + except Exception: + offer.highest_price.value = None + try: + offer.highest_price.currency = x.highest_price.currency + except Exception: + offer.highest_price.currency = None + try: + offer.highest_price.per_unit = x.highest_price.price_per_unit + except Exception: + offer.highest_price.per_unit = None + try: + offer.highest_price.display = x.highest_price.display_amount + except Exception: + offer.highest_price.display = None + try: + offer.lowest_price.value = x.lowest_price.amount + except Exception: + offer.lowest_price.value = None + try: + offer.lowest_price.currency = x.lowest_price.currency + except Exception: + offer.lowest_price.currency = None + try: + offer.lowest_price.per_unit = x.lowest_price.price_per_unit + except Exception: + offer.lowest_price.per_unit = None + try: + offer.lowest_price.display = x.lowest_price.display_amount + except Exception: + offer.lowest_price.display = None + offer.condition = Class() + try: + offer.condition.condition = x.condition.value + except Exception: + offer.condition.condition = None + try: + offer.condition.condition.condition_display = x.condition.display_value + except Exception: + offer.condition.condition_display = None + try: + offer.condition.condition.sub_condition = x.condition.sub_condition.value + except Exception: + offer.condition.sub_condition = None + try: + offer.condition.condition.sub_condition_display = x.condition.sub_condition.display_value + except Exception: + offer.condition.sub_condition_display = None + try: + offer.offer_count = x.offer_count + except Exception: + offer.offer_count = None + product.offers_summary.append(offer) + + return product diff --git a/amazon/serializer/dango_rest_framework.py b/amazon/serializer/dango_rest_framework.py new file mode 100644 index 0000000..8988c15 --- /dev/null +++ b/amazon/serializer/dango_rest_framework.py @@ -0,0 +1,156 @@ +from rest_framework import serializers + + +class _AmazonValueUnitSerializer(serializers.Serializer): + value = serializers.FloatField() + unit = serializers.CharField() + + +class _AmazonDimensionsSerializer(serializers.Serializer): + height = _AmazonValueUnitSerializer() + length = _AmazonValueUnitSerializer() + width = _AmazonValueUnitSerializer() + + +class _AmazonProductSerializer(serializers.Serializer): + features = serializers.ListField() + languages = serializers.ListField() + formats = serializers.ListField() + pages_count = serializers.ListField() + color = serializers.CharField() + unit_count = serializers.IntegerField() + size = serializers.CharField() + dimensions = _AmazonDimensionsSerializer() + weight = _AmazonValueUnitSerializer() + + +class _AmazonContributorsSerializer(serializers.Serializer): + name = serializers.CharField() + role = serializers.CharField() + + +class _AmazonExternalIdsSerializer(serializers.Serializer): + ean = serializers.ListField() + isbn = serializers.ListField() + upc = serializers.ListField() + + +class _AmazonInfoSerializer(serializers.Serializer): + contributors = _AmazonContributorsSerializer(many=True) + manufacturer = serializers.CharField() + brand = serializers.CharField() + model = serializers.CharField() + part_number = serializers.CharField() + product_group = serializers.CharField() + binding = serializers.CharField() + is_adult = serializers.BooleanField() + audience_rating = serializers.CharField() + edition = serializers.CharField() + warranty = serializers.CharField() + publication_date = serializers.CharField() + release_date = serializers.CharField() + external_ids = _AmazonExternalIdsSerializer() + + +class _AmazonImageVariantsSerializer(serializers.Serializer): + small = serializers.ListField() + medium = serializers.ListField() + large = serializers.ListField() + + +class _AmazonImagesSerializer(serializers.Serializer): + small = serializers.CharField() + medium = serializers.CharField() + large = serializers.CharField() + cropped = _AmazonImageVariantsSerializer() + variants = _AmazonImageVariantsSerializer() + + +class _AmazonTradeInSerializer(serializers.Serializer): + elegible = serializers.BooleanField() + price = serializers.FloatField() + currency = serializers.CharField() + + +class _AmazonSavingsSerializer(serializers.Serializer): + value = serializers.FloatField() + currency = serializers.CharField() + per_unit = serializers.FloatField() + display = serializers.CharField() + percentage = serializers.FloatField() + + +class _AmazonPriceSerializer(serializers.Serializer): + value = serializers.FloatField() + currency = serializers.CharField() + per_unit = serializers.FloatField() + display = serializers.CharField() + savings = _AmazonSavingsSerializer() + + +class _AmazonPvpSerializer(serializers.Serializer): + value = serializers.FloatField() + currency = serializers.CharField() + per_unit = serializers.FloatField() + display = serializers.CharField() + + +class _AmazonAvailabilitySerializer(serializers.Serializer): + max_order_quantity = serializers.IntegerField() + min_order_quantity = serializers.IntegerField() + type = serializers.CharField() + message = serializers.CharField() + + +class _AmazonConditionSerializer(serializers.Serializer): + condition = serializers.CharField() + condition_display = serializers.CharField() + sub_condition = serializers.CharField() + sub_condition_display = serializers.CharField() + + +class _AmazonMerchantSerializer(serializers.Serializer): + default_shipping_country = serializers.CharField() + merchant_id = serializers.CharField() + name = serializers.CharField() + + +class _AmazonOtherSerializer(serializers.Serializer): + buybox_winner = serializers.BooleanField() + loyalty_points = serializers.IntegerField() + amazon_fulfilled = serializers.BooleanField() + free_shipping_eligible = serializers.BooleanField() + prime_eligible = serializers.BooleanField() + prime_exclusive = serializers.BooleanField() + prime_pantry = serializers.BooleanField() + violates_map = serializers.BooleanField() + offer_id = serializers.CharField() + + +class _AmazonPricesSerializer(serializers.Serializer): + price = _AmazonPriceSerializer() + pvp = _AmazonPvpSerializer() + availability = _AmazonAvailabilitySerializer() + condition = _AmazonConditionSerializer() + merchant = _AmazonMerchantSerializer() + other = _AmazonOtherSerializer() + + +class _AmazonOffersSummarySerializer(serializers.Serializer): + highest_price = _AmazonPvpSerializer() + lowest_price = _AmazonPvpSerializer() + condition = _AmazonConditionSerializer() + offer_count = serializers.IntegerField() + + +class AmazonProductSerializer(serializers.Serializer): + asin = serializers.CharField(max_length=10) + parent_asin = serializers.CharField(max_length=10) + title = serializers.CharField() + url = serializers.CharField() + product = _AmazonProductSerializer() + info = _AmazonInfoSerializer() + images = _AmazonImagesSerializer() + trade_in = _AmazonTradeInSerializer() + prices = _AmazonPricesSerializer() + offers_summary = _AmazonOffersSummarySerializer(many=True) diff --git a/amazon/tools.py b/amazon/tools.py new file mode 100644 index 0000000..c67e29f --- /dev/null +++ b/amazon/tools.py @@ -0,0 +1,26 @@ +"""Some useful tools.""" + +import re + + +def get_asin(url: str): + """Find the ASIN from a given URL. + + Args: + url (str): The URL containing the product ASIN. + + Returns: + str: Product ASIN. None if ASIN not found. + """ + # Return if url parameter already is the ASIN + if re.search(r'^[A-Z0-9]{10}$', url): + return url + # Extract ASIN from URL searching for alphanumeric and 10 digits + have_asin = re.search(r'(dp|gp/product|gp/aw/d|dp/product)/([a-zA-Z0-9]{10})', url) + return have_asin.group(2) if have_asin else None + + +def chunks(lst, n): + """Yield successive n-sized chunks from lst.""" + for i in range(0, len(lst), n): + yield lst[i:i + n] diff --git a/paapi5_python_sdk/COPYING.txt b/paapi5_python_sdk/COPYING.txt new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/paapi5_python_sdk/COPYING.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License 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. diff --git a/paapi5_python_sdk/LICENSE.txt b/paapi5_python_sdk/LICENSE.txt new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/paapi5_python_sdk/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License 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. diff --git a/paapi5_python_sdk/NOTICE.txt b/paapi5_python_sdk/NOTICE.txt new file mode 100644 index 0000000..526e5d9 --- /dev/null +++ b/paapi5_python_sdk/NOTICE.txt @@ -0,0 +1,2 @@ +Product Advertising API 5.0 SDK for Python +Copyright 2019-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. \ No newline at end of file diff --git a/paapi5_python_sdk/__init__.py b/paapi5_python_sdk/__init__.py new file mode 100644 index 0000000..df27015 --- /dev/null +++ b/paapi5_python_sdk/__init__.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +# flake8: noqa + +from __future__ import absolute_import + +""" + Copyright 2019 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 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +# import apis into sdk package +from paapi5_python_sdk.api.default_api import DefaultApi + +# import auth into sdk package +from paapi5_python_sdk.auth.sig_v4 import AWSV4Auth + +# import ApiClient +from paapi5_python_sdk.api_client import ApiClient +from paapi5_python_sdk.configuration import Configuration +# import models into sdk package +from paapi5_python_sdk.availability import Availability +from paapi5_python_sdk.browse_node import BrowseNode +from paapi5_python_sdk.browse_node_ancestor import BrowseNodeAncestor +from paapi5_python_sdk.browse_node_child import BrowseNodeChild +from paapi5_python_sdk.browse_node_children import BrowseNodeChildren +from paapi5_python_sdk.browse_node_info import BrowseNodeInfo +from paapi5_python_sdk.browse_nodes_result import BrowseNodesResult +from paapi5_python_sdk.by_line_info import ByLineInfo +from paapi5_python_sdk.classifications import Classifications +from paapi5_python_sdk.condition import Condition +from paapi5_python_sdk.content_info import ContentInfo +from paapi5_python_sdk.content_rating import ContentRating +from paapi5_python_sdk.contributor import Contributor +from paapi5_python_sdk.delivery_flag import DeliveryFlag +from paapi5_python_sdk.dimension_based_attribute import DimensionBasedAttribute +from paapi5_python_sdk.duration_price import DurationPrice +from paapi5_python_sdk.error_data import ErrorData +from paapi5_python_sdk.external_ids import ExternalIds +from paapi5_python_sdk.get_browse_nodes_request import GetBrowseNodesRequest +from paapi5_python_sdk.get_browse_nodes_resource import GetBrowseNodesResource +from paapi5_python_sdk.get_browse_nodes_response import GetBrowseNodesResponse +from paapi5_python_sdk.get_items_request import GetItemsRequest +from paapi5_python_sdk.get_items_resource import GetItemsResource +from paapi5_python_sdk.get_items_response import GetItemsResponse +from paapi5_python_sdk.get_variations_request import GetVariationsRequest +from paapi5_python_sdk.get_variations_resource import GetVariationsResource +from paapi5_python_sdk.get_variations_response import GetVariationsResponse +from paapi5_python_sdk.image_size import ImageSize +from paapi5_python_sdk.image_type import ImageType +from paapi5_python_sdk.images import Images +from paapi5_python_sdk.item import Item +from paapi5_python_sdk.item_id_type import ItemIdType +from paapi5_python_sdk.item_info import ItemInfo +from paapi5_python_sdk.items_result import ItemsResult +from paapi5_python_sdk.language_type import LanguageType +from paapi5_python_sdk.languages import Languages +from paapi5_python_sdk.manufacture_info import ManufactureInfo +from paapi5_python_sdk.max_price import MaxPrice +from paapi5_python_sdk.merchant import Merchant +from paapi5_python_sdk.min_price import MinPrice +from paapi5_python_sdk.min_reviews_rating import MinReviewsRating +from paapi5_python_sdk.min_saving_percent import MinSavingPercent +from paapi5_python_sdk.multi_valued_attribute import MultiValuedAttribute +from paapi5_python_sdk.offer_availability import OfferAvailability +from paapi5_python_sdk.offer_condition import OfferCondition +from paapi5_python_sdk.offer_count import OfferCount +from paapi5_python_sdk.offer_delivery_info import OfferDeliveryInfo +from paapi5_python_sdk.offer_listing import OfferListing +from paapi5_python_sdk.offer_loyalty_points import OfferLoyaltyPoints +from paapi5_python_sdk.offer_merchant_info import OfferMerchantInfo +from paapi5_python_sdk.offer_price import OfferPrice +from paapi5_python_sdk.offer_program_eligibility import OfferProgramEligibility +from paapi5_python_sdk.offer_promotion import OfferPromotion +from paapi5_python_sdk.offer_savings import OfferSavings +from paapi5_python_sdk.offer_shipping_charge import OfferShippingCharge +from paapi5_python_sdk.offer_sub_condition import OfferSubCondition +from paapi5_python_sdk.offer_summary import OfferSummary +from paapi5_python_sdk.offers import Offers +from paapi5_python_sdk.partner_type import PartnerType +from paapi5_python_sdk.price import Price +from paapi5_python_sdk.product_advertising_api_client_exception import ProductAdvertisingAPIClientException +from paapi5_python_sdk.product_advertising_api_service_exception import ProductAdvertisingAPIServiceException +from paapi5_python_sdk.product_info import ProductInfo +from paapi5_python_sdk.properties import Properties +from paapi5_python_sdk.refinement import Refinement +from paapi5_python_sdk.refinement_bin import RefinementBin +from paapi5_python_sdk.rental_offer_listing import RentalOfferListing +from paapi5_python_sdk.rental_offers import RentalOffers +from paapi5_python_sdk.search_items_request import SearchItemsRequest +from paapi5_python_sdk.search_items_resource import SearchItemsResource +from paapi5_python_sdk.search_items_response import SearchItemsResponse +from paapi5_python_sdk.search_refinements import SearchRefinements +from paapi5_python_sdk.search_result import SearchResult +from paapi5_python_sdk.single_boolean_valued_attribute import SingleBooleanValuedAttribute +from paapi5_python_sdk.single_integer_valued_attribute import SingleIntegerValuedAttribute +from paapi5_python_sdk.single_string_valued_attribute import SingleStringValuedAttribute +from paapi5_python_sdk.sort_by import SortBy +from paapi5_python_sdk.technical_info import TechnicalInfo +from paapi5_python_sdk.trade_in_info import TradeInInfo +from paapi5_python_sdk.trade_in_price import TradeInPrice +from paapi5_python_sdk.unit_based_attribute import UnitBasedAttribute +from paapi5_python_sdk.variation_attribute import VariationAttribute +from paapi5_python_sdk.variation_dimension import VariationDimension +from paapi5_python_sdk.variation_summary import VariationSummary +from paapi5_python_sdk.variations_result import VariationsResult +from paapi5_python_sdk.website_sales_rank import WebsiteSalesRank diff --git a/paapi5_python_sdk/api/__init__.py b/paapi5_python_sdk/api/__init__.py new file mode 100644 index 0000000..c064c41 --- /dev/null +++ b/paapi5_python_sdk/api/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +# flake8: noqa + +from __future__ import absolute_import + +""" + Copyright 2019 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 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +# import apis into api package +from paapi5_python_sdk.api.default_api import DefaultApi diff --git a/paapi5_python_sdk/api/default_api.py b/paapi5_python_sdk/api/default_api.py new file mode 100644 index 0000000..c2069f1 --- /dev/null +++ b/paapi5_python_sdk/api/default_api.py @@ -0,0 +1,428 @@ +# coding: utf-8 + +from __future__ import absolute_import + +""" + Copyright 2019 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 re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from paapi5_python_sdk.api_client import ApiClient + + +class DefaultApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, + access_key=None, + secret_key=None, + host=None, + region=None, + api_client=None): + if not host: + host = "webservices.amazon.com" + if not region: + region = "us-east-1" + if api_client is None: + api_client = ApiClient(access_key = access_key, + secret_key = secret_key, + host = host, + region = region) + self.api_client = api_client + + def get_browse_nodes(self, get_browse_nodes_request, **kwargs): # noqa: E501 + """get_browse_nodes # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_browse_nodes(get_browse_nodes_request, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param GetBrowseNodesRequest get_browse_nodes_request: GetBrowseNodesRequest (required) + :return: GetBrowseNodesResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_browse_nodes_with_http_info(get_browse_nodes_request, **kwargs) # noqa: E501 + else: + (data) = self.get_browse_nodes_with_http_info(get_browse_nodes_request, **kwargs) # noqa: E501 + return data + + def get_browse_nodes_with_http_info(self, get_browse_nodes_request, **kwargs): # noqa: E501 + """get_browse_nodes # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_browse_nodes_with_http_info(get_browse_nodes_request, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param GetBrowseNodesRequest get_browse_nodes_request: GetBrowseNodesRequest (required) + :return: GetBrowseNodesResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['get_browse_nodes_request'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_browse_nodes" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'get_browse_nodes_request' is set + if ('get_browse_nodes_request' not in params or + params['get_browse_nodes_request'] is None): + raise ValueError("Missing the required parameter `get_browse_nodes_request` when calling `get_browse_nodes`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'get_browse_nodes_request' in params: + body_params = params['get_browse_nodes_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/paapi5/getbrowsenodes', 'POST', 'GetBrowseNodes', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='GetBrowseNodesResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_items(self, get_items_request, **kwargs): # noqa: E501 + """get_items # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_items(get_items_request, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param GetItemsRequest get_items_request: GetItemsRequest (required) + :return: GetItemsResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_items_with_http_info(get_items_request, **kwargs) # noqa: E501 + else: + (data) = self.get_items_with_http_info(get_items_request, **kwargs) # noqa: E501 + return data + + def get_items_with_http_info(self, get_items_request, **kwargs): # noqa: E501 + """get_items # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_items_with_http_info(get_items_request, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param GetItemsRequest get_items_request: GetItemsRequest (required) + :return: GetItemsResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['get_items_request'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_items" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'get_items_request' is set + if ('get_items_request' not in params or + params['get_items_request'] is None): + raise ValueError("Missing the required parameter `get_items_request` when calling `get_items`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'get_items_request' in params: + body_params = params['get_items_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/paapi5/getitems', 'POST', 'GetItems', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='GetItemsResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_variations(self, get_variations_request, **kwargs): # noqa: E501 + """get_variations # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_variations(get_variations_request, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param GetVariationsRequest get_variations_request: GetVariationsRequest (required) + :return: GetVariationsResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_variations_with_http_info(get_variations_request, **kwargs) # noqa: E501 + else: + (data) = self.get_variations_with_http_info(get_variations_request, **kwargs) # noqa: E501 + return data + + def get_variations_with_http_info(self, get_variations_request, **kwargs): # noqa: E501 + """get_variations # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_variations_with_http_info(get_variations_request, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param GetVariationsRequest get_variations_request: GetVariationsRequest (required) + :return: GetVariationsResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['get_variations_request'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_variations" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'get_variations_request' is set + if ('get_variations_request' not in params or + params['get_variations_request'] is None): + raise ValueError("Missing the required parameter `get_variations_request` when calling `get_variations`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'get_variations_request' in params: + body_params = params['get_variations_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/paapi5/getvariations', 'POST', 'GetVariations', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='GetVariationsResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def search_items(self, search_items_request, **kwargs): # noqa: E501 + """search_items # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.search_items(search_items_request, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param SearchItemsRequest search_items_request: SearchItemsRequest (required) + :return: SearchItemsResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.search_items_with_http_info(search_items_request, **kwargs) # noqa: E501 + else: + (data) = self.search_items_with_http_info(search_items_request, **kwargs) # noqa: E501 + return data + + def search_items_with_http_info(self, search_items_request, **kwargs): # noqa: E501 + """search_items # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.search_items_with_http_info(search_items_request, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param SearchItemsRequest search_items_request: SearchItemsRequest (required) + :return: SearchItemsResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['search_items_request'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method search_items" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'search_items_request' is set + if ('search_items_request' not in params or + params['search_items_request'] is None): + raise ValueError("Missing the required parameter `search_items_request` when calling `search_items`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'search_items_request' in params: + body_params = params['search_items_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/paapi5/searchitems', 'POST', 'SearchItems', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='SearchItemsResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/paapi5_python_sdk/api_client.py b/paapi5_python_sdk/api_client.py new file mode 100644 index 0000000..a484778 --- /dev/null +++ b/paapi5_python_sdk/api_client.py @@ -0,0 +1,685 @@ +# coding: utf-8 + +from __future__ import absolute_import + +""" + Copyright 2019 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 datetime +import json +import mimetypes +from multiprocessing.pool import ThreadPool +import os +import re +import tempfile + +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import quote + +from paapi5_python_sdk.configuration import Configuration +import paapi5_python_sdk +from paapi5_python_sdk import rest + +from paapi5_python_sdk.auth.sig_v4 import AWSV4Auth + +class ApiClient(object): + """Generic API client for Swagger client library builds. + + Swagger generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the Swagger + templates. + + NOTE: This class is auto generated by the swagger code generator program. + Ref: https://github.com/swagger-api/swagger-codegen + Do not edit the class manually. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + """ + + PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int if six.PY3 else long, # noqa: F821 + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'object': object, + } + + def __init__(self, + access_key, + secret_key, + host, + region, + configuration=None, + header_name=None, + header_value=None, + cookie=None): + if configuration is None: + configuration = Configuration() + self.configuration = configuration + + self.pool = None + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'paapi5-python-sdk/1.0.0' + + self.access_key = access_key + self.secret_key = secret_key + self.host = host + self.region = region + + def __del__(self): + if self.pool is not None: + self.pool.close() + self.pool.join() + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + def __call_api( + self, resource_path, method, api_name, path_params=None, + query_params=None, header_params=None, body=None, post_params=None, + files=None, response_type=None, auth_settings=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None): + + if self.access_key is None or self.secret_key is None: + raise ValueError("Missing Credentials (Access Key and SecretKey). Please specify credentials.") + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict(self.parameters_to_tuples(header_params, + collection_formats)) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples(path_params, + collection_formats) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + query_params = self.parameters_to_tuples(query_params, + collection_formats) + + # post parameters + if post_params or files: + post_params = self.prepare_post_parameters(post_params, files) + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples(post_params, + collection_formats) + + # auth setting + self.update_params_for_auth(header_params, query_params, auth_settings, api_name, method, body, resource_path) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + url = "https://" + self.host + resource_path + + # perform request and return response + response_data = self.request( + method, url, query_params=query_params, headers=header_params, + post_params=post_params, body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) + + self.last_response = response_data + + return_data = response_data + if _preload_content: + # deserialize response data + if response_type: + return_data = self.deserialize(response_data, response_type) + else: + return_data = None + + if _return_http_data_only: + return (return_data) + else: + return (return_data, response_data.status, + response_data.getheaders()) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is swagger model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, list): + return [self.sanitize_for_serialization(sub_obj) + for sub_obj in obj] + elif isinstance(obj, tuple): + return tuple(self.sanitize_for_serialization(sub_obj) + for sub_obj in obj) + elif isinstance(obj, (datetime.datetime, datetime.date)): + return obj.isoformat() + + if isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `swagger_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) + for attr, _ in six.iteritems(obj.swagger_types) + if getattr(obj, attr) is not None} + + return {key: self.sanitize_for_serialization(val) + for key, val in six.iteritems(obj_dict)} + + def deserialize(self, response, response_type): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + + :return: deserialized object. + """ + # handle file downloading + # save response body into a tmp file and return the instance + if response_type == "file": + return self.__deserialize_file(response) + + # fetch data from response object + try: + data = json.loads(response.data) + except ValueError: + data = response.data + + return self.__deserialize(data, response_type) + + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if type(klass) == str: + if klass.startswith('list['): + sub_kls = re.match(r'list\[(.*)\]', klass).group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('dict('): + sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in six.iteritems(data)} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(paapi5_python_sdk, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datatime(data) + else: + return self.__deserialize_model(data, klass) + + def call_api(self, resource_path, method, api_name, + path_params=None, query_params=None, header_params=None, + body=None, post_params=None, files=None, + response_type=None, auth_settings=None, async_req=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None): + """Makes the HTTP request (synchronous) and returns deserialized data. + + To make an async request, set the async_req parameter. + + :param resource_path: Path to method endpoint. + :param method: Method to call. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param response: Response data type. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param async_req bool: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: + If async_req parameter is True, + the request will be called asynchronously. + The method will return the request thread. + If parameter async_req is False or missing, + then the method will return the response directly. + """ + if not async_req: + return self.__call_api(resource_path, method, api_name, + path_params, query_params, header_params, + body, post_params, files, + response_type, auth_settings, + _return_http_data_only, collection_formats, + _preload_content, _request_timeout) + else: + if self.pool is None: + self.pool = ThreadPool() + thread = self.pool.apply_async(self.__call_api, (resource_path, + method, api_name, path_params, query_params, + header_params, body, + post_params, files, + response_type, auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, _request_timeout)) + return thread + + def request(self, method, url, query_params=None, headers=None, + post_params=None, body=None, _preload_content=True, + _request_timeout=None): + """Makes the HTTP request using RESTClient.""" + if method == "GET": + return self.rest_client.GET(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "HEAD": + return self.rest_client.HEAD(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "OPTIONS": + return self.rest_client.OPTIONS(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "POST": + return self.rest_client.POST(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PUT": + return self.rest_client.PUT(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PATCH": + return self.rest_client.PATCH(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "DELETE": + return self.rest_client.DELETE(url, + query_params=query_params, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + else: + raise ValueError( + "http method must be `GET`, `HEAD`, `OPTIONS`," + " `POST`, `PATCH`, `PUT` or `DELETE`." + ) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params = [] + if collection_formats is None: + collection_formats = {} + for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def prepare_post_parameters(self, post_params=None, files=None): + """Builds form parameters. + + :param post_params: Normal form parameters. + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + + if post_params: + params = post_params + + if files: + for k, v in six.iteritems(files): + if not v: + continue + file_names = v if type(v) is list else [v] + for n in file_names: + with open(n, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + mimetype = (mimetypes.guess_type(filename)[0] or + 'application/octet-stream') + params.append( + tuple([k, tuple([filename, filedata, mimetype])])) + + return params + + def select_header_accept(self, accepts): + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return + + accepts = [x.lower() for x in accepts] + + if 'application/json' in accepts: + return 'application/json' + else: + return ', '.join(accepts) + + def select_header_content_type(self, content_types): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return 'application/json' + + content_types = [x.lower() for x in content_types] + + if 'application/json' in content_types or '*/*' in content_types: + return 'application/json' + else: + return content_types[0] + + def get_amz_date(self, utc_timestamp): + return utc_timestamp.strftime('%Y%m%dT%H%M%SZ') + + def update_params_for_auth(self, headers, querys, auth_settings, api_name, method, body, resource_path): + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param querys: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + """ + if not auth_settings: + service = 'ProductAdvertisingAPI' + utc_timestamp = datetime.datetime.utcnow() + 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' + headers['host'] = self.host + headers['x-amz-date'] = self.get_amz_date(utc_timestamp) + awsv4Auth = AWSV4Auth(access_key=self.access_key, + secret_key=self.secret_key, + host=self.host, + region=self.region, + service=service, + method_name=method, + timestamp=utc_timestamp, + headers=headers, + payload=self.sanitize_for_serialization(body), + path=resource_path) + authHeaders = awsv4Auth.getHeaders() + + return + + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + if not auth_setting['value']: + continue + elif auth_setting['in'] == 'header': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + querys.append((auth_setting['key'], auth_setting['value'])) + else: + raise ValueError( + 'Authentication token must be in `query` or `header`' + ) + + def __deserialize_file(self, response): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.getheader("Content-Disposition") + if content_disposition: + filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition).group(1) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "wb") as f: + f.write(response.data) + + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return six.text_type(data) + #try: + #return unicode(data.replace(r'\\', r'\\\\'), "unicode_escape") + #except TypeError as e: + #if "decoding Unicode is not supported" in str(e): + #return unicode(data.replace(r'\\', r'\\\\')) + except TypeError: + return data + + def __deserialize_object(self, value): + """Return a original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + from dateutil.parser import parse + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) + ) + + def __deserialize_datatime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + from dateutil.parser import parse + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) + ) + + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + if not klass.swagger_types and not hasattr(klass, + 'get_real_child_model'): + return data + + kwargs = {} + if klass.swagger_types is not None: + for attr, attr_type in six.iteritems(klass.swagger_types): + if (data is not None and + klass.attribute_map[attr] in data and + isinstance(data, (list, dict))): + value = data[klass.attribute_map[attr]] + kwargs[attr] = self.__deserialize(value, attr_type) + + instance = klass(**kwargs) + + if (isinstance(instance, dict) and + klass.swagger_types is not None and + isinstance(data, dict)): + for key, value in data.items(): + if key not in klass.swagger_types: + instance[key] = value + if hasattr(instance, 'get_real_child_model'): + klass_name = instance.get_real_child_model(data) + if klass_name: + instance = self.__deserialize(data, klass_name) + return instance diff --git a/paapi5_python_sdk/auth/__init__.py b/paapi5_python_sdk/auth/__init__.py new file mode 100644 index 0000000..f6d79ee --- /dev/null +++ b/paapi5_python_sdk/auth/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +# flake8: noqa + +from __future__ import absolute_import + +""" + Copyright 2019 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 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +# import auth into sdk package +from paapi5_python_sdk.auth.sig_v4 import AWSV4Auth diff --git a/paapi5_python_sdk/auth/sig_v4.py b/paapi5_python_sdk/auth/sig_v4.py new file mode 100644 index 0000000..6fc4bdc --- /dev/null +++ b/paapi5_python_sdk/auth/sig_v4.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Copyright 2019 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 + +""" + +import hashlib +import hmac +import json + + +class AWSV4Auth: + def __init__( + self, + access_key, + secret_key, + host, + region, + service, + method_name, + timestamp, + headers={}, + path="", + payload="", + ): + self.access_key = access_key + self.secret_key = secret_key + self.host = host + self.region = region + self.service = service + self.method_name = method_name + self.headers = headers + self.timestamp = timestamp + self.payload = payload + self.path = path + + self.xAmzDateTime = self.timestamp.strftime("%Y%m%dT%H%M%SZ") + self.xAmzDate = self.timestamp.strftime("%Y%m%d") + + def getHeaders(self): + canonical_request = self.prepareCanonicalURL() + string_to_sign = self.prepareStringToSign(canonical_request=canonical_request) + signing_key = self.getSignatureKey( + self.secret_key, self.xAmzDate, self.region, self.service + ) + signature = self.getSignature( + signing_key=signing_key, string_to_sign=string_to_sign + ) + + authorization_header = ( + self.algorithm + + " " + + "Credential=" + + self.access_key + + "/" + + self.credential_scope + + ", " + + "SignedHeaders=" + + self.signed_header + + ", " + + "Signature=" + + signature + ) + self.headers["Authorization"] = authorization_header + return self.headers + + def prepareCanonicalURL(self): + canonical_uri = self.method_name + "\n" + self.path + canonical_querystring = "" + canonical_header = "" + self.signed_header = "" + sortedkeys = sorted(self.headers, key=str.lower) + for key in sortedkeys: + self.signed_header = self.signed_header + key.lower() + ";" + canonical_header = ( + canonical_header + key.lower() + ":" + self.headers[key] + "\n" + ) + self.signed_header = self.signed_header[:-1] + payload_hash = hashlib.sha256( + json.dumps(self.payload).encode("utf-8") + ).hexdigest() + canonical_request = ( + canonical_uri + + "\n" + + canonical_querystring + + "\n" + + canonical_header + + "\n" + + self.signed_header + + "\n" + + payload_hash + ) + return canonical_request + + def prepareStringToSign(self, canonical_request): + self.algorithm = "AWS4-HMAC-SHA256" + self.credential_scope = ( + self.xAmzDate + + "/" + + self.region + + "/" + + self.service + + "/" + + "aws4_request" + ) + string_to_sign = ( + self.algorithm + + "\n" + + self.xAmzDateTime + + "\n" + + self.credential_scope + + "\n" + + hashlib.sha256(canonical_request.encode("utf-8")).hexdigest() + ) + return string_to_sign + + def sign(self, key, msg): + return hmac.new(key, msg.encode("utf-8"), hashlib.sha256).digest() + + def getSignatureKey(self, key, dateStamp, regionName, serviceName): + kDate = self.sign(("AWS4" + key).encode("utf-8"), dateStamp) + kRegion = self.sign(kDate, regionName) + kService = self.sign(kRegion, serviceName) + kSigning = self.sign(kService, "aws4_request") + return kSigning + + def getSignature(self, signing_key, string_to_sign): + signature = hmac.new( + signing_key, (string_to_sign).encode("utf-8"), hashlib.sha256 + ).hexdigest() + return signature diff --git a/paapi5_python_sdk/availability.py b/paapi5_python_sdk/availability.py new file mode 100644 index 0000000..ff22efa --- /dev/null +++ b/paapi5_python_sdk/availability.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Copyright 2019 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 Availability(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + AVAILABLE = "Available" + INCLUDEOUTOFSTOCK = "IncludeOutOfStock" + + """ + 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 + """Availability - 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(Availability, 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, Availability): + 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/paapi5_python_sdk/browse_node.py b/paapi5_python_sdk/browse_node.py new file mode 100644 index 0000000..bb735b5 --- /dev/null +++ b/paapi5_python_sdk/browse_node.py @@ -0,0 +1,285 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.browse_node_ancestor import BrowseNodeAncestor # noqa: F401,E501 +from paapi5_python_sdk.browse_node_children import BrowseNodeChildren # noqa: F401,E501 + + +class BrowseNode(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 = { + 'ancestor': 'BrowseNodeAncestor', + 'children': 'BrowseNodeChildren', + 'context_free_name': 'str', + 'display_name': 'str', + 'id': 'str', + 'is_root': 'bool', + 'sales_rank': 'int' + } + + attribute_map = { + 'ancestor': 'Ancestor', + 'children': 'Children', + 'context_free_name': 'ContextFreeName', + 'display_name': 'DisplayName', + 'id': 'Id', + 'is_root': 'IsRoot', + 'sales_rank': 'SalesRank' + } + + def __init__(self, ancestor=None, children=None, context_free_name=None, display_name=None, id=None, is_root=None, sales_rank=None): # noqa: E501 + """BrowseNode - a model defined in Swagger""" # noqa: E501 + + self._ancestor = None + self._children = None + self._context_free_name = None + self._display_name = None + self._id = None + self._is_root = None + self._sales_rank = None + self.discriminator = None + + if ancestor is not None: + self.ancestor = ancestor + if children is not None: + self.children = children + if context_free_name is not None: + self.context_free_name = context_free_name + if display_name is not None: + self.display_name = display_name + if id is not None: + self.id = id + if is_root is not None: + self.is_root = is_root + if sales_rank is not None: + self.sales_rank = sales_rank + + @property + def ancestor(self): + """Gets the ancestor of this BrowseNode. # noqa: E501 + + + :return: The ancestor of this BrowseNode. # noqa: E501 + :rtype: BrowseNodeAncestor + """ + return self._ancestor + + @ancestor.setter + def ancestor(self, ancestor): + """Sets the ancestor of this BrowseNode. + + + :param ancestor: The ancestor of this BrowseNode. # noqa: E501 + :type: BrowseNodeAncestor + """ + + self._ancestor = ancestor + + @property + def children(self): + """Gets the children of this BrowseNode. # noqa: E501 + + + :return: The children of this BrowseNode. # noqa: E501 + :rtype: BrowseNodeChildren + """ + return self._children + + @children.setter + def children(self, children): + """Sets the children of this BrowseNode. + + + :param children: The children of this BrowseNode. # noqa: E501 + :type: BrowseNodeChildren + """ + + self._children = children + + @property + def context_free_name(self): + """Gets the context_free_name of this BrowseNode. # noqa: E501 + + + :return: The context_free_name of this BrowseNode. # noqa: E501 + :rtype: str + """ + return self._context_free_name + + @context_free_name.setter + def context_free_name(self, context_free_name): + """Sets the context_free_name of this BrowseNode. + + + :param context_free_name: The context_free_name of this BrowseNode. # noqa: E501 + :type: str + """ + + self._context_free_name = context_free_name + + @property + def display_name(self): + """Gets the display_name of this BrowseNode. # noqa: E501 + + + :return: The display_name of this BrowseNode. # noqa: E501 + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """Sets the display_name of this BrowseNode. + + + :param display_name: The display_name of this BrowseNode. # noqa: E501 + :type: str + """ + + self._display_name = display_name + + @property + def id(self): + """Gets the id of this BrowseNode. # noqa: E501 + + + :return: The id of this BrowseNode. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this BrowseNode. + + + :param id: The id of this BrowseNode. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def is_root(self): + """Gets the is_root of this BrowseNode. # noqa: E501 + + + :return: The is_root of this BrowseNode. # noqa: E501 + :rtype: bool + """ + return self._is_root + + @is_root.setter + def is_root(self, is_root): + """Sets the is_root of this BrowseNode. + + + :param is_root: The is_root of this BrowseNode. # noqa: E501 + :type: bool + """ + + self._is_root = is_root + + @property + def sales_rank(self): + """Gets the sales_rank of this BrowseNode. # noqa: E501 + + + :return: The sales_rank of this BrowseNode. # noqa: E501 + :rtype: int + """ + return self._sales_rank + + @sales_rank.setter + def sales_rank(self, sales_rank): + """Sets the sales_rank of this BrowseNode. + + + :param sales_rank: The sales_rank of this BrowseNode. # noqa: E501 + :type: int + """ + + self._sales_rank = sales_rank + + 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(BrowseNode, 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, BrowseNode): + 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/paapi5_python_sdk/browse_node_ancestor.py b/paapi5_python_sdk/browse_node_ancestor.py new file mode 100644 index 0000000..72c6514 --- /dev/null +++ b/paapi5_python_sdk/browse_node_ancestor.py @@ -0,0 +1,204 @@ +# coding: utf-8 + +""" + Copyright 2019 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 BrowseNodeAncestor(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 = { + 'ancestor': 'BrowseNodeAncestor', + 'context_free_name': 'str', + 'display_name': 'str', + 'id': 'str' + } + + attribute_map = { + 'ancestor': 'Ancestor', + 'context_free_name': 'ContextFreeName', + 'display_name': 'DisplayName', + 'id': 'Id' + } + + def __init__(self, ancestor=None, context_free_name=None, display_name=None, id=None): # noqa: E501 + """BrowseNodeAncestor - a model defined in Swagger""" # noqa: E501 + + self._ancestor = None + self._context_free_name = None + self._display_name = None + self._id = None + self.discriminator = None + + if ancestor is not None: + self.ancestor = ancestor + if context_free_name is not None: + self.context_free_name = context_free_name + if display_name is not None: + self.display_name = display_name + if id is not None: + self.id = id + + @property + def ancestor(self): + """Gets the ancestor of this BrowseNodeAncestor. # noqa: E501 + + + :return: The ancestor of this BrowseNodeAncestor. # noqa: E501 + :rtype: BrowseNodeAncestor + """ + return self._ancestor + + @ancestor.setter + def ancestor(self, ancestor): + """Sets the ancestor of this BrowseNodeAncestor. + + + :param ancestor: The ancestor of this BrowseNodeAncestor. # noqa: E501 + :type: BrowseNodeAncestor + """ + + self._ancestor = ancestor + + @property + def context_free_name(self): + """Gets the context_free_name of this BrowseNodeAncestor. # noqa: E501 + + + :return: The context_free_name of this BrowseNodeAncestor. # noqa: E501 + :rtype: str + """ + return self._context_free_name + + @context_free_name.setter + def context_free_name(self, context_free_name): + """Sets the context_free_name of this BrowseNodeAncestor. + + + :param context_free_name: The context_free_name of this BrowseNodeAncestor. # noqa: E501 + :type: str + """ + + self._context_free_name = context_free_name + + @property + def display_name(self): + """Gets the display_name of this BrowseNodeAncestor. # noqa: E501 + + + :return: The display_name of this BrowseNodeAncestor. # noqa: E501 + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """Sets the display_name of this BrowseNodeAncestor. + + + :param display_name: The display_name of this BrowseNodeAncestor. # noqa: E501 + :type: str + """ + + self._display_name = display_name + + @property + def id(self): + """Gets the id of this BrowseNodeAncestor. # noqa: E501 + + + :return: The id of this BrowseNodeAncestor. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this BrowseNodeAncestor. + + + :param id: The id of this BrowseNodeAncestor. # 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(BrowseNodeAncestor, 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, BrowseNodeAncestor): + 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/paapi5_python_sdk/browse_node_child.py b/paapi5_python_sdk/browse_node_child.py new file mode 100644 index 0000000..47c2d9d --- /dev/null +++ b/paapi5_python_sdk/browse_node_child.py @@ -0,0 +1,178 @@ +# coding: utf-8 + +""" + Copyright 2019 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 BrowseNodeChild(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 = { + 'context_free_name': 'str', + 'display_name': 'str', + 'id': 'str' + } + + attribute_map = { + 'context_free_name': 'ContextFreeName', + 'display_name': 'DisplayName', + 'id': 'Id' + } + + def __init__(self, context_free_name=None, display_name=None, id=None): # noqa: E501 + """BrowseNodeChild - a model defined in Swagger""" # noqa: E501 + + self._context_free_name = None + self._display_name = None + self._id = None + self.discriminator = None + + if context_free_name is not None: + self.context_free_name = context_free_name + if display_name is not None: + self.display_name = display_name + if id is not None: + self.id = id + + @property + def context_free_name(self): + """Gets the context_free_name of this BrowseNodeChild. # noqa: E501 + + + :return: The context_free_name of this BrowseNodeChild. # noqa: E501 + :rtype: str + """ + return self._context_free_name + + @context_free_name.setter + def context_free_name(self, context_free_name): + """Sets the context_free_name of this BrowseNodeChild. + + + :param context_free_name: The context_free_name of this BrowseNodeChild. # noqa: E501 + :type: str + """ + + self._context_free_name = context_free_name + + @property + def display_name(self): + """Gets the display_name of this BrowseNodeChild. # noqa: E501 + + + :return: The display_name of this BrowseNodeChild. # noqa: E501 + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """Sets the display_name of this BrowseNodeChild. + + + :param display_name: The display_name of this BrowseNodeChild. # noqa: E501 + :type: str + """ + + self._display_name = display_name + + @property + def id(self): + """Gets the id of this BrowseNodeChild. # noqa: E501 + + + :return: The id of this BrowseNodeChild. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this BrowseNodeChild. + + + :param id: The id of this BrowseNodeChild. # 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(BrowseNodeChild, 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, BrowseNodeChild): + 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/paapi5_python_sdk/browse_node_children.py b/paapi5_python_sdk/browse_node_children.py new file mode 100644 index 0000000..e0fd2e6 --- /dev/null +++ b/paapi5_python_sdk/browse_node_children.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.browse_node_child import BrowseNodeChild # noqa: F401,E501 + + +class BrowseNodeChildren(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 + """BrowseNodeChildren - 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(BrowseNodeChildren, 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, BrowseNodeChildren): + 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/paapi5_python_sdk/browse_node_info.py b/paapi5_python_sdk/browse_node_info.py new file mode 100644 index 0000000..25ed406 --- /dev/null +++ b/paapi5_python_sdk/browse_node_info.py @@ -0,0 +1,155 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.browse_node import BrowseNode # noqa: F401,E501 +from paapi5_python_sdk.website_sales_rank import WebsiteSalesRank # noqa: F401,E501 + + +class BrowseNodeInfo(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 = { + 'browse_nodes': 'list[BrowseNode]', + 'website_sales_rank': 'WebsiteSalesRank' + } + + attribute_map = { + 'browse_nodes': 'BrowseNodes', + 'website_sales_rank': 'WebsiteSalesRank' + } + + def __init__(self, browse_nodes=None, website_sales_rank=None): # noqa: E501 + """BrowseNodeInfo - a model defined in Swagger""" # noqa: E501 + + self._browse_nodes = None + self._website_sales_rank = None + self.discriminator = None + + if browse_nodes is not None: + self.browse_nodes = browse_nodes + if website_sales_rank is not None: + self.website_sales_rank = website_sales_rank + + @property + def browse_nodes(self): + """Gets the browse_nodes of this BrowseNodeInfo. # noqa: E501 + + + :return: The browse_nodes of this BrowseNodeInfo. # noqa: E501 + :rtype: list[BrowseNode] + """ + return self._browse_nodes + + @browse_nodes.setter + def browse_nodes(self, browse_nodes): + """Sets the browse_nodes of this BrowseNodeInfo. + + + :param browse_nodes: The browse_nodes of this BrowseNodeInfo. # noqa: E501 + :type: list[BrowseNode] + """ + + self._browse_nodes = browse_nodes + + @property + def website_sales_rank(self): + """Gets the website_sales_rank of this BrowseNodeInfo. # noqa: E501 + + + :return: The website_sales_rank of this BrowseNodeInfo. # noqa: E501 + :rtype: WebsiteSalesRank + """ + return self._website_sales_rank + + @website_sales_rank.setter + def website_sales_rank(self, website_sales_rank): + """Sets the website_sales_rank of this BrowseNodeInfo. + + + :param website_sales_rank: The website_sales_rank of this BrowseNodeInfo. # noqa: E501 + :type: WebsiteSalesRank + """ + + self._website_sales_rank = website_sales_rank + + 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(BrowseNodeInfo, 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, BrowseNodeInfo): + 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/paapi5_python_sdk/browse_nodes_result.py b/paapi5_python_sdk/browse_nodes_result.py new file mode 100644 index 0000000..5ee4a0c --- /dev/null +++ b/paapi5_python_sdk/browse_nodes_result.py @@ -0,0 +1,128 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.browse_node import BrowseNode # noqa: F401,E501 + + +class BrowseNodesResult(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 = { + 'browse_nodes': 'list[BrowseNode]' + } + + attribute_map = { + 'browse_nodes': 'BrowseNodes' + } + + def __init__(self, browse_nodes=None): # noqa: E501 + """BrowseNodesResult - a model defined in Swagger""" # noqa: E501 + + self._browse_nodes = None + self.discriminator = None + + if browse_nodes is not None: + self.browse_nodes = browse_nodes + + @property + def browse_nodes(self): + """Gets the browse_nodes of this BrowseNodesResult. # noqa: E501 + + + :return: The browse_nodes of this BrowseNodesResult. # noqa: E501 + :rtype: list[BrowseNode] + """ + return self._browse_nodes + + @browse_nodes.setter + def browse_nodes(self, browse_nodes): + """Sets the browse_nodes of this BrowseNodesResult. + + + :param browse_nodes: The browse_nodes of this BrowseNodesResult. # noqa: E501 + :type: list[BrowseNode] + """ + + self._browse_nodes = browse_nodes + + 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(BrowseNodesResult, 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, BrowseNodesResult): + 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/paapi5_python_sdk/by_line_info.py b/paapi5_python_sdk/by_line_info.py new file mode 100644 index 0000000..8f2812d --- /dev/null +++ b/paapi5_python_sdk/by_line_info.py @@ -0,0 +1,181 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.contributor import Contributor # noqa: F401,E501 +from paapi5_python_sdk.single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 + + +class ByLineInfo(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 = { + 'brand': 'SingleStringValuedAttribute', + 'contributors': 'list[Contributor]', + 'manufacturer': 'SingleStringValuedAttribute' + } + + attribute_map = { + 'brand': 'Brand', + 'contributors': 'Contributors', + 'manufacturer': 'Manufacturer' + } + + def __init__(self, brand=None, contributors=None, manufacturer=None): # noqa: E501 + """ByLineInfo - a model defined in Swagger""" # noqa: E501 + + self._brand = None + self._contributors = None + self._manufacturer = None + self.discriminator = None + + if brand is not None: + self.brand = brand + if contributors is not None: + self.contributors = contributors + if manufacturer is not None: + self.manufacturer = manufacturer + + @property + def brand(self): + """Gets the brand of this ByLineInfo. # noqa: E501 + + + :return: The brand of this ByLineInfo. # noqa: E501 + :rtype: SingleStringValuedAttribute + """ + return self._brand + + @brand.setter + def brand(self, brand): + """Sets the brand of this ByLineInfo. + + + :param brand: The brand of this ByLineInfo. # noqa: E501 + :type: SingleStringValuedAttribute + """ + + self._brand = brand + + @property + def contributors(self): + """Gets the contributors of this ByLineInfo. # noqa: E501 + + + :return: The contributors of this ByLineInfo. # noqa: E501 + :rtype: list[Contributor] + """ + return self._contributors + + @contributors.setter + def contributors(self, contributors): + """Sets the contributors of this ByLineInfo. + + + :param contributors: The contributors of this ByLineInfo. # noqa: E501 + :type: list[Contributor] + """ + + self._contributors = contributors + + @property + def manufacturer(self): + """Gets the manufacturer of this ByLineInfo. # noqa: E501 + + + :return: The manufacturer of this ByLineInfo. # noqa: E501 + :rtype: SingleStringValuedAttribute + """ + return self._manufacturer + + @manufacturer.setter + def manufacturer(self, manufacturer): + """Sets the manufacturer of this ByLineInfo. + + + :param manufacturer: The manufacturer of this ByLineInfo. # noqa: E501 + :type: SingleStringValuedAttribute + """ + + self._manufacturer = manufacturer + + 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(ByLineInfo, 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, ByLineInfo): + 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/paapi5_python_sdk/classifications.py b/paapi5_python_sdk/classifications.py new file mode 100644 index 0000000..0fc3ebb --- /dev/null +++ b/paapi5_python_sdk/classifications.py @@ -0,0 +1,154 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 + + +class Classifications(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 = { + 'binding': 'SingleStringValuedAttribute', + 'product_group': 'SingleStringValuedAttribute' + } + + attribute_map = { + 'binding': 'Binding', + 'product_group': 'ProductGroup' + } + + def __init__(self, binding=None, product_group=None): # noqa: E501 + """Classifications - a model defined in Swagger""" # noqa: E501 + + self._binding = None + self._product_group = None + self.discriminator = None + + if binding is not None: + self.binding = binding + if product_group is not None: + self.product_group = product_group + + @property + def binding(self): + """Gets the binding of this Classifications. # noqa: E501 + + + :return: The binding of this Classifications. # noqa: E501 + :rtype: SingleStringValuedAttribute + """ + return self._binding + + @binding.setter + def binding(self, binding): + """Sets the binding of this Classifications. + + + :param binding: The binding of this Classifications. # noqa: E501 + :type: SingleStringValuedAttribute + """ + + self._binding = binding + + @property + def product_group(self): + """Gets the product_group of this Classifications. # noqa: E501 + + + :return: The product_group of this Classifications. # noqa: E501 + :rtype: SingleStringValuedAttribute + """ + return self._product_group + + @product_group.setter + def product_group(self, product_group): + """Sets the product_group of this Classifications. + + + :param product_group: The product_group of this Classifications. # noqa: E501 + :type: SingleStringValuedAttribute + """ + + self._product_group = product_group + + 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(Classifications, 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, Classifications): + 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/paapi5_python_sdk/condition.py b/paapi5_python_sdk/condition.py new file mode 100644 index 0000000..0f554dc --- /dev/null +++ b/paapi5_python_sdk/condition.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Copyright 2019 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 Condition(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + ANY = "Any" + COLLECTIBLE = "Collectible" + NEW = "New" + REFURBISHED = "Refurbished" + USED = "Used" + + """ + 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 + """Condition - 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(Condition, 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, Condition): + 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/paapi5_python_sdk/configuration.py b/paapi5_python_sdk/configuration.py new file mode 100644 index 0000000..2dd7431 --- /dev/null +++ b/paapi5_python_sdk/configuration.py @@ -0,0 +1,230 @@ +# coding: utf-8 + +from __future__ import absolute_import + +""" + Copyright 2019 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 copy +import logging +import multiprocessing +import sys +import urllib3 + +import six +from six.moves import http_client as httplib + + +class TypeWithDefault(type): + def __init__(cls, name, bases, dct): + super(TypeWithDefault, cls).__init__(name, bases, dct) + cls._default = None + + def __call__(cls): + if cls._default is None: + cls._default = type.__call__(cls) + return copy.copy(cls._default) + + def set_default(cls, default): + cls._default = copy.copy(default) + + +class Configuration(six.with_metaclass(TypeWithDefault, object)): + """NOTE: This class is auto generated by the swagger code generator program. + + Ref: https://github.com/swagger-api/swagger-codegen + Do not edit the class manually. + """ + + def __init__(self, connection_pool_maxsize=None): + """Constructor""" + # Default Base url + self.host = "https://webservices.amazon.com" + + # Logging Settings + self.logger = {} + self.logger["package_logger"] = logging.getLogger("paapi5_python_sdk") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + # Log format + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + # Log stream handler + self.logger_stream_handler = None + # Log file handler + self.logger_file_handler = None + # Debug file location + self.logger_file = None + # Debug switch + self.debug = False + + # SSL/TLS verification + # Set this to false to skip verifying SSL certificate when calling API + # from https server. + self.verify_ssl = True + # Set this to customize the certificate file to verify the peer. + self.ssl_ca_cert = None + # client certificate file + self.cert_file = None + # client key file + self.key_file = None + # Set this to True/False to enable/disable SSL hostname verification. + self.assert_hostname = None + + # urllib3 connection pool's maximum number of connections saved + # per pool. urllib3 uses 1 connection as default value, but this is + # not the best value when you are making a lot of possibly parallel + # requests to the same host, which is often the case here. + # cpu_count * 5 is used as default value to increase performance. + if connection_pool_maxsize is None: + connection_pool_maxsize = multiprocessing.cpu_count() * 5 + self.connection_pool_maxsize = connection_pool_maxsize + # Proxy URL + self.proxy = None + # Safe chars for path_param + self.safe_chars_for_path_param = '' + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in six.iteritems(self.logger): + logger.addHandler(self.logger_file_handler) + if self.logger_stream_handler: + logger.removeHandler(self.logger_stream_handler) + else: + # If not set logging file, + # then add stream handler and remove file handler. + self.logger_stream_handler = logging.StreamHandler() + self.logger_stream_handler.setFormatter(self.logger_formatter) + for _, logger in six.iteritems(self.logger): + logger.addHandler(self.logger_stream_handler) + if self.logger_file_handler: + logger.removeHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier): + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :return: The token for api key authentication. + """ + if (self.api_key.get(identifier) and + self.api_key_prefix.get(identifier)): + return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] # noqa: E501 + elif self.api_key.get(identifier): + return self.api_key[identifier] + + def auth_settings(self): + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + return { + + } + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + 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".\ + format(env=sys.platform, pyversion=sys.version) diff --git a/paapi5_python_sdk/content_info.py b/paapi5_python_sdk/content_info.py new file mode 100644 index 0000000..a0264c2 --- /dev/null +++ b/paapi5_python_sdk/content_info.py @@ -0,0 +1,208 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.languages import Languages # noqa: F401,E501 +from paapi5_python_sdk.single_integer_valued_attribute import SingleIntegerValuedAttribute # noqa: F401,E501 +from paapi5_python_sdk.single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 + + +class ContentInfo(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 = { + 'edition': 'SingleStringValuedAttribute', + 'languages': 'Languages', + 'pages_count': 'SingleIntegerValuedAttribute', + 'publication_date': 'SingleStringValuedAttribute' + } + + attribute_map = { + 'edition': 'Edition', + 'languages': 'Languages', + 'pages_count': 'PagesCount', + 'publication_date': 'PublicationDate' + } + + def __init__(self, edition=None, languages=None, pages_count=None, publication_date=None): # noqa: E501 + """ContentInfo - a model defined in Swagger""" # noqa: E501 + + self._edition = None + self._languages = None + self._pages_count = None + self._publication_date = None + self.discriminator = None + + if edition is not None: + self.edition = edition + if languages is not None: + self.languages = languages + if pages_count is not None: + self.pages_count = pages_count + if publication_date is not None: + self.publication_date = publication_date + + @property + def edition(self): + """Gets the edition of this ContentInfo. # noqa: E501 + + + :return: The edition of this ContentInfo. # noqa: E501 + :rtype: SingleStringValuedAttribute + """ + return self._edition + + @edition.setter + def edition(self, edition): + """Sets the edition of this ContentInfo. + + + :param edition: The edition of this ContentInfo. # noqa: E501 + :type: SingleStringValuedAttribute + """ + + self._edition = edition + + @property + def languages(self): + """Gets the languages of this ContentInfo. # noqa: E501 + + + :return: The languages of this ContentInfo. # noqa: E501 + :rtype: Languages + """ + return self._languages + + @languages.setter + def languages(self, languages): + """Sets the languages of this ContentInfo. + + + :param languages: The languages of this ContentInfo. # noqa: E501 + :type: Languages + """ + + self._languages = languages + + @property + def pages_count(self): + """Gets the pages_count of this ContentInfo. # noqa: E501 + + + :return: The pages_count of this ContentInfo. # noqa: E501 + :rtype: SingleIntegerValuedAttribute + """ + return self._pages_count + + @pages_count.setter + def pages_count(self, pages_count): + """Sets the pages_count of this ContentInfo. + + + :param pages_count: The pages_count of this ContentInfo. # noqa: E501 + :type: SingleIntegerValuedAttribute + """ + + self._pages_count = pages_count + + @property + def publication_date(self): + """Gets the publication_date of this ContentInfo. # noqa: E501 + + + :return: The publication_date of this ContentInfo. # noqa: E501 + :rtype: SingleStringValuedAttribute + """ + return self._publication_date + + @publication_date.setter + def publication_date(self, publication_date): + """Sets the publication_date of this ContentInfo. + + + :param publication_date: The publication_date of this ContentInfo. # noqa: E501 + :type: SingleStringValuedAttribute + """ + + self._publication_date = publication_date + + 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(ContentInfo, 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, ContentInfo): + 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/paapi5_python_sdk/content_rating.py b/paapi5_python_sdk/content_rating.py new file mode 100644 index 0000000..d3584e9 --- /dev/null +++ b/paapi5_python_sdk/content_rating.py @@ -0,0 +1,128 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 + + +class ContentRating(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 = { + 'audience_rating': 'SingleStringValuedAttribute' + } + + attribute_map = { + 'audience_rating': 'AudienceRating' + } + + def __init__(self, audience_rating=None): # noqa: E501 + """ContentRating - a model defined in Swagger""" # noqa: E501 + + self._audience_rating = None + self.discriminator = None + + if audience_rating is not None: + self.audience_rating = audience_rating + + @property + def audience_rating(self): + """Gets the audience_rating of this ContentRating. # noqa: E501 + + + :return: The audience_rating of this ContentRating. # noqa: E501 + :rtype: SingleStringValuedAttribute + """ + return self._audience_rating + + @audience_rating.setter + def audience_rating(self, audience_rating): + """Sets the audience_rating of this ContentRating. + + + :param audience_rating: The audience_rating of this ContentRating. # noqa: E501 + :type: SingleStringValuedAttribute + """ + + self._audience_rating = audience_rating + + 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(ContentRating, 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, ContentRating): + 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/paapi5_python_sdk/contributor.py b/paapi5_python_sdk/contributor.py new file mode 100644 index 0000000..1b1f30e --- /dev/null +++ b/paapi5_python_sdk/contributor.py @@ -0,0 +1,178 @@ +# coding: utf-8 + +""" + Copyright 2019 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 Contributor(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 = { + 'locale': 'str', + 'name': 'str', + 'role': 'str' + } + + attribute_map = { + 'locale': 'Locale', + 'name': 'Name', + 'role': 'Role' + } + + def __init__(self, locale=None, name=None, role=None): # noqa: E501 + """Contributor - a model defined in Swagger""" # noqa: E501 + + self._locale = None + self._name = None + self._role = None + self.discriminator = None + + if locale is not None: + self.locale = locale + if name is not None: + self.name = name + if role is not None: + self.role = role + + @property + def locale(self): + """Gets the locale of this Contributor. # noqa: E501 + + + :return: The locale of this Contributor. # noqa: E501 + :rtype: str + """ + return self._locale + + @locale.setter + def locale(self, locale): + """Sets the locale of this Contributor. + + + :param locale: The locale of this Contributor. # noqa: E501 + :type: str + """ + + self._locale = locale + + @property + def name(self): + """Gets the name of this Contributor. # noqa: E501 + + + :return: The name of this Contributor. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Contributor. + + + :param name: The name of this Contributor. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def role(self): + """Gets the role of this Contributor. # noqa: E501 + + + :return: The role of this Contributor. # noqa: E501 + :rtype: str + """ + return self._role + + @role.setter + def role(self, role): + """Sets the role of this Contributor. + + + :param role: The role of this Contributor. # noqa: E501 + :type: str + """ + + self._role = role + + 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(Contributor, 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, Contributor): + 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/paapi5_python_sdk/delivery_flag.py b/paapi5_python_sdk/delivery_flag.py new file mode 100644 index 0000000..1f0c469 --- /dev/null +++ b/paapi5_python_sdk/delivery_flag.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Copyright 2019 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 DeliveryFlag(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + AMAZONGLOBAL = "AmazonGlobal" + FREESHIPPING = "FreeShipping" + FULFILLEDBYAMAZON = "FulfilledByAmazon" + PRIME = "Prime" + + """ + 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 + """DeliveryFlag - 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(DeliveryFlag, 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, DeliveryFlag): + 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/paapi5_python_sdk/dimension_based_attribute.py b/paapi5_python_sdk/dimension_based_attribute.py new file mode 100644 index 0000000..7744409 --- /dev/null +++ b/paapi5_python_sdk/dimension_based_attribute.py @@ -0,0 +1,206 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.unit_based_attribute import UnitBasedAttribute # noqa: F401,E501 + + +class DimensionBasedAttribute(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 = { + 'height': 'UnitBasedAttribute', + 'length': 'UnitBasedAttribute', + 'weight': 'UnitBasedAttribute', + 'width': 'UnitBasedAttribute' + } + + attribute_map = { + 'height': 'Height', + 'length': 'Length', + 'weight': 'Weight', + 'width': 'Width' + } + + def __init__(self, height=None, length=None, weight=None, width=None): # noqa: E501 + """DimensionBasedAttribute - a model defined in Swagger""" # noqa: E501 + + self._height = None + self._length = None + self._weight = None + self._width = None + self.discriminator = None + + if height is not None: + self.height = height + if length is not None: + self.length = length + if weight is not None: + self.weight = weight + if width is not None: + self.width = width + + @property + def height(self): + """Gets the height of this DimensionBasedAttribute. # noqa: E501 + + + :return: The height of this DimensionBasedAttribute. # noqa: E501 + :rtype: UnitBasedAttribute + """ + return self._height + + @height.setter + def height(self, height): + """Sets the height of this DimensionBasedAttribute. + + + :param height: The height of this DimensionBasedAttribute. # noqa: E501 + :type: UnitBasedAttribute + """ + + self._height = height + + @property + def length(self): + """Gets the length of this DimensionBasedAttribute. # noqa: E501 + + + :return: The length of this DimensionBasedAttribute. # noqa: E501 + :rtype: UnitBasedAttribute + """ + return self._length + + @length.setter + def length(self, length): + """Sets the length of this DimensionBasedAttribute. + + + :param length: The length of this DimensionBasedAttribute. # noqa: E501 + :type: UnitBasedAttribute + """ + + self._length = length + + @property + def weight(self): + """Gets the weight of this DimensionBasedAttribute. # noqa: E501 + + + :return: The weight of this DimensionBasedAttribute. # noqa: E501 + :rtype: UnitBasedAttribute + """ + return self._weight + + @weight.setter + def weight(self, weight): + """Sets the weight of this DimensionBasedAttribute. + + + :param weight: The weight of this DimensionBasedAttribute. # noqa: E501 + :type: UnitBasedAttribute + """ + + self._weight = weight + + @property + def width(self): + """Gets the width of this DimensionBasedAttribute. # noqa: E501 + + + :return: The width of this DimensionBasedAttribute. # noqa: E501 + :rtype: UnitBasedAttribute + """ + return self._width + + @width.setter + def width(self, width): + """Sets the width of this DimensionBasedAttribute. + + + :param width: The width of this DimensionBasedAttribute. # noqa: E501 + :type: UnitBasedAttribute + """ + + self._width = width + + 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(DimensionBasedAttribute, 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, DimensionBasedAttribute): + 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/paapi5_python_sdk/duration_price.py b/paapi5_python_sdk/duration_price.py new file mode 100644 index 0000000..dadad05 --- /dev/null +++ b/paapi5_python_sdk/duration_price.py @@ -0,0 +1,155 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.offer_price import OfferPrice # noqa: F401,E501 +from paapi5_python_sdk.unit_based_attribute import UnitBasedAttribute # noqa: F401,E501 + + +class DurationPrice(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 = { + 'price': 'OfferPrice', + 'duration': 'UnitBasedAttribute' + } + + attribute_map = { + 'price': 'Price', + 'duration': 'Duration' + } + + def __init__(self, price=None, duration=None): # noqa: E501 + """DurationPrice - a model defined in Swagger""" # noqa: E501 + + self._price = None + self._duration = None + self.discriminator = None + + if price is not None: + self.price = price + if duration is not None: + self.duration = duration + + @property + def price(self): + """Gets the price of this DurationPrice. # noqa: E501 + + + :return: The price of this DurationPrice. # noqa: E501 + :rtype: OfferPrice + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this DurationPrice. + + + :param price: The price of this DurationPrice. # noqa: E501 + :type: OfferPrice + """ + + self._price = price + + @property + def duration(self): + """Gets the duration of this DurationPrice. # noqa: E501 + + + :return: The duration of this DurationPrice. # noqa: E501 + :rtype: UnitBasedAttribute + """ + return self._duration + + @duration.setter + def duration(self, duration): + """Sets the duration of this DurationPrice. + + + :param duration: The duration of this DurationPrice. # noqa: E501 + :type: UnitBasedAttribute + """ + + self._duration = duration + + 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(DurationPrice, 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, DurationPrice): + 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/paapi5_python_sdk/error_data.py b/paapi5_python_sdk/error_data.py new file mode 100644 index 0000000..3d6b106 --- /dev/null +++ b/paapi5_python_sdk/error_data.py @@ -0,0 +1,152 @@ +# coding: utf-8 + +""" + Copyright 2019 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 ErrorData(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 = { + 'code': 'str', + 'message': 'str' + } + + attribute_map = { + 'code': 'Code', + 'message': 'Message' + } + + def __init__(self, code=None, message=None): # noqa: E501 + """ErrorData - a model defined in Swagger""" # noqa: E501 + + self._code = None + self._message = None + self.discriminator = None + + if code is not None: + self.code = code + if message is not None: + self.message = message + + @property + def code(self): + """Gets the code of this ErrorData. # noqa: E501 + + + :return: The code of this ErrorData. # noqa: E501 + :rtype: str + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this ErrorData. + + + :param code: The code of this ErrorData. # noqa: E501 + :type: str + """ + + self._code = code + + @property + def message(self): + """Gets the message of this ErrorData. # noqa: E501 + + + :return: The message of this ErrorData. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ErrorData. + + + :param message: The message of this ErrorData. # noqa: E501 + :type: str + """ + + self._message = message + + 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(ErrorData, 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, ErrorData): + 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/paapi5_python_sdk/external_ids.py b/paapi5_python_sdk/external_ids.py new file mode 100644 index 0000000..17f87b5 --- /dev/null +++ b/paapi5_python_sdk/external_ids.py @@ -0,0 +1,180 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.multi_valued_attribute import MultiValuedAttribute # noqa: F401,E501 + + +class ExternalIds(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 = { + 'ea_ns': 'MultiValuedAttribute', + 'isb_ns': 'MultiValuedAttribute', + 'up_cs': 'MultiValuedAttribute' + } + + attribute_map = { + 'ea_ns': 'EANs', + 'isb_ns': 'ISBNs', + 'up_cs': 'UPCs' + } + + def __init__(self, ea_ns=None, isb_ns=None, up_cs=None): # noqa: E501 + """ExternalIds - a model defined in Swagger""" # noqa: E501 + + self._ea_ns = None + self._isb_ns = None + self._up_cs = None + self.discriminator = None + + if ea_ns is not None: + self.ea_ns = ea_ns + if isb_ns is not None: + self.isb_ns = isb_ns + if up_cs is not None: + self.up_cs = up_cs + + @property + def ea_ns(self): + """Gets the ea_ns of this ExternalIds. # noqa: E501 + + + :return: The ea_ns of this ExternalIds. # noqa: E501 + :rtype: MultiValuedAttribute + """ + return self._ea_ns + + @ea_ns.setter + def ea_ns(self, ea_ns): + """Sets the ea_ns of this ExternalIds. + + + :param ea_ns: The ea_ns of this ExternalIds. # noqa: E501 + :type: MultiValuedAttribute + """ + + self._ea_ns = ea_ns + + @property + def isb_ns(self): + """Gets the isb_ns of this ExternalIds. # noqa: E501 + + + :return: The isb_ns of this ExternalIds. # noqa: E501 + :rtype: MultiValuedAttribute + """ + return self._isb_ns + + @isb_ns.setter + def isb_ns(self, isb_ns): + """Sets the isb_ns of this ExternalIds. + + + :param isb_ns: The isb_ns of this ExternalIds. # noqa: E501 + :type: MultiValuedAttribute + """ + + self._isb_ns = isb_ns + + @property + def up_cs(self): + """Gets the up_cs of this ExternalIds. # noqa: E501 + + + :return: The up_cs of this ExternalIds. # noqa: E501 + :rtype: MultiValuedAttribute + """ + return self._up_cs + + @up_cs.setter + def up_cs(self, up_cs): + """Sets the up_cs of this ExternalIds. + + + :param up_cs: The up_cs of this ExternalIds. # noqa: E501 + :type: MultiValuedAttribute + """ + + self._up_cs = up_cs + + 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(ExternalIds, 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, ExternalIds): + 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/paapi5_python_sdk/get_browse_nodes_request.py b/paapi5_python_sdk/get_browse_nodes_request.py new file mode 100644 index 0000000..4ed3ae9 --- /dev/null +++ b/paapi5_python_sdk/get_browse_nodes_request.py @@ -0,0 +1,262 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.get_browse_nodes_resource import GetBrowseNodesResource # noqa: F401,E501 +from paapi5_python_sdk.partner_type import PartnerType # noqa: F401,E501 + + +class GetBrowseNodesRequest(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 = { + 'browse_node_ids': 'list[str]', + 'languages_of_preference': 'list[str]', + 'marketplace': 'str', + 'partner_tag': 'str', + 'partner_type': 'PartnerType', + 'resources': 'list[GetBrowseNodesResource]' + } + + attribute_map = { + 'browse_node_ids': 'BrowseNodeIds', + 'languages_of_preference': 'LanguagesOfPreference', + 'marketplace': 'Marketplace', + 'partner_tag': 'PartnerTag', + 'partner_type': 'PartnerType', + 'resources': 'Resources' + } + + def __init__(self, browse_node_ids=None, languages_of_preference=None, marketplace=None, partner_tag=None, partner_type=None, resources=None): # noqa: E501 + """GetBrowseNodesRequest - a model defined in Swagger""" # noqa: E501 + + self._browse_node_ids = None + self._languages_of_preference = None + self._marketplace = None + self._partner_tag = None + self._partner_type = None + self._resources = None + self.discriminator = None + + self.browse_node_ids = browse_node_ids + if languages_of_preference is not None: + self.languages_of_preference = languages_of_preference + if marketplace is not None: + self.marketplace = marketplace + self.partner_tag = partner_tag + self.partner_type = partner_type + if resources is not None: + self.resources = resources + + @property + def browse_node_ids(self): + """Gets the browse_node_ids of this GetBrowseNodesRequest. # noqa: E501 + + + :return: The browse_node_ids of this GetBrowseNodesRequest. # noqa: E501 + :rtype: list[str] + """ + return self._browse_node_ids + + @browse_node_ids.setter + def browse_node_ids(self, browse_node_ids): + """Sets the browse_node_ids of this GetBrowseNodesRequest. + + + :param browse_node_ids: The browse_node_ids of this GetBrowseNodesRequest. # noqa: E501 + :type: list[str] + """ + if browse_node_ids is None: + raise ValueError("Invalid value for `browse_node_ids`, must not be `None`") # noqa: E501 + + self._browse_node_ids = browse_node_ids + + @property + def languages_of_preference(self): + """Gets the languages_of_preference of this GetBrowseNodesRequest. # noqa: E501 + + + :return: The languages_of_preference of this GetBrowseNodesRequest. # noqa: E501 + :rtype: list[str] + """ + return self._languages_of_preference + + @languages_of_preference.setter + def languages_of_preference(self, languages_of_preference): + """Sets the languages_of_preference of this GetBrowseNodesRequest. + + + :param languages_of_preference: The languages_of_preference of this GetBrowseNodesRequest. # noqa: E501 + :type: list[str] + """ + + self._languages_of_preference = languages_of_preference + + @property + def marketplace(self): + """Gets the marketplace of this GetBrowseNodesRequest. # noqa: E501 + + + :return: The marketplace of this GetBrowseNodesRequest. # noqa: E501 + :rtype: str + """ + return self._marketplace + + @marketplace.setter + def marketplace(self, marketplace): + """Sets the marketplace of this GetBrowseNodesRequest. + + + :param marketplace: The marketplace of this GetBrowseNodesRequest. # noqa: E501 + :type: str + """ + + self._marketplace = marketplace + + @property + def partner_tag(self): + """Gets the partner_tag of this GetBrowseNodesRequest. # noqa: E501 + + + :return: The partner_tag of this GetBrowseNodesRequest. # noqa: E501 + :rtype: str + """ + return self._partner_tag + + @partner_tag.setter + def partner_tag(self, partner_tag): + """Sets the partner_tag of this GetBrowseNodesRequest. + + + :param partner_tag: The partner_tag of this GetBrowseNodesRequest. # noqa: E501 + :type: str + """ + if partner_tag is None: + raise ValueError("Invalid value for `partner_tag`, must not be `None`") # noqa: E501 + + self._partner_tag = partner_tag + + @property + def partner_type(self): + """Gets the partner_type of this GetBrowseNodesRequest. # noqa: E501 + + + :return: The partner_type of this GetBrowseNodesRequest. # noqa: E501 + :rtype: PartnerType + """ + return self._partner_type + + @partner_type.setter + def partner_type(self, partner_type): + """Sets the partner_type of this GetBrowseNodesRequest. + + + :param partner_type: The partner_type of this GetBrowseNodesRequest. # noqa: E501 + :type: PartnerType + """ + if partner_type is None: + raise ValueError("Invalid value for `partner_type`, must not be `None`") # noqa: E501 + + self._partner_type = partner_type + + @property + def resources(self): + """Gets the resources of this GetBrowseNodesRequest. # noqa: E501 + + + :return: The resources of this GetBrowseNodesRequest. # noqa: E501 + :rtype: list[GetBrowseNodesResource] + """ + return self._resources + + @resources.setter + def resources(self, resources): + """Sets the resources of this GetBrowseNodesRequest. + + + :param resources: The resources of this GetBrowseNodesRequest. # noqa: E501 + :type: list[GetBrowseNodesResource] + """ + + self._resources = resources + + 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(GetBrowseNodesRequest, 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, GetBrowseNodesRequest): + 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/paapi5_python_sdk/get_browse_nodes_resource.py b/paapi5_python_sdk/get_browse_nodes_resource.py new file mode 100644 index 0000000..4e7ff94 --- /dev/null +++ b/paapi5_python_sdk/get_browse_nodes_resource.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Copyright 2019 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 GetBrowseNodesResource(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + ANCESTOR = "BrowseNodes.Ancestor" + CHILDREN = "BrowseNodes.Children" + + """ + 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 + """GetBrowseNodesResource - 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(GetBrowseNodesResource, 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, GetBrowseNodesResource): + 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/paapi5_python_sdk/get_browse_nodes_response.py b/paapi5_python_sdk/get_browse_nodes_response.py new file mode 100644 index 0000000..f74f76e --- /dev/null +++ b/paapi5_python_sdk/get_browse_nodes_response.py @@ -0,0 +1,155 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.browse_nodes_result import BrowseNodesResult # noqa: F401,E501 +from paapi5_python_sdk.error_data import ErrorData # noqa: F401,E501 + + +class GetBrowseNodesResponse(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 = { + 'browse_nodes_result': 'BrowseNodesResult', + 'errors': 'list[ErrorData]' + } + + attribute_map = { + 'browse_nodes_result': 'BrowseNodesResult', + 'errors': 'Errors' + } + + def __init__(self, browse_nodes_result=None, errors=None): # noqa: E501 + """GetBrowseNodesResponse - a model defined in Swagger""" # noqa: E501 + + self._browse_nodes_result = None + self._errors = None + self.discriminator = None + + if browse_nodes_result is not None: + self.browse_nodes_result = browse_nodes_result + if errors is not None: + self.errors = errors + + @property + def browse_nodes_result(self): + """Gets the browse_nodes_result of this GetBrowseNodesResponse. # noqa: E501 + + + :return: The browse_nodes_result of this GetBrowseNodesResponse. # noqa: E501 + :rtype: BrowseNodesResult + """ + return self._browse_nodes_result + + @browse_nodes_result.setter + def browse_nodes_result(self, browse_nodes_result): + """Sets the browse_nodes_result of this GetBrowseNodesResponse. + + + :param browse_nodes_result: The browse_nodes_result of this GetBrowseNodesResponse. # noqa: E501 + :type: BrowseNodesResult + """ + + self._browse_nodes_result = browse_nodes_result + + @property + def errors(self): + """Gets the errors of this GetBrowseNodesResponse. # noqa: E501 + + + :return: The errors of this GetBrowseNodesResponse. # noqa: E501 + :rtype: list[ErrorData] + """ + return self._errors + + @errors.setter + def errors(self, errors): + """Sets the errors of this GetBrowseNodesResponse. + + + :param errors: The errors of this GetBrowseNodesResponse. # noqa: E501 + :type: list[ErrorData] + """ + + self._errors = errors + + 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(GetBrowseNodesResponse, 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, GetBrowseNodesResponse): + 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/paapi5_python_sdk/get_items_request.py b/paapi5_python_sdk/get_items_request.py new file mode 100644 index 0000000..4e369ff --- /dev/null +++ b/paapi5_python_sdk/get_items_request.py @@ -0,0 +1,423 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.condition import Condition # noqa: F401,E501 +from paapi5_python_sdk.get_items_resource import GetItemsResource # noqa: F401,E501 +from paapi5_python_sdk.item_id_type import ItemIdType # noqa: F401,E501 +from paapi5_python_sdk.merchant import Merchant # noqa: F401,E501 +from paapi5_python_sdk.offer_count import OfferCount # noqa: F401,E501 +from paapi5_python_sdk.partner_type import PartnerType # noqa: F401,E501 +from paapi5_python_sdk.properties import Properties # noqa: F401,E501 + + +class GetItemsRequest(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 = { + 'condition': 'Condition', + 'currency_of_preference': 'str', + 'item_ids': 'list[str]', + 'item_id_type': 'ItemIdType', + 'languages_of_preference': 'list[str]', + 'marketplace': 'str', + 'merchant': 'Merchant', + 'offer_count': 'OfferCount', + 'partner_tag': 'str', + 'partner_type': 'PartnerType', + 'properties': 'Properties', + 'resources': 'list[GetItemsResource]' + } + + attribute_map = { + 'condition': 'Condition', + 'currency_of_preference': 'CurrencyOfPreference', + 'item_ids': 'ItemIds', + 'item_id_type': 'ItemIdType', + 'languages_of_preference': 'LanguagesOfPreference', + 'marketplace': 'Marketplace', + 'merchant': 'Merchant', + 'offer_count': 'OfferCount', + 'partner_tag': 'PartnerTag', + 'partner_type': 'PartnerType', + 'properties': 'Properties', + 'resources': 'Resources' + } + + def __init__(self, condition=None, currency_of_preference=None, item_ids=None, item_id_type=None, languages_of_preference=None, marketplace=None, merchant=None, offer_count=None, partner_tag=None, partner_type=None, properties=None, resources=None): # noqa: E501 + """GetItemsRequest - a model defined in Swagger""" # noqa: E501 + + self._condition = None + self._currency_of_preference = None + self._item_ids = None + self._item_id_type = None + self._languages_of_preference = None + self._marketplace = None + self._merchant = None + self._offer_count = None + self._partner_tag = None + self._partner_type = None + self._properties = None + self._resources = None + self.discriminator = None + + if condition is not None: + self.condition = condition + if currency_of_preference is not None: + self.currency_of_preference = currency_of_preference + self.item_ids = item_ids + if item_id_type is not None: + self.item_id_type = item_id_type + if languages_of_preference is not None: + self.languages_of_preference = languages_of_preference + if marketplace is not None: + self.marketplace = marketplace + if merchant is not None: + self.merchant = merchant + if offer_count is not None: + self.offer_count = offer_count + self.partner_tag = partner_tag + self.partner_type = partner_type + if properties is not None: + self.properties = properties + if resources is not None: + self.resources = resources + + @property + def condition(self): + """Gets the condition of this GetItemsRequest. # noqa: E501 + + + :return: The condition of this GetItemsRequest. # noqa: E501 + :rtype: Condition + """ + return self._condition + + @condition.setter + def condition(self, condition): + """Sets the condition of this GetItemsRequest. + + + :param condition: The condition of this GetItemsRequest. # noqa: E501 + :type: Condition + """ + + self._condition = condition + + @property + def currency_of_preference(self): + """Gets the currency_of_preference of this GetItemsRequest. # noqa: E501 + + + :return: The currency_of_preference of this GetItemsRequest. # noqa: E501 + :rtype: str + """ + return self._currency_of_preference + + @currency_of_preference.setter + def currency_of_preference(self, currency_of_preference): + """Sets the currency_of_preference of this GetItemsRequest. + + + :param currency_of_preference: The currency_of_preference of this GetItemsRequest. # noqa: E501 + :type: str + """ + + self._currency_of_preference = currency_of_preference + + @property + def item_ids(self): + """Gets the item_ids of this GetItemsRequest. # noqa: E501 + + + :return: The item_ids of this GetItemsRequest. # noqa: E501 + :rtype: list[str] + """ + return self._item_ids + + @item_ids.setter + def item_ids(self, item_ids): + """Sets the item_ids of this GetItemsRequest. + + + :param item_ids: The item_ids of this GetItemsRequest. # noqa: E501 + :type: list[str] + """ + if item_ids is None: + raise ValueError("Invalid value for `item_ids`, must not be `None`") # noqa: E501 + + self._item_ids = item_ids + + @property + def item_id_type(self): + """Gets the item_id_type of this GetItemsRequest. # noqa: E501 + + + :return: The item_id_type of this GetItemsRequest. # noqa: E501 + :rtype: ItemIdType + """ + return self._item_id_type + + @item_id_type.setter + def item_id_type(self, item_id_type): + """Sets the item_id_type of this GetItemsRequest. + + + :param item_id_type: The item_id_type of this GetItemsRequest. # noqa: E501 + :type: ItemIdType + """ + + self._item_id_type = item_id_type + + @property + def languages_of_preference(self): + """Gets the languages_of_preference of this GetItemsRequest. # noqa: E501 + + + :return: The languages_of_preference of this GetItemsRequest. # noqa: E501 + :rtype: list[str] + """ + return self._languages_of_preference + + @languages_of_preference.setter + def languages_of_preference(self, languages_of_preference): + """Sets the languages_of_preference of this GetItemsRequest. + + + :param languages_of_preference: The languages_of_preference of this GetItemsRequest. # noqa: E501 + :type: list[str] + """ + + self._languages_of_preference = languages_of_preference + + @property + def marketplace(self): + """Gets the marketplace of this GetItemsRequest. # noqa: E501 + + + :return: The marketplace of this GetItemsRequest. # noqa: E501 + :rtype: str + """ + return self._marketplace + + @marketplace.setter + def marketplace(self, marketplace): + """Sets the marketplace of this GetItemsRequest. + + + :param marketplace: The marketplace of this GetItemsRequest. # noqa: E501 + :type: str + """ + + self._marketplace = marketplace + + @property + def merchant(self): + """Gets the merchant of this GetItemsRequest. # noqa: E501 + + + :return: The merchant of this GetItemsRequest. # noqa: E501 + :rtype: Merchant + """ + return self._merchant + + @merchant.setter + def merchant(self, merchant): + """Sets the merchant of this GetItemsRequest. + + + :param merchant: The merchant of this GetItemsRequest. # noqa: E501 + :type: Merchant + """ + + self._merchant = merchant + + @property + def offer_count(self): + """Gets the offer_count of this GetItemsRequest. # noqa: E501 + + + :return: The offer_count of this GetItemsRequest. # noqa: E501 + :rtype: OfferCount + """ + return self._offer_count + + @offer_count.setter + def offer_count(self, offer_count): + """Sets the offer_count of this GetItemsRequest. + + + :param offer_count: The offer_count of this GetItemsRequest. # noqa: E501 + :type: OfferCount + """ + + self._offer_count = offer_count + + @property + def partner_tag(self): + """Gets the partner_tag of this GetItemsRequest. # noqa: E501 + + + :return: The partner_tag of this GetItemsRequest. # noqa: E501 + :rtype: str + """ + return self._partner_tag + + @partner_tag.setter + def partner_tag(self, partner_tag): + """Sets the partner_tag of this GetItemsRequest. + + + :param partner_tag: The partner_tag of this GetItemsRequest. # noqa: E501 + :type: str + """ + if partner_tag is None: + raise ValueError("Invalid value for `partner_tag`, must not be `None`") # noqa: E501 + + self._partner_tag = partner_tag + + @property + def partner_type(self): + """Gets the partner_type of this GetItemsRequest. # noqa: E501 + + + :return: The partner_type of this GetItemsRequest. # noqa: E501 + :rtype: PartnerType + """ + return self._partner_type + + @partner_type.setter + def partner_type(self, partner_type): + """Sets the partner_type of this GetItemsRequest. + + + :param partner_type: The partner_type of this GetItemsRequest. # noqa: E501 + :type: PartnerType + """ + if partner_type is None: + raise ValueError("Invalid value for `partner_type`, must not be `None`") # noqa: E501 + + self._partner_type = partner_type + + @property + def properties(self): + """Gets the properties of this GetItemsRequest. # noqa: E501 + + + :return: The properties of this GetItemsRequest. # noqa: E501 + :rtype: Properties + """ + return self._properties + + @properties.setter + def properties(self, properties): + """Sets the properties of this GetItemsRequest. + + + :param properties: The properties of this GetItemsRequest. # noqa: E501 + :type: Properties + """ + + self._properties = properties + + @property + def resources(self): + """Gets the resources of this GetItemsRequest. # noqa: E501 + + + :return: The resources of this GetItemsRequest. # noqa: E501 + :rtype: list[GetItemsResource] + """ + return self._resources + + @resources.setter + def resources(self, resources): + """Sets the resources of this GetItemsRequest. + + + :param resources: The resources of this GetItemsRequest. # noqa: E501 + :type: list[GetItemsResource] + """ + + self._resources = resources + + 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(GetItemsRequest, 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, GetItemsRequest): + 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/paapi5_python_sdk/get_items_resource.py b/paapi5_python_sdk/get_items_resource.py new file mode 100644 index 0000000..b0ddcc5 --- /dev/null +++ b/paapi5_python_sdk/get_items_resource.py @@ -0,0 +1,157 @@ +# coding: utf-8 + +""" + Copyright 2019 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 GetItemsResource(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + BROWSENODEINFO_BROWSENODES = "BrowseNodeInfo.BrowseNodes" + BROWSENODEINFO_BROWSENODES_ANCESTOR = "BrowseNodeInfo.BrowseNodes.Ancestor" + BROWSENODEINFO_BROWSENODES_SALESRANK = "BrowseNodeInfo.BrowseNodes.SalesRank" + BROWSENODEINFO_WEBSITESALESRANK = "BrowseNodeInfo.WebsiteSalesRank" + IMAGES_PRIMARY_SMALL = "Images.Primary.Small" + IMAGES_PRIMARY_MEDIUM = "Images.Primary.Medium" + IMAGES_PRIMARY_LARGE = "Images.Primary.Large" + IMAGES_VARIANTS_SMALL = "Images.Variants.Small" + IMAGES_VARIANTS_MEDIUM = "Images.Variants.Medium" + IMAGES_VARIANTS_LARGE = "Images.Variants.Large" + ITEMINFO_BYLINEINFO = "ItemInfo.ByLineInfo" + ITEMINFO_CONTENTINFO = "ItemInfo.ContentInfo" + ITEMINFO_CONTENTRATING = "ItemInfo.ContentRating" + ITEMINFO_CLASSIFICATIONS = "ItemInfo.Classifications" + ITEMINFO_EXTERNALIDS = "ItemInfo.ExternalIds" + ITEMINFO_FEATURES = "ItemInfo.Features" + ITEMINFO_MANUFACTUREINFO = "ItemInfo.ManufactureInfo" + ITEMINFO_PRODUCTINFO = "ItemInfo.ProductInfo" + ITEMINFO_TECHNICALINFO = "ItemInfo.TechnicalInfo" + ITEMINFO_TITLE = "ItemInfo.Title" + ITEMINFO_TRADEININFO = "ItemInfo.TradeInInfo" + OFFERS_LISTINGS_AVAILABILITY_MAXORDERQUANTITY = "Offers.Listings.Availability.MaxOrderQuantity" + OFFERS_LISTINGS_AVAILABILITY_MESSAGE = "Offers.Listings.Availability.Message" + OFFERS_LISTINGS_AVAILABILITY_MINORDERQUANTITY = "Offers.Listings.Availability.MinOrderQuantity" + OFFERS_LISTINGS_AVAILABILITY_TYPE = "Offers.Listings.Availability.Type" + OFFERS_LISTINGS_CONDITION = "Offers.Listings.Condition" + OFFERS_LISTINGS_CONDITION_SUBCONDITION = "Offers.Listings.Condition.SubCondition" + OFFERS_LISTINGS_DELIVERYINFO_ISAMAZONFULFILLED = "Offers.Listings.DeliveryInfo.IsAmazonFulfilled" + OFFERS_LISTINGS_DELIVERYINFO_ISFREESHIPPINGELIGIBLE = "Offers.Listings.DeliveryInfo.IsFreeShippingEligible" + OFFERS_LISTINGS_DELIVERYINFO_ISPRIMEELIGIBLE = "Offers.Listings.DeliveryInfo.IsPrimeEligible" + OFFERS_LISTINGS_DELIVERYINFO_SHIPPINGCHARGES = "Offers.Listings.DeliveryInfo.ShippingCharges" + OFFERS_LISTINGS_ISBUYBOXWINNER = "Offers.Listings.IsBuyBoxWinner" + OFFERS_LISTINGS_LOYALTYPOINTS_POINTS = "Offers.Listings.LoyaltyPoints.Points" + OFFERS_LISTINGS_MERCHANTINFO = "Offers.Listings.MerchantInfo" + OFFERS_LISTINGS_PRICE = "Offers.Listings.Price" + OFFERS_LISTINGS_PROGRAMELIGIBILITY_ISPRIMEEXCLUSIVE = "Offers.Listings.ProgramEligibility.IsPrimeExclusive" + OFFERS_LISTINGS_PROGRAMELIGIBILITY_ISPRIMEPANTRY = "Offers.Listings.ProgramEligibility.IsPrimePantry" + OFFERS_LISTINGS_PROMOTIONS = "Offers.Listings.Promotions" + OFFERS_LISTINGS_SAVINGBASIS = "Offers.Listings.SavingBasis" + OFFERS_SUMMARIES_HIGHESTPRICE = "Offers.Summaries.HighestPrice" + OFFERS_SUMMARIES_LOWESTPRICE = "Offers.Summaries.LowestPrice" + OFFERS_SUMMARIES_OFFERCOUNT = "Offers.Summaries.OfferCount" + PARENTASIN = "ParentASIN" + RENTALOFFERS_LISTINGS_AVAILABILITY_MAXORDERQUANTITY = "RentalOffers.Listings.Availability.MaxOrderQuantity" + RENTALOFFERS_LISTINGS_AVAILABILITY_MESSAGE = "RentalOffers.Listings.Availability.Message" + RENTALOFFERS_LISTINGS_AVAILABILITY_MINORDERQUANTITY = "RentalOffers.Listings.Availability.MinOrderQuantity" + RENTALOFFERS_LISTINGS_AVAILABILITY_TYPE = "RentalOffers.Listings.Availability.Type" + RENTALOFFERS_LISTINGS_BASEPRICE = "RentalOffers.Listings.BasePrice" + RENTALOFFERS_LISTINGS_CONDITION = "RentalOffers.Listings.Condition" + RENTALOFFERS_LISTINGS_CONDITION_SUBCONDITION = "RentalOffers.Listings.Condition.SubCondition" + RENTALOFFERS_LISTINGS_DELIVERYINFO_ISAMAZONFULFILLED = "RentalOffers.Listings.DeliveryInfo.IsAmazonFulfilled" + RENTALOFFERS_LISTINGS_DELIVERYINFO_ISFREESHIPPINGELIGIBLE = "RentalOffers.Listings.DeliveryInfo.IsFreeShippingEligible" + RENTALOFFERS_LISTINGS_DELIVERYINFO_ISPRIMEELIGIBLE = "RentalOffers.Listings.DeliveryInfo.IsPrimeEligible" + RENTALOFFERS_LISTINGS_DELIVERYINFO_SHIPPINGCHARGES = "RentalOffers.Listings.DeliveryInfo.ShippingCharges" + RENTALOFFERS_LISTINGS_MERCHANTINFO = "RentalOffers.Listings.MerchantInfo" + + """ + 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 + """GetItemsResource - 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(GetItemsResource, 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, GetItemsResource): + 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/paapi5_python_sdk/get_items_response.py b/paapi5_python_sdk/get_items_response.py new file mode 100644 index 0000000..9cc6510 --- /dev/null +++ b/paapi5_python_sdk/get_items_response.py @@ -0,0 +1,155 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.error_data import ErrorData # noqa: F401,E501 +from paapi5_python_sdk.items_result import ItemsResult # noqa: F401,E501 + + +class GetItemsResponse(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 = { + 'errors': 'list[ErrorData]', + 'items_result': 'ItemsResult' + } + + attribute_map = { + 'errors': 'Errors', + 'items_result': 'ItemsResult' + } + + def __init__(self, errors=None, items_result=None): # noqa: E501 + """GetItemsResponse - a model defined in Swagger""" # noqa: E501 + + self._errors = None + self._items_result = None + self.discriminator = None + + if errors is not None: + self.errors = errors + if items_result is not None: + self.items_result = items_result + + @property + def errors(self): + """Gets the errors of this GetItemsResponse. # noqa: E501 + + + :return: The errors of this GetItemsResponse. # noqa: E501 + :rtype: list[ErrorData] + """ + return self._errors + + @errors.setter + def errors(self, errors): + """Sets the errors of this GetItemsResponse. + + + :param errors: The errors of this GetItemsResponse. # noqa: E501 + :type: list[ErrorData] + """ + + self._errors = errors + + @property + def items_result(self): + """Gets the items_result of this GetItemsResponse. # noqa: E501 + + + :return: The items_result of this GetItemsResponse. # noqa: E501 + :rtype: ItemsResult + """ + return self._items_result + + @items_result.setter + def items_result(self, items_result): + """Sets the items_result of this GetItemsResponse. + + + :param items_result: The items_result of this GetItemsResponse. # noqa: E501 + :type: ItemsResult + """ + + self._items_result = items_result + + 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(GetItemsResponse, 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, GetItemsResponse): + 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/paapi5_python_sdk/get_variations_request.py b/paapi5_python_sdk/get_variations_request.py new file mode 100644 index 0000000..c78314c --- /dev/null +++ b/paapi5_python_sdk/get_variations_request.py @@ -0,0 +1,448 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.condition import Condition # noqa: F401,E501 +from paapi5_python_sdk.get_variations_resource import GetVariationsResource # noqa: F401,E501 +from paapi5_python_sdk.merchant import Merchant # noqa: F401,E501 +from paapi5_python_sdk.offer_count import OfferCount # noqa: F401,E501 +from paapi5_python_sdk.partner_type import PartnerType # noqa: F401,E501 +from paapi5_python_sdk.properties import Properties # noqa: F401,E501 + + +class GetVariationsRequest(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 = { + 'asin': 'str', + 'condition': 'Condition', + 'currency_of_preference': 'str', + 'languages_of_preference': 'list[str]', + 'marketplace': 'str', + 'merchant': 'Merchant', + 'offer_count': 'OfferCount', + 'partner_tag': 'str', + 'partner_type': 'PartnerType', + 'properties': 'Properties', + 'resources': 'list[GetVariationsResource]', + 'variation_count': 'int', + 'variation_page': 'int' + } + + attribute_map = { + 'asin': 'ASIN', + 'condition': 'Condition', + 'currency_of_preference': 'CurrencyOfPreference', + 'languages_of_preference': 'LanguagesOfPreference', + 'marketplace': 'Marketplace', + 'merchant': 'Merchant', + 'offer_count': 'OfferCount', + 'partner_tag': 'PartnerTag', + 'partner_type': 'PartnerType', + 'properties': 'Properties', + 'resources': 'Resources', + 'variation_count': 'VariationCount', + 'variation_page': 'VariationPage' + } + + def __init__(self, asin=None, condition=None, currency_of_preference=None, languages_of_preference=None, marketplace=None, merchant=None, offer_count=None, partner_tag=None, partner_type=None, properties=None, resources=None, variation_count=None, variation_page=None): # noqa: E501 + """GetVariationsRequest - a model defined in Swagger""" # noqa: E501 + + self._asin = None + self._condition = None + self._currency_of_preference = None + self._languages_of_preference = None + self._marketplace = None + self._merchant = None + self._offer_count = None + self._partner_tag = None + self._partner_type = None + self._properties = None + self._resources = None + self._variation_count = None + self._variation_page = None + self.discriminator = None + + self.asin = asin + if condition is not None: + self.condition = condition + if currency_of_preference is not None: + self.currency_of_preference = currency_of_preference + if languages_of_preference is not None: + self.languages_of_preference = languages_of_preference + if marketplace is not None: + self.marketplace = marketplace + if merchant is not None: + self.merchant = merchant + if offer_count is not None: + self.offer_count = offer_count + self.partner_tag = partner_tag + self.partner_type = partner_type + if properties is not None: + self.properties = properties + if resources is not None: + self.resources = resources + if variation_count is not None: + self.variation_count = variation_count + if variation_page is not None: + self.variation_page = variation_page + + @property + def asin(self): + """Gets the asin of this GetVariationsRequest. # noqa: E501 + + + :return: The asin of this GetVariationsRequest. # noqa: E501 + :rtype: str + """ + return self._asin + + @asin.setter + def asin(self, asin): + """Sets the asin of this GetVariationsRequest. + + + :param asin: The asin of this GetVariationsRequest. # noqa: E501 + :type: str + """ + if asin is None: + raise ValueError("Invalid value for `asin`, must not be `None`") # noqa: E501 + + self._asin = asin + + @property + def condition(self): + """Gets the condition of this GetVariationsRequest. # noqa: E501 + + + :return: The condition of this GetVariationsRequest. # noqa: E501 + :rtype: Condition + """ + return self._condition + + @condition.setter + def condition(self, condition): + """Sets the condition of this GetVariationsRequest. + + + :param condition: The condition of this GetVariationsRequest. # noqa: E501 + :type: Condition + """ + + self._condition = condition + + @property + def currency_of_preference(self): + """Gets the currency_of_preference of this GetVariationsRequest. # noqa: E501 + + + :return: The currency_of_preference of this GetVariationsRequest. # noqa: E501 + :rtype: str + """ + return self._currency_of_preference + + @currency_of_preference.setter + def currency_of_preference(self, currency_of_preference): + """Sets the currency_of_preference of this GetVariationsRequest. + + + :param currency_of_preference: The currency_of_preference of this GetVariationsRequest. # noqa: E501 + :type: str + """ + + self._currency_of_preference = currency_of_preference + + @property + def languages_of_preference(self): + """Gets the languages_of_preference of this GetVariationsRequest. # noqa: E501 + + + :return: The languages_of_preference of this GetVariationsRequest. # noqa: E501 + :rtype: list[str] + """ + return self._languages_of_preference + + @languages_of_preference.setter + def languages_of_preference(self, languages_of_preference): + """Sets the languages_of_preference of this GetVariationsRequest. + + + :param languages_of_preference: The languages_of_preference of this GetVariationsRequest. # noqa: E501 + :type: list[str] + """ + + self._languages_of_preference = languages_of_preference + + @property + def marketplace(self): + """Gets the marketplace of this GetVariationsRequest. # noqa: E501 + + + :return: The marketplace of this GetVariationsRequest. # noqa: E501 + :rtype: str + """ + return self._marketplace + + @marketplace.setter + def marketplace(self, marketplace): + """Sets the marketplace of this GetVariationsRequest. + + + :param marketplace: The marketplace of this GetVariationsRequest. # noqa: E501 + :type: str + """ + + self._marketplace = marketplace + + @property + def merchant(self): + """Gets the merchant of this GetVariationsRequest. # noqa: E501 + + + :return: The merchant of this GetVariationsRequest. # noqa: E501 + :rtype: Merchant + """ + return self._merchant + + @merchant.setter + def merchant(self, merchant): + """Sets the merchant of this GetVariationsRequest. + + + :param merchant: The merchant of this GetVariationsRequest. # noqa: E501 + :type: Merchant + """ + + self._merchant = merchant + + @property + def offer_count(self): + """Gets the offer_count of this GetVariationsRequest. # noqa: E501 + + + :return: The offer_count of this GetVariationsRequest. # noqa: E501 + :rtype: OfferCount + """ + return self._offer_count + + @offer_count.setter + def offer_count(self, offer_count): + """Sets the offer_count of this GetVariationsRequest. + + + :param offer_count: The offer_count of this GetVariationsRequest. # noqa: E501 + :type: OfferCount + """ + + self._offer_count = offer_count + + @property + def partner_tag(self): + """Gets the partner_tag of this GetVariationsRequest. # noqa: E501 + + + :return: The partner_tag of this GetVariationsRequest. # noqa: E501 + :rtype: str + """ + return self._partner_tag + + @partner_tag.setter + def partner_tag(self, partner_tag): + """Sets the partner_tag of this GetVariationsRequest. + + + :param partner_tag: The partner_tag of this GetVariationsRequest. # noqa: E501 + :type: str + """ + if partner_tag is None: + raise ValueError("Invalid value for `partner_tag`, must not be `None`") # noqa: E501 + + self._partner_tag = partner_tag + + @property + def partner_type(self): + """Gets the partner_type of this GetVariationsRequest. # noqa: E501 + + + :return: The partner_type of this GetVariationsRequest. # noqa: E501 + :rtype: PartnerType + """ + return self._partner_type + + @partner_type.setter + def partner_type(self, partner_type): + """Sets the partner_type of this GetVariationsRequest. + + + :param partner_type: The partner_type of this GetVariationsRequest. # noqa: E501 + :type: PartnerType + """ + if partner_type is None: + raise ValueError("Invalid value for `partner_type`, must not be `None`") # noqa: E501 + + self._partner_type = partner_type + + @property + def properties(self): + """Gets the properties of this GetVariationsRequest. # noqa: E501 + + + :return: The properties of this GetVariationsRequest. # noqa: E501 + :rtype: Properties + """ + return self._properties + + @properties.setter + def properties(self, properties): + """Sets the properties of this GetVariationsRequest. + + + :param properties: The properties of this GetVariationsRequest. # noqa: E501 + :type: Properties + """ + + self._properties = properties + + @property + def resources(self): + """Gets the resources of this GetVariationsRequest. # noqa: E501 + + + :return: The resources of this GetVariationsRequest. # noqa: E501 + :rtype: list[GetVariationsResource] + """ + return self._resources + + @resources.setter + def resources(self, resources): + """Sets the resources of this GetVariationsRequest. + + + :param resources: The resources of this GetVariationsRequest. # noqa: E501 + :type: list[GetVariationsResource] + """ + + self._resources = resources + + @property + def variation_count(self): + """Gets the variation_count of this GetVariationsRequest. # noqa: E501 + + + :return: The variation_count of this GetVariationsRequest. # noqa: E501 + :rtype: int + """ + return self._variation_count + + @variation_count.setter + def variation_count(self, variation_count): + """Sets the variation_count of this GetVariationsRequest. + + + :param variation_count: The variation_count of this GetVariationsRequest. # noqa: E501 + :type: int + """ + + self._variation_count = variation_count + + @property + def variation_page(self): + """Gets the variation_page of this GetVariationsRequest. # noqa: E501 + + + :return: The variation_page of this GetVariationsRequest. # noqa: E501 + :rtype: int + """ + return self._variation_page + + @variation_page.setter + def variation_page(self, variation_page): + """Sets the variation_page of this GetVariationsRequest. + + + :param variation_page: The variation_page of this GetVariationsRequest. # noqa: E501 + :type: int + """ + + self._variation_page = variation_page + + 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(GetVariationsRequest, 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, GetVariationsRequest): + 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/paapi5_python_sdk/get_variations_resource.py b/paapi5_python_sdk/get_variations_resource.py new file mode 100644 index 0000000..bf5018e --- /dev/null +++ b/paapi5_python_sdk/get_variations_resource.py @@ -0,0 +1,160 @@ +# coding: utf-8 + +""" + Copyright 2019 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 GetVariationsResource(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + BROWSENODEINFO_BROWSENODES = "BrowseNodeInfo.BrowseNodes" + BROWSENODEINFO_BROWSENODES_ANCESTOR = "BrowseNodeInfo.BrowseNodes.Ancestor" + BROWSENODEINFO_BROWSENODES_SALESRANK = "BrowseNodeInfo.BrowseNodes.SalesRank" + BROWSENODEINFO_WEBSITESALESRANK = "BrowseNodeInfo.WebsiteSalesRank" + IMAGES_PRIMARY_SMALL = "Images.Primary.Small" + IMAGES_PRIMARY_MEDIUM = "Images.Primary.Medium" + IMAGES_PRIMARY_LARGE = "Images.Primary.Large" + IMAGES_VARIANTS_SMALL = "Images.Variants.Small" + IMAGES_VARIANTS_MEDIUM = "Images.Variants.Medium" + IMAGES_VARIANTS_LARGE = "Images.Variants.Large" + ITEMINFO_BYLINEINFO = "ItemInfo.ByLineInfo" + ITEMINFO_CONTENTINFO = "ItemInfo.ContentInfo" + ITEMINFO_CONTENTRATING = "ItemInfo.ContentRating" + ITEMINFO_CLASSIFICATIONS = "ItemInfo.Classifications" + ITEMINFO_EXTERNALIDS = "ItemInfo.ExternalIds" + ITEMINFO_FEATURES = "ItemInfo.Features" + ITEMINFO_MANUFACTUREINFO = "ItemInfo.ManufactureInfo" + ITEMINFO_PRODUCTINFO = "ItemInfo.ProductInfo" + ITEMINFO_TECHNICALINFO = "ItemInfo.TechnicalInfo" + ITEMINFO_TITLE = "ItemInfo.Title" + ITEMINFO_TRADEININFO = "ItemInfo.TradeInInfo" + OFFERS_LISTINGS_AVAILABILITY_MAXORDERQUANTITY = "Offers.Listings.Availability.MaxOrderQuantity" + OFFERS_LISTINGS_AVAILABILITY_MESSAGE = "Offers.Listings.Availability.Message" + OFFERS_LISTINGS_AVAILABILITY_MINORDERQUANTITY = "Offers.Listings.Availability.MinOrderQuantity" + OFFERS_LISTINGS_AVAILABILITY_TYPE = "Offers.Listings.Availability.Type" + OFFERS_LISTINGS_CONDITION = "Offers.Listings.Condition" + OFFERS_LISTINGS_CONDITION_SUBCONDITION = "Offers.Listings.Condition.SubCondition" + OFFERS_LISTINGS_DELIVERYINFO_ISAMAZONFULFILLED = "Offers.Listings.DeliveryInfo.IsAmazonFulfilled" + OFFERS_LISTINGS_DELIVERYINFO_ISFREESHIPPINGELIGIBLE = "Offers.Listings.DeliveryInfo.IsFreeShippingEligible" + OFFERS_LISTINGS_DELIVERYINFO_ISPRIMEELIGIBLE = "Offers.Listings.DeliveryInfo.IsPrimeEligible" + OFFERS_LISTINGS_DELIVERYINFO_SHIPPINGCHARGES = "Offers.Listings.DeliveryInfo.ShippingCharges" + OFFERS_LISTINGS_ISBUYBOXWINNER = "Offers.Listings.IsBuyBoxWinner" + OFFERS_LISTINGS_LOYALTYPOINTS_POINTS = "Offers.Listings.LoyaltyPoints.Points" + OFFERS_LISTINGS_MERCHANTINFO = "Offers.Listings.MerchantInfo" + OFFERS_LISTINGS_PRICE = "Offers.Listings.Price" + OFFERS_LISTINGS_PROGRAMELIGIBILITY_ISPRIMEEXCLUSIVE = "Offers.Listings.ProgramEligibility.IsPrimeExclusive" + OFFERS_LISTINGS_PROGRAMELIGIBILITY_ISPRIMEPANTRY = "Offers.Listings.ProgramEligibility.IsPrimePantry" + OFFERS_LISTINGS_PROMOTIONS = "Offers.Listings.Promotions" + OFFERS_LISTINGS_SAVINGBASIS = "Offers.Listings.SavingBasis" + OFFERS_SUMMARIES_HIGHESTPRICE = "Offers.Summaries.HighestPrice" + OFFERS_SUMMARIES_LOWESTPRICE = "Offers.Summaries.LowestPrice" + OFFERS_SUMMARIES_OFFERCOUNT = "Offers.Summaries.OfferCount" + PARENTASIN = "ParentASIN" + RENTALOFFERS_LISTINGS_AVAILABILITY_MAXORDERQUANTITY = "RentalOffers.Listings.Availability.MaxOrderQuantity" + RENTALOFFERS_LISTINGS_AVAILABILITY_MESSAGE = "RentalOffers.Listings.Availability.Message" + RENTALOFFERS_LISTINGS_AVAILABILITY_MINORDERQUANTITY = "RentalOffers.Listings.Availability.MinOrderQuantity" + RENTALOFFERS_LISTINGS_AVAILABILITY_TYPE = "RentalOffers.Listings.Availability.Type" + RENTALOFFERS_LISTINGS_BASEPRICE = "RentalOffers.Listings.BasePrice" + RENTALOFFERS_LISTINGS_CONDITION = "RentalOffers.Listings.Condition" + RENTALOFFERS_LISTINGS_CONDITION_SUBCONDITION = "RentalOffers.Listings.Condition.SubCondition" + RENTALOFFERS_LISTINGS_DELIVERYINFO_ISAMAZONFULFILLED = "RentalOffers.Listings.DeliveryInfo.IsAmazonFulfilled" + RENTALOFFERS_LISTINGS_DELIVERYINFO_ISFREESHIPPINGELIGIBLE = "RentalOffers.Listings.DeliveryInfo.IsFreeShippingEligible" + RENTALOFFERS_LISTINGS_DELIVERYINFO_ISPRIMEELIGIBLE = "RentalOffers.Listings.DeliveryInfo.IsPrimeEligible" + RENTALOFFERS_LISTINGS_DELIVERYINFO_SHIPPINGCHARGES = "RentalOffers.Listings.DeliveryInfo.ShippingCharges" + RENTALOFFERS_LISTINGS_MERCHANTINFO = "RentalOffers.Listings.MerchantInfo" + VARIATIONSUMMARY_PRICE_HIGHESTPRICE = "VariationSummary.Price.HighestPrice" + VARIATIONSUMMARY_PRICE_LOWESTPRICE = "VariationSummary.Price.LowestPrice" + VARIATIONSUMMARY_VARIATIONDIMENSION = "VariationSummary.VariationDimension" + + """ + 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 + """GetVariationsResource - 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(GetVariationsResource, 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, GetVariationsResource): + 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/paapi5_python_sdk/get_variations_response.py b/paapi5_python_sdk/get_variations_response.py new file mode 100644 index 0000000..c99df31 --- /dev/null +++ b/paapi5_python_sdk/get_variations_response.py @@ -0,0 +1,155 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.error_data import ErrorData # noqa: F401,E501 +from paapi5_python_sdk.variations_result import VariationsResult # noqa: F401,E501 + + +class GetVariationsResponse(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 = { + 'errors': 'list[ErrorData]', + 'variations_result': 'VariationsResult' + } + + attribute_map = { + 'errors': 'Errors', + 'variations_result': 'VariationsResult' + } + + def __init__(self, errors=None, variations_result=None): # noqa: E501 + """GetVariationsResponse - a model defined in Swagger""" # noqa: E501 + + self._errors = None + self._variations_result = None + self.discriminator = None + + if errors is not None: + self.errors = errors + if variations_result is not None: + self.variations_result = variations_result + + @property + def errors(self): + """Gets the errors of this GetVariationsResponse. # noqa: E501 + + + :return: The errors of this GetVariationsResponse. # noqa: E501 + :rtype: list[ErrorData] + """ + return self._errors + + @errors.setter + def errors(self, errors): + """Sets the errors of this GetVariationsResponse. + + + :param errors: The errors of this GetVariationsResponse. # noqa: E501 + :type: list[ErrorData] + """ + + self._errors = errors + + @property + def variations_result(self): + """Gets the variations_result of this GetVariationsResponse. # noqa: E501 + + + :return: The variations_result of this GetVariationsResponse. # noqa: E501 + :rtype: VariationsResult + """ + return self._variations_result + + @variations_result.setter + def variations_result(self, variations_result): + """Sets the variations_result of this GetVariationsResponse. + + + :param variations_result: The variations_result of this GetVariationsResponse. # noqa: E501 + :type: VariationsResult + """ + + self._variations_result = variations_result + + 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(GetVariationsResponse, 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, GetVariationsResponse): + 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/paapi5_python_sdk/image_size.py b/paapi5_python_sdk/image_size.py new file mode 100644 index 0000000..cb56660 --- /dev/null +++ b/paapi5_python_sdk/image_size.py @@ -0,0 +1,178 @@ +# coding: utf-8 + +""" + Copyright 2019 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 ImageSize(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 = { + 'url': 'str', + 'height': 'int', + 'width': 'int' + } + + attribute_map = { + 'url': 'URL', + 'height': 'Height', + 'width': 'Width' + } + + def __init__(self, url=None, height=None, width=None): # noqa: E501 + """ImageSize - a model defined in Swagger""" # noqa: E501 + + self._url = None + self._height = None + self._width = None + self.discriminator = None + + if url is not None: + self.url = url + if height is not None: + self.height = height + if width is not None: + self.width = width + + @property + def url(self): + """Gets the url of this ImageSize. # noqa: E501 + + + :return: The url of this ImageSize. # noqa: E501 + :rtype: str + """ + return self._url + + @url.setter + def url(self, url): + """Sets the url of this ImageSize. + + + :param url: The url of this ImageSize. # noqa: E501 + :type: str + """ + + self._url = url + + @property + def height(self): + """Gets the height of this ImageSize. # noqa: E501 + + + :return: The height of this ImageSize. # noqa: E501 + :rtype: int + """ + return self._height + + @height.setter + def height(self, height): + """Sets the height of this ImageSize. + + + :param height: The height of this ImageSize. # noqa: E501 + :type: int + """ + + self._height = height + + @property + def width(self): + """Gets the width of this ImageSize. # noqa: E501 + + + :return: The width of this ImageSize. # noqa: E501 + :rtype: int + """ + return self._width + + @width.setter + def width(self, width): + """Sets the width of this ImageSize. + + + :param width: The width of this ImageSize. # noqa: E501 + :type: int + """ + + self._width = width + + 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(ImageSize, 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, ImageSize): + 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/paapi5_python_sdk/image_type.py b/paapi5_python_sdk/image_type.py new file mode 100644 index 0000000..b6537c5 --- /dev/null +++ b/paapi5_python_sdk/image_type.py @@ -0,0 +1,180 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.image_size import ImageSize # noqa: F401,E501 + + +class ImageType(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 = { + 'small': 'ImageSize', + 'medium': 'ImageSize', + 'large': 'ImageSize' + } + + attribute_map = { + 'small': 'Small', + 'medium': 'Medium', + 'large': 'Large' + } + + def __init__(self, small=None, medium=None, large=None): # noqa: E501 + """ImageType - a model defined in Swagger""" # noqa: E501 + + self._small = None + self._medium = None + self._large = None + self.discriminator = None + + if small is not None: + self.small = small + if medium is not None: + self.medium = medium + if large is not None: + self.large = large + + @property + def small(self): + """Gets the small of this ImageType. # noqa: E501 + + + :return: The small of this ImageType. # noqa: E501 + :rtype: ImageSize + """ + return self._small + + @small.setter + def small(self, small): + """Sets the small of this ImageType. + + + :param small: The small of this ImageType. # noqa: E501 + :type: ImageSize + """ + + self._small = small + + @property + def medium(self): + """Gets the medium of this ImageType. # noqa: E501 + + + :return: The medium of this ImageType. # noqa: E501 + :rtype: ImageSize + """ + return self._medium + + @medium.setter + def medium(self, medium): + """Sets the medium of this ImageType. + + + :param medium: The medium of this ImageType. # noqa: E501 + :type: ImageSize + """ + + self._medium = medium + + @property + def large(self): + """Gets the large of this ImageType. # noqa: E501 + + + :return: The large of this ImageType. # noqa: E501 + :rtype: ImageSize + """ + return self._large + + @large.setter + def large(self, large): + """Sets the large of this ImageType. + + + :param large: The large of this ImageType. # noqa: E501 + :type: ImageSize + """ + + self._large = large + + 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(ImageType, 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, ImageType): + 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/paapi5_python_sdk/images.py b/paapi5_python_sdk/images.py new file mode 100644 index 0000000..4e67a45 --- /dev/null +++ b/paapi5_python_sdk/images.py @@ -0,0 +1,154 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.image_type import ImageType # noqa: F401,E501 + + +class Images(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 = { + 'primary': 'ImageType', + 'variants': 'list[ImageType]' + } + + attribute_map = { + 'primary': 'Primary', + 'variants': 'Variants' + } + + def __init__(self, primary=None, variants=None): # noqa: E501 + """Images - a model defined in Swagger""" # noqa: E501 + + self._primary = None + self._variants = None + self.discriminator = None + + if primary is not None: + self.primary = primary + if variants is not None: + self.variants = variants + + @property + def primary(self): + """Gets the primary of this Images. # noqa: E501 + + + :return: The primary of this Images. # noqa: E501 + :rtype: ImageType + """ + return self._primary + + @primary.setter + def primary(self, primary): + """Sets the primary of this Images. + + + :param primary: The primary of this Images. # noqa: E501 + :type: ImageType + """ + + self._primary = primary + + @property + def variants(self): + """Gets the variants of this Images. # noqa: E501 + + + :return: The variants of this Images. # noqa: E501 + :rtype: list[ImageType] + """ + return self._variants + + @variants.setter + def variants(self, variants): + """Sets the variants of this Images. + + + :param variants: The variants of this Images. # noqa: E501 + :type: list[ImageType] + """ + + self._variants = variants + + 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(Images, 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, Images): + 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/paapi5_python_sdk/item.py b/paapi5_python_sdk/item.py new file mode 100644 index 0000000..23cb16a --- /dev/null +++ b/paapi5_python_sdk/item.py @@ -0,0 +1,367 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.browse_node_info import BrowseNodeInfo # noqa: F401,E501 +from paapi5_python_sdk.images import Images # noqa: F401,E501 +from paapi5_python_sdk.item_info import ItemInfo # noqa: F401,E501 +from paapi5_python_sdk.offers import Offers # noqa: F401,E501 +from paapi5_python_sdk.rental_offers import RentalOffers # noqa: F401,E501 +from paapi5_python_sdk.variation_attribute import VariationAttribute # noqa: F401,E501 + + +class Item(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 = { + 'asin': 'str', + 'browse_node_info': 'BrowseNodeInfo', + 'detail_page_url': 'str', + 'images': 'Images', + 'item_info': 'ItemInfo', + 'offers': 'Offers', + 'parent_asin': 'str', + 'rental_offers': 'RentalOffers', + 'score': 'float', + 'variation_attributes': 'list[VariationAttribute]' + } + + attribute_map = { + 'asin': 'ASIN', + 'browse_node_info': 'BrowseNodeInfo', + 'detail_page_url': 'DetailPageURL', + 'images': 'Images', + 'item_info': 'ItemInfo', + 'offers': 'Offers', + 'parent_asin': 'ParentASIN', + 'rental_offers': 'RentalOffers', + 'score': 'Score', + 'variation_attributes': 'VariationAttributes' + } + + def __init__(self, asin=None, browse_node_info=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 + """Item - a model defined in Swagger""" # noqa: E501 + + self._asin = None + self._browse_node_info = None + self._detail_page_url = None + self._images = None + self._item_info = None + self._offers = None + self._parent_asin = None + self._rental_offers = None + self._score = None + self._variation_attributes = None + self.discriminator = None + + if asin is not None: + self.asin = asin + if browse_node_info is not None: + self.browse_node_info = browse_node_info + if detail_page_url is not None: + self.detail_page_url = detail_page_url + if images is not None: + self.images = images + if item_info is not None: + self.item_info = item_info + if offers is not None: + self.offers = offers + if parent_asin is not None: + self.parent_asin = parent_asin + if rental_offers is not None: + self.rental_offers = rental_offers + if score is not None: + self.score = score + if variation_attributes is not None: + self.variation_attributes = variation_attributes + + @property + def asin(self): + """Gets the asin of this Item. # noqa: E501 + + + :return: The asin of this Item. # noqa: E501 + :rtype: str + """ + return self._asin + + @asin.setter + def asin(self, asin): + """Sets the asin of this Item. + + + :param asin: The asin of this Item. # noqa: E501 + :type: str + """ + + self._asin = asin + + @property + def browse_node_info(self): + """Gets the browse_node_info of this Item. # noqa: E501 + + + :return: The browse_node_info of this Item. # noqa: E501 + :rtype: BrowseNodeInfo + """ + return self._browse_node_info + + @browse_node_info.setter + def browse_node_info(self, browse_node_info): + """Sets the browse_node_info of this Item. + + + :param browse_node_info: The browse_node_info of this Item. # noqa: E501 + :type: BrowseNodeInfo + """ + + self._browse_node_info = browse_node_info + + @property + def detail_page_url(self): + """Gets the detail_page_url of this Item. # noqa: E501 + + + :return: The detail_page_url of this Item. # noqa: E501 + :rtype: str + """ + return self._detail_page_url + + @detail_page_url.setter + def detail_page_url(self, detail_page_url): + """Sets the detail_page_url of this Item. + + + :param detail_page_url: The detail_page_url of this Item. # noqa: E501 + :type: str + """ + + self._detail_page_url = detail_page_url + + @property + def images(self): + """Gets the images of this Item. # noqa: E501 + + + :return: The images of this Item. # noqa: E501 + :rtype: Images + """ + return self._images + + @images.setter + def images(self, images): + """Sets the images of this Item. + + + :param images: The images of this Item. # noqa: E501 + :type: Images + """ + + self._images = images + + @property + def item_info(self): + """Gets the item_info of this Item. # noqa: E501 + + + :return: The item_info of this Item. # noqa: E501 + :rtype: ItemInfo + """ + return self._item_info + + @item_info.setter + def item_info(self, item_info): + """Sets the item_info of this Item. + + + :param item_info: The item_info of this Item. # noqa: E501 + :type: ItemInfo + """ + + self._item_info = item_info + + @property + def offers(self): + """Gets the offers of this Item. # noqa: E501 + + + :return: The offers of this Item. # noqa: E501 + :rtype: Offers + """ + return self._offers + + @offers.setter + def offers(self, offers): + """Sets the offers of this Item. + + + :param offers: The offers of this Item. # noqa: E501 + :type: Offers + """ + + self._offers = offers + + @property + def parent_asin(self): + """Gets the parent_asin of this Item. # noqa: E501 + + + :return: The parent_asin of this Item. # noqa: E501 + :rtype: str + """ + return self._parent_asin + + @parent_asin.setter + def parent_asin(self, parent_asin): + """Sets the parent_asin of this Item. + + + :param parent_asin: The parent_asin of this Item. # noqa: E501 + :type: str + """ + + self._parent_asin = parent_asin + + @property + def rental_offers(self): + """Gets the rental_offers of this Item. # noqa: E501 + + + :return: The rental_offers of this Item. # noqa: E501 + :rtype: RentalOffers + """ + return self._rental_offers + + @rental_offers.setter + def rental_offers(self, rental_offers): + """Sets the rental_offers of this Item. + + + :param rental_offers: The rental_offers of this Item. # noqa: E501 + :type: RentalOffers + """ + + self._rental_offers = rental_offers + + @property + def score(self): + """Gets the score of this Item. # noqa: E501 + + + :return: The score of this Item. # noqa: E501 + :rtype: float + """ + return self._score + + @score.setter + def score(self, score): + """Sets the score of this Item. + + + :param score: The score of this Item. # noqa: E501 + :type: float + """ + + self._score = score + + @property + def variation_attributes(self): + """Gets the variation_attributes of this Item. # noqa: E501 + + + :return: The variation_attributes of this Item. # noqa: E501 + :rtype: list[VariationAttribute] + """ + return self._variation_attributes + + @variation_attributes.setter + def variation_attributes(self, variation_attributes): + """Sets the variation_attributes of this Item. + + + :param variation_attributes: The variation_attributes of this Item. # noqa: E501 + :type: list[VariationAttribute] + """ + + self._variation_attributes = variation_attributes + + 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(Item, 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, Item): + 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/paapi5_python_sdk/item_id_type.py b/paapi5_python_sdk/item_id_type.py new file mode 100644 index 0000000..0d3b36a --- /dev/null +++ b/paapi5_python_sdk/item_id_type.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Copyright 2019 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 ItemIdType(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + ASIN = "ASIN" + + """ + 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 + """ItemIdType - 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(ItemIdType, 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, ItemIdType): + 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/paapi5_python_sdk/item_info.py b/paapi5_python_sdk/item_info.py new file mode 100644 index 0000000..ec8c37e --- /dev/null +++ b/paapi5_python_sdk/item_info.py @@ -0,0 +1,398 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.by_line_info import ByLineInfo # noqa: F401,E501 +from paapi5_python_sdk.classifications import Classifications # noqa: F401,E501 +from paapi5_python_sdk.content_info import ContentInfo # noqa: F401,E501 +from paapi5_python_sdk.content_rating import ContentRating # noqa: F401,E501 +from paapi5_python_sdk.external_ids import ExternalIds # noqa: F401,E501 +from paapi5_python_sdk.manufacture_info import ManufactureInfo # noqa: F401,E501 +from paapi5_python_sdk.multi_valued_attribute import MultiValuedAttribute # noqa: F401,E501 +from paapi5_python_sdk.product_info import ProductInfo # noqa: F401,E501 +from paapi5_python_sdk.single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 +from paapi5_python_sdk.technical_info import TechnicalInfo # noqa: F401,E501 +from paapi5_python_sdk.trade_in_info import TradeInInfo # noqa: F401,E501 + + +class ItemInfo(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 = { + 'by_line_info': 'ByLineInfo', + 'classifications': 'Classifications', + 'content_info': 'ContentInfo', + 'content_rating': 'ContentRating', + 'external_ids': 'ExternalIds', + 'features': 'MultiValuedAttribute', + 'manufacture_info': 'ManufactureInfo', + 'product_info': 'ProductInfo', + 'technical_info': 'TechnicalInfo', + 'title': 'SingleStringValuedAttribute', + 'trade_in_info': 'TradeInInfo' + } + + attribute_map = { + 'by_line_info': 'ByLineInfo', + 'classifications': 'Classifications', + 'content_info': 'ContentInfo', + 'content_rating': 'ContentRating', + 'external_ids': 'ExternalIds', + 'features': 'Features', + 'manufacture_info': 'ManufactureInfo', + 'product_info': 'ProductInfo', + 'technical_info': 'TechnicalInfo', + 'title': 'Title', + 'trade_in_info': 'TradeInInfo' + } + + def __init__(self, by_line_info=None, classifications=None, content_info=None, content_rating=None, external_ids=None, features=None, manufacture_info=None, product_info=None, technical_info=None, title=None, trade_in_info=None): # noqa: E501 + """ItemInfo - a model defined in Swagger""" # noqa: E501 + + self._by_line_info = None + self._classifications = None + self._content_info = None + self._content_rating = None + self._external_ids = None + self._features = None + self._manufacture_info = None + self._product_info = None + self._technical_info = None + self._title = None + self._trade_in_info = None + self.discriminator = None + + if by_line_info is not None: + self.by_line_info = by_line_info + if classifications is not None: + self.classifications = classifications + if content_info is not None: + self.content_info = content_info + if content_rating is not None: + self.content_rating = content_rating + if external_ids is not None: + self.external_ids = external_ids + if features is not None: + self.features = features + if manufacture_info is not None: + self.manufacture_info = manufacture_info + if product_info is not None: + self.product_info = product_info + if technical_info is not None: + self.technical_info = technical_info + if title is not None: + self.title = title + if trade_in_info is not None: + self.trade_in_info = trade_in_info + + @property + def by_line_info(self): + """Gets the by_line_info of this ItemInfo. # noqa: E501 + + + :return: The by_line_info of this ItemInfo. # noqa: E501 + :rtype: ByLineInfo + """ + return self._by_line_info + + @by_line_info.setter + def by_line_info(self, by_line_info): + """Sets the by_line_info of this ItemInfo. + + + :param by_line_info: The by_line_info of this ItemInfo. # noqa: E501 + :type: ByLineInfo + """ + + self._by_line_info = by_line_info + + @property + def classifications(self): + """Gets the classifications of this ItemInfo. # noqa: E501 + + + :return: The classifications of this ItemInfo. # noqa: E501 + :rtype: Classifications + """ + return self._classifications + + @classifications.setter + def classifications(self, classifications): + """Sets the classifications of this ItemInfo. + + + :param classifications: The classifications of this ItemInfo. # noqa: E501 + :type: Classifications + """ + + self._classifications = classifications + + @property + def content_info(self): + """Gets the content_info of this ItemInfo. # noqa: E501 + + + :return: The content_info of this ItemInfo. # noqa: E501 + :rtype: ContentInfo + """ + return self._content_info + + @content_info.setter + def content_info(self, content_info): + """Sets the content_info of this ItemInfo. + + + :param content_info: The content_info of this ItemInfo. # noqa: E501 + :type: ContentInfo + """ + + self._content_info = content_info + + @property + def content_rating(self): + """Gets the content_rating of this ItemInfo. # noqa: E501 + + + :return: The content_rating of this ItemInfo. # noqa: E501 + :rtype: ContentRating + """ + return self._content_rating + + @content_rating.setter + def content_rating(self, content_rating): + """Sets the content_rating of this ItemInfo. + + + :param content_rating: The content_rating of this ItemInfo. # noqa: E501 + :type: ContentRating + """ + + self._content_rating = content_rating + + @property + def external_ids(self): + """Gets the external_ids of this ItemInfo. # noqa: E501 + + + :return: The external_ids of this ItemInfo. # noqa: E501 + :rtype: ExternalIds + """ + return self._external_ids + + @external_ids.setter + def external_ids(self, external_ids): + """Sets the external_ids of this ItemInfo. + + + :param external_ids: The external_ids of this ItemInfo. # noqa: E501 + :type: ExternalIds + """ + + self._external_ids = external_ids + + @property + def features(self): + """Gets the features of this ItemInfo. # noqa: E501 + + + :return: The features of this ItemInfo. # noqa: E501 + :rtype: MultiValuedAttribute + """ + return self._features + + @features.setter + def features(self, features): + """Sets the features of this ItemInfo. + + + :param features: The features of this ItemInfo. # noqa: E501 + :type: MultiValuedAttribute + """ + + self._features = features + + @property + def manufacture_info(self): + """Gets the manufacture_info of this ItemInfo. # noqa: E501 + + + :return: The manufacture_info of this ItemInfo. # noqa: E501 + :rtype: ManufactureInfo + """ + return self._manufacture_info + + @manufacture_info.setter + def manufacture_info(self, manufacture_info): + """Sets the manufacture_info of this ItemInfo. + + + :param manufacture_info: The manufacture_info of this ItemInfo. # noqa: E501 + :type: ManufactureInfo + """ + + self._manufacture_info = manufacture_info + + @property + def product_info(self): + """Gets the product_info of this ItemInfo. # noqa: E501 + + + :return: The product_info of this ItemInfo. # noqa: E501 + :rtype: ProductInfo + """ + return self._product_info + + @product_info.setter + def product_info(self, product_info): + """Sets the product_info of this ItemInfo. + + + :param product_info: The product_info of this ItemInfo. # noqa: E501 + :type: ProductInfo + """ + + self._product_info = product_info + + @property + def technical_info(self): + """Gets the technical_info of this ItemInfo. # noqa: E501 + + + :return: The technical_info of this ItemInfo. # noqa: E501 + :rtype: TechnicalInfo + """ + return self._technical_info + + @technical_info.setter + def technical_info(self, technical_info): + """Sets the technical_info of this ItemInfo. + + + :param technical_info: The technical_info of this ItemInfo. # noqa: E501 + :type: TechnicalInfo + """ + + self._technical_info = technical_info + + @property + def title(self): + """Gets the title of this ItemInfo. # noqa: E501 + + + :return: The title of this ItemInfo. # noqa: E501 + :rtype: SingleStringValuedAttribute + """ + return self._title + + @title.setter + def title(self, title): + """Sets the title of this ItemInfo. + + + :param title: The title of this ItemInfo. # noqa: E501 + :type: SingleStringValuedAttribute + """ + + self._title = title + + @property + def trade_in_info(self): + """Gets the trade_in_info of this ItemInfo. # noqa: E501 + + + :return: The trade_in_info of this ItemInfo. # noqa: E501 + :rtype: TradeInInfo + """ + return self._trade_in_info + + @trade_in_info.setter + def trade_in_info(self, trade_in_info): + """Sets the trade_in_info of this ItemInfo. + + + :param trade_in_info: The trade_in_info of this ItemInfo. # noqa: E501 + :type: TradeInInfo + """ + + self._trade_in_info = trade_in_info + + 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(ItemInfo, 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, ItemInfo): + 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/paapi5_python_sdk/items_result.py b/paapi5_python_sdk/items_result.py new file mode 100644 index 0000000..714d848 --- /dev/null +++ b/paapi5_python_sdk/items_result.py @@ -0,0 +1,128 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.item import Item # noqa: F401,E501 + + +class ItemsResult(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 = { + 'items': 'list[Item]' + } + + attribute_map = { + 'items': 'Items' + } + + def __init__(self, items=None): # noqa: E501 + """ItemsResult - a model defined in Swagger""" # noqa: E501 + + self._items = None + self.discriminator = None + + if items is not None: + self.items = items + + @property + def items(self): + """Gets the items of this ItemsResult. # noqa: E501 + + + :return: The items of this ItemsResult. # noqa: E501 + :rtype: list[Item] + """ + return self._items + + @items.setter + def items(self, items): + """Sets the items of this ItemsResult. + + + :param items: The items of this ItemsResult. # noqa: E501 + :type: list[Item] + """ + + self._items = items + + 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(ItemsResult, 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, ItemsResult): + 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/paapi5_python_sdk/language_type.py b/paapi5_python_sdk/language_type.py new file mode 100644 index 0000000..c5a038c --- /dev/null +++ b/paapi5_python_sdk/language_type.py @@ -0,0 +1,152 @@ +# coding: utf-8 + +""" + Copyright 2019 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 LanguageType(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 = { + 'display_value': 'str', + 'type': 'str' + } + + attribute_map = { + 'display_value': 'DisplayValue', + 'type': 'Type' + } + + def __init__(self, display_value=None, type=None): # noqa: E501 + """LanguageType - a model defined in Swagger""" # noqa: E501 + + self._display_value = None + self._type = None + self.discriminator = None + + if display_value is not None: + self.display_value = display_value + if type is not None: + self.type = type + + @property + def display_value(self): + """Gets the display_value of this LanguageType. # noqa: E501 + + + :return: The display_value of this LanguageType. # noqa: E501 + :rtype: str + """ + return self._display_value + + @display_value.setter + def display_value(self, display_value): + """Sets the display_value of this LanguageType. + + + :param display_value: The display_value of this LanguageType. # noqa: E501 + :type: str + """ + + self._display_value = display_value + + @property + def type(self): + """Gets the type of this LanguageType. # noqa: E501 + + + :return: The type of this LanguageType. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this LanguageType. + + + :param type: The type of this LanguageType. # 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(LanguageType, 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, LanguageType): + 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/paapi5_python_sdk/languages.py b/paapi5_python_sdk/languages.py new file mode 100644 index 0000000..7687180 --- /dev/null +++ b/paapi5_python_sdk/languages.py @@ -0,0 +1,180 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.language_type import LanguageType # noqa: F401,E501 + + +class Languages(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 = { + 'display_values': 'list[LanguageType]', + 'label': 'str', + 'locale': 'str' + } + + attribute_map = { + 'display_values': 'DisplayValues', + 'label': 'Label', + 'locale': 'Locale' + } + + def __init__(self, display_values=None, label=None, locale=None): # noqa: E501 + """Languages - a model defined in Swagger""" # noqa: E501 + + self._display_values = None + self._label = None + self._locale = None + self.discriminator = None + + if display_values is not None: + self.display_values = display_values + if label is not None: + self.label = label + if locale is not None: + self.locale = locale + + @property + def display_values(self): + """Gets the display_values of this Languages. # noqa: E501 + + + :return: The display_values of this Languages. # noqa: E501 + :rtype: list[LanguageType] + """ + return self._display_values + + @display_values.setter + def display_values(self, display_values): + """Sets the display_values of this Languages. + + + :param display_values: The display_values of this Languages. # noqa: E501 + :type: list[LanguageType] + """ + + self._display_values = display_values + + @property + def label(self): + """Gets the label of this Languages. # noqa: E501 + + + :return: The label of this Languages. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this Languages. + + + :param label: The label of this Languages. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def locale(self): + """Gets the locale of this Languages. # noqa: E501 + + + :return: The locale of this Languages. # noqa: E501 + :rtype: str + """ + return self._locale + + @locale.setter + def locale(self, locale): + """Sets the locale of this Languages. + + + :param locale: The locale of this Languages. # noqa: E501 + :type: str + """ + + self._locale = locale + + 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(Languages, 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, Languages): + 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/paapi5_python_sdk/manufacture_info.py b/paapi5_python_sdk/manufacture_info.py new file mode 100644 index 0000000..b4b44cd --- /dev/null +++ b/paapi5_python_sdk/manufacture_info.py @@ -0,0 +1,180 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 + + +class ManufactureInfo(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 = { + 'item_part_number': 'SingleStringValuedAttribute', + 'model': 'SingleStringValuedAttribute', + 'warranty': 'SingleStringValuedAttribute' + } + + attribute_map = { + 'item_part_number': 'ItemPartNumber', + 'model': 'Model', + 'warranty': 'Warranty' + } + + def __init__(self, item_part_number=None, model=None, warranty=None): # noqa: E501 + """ManufactureInfo - a model defined in Swagger""" # noqa: E501 + + self._item_part_number = None + self._model = None + self._warranty = None + self.discriminator = None + + if item_part_number is not None: + self.item_part_number = item_part_number + if model is not None: + self.model = model + if warranty is not None: + self.warranty = warranty + + @property + def item_part_number(self): + """Gets the item_part_number of this ManufactureInfo. # noqa: E501 + + + :return: The item_part_number of this ManufactureInfo. # noqa: E501 + :rtype: SingleStringValuedAttribute + """ + return self._item_part_number + + @item_part_number.setter + def item_part_number(self, item_part_number): + """Sets the item_part_number of this ManufactureInfo. + + + :param item_part_number: The item_part_number of this ManufactureInfo. # noqa: E501 + :type: SingleStringValuedAttribute + """ + + self._item_part_number = item_part_number + + @property + def model(self): + """Gets the model of this ManufactureInfo. # noqa: E501 + + + :return: The model of this ManufactureInfo. # noqa: E501 + :rtype: SingleStringValuedAttribute + """ + return self._model + + @model.setter + def model(self, model): + """Sets the model of this ManufactureInfo. + + + :param model: The model of this ManufactureInfo. # noqa: E501 + :type: SingleStringValuedAttribute + """ + + self._model = model + + @property + def warranty(self): + """Gets the warranty of this ManufactureInfo. # noqa: E501 + + + :return: The warranty of this ManufactureInfo. # noqa: E501 + :rtype: SingleStringValuedAttribute + """ + return self._warranty + + @warranty.setter + def warranty(self, warranty): + """Sets the warranty of this ManufactureInfo. + + + :param warranty: The warranty of this ManufactureInfo. # noqa: E501 + :type: SingleStringValuedAttribute + """ + + self._warranty = warranty + + 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(ManufactureInfo, 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, ManufactureInfo): + 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/paapi5_python_sdk/max_price.py b/paapi5_python_sdk/max_price.py new file mode 100644 index 0000000..651f4da --- /dev/null +++ b/paapi5_python_sdk/max_price.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Copyright 2019 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 MaxPrice(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 + """MaxPrice - 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(MaxPrice, 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, MaxPrice): + 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/paapi5_python_sdk/merchant.py b/paapi5_python_sdk/merchant.py new file mode 100644 index 0000000..f5a6ad9 --- /dev/null +++ b/paapi5_python_sdk/merchant.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Copyright 2019 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 Merchant(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + ALL = "All" + AMAZON = "Amazon" + + """ + 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 + """Merchant - 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(Merchant, 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, Merchant): + 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/paapi5_python_sdk/min_price.py b/paapi5_python_sdk/min_price.py new file mode 100644 index 0000000..b4b2aa4 --- /dev/null +++ b/paapi5_python_sdk/min_price.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Copyright 2019 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 MinPrice(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 + """MinPrice - 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(MinPrice, 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, MinPrice): + 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/paapi5_python_sdk/min_reviews_rating.py b/paapi5_python_sdk/min_reviews_rating.py new file mode 100644 index 0000000..a4d1bbb --- /dev/null +++ b/paapi5_python_sdk/min_reviews_rating.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Copyright 2019 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 MinReviewsRating(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 + """MinReviewsRating - 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(MinReviewsRating, 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, MinReviewsRating): + 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/paapi5_python_sdk/min_saving_percent.py b/paapi5_python_sdk/min_saving_percent.py new file mode 100644 index 0000000..a3ec1ad --- /dev/null +++ b/paapi5_python_sdk/min_saving_percent.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Copyright 2019 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 MinSavingPercent(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 + """MinSavingPercent - 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(MinSavingPercent, 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, MinSavingPercent): + 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/paapi5_python_sdk/multi_valued_attribute.py b/paapi5_python_sdk/multi_valued_attribute.py new file mode 100644 index 0000000..0d1e6b5 --- /dev/null +++ b/paapi5_python_sdk/multi_valued_attribute.py @@ -0,0 +1,178 @@ +# coding: utf-8 + +""" + Copyright 2019 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 MultiValuedAttribute(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 = { + 'display_values': 'list[str]', + 'label': 'str', + 'locale': 'str' + } + + attribute_map = { + 'display_values': 'DisplayValues', + 'label': 'Label', + 'locale': 'Locale' + } + + def __init__(self, display_values=None, label=None, locale=None): # noqa: E501 + """MultiValuedAttribute - a model defined in Swagger""" # noqa: E501 + + self._display_values = None + self._label = None + self._locale = None + self.discriminator = None + + if display_values is not None: + self.display_values = display_values + if label is not None: + self.label = label + if locale is not None: + self.locale = locale + + @property + def display_values(self): + """Gets the display_values of this MultiValuedAttribute. # noqa: E501 + + + :return: The display_values of this MultiValuedAttribute. # noqa: E501 + :rtype: list[str] + """ + return self._display_values + + @display_values.setter + def display_values(self, display_values): + """Sets the display_values of this MultiValuedAttribute. + + + :param display_values: The display_values of this MultiValuedAttribute. # noqa: E501 + :type: list[str] + """ + + self._display_values = display_values + + @property + def label(self): + """Gets the label of this MultiValuedAttribute. # noqa: E501 + + + :return: The label of this MultiValuedAttribute. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this MultiValuedAttribute. + + + :param label: The label of this MultiValuedAttribute. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def locale(self): + """Gets the locale of this MultiValuedAttribute. # noqa: E501 + + + :return: The locale of this MultiValuedAttribute. # noqa: E501 + :rtype: str + """ + return self._locale + + @locale.setter + def locale(self, locale): + """Sets the locale of this MultiValuedAttribute. + + + :param locale: The locale of this MultiValuedAttribute. # noqa: E501 + :type: str + """ + + self._locale = locale + + 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(MultiValuedAttribute, 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, MultiValuedAttribute): + 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/paapi5_python_sdk/offer_availability.py b/paapi5_python_sdk/offer_availability.py new file mode 100644 index 0000000..2da4ef6 --- /dev/null +++ b/paapi5_python_sdk/offer_availability.py @@ -0,0 +1,203 @@ +# coding: utf-8 + +""" + Copyright 2019 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 OfferAvailability(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 = { + 'max_order_quantity': 'int', + 'message': 'str', + 'min_order_quantity': 'int', + 'type': 'str' + } + + attribute_map = { + 'max_order_quantity': 'MaxOrderQuantity', + 'message': 'Message', + 'min_order_quantity': 'MinOrderQuantity', + 'type': 'Type' + } + + def __init__(self, max_order_quantity=None, message=None, min_order_quantity=None, type=None): # noqa: E501 + """OfferAvailability - a model defined in Swagger""" # noqa: E501 + + self._max_order_quantity = None + self._message = None + self._min_order_quantity = None + self._type = None + self.discriminator = None + + if max_order_quantity is not None: + self.max_order_quantity = max_order_quantity + if message is not None: + self.message = message + if min_order_quantity is not None: + self.min_order_quantity = min_order_quantity + if type is not None: + self.type = type + + @property + def max_order_quantity(self): + """Gets the max_order_quantity of this OfferAvailability. # noqa: E501 + + + :return: The max_order_quantity of this OfferAvailability. # 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 OfferAvailability. + + + :param max_order_quantity: The max_order_quantity of this OfferAvailability. # noqa: E501 + :type: int + """ + + self._max_order_quantity = max_order_quantity + + @property + def message(self): + """Gets the message of this OfferAvailability. # noqa: E501 + + + :return: The message of this OfferAvailability. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this OfferAvailability. + + + :param message: The message of this OfferAvailability. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def min_order_quantity(self): + """Gets the min_order_quantity of this OfferAvailability. # noqa: E501 + + + :return: The min_order_quantity of this OfferAvailability. # 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 OfferAvailability. + + + :param min_order_quantity: The min_order_quantity of this OfferAvailability. # noqa: E501 + :type: int + """ + + self._min_order_quantity = min_order_quantity + + @property + def type(self): + """Gets the type of this OfferAvailability. # noqa: E501 + + + :return: The type of this OfferAvailability. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this OfferAvailability. + + + :param type: The type of this OfferAvailability. # 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(OfferAvailability, 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, OfferAvailability): + 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/paapi5_python_sdk/offer_condition.py b/paapi5_python_sdk/offer_condition.py new file mode 100644 index 0000000..128174b --- /dev/null +++ b/paapi5_python_sdk/offer_condition.py @@ -0,0 +1,232 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.offer_sub_condition import OfferSubCondition # noqa: F401,E501 + + +class OfferCondition(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 = { + 'display_value': 'str', + 'label': 'str', + 'locale': 'str', + 'value': 'str', + 'sub_condition': 'OfferSubCondition' + } + + attribute_map = { + 'display_value': 'DisplayValue', + 'label': 'Label', + 'locale': 'Locale', + 'value': 'Value', + 'sub_condition': 'SubCondition' + } + + def __init__(self, display_value=None, label=None, locale=None, value=None, sub_condition=None): # noqa: E501 + """OfferCondition - a model defined in Swagger""" # noqa: E501 + + self._display_value = None + self._label = None + self._locale = None + self._value = None + self._sub_condition = None + self.discriminator = None + + if display_value is not None: + self.display_value = display_value + if label is not None: + self.label = label + if locale is not None: + self.locale = locale + if value is not None: + self.value = value + if sub_condition is not None: + self.sub_condition = sub_condition + + @property + def display_value(self): + """Gets the display_value of this OfferCondition. # noqa: E501 + + + :return: The display_value of this OfferCondition. # noqa: E501 + :rtype: str + """ + return self._display_value + + @display_value.setter + def display_value(self, display_value): + """Sets the display_value of this OfferCondition. + + + :param display_value: The display_value of this OfferCondition. # noqa: E501 + :type: str + """ + + self._display_value = display_value + + @property + def label(self): + """Gets the label of this OfferCondition. # noqa: E501 + + + :return: The label of this OfferCondition. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this OfferCondition. + + + :param label: The label of this OfferCondition. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def locale(self): + """Gets the locale of this OfferCondition. # noqa: E501 + + + :return: The locale of this OfferCondition. # noqa: E501 + :rtype: str + """ + return self._locale + + @locale.setter + def locale(self, locale): + """Sets the locale of this OfferCondition. + + + :param locale: The locale of this OfferCondition. # noqa: E501 + :type: str + """ + + self._locale = locale + + @property + def value(self): + """Gets the value of this OfferCondition. # noqa: E501 + + + :return: The value of this OfferCondition. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this OfferCondition. + + + :param value: The value of this OfferCondition. # noqa: E501 + :type: str + """ + + self._value = value + + @property + def sub_condition(self): + """Gets the sub_condition of this OfferCondition. # noqa: E501 + + + :return: The sub_condition of this OfferCondition. # noqa: E501 + :rtype: OfferSubCondition + """ + return self._sub_condition + + @sub_condition.setter + def sub_condition(self, sub_condition): + """Sets the sub_condition of this OfferCondition. + + + :param sub_condition: The sub_condition of this OfferCondition. # noqa: E501 + :type: OfferSubCondition + """ + + self._sub_condition = sub_condition + + 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(OfferCondition, 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, OfferCondition): + 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/paapi5_python_sdk/offer_count.py b/paapi5_python_sdk/offer_count.py new file mode 100644 index 0000000..951020b --- /dev/null +++ b/paapi5_python_sdk/offer_count.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Copyright 2019 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 OfferCount(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 + """OfferCount - 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(OfferCount, 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, OfferCount): + 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/paapi5_python_sdk/offer_delivery_info.py b/paapi5_python_sdk/offer_delivery_info.py new file mode 100644 index 0000000..ae67402 --- /dev/null +++ b/paapi5_python_sdk/offer_delivery_info.py @@ -0,0 +1,206 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.offer_shipping_charge import OfferShippingCharge # noqa: F401,E501 + + +class OfferDeliveryInfo(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 = { + 'is_amazon_fulfilled': 'bool', + 'is_free_shipping_eligible': 'bool', + 'is_prime_eligible': 'bool', + 'shipping_charges': 'list[OfferShippingCharge]' + } + + attribute_map = { + 'is_amazon_fulfilled': 'IsAmazonFulfilled', + 'is_free_shipping_eligible': 'IsFreeShippingEligible', + 'is_prime_eligible': 'IsPrimeEligible', + 'shipping_charges': 'ShippingCharges' + } + + def __init__(self, is_amazon_fulfilled=None, is_free_shipping_eligible=None, is_prime_eligible=None, shipping_charges=None): # noqa: E501 + """OfferDeliveryInfo - a model defined in Swagger""" # noqa: E501 + + self._is_amazon_fulfilled = None + self._is_free_shipping_eligible = None + self._is_prime_eligible = None + self._shipping_charges = None + self.discriminator = None + + if is_amazon_fulfilled is not None: + self.is_amazon_fulfilled = is_amazon_fulfilled + if is_free_shipping_eligible is not None: + self.is_free_shipping_eligible = is_free_shipping_eligible + if is_prime_eligible is not None: + self.is_prime_eligible = is_prime_eligible + if shipping_charges is not None: + self.shipping_charges = shipping_charges + + @property + def is_amazon_fulfilled(self): + """Gets the is_amazon_fulfilled of this OfferDeliveryInfo. # noqa: E501 + + + :return: The is_amazon_fulfilled of this OfferDeliveryInfo. # noqa: E501 + :rtype: bool + """ + return self._is_amazon_fulfilled + + @is_amazon_fulfilled.setter + def is_amazon_fulfilled(self, is_amazon_fulfilled): + """Sets the is_amazon_fulfilled of this OfferDeliveryInfo. + + + :param is_amazon_fulfilled: The is_amazon_fulfilled of this OfferDeliveryInfo. # noqa: E501 + :type: bool + """ + + self._is_amazon_fulfilled = is_amazon_fulfilled + + @property + def is_free_shipping_eligible(self): + """Gets the is_free_shipping_eligible of this OfferDeliveryInfo. # noqa: E501 + + + :return: The is_free_shipping_eligible of this OfferDeliveryInfo. # noqa: E501 + :rtype: bool + """ + return self._is_free_shipping_eligible + + @is_free_shipping_eligible.setter + def is_free_shipping_eligible(self, is_free_shipping_eligible): + """Sets the is_free_shipping_eligible of this OfferDeliveryInfo. + + + :param is_free_shipping_eligible: The is_free_shipping_eligible of this OfferDeliveryInfo. # noqa: E501 + :type: bool + """ + + self._is_free_shipping_eligible = is_free_shipping_eligible + + @property + def is_prime_eligible(self): + """Gets the is_prime_eligible of this OfferDeliveryInfo. # noqa: E501 + + + :return: The is_prime_eligible of this OfferDeliveryInfo. # noqa: E501 + :rtype: bool + """ + return self._is_prime_eligible + + @is_prime_eligible.setter + def is_prime_eligible(self, is_prime_eligible): + """Sets the is_prime_eligible of this OfferDeliveryInfo. + + + :param is_prime_eligible: The is_prime_eligible of this OfferDeliveryInfo. # noqa: E501 + :type: bool + """ + + self._is_prime_eligible = is_prime_eligible + + @property + def shipping_charges(self): + """Gets the shipping_charges of this OfferDeliveryInfo. # noqa: E501 + + + :return: The shipping_charges of this OfferDeliveryInfo. # noqa: E501 + :rtype: list[OfferShippingCharge] + """ + return self._shipping_charges + + @shipping_charges.setter + def shipping_charges(self, shipping_charges): + """Sets the shipping_charges of this OfferDeliveryInfo. + + + :param shipping_charges: The shipping_charges of this OfferDeliveryInfo. # noqa: E501 + :type: list[OfferShippingCharge] + """ + + self._shipping_charges = shipping_charges + + 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(OfferDeliveryInfo, 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, OfferDeliveryInfo): + 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/paapi5_python_sdk/offer_listing.py b/paapi5_python_sdk/offer_listing.py new file mode 100644 index 0000000..a513d20 --- /dev/null +++ b/paapi5_python_sdk/offer_listing.py @@ -0,0 +1,421 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.offer_availability import OfferAvailability # noqa: F401,E501 +from paapi5_python_sdk.offer_condition import OfferCondition # noqa: F401,E501 +from paapi5_python_sdk.offer_delivery_info import OfferDeliveryInfo # noqa: F401,E501 +from paapi5_python_sdk.offer_loyalty_points import OfferLoyaltyPoints # noqa: F401,E501 +from paapi5_python_sdk.offer_merchant_info import OfferMerchantInfo # noqa: F401,E501 +from paapi5_python_sdk.offer_price import OfferPrice # noqa: F401,E501 +from paapi5_python_sdk.offer_program_eligibility import OfferProgramEligibility # noqa: F401,E501 +from paapi5_python_sdk.offer_promotion import OfferPromotion # noqa: F401,E501 + + +class OfferListing(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': 'OfferAvailability', + 'condition': 'OfferCondition', + 'delivery_info': 'OfferDeliveryInfo', + 'id': 'str', + 'is_buy_box_winner': 'bool', + 'loyalty_points': 'OfferLoyaltyPoints', + 'merchant_info': 'OfferMerchantInfo', + 'price': 'OfferPrice', + 'program_eligibility': 'OfferProgramEligibility', + 'promotions': 'list[OfferPromotion]', + 'saving_basis': 'OfferPrice', + 'violates_map': 'bool' + } + + attribute_map = { + 'availability': 'Availability', + 'condition': 'Condition', + 'delivery_info': 'DeliveryInfo', + 'id': 'Id', + 'is_buy_box_winner': 'IsBuyBoxWinner', + 'loyalty_points': 'LoyaltyPoints', + 'merchant_info': 'MerchantInfo', + 'price': 'Price', + 'program_eligibility': 'ProgramEligibility', + 'promotions': 'Promotions', + 'saving_basis': 'SavingBasis', + 'violates_map': 'ViolatesMAP' + } + + def __init__(self, availability=None, condition=None, delivery_info=None, id=None, is_buy_box_winner=None, loyalty_points=None, merchant_info=None, price=None, program_eligibility=None, promotions=None, saving_basis=None, violates_map=None): # noqa: E501 + """OfferListing - a model defined in Swagger""" # noqa: E501 + + self._availability = None + self._condition = None + self._delivery_info = None + self._id = None + self._is_buy_box_winner = None + self._loyalty_points = None + self._merchant_info = None + self._price = None + self._program_eligibility = None + self._promotions = None + self._saving_basis = 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 delivery_info is not None: + self.delivery_info = delivery_info + if id is not None: + self.id = id + 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 program_eligibility is not None: + self.program_eligibility = program_eligibility + if promotions is not None: + self.promotions = promotions + if saving_basis is not None: + self.saving_basis = saving_basis + if violates_map is not None: + self.violates_map = violates_map + + @property + def availability(self): + """Gets the availability of this OfferListing. # noqa: E501 + + + :return: The availability of this OfferListing. # noqa: E501 + :rtype: OfferAvailability + """ + return self._availability + + @availability.setter + def availability(self, availability): + """Sets the availability of this OfferListing. + + + :param availability: The availability of this OfferListing. # noqa: E501 + :type: OfferAvailability + """ + + self._availability = availability + + @property + def condition(self): + """Gets the condition of this OfferListing. # noqa: E501 + + + :return: The condition of this OfferListing. # noqa: E501 + :rtype: OfferCondition + """ + return self._condition + + @condition.setter + def condition(self, condition): + """Sets the condition of this OfferListing. + + + :param condition: The condition of this OfferListing. # noqa: E501 + :type: OfferCondition + """ + + self._condition = condition + + @property + def delivery_info(self): + """Gets the delivery_info of this OfferListing. # noqa: E501 + + + :return: The delivery_info of this OfferListing. # noqa: E501 + :rtype: OfferDeliveryInfo + """ + return self._delivery_info + + @delivery_info.setter + def delivery_info(self, delivery_info): + """Sets the delivery_info of this OfferListing. + + + :param delivery_info: The delivery_info of this OfferListing. # noqa: E501 + :type: OfferDeliveryInfo + """ + + self._delivery_info = delivery_info + + @property + def id(self): + """Gets the id of this OfferListing. # noqa: E501 + + + :return: The id of this OfferListing. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this OfferListing. + + + :param id: The id of this OfferListing. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def is_buy_box_winner(self): + """Gets the is_buy_box_winner of this OfferListing. # noqa: E501 + + + :return: The is_buy_box_winner of this OfferListing. # 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 OfferListing. + + + :param is_buy_box_winner: The is_buy_box_winner of this OfferListing. # noqa: E501 + :type: bool + """ + + self._is_buy_box_winner = is_buy_box_winner + + @property + def loyalty_points(self): + """Gets the loyalty_points of this OfferListing. # noqa: E501 + + + :return: The loyalty_points of this OfferListing. # noqa: E501 + :rtype: OfferLoyaltyPoints + """ + return self._loyalty_points + + @loyalty_points.setter + def loyalty_points(self, loyalty_points): + """Sets the loyalty_points of this OfferListing. + + + :param loyalty_points: The loyalty_points of this OfferListing. # noqa: E501 + :type: OfferLoyaltyPoints + """ + + self._loyalty_points = loyalty_points + + @property + def merchant_info(self): + """Gets the merchant_info of this OfferListing. # noqa: E501 + + + :return: The merchant_info of this OfferListing. # noqa: E501 + :rtype: OfferMerchantInfo + """ + return self._merchant_info + + @merchant_info.setter + def merchant_info(self, merchant_info): + """Sets the merchant_info of this OfferListing. + + + :param merchant_info: The merchant_info of this OfferListing. # noqa: E501 + :type: OfferMerchantInfo + """ + + self._merchant_info = merchant_info + + @property + def price(self): + """Gets the price of this OfferListing. # noqa: E501 + + + :return: The price of this OfferListing. # noqa: E501 + :rtype: OfferPrice + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this OfferListing. + + + :param price: The price of this OfferListing. # noqa: E501 + :type: OfferPrice + """ + + self._price = price + + @property + def program_eligibility(self): + """Gets the program_eligibility of this OfferListing. # noqa: E501 + + + :return: The program_eligibility of this OfferListing. # noqa: E501 + :rtype: OfferProgramEligibility + """ + return self._program_eligibility + + @program_eligibility.setter + def program_eligibility(self, program_eligibility): + """Sets the program_eligibility of this OfferListing. + + + :param program_eligibility: The program_eligibility of this OfferListing. # noqa: E501 + :type: OfferProgramEligibility + """ + + self._program_eligibility = program_eligibility + + @property + def promotions(self): + """Gets the promotions of this OfferListing. # noqa: E501 + + + :return: The promotions of this OfferListing. # noqa: E501 + :rtype: list[OfferPromotion] + """ + return self._promotions + + @promotions.setter + def promotions(self, promotions): + """Sets the promotions of this OfferListing. + + + :param promotions: The promotions of this OfferListing. # noqa: E501 + :type: list[OfferPromotion] + """ + + self._promotions = promotions + + @property + def saving_basis(self): + """Gets the saving_basis of this OfferListing. # noqa: E501 + + + :return: The saving_basis of this OfferListing. # noqa: E501 + :rtype: OfferPrice + """ + return self._saving_basis + + @saving_basis.setter + def saving_basis(self, saving_basis): + """Sets the saving_basis of this OfferListing. + + + :param saving_basis: The saving_basis of this OfferListing. # noqa: E501 + :type: OfferPrice + """ + + self._saving_basis = saving_basis + + @property + def violates_map(self): + """Gets the violates_map of this OfferListing. # noqa: E501 + + + :return: The violates_map of this OfferListing. # noqa: E501 + :rtype: bool + """ + return self._violates_map + + @violates_map.setter + def violates_map(self, violates_map): + """Sets the violates_map of this OfferListing. + + + :param violates_map: The violates_map of this OfferListing. # 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(OfferListing, 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, OfferListing): + 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/paapi5_python_sdk/offer_loyalty_points.py b/paapi5_python_sdk/offer_loyalty_points.py new file mode 100644 index 0000000..08b86e9 --- /dev/null +++ b/paapi5_python_sdk/offer_loyalty_points.py @@ -0,0 +1,126 @@ +# coding: utf-8 + +""" + Copyright 2019 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 OfferLoyaltyPoints(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 + """OfferLoyaltyPoints - 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 OfferLoyaltyPoints. # noqa: E501 + + + :return: The points of this OfferLoyaltyPoints. # noqa: E501 + :rtype: int + """ + return self._points + + @points.setter + def points(self, points): + """Sets the points of this OfferLoyaltyPoints. + + + :param points: The points of this OfferLoyaltyPoints. # 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(OfferLoyaltyPoints, 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, OfferLoyaltyPoints): + 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/paapi5_python_sdk/offer_merchant_info.py b/paapi5_python_sdk/offer_merchant_info.py new file mode 100644 index 0000000..b0ec576 --- /dev/null +++ b/paapi5_python_sdk/offer_merchant_info.py @@ -0,0 +1,178 @@ +# coding: utf-8 + +""" + Copyright 2019 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 OfferMerchantInfo(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 = { + 'default_shipping_country': 'str', + 'id': 'str', + 'name': 'str' + } + + attribute_map = { + 'default_shipping_country': 'DefaultShippingCountry', + 'id': 'Id', + 'name': 'Name' + } + + def __init__(self, default_shipping_country=None, id=None, name=None): # noqa: E501 + """OfferMerchantInfo - a model defined in Swagger""" # noqa: E501 + + self._default_shipping_country = None + self._id = None + self._name = None + self.discriminator = None + + if default_shipping_country is not None: + self.default_shipping_country = default_shipping_country + if id is not None: + self.id = id + if name is not None: + self.name = name + + @property + def default_shipping_country(self): + """Gets the default_shipping_country of this OfferMerchantInfo. # noqa: E501 + + + :return: The default_shipping_country of this OfferMerchantInfo. # noqa: E501 + :rtype: str + """ + return self._default_shipping_country + + @default_shipping_country.setter + def default_shipping_country(self, default_shipping_country): + """Sets the default_shipping_country of this OfferMerchantInfo. + + + :param default_shipping_country: The default_shipping_country of this OfferMerchantInfo. # noqa: E501 + :type: str + """ + + self._default_shipping_country = default_shipping_country + + @property + def id(self): + """Gets the id of this OfferMerchantInfo. # noqa: E501 + + + :return: The id of this OfferMerchantInfo. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this OfferMerchantInfo. + + + :param id: The id of this OfferMerchantInfo. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def name(self): + """Gets the name of this OfferMerchantInfo. # noqa: E501 + + + :return: The name of this OfferMerchantInfo. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this OfferMerchantInfo. + + + :param name: The name of this OfferMerchantInfo. # noqa: E501 + :type: str + """ + + self._name = name + + 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(OfferMerchantInfo, 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, OfferMerchantInfo): + 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/paapi5_python_sdk/offer_price.py b/paapi5_python_sdk/offer_price.py new file mode 100644 index 0000000..3463a66 --- /dev/null +++ b/paapi5_python_sdk/offer_price.py @@ -0,0 +1,232 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.offer_savings import OfferSavings # noqa: F401,E501 + + +class OfferPrice(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': 'float', + 'currency': 'str', + 'display_amount': 'str', + 'price_per_unit': 'float', + 'savings': 'OfferSavings' + } + + attribute_map = { + 'amount': 'Amount', + 'currency': 'Currency', + 'display_amount': 'DisplayAmount', + 'price_per_unit': 'PricePerUnit', + 'savings': 'Savings' + } + + def __init__(self, amount=None, currency=None, display_amount=None, price_per_unit=None, savings=None): # noqa: E501 + """OfferPrice - a model defined in Swagger""" # noqa: E501 + + self._amount = None + self._currency = None + self._display_amount = None + self._price_per_unit = None + self._savings = 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 + if price_per_unit is not None: + self.price_per_unit = price_per_unit + if savings is not None: + self.savings = savings + + @property + def amount(self): + """Gets the amount of this OfferPrice. # noqa: E501 + + + :return: The amount of this OfferPrice. # noqa: E501 + :rtype: float + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this OfferPrice. + + + :param amount: The amount of this OfferPrice. # noqa: E501 + :type: float + """ + + self._amount = amount + + @property + def currency(self): + """Gets the currency of this OfferPrice. # noqa: E501 + + + :return: The currency of this OfferPrice. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this OfferPrice. + + + :param currency: The currency of this OfferPrice. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def display_amount(self): + """Gets the display_amount of this OfferPrice. # noqa: E501 + + + :return: The display_amount of this OfferPrice. # noqa: E501 + :rtype: str + """ + return self._display_amount + + @display_amount.setter + def display_amount(self, display_amount): + """Sets the display_amount of this OfferPrice. + + + :param display_amount: The display_amount of this OfferPrice. # noqa: E501 + :type: str + """ + + self._display_amount = display_amount + + @property + def price_per_unit(self): + """Gets the price_per_unit of this OfferPrice. # noqa: E501 + + + :return: The price_per_unit of this OfferPrice. # noqa: E501 + :rtype: float + """ + return self._price_per_unit + + @price_per_unit.setter + def price_per_unit(self, price_per_unit): + """Sets the price_per_unit of this OfferPrice. + + + :param price_per_unit: The price_per_unit of this OfferPrice. # noqa: E501 + :type: float + """ + + self._price_per_unit = price_per_unit + + @property + def savings(self): + """Gets the savings of this OfferPrice. # noqa: E501 + + + :return: The savings of this OfferPrice. # noqa: E501 + :rtype: OfferSavings + """ + return self._savings + + @savings.setter + def savings(self, savings): + """Sets the savings of this OfferPrice. + + + :param savings: The savings of this OfferPrice. # noqa: E501 + :type: OfferSavings + """ + + self._savings = savings + + 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(OfferPrice, 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, OfferPrice): + 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/paapi5_python_sdk/offer_program_eligibility.py b/paapi5_python_sdk/offer_program_eligibility.py new file mode 100644 index 0000000..ffeaa6c --- /dev/null +++ b/paapi5_python_sdk/offer_program_eligibility.py @@ -0,0 +1,152 @@ +# coding: utf-8 + +""" + Copyright 2019 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 OfferProgramEligibility(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 = { + 'is_prime_exclusive': 'bool', + 'is_prime_pantry': 'bool' + } + + attribute_map = { + 'is_prime_exclusive': 'IsPrimeExclusive', + 'is_prime_pantry': 'IsPrimePantry' + } + + def __init__(self, is_prime_exclusive=None, is_prime_pantry=None): # noqa: E501 + """OfferProgramEligibility - a model defined in Swagger""" # noqa: E501 + + self._is_prime_exclusive = None + self._is_prime_pantry = None + self.discriminator = None + + if is_prime_exclusive is not None: + self.is_prime_exclusive = is_prime_exclusive + if is_prime_pantry is not None: + self.is_prime_pantry = is_prime_pantry + + @property + def is_prime_exclusive(self): + """Gets the is_prime_exclusive of this OfferProgramEligibility. # noqa: E501 + + + :return: The is_prime_exclusive of this OfferProgramEligibility. # noqa: E501 + :rtype: bool + """ + return self._is_prime_exclusive + + @is_prime_exclusive.setter + def is_prime_exclusive(self, is_prime_exclusive): + """Sets the is_prime_exclusive of this OfferProgramEligibility. + + + :param is_prime_exclusive: The is_prime_exclusive of this OfferProgramEligibility. # noqa: E501 + :type: bool + """ + + self._is_prime_exclusive = is_prime_exclusive + + @property + def is_prime_pantry(self): + """Gets the is_prime_pantry of this OfferProgramEligibility. # noqa: E501 + + + :return: The is_prime_pantry of this OfferProgramEligibility. # noqa: E501 + :rtype: bool + """ + return self._is_prime_pantry + + @is_prime_pantry.setter + def is_prime_pantry(self, is_prime_pantry): + """Sets the is_prime_pantry of this OfferProgramEligibility. + + + :param is_prime_pantry: The is_prime_pantry of this OfferProgramEligibility. # noqa: E501 + :type: bool + """ + + self._is_prime_pantry = is_prime_pantry + + 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(OfferProgramEligibility, 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, OfferProgramEligibility): + 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/paapi5_python_sdk/offer_promotion.py b/paapi5_python_sdk/offer_promotion.py new file mode 100644 index 0000000..d161a4b --- /dev/null +++ b/paapi5_python_sdk/offer_promotion.py @@ -0,0 +1,255 @@ +# coding: utf-8 + +""" + Copyright 2019 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 OfferPromotion(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': 'float', + 'currency': 'str', + 'discount_percent': 'int', + 'display_amount': 'str', + 'price_per_unit': 'float', + 'type': 'str' + } + + attribute_map = { + 'amount': 'Amount', + 'currency': 'Currency', + 'discount_percent': 'DiscountPercent', + 'display_amount': 'DisplayAmount', + 'price_per_unit': 'PricePerUnit', + 'type': 'Type' + } + + def __init__(self, amount=None, currency=None, discount_percent=None, display_amount=None, price_per_unit=None, type=None): # noqa: E501 + """OfferPromotion - a model defined in Swagger""" # noqa: E501 + + self._amount = None + self._currency = None + self._discount_percent = None + self._display_amount = None + self._price_per_unit = None + self._type = None + self.discriminator = None + + if amount is not None: + self.amount = amount + if currency is not None: + self.currency = currency + if discount_percent is not None: + self.discount_percent = discount_percent + if display_amount is not None: + self.display_amount = display_amount + if price_per_unit is not None: + self.price_per_unit = price_per_unit + if type is not None: + self.type = type + + @property + def amount(self): + """Gets the amount of this OfferPromotion. # noqa: E501 + + + :return: The amount of this OfferPromotion. # noqa: E501 + :rtype: float + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this OfferPromotion. + + + :param amount: The amount of this OfferPromotion. # noqa: E501 + :type: float + """ + + self._amount = amount + + @property + def currency(self): + """Gets the currency of this OfferPromotion. # noqa: E501 + + + :return: The currency of this OfferPromotion. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this OfferPromotion. + + + :param currency: The currency of this OfferPromotion. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def discount_percent(self): + """Gets the discount_percent of this OfferPromotion. # noqa: E501 + + + :return: The discount_percent of this OfferPromotion. # noqa: E501 + :rtype: int + """ + return self._discount_percent + + @discount_percent.setter + def discount_percent(self, discount_percent): + """Sets the discount_percent of this OfferPromotion. + + + :param discount_percent: The discount_percent of this OfferPromotion. # noqa: E501 + :type: int + """ + + self._discount_percent = discount_percent + + @property + def display_amount(self): + """Gets the display_amount of this OfferPromotion. # noqa: E501 + + + :return: The display_amount of this OfferPromotion. # noqa: E501 + :rtype: str + """ + return self._display_amount + + @display_amount.setter + def display_amount(self, display_amount): + """Sets the display_amount of this OfferPromotion. + + + :param display_amount: The display_amount of this OfferPromotion. # noqa: E501 + :type: str + """ + + self._display_amount = display_amount + + @property + def price_per_unit(self): + """Gets the price_per_unit of this OfferPromotion. # noqa: E501 + + + :return: The price_per_unit of this OfferPromotion. # noqa: E501 + :rtype: float + """ + return self._price_per_unit + + @price_per_unit.setter + def price_per_unit(self, price_per_unit): + """Sets the price_per_unit of this OfferPromotion. + + + :param price_per_unit: The price_per_unit of this OfferPromotion. # noqa: E501 + :type: float + """ + + self._price_per_unit = price_per_unit + + @property + def type(self): + """Gets the type of this OfferPromotion. # noqa: E501 + + + :return: The type of this OfferPromotion. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this OfferPromotion. + + + :param type: The type of this OfferPromotion. # 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(OfferPromotion, 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, OfferPromotion): + 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/paapi5_python_sdk/offer_savings.py b/paapi5_python_sdk/offer_savings.py new file mode 100644 index 0000000..42c5eb9 --- /dev/null +++ b/paapi5_python_sdk/offer_savings.py @@ -0,0 +1,230 @@ +# coding: utf-8 + +""" + Copyright 2019 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 OfferSavings(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': 'float', + 'currency': 'str', + 'display_amount': 'str', + 'percentage': 'int', + 'price_per_unit': 'float' + } + + attribute_map = { + 'amount': 'Amount', + 'currency': 'Currency', + 'display_amount': 'DisplayAmount', + 'percentage': 'Percentage', + 'price_per_unit': 'PricePerUnit' + } + + def __init__(self, amount=None, currency=None, display_amount=None, percentage=None, price_per_unit=None): # noqa: E501 + """OfferSavings - a model defined in Swagger""" # noqa: E501 + + self._amount = None + self._currency = None + self._display_amount = None + self._percentage = None + self._price_per_unit = 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 + if percentage is not None: + self.percentage = percentage + if price_per_unit is not None: + self.price_per_unit = price_per_unit + + @property + def amount(self): + """Gets the amount of this OfferSavings. # noqa: E501 + + + :return: The amount of this OfferSavings. # noqa: E501 + :rtype: float + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this OfferSavings. + + + :param amount: The amount of this OfferSavings. # noqa: E501 + :type: float + """ + + self._amount = amount + + @property + def currency(self): + """Gets the currency of this OfferSavings. # noqa: E501 + + + :return: The currency of this OfferSavings. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this OfferSavings. + + + :param currency: The currency of this OfferSavings. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def display_amount(self): + """Gets the display_amount of this OfferSavings. # noqa: E501 + + + :return: The display_amount of this OfferSavings. # noqa: E501 + :rtype: str + """ + return self._display_amount + + @display_amount.setter + def display_amount(self, display_amount): + """Sets the display_amount of this OfferSavings. + + + :param display_amount: The display_amount of this OfferSavings. # noqa: E501 + :type: str + """ + + self._display_amount = display_amount + + @property + def percentage(self): + """Gets the percentage of this OfferSavings. # noqa: E501 + + + :return: The percentage of this OfferSavings. # noqa: E501 + :rtype: int + """ + return self._percentage + + @percentage.setter + def percentage(self, percentage): + """Sets the percentage of this OfferSavings. + + + :param percentage: The percentage of this OfferSavings. # noqa: E501 + :type: int + """ + + self._percentage = percentage + + @property + def price_per_unit(self): + """Gets the price_per_unit of this OfferSavings. # noqa: E501 + + + :return: The price_per_unit of this OfferSavings. # noqa: E501 + :rtype: float + """ + return self._price_per_unit + + @price_per_unit.setter + def price_per_unit(self, price_per_unit): + """Sets the price_per_unit of this OfferSavings. + + + :param price_per_unit: The price_per_unit of this OfferSavings. # noqa: E501 + :type: float + """ + + self._price_per_unit = price_per_unit + + 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(OfferSavings, 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, OfferSavings): + 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/paapi5_python_sdk/offer_shipping_charge.py b/paapi5_python_sdk/offer_shipping_charge.py new file mode 100644 index 0000000..5674f19 --- /dev/null +++ b/paapi5_python_sdk/offer_shipping_charge.py @@ -0,0 +1,229 @@ +# coding: utf-8 + +""" + Copyright 2019 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 OfferShippingCharge(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': 'float', + 'currency': 'str', + 'display_amount': 'str', + 'is_rate_tax_inclusive': 'bool', + 'type': 'str' + } + + attribute_map = { + 'amount': 'Amount', + 'currency': 'Currency', + 'display_amount': 'DisplayAmount', + 'is_rate_tax_inclusive': 'IsRateTaxInclusive', + 'type': 'Type' + } + + def __init__(self, amount=None, currency=None, display_amount=None, is_rate_tax_inclusive=None, type=None): # noqa: E501 + """OfferShippingCharge - a model defined in Swagger""" # noqa: E501 + + self._amount = None + self._currency = None + self._display_amount = None + self._is_rate_tax_inclusive = None + self._type = 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 + if is_rate_tax_inclusive is not None: + self.is_rate_tax_inclusive = is_rate_tax_inclusive + if type is not None: + self.type = type + + @property + def amount(self): + """Gets the amount of this OfferShippingCharge. # noqa: E501 + + + :return: The amount of this OfferShippingCharge. # noqa: E501 + :rtype: float + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this OfferShippingCharge. + + + :param amount: The amount of this OfferShippingCharge. # noqa: E501 + :type: float + """ + + self._amount = amount + + @property + def currency(self): + """Gets the currency of this OfferShippingCharge. # noqa: E501 + + + :return: The currency of this OfferShippingCharge. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this OfferShippingCharge. + + + :param currency: The currency of this OfferShippingCharge. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def display_amount(self): + """Gets the display_amount of this OfferShippingCharge. # noqa: E501 + + + :return: The display_amount of this OfferShippingCharge. # noqa: E501 + :rtype: str + """ + return self._display_amount + + @display_amount.setter + def display_amount(self, display_amount): + """Sets the display_amount of this OfferShippingCharge. + + + :param display_amount: The display_amount of this OfferShippingCharge. # noqa: E501 + :type: str + """ + + self._display_amount = display_amount + + @property + def is_rate_tax_inclusive(self): + """Gets the is_rate_tax_inclusive of this OfferShippingCharge. # noqa: E501 + + + :return: The is_rate_tax_inclusive of this OfferShippingCharge. # noqa: E501 + :rtype: bool + """ + return self._is_rate_tax_inclusive + + @is_rate_tax_inclusive.setter + def is_rate_tax_inclusive(self, is_rate_tax_inclusive): + """Sets the is_rate_tax_inclusive of this OfferShippingCharge. + + + :param is_rate_tax_inclusive: The is_rate_tax_inclusive of this OfferShippingCharge. # noqa: E501 + :type: bool + """ + + self._is_rate_tax_inclusive = is_rate_tax_inclusive + + @property + def type(self): + """Gets the type of this OfferShippingCharge. # noqa: E501 + + + :return: The type of this OfferShippingCharge. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this OfferShippingCharge. + + + :param type: The type of this OfferShippingCharge. # 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(OfferShippingCharge, 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, OfferShippingCharge): + 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/paapi5_python_sdk/offer_sub_condition.py b/paapi5_python_sdk/offer_sub_condition.py new file mode 100644 index 0000000..bb5be69 --- /dev/null +++ b/paapi5_python_sdk/offer_sub_condition.py @@ -0,0 +1,204 @@ +# coding: utf-8 + +""" + Copyright 2019 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 OfferSubCondition(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 = { + 'display_value': 'str', + 'label': 'str', + 'locale': 'str', + 'value': 'str' + } + + attribute_map = { + 'display_value': 'DisplayValue', + 'label': 'Label', + 'locale': 'Locale', + 'value': 'Value' + } + + def __init__(self, display_value=None, label=None, locale=None, value=None): # noqa: E501 + """OfferSubCondition - a model defined in Swagger""" # noqa: E501 + + self._display_value = None + self._label = None + self._locale = None + self._value = None + self.discriminator = None + + if display_value is not None: + self.display_value = display_value + if label is not None: + self.label = label + if locale is not None: + self.locale = locale + if value is not None: + self.value = value + + @property + def display_value(self): + """Gets the display_value of this OfferSubCondition. # noqa: E501 + + + :return: The display_value of this OfferSubCondition. # noqa: E501 + :rtype: str + """ + return self._display_value + + @display_value.setter + def display_value(self, display_value): + """Sets the display_value of this OfferSubCondition. + + + :param display_value: The display_value of this OfferSubCondition. # noqa: E501 + :type: str + """ + + self._display_value = display_value + + @property + def label(self): + """Gets the label of this OfferSubCondition. # noqa: E501 + + + :return: The label of this OfferSubCondition. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this OfferSubCondition. + + + :param label: The label of this OfferSubCondition. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def locale(self): + """Gets the locale of this OfferSubCondition. # noqa: E501 + + + :return: The locale of this OfferSubCondition. # noqa: E501 + :rtype: str + """ + return self._locale + + @locale.setter + def locale(self, locale): + """Sets the locale of this OfferSubCondition. + + + :param locale: The locale of this OfferSubCondition. # noqa: E501 + :type: str + """ + + self._locale = locale + + @property + def value(self): + """Gets the value of this OfferSubCondition. # noqa: E501 + + + :return: The value of this OfferSubCondition. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this OfferSubCondition. + + + :param value: The value of this OfferSubCondition. # noqa: E501 + :type: str + """ + + self._value = value + + 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(OfferSubCondition, 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, OfferSubCondition): + 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/paapi5_python_sdk/offer_summary.py b/paapi5_python_sdk/offer_summary.py new file mode 100644 index 0000000..5fa2c14 --- /dev/null +++ b/paapi5_python_sdk/offer_summary.py @@ -0,0 +1,207 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.offer_condition import OfferCondition # noqa: F401,E501 +from paapi5_python_sdk.offer_price import OfferPrice # noqa: F401,E501 + + +class OfferSummary(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 = { + 'condition': 'OfferCondition', + 'highest_price': 'OfferPrice', + 'lowest_price': 'OfferPrice', + 'offer_count': 'int' + } + + attribute_map = { + 'condition': 'Condition', + 'highest_price': 'HighestPrice', + 'lowest_price': 'LowestPrice', + 'offer_count': 'OfferCount' + } + + def __init__(self, condition=None, highest_price=None, lowest_price=None, offer_count=None): # noqa: E501 + """OfferSummary - a model defined in Swagger""" # noqa: E501 + + self._condition = None + self._highest_price = None + self._lowest_price = None + self._offer_count = None + self.discriminator = None + + if condition is not None: + self.condition = condition + if highest_price is not None: + self.highest_price = highest_price + if lowest_price is not None: + self.lowest_price = lowest_price + if offer_count is not None: + self.offer_count = offer_count + + @property + def condition(self): + """Gets the condition of this OfferSummary. # noqa: E501 + + + :return: The condition of this OfferSummary. # noqa: E501 + :rtype: OfferCondition + """ + return self._condition + + @condition.setter + def condition(self, condition): + """Sets the condition of this OfferSummary. + + + :param condition: The condition of this OfferSummary. # noqa: E501 + :type: OfferCondition + """ + + self._condition = condition + + @property + def highest_price(self): + """Gets the highest_price of this OfferSummary. # noqa: E501 + + + :return: The highest_price of this OfferSummary. # noqa: E501 + :rtype: OfferPrice + """ + return self._highest_price + + @highest_price.setter + def highest_price(self, highest_price): + """Sets the highest_price of this OfferSummary. + + + :param highest_price: The highest_price of this OfferSummary. # noqa: E501 + :type: OfferPrice + """ + + self._highest_price = highest_price + + @property + def lowest_price(self): + """Gets the lowest_price of this OfferSummary. # noqa: E501 + + + :return: The lowest_price of this OfferSummary. # noqa: E501 + :rtype: OfferPrice + """ + return self._lowest_price + + @lowest_price.setter + def lowest_price(self, lowest_price): + """Sets the lowest_price of this OfferSummary. + + + :param lowest_price: The lowest_price of this OfferSummary. # noqa: E501 + :type: OfferPrice + """ + + self._lowest_price = lowest_price + + @property + def offer_count(self): + """Gets the offer_count of this OfferSummary. # noqa: E501 + + + :return: The offer_count of this OfferSummary. # noqa: E501 + :rtype: int + """ + return self._offer_count + + @offer_count.setter + def offer_count(self, offer_count): + """Sets the offer_count of this OfferSummary. + + + :param offer_count: The offer_count of this OfferSummary. # noqa: E501 + :type: int + """ + + self._offer_count = offer_count + + 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(OfferSummary, 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, OfferSummary): + 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/paapi5_python_sdk/offers.py b/paapi5_python_sdk/offers.py new file mode 100644 index 0000000..1454205 --- /dev/null +++ b/paapi5_python_sdk/offers.py @@ -0,0 +1,155 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.offer_listing import OfferListing # noqa: F401,E501 +from paapi5_python_sdk.offer_summary import OfferSummary # noqa: F401,E501 + + +class Offers(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': 'list[OfferListing]', + 'summaries': 'list[OfferSummary]' + } + + attribute_map = { + 'listings': 'Listings', + 'summaries': 'Summaries' + } + + def __init__(self, listings=None, summaries=None): # noqa: E501 + """Offers - a model defined in Swagger""" # noqa: E501 + + self._listings = None + self._summaries = None + self.discriminator = None + + if listings is not None: + self.listings = listings + if summaries is not None: + self.summaries = summaries + + @property + def listings(self): + """Gets the listings of this Offers. # noqa: E501 + + + :return: The listings of this Offers. # noqa: E501 + :rtype: list[OfferListing] + """ + return self._listings + + @listings.setter + def listings(self, listings): + """Sets the listings of this Offers. + + + :param listings: The listings of this Offers. # noqa: E501 + :type: list[OfferListing] + """ + + self._listings = listings + + @property + def summaries(self): + """Gets the summaries of this Offers. # noqa: E501 + + + :return: The summaries of this Offers. # noqa: E501 + :rtype: list[OfferSummary] + """ + return self._summaries + + @summaries.setter + def summaries(self, summaries): + """Sets the summaries of this Offers. + + + :param summaries: The summaries of this Offers. # noqa: E501 + :type: list[OfferSummary] + """ + + self._summaries = summaries + + 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(Offers, 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, Offers): + 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/paapi5_python_sdk/partner_type.py b/paapi5_python_sdk/partner_type.py new file mode 100644 index 0000000..37f9a39 --- /dev/null +++ b/paapi5_python_sdk/partner_type.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Copyright 2019 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 PartnerType(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + ASSOCIATES = "Associates" + + """ + 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 + """PartnerType - 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(PartnerType, 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, PartnerType): + 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/paapi5_python_sdk/price.py b/paapi5_python_sdk/price.py new file mode 100644 index 0000000..7586b28 --- /dev/null +++ b/paapi5_python_sdk/price.py @@ -0,0 +1,154 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.offer_price import OfferPrice # noqa: F401,E501 + + +class Price(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 = { + 'highest_price': 'OfferPrice', + 'lowest_price': 'OfferPrice' + } + + attribute_map = { + 'highest_price': 'HighestPrice', + 'lowest_price': 'LowestPrice' + } + + def __init__(self, highest_price=None, lowest_price=None): # noqa: E501 + """Price - a model defined in Swagger""" # noqa: E501 + + self._highest_price = None + self._lowest_price = None + self.discriminator = None + + if highest_price is not None: + self.highest_price = highest_price + if lowest_price is not None: + self.lowest_price = lowest_price + + @property + def highest_price(self): + """Gets the highest_price of this Price. # noqa: E501 + + + :return: The highest_price of this Price. # noqa: E501 + :rtype: OfferPrice + """ + return self._highest_price + + @highest_price.setter + def highest_price(self, highest_price): + """Sets the highest_price of this Price. + + + :param highest_price: The highest_price of this Price. # noqa: E501 + :type: OfferPrice + """ + + self._highest_price = highest_price + + @property + def lowest_price(self): + """Gets the lowest_price of this Price. # noqa: E501 + + + :return: The lowest_price of this Price. # noqa: E501 + :rtype: OfferPrice + """ + return self._lowest_price + + @lowest_price.setter + def lowest_price(self, lowest_price): + """Sets the lowest_price of this Price. + + + :param lowest_price: The lowest_price of this Price. # noqa: E501 + :type: OfferPrice + """ + + self._lowest_price = lowest_price + + 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(Price, 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, Price): + 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/paapi5_python_sdk/product_advertising_api_client_exception.py b/paapi5_python_sdk/product_advertising_api_client_exception.py new file mode 100644 index 0000000..77b712c --- /dev/null +++ b/paapi5_python_sdk/product_advertising_api_client_exception.py @@ -0,0 +1,128 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.error_data import ErrorData # noqa: F401,E501 + + +class ProductAdvertisingAPIClientException(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 = { + 'errors': 'list[ErrorData]' + } + + attribute_map = { + 'errors': 'Errors' + } + + def __init__(self, errors=None): # noqa: E501 + """ProductAdvertisingAPIClientException - a model defined in Swagger""" # noqa: E501 + + self._errors = None + self.discriminator = None + + if errors is not None: + self.errors = errors + + @property + def errors(self): + """Gets the errors of this ProductAdvertisingAPIClientException. # noqa: E501 + + + :return: The errors of this ProductAdvertisingAPIClientException. # noqa: E501 + :rtype: list[ErrorData] + """ + return self._errors + + @errors.setter + def errors(self, errors): + """Sets the errors of this ProductAdvertisingAPIClientException. + + + :param errors: The errors of this ProductAdvertisingAPIClientException. # noqa: E501 + :type: list[ErrorData] + """ + + self._errors = errors + + 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(ProductAdvertisingAPIClientException, 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, ProductAdvertisingAPIClientException): + 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/paapi5_python_sdk/product_advertising_api_service_exception.py b/paapi5_python_sdk/product_advertising_api_service_exception.py new file mode 100644 index 0000000..957d9d4 --- /dev/null +++ b/paapi5_python_sdk/product_advertising_api_service_exception.py @@ -0,0 +1,126 @@ +# coding: utf-8 + +""" + Copyright 2019 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 ProductAdvertisingAPIServiceException(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' + } + + attribute_map = { + 'message': 'message' + } + + def __init__(self, message=None): # noqa: E501 + """ProductAdvertisingAPIServiceException - a model defined in Swagger""" # noqa: E501 + + self._message = None + self.discriminator = None + + if message is not None: + self.message = message + + @property + def message(self): + """Gets the message of this ProductAdvertisingAPIServiceException. # noqa: E501 + + + :return: The message of this ProductAdvertisingAPIServiceException. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ProductAdvertisingAPIServiceException. + + + :param message: The message of this ProductAdvertisingAPIServiceException. # noqa: E501 + :type: str + """ + + self._message = message + + 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(ProductAdvertisingAPIServiceException, 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, ProductAdvertisingAPIServiceException): + 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/paapi5_python_sdk/product_info.py b/paapi5_python_sdk/product_info.py new file mode 100644 index 0000000..d9dbc0b --- /dev/null +++ b/paapi5_python_sdk/product_info.py @@ -0,0 +1,261 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.dimension_based_attribute import DimensionBasedAttribute # noqa: F401,E501 +from paapi5_python_sdk.single_boolean_valued_attribute import SingleBooleanValuedAttribute # noqa: F401,E501 +from paapi5_python_sdk.single_integer_valued_attribute import SingleIntegerValuedAttribute # noqa: F401,E501 +from paapi5_python_sdk.single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 + + +class ProductInfo(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 = { + 'color': 'SingleStringValuedAttribute', + 'is_adult_product': 'SingleBooleanValuedAttribute', + 'item_dimensions': 'DimensionBasedAttribute', + 'release_date': 'SingleStringValuedAttribute', + 'size': 'SingleStringValuedAttribute', + 'unit_count': 'SingleIntegerValuedAttribute' + } + + attribute_map = { + 'color': 'Color', + 'is_adult_product': 'IsAdultProduct', + 'item_dimensions': 'ItemDimensions', + 'release_date': 'ReleaseDate', + 'size': 'Size', + 'unit_count': 'UnitCount' + } + + def __init__(self, color=None, is_adult_product=None, item_dimensions=None, release_date=None, size=None, unit_count=None): # noqa: E501 + """ProductInfo - a model defined in Swagger""" # noqa: E501 + + self._color = None + self._is_adult_product = None + self._item_dimensions = None + self._release_date = None + self._size = None + self._unit_count = None + self.discriminator = None + + if color is not None: + self.color = color + if is_adult_product is not None: + self.is_adult_product = is_adult_product + if item_dimensions is not None: + self.item_dimensions = item_dimensions + if release_date is not None: + self.release_date = release_date + if size is not None: + self.size = size + if unit_count is not None: + self.unit_count = unit_count + + @property + def color(self): + """Gets the color of this ProductInfo. # noqa: E501 + + + :return: The color of this ProductInfo. # noqa: E501 + :rtype: SingleStringValuedAttribute + """ + return self._color + + @color.setter + def color(self, color): + """Sets the color of this ProductInfo. + + + :param color: The color of this ProductInfo. # noqa: E501 + :type: SingleStringValuedAttribute + """ + + self._color = color + + @property + def is_adult_product(self): + """Gets the is_adult_product of this ProductInfo. # noqa: E501 + + + :return: The is_adult_product of this ProductInfo. # noqa: E501 + :rtype: SingleBooleanValuedAttribute + """ + return self._is_adult_product + + @is_adult_product.setter + def is_adult_product(self, is_adult_product): + """Sets the is_adult_product of this ProductInfo. + + + :param is_adult_product: The is_adult_product of this ProductInfo. # noqa: E501 + :type: SingleBooleanValuedAttribute + """ + + self._is_adult_product = is_adult_product + + @property + def item_dimensions(self): + """Gets the item_dimensions of this ProductInfo. # noqa: E501 + + + :return: The item_dimensions of this ProductInfo. # noqa: E501 + :rtype: DimensionBasedAttribute + """ + return self._item_dimensions + + @item_dimensions.setter + def item_dimensions(self, item_dimensions): + """Sets the item_dimensions of this ProductInfo. + + + :param item_dimensions: The item_dimensions of this ProductInfo. # noqa: E501 + :type: DimensionBasedAttribute + """ + + self._item_dimensions = item_dimensions + + @property + def release_date(self): + """Gets the release_date of this ProductInfo. # noqa: E501 + + + :return: The release_date of this ProductInfo. # noqa: E501 + :rtype: SingleStringValuedAttribute + """ + return self._release_date + + @release_date.setter + def release_date(self, release_date): + """Sets the release_date of this ProductInfo. + + + :param release_date: The release_date of this ProductInfo. # noqa: E501 + :type: SingleStringValuedAttribute + """ + + self._release_date = release_date + + @property + def size(self): + """Gets the size of this ProductInfo. # noqa: E501 + + + :return: The size of this ProductInfo. # noqa: E501 + :rtype: SingleStringValuedAttribute + """ + return self._size + + @size.setter + def size(self, size): + """Sets the size of this ProductInfo. + + + :param size: The size of this ProductInfo. # noqa: E501 + :type: SingleStringValuedAttribute + """ + + self._size = size + + @property + def unit_count(self): + """Gets the unit_count of this ProductInfo. # noqa: E501 + + + :return: The unit_count of this ProductInfo. # noqa: E501 + :rtype: SingleIntegerValuedAttribute + """ + return self._unit_count + + @unit_count.setter + def unit_count(self, unit_count): + """Sets the unit_count of this ProductInfo. + + + :param unit_count: The unit_count of this ProductInfo. # noqa: E501 + :type: SingleIntegerValuedAttribute + """ + + self._unit_count = unit_count + + 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(ProductInfo, 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, ProductInfo): + 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/paapi5_python_sdk/properties.py b/paapi5_python_sdk/properties.py new file mode 100644 index 0000000..ea72b0a --- /dev/null +++ b/paapi5_python_sdk/properties.py @@ -0,0 +1,83 @@ +# coding: utf-8 + +""" + ProductAdvertisingAPI + + https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Properties(dict): + """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 + """Properties - 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(Properties, 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, Properties): + 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/paapi5_python_sdk/refinement.py b/paapi5_python_sdk/refinement.py new file mode 100644 index 0000000..5d89f56 --- /dev/null +++ b/paapi5_python_sdk/refinement.py @@ -0,0 +1,180 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.refinement_bin import RefinementBin # noqa: F401,E501 + + +class Refinement(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 = { + 'bins': 'list[RefinementBin]', + 'display_name': 'str', + 'id': 'str' + } + + attribute_map = { + 'bins': 'Bins', + 'display_name': 'DisplayName', + 'id': 'Id' + } + + def __init__(self, bins=None, display_name=None, id=None): # noqa: E501 + """Refinement - a model defined in Swagger""" # noqa: E501 + + self._bins = None + self._display_name = None + self._id = None + self.discriminator = None + + if bins is not None: + self.bins = bins + if display_name is not None: + self.display_name = display_name + if id is not None: + self.id = id + + @property + def bins(self): + """Gets the bins of this Refinement. # noqa: E501 + + + :return: The bins of this Refinement. # noqa: E501 + :rtype: list[RefinementBin] + """ + return self._bins + + @bins.setter + def bins(self, bins): + """Sets the bins of this Refinement. + + + :param bins: The bins of this Refinement. # noqa: E501 + :type: list[RefinementBin] + """ + + self._bins = bins + + @property + def display_name(self): + """Gets the display_name of this Refinement. # noqa: E501 + + + :return: The display_name of this Refinement. # noqa: E501 + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """Sets the display_name of this Refinement. + + + :param display_name: The display_name of this Refinement. # noqa: E501 + :type: str + """ + + self._display_name = display_name + + @property + def id(self): + """Gets the id of this Refinement. # noqa: E501 + + + :return: The id of this Refinement. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Refinement. + + + :param id: The id of this Refinement. # 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(Refinement, 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, Refinement): + 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/paapi5_python_sdk/refinement_bin.py b/paapi5_python_sdk/refinement_bin.py new file mode 100644 index 0000000..9b44ba6 --- /dev/null +++ b/paapi5_python_sdk/refinement_bin.py @@ -0,0 +1,152 @@ +# coding: utf-8 + +""" + Copyright 2019 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 RefinementBin(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 = { + 'display_name': 'str', + 'id': 'str' + } + + attribute_map = { + 'display_name': 'DisplayName', + 'id': 'Id' + } + + def __init__(self, display_name=None, id=None): # noqa: E501 + """RefinementBin - a model defined in Swagger""" # noqa: E501 + + self._display_name = None + self._id = None + self.discriminator = None + + if display_name is not None: + self.display_name = display_name + if id is not None: + self.id = id + + @property + def display_name(self): + """Gets the display_name of this RefinementBin. # noqa: E501 + + + :return: The display_name of this RefinementBin. # noqa: E501 + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """Sets the display_name of this RefinementBin. + + + :param display_name: The display_name of this RefinementBin. # noqa: E501 + :type: str + """ + + self._display_name = display_name + + @property + def id(self): + """Gets the id of this RefinementBin. # noqa: E501 + + + :return: The id of this RefinementBin. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this RefinementBin. + + + :param id: The id of this RefinementBin. # 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(RefinementBin, 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, RefinementBin): + 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/paapi5_python_sdk/rental_offer_listing.py b/paapi5_python_sdk/rental_offer_listing.py new file mode 100644 index 0000000..6859d5a --- /dev/null +++ b/paapi5_python_sdk/rental_offer_listing.py @@ -0,0 +1,262 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.duration_price import DurationPrice # noqa: F401,E501 +from paapi5_python_sdk.offer_availability import OfferAvailability # noqa: F401,E501 +from paapi5_python_sdk.offer_condition import OfferCondition # noqa: F401,E501 +from paapi5_python_sdk.offer_delivery_info import OfferDeliveryInfo # noqa: F401,E501 +from paapi5_python_sdk.offer_merchant_info import OfferMerchantInfo # noqa: F401,E501 + + +class RentalOfferListing(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': 'OfferAvailability', + 'base_price': 'DurationPrice', + 'condition': 'OfferCondition', + 'delivery_info': 'OfferDeliveryInfo', + 'id': 'str', + 'merchant_info': 'OfferMerchantInfo' + } + + attribute_map = { + 'availability': 'Availability', + 'base_price': 'BasePrice', + 'condition': 'Condition', + 'delivery_info': 'DeliveryInfo', + 'id': 'Id', + 'merchant_info': 'MerchantInfo' + } + + def __init__(self, availability=None, base_price=None, condition=None, delivery_info=None, id=None, merchant_info=None): # noqa: E501 + """RentalOfferListing - a model defined in Swagger""" # noqa: E501 + + self._availability = None + self._base_price = None + self._condition = None + self._delivery_info = None + self._id = None + self._merchant_info = None + self.discriminator = None + + if availability is not None: + self.availability = availability + if base_price is not None: + self.base_price = base_price + if condition is not None: + self.condition = condition + if delivery_info is not None: + self.delivery_info = delivery_info + if id is not None: + self.id = id + if merchant_info is not None: + self.merchant_info = merchant_info + + @property + def availability(self): + """Gets the availability of this RentalOfferListing. # noqa: E501 + + + :return: The availability of this RentalOfferListing. # noqa: E501 + :rtype: OfferAvailability + """ + return self._availability + + @availability.setter + def availability(self, availability): + """Sets the availability of this RentalOfferListing. + + + :param availability: The availability of this RentalOfferListing. # noqa: E501 + :type: OfferAvailability + """ + + self._availability = availability + + @property + def base_price(self): + """Gets the base_price of this RentalOfferListing. # noqa: E501 + + + :return: The base_price of this RentalOfferListing. # noqa: E501 + :rtype: DurationPrice + """ + return self._base_price + + @base_price.setter + def base_price(self, base_price): + """Sets the base_price of this RentalOfferListing. + + + :param base_price: The base_price of this RentalOfferListing. # noqa: E501 + :type: DurationPrice + """ + + self._base_price = base_price + + @property + def condition(self): + """Gets the condition of this RentalOfferListing. # noqa: E501 + + + :return: The condition of this RentalOfferListing. # noqa: E501 + :rtype: OfferCondition + """ + return self._condition + + @condition.setter + def condition(self, condition): + """Sets the condition of this RentalOfferListing. + + + :param condition: The condition of this RentalOfferListing. # noqa: E501 + :type: OfferCondition + """ + + self._condition = condition + + @property + def delivery_info(self): + """Gets the delivery_info of this RentalOfferListing. # noqa: E501 + + + :return: The delivery_info of this RentalOfferListing. # noqa: E501 + :rtype: OfferDeliveryInfo + """ + return self._delivery_info + + @delivery_info.setter + def delivery_info(self, delivery_info): + """Sets the delivery_info of this RentalOfferListing. + + + :param delivery_info: The delivery_info of this RentalOfferListing. # noqa: E501 + :type: OfferDeliveryInfo + """ + + self._delivery_info = delivery_info + + @property + def id(self): + """Gets the id of this RentalOfferListing. # noqa: E501 + + + :return: The id of this RentalOfferListing. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this RentalOfferListing. + + + :param id: The id of this RentalOfferListing. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def merchant_info(self): + """Gets the merchant_info of this RentalOfferListing. # noqa: E501 + + + :return: The merchant_info of this RentalOfferListing. # noqa: E501 + :rtype: OfferMerchantInfo + """ + return self._merchant_info + + @merchant_info.setter + def merchant_info(self, merchant_info): + """Sets the merchant_info of this RentalOfferListing. + + + :param merchant_info: The merchant_info of this RentalOfferListing. # noqa: E501 + :type: OfferMerchantInfo + """ + + self._merchant_info = merchant_info + + 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(RentalOfferListing, 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, RentalOfferListing): + 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/paapi5_python_sdk/rental_offers.py b/paapi5_python_sdk/rental_offers.py new file mode 100644 index 0000000..c3f60c2 --- /dev/null +++ b/paapi5_python_sdk/rental_offers.py @@ -0,0 +1,128 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.rental_offer_listing import RentalOfferListing # noqa: F401,E501 + + +class RentalOffers(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': 'list[RentalOfferListing]' + } + + attribute_map = { + 'listings': 'Listings' + } + + def __init__(self, listings=None): # noqa: E501 + """RentalOffers - 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 RentalOffers. # noqa: E501 + + + :return: The listings of this RentalOffers. # noqa: E501 + :rtype: list[RentalOfferListing] + """ + return self._listings + + @listings.setter + def listings(self, listings): + """Sets the listings of this RentalOffers. + + + :param listings: The listings of this RentalOffers. # noqa: E501 + :type: list[RentalOfferListing] + """ + + 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(RentalOffers, 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, RentalOffers): + 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/paapi5_python_sdk/rest.py b/paapi5_python_sdk/rest.py new file mode 100644 index 0000000..a4e74fa --- /dev/null +++ b/paapi5_python_sdk/rest.py @@ -0,0 +1,333 @@ +# coding: utf-8 + +from __future__ import absolute_import + +""" + Copyright 2019 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 io +import json +import logging +import re +import ssl + +import certifi +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import urlencode + +try: + import urllib3 +except ImportError: + raise ImportError('Swagger python client requires urllib3.') + + +logger = logging.getLogger(__name__) + + +class RESTResponse(io.IOBase): + + def __init__(self, resp): + self.urllib3_response = resp + self.status = resp.status + self.reason = resp.reason + self.data = resp.data + + def getheaders(self): + """Returns a dictionary of the response headers.""" + return self.urllib3_response.getheaders() + + def getheader(self, name, default=None): + """Returns a given response header.""" + return self.urllib3_response.getheader(name, default) + + +class RESTClientObject(object): + + def __init__(self, configuration, pools_size=4, maxsize=None): + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + # ca_certs + if configuration.ssl_ca_cert: + ca_certs = configuration.ssl_ca_cert + else: + # if not set certificate file, use Mozilla's root certificates. + ca_certs = certifi.where() + + addition_pool_args = {} + if configuration.assert_hostname is not None: + addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + + if maxsize is None: + if configuration.connection_pool_maxsize is not None: + maxsize = configuration.connection_pool_maxsize + else: + maxsize = 4 + + # https pool manager + if configuration.proxy: + self.pool_manager = urllib3.ProxyManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + proxy_url=configuration.proxy, + **addition_pool_args + ) + else: + self.pool_manager = urllib3.PoolManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + **addition_pool_args + ) + + def request(self, method, url, query_params=None, headers=None, + body=None, post_params=None, _preload_content=True, + _request_timeout=None): + """Perform requests. + + :param method: http request method + :param url: http request url + :param query_params: query parameters in the url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + """ + method = method.upper() + assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', + 'PATCH', 'OPTIONS'] + + if post_params and body: + raise ValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = headers or {} + + timeout = None + if _request_timeout: + if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821 + timeout = urllib3.Timeout(total=_request_timeout) + elif (isinstance(_request_timeout, tuple) and + len(_request_timeout) == 2): + timeout = urllib3.Timeout( + connect=_request_timeout[0], read=_request_timeout[1]) + + if 'Content-Type' not in headers: + headers['Content-Type'] = 'application/json' + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + if query_params: + url += '?' + urlencode(query_params) + if re.search('json', headers['Content-Type'], re.IGNORECASE): + request_body = None + if body is not None: + request_body = json.dumps(body) + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=False, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers['Content-Type'] + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=True, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + # Pass a `string` parameter directly in the body to support + # other content types than Json when `body` argument is + # provided in serialized form + elif isinstance(body, str): + request_body = body + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request(method, url, + fields=query_params, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + except urllib3.exceptions.SSLError as e: + msg = "{0}\n{1}".format(type(e).__name__, str(e)) + raise ApiException(status=0, reason=msg) + + if _preload_content: + r = RESTResponse(r) + + # In the python 3, the response.data is bytes. + # we need to decode it to string. + if six.PY3: + r.data = r.data.decode('utf8') + + # log response body + logger.debug("response body: %s", r.data) + + if not 200 <= r.status <= 299: + raise ApiException(http_resp=r) + + return r + + def GET(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("GET", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def HEAD(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("HEAD", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def OPTIONS(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("OPTIONS", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def DELETE(self, url, headers=None, query_params=None, body=None, + _preload_content=True, _request_timeout=None): + return self.request("DELETE", url, + headers=headers, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def POST(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("POST", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PUT(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PUT", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PATCH(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PATCH", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + +class ApiException(Exception): + + def __init__(self, status=None, reason=None, http_resp=None): + if http_resp: + self.status = http_resp.status + self.reason = http_resp.reason + self.body = http_resp.data + self.headers = http_resp.getheaders() + else: + self.status = status + self.reason = reason + self.body = None + self.headers = None + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + return error_message diff --git a/paapi5_python_sdk/search_items_request.py b/paapi5_python_sdk/search_items_request.py new file mode 100644 index 0000000..a552080 --- /dev/null +++ b/paapi5_python_sdk/search_items_request.py @@ -0,0 +1,818 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.availability import Availability # noqa: F401,E501 +from paapi5_python_sdk.condition import Condition # noqa: F401,E501 +from paapi5_python_sdk.delivery_flag import DeliveryFlag # noqa: F401,E501 +from paapi5_python_sdk.max_price import MaxPrice # noqa: F401,E501 +from paapi5_python_sdk.merchant import Merchant # noqa: F401,E501 +from paapi5_python_sdk.min_price import MinPrice # noqa: F401,E501 +from paapi5_python_sdk.min_reviews_rating import MinReviewsRating # noqa: F401,E501 +from paapi5_python_sdk.min_saving_percent import MinSavingPercent # noqa: F401,E501 +from paapi5_python_sdk.offer_count import OfferCount # noqa: F401,E501 +from paapi5_python_sdk.partner_type import PartnerType # noqa: F401,E501 +from paapi5_python_sdk.properties import Properties # noqa: F401,E501 +from paapi5_python_sdk.search_items_resource import SearchItemsResource # noqa: F401,E501 +from paapi5_python_sdk.sort_by import SortBy # noqa: F401,E501 + + +class SearchItemsRequest(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 = { + 'actor': 'str', + 'artist': 'str', + 'author': 'str', + 'availability': 'Availability', + 'brand': 'str', + 'browse_node_id': 'str', + 'condition': 'Condition', + 'currency_of_preference': 'str', + 'delivery_flags': 'list[DeliveryFlag]', + 'item_count': 'int', + 'item_page': 'int', + 'keywords': 'str', + 'languages_of_preference': 'list[str]', + 'marketplace': 'str', + 'max_price': 'MaxPrice', + 'merchant': 'Merchant', + 'min_price': 'MinPrice', + 'min_reviews_rating': 'MinReviewsRating', + 'min_saving_percent': 'MinSavingPercent', + 'offer_count': 'OfferCount', + 'partner_tag': 'str', + 'partner_type': 'PartnerType', + 'properties': 'Properties', + 'resources': 'list[SearchItemsResource]', + 'search_index': 'str', + 'sort_by': 'SortBy', + 'title': 'str' + } + + attribute_map = { + 'actor': 'Actor', + 'artist': 'Artist', + 'author': 'Author', + 'availability': 'Availability', + 'brand': 'Brand', + 'browse_node_id': 'BrowseNodeId', + 'condition': 'Condition', + 'currency_of_preference': 'CurrencyOfPreference', + 'delivery_flags': 'DeliveryFlags', + 'item_count': 'ItemCount', + 'item_page': 'ItemPage', + 'keywords': 'Keywords', + 'languages_of_preference': 'LanguagesOfPreference', + 'marketplace': 'Marketplace', + 'max_price': 'MaxPrice', + 'merchant': 'Merchant', + 'min_price': 'MinPrice', + 'min_reviews_rating': 'MinReviewsRating', + 'min_saving_percent': 'MinSavingPercent', + 'offer_count': 'OfferCount', + 'partner_tag': 'PartnerTag', + 'partner_type': 'PartnerType', + 'properties': 'Properties', + 'resources': 'Resources', + 'search_index': 'SearchIndex', + 'sort_by': 'SortBy', + 'title': 'Title' + } + + def __init__(self, actor=None, artist=None, author=None, availability=None, brand=None, browse_node_id=None, condition=None, currency_of_preference=None, delivery_flags=None, item_count=None, item_page=None, keywords=None, languages_of_preference=None, marketplace=None, max_price=None, merchant=None, min_price=None, min_reviews_rating=None, min_saving_percent=None, offer_count=None, partner_tag=None, partner_type=None, properties=None, resources=None, search_index=None, sort_by=None, title=None): # noqa: E501 + """SearchItemsRequest - a model defined in Swagger""" # noqa: E501 + + self._actor = None + self._artist = None + self._author = None + self._availability = None + self._brand = None + self._browse_node_id = None + self._condition = None + self._currency_of_preference = None + self._delivery_flags = None + self._item_count = None + self._item_page = None + self._keywords = None + self._languages_of_preference = None + self._marketplace = None + self._max_price = None + self._merchant = None + self._min_price = None + self._min_reviews_rating = None + self._min_saving_percent = None + self._offer_count = None + self._partner_tag = None + self._partner_type = None + self._properties = None + self._resources = None + self._search_index = None + self._sort_by = None + self._title = None + self.discriminator = None + + if actor is not None: + self.actor = actor + if artist is not None: + self.artist = artist + if author is not None: + self.author = author + if availability is not None: + self.availability = availability + if brand is not None: + self.brand = brand + if browse_node_id is not None: + self.browse_node_id = browse_node_id + if condition is not None: + self.condition = condition + if currency_of_preference is not None: + self.currency_of_preference = currency_of_preference + if delivery_flags is not None: + self.delivery_flags = delivery_flags + if item_count is not None: + self.item_count = item_count + if item_page is not None: + self.item_page = item_page + if keywords is not None: + self.keywords = keywords + if languages_of_preference is not None: + self.languages_of_preference = languages_of_preference + if marketplace is not None: + self.marketplace = marketplace + if max_price is not None: + self.max_price = max_price + if merchant is not None: + self.merchant = merchant + if min_price is not None: + self.min_price = min_price + if min_reviews_rating is not None: + self.min_reviews_rating = min_reviews_rating + if min_saving_percent is not None: + self.min_saving_percent = min_saving_percent + if offer_count is not None: + self.offer_count = offer_count + self.partner_tag = partner_tag + self.partner_type = partner_type + if properties is not None: + self.properties = properties + if resources is not None: + self.resources = resources + if search_index is not None: + self.search_index = search_index + if sort_by is not None: + self.sort_by = sort_by + if title is not None: + self.title = title + + @property + def actor(self): + """Gets the actor of this SearchItemsRequest. # noqa: E501 + + + :return: The actor of this SearchItemsRequest. # noqa: E501 + :rtype: str + """ + return self._actor + + @actor.setter + def actor(self, actor): + """Sets the actor of this SearchItemsRequest. + + + :param actor: The actor of this SearchItemsRequest. # noqa: E501 + :type: str + """ + + self._actor = actor + + @property + def artist(self): + """Gets the artist of this SearchItemsRequest. # noqa: E501 + + + :return: The artist of this SearchItemsRequest. # noqa: E501 + :rtype: str + """ + return self._artist + + @artist.setter + def artist(self, artist): + """Sets the artist of this SearchItemsRequest. + + + :param artist: The artist of this SearchItemsRequest. # noqa: E501 + :type: str + """ + + self._artist = artist + + @property + def author(self): + """Gets the author of this SearchItemsRequest. # noqa: E501 + + + :return: The author of this SearchItemsRequest. # noqa: E501 + :rtype: str + """ + return self._author + + @author.setter + def author(self, author): + """Sets the author of this SearchItemsRequest. + + + :param author: The author of this SearchItemsRequest. # noqa: E501 + :type: str + """ + + self._author = author + + @property + def availability(self): + """Gets the availability of this SearchItemsRequest. # noqa: E501 + + + :return: The availability of this SearchItemsRequest. # noqa: E501 + :rtype: Availability + """ + return self._availability + + @availability.setter + def availability(self, availability): + """Sets the availability of this SearchItemsRequest. + + + :param availability: The availability of this SearchItemsRequest. # noqa: E501 + :type: Availability + """ + + self._availability = availability + + @property + def brand(self): + """Gets the brand of this SearchItemsRequest. # noqa: E501 + + + :return: The brand of this SearchItemsRequest. # noqa: E501 + :rtype: str + """ + return self._brand + + @brand.setter + def brand(self, brand): + """Sets the brand of this SearchItemsRequest. + + + :param brand: The brand of this SearchItemsRequest. # noqa: E501 + :type: str + """ + + self._brand = brand + + @property + def browse_node_id(self): + """Gets the browse_node_id of this SearchItemsRequest. # noqa: E501 + + + :return: The browse_node_id of this SearchItemsRequest. # noqa: E501 + :rtype: str + """ + return self._browse_node_id + + @browse_node_id.setter + def browse_node_id(self, browse_node_id): + """Sets the browse_node_id of this SearchItemsRequest. + + + :param browse_node_id: The browse_node_id of this SearchItemsRequest. # noqa: E501 + :type: str + """ + + self._browse_node_id = browse_node_id + + @property + def condition(self): + """Gets the condition of this SearchItemsRequest. # noqa: E501 + + + :return: The condition of this SearchItemsRequest. # noqa: E501 + :rtype: Condition + """ + return self._condition + + @condition.setter + def condition(self, condition): + """Sets the condition of this SearchItemsRequest. + + + :param condition: The condition of this SearchItemsRequest. # noqa: E501 + :type: Condition + """ + + self._condition = condition + + @property + def currency_of_preference(self): + """Gets the currency_of_preference of this SearchItemsRequest. # noqa: E501 + + + :return: The currency_of_preference of this SearchItemsRequest. # noqa: E501 + :rtype: str + """ + return self._currency_of_preference + + @currency_of_preference.setter + def currency_of_preference(self, currency_of_preference): + """Sets the currency_of_preference of this SearchItemsRequest. + + + :param currency_of_preference: The currency_of_preference of this SearchItemsRequest. # noqa: E501 + :type: str + """ + + self._currency_of_preference = currency_of_preference + + @property + def delivery_flags(self): + """Gets the delivery_flags of this SearchItemsRequest. # noqa: E501 + + + :return: The delivery_flags of this SearchItemsRequest. # noqa: E501 + :rtype: list[DeliveryFlag] + """ + return self._delivery_flags + + @delivery_flags.setter + def delivery_flags(self, delivery_flags): + """Sets the delivery_flags of this SearchItemsRequest. + + + :param delivery_flags: The delivery_flags of this SearchItemsRequest. # noqa: E501 + :type: list[DeliveryFlag] + """ + + self._delivery_flags = delivery_flags + + @property + def item_count(self): + """Gets the item_count of this SearchItemsRequest. # noqa: E501 + + + :return: The item_count of this SearchItemsRequest. # noqa: E501 + :rtype: int + """ + return self._item_count + + @item_count.setter + def item_count(self, item_count): + """Sets the item_count of this SearchItemsRequest. + + + :param item_count: The item_count of this SearchItemsRequest. # noqa: E501 + :type: int + """ + + self._item_count = item_count + + @property + def item_page(self): + """Gets the item_page of this SearchItemsRequest. # noqa: E501 + + + :return: The item_page of this SearchItemsRequest. # noqa: E501 + :rtype: int + """ + return self._item_page + + @item_page.setter + def item_page(self, item_page): + """Sets the item_page of this SearchItemsRequest. + + + :param item_page: The item_page of this SearchItemsRequest. # noqa: E501 + :type: int + """ + + self._item_page = item_page + + @property + def keywords(self): + """Gets the keywords of this SearchItemsRequest. # noqa: E501 + + + :return: The keywords of this SearchItemsRequest. # noqa: E501 + :rtype: str + """ + return self._keywords + + @keywords.setter + def keywords(self, keywords): + """Sets the keywords of this SearchItemsRequest. + + + :param keywords: The keywords of this SearchItemsRequest. # noqa: E501 + :type: str + """ + + self._keywords = keywords + + @property + def languages_of_preference(self): + """Gets the languages_of_preference of this SearchItemsRequest. # noqa: E501 + + + :return: The languages_of_preference of this SearchItemsRequest. # noqa: E501 + :rtype: list[str] + """ + return self._languages_of_preference + + @languages_of_preference.setter + def languages_of_preference(self, languages_of_preference): + """Sets the languages_of_preference of this SearchItemsRequest. + + + :param languages_of_preference: The languages_of_preference of this SearchItemsRequest. # noqa: E501 + :type: list[str] + """ + + self._languages_of_preference = languages_of_preference + + @property + def marketplace(self): + """Gets the marketplace of this SearchItemsRequest. # noqa: E501 + + + :return: The marketplace of this SearchItemsRequest. # noqa: E501 + :rtype: str + """ + return self._marketplace + + @marketplace.setter + def marketplace(self, marketplace): + """Sets the marketplace of this SearchItemsRequest. + + + :param marketplace: The marketplace of this SearchItemsRequest. # noqa: E501 + :type: str + """ + + self._marketplace = marketplace + + @property + def max_price(self): + """Gets the max_price of this SearchItemsRequest. # noqa: E501 + + + :return: The max_price of this SearchItemsRequest. # noqa: E501 + :rtype: MaxPrice + """ + return self._max_price + + @max_price.setter + def max_price(self, max_price): + """Sets the max_price of this SearchItemsRequest. + + + :param max_price: The max_price of this SearchItemsRequest. # noqa: E501 + :type: MaxPrice + """ + + self._max_price = max_price + + @property + def merchant(self): + """Gets the merchant of this SearchItemsRequest. # noqa: E501 + + + :return: The merchant of this SearchItemsRequest. # noqa: E501 + :rtype: Merchant + """ + return self._merchant + + @merchant.setter + def merchant(self, merchant): + """Sets the merchant of this SearchItemsRequest. + + + :param merchant: The merchant of this SearchItemsRequest. # noqa: E501 + :type: Merchant + """ + + self._merchant = merchant + + @property + def min_price(self): + """Gets the min_price of this SearchItemsRequest. # noqa: E501 + + + :return: The min_price of this SearchItemsRequest. # noqa: E501 + :rtype: MinPrice + """ + return self._min_price + + @min_price.setter + def min_price(self, min_price): + """Sets the min_price of this SearchItemsRequest. + + + :param min_price: The min_price of this SearchItemsRequest. # noqa: E501 + :type: MinPrice + """ + + self._min_price = min_price + + @property + def min_reviews_rating(self): + """Gets the min_reviews_rating of this SearchItemsRequest. # noqa: E501 + + + :return: The min_reviews_rating of this SearchItemsRequest. # noqa: E501 + :rtype: MinReviewsRating + """ + return self._min_reviews_rating + + @min_reviews_rating.setter + def min_reviews_rating(self, min_reviews_rating): + """Sets the min_reviews_rating of this SearchItemsRequest. + + + :param min_reviews_rating: The min_reviews_rating of this SearchItemsRequest. # noqa: E501 + :type: MinReviewsRating + """ + + self._min_reviews_rating = min_reviews_rating + + @property + def min_saving_percent(self): + """Gets the min_saving_percent of this SearchItemsRequest. # noqa: E501 + + + :return: The min_saving_percent of this SearchItemsRequest. # noqa: E501 + :rtype: MinSavingPercent + """ + return self._min_saving_percent + + @min_saving_percent.setter + def min_saving_percent(self, min_saving_percent): + """Sets the min_saving_percent of this SearchItemsRequest. + + + :param min_saving_percent: The min_saving_percent of this SearchItemsRequest. # noqa: E501 + :type: MinSavingPercent + """ + + self._min_saving_percent = min_saving_percent + + @property + def offer_count(self): + """Gets the offer_count of this SearchItemsRequest. # noqa: E501 + + + :return: The offer_count of this SearchItemsRequest. # noqa: E501 + :rtype: OfferCount + """ + return self._offer_count + + @offer_count.setter + def offer_count(self, offer_count): + """Sets the offer_count of this SearchItemsRequest. + + + :param offer_count: The offer_count of this SearchItemsRequest. # noqa: E501 + :type: OfferCount + """ + + self._offer_count = offer_count + + @property + def partner_tag(self): + """Gets the partner_tag of this SearchItemsRequest. # noqa: E501 + + + :return: The partner_tag of this SearchItemsRequest. # noqa: E501 + :rtype: str + """ + return self._partner_tag + + @partner_tag.setter + def partner_tag(self, partner_tag): + """Sets the partner_tag of this SearchItemsRequest. + + + :param partner_tag: The partner_tag of this SearchItemsRequest. # noqa: E501 + :type: str + """ + if partner_tag is None: + raise ValueError("Invalid value for `partner_tag`, must not be `None`") # noqa: E501 + + self._partner_tag = partner_tag + + @property + def partner_type(self): + """Gets the partner_type of this SearchItemsRequest. # noqa: E501 + + + :return: The partner_type of this SearchItemsRequest. # noqa: E501 + :rtype: PartnerType + """ + return self._partner_type + + @partner_type.setter + def partner_type(self, partner_type): + """Sets the partner_type of this SearchItemsRequest. + + + :param partner_type: The partner_type of this SearchItemsRequest. # noqa: E501 + :type: PartnerType + """ + if partner_type is None: + raise ValueError("Invalid value for `partner_type`, must not be `None`") # noqa: E501 + + self._partner_type = partner_type + + @property + def properties(self): + """Gets the properties of this SearchItemsRequest. # noqa: E501 + + + :return: The properties of this SearchItemsRequest. # noqa: E501 + :rtype: Properties + """ + return self._properties + + @properties.setter + def properties(self, properties): + """Sets the properties of this SearchItemsRequest. + + + :param properties: The properties of this SearchItemsRequest. # noqa: E501 + :type: Properties + """ + + self._properties = properties + + @property + def resources(self): + """Gets the resources of this SearchItemsRequest. # noqa: E501 + + + :return: The resources of this SearchItemsRequest. # noqa: E501 + :rtype: list[SearchItemsResource] + """ + return self._resources + + @resources.setter + def resources(self, resources): + """Sets the resources of this SearchItemsRequest. + + + :param resources: The resources of this SearchItemsRequest. # noqa: E501 + :type: list[SearchItemsResource] + """ + + self._resources = resources + + @property + def search_index(self): + """Gets the search_index of this SearchItemsRequest. # noqa: E501 + + + :return: The search_index of this SearchItemsRequest. # noqa: E501 + :rtype: str + """ + return self._search_index + + @search_index.setter + def search_index(self, search_index): + """Sets the search_index of this SearchItemsRequest. + + + :param search_index: The search_index of this SearchItemsRequest. # noqa: E501 + :type: str + """ + + self._search_index = search_index + + @property + def sort_by(self): + """Gets the sort_by of this SearchItemsRequest. # noqa: E501 + + + :return: The sort_by of this SearchItemsRequest. # noqa: E501 + :rtype: SortBy + """ + return self._sort_by + + @sort_by.setter + def sort_by(self, sort_by): + """Sets the sort_by of this SearchItemsRequest. + + + :param sort_by: The sort_by of this SearchItemsRequest. # noqa: E501 + :type: SortBy + """ + + self._sort_by = sort_by + + @property + def title(self): + """Gets the title of this SearchItemsRequest. # noqa: E501 + + + :return: The title of this SearchItemsRequest. # noqa: E501 + :rtype: str + """ + return self._title + + @title.setter + def title(self, title): + """Sets the title of this SearchItemsRequest. + + + :param title: The title of this SearchItemsRequest. # noqa: E501 + :type: str + """ + + self._title = title + + 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(SearchItemsRequest, 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, SearchItemsRequest): + 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/paapi5_python_sdk/search_items_resource.py b/paapi5_python_sdk/search_items_resource.py new file mode 100644 index 0000000..a55a559 --- /dev/null +++ b/paapi5_python_sdk/search_items_resource.py @@ -0,0 +1,158 @@ +# coding: utf-8 + +""" + Copyright 2019 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 SearchItemsResource(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + BROWSENODEINFO_BROWSENODES = "BrowseNodeInfo.BrowseNodes" + BROWSENODEINFO_BROWSENODES_ANCESTOR = "BrowseNodeInfo.BrowseNodes.Ancestor" + BROWSENODEINFO_BROWSENODES_SALESRANK = "BrowseNodeInfo.BrowseNodes.SalesRank" + BROWSENODEINFO_WEBSITESALESRANK = "BrowseNodeInfo.WebsiteSalesRank" + IMAGES_PRIMARY_SMALL = "Images.Primary.Small" + IMAGES_PRIMARY_MEDIUM = "Images.Primary.Medium" + IMAGES_PRIMARY_LARGE = "Images.Primary.Large" + IMAGES_VARIANTS_SMALL = "Images.Variants.Small" + IMAGES_VARIANTS_MEDIUM = "Images.Variants.Medium" + IMAGES_VARIANTS_LARGE = "Images.Variants.Large" + ITEMINFO_BYLINEINFO = "ItemInfo.ByLineInfo" + ITEMINFO_CONTENTINFO = "ItemInfo.ContentInfo" + ITEMINFO_CONTENTRATING = "ItemInfo.ContentRating" + ITEMINFO_CLASSIFICATIONS = "ItemInfo.Classifications" + ITEMINFO_EXTERNALIDS = "ItemInfo.ExternalIds" + ITEMINFO_FEATURES = "ItemInfo.Features" + ITEMINFO_MANUFACTUREINFO = "ItemInfo.ManufactureInfo" + ITEMINFO_PRODUCTINFO = "ItemInfo.ProductInfo" + ITEMINFO_TECHNICALINFO = "ItemInfo.TechnicalInfo" + ITEMINFO_TITLE = "ItemInfo.Title" + ITEMINFO_TRADEININFO = "ItemInfo.TradeInInfo" + OFFERS_LISTINGS_AVAILABILITY_MAXORDERQUANTITY = "Offers.Listings.Availability.MaxOrderQuantity" + OFFERS_LISTINGS_AVAILABILITY_MESSAGE = "Offers.Listings.Availability.Message" + OFFERS_LISTINGS_AVAILABILITY_MINORDERQUANTITY = "Offers.Listings.Availability.MinOrderQuantity" + OFFERS_LISTINGS_AVAILABILITY_TYPE = "Offers.Listings.Availability.Type" + OFFERS_LISTINGS_CONDITION = "Offers.Listings.Condition" + OFFERS_LISTINGS_CONDITION_SUBCONDITION = "Offers.Listings.Condition.SubCondition" + OFFERS_LISTINGS_DELIVERYINFO_ISAMAZONFULFILLED = "Offers.Listings.DeliveryInfo.IsAmazonFulfilled" + OFFERS_LISTINGS_DELIVERYINFO_ISFREESHIPPINGELIGIBLE = "Offers.Listings.DeliveryInfo.IsFreeShippingEligible" + OFFERS_LISTINGS_DELIVERYINFO_ISPRIMEELIGIBLE = "Offers.Listings.DeliveryInfo.IsPrimeEligible" + OFFERS_LISTINGS_DELIVERYINFO_SHIPPINGCHARGES = "Offers.Listings.DeliveryInfo.ShippingCharges" + OFFERS_LISTINGS_ISBUYBOXWINNER = "Offers.Listings.IsBuyBoxWinner" + OFFERS_LISTINGS_LOYALTYPOINTS_POINTS = "Offers.Listings.LoyaltyPoints.Points" + OFFERS_LISTINGS_MERCHANTINFO = "Offers.Listings.MerchantInfo" + OFFERS_LISTINGS_PRICE = "Offers.Listings.Price" + OFFERS_LISTINGS_PROGRAMELIGIBILITY_ISPRIMEEXCLUSIVE = "Offers.Listings.ProgramEligibility.IsPrimeExclusive" + OFFERS_LISTINGS_PROGRAMELIGIBILITY_ISPRIMEPANTRY = "Offers.Listings.ProgramEligibility.IsPrimePantry" + OFFERS_LISTINGS_PROMOTIONS = "Offers.Listings.Promotions" + OFFERS_LISTINGS_SAVINGBASIS = "Offers.Listings.SavingBasis" + OFFERS_SUMMARIES_HIGHESTPRICE = "Offers.Summaries.HighestPrice" + OFFERS_SUMMARIES_LOWESTPRICE = "Offers.Summaries.LowestPrice" + OFFERS_SUMMARIES_OFFERCOUNT = "Offers.Summaries.OfferCount" + PARENTASIN = "ParentASIN" + RENTALOFFERS_LISTINGS_AVAILABILITY_MAXORDERQUANTITY = "RentalOffers.Listings.Availability.MaxOrderQuantity" + RENTALOFFERS_LISTINGS_AVAILABILITY_MESSAGE = "RentalOffers.Listings.Availability.Message" + RENTALOFFERS_LISTINGS_AVAILABILITY_MINORDERQUANTITY = "RentalOffers.Listings.Availability.MinOrderQuantity" + RENTALOFFERS_LISTINGS_AVAILABILITY_TYPE = "RentalOffers.Listings.Availability.Type" + RENTALOFFERS_LISTINGS_BASEPRICE = "RentalOffers.Listings.BasePrice" + RENTALOFFERS_LISTINGS_CONDITION = "RentalOffers.Listings.Condition" + RENTALOFFERS_LISTINGS_CONDITION_SUBCONDITION = "RentalOffers.Listings.Condition.SubCondition" + RENTALOFFERS_LISTINGS_DELIVERYINFO_ISAMAZONFULFILLED = "RentalOffers.Listings.DeliveryInfo.IsAmazonFulfilled" + RENTALOFFERS_LISTINGS_DELIVERYINFO_ISFREESHIPPINGELIGIBLE = "RentalOffers.Listings.DeliveryInfo.IsFreeShippingEligible" + RENTALOFFERS_LISTINGS_DELIVERYINFO_ISPRIMEELIGIBLE = "RentalOffers.Listings.DeliveryInfo.IsPrimeEligible" + RENTALOFFERS_LISTINGS_DELIVERYINFO_SHIPPINGCHARGES = "RentalOffers.Listings.DeliveryInfo.ShippingCharges" + RENTALOFFERS_LISTINGS_MERCHANTINFO = "RentalOffers.Listings.MerchantInfo" + SEARCHREFINEMENTS = "SearchRefinements" + + """ + 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 + """SearchItemsResource - 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(SearchItemsResource, 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, SearchItemsResource): + 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/paapi5_python_sdk/search_items_response.py b/paapi5_python_sdk/search_items_response.py new file mode 100644 index 0000000..a95f657 --- /dev/null +++ b/paapi5_python_sdk/search_items_response.py @@ -0,0 +1,155 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.error_data import ErrorData # noqa: F401,E501 +from paapi5_python_sdk.search_result import SearchResult # noqa: F401,E501 + + +class SearchItemsResponse(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 = { + 'search_result': 'SearchResult', + 'errors': 'list[ErrorData]' + } + + attribute_map = { + 'search_result': 'SearchResult', + 'errors': 'Errors' + } + + def __init__(self, search_result=None, errors=None): # noqa: E501 + """SearchItemsResponse - a model defined in Swagger""" # noqa: E501 + + self._search_result = None + self._errors = None + self.discriminator = None + + if search_result is not None: + self.search_result = search_result + if errors is not None: + self.errors = errors + + @property + def search_result(self): + """Gets the search_result of this SearchItemsResponse. # noqa: E501 + + + :return: The search_result of this SearchItemsResponse. # noqa: E501 + :rtype: SearchResult + """ + return self._search_result + + @search_result.setter + def search_result(self, search_result): + """Sets the search_result of this SearchItemsResponse. + + + :param search_result: The search_result of this SearchItemsResponse. # noqa: E501 + :type: SearchResult + """ + + self._search_result = search_result + + @property + def errors(self): + """Gets the errors of this SearchItemsResponse. # noqa: E501 + + + :return: The errors of this SearchItemsResponse. # noqa: E501 + :rtype: list[ErrorData] + """ + return self._errors + + @errors.setter + def errors(self, errors): + """Sets the errors of this SearchItemsResponse. + + + :param errors: The errors of this SearchItemsResponse. # noqa: E501 + :type: list[ErrorData] + """ + + self._errors = errors + + 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(SearchItemsResponse, 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, SearchItemsResponse): + 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/paapi5_python_sdk/search_refinements.py b/paapi5_python_sdk/search_refinements.py new file mode 100644 index 0000000..fc54d3c --- /dev/null +++ b/paapi5_python_sdk/search_refinements.py @@ -0,0 +1,180 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.refinement import Refinement # noqa: F401,E501 + + +class SearchRefinements(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 = { + 'browse_node': 'Refinement', + 'other_refinements': 'list[Refinement]', + 'search_index': 'Refinement' + } + + attribute_map = { + 'browse_node': 'BrowseNode', + 'other_refinements': 'OtherRefinements', + 'search_index': 'SearchIndex' + } + + def __init__(self, browse_node=None, other_refinements=None, search_index=None): # noqa: E501 + """SearchRefinements - a model defined in Swagger""" # noqa: E501 + + self._browse_node = None + self._other_refinements = None + self._search_index = None + self.discriminator = None + + if browse_node is not None: + self.browse_node = browse_node + if other_refinements is not None: + self.other_refinements = other_refinements + if search_index is not None: + self.search_index = search_index + + @property + def browse_node(self): + """Gets the browse_node of this SearchRefinements. # noqa: E501 + + + :return: The browse_node of this SearchRefinements. # noqa: E501 + :rtype: Refinement + """ + return self._browse_node + + @browse_node.setter + def browse_node(self, browse_node): + """Sets the browse_node of this SearchRefinements. + + + :param browse_node: The browse_node of this SearchRefinements. # noqa: E501 + :type: Refinement + """ + + self._browse_node = browse_node + + @property + def other_refinements(self): + """Gets the other_refinements of this SearchRefinements. # noqa: E501 + + + :return: The other_refinements of this SearchRefinements. # noqa: E501 + :rtype: list[Refinement] + """ + return self._other_refinements + + @other_refinements.setter + def other_refinements(self, other_refinements): + """Sets the other_refinements of this SearchRefinements. + + + :param other_refinements: The other_refinements of this SearchRefinements. # noqa: E501 + :type: list[Refinement] + """ + + self._other_refinements = other_refinements + + @property + def search_index(self): + """Gets the search_index of this SearchRefinements. # noqa: E501 + + + :return: The search_index of this SearchRefinements. # noqa: E501 + :rtype: Refinement + """ + return self._search_index + + @search_index.setter + def search_index(self, search_index): + """Sets the search_index of this SearchRefinements. + + + :param search_index: The search_index of this SearchRefinements. # noqa: E501 + :type: Refinement + """ + + self._search_index = search_index + + 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(SearchRefinements, 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, SearchRefinements): + 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/paapi5_python_sdk/search_result.py b/paapi5_python_sdk/search_result.py new file mode 100644 index 0000000..bd94199 --- /dev/null +++ b/paapi5_python_sdk/search_result.py @@ -0,0 +1,207 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.item import Item # noqa: F401,E501 +from paapi5_python_sdk.search_refinements import SearchRefinements # noqa: F401,E501 + + +class SearchResult(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 = { + 'total_result_count': 'int', + 'search_url': 'str', + 'items': 'list[Item]', + 'search_refinements': 'SearchRefinements' + } + + attribute_map = { + 'total_result_count': 'TotalResultCount', + 'search_url': 'SearchURL', + 'items': 'Items', + 'search_refinements': 'SearchRefinements' + } + + def __init__(self, total_result_count=None, search_url=None, items=None, search_refinements=None): # noqa: E501 + """SearchResult - a model defined in Swagger""" # noqa: E501 + + self._total_result_count = None + self._search_url = None + self._items = None + self._search_refinements = None + self.discriminator = None + + if total_result_count is not None: + self.total_result_count = total_result_count + if search_url is not None: + self.search_url = search_url + if items is not None: + self.items = items + if search_refinements is not None: + self.search_refinements = search_refinements + + @property + def total_result_count(self): + """Gets the total_result_count of this SearchResult. # noqa: E501 + + + :return: The total_result_count of this SearchResult. # noqa: E501 + :rtype: int + """ + return self._total_result_count + + @total_result_count.setter + def total_result_count(self, total_result_count): + """Sets the total_result_count of this SearchResult. + + + :param total_result_count: The total_result_count of this SearchResult. # noqa: E501 + :type: int + """ + + self._total_result_count = total_result_count + + @property + def search_url(self): + """Gets the search_url of this SearchResult. # noqa: E501 + + + :return: The search_url of this SearchResult. # noqa: E501 + :rtype: str + """ + return self._search_url + + @search_url.setter + def search_url(self, search_url): + """Sets the search_url of this SearchResult. + + + :param search_url: The search_url of this SearchResult. # noqa: E501 + :type: str + """ + + self._search_url = search_url + + @property + def items(self): + """Gets the items of this SearchResult. # noqa: E501 + + + :return: The items of this SearchResult. # noqa: E501 + :rtype: list[Item] + """ + return self._items + + @items.setter + def items(self, items): + """Sets the items of this SearchResult. + + + :param items: The items of this SearchResult. # noqa: E501 + :type: list[Item] + """ + + self._items = items + + @property + def search_refinements(self): + """Gets the search_refinements of this SearchResult. # noqa: E501 + + + :return: The search_refinements of this SearchResult. # noqa: E501 + :rtype: SearchRefinements + """ + return self._search_refinements + + @search_refinements.setter + def search_refinements(self, search_refinements): + """Sets the search_refinements of this SearchResult. + + + :param search_refinements: The search_refinements of this SearchResult. # noqa: E501 + :type: SearchRefinements + """ + + self._search_refinements = search_refinements + + 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(SearchResult, 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, SearchResult): + 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/paapi5_python_sdk/single_boolean_valued_attribute.py b/paapi5_python_sdk/single_boolean_valued_attribute.py new file mode 100644 index 0000000..df043f6 --- /dev/null +++ b/paapi5_python_sdk/single_boolean_valued_attribute.py @@ -0,0 +1,178 @@ +# coding: utf-8 + +""" + Copyright 2019 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 SingleBooleanValuedAttribute(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 = { + 'display_value': 'bool', + 'label': 'str', + 'locale': 'str' + } + + attribute_map = { + 'display_value': 'DisplayValue', + 'label': 'Label', + 'locale': 'Locale' + } + + def __init__(self, display_value=None, label=None, locale=None): # noqa: E501 + """SingleBooleanValuedAttribute - a model defined in Swagger""" # noqa: E501 + + self._display_value = None + self._label = None + self._locale = None + self.discriminator = None + + if display_value is not None: + self.display_value = display_value + if label is not None: + self.label = label + if locale is not None: + self.locale = locale + + @property + def display_value(self): + """Gets the display_value of this SingleBooleanValuedAttribute. # noqa: E501 + + + :return: The display_value of this SingleBooleanValuedAttribute. # noqa: E501 + :rtype: bool + """ + return self._display_value + + @display_value.setter + def display_value(self, display_value): + """Sets the display_value of this SingleBooleanValuedAttribute. + + + :param display_value: The display_value of this SingleBooleanValuedAttribute. # noqa: E501 + :type: bool + """ + + self._display_value = display_value + + @property + def label(self): + """Gets the label of this SingleBooleanValuedAttribute. # noqa: E501 + + + :return: The label of this SingleBooleanValuedAttribute. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this SingleBooleanValuedAttribute. + + + :param label: The label of this SingleBooleanValuedAttribute. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def locale(self): + """Gets the locale of this SingleBooleanValuedAttribute. # noqa: E501 + + + :return: The locale of this SingleBooleanValuedAttribute. # noqa: E501 + :rtype: str + """ + return self._locale + + @locale.setter + def locale(self, locale): + """Sets the locale of this SingleBooleanValuedAttribute. + + + :param locale: The locale of this SingleBooleanValuedAttribute. # noqa: E501 + :type: str + """ + + self._locale = locale + + 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(SingleBooleanValuedAttribute, 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, SingleBooleanValuedAttribute): + 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/paapi5_python_sdk/single_integer_valued_attribute.py b/paapi5_python_sdk/single_integer_valued_attribute.py new file mode 100644 index 0000000..63b93e3 --- /dev/null +++ b/paapi5_python_sdk/single_integer_valued_attribute.py @@ -0,0 +1,178 @@ +# coding: utf-8 + +""" + Copyright 2019 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 SingleIntegerValuedAttribute(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 = { + 'display_value': 'int', + 'label': 'str', + 'locale': 'str' + } + + attribute_map = { + 'display_value': 'DisplayValue', + 'label': 'Label', + 'locale': 'Locale' + } + + def __init__(self, display_value=None, label=None, locale=None): # noqa: E501 + """SingleIntegerValuedAttribute - a model defined in Swagger""" # noqa: E501 + + self._display_value = None + self._label = None + self._locale = None + self.discriminator = None + + if display_value is not None: + self.display_value = display_value + if label is not None: + self.label = label + if locale is not None: + self.locale = locale + + @property + def display_value(self): + """Gets the display_value of this SingleIntegerValuedAttribute. # noqa: E501 + + + :return: The display_value of this SingleIntegerValuedAttribute. # noqa: E501 + :rtype: int + """ + return self._display_value + + @display_value.setter + def display_value(self, display_value): + """Sets the display_value of this SingleIntegerValuedAttribute. + + + :param display_value: The display_value of this SingleIntegerValuedAttribute. # noqa: E501 + :type: int + """ + + self._display_value = display_value + + @property + def label(self): + """Gets the label of this SingleIntegerValuedAttribute. # noqa: E501 + + + :return: The label of this SingleIntegerValuedAttribute. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this SingleIntegerValuedAttribute. + + + :param label: The label of this SingleIntegerValuedAttribute. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def locale(self): + """Gets the locale of this SingleIntegerValuedAttribute. # noqa: E501 + + + :return: The locale of this SingleIntegerValuedAttribute. # noqa: E501 + :rtype: str + """ + return self._locale + + @locale.setter + def locale(self, locale): + """Sets the locale of this SingleIntegerValuedAttribute. + + + :param locale: The locale of this SingleIntegerValuedAttribute. # noqa: E501 + :type: str + """ + + self._locale = locale + + 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(SingleIntegerValuedAttribute, 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, SingleIntegerValuedAttribute): + 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/paapi5_python_sdk/single_string_valued_attribute.py b/paapi5_python_sdk/single_string_valued_attribute.py new file mode 100644 index 0000000..e217d62 --- /dev/null +++ b/paapi5_python_sdk/single_string_valued_attribute.py @@ -0,0 +1,178 @@ +# coding: utf-8 + +""" + Copyright 2019 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 SingleStringValuedAttribute(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 = { + 'display_value': 'str', + 'label': 'str', + 'locale': 'str' + } + + attribute_map = { + 'display_value': 'DisplayValue', + 'label': 'Label', + 'locale': 'Locale' + } + + def __init__(self, display_value=None, label=None, locale=None): # noqa: E501 + """SingleStringValuedAttribute - a model defined in Swagger""" # noqa: E501 + + self._display_value = None + self._label = None + self._locale = None + self.discriminator = None + + if display_value is not None: + self.display_value = display_value + if label is not None: + self.label = label + if locale is not None: + self.locale = locale + + @property + def display_value(self): + """Gets the display_value of this SingleStringValuedAttribute. # noqa: E501 + + + :return: The display_value of this SingleStringValuedAttribute. # noqa: E501 + :rtype: str + """ + return self._display_value + + @display_value.setter + def display_value(self, display_value): + """Sets the display_value of this SingleStringValuedAttribute. + + + :param display_value: The display_value of this SingleStringValuedAttribute. # noqa: E501 + :type: str + """ + + self._display_value = display_value + + @property + def label(self): + """Gets the label of this SingleStringValuedAttribute. # noqa: E501 + + + :return: The label of this SingleStringValuedAttribute. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this SingleStringValuedAttribute. + + + :param label: The label of this SingleStringValuedAttribute. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def locale(self): + """Gets the locale of this SingleStringValuedAttribute. # noqa: E501 + + + :return: The locale of this SingleStringValuedAttribute. # noqa: E501 + :rtype: str + """ + return self._locale + + @locale.setter + def locale(self, locale): + """Sets the locale of this SingleStringValuedAttribute. + + + :param locale: The locale of this SingleStringValuedAttribute. # noqa: E501 + :type: str + """ + + self._locale = locale + + 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(SingleStringValuedAttribute, 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, SingleStringValuedAttribute): + 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/paapi5_python_sdk/sort_by.py b/paapi5_python_sdk/sort_by.py new file mode 100644 index 0000000..33f8312 --- /dev/null +++ b/paapi5_python_sdk/sort_by.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Copyright 2019 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 SortBy(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + AVGCUSTOMERREVIEWS = "AvgCustomerReviews" + FEATURED = "Featured" + NEWESTARRIVALS = "NewestArrivals" + PRICE_HIGHTOLOW = "Price:HighToLow" + PRICE_LOWTOHIGH = "Price:LowToHigh" + RELEVANCE = "Relevance" + + """ + 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 + """SortBy - 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(SortBy, 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, SortBy): + 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/paapi5_python_sdk/technical_info.py b/paapi5_python_sdk/technical_info.py new file mode 100644 index 0000000..c70d5b6 --- /dev/null +++ b/paapi5_python_sdk/technical_info.py @@ -0,0 +1,128 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.multi_valued_attribute import MultiValuedAttribute # noqa: F401,E501 + + +class TechnicalInfo(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 = { + 'formats': 'MultiValuedAttribute' + } + + attribute_map = { + 'formats': 'Formats' + } + + def __init__(self, formats=None): # noqa: E501 + """TechnicalInfo - a model defined in Swagger""" # noqa: E501 + + self._formats = None + self.discriminator = None + + if formats is not None: + self.formats = formats + + @property + def formats(self): + """Gets the formats of this TechnicalInfo. # noqa: E501 + + + :return: The formats of this TechnicalInfo. # noqa: E501 + :rtype: MultiValuedAttribute + """ + return self._formats + + @formats.setter + def formats(self, formats): + """Sets the formats of this TechnicalInfo. + + + :param formats: The formats of this TechnicalInfo. # noqa: E501 + :type: MultiValuedAttribute + """ + + self._formats = formats + + 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(TechnicalInfo, 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, TechnicalInfo): + 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/paapi5_python_sdk/trade_in_info.py b/paapi5_python_sdk/trade_in_info.py new file mode 100644 index 0000000..5c54e5f --- /dev/null +++ b/paapi5_python_sdk/trade_in_info.py @@ -0,0 +1,154 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.trade_in_price import TradeInPrice # noqa: F401,E501 + + +class TradeInInfo(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 = { + 'is_eligible_for_trade_in': 'bool', + 'price': 'TradeInPrice' + } + + attribute_map = { + 'is_eligible_for_trade_in': 'IsEligibleForTradeIn', + 'price': 'Price' + } + + def __init__(self, is_eligible_for_trade_in=None, price=None): # noqa: E501 + """TradeInInfo - a model defined in Swagger""" # noqa: E501 + + self._is_eligible_for_trade_in = None + self._price = None + self.discriminator = None + + if is_eligible_for_trade_in is not None: + self.is_eligible_for_trade_in = is_eligible_for_trade_in + if price is not None: + self.price = price + + @property + def is_eligible_for_trade_in(self): + """Gets the is_eligible_for_trade_in of this TradeInInfo. # noqa: E501 + + + :return: The is_eligible_for_trade_in of this TradeInInfo. # noqa: E501 + :rtype: bool + """ + return self._is_eligible_for_trade_in + + @is_eligible_for_trade_in.setter + def is_eligible_for_trade_in(self, is_eligible_for_trade_in): + """Sets the is_eligible_for_trade_in of this TradeInInfo. + + + :param is_eligible_for_trade_in: The is_eligible_for_trade_in of this TradeInInfo. # noqa: E501 + :type: bool + """ + + self._is_eligible_for_trade_in = is_eligible_for_trade_in + + @property + def price(self): + """Gets the price of this TradeInInfo. # noqa: E501 + + + :return: The price of this TradeInInfo. # noqa: E501 + :rtype: TradeInPrice + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this TradeInInfo. + + + :param price: The price of this TradeInInfo. # noqa: E501 + :type: TradeInPrice + """ + + self._price = price + + 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(TradeInInfo, 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, TradeInInfo): + 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/paapi5_python_sdk/trade_in_price.py b/paapi5_python_sdk/trade_in_price.py new file mode 100644 index 0000000..3e968e5 --- /dev/null +++ b/paapi5_python_sdk/trade_in_price.py @@ -0,0 +1,178 @@ +# coding: utf-8 + +""" + Copyright 2019 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 TradeInPrice(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': 'float', + '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 + """TradeInPrice - 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 TradeInPrice. # noqa: E501 + + + :return: The amount of this TradeInPrice. # noqa: E501 + :rtype: float + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this TradeInPrice. + + + :param amount: The amount of this TradeInPrice. # noqa: E501 + :type: float + """ + + self._amount = amount + + @property + def currency(self): + """Gets the currency of this TradeInPrice. # noqa: E501 + + + :return: The currency of this TradeInPrice. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this TradeInPrice. + + + :param currency: The currency of this TradeInPrice. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def display_amount(self): + """Gets the display_amount of this TradeInPrice. # noqa: E501 + + + :return: The display_amount of this TradeInPrice. # noqa: E501 + :rtype: str + """ + return self._display_amount + + @display_amount.setter + def display_amount(self, display_amount): + """Sets the display_amount of this TradeInPrice. + + + :param display_amount: The display_amount of this TradeInPrice. # 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(TradeInPrice, 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, TradeInPrice): + 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/paapi5_python_sdk/unit_based_attribute.py b/paapi5_python_sdk/unit_based_attribute.py new file mode 100644 index 0000000..19e5f31 --- /dev/null +++ b/paapi5_python_sdk/unit_based_attribute.py @@ -0,0 +1,204 @@ +# coding: utf-8 + +""" + Copyright 2019 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 UnitBasedAttribute(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 = { + 'display_value': 'float', + 'label': 'str', + 'locale': 'str', + 'unit': 'str' + } + + attribute_map = { + 'display_value': 'DisplayValue', + 'label': 'Label', + 'locale': 'Locale', + 'unit': 'Unit' + } + + def __init__(self, display_value=None, label=None, locale=None, unit=None): # noqa: E501 + """UnitBasedAttribute - a model defined in Swagger""" # noqa: E501 + + self._display_value = None + self._label = None + self._locale = None + self._unit = None + self.discriminator = None + + if display_value is not None: + self.display_value = display_value + if label is not None: + self.label = label + if locale is not None: + self.locale = locale + if unit is not None: + self.unit = unit + + @property + def display_value(self): + """Gets the display_value of this UnitBasedAttribute. # noqa: E501 + + + :return: The display_value of this UnitBasedAttribute. # noqa: E501 + :rtype: float + """ + return self._display_value + + @display_value.setter + def display_value(self, display_value): + """Sets the display_value of this UnitBasedAttribute. + + + :param display_value: The display_value of this UnitBasedAttribute. # noqa: E501 + :type: float + """ + + self._display_value = display_value + + @property + def label(self): + """Gets the label of this UnitBasedAttribute. # noqa: E501 + + + :return: The label of this UnitBasedAttribute. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this UnitBasedAttribute. + + + :param label: The label of this UnitBasedAttribute. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def locale(self): + """Gets the locale of this UnitBasedAttribute. # noqa: E501 + + + :return: The locale of this UnitBasedAttribute. # noqa: E501 + :rtype: str + """ + return self._locale + + @locale.setter + def locale(self, locale): + """Sets the locale of this UnitBasedAttribute. + + + :param locale: The locale of this UnitBasedAttribute. # noqa: E501 + :type: str + """ + + self._locale = locale + + @property + def unit(self): + """Gets the unit of this UnitBasedAttribute. # noqa: E501 + + + :return: The unit of this UnitBasedAttribute. # noqa: E501 + :rtype: str + """ + return self._unit + + @unit.setter + def unit(self, unit): + """Sets the unit of this UnitBasedAttribute. + + + :param unit: The unit of this UnitBasedAttribute. # noqa: E501 + :type: str + """ + + self._unit = unit + + 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(UnitBasedAttribute, 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, UnitBasedAttribute): + 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/paapi5_python_sdk/variation_attribute.py b/paapi5_python_sdk/variation_attribute.py new file mode 100644 index 0000000..1173e3d --- /dev/null +++ b/paapi5_python_sdk/variation_attribute.py @@ -0,0 +1,152 @@ +# coding: utf-8 + +""" + Copyright 2019 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 VariationAttribute(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', + 'value': 'str' + } + + attribute_map = { + 'name': 'Name', + 'value': 'Value' + } + + def __init__(self, name=None, value=None): # noqa: E501 + """VariationAttribute - a model defined in Swagger""" # noqa: E501 + + self._name = None + self._value = None + self.discriminator = None + + if name is not None: + self.name = name + if value is not None: + self.value = value + + @property + def name(self): + """Gets the name of this VariationAttribute. # noqa: E501 + + + :return: The name of this VariationAttribute. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this VariationAttribute. + + + :param name: The name of this VariationAttribute. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def value(self): + """Gets the value of this VariationAttribute. # noqa: E501 + + + :return: The value of this VariationAttribute. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this VariationAttribute. + + + :param value: The value of this VariationAttribute. # noqa: E501 + :type: str + """ + + self._value = value + + 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(VariationAttribute, 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, VariationAttribute): + 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/paapi5_python_sdk/variation_dimension.py b/paapi5_python_sdk/variation_dimension.py new file mode 100644 index 0000000..8ff9e86 --- /dev/null +++ b/paapi5_python_sdk/variation_dimension.py @@ -0,0 +1,204 @@ +# coding: utf-8 + +""" + Copyright 2019 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 VariationDimension(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 = { + 'display_name': 'str', + 'locale': 'str', + 'name': 'str', + 'values': 'list[str]' + } + + attribute_map = { + 'display_name': 'DisplayName', + 'locale': 'Locale', + 'name': 'Name', + 'values': 'Values' + } + + def __init__(self, display_name=None, locale=None, name=None, values=None): # noqa: E501 + """VariationDimension - a model defined in Swagger""" # noqa: E501 + + self._display_name = None + self._locale = None + self._name = None + self._values = None + self.discriminator = None + + if display_name is not None: + self.display_name = display_name + if locale is not None: + self.locale = locale + if name is not None: + self.name = name + if values is not None: + self.values = values + + @property + def display_name(self): + """Gets the display_name of this VariationDimension. # noqa: E501 + + + :return: The display_name of this VariationDimension. # noqa: E501 + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """Sets the display_name of this VariationDimension. + + + :param display_name: The display_name of this VariationDimension. # noqa: E501 + :type: str + """ + + self._display_name = display_name + + @property + def locale(self): + """Gets the locale of this VariationDimension. # noqa: E501 + + + :return: The locale of this VariationDimension. # noqa: E501 + :rtype: str + """ + return self._locale + + @locale.setter + def locale(self, locale): + """Sets the locale of this VariationDimension. + + + :param locale: The locale of this VariationDimension. # noqa: E501 + :type: str + """ + + self._locale = locale + + @property + def name(self): + """Gets the name of this VariationDimension. # noqa: E501 + + + :return: The name of this VariationDimension. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this VariationDimension. + + + :param name: The name of this VariationDimension. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def values(self): + """Gets the values of this VariationDimension. # noqa: E501 + + + :return: The values of this VariationDimension. # noqa: E501 + :rtype: list[str] + """ + return self._values + + @values.setter + def values(self, values): + """Sets the values of this VariationDimension. + + + :param values: The values of this VariationDimension. # noqa: E501 + :type: list[str] + """ + + self._values = values + + 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(VariationDimension, 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, VariationDimension): + 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/paapi5_python_sdk/variation_summary.py b/paapi5_python_sdk/variation_summary.py new file mode 100644 index 0000000..a5a0e8e --- /dev/null +++ b/paapi5_python_sdk/variation_summary.py @@ -0,0 +1,207 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.price import Price # noqa: F401,E501 +from paapi5_python_sdk.variation_dimension import VariationDimension # noqa: F401,E501 + + +class VariationSummary(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 = { + 'page_count': 'int', + 'price': 'Price', + 'variation_count': 'int', + 'variation_dimensions': 'list[VariationDimension]' + } + + attribute_map = { + 'page_count': 'PageCount', + 'price': 'Price', + 'variation_count': 'VariationCount', + 'variation_dimensions': 'VariationDimensions' + } + + def __init__(self, page_count=None, price=None, variation_count=None, variation_dimensions=None): # noqa: E501 + """VariationSummary - a model defined in Swagger""" # noqa: E501 + + self._page_count = None + self._price = None + self._variation_count = None + self._variation_dimensions = None + self.discriminator = None + + if page_count is not None: + self.page_count = page_count + if price is not None: + self.price = price + if variation_count is not None: + self.variation_count = variation_count + if variation_dimensions is not None: + self.variation_dimensions = variation_dimensions + + @property + def page_count(self): + """Gets the page_count of this VariationSummary. # noqa: E501 + + + :return: The page_count of this VariationSummary. # noqa: E501 + :rtype: int + """ + return self._page_count + + @page_count.setter + def page_count(self, page_count): + """Sets the page_count of this VariationSummary. + + + :param page_count: The page_count of this VariationSummary. # noqa: E501 + :type: int + """ + + self._page_count = page_count + + @property + def price(self): + """Gets the price of this VariationSummary. # noqa: E501 + + + :return: The price of this VariationSummary. # noqa: E501 + :rtype: Price + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this VariationSummary. + + + :param price: The price of this VariationSummary. # noqa: E501 + :type: Price + """ + + self._price = price + + @property + def variation_count(self): + """Gets the variation_count of this VariationSummary. # noqa: E501 + + + :return: The variation_count of this VariationSummary. # noqa: E501 + :rtype: int + """ + return self._variation_count + + @variation_count.setter + def variation_count(self, variation_count): + """Sets the variation_count of this VariationSummary. + + + :param variation_count: The variation_count of this VariationSummary. # noqa: E501 + :type: int + """ + + self._variation_count = variation_count + + @property + def variation_dimensions(self): + """Gets the variation_dimensions of this VariationSummary. # noqa: E501 + + + :return: The variation_dimensions of this VariationSummary. # noqa: E501 + :rtype: list[VariationDimension] + """ + return self._variation_dimensions + + @variation_dimensions.setter + def variation_dimensions(self, variation_dimensions): + """Sets the variation_dimensions of this VariationSummary. + + + :param variation_dimensions: The variation_dimensions of this VariationSummary. # noqa: E501 + :type: list[VariationDimension] + """ + + self._variation_dimensions = variation_dimensions + + 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(VariationSummary, 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, VariationSummary): + 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/paapi5_python_sdk/variations_result.py b/paapi5_python_sdk/variations_result.py new file mode 100644 index 0000000..0f3206a --- /dev/null +++ b/paapi5_python_sdk/variations_result.py @@ -0,0 +1,155 @@ +# coding: utf-8 + +""" + Copyright 2019 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 paapi5_python_sdk.item import Item # noqa: F401,E501 +from paapi5_python_sdk.variation_summary import VariationSummary # noqa: F401,E501 + + +class VariationsResult(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 = { + 'items': 'list[Item]', + 'variation_summary': 'VariationSummary' + } + + attribute_map = { + 'items': 'Items', + 'variation_summary': 'VariationSummary' + } + + def __init__(self, items=None, variation_summary=None): # noqa: E501 + """VariationsResult - a model defined in Swagger""" # noqa: E501 + + self._items = None + self._variation_summary = None + self.discriminator = None + + if items is not None: + self.items = items + if variation_summary is not None: + self.variation_summary = variation_summary + + @property + def items(self): + """Gets the items of this VariationsResult. # noqa: E501 + + + :return: The items of this VariationsResult. # noqa: E501 + :rtype: list[Item] + """ + return self._items + + @items.setter + def items(self, items): + """Sets the items of this VariationsResult. + + + :param items: The items of this VariationsResult. # noqa: E501 + :type: list[Item] + """ + + self._items = items + + @property + def variation_summary(self): + """Gets the variation_summary of this VariationsResult. # noqa: E501 + + + :return: The variation_summary of this VariationsResult. # noqa: E501 + :rtype: VariationSummary + """ + return self._variation_summary + + @variation_summary.setter + def variation_summary(self, variation_summary): + """Sets the variation_summary of this VariationsResult. + + + :param variation_summary: The variation_summary of this VariationsResult. # noqa: E501 + :type: VariationSummary + """ + + self._variation_summary = variation_summary + + 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(VariationsResult, 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, VariationsResult): + 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/paapi5_python_sdk/website_sales_rank.py b/paapi5_python_sdk/website_sales_rank.py new file mode 100644 index 0000000..da92d28 --- /dev/null +++ b/paapi5_python_sdk/website_sales_rank.py @@ -0,0 +1,204 @@ +# coding: utf-8 + +""" + Copyright 2019 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 WebsiteSalesRank(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 = { + 'context_free_name': 'str', + 'display_name': 'str', + 'id': 'str', + 'sales_rank': 'int' + } + + attribute_map = { + 'context_free_name': 'ContextFreeName', + 'display_name': 'DisplayName', + 'id': 'Id', + 'sales_rank': 'SalesRank' + } + + def __init__(self, context_free_name=None, display_name=None, id=None, sales_rank=None): # noqa: E501 + """WebsiteSalesRank - a model defined in Swagger""" # noqa: E501 + + self._context_free_name = None + self._display_name = None + self._id = None + self._sales_rank = None + self.discriminator = None + + if context_free_name is not None: + self.context_free_name = context_free_name + if display_name is not None: + self.display_name = display_name + if id is not None: + self.id = id + if sales_rank is not None: + self.sales_rank = sales_rank + + @property + def context_free_name(self): + """Gets the context_free_name of this WebsiteSalesRank. # noqa: E501 + + + :return: The context_free_name of this WebsiteSalesRank. # noqa: E501 + :rtype: str + """ + return self._context_free_name + + @context_free_name.setter + def context_free_name(self, context_free_name): + """Sets the context_free_name of this WebsiteSalesRank. + + + :param context_free_name: The context_free_name of this WebsiteSalesRank. # noqa: E501 + :type: str + """ + + self._context_free_name = context_free_name + + @property + def display_name(self): + """Gets the display_name of this WebsiteSalesRank. # noqa: E501 + + + :return: The display_name of this WebsiteSalesRank. # noqa: E501 + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """Sets the display_name of this WebsiteSalesRank. + + + :param display_name: The display_name of this WebsiteSalesRank. # noqa: E501 + :type: str + """ + + self._display_name = display_name + + @property + def id(self): + """Gets the id of this WebsiteSalesRank. # noqa: E501 + + + :return: The id of this WebsiteSalesRank. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this WebsiteSalesRank. + + + :param id: The id of this WebsiteSalesRank. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def sales_rank(self): + """Gets the sales_rank of this WebsiteSalesRank. # noqa: E501 + + + :return: The sales_rank of this WebsiteSalesRank. # noqa: E501 + :rtype: int + """ + return self._sales_rank + + @sales_rank.setter + def sales_rank(self, sales_rank): + """Sets the sales_rank of this WebsiteSalesRank. + + + :param sales_rank: The sales_rank of this WebsiteSalesRank. # noqa: E501 + :type: int + """ + + self._sales_rank = sales_rank + + 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(WebsiteSalesRank, 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, WebsiteSalesRank): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other From 24b56ac0e6ad242a368cb5ae7d3b962dcc9004db Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Tue, 13 Jul 2021 19:24:02 +0200 Subject: [PATCH 61/67] Updated SDK to relative imports --- amazon_paapi/sdk/__init__.py | 184 +++++++++--------- amazon_paapi/sdk/api/__init__.py | 2 +- amazon_paapi/sdk/api/default_api.py | 2 +- amazon_paapi/sdk/api_client.py | 10 +- amazon_paapi/sdk/auth/__init__.py | 2 +- amazon_paapi/sdk/models/__init__.py | 176 ++++++++--------- amazon_paapi/sdk/models/browse_node.py | 4 +- amazon_paapi/sdk/models/browse_node_info.py | 4 +- .../sdk/models/browse_nodes_result.py | 2 +- amazon_paapi/sdk/models/by_line_info.py | 4 +- amazon_paapi/sdk/models/classifications.py | 2 +- amazon_paapi/sdk/models/content_info.py | 6 +- amazon_paapi/sdk/models/content_rating.py | 2 +- amazon_paapi/sdk/models/customer_reviews.py | 2 +- .../sdk/models/dimension_based_attribute.py | 2 +- amazon_paapi/sdk/models/duration_price.py | 4 +- amazon_paapi/sdk/models/external_ids.py | 2 +- .../sdk/models/get_browse_nodes_request.py | 4 +- .../sdk/models/get_browse_nodes_response.py | 4 +- amazon_paapi/sdk/models/get_items_request.py | 14 +- amazon_paapi/sdk/models/get_items_response.py | 4 +- .../sdk/models/get_variations_request.py | 12 +- .../sdk/models/get_variations_response.py | 4 +- amazon_paapi/sdk/models/image_type.py | 2 +- amazon_paapi/sdk/models/images.py | 2 +- amazon_paapi/sdk/models/item.py | 14 +- amazon_paapi/sdk/models/item_info.py | 22 +-- amazon_paapi/sdk/models/items_result.py | 2 +- amazon_paapi/sdk/models/languages.py | 2 +- amazon_paapi/sdk/models/manufacture_info.py | 2 +- amazon_paapi/sdk/models/offer_condition.py | 4 +- .../sdk/models/offer_delivery_info.py | 2 +- amazon_paapi/sdk/models/offer_listing.py | 16 +- amazon_paapi/sdk/models/offer_price.py | 2 +- amazon_paapi/sdk/models/offer_summary.py | 4 +- amazon_paapi/sdk/models/offers.py | 4 +- amazon_paapi/sdk/models/price.py | 2 +- ...roduct_advertising_api_client_exception.py | 2 +- amazon_paapi/sdk/models/product_info.py | 8 +- amazon_paapi/sdk/models/refinement.py | 2 +- .../sdk/models/rental_offer_listing.py | 10 +- amazon_paapi/sdk/models/rental_offers.py | 2 +- .../sdk/models/search_items_request.py | 26 +-- .../sdk/models/search_items_response.py | 4 +- amazon_paapi/sdk/models/search_refinements.py | 2 +- amazon_paapi/sdk/models/search_result.py | 4 +- amazon_paapi/sdk/models/technical_info.py | 4 +- amazon_paapi/sdk/models/trade_in_info.py | 2 +- amazon_paapi/sdk/models/variation_summary.py | 4 +- amazon_paapi/sdk/models/variations_result.py | 4 +- 50 files changed, 303 insertions(+), 303 deletions(-) diff --git a/amazon_paapi/sdk/__init__.py b/amazon_paapi/sdk/__init__.py index 5766fac..1b3c58b 100644 --- a/amazon_paapi/sdk/__init__.py +++ b/amazon_paapi/sdk/__init__.py @@ -27,101 +27,101 @@ # import auth into sdk package -from amazon_paapi.sdk.auth.sign_helper import AWSV4Auth +from .auth.sign_helper import AWSV4Auth # import apis into sdk package -from amazon_paapi.sdk.api.default_api import DefaultApi +from .api.default_api import DefaultApi # import ApiClient -from amazon_paapi.sdk.api_client import ApiClient -from amazon_paapi.sdk.configuration import Configuration +from .api_client import ApiClient +from .configuration import Configuration # import models into sdk package -from amazon_paapi.sdk.models.availability import Availability -from amazon_paapi.sdk.models.browse_node import BrowseNode -from amazon_paapi.sdk.models.browse_node_ancestor import BrowseNodeAncestor -from amazon_paapi.sdk.models.browse_node_child import BrowseNodeChild -from amazon_paapi.sdk.models.browse_node_info import BrowseNodeInfo -from amazon_paapi.sdk.models.browse_nodes_result import BrowseNodesResult -from amazon_paapi.sdk.models.by_line_info import ByLineInfo -from amazon_paapi.sdk.models.classifications import Classifications -from amazon_paapi.sdk.models.condition import Condition -from amazon_paapi.sdk.models.content_info import ContentInfo -from amazon_paapi.sdk.models.content_rating import ContentRating -from amazon_paapi.sdk.models.contributor import Contributor -from amazon_paapi.sdk.models.customer_reviews import CustomerReviews -from amazon_paapi.sdk.models.delivery_flag import DeliveryFlag -from amazon_paapi.sdk.models.dimension_based_attribute import DimensionBasedAttribute -from amazon_paapi.sdk.models.duration_price import DurationPrice -from amazon_paapi.sdk.models.error_data import ErrorData -from amazon_paapi.sdk.models.external_ids import ExternalIds -from amazon_paapi.sdk.models.get_browse_nodes_request import GetBrowseNodesRequest -from amazon_paapi.sdk.models.get_browse_nodes_resource import GetBrowseNodesResource -from amazon_paapi.sdk.models.get_browse_nodes_response import GetBrowseNodesResponse -from amazon_paapi.sdk.models.get_items_request import GetItemsRequest -from amazon_paapi.sdk.models.get_items_resource import GetItemsResource -from amazon_paapi.sdk.models.get_items_response import GetItemsResponse -from amazon_paapi.sdk.models.get_variations_request import GetVariationsRequest -from amazon_paapi.sdk.models.get_variations_resource import GetVariationsResource -from amazon_paapi.sdk.models.get_variations_response import GetVariationsResponse -from amazon_paapi.sdk.models.image_size import ImageSize -from amazon_paapi.sdk.models.image_type import ImageType -from amazon_paapi.sdk.models.images import Images -from amazon_paapi.sdk.models.item import Item -from amazon_paapi.sdk.models.item_id_type import ItemIdType -from amazon_paapi.sdk.models.item_info import ItemInfo -from amazon_paapi.sdk.models.items_result import ItemsResult -from amazon_paapi.sdk.models.language_type import LanguageType -from amazon_paapi.sdk.models.languages import Languages -from amazon_paapi.sdk.models.manufacture_info import ManufactureInfo -from amazon_paapi.sdk.models.max_price import MaxPrice -from amazon_paapi.sdk.models.merchant import Merchant -from amazon_paapi.sdk.models.min_price import MinPrice -from amazon_paapi.sdk.models.min_reviews_rating import MinReviewsRating -from amazon_paapi.sdk.models.min_saving_percent import MinSavingPercent -from amazon_paapi.sdk.models.multi_valued_attribute import MultiValuedAttribute -from amazon_paapi.sdk.models.offer_availability import OfferAvailability -from amazon_paapi.sdk.models.offer_condition import OfferCondition -from amazon_paapi.sdk.models.offer_condition_note import OfferConditionNote -from amazon_paapi.sdk.models.offer_count import OfferCount -from amazon_paapi.sdk.models.offer_delivery_info import OfferDeliveryInfo -from amazon_paapi.sdk.models.offer_listing import OfferListing -from amazon_paapi.sdk.models.offer_loyalty_points import OfferLoyaltyPoints -from amazon_paapi.sdk.models.offer_merchant_info import OfferMerchantInfo -from amazon_paapi.sdk.models.offer_price import OfferPrice -from amazon_paapi.sdk.models.offer_program_eligibility import OfferProgramEligibility -from amazon_paapi.sdk.models.offer_promotion import OfferPromotion -from amazon_paapi.sdk.models.offer_savings import OfferSavings -from amazon_paapi.sdk.models.offer_shipping_charge import OfferShippingCharge -from amazon_paapi.sdk.models.offer_sub_condition import OfferSubCondition -from amazon_paapi.sdk.models.offer_summary import OfferSummary -from amazon_paapi.sdk.models.offers import Offers -from amazon_paapi.sdk.models.partner_type import PartnerType -from amazon_paapi.sdk.models.price import Price -from amazon_paapi.sdk.models.product_advertising_api_client_exception import ProductAdvertisingAPIClientException -from amazon_paapi.sdk.models.product_advertising_api_service_exception import ProductAdvertisingAPIServiceException -from amazon_paapi.sdk.models.product_info import ProductInfo -from amazon_paapi.sdk.models.properties import Properties -from amazon_paapi.sdk.models.rating import Rating -from amazon_paapi.sdk.models.refinement import Refinement -from amazon_paapi.sdk.models.refinement_bin import RefinementBin -from amazon_paapi.sdk.models.rental_offer_listing import RentalOfferListing -from amazon_paapi.sdk.models.rental_offers import RentalOffers -from amazon_paapi.sdk.models.search_items_request import SearchItemsRequest -from amazon_paapi.sdk.models.search_items_resource import SearchItemsResource -from amazon_paapi.sdk.models.search_items_response import SearchItemsResponse -from amazon_paapi.sdk.models.search_refinements import SearchRefinements -from amazon_paapi.sdk.models.search_result import SearchResult -from amazon_paapi.sdk.models.single_boolean_valued_attribute import SingleBooleanValuedAttribute -from amazon_paapi.sdk.models.single_integer_valued_attribute import SingleIntegerValuedAttribute -from amazon_paapi.sdk.models.single_string_valued_attribute import SingleStringValuedAttribute -from amazon_paapi.sdk.models.sort_by import SortBy -from amazon_paapi.sdk.models.technical_info import TechnicalInfo -from amazon_paapi.sdk.models.trade_in_info import TradeInInfo -from amazon_paapi.sdk.models.trade_in_price import TradeInPrice -from amazon_paapi.sdk.models.unit_based_attribute import UnitBasedAttribute -from amazon_paapi.sdk.models.variation_attribute import VariationAttribute -from amazon_paapi.sdk.models.variation_dimension import VariationDimension -from amazon_paapi.sdk.models.variation_summary import VariationSummary -from amazon_paapi.sdk.models.variations_result import VariationsResult -from amazon_paapi.sdk.models.website_sales_rank import WebsiteSalesRank +from .models.availability import Availability +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.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.multi_valued_attribute import MultiValuedAttribute +from .models.offer_availability import OfferAvailability +from .models.offer_condition import OfferCondition +from .models.offer_condition_note import OfferConditionNote +from .models.offer_count import OfferCount +from .models.offer_delivery_info import OfferDeliveryInfo +from .models.offer_listing import OfferListing +from .models.offer_loyalty_points import OfferLoyaltyPoints +from .models.offer_merchant_info import OfferMerchantInfo +from .models.offer_price import OfferPrice +from .models.offer_program_eligibility import OfferProgramEligibility +from .models.offer_promotion import OfferPromotion +from .models.offer_savings import OfferSavings +from .models.offer_shipping_charge import OfferShippingCharge +from .models.offer_sub_condition import OfferSubCondition +from .models.offer_summary import OfferSummary +from .models.offers import Offers +from .models.partner_type import PartnerType +from .models.price import Price +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.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/api/__init__.py b/amazon_paapi/sdk/api/__init__.py index ff86583..0597bfa 100644 --- a/amazon_paapi/sdk/api/__init__.py +++ b/amazon_paapi/sdk/api/__init__.py @@ -27,4 +27,4 @@ # import apis into api package -from amazon_paapi.sdk.api.default_api import DefaultApi +from .default_api import DefaultApi diff --git a/amazon_paapi/sdk/api/default_api.py b/amazon_paapi/sdk/api/default_api.py index c4e8611..ebcd6cb 100644 --- a/amazon_paapi/sdk/api/default_api.py +++ b/amazon_paapi/sdk/api/default_api.py @@ -31,7 +31,7 @@ # python 2 and python 3 compatibility library import six -from amazon_paapi.sdk.api_client import ApiClient +from ..api_client import ApiClient class DefaultApi(object): diff --git a/amazon_paapi/sdk/api_client.py b/amazon_paapi/sdk/api_client.py index 8046413..e14223e 100644 --- a/amazon_paapi/sdk/api_client.py +++ b/amazon_paapi/sdk/api_client.py @@ -37,11 +37,11 @@ import six from six.moves.urllib.parse import quote -from amazon_paapi.sdk.configuration import Configuration -import amazon_paapi.sdk.models -from amazon_paapi.sdk import rest +from .configuration import Configuration +from . import models +from . import rest -from amazon_paapi.sdk.auth.sign_helper import AWSV4Auth +from .auth.sign_helper import AWSV4Auth class ApiClient(object): """Generic API client for Swagger client library builds. @@ -288,7 +288,7 @@ def __deserialize(self, data, klass): if klass in self.NATIVE_TYPES_MAPPING: klass = self.NATIVE_TYPES_MAPPING[klass] else: - klass = getattr(amazon_paapi.sdk.models, klass) + klass = getattr(models, klass) if klass in self.PRIMITIVE_TYPES: return self.__deserialize_primitive(data, klass) diff --git a/amazon_paapi/sdk/auth/__init__.py b/amazon_paapi/sdk/auth/__init__.py index 7bc1b04..cc76d25 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 amazon_paapi.sdk.auth.sign_helper import AWSV4Auth +from .sign_helper import AWSV4Auth diff --git a/amazon_paapi/sdk/models/__init__.py b/amazon_paapi/sdk/models/__init__.py index 4a5adae..89a1004 100644 --- a/amazon_paapi/sdk/models/__init__.py +++ b/amazon_paapi/sdk/models/__init__.py @@ -27,91 +27,91 @@ # import models into model package -from amazon_paapi.sdk.models.availability import Availability -from amazon_paapi.sdk.models.browse_node import BrowseNode -from amazon_paapi.sdk.models.browse_node_ancestor import BrowseNodeAncestor -from amazon_paapi.sdk.models.browse_node_child import BrowseNodeChild -from amazon_paapi.sdk.models.browse_node_info import BrowseNodeInfo -from amazon_paapi.sdk.models.browse_nodes_result import BrowseNodesResult -from amazon_paapi.sdk.models.by_line_info import ByLineInfo -from amazon_paapi.sdk.models.classifications import Classifications -from amazon_paapi.sdk.models.condition import Condition -from amazon_paapi.sdk.models.content_info import ContentInfo -from amazon_paapi.sdk.models.content_rating import ContentRating -from amazon_paapi.sdk.models.contributor import Contributor -from amazon_paapi.sdk.models.customer_reviews import CustomerReviews -from amazon_paapi.sdk.models.delivery_flag import DeliveryFlag -from amazon_paapi.sdk.models.dimension_based_attribute import DimensionBasedAttribute -from amazon_paapi.sdk.models.duration_price import DurationPrice -from amazon_paapi.sdk.models.error_data import ErrorData -from amazon_paapi.sdk.models.external_ids import ExternalIds -from amazon_paapi.sdk.models.get_browse_nodes_request import GetBrowseNodesRequest -from amazon_paapi.sdk.models.get_browse_nodes_resource import GetBrowseNodesResource -from amazon_paapi.sdk.models.get_browse_nodes_response import GetBrowseNodesResponse -from amazon_paapi.sdk.models.get_items_request import GetItemsRequest -from amazon_paapi.sdk.models.get_items_resource import GetItemsResource -from amazon_paapi.sdk.models.get_items_response import GetItemsResponse -from amazon_paapi.sdk.models.get_variations_request import GetVariationsRequest -from amazon_paapi.sdk.models.get_variations_resource import GetVariationsResource -from amazon_paapi.sdk.models.get_variations_response import GetVariationsResponse -from amazon_paapi.sdk.models.image_size import ImageSize -from amazon_paapi.sdk.models.image_type import ImageType -from amazon_paapi.sdk.models.images import Images -from amazon_paapi.sdk.models.item import Item -from amazon_paapi.sdk.models.item_id_type import ItemIdType -from amazon_paapi.sdk.models.item_info import ItemInfo -from amazon_paapi.sdk.models.items_result import ItemsResult -from amazon_paapi.sdk.models.language_type import LanguageType -from amazon_paapi.sdk.models.languages import Languages -from amazon_paapi.sdk.models.manufacture_info import ManufactureInfo -from amazon_paapi.sdk.models.max_price import MaxPrice -from amazon_paapi.sdk.models.merchant import Merchant -from amazon_paapi.sdk.models.min_price import MinPrice -from amazon_paapi.sdk.models.min_reviews_rating import MinReviewsRating -from amazon_paapi.sdk.models.min_saving_percent import MinSavingPercent -from amazon_paapi.sdk.models.multi_valued_attribute import MultiValuedAttribute -from amazon_paapi.sdk.models.offer_availability import OfferAvailability -from amazon_paapi.sdk.models.offer_condition import OfferCondition -from amazon_paapi.sdk.models.offer_condition_note import OfferConditionNote -from amazon_paapi.sdk.models.offer_count import OfferCount -from amazon_paapi.sdk.models.offer_delivery_info import OfferDeliveryInfo -from amazon_paapi.sdk.models.offer_listing import OfferListing -from amazon_paapi.sdk.models.offer_loyalty_points import OfferLoyaltyPoints -from amazon_paapi.sdk.models.offer_merchant_info import OfferMerchantInfo -from amazon_paapi.sdk.models.offer_price import OfferPrice -from amazon_paapi.sdk.models.offer_program_eligibility import OfferProgramEligibility -from amazon_paapi.sdk.models.offer_promotion import OfferPromotion -from amazon_paapi.sdk.models.offer_savings import OfferSavings -from amazon_paapi.sdk.models.offer_shipping_charge import OfferShippingCharge -from amazon_paapi.sdk.models.offer_sub_condition import OfferSubCondition -from amazon_paapi.sdk.models.offer_summary import OfferSummary -from amazon_paapi.sdk.models.offers import Offers -from amazon_paapi.sdk.models.partner_type import PartnerType -from amazon_paapi.sdk.models.price import Price -from amazon_paapi.sdk.models.product_advertising_api_client_exception import ProductAdvertisingAPIClientException -from amazon_paapi.sdk.models.product_advertising_api_service_exception import ProductAdvertisingAPIServiceException -from amazon_paapi.sdk.models.product_info import ProductInfo -from amazon_paapi.sdk.models.properties import Properties -from amazon_paapi.sdk.models.rating import Rating -from amazon_paapi.sdk.models.refinement import Refinement -from amazon_paapi.sdk.models.refinement_bin import RefinementBin -from amazon_paapi.sdk.models.rental_offer_listing import RentalOfferListing -from amazon_paapi.sdk.models.rental_offers import RentalOffers -from amazon_paapi.sdk.models.search_items_request import SearchItemsRequest -from amazon_paapi.sdk.models.search_items_resource import SearchItemsResource -from amazon_paapi.sdk.models.search_items_response import SearchItemsResponse -from amazon_paapi.sdk.models.search_refinements import SearchRefinements -from amazon_paapi.sdk.models.search_result import SearchResult -from amazon_paapi.sdk.models.single_boolean_valued_attribute import SingleBooleanValuedAttribute -from amazon_paapi.sdk.models.single_integer_valued_attribute import SingleIntegerValuedAttribute -from amazon_paapi.sdk.models.single_string_valued_attribute import SingleStringValuedAttribute -from amazon_paapi.sdk.models.sort_by import SortBy -from amazon_paapi.sdk.models.technical_info import TechnicalInfo -from amazon_paapi.sdk.models.trade_in_info import TradeInInfo -from amazon_paapi.sdk.models.trade_in_price import TradeInPrice -from amazon_paapi.sdk.models.unit_based_attribute import UnitBasedAttribute -from amazon_paapi.sdk.models.variation_attribute import VariationAttribute -from amazon_paapi.sdk.models.variation_dimension import VariationDimension -from amazon_paapi.sdk.models.variation_summary import VariationSummary -from amazon_paapi.sdk.models.variations_result import VariationsResult -from amazon_paapi.sdk.models.website_sales_rank import WebsiteSalesRank +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 .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 diff --git a/amazon_paapi/sdk/models/browse_node.py b/amazon_paapi/sdk/models/browse_node.py index fabd708..2368305 100644 --- a/amazon_paapi/sdk/models/browse_node.py +++ b/amazon_paapi/sdk/models/browse_node.py @@ -28,8 +28,8 @@ import six -from amazon_paapi.sdk.models.browse_node_ancestor import BrowseNodeAncestor # noqa: F401,E501 -from amazon_paapi.sdk.models.browse_node_child import BrowseNodeChild # noqa: F401,E501 +from .browse_node_ancestor import BrowseNodeAncestor # noqa: F401,E501 +from .browse_node_child import BrowseNodeChild # noqa: F401,E501 class BrowseNode(object): diff --git a/amazon_paapi/sdk/models/browse_node_info.py b/amazon_paapi/sdk/models/browse_node_info.py index e15ab48..ce57b1f 100644 --- a/amazon_paapi/sdk/models/browse_node_info.py +++ b/amazon_paapi/sdk/models/browse_node_info.py @@ -28,8 +28,8 @@ import six -from amazon_paapi.sdk.models.browse_node import BrowseNode # noqa: F401,E501 -from amazon_paapi.sdk.models.website_sales_rank import WebsiteSalesRank # noqa: F401,E501 +from .browse_node import BrowseNode # noqa: F401,E501 +from .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 6202592..0efd996 100644 --- a/amazon_paapi/sdk/models/browse_nodes_result.py +++ b/amazon_paapi/sdk/models/browse_nodes_result.py @@ -28,7 +28,7 @@ import six -from amazon_paapi.sdk.models.browse_node import BrowseNode # noqa: F401,E501 +from .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 4792699..a2a55c8 100644 --- a/amazon_paapi/sdk/models/by_line_info.py +++ b/amazon_paapi/sdk/models/by_line_info.py @@ -28,8 +28,8 @@ import six -from amazon_paapi.sdk.models.contributor import Contributor # noqa: F401,E501 -from amazon_paapi.sdk.models.single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 +from .contributor import Contributor # noqa: F401,E501 +from .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 c806649..3f53dbf 100644 --- a/amazon_paapi/sdk/models/classifications.py +++ b/amazon_paapi/sdk/models/classifications.py @@ -28,7 +28,7 @@ import six -from amazon_paapi.sdk.models.single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 +from .single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 class Classifications(object): diff --git a/amazon_paapi/sdk/models/content_info.py b/amazon_paapi/sdk/models/content_info.py index 0bd1bce..068c02a 100644 --- a/amazon_paapi/sdk/models/content_info.py +++ b/amazon_paapi/sdk/models/content_info.py @@ -28,9 +28,9 @@ import six -from amazon_paapi.sdk.models.languages import Languages # noqa: F401,E501 -from amazon_paapi.sdk.models.single_integer_valued_attribute import SingleIntegerValuedAttribute # noqa: F401,E501 -from amazon_paapi.sdk.models.single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 +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 class ContentInfo(object): diff --git a/amazon_paapi/sdk/models/content_rating.py b/amazon_paapi/sdk/models/content_rating.py index b1440db..fd4276f 100644 --- a/amazon_paapi/sdk/models/content_rating.py +++ b/amazon_paapi/sdk/models/content_rating.py @@ -28,7 +28,7 @@ import six -from amazon_paapi.sdk.models.single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 +from .single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 class ContentRating(object): diff --git a/amazon_paapi/sdk/models/customer_reviews.py b/amazon_paapi/sdk/models/customer_reviews.py index f25ea7c..1ed184f 100644 --- a/amazon_paapi/sdk/models/customer_reviews.py +++ b/amazon_paapi/sdk/models/customer_reviews.py @@ -28,7 +28,7 @@ import six -from amazon_paapi.sdk.models.rating import Rating # noqa: F401,E501 +from .rating import Rating # noqa: F401,E501 class CustomerReviews(object): diff --git a/amazon_paapi/sdk/models/dimension_based_attribute.py b/amazon_paapi/sdk/models/dimension_based_attribute.py index a814223..b8f5e62 100644 --- a/amazon_paapi/sdk/models/dimension_based_attribute.py +++ b/amazon_paapi/sdk/models/dimension_based_attribute.py @@ -28,7 +28,7 @@ import six -from amazon_paapi.sdk.models.unit_based_attribute import UnitBasedAttribute # noqa: F401,E501 +from .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 2e9efb1..d5adfc7 100644 --- a/amazon_paapi/sdk/models/duration_price.py +++ b/amazon_paapi/sdk/models/duration_price.py @@ -28,8 +28,8 @@ import six -from amazon_paapi.sdk.models.offer_price import OfferPrice # noqa: F401,E501 -from amazon_paapi.sdk.models.unit_based_attribute import UnitBasedAttribute # noqa: F401,E501 +from .offer_price import OfferPrice # noqa: F401,E501 +from .unit_based_attribute import UnitBasedAttribute # noqa: F401,E501 class DurationPrice(object): diff --git a/amazon_paapi/sdk/models/external_ids.py b/amazon_paapi/sdk/models/external_ids.py index f50198d..ded47ea 100644 --- a/amazon_paapi/sdk/models/external_ids.py +++ b/amazon_paapi/sdk/models/external_ids.py @@ -28,7 +28,7 @@ import six -from amazon_paapi.sdk.models.multi_valued_attribute import MultiValuedAttribute # noqa: F401,E501 +from .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 3ce3bcc..f5fe775 100644 --- a/amazon_paapi/sdk/models/get_browse_nodes_request.py +++ b/amazon_paapi/sdk/models/get_browse_nodes_request.py @@ -28,8 +28,8 @@ import six -from amazon_paapi.sdk.models.get_browse_nodes_resource import GetBrowseNodesResource # noqa: F401,E501 -from amazon_paapi.sdk.models.partner_type import PartnerType # noqa: F401,E501 +from .get_browse_nodes_resource import GetBrowseNodesResource # noqa: F401,E501 +from .partner_type import PartnerType # noqa: F401,E501 class GetBrowseNodesRequest(object): diff --git a/amazon_paapi/sdk/models/get_browse_nodes_response.py b/amazon_paapi/sdk/models/get_browse_nodes_response.py index 86936f4..2640f27 100644 --- a/amazon_paapi/sdk/models/get_browse_nodes_response.py +++ b/amazon_paapi/sdk/models/get_browse_nodes_response.py @@ -28,8 +28,8 @@ import six -from amazon_paapi.sdk.models.browse_nodes_result import BrowseNodesResult # noqa: F401,E501 -from amazon_paapi.sdk.models.error_data import ErrorData # noqa: F401,E501 +from .browse_nodes_result import BrowseNodesResult # noqa: F401,E501 +from .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 1ff00ee..2ea5ae1 100644 --- a/amazon_paapi/sdk/models/get_items_request.py +++ b/amazon_paapi/sdk/models/get_items_request.py @@ -28,13 +28,13 @@ import six -from amazon_paapi.sdk.models.condition import Condition # noqa: F401,E501 -from amazon_paapi.sdk.models.get_items_resource import GetItemsResource # noqa: F401,E501 -from amazon_paapi.sdk.models.item_id_type import ItemIdType # noqa: F401,E501 -from amazon_paapi.sdk.models.merchant import Merchant # noqa: F401,E501 -from amazon_paapi.sdk.models.offer_count import OfferCount # noqa: F401,E501 -from amazon_paapi.sdk.models.partner_type import PartnerType # noqa: F401,E501 -from amazon_paapi.sdk.models.properties import Properties # noqa: F401,E501 +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 class GetItemsRequest(object): diff --git a/amazon_paapi/sdk/models/get_items_response.py b/amazon_paapi/sdk/models/get_items_response.py index cd5dabd..0c7c958 100644 --- a/amazon_paapi/sdk/models/get_items_response.py +++ b/amazon_paapi/sdk/models/get_items_response.py @@ -28,8 +28,8 @@ import six -from amazon_paapi.sdk.models.error_data import ErrorData # noqa: F401,E501 -from amazon_paapi.sdk.models.items_result import ItemsResult # noqa: F401,E501 +from .error_data import ErrorData # noqa: F401,E501 +from .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 5904829..1e539f5 100644 --- a/amazon_paapi/sdk/models/get_variations_request.py +++ b/amazon_paapi/sdk/models/get_variations_request.py @@ -28,12 +28,12 @@ import six -from amazon_paapi.sdk.models.condition import Condition # noqa: F401,E501 -from amazon_paapi.sdk.models.get_variations_resource import GetVariationsResource # noqa: F401,E501 -from amazon_paapi.sdk.models.merchant import Merchant # noqa: F401,E501 -from amazon_paapi.sdk.models.offer_count import OfferCount # noqa: F401,E501 -from amazon_paapi.sdk.models.partner_type import PartnerType # noqa: F401,E501 -from amazon_paapi.sdk.models.properties import Properties # noqa: F401,E501 +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 class GetVariationsRequest(object): diff --git a/amazon_paapi/sdk/models/get_variations_response.py b/amazon_paapi/sdk/models/get_variations_response.py index 64a8e79..a6698cd 100644 --- a/amazon_paapi/sdk/models/get_variations_response.py +++ b/amazon_paapi/sdk/models/get_variations_response.py @@ -28,8 +28,8 @@ import six -from amazon_paapi.sdk.models.error_data import ErrorData # noqa: F401,E501 -from amazon_paapi.sdk.models.variations_result import VariationsResult # noqa: F401,E501 +from .error_data import ErrorData # noqa: F401,E501 +from .variations_result import VariationsResult # noqa: F401,E501 class GetVariationsResponse(object): diff --git a/amazon_paapi/sdk/models/image_type.py b/amazon_paapi/sdk/models/image_type.py index 09d5b3d..003efea 100644 --- a/amazon_paapi/sdk/models/image_type.py +++ b/amazon_paapi/sdk/models/image_type.py @@ -28,7 +28,7 @@ import six -from amazon_paapi.sdk.models.image_size import ImageSize # noqa: F401,E501 +from .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 1e9a611..caf1370 100644 --- a/amazon_paapi/sdk/models/images.py +++ b/amazon_paapi/sdk/models/images.py @@ -28,7 +28,7 @@ import six -from amazon_paapi.sdk.models.image_type import ImageType # noqa: F401,E501 +from .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 02c6c32..ab41162 100644 --- a/amazon_paapi/sdk/models/item.py +++ b/amazon_paapi/sdk/models/item.py @@ -28,13 +28,13 @@ import six -from amazon_paapi.sdk.models.browse_node_info import BrowseNodeInfo # noqa: F401,E501 -from amazon_paapi.sdk.models.customer_reviews import CustomerReviews # noqa: F401,E501 -from amazon_paapi.sdk.models.images import Images # noqa: F401,E501 -from amazon_paapi.sdk.models.item_info import ItemInfo # noqa: F401,E501 -from amazon_paapi.sdk.models.offers import Offers # noqa: F401,E501 -from amazon_paapi.sdk.models.rental_offers import RentalOffers # noqa: F401,E501 -from amazon_paapi.sdk.models.variation_attribute import VariationAttribute # noqa: F401,E501 +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 class Item(object): diff --git a/amazon_paapi/sdk/models/item_info.py b/amazon_paapi/sdk/models/item_info.py index 9cbd03c..c8c6343 100644 --- a/amazon_paapi/sdk/models/item_info.py +++ b/amazon_paapi/sdk/models/item_info.py @@ -28,17 +28,17 @@ import six -from amazon_paapi.sdk.models.by_line_info import ByLineInfo # noqa: F401,E501 -from amazon_paapi.sdk.models.classifications import Classifications # noqa: F401,E501 -from amazon_paapi.sdk.models.content_info import ContentInfo # noqa: F401,E501 -from amazon_paapi.sdk.models.content_rating import ContentRating # noqa: F401,E501 -from amazon_paapi.sdk.models.external_ids import ExternalIds # noqa: F401,E501 -from amazon_paapi.sdk.models.manufacture_info import ManufactureInfo # noqa: F401,E501 -from amazon_paapi.sdk.models.multi_valued_attribute import MultiValuedAttribute # noqa: F401,E501 -from amazon_paapi.sdk.models.product_info import ProductInfo # noqa: F401,E501 -from amazon_paapi.sdk.models.single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 -from amazon_paapi.sdk.models.technical_info import TechnicalInfo # noqa: F401,E501 -from amazon_paapi.sdk.models.trade_in_info import TradeInInfo # noqa: F401,E501 +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 class ItemInfo(object): diff --git a/amazon_paapi/sdk/models/items_result.py b/amazon_paapi/sdk/models/items_result.py index 5065c26..9465dcd 100644 --- a/amazon_paapi/sdk/models/items_result.py +++ b/amazon_paapi/sdk/models/items_result.py @@ -28,7 +28,7 @@ import six -from amazon_paapi.sdk.models.item import Item # noqa: F401,E501 +from .item import Item # noqa: F401,E501 class ItemsResult(object): diff --git a/amazon_paapi/sdk/models/languages.py b/amazon_paapi/sdk/models/languages.py index 7ada11c..51b99a0 100644 --- a/amazon_paapi/sdk/models/languages.py +++ b/amazon_paapi/sdk/models/languages.py @@ -28,7 +28,7 @@ import six -from amazon_paapi.sdk.models.language_type import LanguageType # noqa: F401,E501 +from .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 54cbc10..ff82b41 100644 --- a/amazon_paapi/sdk/models/manufacture_info.py +++ b/amazon_paapi/sdk/models/manufacture_info.py @@ -28,7 +28,7 @@ import six -from amazon_paapi.sdk.models.single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 +from .single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 class ManufactureInfo(object): diff --git a/amazon_paapi/sdk/models/offer_condition.py b/amazon_paapi/sdk/models/offer_condition.py index aa353de..ca5a7fa 100644 --- a/amazon_paapi/sdk/models/offer_condition.py +++ b/amazon_paapi/sdk/models/offer_condition.py @@ -28,8 +28,8 @@ import six -from amazon_paapi.sdk.models.offer_condition_note import OfferConditionNote # noqa: F401,E501 -from amazon_paapi.sdk.models.offer_sub_condition import OfferSubCondition # noqa: F401,E501 +from .offer_condition_note import OfferConditionNote # noqa: F401,E501 +from .offer_sub_condition import OfferSubCondition # noqa: F401,E501 class OfferCondition(object): diff --git a/amazon_paapi/sdk/models/offer_delivery_info.py b/amazon_paapi/sdk/models/offer_delivery_info.py index d1799a7..4518af9 100644 --- a/amazon_paapi/sdk/models/offer_delivery_info.py +++ b/amazon_paapi/sdk/models/offer_delivery_info.py @@ -28,7 +28,7 @@ import six -from amazon_paapi.sdk.models.offer_shipping_charge import OfferShippingCharge # noqa: F401,E501 +from .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 7b4903b..58f4d61 100644 --- a/amazon_paapi/sdk/models/offer_listing.py +++ b/amazon_paapi/sdk/models/offer_listing.py @@ -28,14 +28,14 @@ import six -from amazon_paapi.sdk.models.offer_availability import OfferAvailability # noqa: F401,E501 -from amazon_paapi.sdk.models.offer_condition import OfferCondition # noqa: F401,E501 -from amazon_paapi.sdk.models.offer_delivery_info import OfferDeliveryInfo # noqa: F401,E501 -from amazon_paapi.sdk.models.offer_loyalty_points import OfferLoyaltyPoints # noqa: F401,E501 -from amazon_paapi.sdk.models.offer_merchant_info import OfferMerchantInfo # noqa: F401,E501 -from amazon_paapi.sdk.models.offer_price import OfferPrice # noqa: F401,E501 -from amazon_paapi.sdk.models.offer_program_eligibility import OfferProgramEligibility # noqa: F401,E501 -from amazon_paapi.sdk.models.offer_promotion import OfferPromotion # 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_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 class OfferListing(object): diff --git a/amazon_paapi/sdk/models/offer_price.py b/amazon_paapi/sdk/models/offer_price.py index 1bdaf1d..56d3ab8 100644 --- a/amazon_paapi/sdk/models/offer_price.py +++ b/amazon_paapi/sdk/models/offer_price.py @@ -28,7 +28,7 @@ import six -from amazon_paapi.sdk.models.offer_savings import OfferSavings # noqa: F401,E501 +from .offer_savings import OfferSavings # noqa: F401,E501 class OfferPrice(object): diff --git a/amazon_paapi/sdk/models/offer_summary.py b/amazon_paapi/sdk/models/offer_summary.py index 5cf15ea..c834583 100644 --- a/amazon_paapi/sdk/models/offer_summary.py +++ b/amazon_paapi/sdk/models/offer_summary.py @@ -28,8 +28,8 @@ import six -from amazon_paapi.sdk.models.offer_condition import OfferCondition # noqa: F401,E501 -from amazon_paapi.sdk.models.offer_price import OfferPrice # noqa: F401,E501 +from .offer_condition import OfferCondition # noqa: F401,E501 +from .offer_price import OfferPrice # noqa: F401,E501 class OfferSummary(object): diff --git a/amazon_paapi/sdk/models/offers.py b/amazon_paapi/sdk/models/offers.py index ade03f9..5e38c4d 100644 --- a/amazon_paapi/sdk/models/offers.py +++ b/amazon_paapi/sdk/models/offers.py @@ -28,8 +28,8 @@ import six -from amazon_paapi.sdk.models.offer_listing import OfferListing # noqa: F401,E501 -from amazon_paapi.sdk.models.offer_summary import OfferSummary # noqa: F401,E501 +from .offer_listing import OfferListing # noqa: F401,E501 +from .offer_summary import OfferSummary # noqa: F401,E501 class Offers(object): diff --git a/amazon_paapi/sdk/models/price.py b/amazon_paapi/sdk/models/price.py index 3ef21ca..08db8fe 100644 --- a/amazon_paapi/sdk/models/price.py +++ b/amazon_paapi/sdk/models/price.py @@ -28,7 +28,7 @@ import six -from amazon_paapi.sdk.models.offer_price import OfferPrice # noqa: F401,E501 +from .offer_price import OfferPrice # noqa: F401,E501 class Price(object): 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 e71564c..c58001e 100644 --- a/amazon_paapi/sdk/models/product_advertising_api_client_exception.py +++ b/amazon_paapi/sdk/models/product_advertising_api_client_exception.py @@ -28,7 +28,7 @@ import six -from amazon_paapi.sdk.models.error_data import ErrorData # noqa: F401,E501 +from .error_data import ErrorData # noqa: F401,E501 class ProductAdvertisingAPIClientException(object): diff --git a/amazon_paapi/sdk/models/product_info.py b/amazon_paapi/sdk/models/product_info.py index f17c7eb..fbd056a 100644 --- a/amazon_paapi/sdk/models/product_info.py +++ b/amazon_paapi/sdk/models/product_info.py @@ -28,10 +28,10 @@ import six -from amazon_paapi.sdk.models.dimension_based_attribute import DimensionBasedAttribute # noqa: F401,E501 -from amazon_paapi.sdk.models.single_boolean_valued_attribute import SingleBooleanValuedAttribute # noqa: F401,E501 -from amazon_paapi.sdk.models.single_integer_valued_attribute import SingleIntegerValuedAttribute # noqa: F401,E501 -from amazon_paapi.sdk.models.single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 +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 class ProductInfo(object): diff --git a/amazon_paapi/sdk/models/refinement.py b/amazon_paapi/sdk/models/refinement.py index 37f30a7..edb536d 100644 --- a/amazon_paapi/sdk/models/refinement.py +++ b/amazon_paapi/sdk/models/refinement.py @@ -28,7 +28,7 @@ import six -from amazon_paapi.sdk.models.refinement_bin import RefinementBin # noqa: F401,E501 +from .refinement_bin import RefinementBin # noqa: F401,E501 class Refinement(object): diff --git a/amazon_paapi/sdk/models/rental_offer_listing.py b/amazon_paapi/sdk/models/rental_offer_listing.py index ae879ed..239775f 100644 --- a/amazon_paapi/sdk/models/rental_offer_listing.py +++ b/amazon_paapi/sdk/models/rental_offer_listing.py @@ -28,11 +28,11 @@ import six -from amazon_paapi.sdk.models.duration_price import DurationPrice # noqa: F401,E501 -from amazon_paapi.sdk.models.offer_availability import OfferAvailability # noqa: F401,E501 -from amazon_paapi.sdk.models.offer_condition import OfferCondition # noqa: F401,E501 -from amazon_paapi.sdk.models.offer_delivery_info import OfferDeliveryInfo # noqa: F401,E501 -from amazon_paapi.sdk.models.offer_merchant_info import OfferMerchantInfo # noqa: F401,E501 +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 class RentalOfferListing(object): diff --git a/amazon_paapi/sdk/models/rental_offers.py b/amazon_paapi/sdk/models/rental_offers.py index 948fd1e..6fefcb2 100644 --- a/amazon_paapi/sdk/models/rental_offers.py +++ b/amazon_paapi/sdk/models/rental_offers.py @@ -28,7 +28,7 @@ import six -from amazon_paapi.sdk.models.rental_offer_listing import RentalOfferListing # noqa: F401,E501 +from .rental_offer_listing import RentalOfferListing # noqa: F401,E501 class RentalOffers(object): diff --git a/amazon_paapi/sdk/models/search_items_request.py b/amazon_paapi/sdk/models/search_items_request.py index 37d70aa..a8c74da 100644 --- a/amazon_paapi/sdk/models/search_items_request.py +++ b/amazon_paapi/sdk/models/search_items_request.py @@ -28,19 +28,19 @@ import six -from amazon_paapi.sdk.models.availability import Availability # noqa: F401,E501 -from amazon_paapi.sdk.models.condition import Condition # noqa: F401,E501 -from amazon_paapi.sdk.models.delivery_flag import DeliveryFlag # noqa: F401,E501 -from amazon_paapi.sdk.models.max_price import MaxPrice # noqa: F401,E501 -from amazon_paapi.sdk.models.merchant import Merchant # noqa: F401,E501 -from amazon_paapi.sdk.models.min_price import MinPrice # noqa: F401,E501 -from amazon_paapi.sdk.models.min_reviews_rating import MinReviewsRating # noqa: F401,E501 -from amazon_paapi.sdk.models.min_saving_percent import MinSavingPercent # noqa: F401,E501 -from amazon_paapi.sdk.models.offer_count import OfferCount # noqa: F401,E501 -from amazon_paapi.sdk.models.partner_type import PartnerType # noqa: F401,E501 -from amazon_paapi.sdk.models.properties import Properties # noqa: F401,E501 -from amazon_paapi.sdk.models.search_items_resource import SearchItemsResource # noqa: F401,E501 -from amazon_paapi.sdk.models.sort_by import SortBy # noqa: F401,E501 +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 class SearchItemsRequest(object): diff --git a/amazon_paapi/sdk/models/search_items_response.py b/amazon_paapi/sdk/models/search_items_response.py index 9f29114..34727b5 100644 --- a/amazon_paapi/sdk/models/search_items_response.py +++ b/amazon_paapi/sdk/models/search_items_response.py @@ -28,8 +28,8 @@ import six -from amazon_paapi.sdk.models.error_data import ErrorData # noqa: F401,E501 -from amazon_paapi.sdk.models.search_result import SearchResult # noqa: F401,E501 +from .error_data import ErrorData # noqa: F401,E501 +from .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 4d69d7f..7722283 100644 --- a/amazon_paapi/sdk/models/search_refinements.py +++ b/amazon_paapi/sdk/models/search_refinements.py @@ -28,7 +28,7 @@ import six -from amazon_paapi.sdk.models.refinement import Refinement # noqa: F401,E501 +from .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 d0cd250..27a3b99 100644 --- a/amazon_paapi/sdk/models/search_result.py +++ b/amazon_paapi/sdk/models/search_result.py @@ -28,8 +28,8 @@ import six -from amazon_paapi.sdk.models.item import Item # noqa: F401,E501 -from amazon_paapi.sdk.models.search_refinements import SearchRefinements # noqa: F401,E501 +from .item import Item # noqa: F401,E501 +from .search_refinements import SearchRefinements # noqa: F401,E501 class SearchResult(object): diff --git a/amazon_paapi/sdk/models/technical_info.py b/amazon_paapi/sdk/models/technical_info.py index 8fa04eb..11e0b18 100644 --- a/amazon_paapi/sdk/models/technical_info.py +++ b/amazon_paapi/sdk/models/technical_info.py @@ -28,8 +28,8 @@ import six -from amazon_paapi.sdk.models.multi_valued_attribute import MultiValuedAttribute # noqa: F401,E501 -from amazon_paapi.sdk.models.single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 +from .multi_valued_attribute import MultiValuedAttribute # noqa: F401,E501 +from .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 3b1192b..d7caf2b 100644 --- a/amazon_paapi/sdk/models/trade_in_info.py +++ b/amazon_paapi/sdk/models/trade_in_info.py @@ -28,7 +28,7 @@ import six -from amazon_paapi.sdk.models.trade_in_price import TradeInPrice # noqa: F401,E501 +from .trade_in_price import TradeInPrice # noqa: F401,E501 class TradeInInfo(object): diff --git a/amazon_paapi/sdk/models/variation_summary.py b/amazon_paapi/sdk/models/variation_summary.py index 1d3fa12..76738d0 100644 --- a/amazon_paapi/sdk/models/variation_summary.py +++ b/amazon_paapi/sdk/models/variation_summary.py @@ -28,8 +28,8 @@ import six -from amazon_paapi.sdk.models.price import Price # noqa: F401,E501 -from amazon_paapi.sdk.models.variation_dimension import VariationDimension # noqa: F401,E501 +from .price import Price # noqa: F401,E501 +from .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 856c0ed..3e9a849 100644 --- a/amazon_paapi/sdk/models/variations_result.py +++ b/amazon_paapi/sdk/models/variations_result.py @@ -28,8 +28,8 @@ import six -from amazon_paapi.sdk.models.item import Item # noqa: F401,E501 -from amazon_paapi.sdk.models.variation_summary import VariationSummary # noqa: F401,E501 +from .item import Item # noqa: F401,E501 +from .variation_summary import VariationSummary # noqa: F401,E501 class VariationsResult(object): From 2eaa579dc01fc0a66ce7277a477d77334f1e15ef Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Tue, 13 Jul 2021 19:31:54 +0200 Subject: [PATCH 62/67] Moved old SDK folder inside amazon module --- amazon/constant.py | 10 +- amazon/paapi.py | 14 +- .../paapi5_python_sdk}/COPYING.txt | 0 .../paapi5_python_sdk}/LICENSE.txt | 0 .../paapi5_python_sdk}/NOTICE.txt | 0 amazon/paapi5_python_sdk/__init__.py | 123 ++++++++++++++++++ .../paapi5_python_sdk}/api/__init__.py | 2 +- .../paapi5_python_sdk}/api/default_api.py | 2 +- .../paapi5_python_sdk}/api_client.py | 8 +- .../paapi5_python_sdk}/auth/__init__.py | 4 +- .../paapi5_python_sdk}/auth/sig_v4.py | 0 .../paapi5_python_sdk}/availability.py | 0 .../paapi5_python_sdk}/browse_node.py | 4 +- .../browse_node_ancestor.py | 0 .../paapi5_python_sdk}/browse_node_child.py | 0 .../browse_node_children.py | 2 +- .../paapi5_python_sdk}/browse_node_info.py | 4 +- .../paapi5_python_sdk}/browse_nodes_result.py | 2 +- .../paapi5_python_sdk}/by_line_info.py | 4 +- .../paapi5_python_sdk}/classifications.py | 2 +- .../paapi5_python_sdk}/condition.py | 0 .../paapi5_python_sdk}/configuration.py | 2 +- .../paapi5_python_sdk}/content_info.py | 6 +- .../paapi5_python_sdk}/content_rating.py | 2 +- .../paapi5_python_sdk}/contributor.py | 0 .../paapi5_python_sdk}/delivery_flag.py | 0 .../dimension_based_attribute.py | 2 +- .../paapi5_python_sdk}/duration_price.py | 4 +- .../paapi5_python_sdk}/error_data.py | 0 .../paapi5_python_sdk}/external_ids.py | 2 +- .../get_browse_nodes_request.py | 4 +- .../get_browse_nodes_resource.py | 0 .../get_browse_nodes_response.py | 4 +- .../paapi5_python_sdk}/get_items_request.py | 14 +- .../paapi5_python_sdk}/get_items_resource.py | 0 .../paapi5_python_sdk}/get_items_response.py | 4 +- .../get_variations_request.py | 12 +- .../get_variations_resource.py | 0 .../get_variations_response.py | 4 +- .../paapi5_python_sdk}/image_size.py | 0 .../paapi5_python_sdk}/image_type.py | 2 +- .../paapi5_python_sdk}/images.py | 2 +- .../paapi5_python_sdk}/item.py | 12 +- .../paapi5_python_sdk}/item_id_type.py | 0 .../paapi5_python_sdk}/item_info.py | 22 ++-- .../paapi5_python_sdk}/items_result.py | 2 +- .../paapi5_python_sdk}/language_type.py | 0 .../paapi5_python_sdk}/languages.py | 2 +- .../paapi5_python_sdk}/manufacture_info.py | 2 +- .../paapi5_python_sdk}/max_price.py | 0 .../paapi5_python_sdk}/merchant.py | 0 .../paapi5_python_sdk}/min_price.py | 0 .../paapi5_python_sdk}/min_reviews_rating.py | 0 .../paapi5_python_sdk}/min_saving_percent.py | 0 .../multi_valued_attribute.py | 0 .../paapi5_python_sdk}/offer_availability.py | 0 .../paapi5_python_sdk}/offer_condition.py | 2 +- .../paapi5_python_sdk}/offer_count.py | 0 .../paapi5_python_sdk}/offer_delivery_info.py | 2 +- .../paapi5_python_sdk}/offer_listing.py | 16 +-- .../offer_loyalty_points.py | 0 .../paapi5_python_sdk}/offer_merchant_info.py | 0 .../paapi5_python_sdk}/offer_price.py | 2 +- .../offer_program_eligibility.py | 0 .../paapi5_python_sdk}/offer_promotion.py | 0 .../paapi5_python_sdk}/offer_savings.py | 0 .../offer_shipping_charge.py | 0 .../paapi5_python_sdk}/offer_sub_condition.py | 0 .../paapi5_python_sdk}/offer_summary.py | 4 +- .../paapi5_python_sdk}/offers.py | 4 +- .../paapi5_python_sdk}/partner_type.py | 0 .../paapi5_python_sdk}/price.py | 2 +- ...roduct_advertising_api_client_exception.py | 2 +- ...oduct_advertising_api_service_exception.py | 0 .../paapi5_python_sdk}/product_info.py | 8 +- .../paapi5_python_sdk}/properties.py | 0 .../paapi5_python_sdk}/refinement.py | 2 +- .../paapi5_python_sdk}/refinement_bin.py | 0 .../rental_offer_listing.py | 10 +- .../paapi5_python_sdk}/rental_offers.py | 2 +- .../paapi5_python_sdk}/rest.py | 0 .../search_items_request.py | 26 ++-- .../search_items_resource.py | 0 .../search_items_response.py | 4 +- .../paapi5_python_sdk}/search_refinements.py | 2 +- .../paapi5_python_sdk}/search_result.py | 4 +- .../single_boolean_valued_attribute.py | 0 .../single_integer_valued_attribute.py | 0 .../single_string_valued_attribute.py | 0 .../paapi5_python_sdk}/sort_by.py | 0 .../paapi5_python_sdk}/technical_info.py | 2 +- .../paapi5_python_sdk}/trade_in_info.py | 2 +- .../paapi5_python_sdk}/trade_in_price.py | 0 .../unit_based_attribute.py | 0 .../paapi5_python_sdk}/variation_attribute.py | 0 .../paapi5_python_sdk}/variation_dimension.py | 0 .../paapi5_python_sdk}/variation_summary.py | 4 +- .../paapi5_python_sdk}/variations_result.py | 4 +- .../paapi5_python_sdk}/website_sales_rank.py | 0 paapi5_python_sdk/__init__.py | 123 ------------------ 100 files changed, 256 insertions(+), 256 deletions(-) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/COPYING.txt (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/LICENSE.txt (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/NOTICE.txt (100%) create mode 100644 amazon/paapi5_python_sdk/__init__.py rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/api/__init__.py (93%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/api/default_api.py (99%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/api_client.py (99%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/auth/__init__.py (93%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/auth/sig_v4.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/availability.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/browse_node.py (97%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/browse_node_ancestor.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/browse_node_child.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/browse_node_children.py (97%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/browse_node_info.py (96%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/browse_nodes_result.py (98%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/by_line_info.py (96%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/classifications.py (97%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/condition.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/configuration.py (98%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/content_info.py (95%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/content_rating.py (97%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/contributor.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/delivery_flag.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/dimension_based_attribute.py (98%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/duration_price.py (96%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/error_data.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/external_ids.py (98%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/get_browse_nodes_request.py (97%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/get_browse_nodes_resource.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/get_browse_nodes_response.py (96%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/get_items_request.py (96%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/get_items_resource.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/get_items_response.py (96%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/get_variations_request.py (96%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/get_variations_resource.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/get_variations_response.py (96%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/image_size.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/image_type.py (98%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/images.py (98%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/item.py (95%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/item_id_type.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/item_info.py (92%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/items_result.py (98%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/language_type.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/languages.py (98%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/manufacture_info.py (97%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/max_price.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/merchant.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/min_price.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/min_reviews_rating.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/min_saving_percent.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/multi_valued_attribute.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/offer_availability.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/offer_condition.py (98%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/offer_count.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/offer_delivery_info.py (98%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/offer_listing.py (94%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/offer_loyalty_points.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/offer_merchant_info.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/offer_price.py (98%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/offer_program_eligibility.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/offer_promotion.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/offer_savings.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/offer_shipping_charge.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/offer_sub_condition.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/offer_summary.py (97%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/offers.py (96%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/partner_type.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/price.py (98%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/product_advertising_api_client_exception.py (98%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/product_advertising_api_service_exception.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/product_info.py (94%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/properties.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/refinement.py (98%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/refinement_bin.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/rental_offer_listing.py (94%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/rental_offers.py (97%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/rest.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/search_items_request.py (96%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/search_items_resource.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/search_items_response.py (96%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/search_refinements.py (98%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/search_result.py (97%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/single_boolean_valued_attribute.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/single_integer_valued_attribute.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/single_string_valued_attribute.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/sort_by.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/technical_info.py (97%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/trade_in_info.py (98%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/trade_in_price.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/unit_based_attribute.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/variation_attribute.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/variation_dimension.py (100%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/variation_summary.py (97%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/variations_result.py (96%) rename {paapi5_python_sdk => amazon/paapi5_python_sdk}/website_sales_rank.py (100%) delete mode 100644 paapi5_python_sdk/__init__.py diff --git a/amazon/constant.py b/amazon/constant.py index f8faed6..c1fae32 100644 --- a/amazon/constant.py +++ b/amazon/constant.py @@ -1,10 +1,10 @@ """Module containing all the constants.""" -from paapi5_python_sdk.get_items_resource import GetItemsResource -from paapi5_python_sdk.search_items_resource import SearchItemsResource -from paapi5_python_sdk.get_variations_resource import GetVariationsResource -from paapi5_python_sdk.get_browse_nodes_resource import GetBrowseNodesResource -from paapi5_python_sdk.condition import Condition +from .paapi5_python_sdk.get_items_resource import GetItemsResource +from .paapi5_python_sdk.search_items_resource import SearchItemsResource +from .paapi5_python_sdk.get_variations_resource import GetVariationsResource +from .paapi5_python_sdk.get_browse_nodes_resource import GetBrowseNodesResource +from .paapi5_python_sdk.condition import Condition """Available regions for the Amazon API.""" REGIONS = { diff --git a/amazon/paapi.py b/amazon/paapi.py index 31d8046..d29a79c 100644 --- a/amazon/paapi.py +++ b/amazon/paapi.py @@ -5,13 +5,13 @@ an easier way. """ -from paapi5_python_sdk.api.default_api import DefaultApi -from paapi5_python_sdk.get_items_request import GetItemsRequest -from paapi5_python_sdk.search_items_request import SearchItemsRequest -from paapi5_python_sdk.get_variations_request import GetVariationsRequest -from paapi5_python_sdk.get_browse_nodes_request import GetBrowseNodesRequest -from paapi5_python_sdk.partner_type import PartnerType -from paapi5_python_sdk.rest import ApiException +from .paapi5_python_sdk.api.default_api import DefaultApi +from .paapi5_python_sdk.get_items_request import GetItemsRequest +from .paapi5_python_sdk.search_items_request import SearchItemsRequest +from .paapi5_python_sdk.get_variations_request import GetVariationsRequest +from .paapi5_python_sdk.get_browse_nodes_request import GetBrowseNodesRequest +from .paapi5_python_sdk.partner_type import PartnerType +from .paapi5_python_sdk.rest import ApiException from amazon.constant import DOMAINS, REGIONS, CONDITION from amazon.constant import PRODUCT_RESOURCES, SEARCH_RESOURCES, VARIATION_RESOURCES diff --git a/paapi5_python_sdk/COPYING.txt b/amazon/paapi5_python_sdk/COPYING.txt similarity index 100% rename from paapi5_python_sdk/COPYING.txt rename to amazon/paapi5_python_sdk/COPYING.txt diff --git a/paapi5_python_sdk/LICENSE.txt b/amazon/paapi5_python_sdk/LICENSE.txt similarity index 100% rename from paapi5_python_sdk/LICENSE.txt rename to amazon/paapi5_python_sdk/LICENSE.txt diff --git a/paapi5_python_sdk/NOTICE.txt b/amazon/paapi5_python_sdk/NOTICE.txt similarity index 100% rename from paapi5_python_sdk/NOTICE.txt rename to amazon/paapi5_python_sdk/NOTICE.txt diff --git a/amazon/paapi5_python_sdk/__init__.py b/amazon/paapi5_python_sdk/__init__.py new file mode 100644 index 0000000..33fd32b --- /dev/null +++ b/amazon/paapi5_python_sdk/__init__.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +# flake8: noqa + +from __future__ import absolute_import + +""" + Copyright 2019 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 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +# import apis into sdk package +from .api.default_api import DefaultApi + +# import auth into sdk package +from .auth.sig_v4 import AWSV4Auth + +# import ApiClient +from .api_client import ApiClient +from .configuration import Configuration +# import models into sdk 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_children import BrowseNodeChildren +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 .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_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 .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 .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 diff --git a/paapi5_python_sdk/api/__init__.py b/amazon/paapi5_python_sdk/api/__init__.py similarity index 93% rename from paapi5_python_sdk/api/__init__.py rename to amazon/paapi5_python_sdk/api/__init__.py index c064c41..8fa4a5c 100644 --- a/paapi5_python_sdk/api/__init__.py +++ b/amazon/paapi5_python_sdk/api/__init__.py @@ -26,4 +26,4 @@ """ # import apis into api package -from paapi5_python_sdk.api.default_api import DefaultApi +from .default_api import DefaultApi diff --git a/paapi5_python_sdk/api/default_api.py b/amazon/paapi5_python_sdk/api/default_api.py similarity index 99% rename from paapi5_python_sdk/api/default_api.py rename to amazon/paapi5_python_sdk/api/default_api.py index c2069f1..268c452 100644 --- a/paapi5_python_sdk/api/default_api.py +++ b/amazon/paapi5_python_sdk/api/default_api.py @@ -28,7 +28,7 @@ # python 2 and python 3 compatibility library import six -from paapi5_python_sdk.api_client import ApiClient +from ..api_client import ApiClient class DefaultApi(object): diff --git a/paapi5_python_sdk/api_client.py b/amazon/paapi5_python_sdk/api_client.py similarity index 99% rename from paapi5_python_sdk/api_client.py rename to amazon/paapi5_python_sdk/api_client.py index a484778..5f26b32 100644 --- a/paapi5_python_sdk/api_client.py +++ b/amazon/paapi5_python_sdk/api_client.py @@ -35,11 +35,11 @@ import six from six.moves.urllib.parse import quote -from paapi5_python_sdk.configuration import Configuration -import paapi5_python_sdk -from paapi5_python_sdk import rest +from .configuration import Configuration +from .. import paapi5_python_sdk +from . import rest -from paapi5_python_sdk.auth.sig_v4 import AWSV4Auth +from .auth.sig_v4 import AWSV4Auth class ApiClient(object): """Generic API client for Swagger client library builds. diff --git a/paapi5_python_sdk/auth/__init__.py b/amazon/paapi5_python_sdk/auth/__init__.py similarity index 93% rename from paapi5_python_sdk/auth/__init__.py rename to amazon/paapi5_python_sdk/auth/__init__.py index f6d79ee..fe07328 100644 --- a/paapi5_python_sdk/auth/__init__.py +++ b/amazon/paapi5_python_sdk/auth/__init__.py @@ -21,9 +21,9 @@ """ ProductAdvertisingAPI - + Generated by: https://github.com/swagger-api/swagger-codegen.git """ # import auth into sdk package -from paapi5_python_sdk.auth.sig_v4 import AWSV4Auth +from .sig_v4 import AWSV4Auth diff --git a/paapi5_python_sdk/auth/sig_v4.py b/amazon/paapi5_python_sdk/auth/sig_v4.py similarity index 100% rename from paapi5_python_sdk/auth/sig_v4.py rename to amazon/paapi5_python_sdk/auth/sig_v4.py diff --git a/paapi5_python_sdk/availability.py b/amazon/paapi5_python_sdk/availability.py similarity index 100% rename from paapi5_python_sdk/availability.py rename to amazon/paapi5_python_sdk/availability.py diff --git a/paapi5_python_sdk/browse_node.py b/amazon/paapi5_python_sdk/browse_node.py similarity index 97% rename from paapi5_python_sdk/browse_node.py rename to amazon/paapi5_python_sdk/browse_node.py index bb735b5..09e8242 100644 --- a/paapi5_python_sdk/browse_node.py +++ b/amazon/paapi5_python_sdk/browse_node.py @@ -27,8 +27,8 @@ import six -from paapi5_python_sdk.browse_node_ancestor import BrowseNodeAncestor # noqa: F401,E501 -from paapi5_python_sdk.browse_node_children import BrowseNodeChildren # noqa: F401,E501 +from .browse_node_ancestor import BrowseNodeAncestor # noqa: F401,E501 +from .browse_node_children import BrowseNodeChildren # noqa: F401,E501 class BrowseNode(object): diff --git a/paapi5_python_sdk/browse_node_ancestor.py b/amazon/paapi5_python_sdk/browse_node_ancestor.py similarity index 100% rename from paapi5_python_sdk/browse_node_ancestor.py rename to amazon/paapi5_python_sdk/browse_node_ancestor.py diff --git a/paapi5_python_sdk/browse_node_child.py b/amazon/paapi5_python_sdk/browse_node_child.py similarity index 100% rename from paapi5_python_sdk/browse_node_child.py rename to amazon/paapi5_python_sdk/browse_node_child.py diff --git a/paapi5_python_sdk/browse_node_children.py b/amazon/paapi5_python_sdk/browse_node_children.py similarity index 97% rename from paapi5_python_sdk/browse_node_children.py rename to amazon/paapi5_python_sdk/browse_node_children.py index e0fd2e6..9b9772a 100644 --- a/paapi5_python_sdk/browse_node_children.py +++ b/amazon/paapi5_python_sdk/browse_node_children.py @@ -27,7 +27,7 @@ import six -from paapi5_python_sdk.browse_node_child import BrowseNodeChild # noqa: F401,E501 +from .browse_node_child import BrowseNodeChild # noqa: F401,E501 class BrowseNodeChildren(object): diff --git a/paapi5_python_sdk/browse_node_info.py b/amazon/paapi5_python_sdk/browse_node_info.py similarity index 96% rename from paapi5_python_sdk/browse_node_info.py rename to amazon/paapi5_python_sdk/browse_node_info.py index 25ed406..52d8de7 100644 --- a/paapi5_python_sdk/browse_node_info.py +++ b/amazon/paapi5_python_sdk/browse_node_info.py @@ -27,8 +27,8 @@ import six -from paapi5_python_sdk.browse_node import BrowseNode # noqa: F401,E501 -from paapi5_python_sdk.website_sales_rank import WebsiteSalesRank # noqa: F401,E501 +from .browse_node import BrowseNode # noqa: F401,E501 +from .website_sales_rank import WebsiteSalesRank # noqa: F401,E501 class BrowseNodeInfo(object): diff --git a/paapi5_python_sdk/browse_nodes_result.py b/amazon/paapi5_python_sdk/browse_nodes_result.py similarity index 98% rename from paapi5_python_sdk/browse_nodes_result.py rename to amazon/paapi5_python_sdk/browse_nodes_result.py index 5ee4a0c..0bccd5d 100644 --- a/paapi5_python_sdk/browse_nodes_result.py +++ b/amazon/paapi5_python_sdk/browse_nodes_result.py @@ -27,7 +27,7 @@ import six -from paapi5_python_sdk.browse_node import BrowseNode # noqa: F401,E501 +from .browse_node import BrowseNode # noqa: F401,E501 class BrowseNodesResult(object): diff --git a/paapi5_python_sdk/by_line_info.py b/amazon/paapi5_python_sdk/by_line_info.py similarity index 96% rename from paapi5_python_sdk/by_line_info.py rename to amazon/paapi5_python_sdk/by_line_info.py index 8f2812d..9b3052b 100644 --- a/paapi5_python_sdk/by_line_info.py +++ b/amazon/paapi5_python_sdk/by_line_info.py @@ -27,8 +27,8 @@ import six -from paapi5_python_sdk.contributor import Contributor # noqa: F401,E501 -from paapi5_python_sdk.single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 +from .contributor import Contributor # noqa: F401,E501 +from .single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 class ByLineInfo(object): diff --git a/paapi5_python_sdk/classifications.py b/amazon/paapi5_python_sdk/classifications.py similarity index 97% rename from paapi5_python_sdk/classifications.py rename to amazon/paapi5_python_sdk/classifications.py index 0fc3ebb..86e2e25 100644 --- a/paapi5_python_sdk/classifications.py +++ b/amazon/paapi5_python_sdk/classifications.py @@ -27,7 +27,7 @@ import six -from paapi5_python_sdk.single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 +from .single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 class Classifications(object): diff --git a/paapi5_python_sdk/condition.py b/amazon/paapi5_python_sdk/condition.py similarity index 100% rename from paapi5_python_sdk/condition.py rename to amazon/paapi5_python_sdk/condition.py diff --git a/paapi5_python_sdk/configuration.py b/amazon/paapi5_python_sdk/configuration.py similarity index 98% rename from paapi5_python_sdk/configuration.py rename to amazon/paapi5_python_sdk/configuration.py index 2dd7431..562a9c6 100644 --- a/paapi5_python_sdk/configuration.py +++ b/amazon/paapi5_python_sdk/configuration.py @@ -61,7 +61,7 @@ def __init__(self, connection_pool_maxsize=None): # Logging Settings self.logger = {} - self.logger["package_logger"] = logging.getLogger("paapi5_python_sdk") + self.logger["package_logger"] = logging.getLogger("") self.logger["urllib3_logger"] = logging.getLogger("urllib3") # Log format self.logger_format = '%(asctime)s %(levelname)s %(message)s' diff --git a/paapi5_python_sdk/content_info.py b/amazon/paapi5_python_sdk/content_info.py similarity index 95% rename from paapi5_python_sdk/content_info.py rename to amazon/paapi5_python_sdk/content_info.py index a0264c2..b46e244 100644 --- a/paapi5_python_sdk/content_info.py +++ b/amazon/paapi5_python_sdk/content_info.py @@ -27,9 +27,9 @@ import six -from paapi5_python_sdk.languages import Languages # noqa: F401,E501 -from paapi5_python_sdk.single_integer_valued_attribute import SingleIntegerValuedAttribute # noqa: F401,E501 -from paapi5_python_sdk.single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 +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 class ContentInfo(object): diff --git a/paapi5_python_sdk/content_rating.py b/amazon/paapi5_python_sdk/content_rating.py similarity index 97% rename from paapi5_python_sdk/content_rating.py rename to amazon/paapi5_python_sdk/content_rating.py index d3584e9..10ac8f0 100644 --- a/paapi5_python_sdk/content_rating.py +++ b/amazon/paapi5_python_sdk/content_rating.py @@ -27,7 +27,7 @@ import six -from paapi5_python_sdk.single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 +from .single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 class ContentRating(object): diff --git a/paapi5_python_sdk/contributor.py b/amazon/paapi5_python_sdk/contributor.py similarity index 100% rename from paapi5_python_sdk/contributor.py rename to amazon/paapi5_python_sdk/contributor.py diff --git a/paapi5_python_sdk/delivery_flag.py b/amazon/paapi5_python_sdk/delivery_flag.py similarity index 100% rename from paapi5_python_sdk/delivery_flag.py rename to amazon/paapi5_python_sdk/delivery_flag.py diff --git a/paapi5_python_sdk/dimension_based_attribute.py b/amazon/paapi5_python_sdk/dimension_based_attribute.py similarity index 98% rename from paapi5_python_sdk/dimension_based_attribute.py rename to amazon/paapi5_python_sdk/dimension_based_attribute.py index 7744409..04cc4f7 100644 --- a/paapi5_python_sdk/dimension_based_attribute.py +++ b/amazon/paapi5_python_sdk/dimension_based_attribute.py @@ -27,7 +27,7 @@ import six -from paapi5_python_sdk.unit_based_attribute import UnitBasedAttribute # noqa: F401,E501 +from .unit_based_attribute import UnitBasedAttribute # noqa: F401,E501 class DimensionBasedAttribute(object): diff --git a/paapi5_python_sdk/duration_price.py b/amazon/paapi5_python_sdk/duration_price.py similarity index 96% rename from paapi5_python_sdk/duration_price.py rename to amazon/paapi5_python_sdk/duration_price.py index dadad05..724fe4b 100644 --- a/paapi5_python_sdk/duration_price.py +++ b/amazon/paapi5_python_sdk/duration_price.py @@ -27,8 +27,8 @@ import six -from paapi5_python_sdk.offer_price import OfferPrice # noqa: F401,E501 -from paapi5_python_sdk.unit_based_attribute import UnitBasedAttribute # noqa: F401,E501 +from .offer_price import OfferPrice # noqa: F401,E501 +from .unit_based_attribute import UnitBasedAttribute # noqa: F401,E501 class DurationPrice(object): diff --git a/paapi5_python_sdk/error_data.py b/amazon/paapi5_python_sdk/error_data.py similarity index 100% rename from paapi5_python_sdk/error_data.py rename to amazon/paapi5_python_sdk/error_data.py diff --git a/paapi5_python_sdk/external_ids.py b/amazon/paapi5_python_sdk/external_ids.py similarity index 98% rename from paapi5_python_sdk/external_ids.py rename to amazon/paapi5_python_sdk/external_ids.py index 17f87b5..ff545a7 100644 --- a/paapi5_python_sdk/external_ids.py +++ b/amazon/paapi5_python_sdk/external_ids.py @@ -27,7 +27,7 @@ import six -from paapi5_python_sdk.multi_valued_attribute import MultiValuedAttribute # noqa: F401,E501 +from .multi_valued_attribute import MultiValuedAttribute # noqa: F401,E501 class ExternalIds(object): diff --git a/paapi5_python_sdk/get_browse_nodes_request.py b/amazon/paapi5_python_sdk/get_browse_nodes_request.py similarity index 97% rename from paapi5_python_sdk/get_browse_nodes_request.py rename to amazon/paapi5_python_sdk/get_browse_nodes_request.py index 4ed3ae9..6d5d57b 100644 --- a/paapi5_python_sdk/get_browse_nodes_request.py +++ b/amazon/paapi5_python_sdk/get_browse_nodes_request.py @@ -27,8 +27,8 @@ import six -from paapi5_python_sdk.get_browse_nodes_resource import GetBrowseNodesResource # noqa: F401,E501 -from paapi5_python_sdk.partner_type import PartnerType # noqa: F401,E501 +from .get_browse_nodes_resource import GetBrowseNodesResource # noqa: F401,E501 +from .partner_type import PartnerType # noqa: F401,E501 class GetBrowseNodesRequest(object): diff --git a/paapi5_python_sdk/get_browse_nodes_resource.py b/amazon/paapi5_python_sdk/get_browse_nodes_resource.py similarity index 100% rename from paapi5_python_sdk/get_browse_nodes_resource.py rename to amazon/paapi5_python_sdk/get_browse_nodes_resource.py diff --git a/paapi5_python_sdk/get_browse_nodes_response.py b/amazon/paapi5_python_sdk/get_browse_nodes_response.py similarity index 96% rename from paapi5_python_sdk/get_browse_nodes_response.py rename to amazon/paapi5_python_sdk/get_browse_nodes_response.py index f74f76e..10e0a21 100644 --- a/paapi5_python_sdk/get_browse_nodes_response.py +++ b/amazon/paapi5_python_sdk/get_browse_nodes_response.py @@ -27,8 +27,8 @@ import six -from paapi5_python_sdk.browse_nodes_result import BrowseNodesResult # noqa: F401,E501 -from paapi5_python_sdk.error_data import ErrorData # noqa: F401,E501 +from .browse_nodes_result import BrowseNodesResult # noqa: F401,E501 +from .error_data import ErrorData # noqa: F401,E501 class GetBrowseNodesResponse(object): diff --git a/paapi5_python_sdk/get_items_request.py b/amazon/paapi5_python_sdk/get_items_request.py similarity index 96% rename from paapi5_python_sdk/get_items_request.py rename to amazon/paapi5_python_sdk/get_items_request.py index 4e369ff..567ba65 100644 --- a/paapi5_python_sdk/get_items_request.py +++ b/amazon/paapi5_python_sdk/get_items_request.py @@ -27,13 +27,13 @@ import six -from paapi5_python_sdk.condition import Condition # noqa: F401,E501 -from paapi5_python_sdk.get_items_resource import GetItemsResource # noqa: F401,E501 -from paapi5_python_sdk.item_id_type import ItemIdType # noqa: F401,E501 -from paapi5_python_sdk.merchant import Merchant # noqa: F401,E501 -from paapi5_python_sdk.offer_count import OfferCount # noqa: F401,E501 -from paapi5_python_sdk.partner_type import PartnerType # noqa: F401,E501 -from paapi5_python_sdk.properties import Properties # noqa: F401,E501 +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 class GetItemsRequest(object): diff --git a/paapi5_python_sdk/get_items_resource.py b/amazon/paapi5_python_sdk/get_items_resource.py similarity index 100% rename from paapi5_python_sdk/get_items_resource.py rename to amazon/paapi5_python_sdk/get_items_resource.py diff --git a/paapi5_python_sdk/get_items_response.py b/amazon/paapi5_python_sdk/get_items_response.py similarity index 96% rename from paapi5_python_sdk/get_items_response.py rename to amazon/paapi5_python_sdk/get_items_response.py index 9cc6510..fa22753 100644 --- a/paapi5_python_sdk/get_items_response.py +++ b/amazon/paapi5_python_sdk/get_items_response.py @@ -27,8 +27,8 @@ import six -from paapi5_python_sdk.error_data import ErrorData # noqa: F401,E501 -from paapi5_python_sdk.items_result import ItemsResult # noqa: F401,E501 +from .error_data import ErrorData # noqa: F401,E501 +from .items_result import ItemsResult # noqa: F401,E501 class GetItemsResponse(object): diff --git a/paapi5_python_sdk/get_variations_request.py b/amazon/paapi5_python_sdk/get_variations_request.py similarity index 96% rename from paapi5_python_sdk/get_variations_request.py rename to amazon/paapi5_python_sdk/get_variations_request.py index c78314c..0b1ea3a 100644 --- a/paapi5_python_sdk/get_variations_request.py +++ b/amazon/paapi5_python_sdk/get_variations_request.py @@ -27,12 +27,12 @@ import six -from paapi5_python_sdk.condition import Condition # noqa: F401,E501 -from paapi5_python_sdk.get_variations_resource import GetVariationsResource # noqa: F401,E501 -from paapi5_python_sdk.merchant import Merchant # noqa: F401,E501 -from paapi5_python_sdk.offer_count import OfferCount # noqa: F401,E501 -from paapi5_python_sdk.partner_type import PartnerType # noqa: F401,E501 -from paapi5_python_sdk.properties import Properties # noqa: F401,E501 +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 class GetVariationsRequest(object): diff --git a/paapi5_python_sdk/get_variations_resource.py b/amazon/paapi5_python_sdk/get_variations_resource.py similarity index 100% rename from paapi5_python_sdk/get_variations_resource.py rename to amazon/paapi5_python_sdk/get_variations_resource.py diff --git a/paapi5_python_sdk/get_variations_response.py b/amazon/paapi5_python_sdk/get_variations_response.py similarity index 96% rename from paapi5_python_sdk/get_variations_response.py rename to amazon/paapi5_python_sdk/get_variations_response.py index c99df31..287ee5e 100644 --- a/paapi5_python_sdk/get_variations_response.py +++ b/amazon/paapi5_python_sdk/get_variations_response.py @@ -27,8 +27,8 @@ import six -from paapi5_python_sdk.error_data import ErrorData # noqa: F401,E501 -from paapi5_python_sdk.variations_result import VariationsResult # noqa: F401,E501 +from .error_data import ErrorData # noqa: F401,E501 +from .variations_result import VariationsResult # noqa: F401,E501 class GetVariationsResponse(object): diff --git a/paapi5_python_sdk/image_size.py b/amazon/paapi5_python_sdk/image_size.py similarity index 100% rename from paapi5_python_sdk/image_size.py rename to amazon/paapi5_python_sdk/image_size.py diff --git a/paapi5_python_sdk/image_type.py b/amazon/paapi5_python_sdk/image_type.py similarity index 98% rename from paapi5_python_sdk/image_type.py rename to amazon/paapi5_python_sdk/image_type.py index b6537c5..1abf7eb 100644 --- a/paapi5_python_sdk/image_type.py +++ b/amazon/paapi5_python_sdk/image_type.py @@ -27,7 +27,7 @@ import six -from paapi5_python_sdk.image_size import ImageSize # noqa: F401,E501 +from .image_size import ImageSize # noqa: F401,E501 class ImageType(object): diff --git a/paapi5_python_sdk/images.py b/amazon/paapi5_python_sdk/images.py similarity index 98% rename from paapi5_python_sdk/images.py rename to amazon/paapi5_python_sdk/images.py index 4e67a45..cf46148 100644 --- a/paapi5_python_sdk/images.py +++ b/amazon/paapi5_python_sdk/images.py @@ -27,7 +27,7 @@ import six -from paapi5_python_sdk.image_type import ImageType # noqa: F401,E501 +from .image_type import ImageType # noqa: F401,E501 class Images(object): diff --git a/paapi5_python_sdk/item.py b/amazon/paapi5_python_sdk/item.py similarity index 95% rename from paapi5_python_sdk/item.py rename to amazon/paapi5_python_sdk/item.py index 23cb16a..6583aed 100644 --- a/paapi5_python_sdk/item.py +++ b/amazon/paapi5_python_sdk/item.py @@ -27,12 +27,12 @@ import six -from paapi5_python_sdk.browse_node_info import BrowseNodeInfo # noqa: F401,E501 -from paapi5_python_sdk.images import Images # noqa: F401,E501 -from paapi5_python_sdk.item_info import ItemInfo # noqa: F401,E501 -from paapi5_python_sdk.offers import Offers # noqa: F401,E501 -from paapi5_python_sdk.rental_offers import RentalOffers # noqa: F401,E501 -from paapi5_python_sdk.variation_attribute import VariationAttribute # noqa: F401,E501 +from .browse_node_info import BrowseNodeInfo # 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 class Item(object): diff --git a/paapi5_python_sdk/item_id_type.py b/amazon/paapi5_python_sdk/item_id_type.py similarity index 100% rename from paapi5_python_sdk/item_id_type.py rename to amazon/paapi5_python_sdk/item_id_type.py diff --git a/paapi5_python_sdk/item_info.py b/amazon/paapi5_python_sdk/item_info.py similarity index 92% rename from paapi5_python_sdk/item_info.py rename to amazon/paapi5_python_sdk/item_info.py index ec8c37e..c03de48 100644 --- a/paapi5_python_sdk/item_info.py +++ b/amazon/paapi5_python_sdk/item_info.py @@ -27,17 +27,17 @@ import six -from paapi5_python_sdk.by_line_info import ByLineInfo # noqa: F401,E501 -from paapi5_python_sdk.classifications import Classifications # noqa: F401,E501 -from paapi5_python_sdk.content_info import ContentInfo # noqa: F401,E501 -from paapi5_python_sdk.content_rating import ContentRating # noqa: F401,E501 -from paapi5_python_sdk.external_ids import ExternalIds # noqa: F401,E501 -from paapi5_python_sdk.manufacture_info import ManufactureInfo # noqa: F401,E501 -from paapi5_python_sdk.multi_valued_attribute import MultiValuedAttribute # noqa: F401,E501 -from paapi5_python_sdk.product_info import ProductInfo # noqa: F401,E501 -from paapi5_python_sdk.single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 -from paapi5_python_sdk.technical_info import TechnicalInfo # noqa: F401,E501 -from paapi5_python_sdk.trade_in_info import TradeInInfo # noqa: F401,E501 +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 class ItemInfo(object): diff --git a/paapi5_python_sdk/items_result.py b/amazon/paapi5_python_sdk/items_result.py similarity index 98% rename from paapi5_python_sdk/items_result.py rename to amazon/paapi5_python_sdk/items_result.py index 714d848..4c4192a 100644 --- a/paapi5_python_sdk/items_result.py +++ b/amazon/paapi5_python_sdk/items_result.py @@ -27,7 +27,7 @@ import six -from paapi5_python_sdk.item import Item # noqa: F401,E501 +from .item import Item # noqa: F401,E501 class ItemsResult(object): diff --git a/paapi5_python_sdk/language_type.py b/amazon/paapi5_python_sdk/language_type.py similarity index 100% rename from paapi5_python_sdk/language_type.py rename to amazon/paapi5_python_sdk/language_type.py diff --git a/paapi5_python_sdk/languages.py b/amazon/paapi5_python_sdk/languages.py similarity index 98% rename from paapi5_python_sdk/languages.py rename to amazon/paapi5_python_sdk/languages.py index 7687180..f1f8db0 100644 --- a/paapi5_python_sdk/languages.py +++ b/amazon/paapi5_python_sdk/languages.py @@ -27,7 +27,7 @@ import six -from paapi5_python_sdk.language_type import LanguageType # noqa: F401,E501 +from .language_type import LanguageType # noqa: F401,E501 class Languages(object): diff --git a/paapi5_python_sdk/manufacture_info.py b/amazon/paapi5_python_sdk/manufacture_info.py similarity index 97% rename from paapi5_python_sdk/manufacture_info.py rename to amazon/paapi5_python_sdk/manufacture_info.py index b4b44cd..ccc9fe7 100644 --- a/paapi5_python_sdk/manufacture_info.py +++ b/amazon/paapi5_python_sdk/manufacture_info.py @@ -27,7 +27,7 @@ import six -from paapi5_python_sdk.single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 +from .single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 class ManufactureInfo(object): diff --git a/paapi5_python_sdk/max_price.py b/amazon/paapi5_python_sdk/max_price.py similarity index 100% rename from paapi5_python_sdk/max_price.py rename to amazon/paapi5_python_sdk/max_price.py diff --git a/paapi5_python_sdk/merchant.py b/amazon/paapi5_python_sdk/merchant.py similarity index 100% rename from paapi5_python_sdk/merchant.py rename to amazon/paapi5_python_sdk/merchant.py diff --git a/paapi5_python_sdk/min_price.py b/amazon/paapi5_python_sdk/min_price.py similarity index 100% rename from paapi5_python_sdk/min_price.py rename to amazon/paapi5_python_sdk/min_price.py diff --git a/paapi5_python_sdk/min_reviews_rating.py b/amazon/paapi5_python_sdk/min_reviews_rating.py similarity index 100% rename from paapi5_python_sdk/min_reviews_rating.py rename to amazon/paapi5_python_sdk/min_reviews_rating.py diff --git a/paapi5_python_sdk/min_saving_percent.py b/amazon/paapi5_python_sdk/min_saving_percent.py similarity index 100% rename from paapi5_python_sdk/min_saving_percent.py rename to amazon/paapi5_python_sdk/min_saving_percent.py diff --git a/paapi5_python_sdk/multi_valued_attribute.py b/amazon/paapi5_python_sdk/multi_valued_attribute.py similarity index 100% rename from paapi5_python_sdk/multi_valued_attribute.py rename to amazon/paapi5_python_sdk/multi_valued_attribute.py diff --git a/paapi5_python_sdk/offer_availability.py b/amazon/paapi5_python_sdk/offer_availability.py similarity index 100% rename from paapi5_python_sdk/offer_availability.py rename to amazon/paapi5_python_sdk/offer_availability.py diff --git a/paapi5_python_sdk/offer_condition.py b/amazon/paapi5_python_sdk/offer_condition.py similarity index 98% rename from paapi5_python_sdk/offer_condition.py rename to amazon/paapi5_python_sdk/offer_condition.py index 128174b..056091f 100644 --- a/paapi5_python_sdk/offer_condition.py +++ b/amazon/paapi5_python_sdk/offer_condition.py @@ -27,7 +27,7 @@ import six -from paapi5_python_sdk.offer_sub_condition import OfferSubCondition # noqa: F401,E501 +from .offer_sub_condition import OfferSubCondition # noqa: F401,E501 class OfferCondition(object): diff --git a/paapi5_python_sdk/offer_count.py b/amazon/paapi5_python_sdk/offer_count.py similarity index 100% rename from paapi5_python_sdk/offer_count.py rename to amazon/paapi5_python_sdk/offer_count.py diff --git a/paapi5_python_sdk/offer_delivery_info.py b/amazon/paapi5_python_sdk/offer_delivery_info.py similarity index 98% rename from paapi5_python_sdk/offer_delivery_info.py rename to amazon/paapi5_python_sdk/offer_delivery_info.py index ae67402..69ad748 100644 --- a/paapi5_python_sdk/offer_delivery_info.py +++ b/amazon/paapi5_python_sdk/offer_delivery_info.py @@ -27,7 +27,7 @@ import six -from paapi5_python_sdk.offer_shipping_charge import OfferShippingCharge # noqa: F401,E501 +from .offer_shipping_charge import OfferShippingCharge # noqa: F401,E501 class OfferDeliveryInfo(object): diff --git a/paapi5_python_sdk/offer_listing.py b/amazon/paapi5_python_sdk/offer_listing.py similarity index 94% rename from paapi5_python_sdk/offer_listing.py rename to amazon/paapi5_python_sdk/offer_listing.py index a513d20..0cb3be6 100644 --- a/paapi5_python_sdk/offer_listing.py +++ b/amazon/paapi5_python_sdk/offer_listing.py @@ -27,14 +27,14 @@ import six -from paapi5_python_sdk.offer_availability import OfferAvailability # noqa: F401,E501 -from paapi5_python_sdk.offer_condition import OfferCondition # noqa: F401,E501 -from paapi5_python_sdk.offer_delivery_info import OfferDeliveryInfo # noqa: F401,E501 -from paapi5_python_sdk.offer_loyalty_points import OfferLoyaltyPoints # noqa: F401,E501 -from paapi5_python_sdk.offer_merchant_info import OfferMerchantInfo # noqa: F401,E501 -from paapi5_python_sdk.offer_price import OfferPrice # noqa: F401,E501 -from paapi5_python_sdk.offer_program_eligibility import OfferProgramEligibility # noqa: F401,E501 -from paapi5_python_sdk.offer_promotion import OfferPromotion # 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_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 class OfferListing(object): diff --git a/paapi5_python_sdk/offer_loyalty_points.py b/amazon/paapi5_python_sdk/offer_loyalty_points.py similarity index 100% rename from paapi5_python_sdk/offer_loyalty_points.py rename to amazon/paapi5_python_sdk/offer_loyalty_points.py diff --git a/paapi5_python_sdk/offer_merchant_info.py b/amazon/paapi5_python_sdk/offer_merchant_info.py similarity index 100% rename from paapi5_python_sdk/offer_merchant_info.py rename to amazon/paapi5_python_sdk/offer_merchant_info.py diff --git a/paapi5_python_sdk/offer_price.py b/amazon/paapi5_python_sdk/offer_price.py similarity index 98% rename from paapi5_python_sdk/offer_price.py rename to amazon/paapi5_python_sdk/offer_price.py index 3463a66..343c9b5 100644 --- a/paapi5_python_sdk/offer_price.py +++ b/amazon/paapi5_python_sdk/offer_price.py @@ -27,7 +27,7 @@ import six -from paapi5_python_sdk.offer_savings import OfferSavings # noqa: F401,E501 +from .offer_savings import OfferSavings # noqa: F401,E501 class OfferPrice(object): diff --git a/paapi5_python_sdk/offer_program_eligibility.py b/amazon/paapi5_python_sdk/offer_program_eligibility.py similarity index 100% rename from paapi5_python_sdk/offer_program_eligibility.py rename to amazon/paapi5_python_sdk/offer_program_eligibility.py diff --git a/paapi5_python_sdk/offer_promotion.py b/amazon/paapi5_python_sdk/offer_promotion.py similarity index 100% rename from paapi5_python_sdk/offer_promotion.py rename to amazon/paapi5_python_sdk/offer_promotion.py diff --git a/paapi5_python_sdk/offer_savings.py b/amazon/paapi5_python_sdk/offer_savings.py similarity index 100% rename from paapi5_python_sdk/offer_savings.py rename to amazon/paapi5_python_sdk/offer_savings.py diff --git a/paapi5_python_sdk/offer_shipping_charge.py b/amazon/paapi5_python_sdk/offer_shipping_charge.py similarity index 100% rename from paapi5_python_sdk/offer_shipping_charge.py rename to amazon/paapi5_python_sdk/offer_shipping_charge.py diff --git a/paapi5_python_sdk/offer_sub_condition.py b/amazon/paapi5_python_sdk/offer_sub_condition.py similarity index 100% rename from paapi5_python_sdk/offer_sub_condition.py rename to amazon/paapi5_python_sdk/offer_sub_condition.py diff --git a/paapi5_python_sdk/offer_summary.py b/amazon/paapi5_python_sdk/offer_summary.py similarity index 97% rename from paapi5_python_sdk/offer_summary.py rename to amazon/paapi5_python_sdk/offer_summary.py index 5fa2c14..f2363b2 100644 --- a/paapi5_python_sdk/offer_summary.py +++ b/amazon/paapi5_python_sdk/offer_summary.py @@ -27,8 +27,8 @@ import six -from paapi5_python_sdk.offer_condition import OfferCondition # noqa: F401,E501 -from paapi5_python_sdk.offer_price import OfferPrice # noqa: F401,E501 +from .offer_condition import OfferCondition # noqa: F401,E501 +from .offer_price import OfferPrice # noqa: F401,E501 class OfferSummary(object): diff --git a/paapi5_python_sdk/offers.py b/amazon/paapi5_python_sdk/offers.py similarity index 96% rename from paapi5_python_sdk/offers.py rename to amazon/paapi5_python_sdk/offers.py index 1454205..4565b7b 100644 --- a/paapi5_python_sdk/offers.py +++ b/amazon/paapi5_python_sdk/offers.py @@ -27,8 +27,8 @@ import six -from paapi5_python_sdk.offer_listing import OfferListing # noqa: F401,E501 -from paapi5_python_sdk.offer_summary import OfferSummary # noqa: F401,E501 +from .offer_listing import OfferListing # noqa: F401,E501 +from .offer_summary import OfferSummary # noqa: F401,E501 class Offers(object): diff --git a/paapi5_python_sdk/partner_type.py b/amazon/paapi5_python_sdk/partner_type.py similarity index 100% rename from paapi5_python_sdk/partner_type.py rename to amazon/paapi5_python_sdk/partner_type.py diff --git a/paapi5_python_sdk/price.py b/amazon/paapi5_python_sdk/price.py similarity index 98% rename from paapi5_python_sdk/price.py rename to amazon/paapi5_python_sdk/price.py index 7586b28..9fa403c 100644 --- a/paapi5_python_sdk/price.py +++ b/amazon/paapi5_python_sdk/price.py @@ -27,7 +27,7 @@ import six -from paapi5_python_sdk.offer_price import OfferPrice # noqa: F401,E501 +from .offer_price import OfferPrice # noqa: F401,E501 class Price(object): diff --git a/paapi5_python_sdk/product_advertising_api_client_exception.py b/amazon/paapi5_python_sdk/product_advertising_api_client_exception.py similarity index 98% rename from paapi5_python_sdk/product_advertising_api_client_exception.py rename to amazon/paapi5_python_sdk/product_advertising_api_client_exception.py index 77b712c..2e5cd35 100644 --- a/paapi5_python_sdk/product_advertising_api_client_exception.py +++ b/amazon/paapi5_python_sdk/product_advertising_api_client_exception.py @@ -27,7 +27,7 @@ import six -from paapi5_python_sdk.error_data import ErrorData # noqa: F401,E501 +from .error_data import ErrorData # noqa: F401,E501 class ProductAdvertisingAPIClientException(object): diff --git a/paapi5_python_sdk/product_advertising_api_service_exception.py b/amazon/paapi5_python_sdk/product_advertising_api_service_exception.py similarity index 100% rename from paapi5_python_sdk/product_advertising_api_service_exception.py rename to amazon/paapi5_python_sdk/product_advertising_api_service_exception.py diff --git a/paapi5_python_sdk/product_info.py b/amazon/paapi5_python_sdk/product_info.py similarity index 94% rename from paapi5_python_sdk/product_info.py rename to amazon/paapi5_python_sdk/product_info.py index d9dbc0b..d0558d1 100644 --- a/paapi5_python_sdk/product_info.py +++ b/amazon/paapi5_python_sdk/product_info.py @@ -27,10 +27,10 @@ import six -from paapi5_python_sdk.dimension_based_attribute import DimensionBasedAttribute # noqa: F401,E501 -from paapi5_python_sdk.single_boolean_valued_attribute import SingleBooleanValuedAttribute # noqa: F401,E501 -from paapi5_python_sdk.single_integer_valued_attribute import SingleIntegerValuedAttribute # noqa: F401,E501 -from paapi5_python_sdk.single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 +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 class ProductInfo(object): diff --git a/paapi5_python_sdk/properties.py b/amazon/paapi5_python_sdk/properties.py similarity index 100% rename from paapi5_python_sdk/properties.py rename to amazon/paapi5_python_sdk/properties.py diff --git a/paapi5_python_sdk/refinement.py b/amazon/paapi5_python_sdk/refinement.py similarity index 98% rename from paapi5_python_sdk/refinement.py rename to amazon/paapi5_python_sdk/refinement.py index 5d89f56..cce4c59 100644 --- a/paapi5_python_sdk/refinement.py +++ b/amazon/paapi5_python_sdk/refinement.py @@ -27,7 +27,7 @@ import six -from paapi5_python_sdk.refinement_bin import RefinementBin # noqa: F401,E501 +from .refinement_bin import RefinementBin # noqa: F401,E501 class Refinement(object): diff --git a/paapi5_python_sdk/refinement_bin.py b/amazon/paapi5_python_sdk/refinement_bin.py similarity index 100% rename from paapi5_python_sdk/refinement_bin.py rename to amazon/paapi5_python_sdk/refinement_bin.py diff --git a/paapi5_python_sdk/rental_offer_listing.py b/amazon/paapi5_python_sdk/rental_offer_listing.py similarity index 94% rename from paapi5_python_sdk/rental_offer_listing.py rename to amazon/paapi5_python_sdk/rental_offer_listing.py index 6859d5a..95936a6 100644 --- a/paapi5_python_sdk/rental_offer_listing.py +++ b/amazon/paapi5_python_sdk/rental_offer_listing.py @@ -27,11 +27,11 @@ import six -from paapi5_python_sdk.duration_price import DurationPrice # noqa: F401,E501 -from paapi5_python_sdk.offer_availability import OfferAvailability # noqa: F401,E501 -from paapi5_python_sdk.offer_condition import OfferCondition # noqa: F401,E501 -from paapi5_python_sdk.offer_delivery_info import OfferDeliveryInfo # noqa: F401,E501 -from paapi5_python_sdk.offer_merchant_info import OfferMerchantInfo # noqa: F401,E501 +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 class RentalOfferListing(object): diff --git a/paapi5_python_sdk/rental_offers.py b/amazon/paapi5_python_sdk/rental_offers.py similarity index 97% rename from paapi5_python_sdk/rental_offers.py rename to amazon/paapi5_python_sdk/rental_offers.py index c3f60c2..6fb4e09 100644 --- a/paapi5_python_sdk/rental_offers.py +++ b/amazon/paapi5_python_sdk/rental_offers.py @@ -27,7 +27,7 @@ import six -from paapi5_python_sdk.rental_offer_listing import RentalOfferListing # noqa: F401,E501 +from .rental_offer_listing import RentalOfferListing # noqa: F401,E501 class RentalOffers(object): diff --git a/paapi5_python_sdk/rest.py b/amazon/paapi5_python_sdk/rest.py similarity index 100% rename from paapi5_python_sdk/rest.py rename to amazon/paapi5_python_sdk/rest.py diff --git a/paapi5_python_sdk/search_items_request.py b/amazon/paapi5_python_sdk/search_items_request.py similarity index 96% rename from paapi5_python_sdk/search_items_request.py rename to amazon/paapi5_python_sdk/search_items_request.py index a552080..4d1107a 100644 --- a/paapi5_python_sdk/search_items_request.py +++ b/amazon/paapi5_python_sdk/search_items_request.py @@ -27,19 +27,19 @@ import six -from paapi5_python_sdk.availability import Availability # noqa: F401,E501 -from paapi5_python_sdk.condition import Condition # noqa: F401,E501 -from paapi5_python_sdk.delivery_flag import DeliveryFlag # noqa: F401,E501 -from paapi5_python_sdk.max_price import MaxPrice # noqa: F401,E501 -from paapi5_python_sdk.merchant import Merchant # noqa: F401,E501 -from paapi5_python_sdk.min_price import MinPrice # noqa: F401,E501 -from paapi5_python_sdk.min_reviews_rating import MinReviewsRating # noqa: F401,E501 -from paapi5_python_sdk.min_saving_percent import MinSavingPercent # noqa: F401,E501 -from paapi5_python_sdk.offer_count import OfferCount # noqa: F401,E501 -from paapi5_python_sdk.partner_type import PartnerType # noqa: F401,E501 -from paapi5_python_sdk.properties import Properties # noqa: F401,E501 -from paapi5_python_sdk.search_items_resource import SearchItemsResource # noqa: F401,E501 -from paapi5_python_sdk.sort_by import SortBy # noqa: F401,E501 +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 class SearchItemsRequest(object): diff --git a/paapi5_python_sdk/search_items_resource.py b/amazon/paapi5_python_sdk/search_items_resource.py similarity index 100% rename from paapi5_python_sdk/search_items_resource.py rename to amazon/paapi5_python_sdk/search_items_resource.py diff --git a/paapi5_python_sdk/search_items_response.py b/amazon/paapi5_python_sdk/search_items_response.py similarity index 96% rename from paapi5_python_sdk/search_items_response.py rename to amazon/paapi5_python_sdk/search_items_response.py index a95f657..8c66fc7 100644 --- a/paapi5_python_sdk/search_items_response.py +++ b/amazon/paapi5_python_sdk/search_items_response.py @@ -27,8 +27,8 @@ import six -from paapi5_python_sdk.error_data import ErrorData # noqa: F401,E501 -from paapi5_python_sdk.search_result import SearchResult # noqa: F401,E501 +from .error_data import ErrorData # noqa: F401,E501 +from .search_result import SearchResult # noqa: F401,E501 class SearchItemsResponse(object): diff --git a/paapi5_python_sdk/search_refinements.py b/amazon/paapi5_python_sdk/search_refinements.py similarity index 98% rename from paapi5_python_sdk/search_refinements.py rename to amazon/paapi5_python_sdk/search_refinements.py index fc54d3c..2741661 100644 --- a/paapi5_python_sdk/search_refinements.py +++ b/amazon/paapi5_python_sdk/search_refinements.py @@ -27,7 +27,7 @@ import six -from paapi5_python_sdk.refinement import Refinement # noqa: F401,E501 +from .refinement import Refinement # noqa: F401,E501 class SearchRefinements(object): diff --git a/paapi5_python_sdk/search_result.py b/amazon/paapi5_python_sdk/search_result.py similarity index 97% rename from paapi5_python_sdk/search_result.py rename to amazon/paapi5_python_sdk/search_result.py index bd94199..6ba2d5e 100644 --- a/paapi5_python_sdk/search_result.py +++ b/amazon/paapi5_python_sdk/search_result.py @@ -27,8 +27,8 @@ import six -from paapi5_python_sdk.item import Item # noqa: F401,E501 -from paapi5_python_sdk.search_refinements import SearchRefinements # noqa: F401,E501 +from .item import Item # noqa: F401,E501 +from .search_refinements import SearchRefinements # noqa: F401,E501 class SearchResult(object): diff --git a/paapi5_python_sdk/single_boolean_valued_attribute.py b/amazon/paapi5_python_sdk/single_boolean_valued_attribute.py similarity index 100% rename from paapi5_python_sdk/single_boolean_valued_attribute.py rename to amazon/paapi5_python_sdk/single_boolean_valued_attribute.py diff --git a/paapi5_python_sdk/single_integer_valued_attribute.py b/amazon/paapi5_python_sdk/single_integer_valued_attribute.py similarity index 100% rename from paapi5_python_sdk/single_integer_valued_attribute.py rename to amazon/paapi5_python_sdk/single_integer_valued_attribute.py diff --git a/paapi5_python_sdk/single_string_valued_attribute.py b/amazon/paapi5_python_sdk/single_string_valued_attribute.py similarity index 100% rename from paapi5_python_sdk/single_string_valued_attribute.py rename to amazon/paapi5_python_sdk/single_string_valued_attribute.py diff --git a/paapi5_python_sdk/sort_by.py b/amazon/paapi5_python_sdk/sort_by.py similarity index 100% rename from paapi5_python_sdk/sort_by.py rename to amazon/paapi5_python_sdk/sort_by.py diff --git a/paapi5_python_sdk/technical_info.py b/amazon/paapi5_python_sdk/technical_info.py similarity index 97% rename from paapi5_python_sdk/technical_info.py rename to amazon/paapi5_python_sdk/technical_info.py index c70d5b6..508af10 100644 --- a/paapi5_python_sdk/technical_info.py +++ b/amazon/paapi5_python_sdk/technical_info.py @@ -27,7 +27,7 @@ import six -from paapi5_python_sdk.multi_valued_attribute import MultiValuedAttribute # noqa: F401,E501 +from .multi_valued_attribute import MultiValuedAttribute # noqa: F401,E501 class TechnicalInfo(object): diff --git a/paapi5_python_sdk/trade_in_info.py b/amazon/paapi5_python_sdk/trade_in_info.py similarity index 98% rename from paapi5_python_sdk/trade_in_info.py rename to amazon/paapi5_python_sdk/trade_in_info.py index 5c54e5f..248b4e1 100644 --- a/paapi5_python_sdk/trade_in_info.py +++ b/amazon/paapi5_python_sdk/trade_in_info.py @@ -27,7 +27,7 @@ import six -from paapi5_python_sdk.trade_in_price import TradeInPrice # noqa: F401,E501 +from .trade_in_price import TradeInPrice # noqa: F401,E501 class TradeInInfo(object): diff --git a/paapi5_python_sdk/trade_in_price.py b/amazon/paapi5_python_sdk/trade_in_price.py similarity index 100% rename from paapi5_python_sdk/trade_in_price.py rename to amazon/paapi5_python_sdk/trade_in_price.py diff --git a/paapi5_python_sdk/unit_based_attribute.py b/amazon/paapi5_python_sdk/unit_based_attribute.py similarity index 100% rename from paapi5_python_sdk/unit_based_attribute.py rename to amazon/paapi5_python_sdk/unit_based_attribute.py diff --git a/paapi5_python_sdk/variation_attribute.py b/amazon/paapi5_python_sdk/variation_attribute.py similarity index 100% rename from paapi5_python_sdk/variation_attribute.py rename to amazon/paapi5_python_sdk/variation_attribute.py diff --git a/paapi5_python_sdk/variation_dimension.py b/amazon/paapi5_python_sdk/variation_dimension.py similarity index 100% rename from paapi5_python_sdk/variation_dimension.py rename to amazon/paapi5_python_sdk/variation_dimension.py diff --git a/paapi5_python_sdk/variation_summary.py b/amazon/paapi5_python_sdk/variation_summary.py similarity index 97% rename from paapi5_python_sdk/variation_summary.py rename to amazon/paapi5_python_sdk/variation_summary.py index a5a0e8e..e8aeea4 100644 --- a/paapi5_python_sdk/variation_summary.py +++ b/amazon/paapi5_python_sdk/variation_summary.py @@ -27,8 +27,8 @@ import six -from paapi5_python_sdk.price import Price # noqa: F401,E501 -from paapi5_python_sdk.variation_dimension import VariationDimension # noqa: F401,E501 +from .price import Price # noqa: F401,E501 +from .variation_dimension import VariationDimension # noqa: F401,E501 class VariationSummary(object): diff --git a/paapi5_python_sdk/variations_result.py b/amazon/paapi5_python_sdk/variations_result.py similarity index 96% rename from paapi5_python_sdk/variations_result.py rename to amazon/paapi5_python_sdk/variations_result.py index 0f3206a..9ce3c66 100644 --- a/paapi5_python_sdk/variations_result.py +++ b/amazon/paapi5_python_sdk/variations_result.py @@ -27,8 +27,8 @@ import six -from paapi5_python_sdk.item import Item # noqa: F401,E501 -from paapi5_python_sdk.variation_summary import VariationSummary # noqa: F401,E501 +from .item import Item # noqa: F401,E501 +from .variation_summary import VariationSummary # noqa: F401,E501 class VariationsResult(object): diff --git a/paapi5_python_sdk/website_sales_rank.py b/amazon/paapi5_python_sdk/website_sales_rank.py similarity index 100% rename from paapi5_python_sdk/website_sales_rank.py rename to amazon/paapi5_python_sdk/website_sales_rank.py diff --git a/paapi5_python_sdk/__init__.py b/paapi5_python_sdk/__init__.py deleted file mode 100644 index df27015..0000000 --- a/paapi5_python_sdk/__init__.py +++ /dev/null @@ -1,123 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -from __future__ import absolute_import - -""" - Copyright 2019 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 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -# import apis into sdk package -from paapi5_python_sdk.api.default_api import DefaultApi - -# import auth into sdk package -from paapi5_python_sdk.auth.sig_v4 import AWSV4Auth - -# import ApiClient -from paapi5_python_sdk.api_client import ApiClient -from paapi5_python_sdk.configuration import Configuration -# import models into sdk package -from paapi5_python_sdk.availability import Availability -from paapi5_python_sdk.browse_node import BrowseNode -from paapi5_python_sdk.browse_node_ancestor import BrowseNodeAncestor -from paapi5_python_sdk.browse_node_child import BrowseNodeChild -from paapi5_python_sdk.browse_node_children import BrowseNodeChildren -from paapi5_python_sdk.browse_node_info import BrowseNodeInfo -from paapi5_python_sdk.browse_nodes_result import BrowseNodesResult -from paapi5_python_sdk.by_line_info import ByLineInfo -from paapi5_python_sdk.classifications import Classifications -from paapi5_python_sdk.condition import Condition -from paapi5_python_sdk.content_info import ContentInfo -from paapi5_python_sdk.content_rating import ContentRating -from paapi5_python_sdk.contributor import Contributor -from paapi5_python_sdk.delivery_flag import DeliveryFlag -from paapi5_python_sdk.dimension_based_attribute import DimensionBasedAttribute -from paapi5_python_sdk.duration_price import DurationPrice -from paapi5_python_sdk.error_data import ErrorData -from paapi5_python_sdk.external_ids import ExternalIds -from paapi5_python_sdk.get_browse_nodes_request import GetBrowseNodesRequest -from paapi5_python_sdk.get_browse_nodes_resource import GetBrowseNodesResource -from paapi5_python_sdk.get_browse_nodes_response import GetBrowseNodesResponse -from paapi5_python_sdk.get_items_request import GetItemsRequest -from paapi5_python_sdk.get_items_resource import GetItemsResource -from paapi5_python_sdk.get_items_response import GetItemsResponse -from paapi5_python_sdk.get_variations_request import GetVariationsRequest -from paapi5_python_sdk.get_variations_resource import GetVariationsResource -from paapi5_python_sdk.get_variations_response import GetVariationsResponse -from paapi5_python_sdk.image_size import ImageSize -from paapi5_python_sdk.image_type import ImageType -from paapi5_python_sdk.images import Images -from paapi5_python_sdk.item import Item -from paapi5_python_sdk.item_id_type import ItemIdType -from paapi5_python_sdk.item_info import ItemInfo -from paapi5_python_sdk.items_result import ItemsResult -from paapi5_python_sdk.language_type import LanguageType -from paapi5_python_sdk.languages import Languages -from paapi5_python_sdk.manufacture_info import ManufactureInfo -from paapi5_python_sdk.max_price import MaxPrice -from paapi5_python_sdk.merchant import Merchant -from paapi5_python_sdk.min_price import MinPrice -from paapi5_python_sdk.min_reviews_rating import MinReviewsRating -from paapi5_python_sdk.min_saving_percent import MinSavingPercent -from paapi5_python_sdk.multi_valued_attribute import MultiValuedAttribute -from paapi5_python_sdk.offer_availability import OfferAvailability -from paapi5_python_sdk.offer_condition import OfferCondition -from paapi5_python_sdk.offer_count import OfferCount -from paapi5_python_sdk.offer_delivery_info import OfferDeliveryInfo -from paapi5_python_sdk.offer_listing import OfferListing -from paapi5_python_sdk.offer_loyalty_points import OfferLoyaltyPoints -from paapi5_python_sdk.offer_merchant_info import OfferMerchantInfo -from paapi5_python_sdk.offer_price import OfferPrice -from paapi5_python_sdk.offer_program_eligibility import OfferProgramEligibility -from paapi5_python_sdk.offer_promotion import OfferPromotion -from paapi5_python_sdk.offer_savings import OfferSavings -from paapi5_python_sdk.offer_shipping_charge import OfferShippingCharge -from paapi5_python_sdk.offer_sub_condition import OfferSubCondition -from paapi5_python_sdk.offer_summary import OfferSummary -from paapi5_python_sdk.offers import Offers -from paapi5_python_sdk.partner_type import PartnerType -from paapi5_python_sdk.price import Price -from paapi5_python_sdk.product_advertising_api_client_exception import ProductAdvertisingAPIClientException -from paapi5_python_sdk.product_advertising_api_service_exception import ProductAdvertisingAPIServiceException -from paapi5_python_sdk.product_info import ProductInfo -from paapi5_python_sdk.properties import Properties -from paapi5_python_sdk.refinement import Refinement -from paapi5_python_sdk.refinement_bin import RefinementBin -from paapi5_python_sdk.rental_offer_listing import RentalOfferListing -from paapi5_python_sdk.rental_offers import RentalOffers -from paapi5_python_sdk.search_items_request import SearchItemsRequest -from paapi5_python_sdk.search_items_resource import SearchItemsResource -from paapi5_python_sdk.search_items_response import SearchItemsResponse -from paapi5_python_sdk.search_refinements import SearchRefinements -from paapi5_python_sdk.search_result import SearchResult -from paapi5_python_sdk.single_boolean_valued_attribute import SingleBooleanValuedAttribute -from paapi5_python_sdk.single_integer_valued_attribute import SingleIntegerValuedAttribute -from paapi5_python_sdk.single_string_valued_attribute import SingleStringValuedAttribute -from paapi5_python_sdk.sort_by import SortBy -from paapi5_python_sdk.technical_info import TechnicalInfo -from paapi5_python_sdk.trade_in_info import TradeInInfo -from paapi5_python_sdk.trade_in_price import TradeInPrice -from paapi5_python_sdk.unit_based_attribute import UnitBasedAttribute -from paapi5_python_sdk.variation_attribute import VariationAttribute -from paapi5_python_sdk.variation_dimension import VariationDimension -from paapi5_python_sdk.variation_summary import VariationSummary -from paapi5_python_sdk.variations_result import VariationsResult -from paapi5_python_sdk.website_sales_rank import WebsiteSalesRank From eec9fc978461042e71521813314921aeaad38ea5 Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Tue, 13 Jul 2021 19:37:18 +0200 Subject: [PATCH 63/67] Added warning and moved old README --- amazon/README.md | 123 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 amazon/README.md diff --git a/amazon/README.md b/amazon/README.md new file mode 100644 index 0000000..25a3a02 --- /dev/null +++ b/amazon/README.md @@ -0,0 +1,123 @@ +# Amazon Product Advertising API 5.0 wrapper for Python + +A simple Python wrapper for the [last version of the Amazon Product Advertising API](https://webservices.amazon.com/paapi5/documentation/quick-start/using-sdk.html). This module allows to get product information from Amazon using the official API in an easier way. + +[![PyPI](https://img.shields.io/pypi/v/python-amazon-paapi?color=%231182C2&label=PyPI)](https://pypi.org/project/python-amazon-paapi/) +[![Python](https://img.shields.io/badge/Python-2.x%20%7C%203.x-%23FFD140)](https://www.python.org/) +[![License](https://img.shields.io/badge/License-MIT-%23e83633)](https://github.com/sergioteula/python-amazon-paapi/blob/master/LICENSE) +[![Support](https://img.shields.io/badge/Support-Good-brightgreen)](https://github.com/sergioteula/python-amazon-paapi/issues) +[![Amazon API](https://img.shields.io/badge/Amazon%20API-5.0-%23FD9B15)](https://webservices.amazon.com/paapi5/documentation/) + +> :warning: **This version is deprecated and it will be removed in the future. Please use [this](https://github.com/sergioteula/python-amazon-paapi).** + +## Features + +- Object oriented interface for simple usage. +- Get information about a product through its ASIN or URL. +- Get item variations or search for products on Amazon. +- Get browse nodes information. +- Get multiple results at once without the 10 items limitation from Amazon. +- Configurable throttling to avoid requests exceptions. +- Built-in serializer for Django REST framework. +- Support for [all available countries](https://github.com/sergioteula/python-amazon-paapi/blob/master/amazon/paapi.py#L31). +- Reorganized product information [structure](https://github.com/sergioteula/python-amazon-paapi/blob/master/PRODUCT.md) for simple use. +- Ask for new features through the [issues](https://github.com/sergioteula/python-amazon-paapi/issues) section. +- Join our [Telegram group](https://t.me/PythonAmazonPAAPI) for support or development. + +## Installation + +You can install or upgrade the module with: + + pip install python-amazon-paapi --upgrade + +If you get `ModuleNotFoundError`, try installing this: + + pip install amightygirl.paapi5-python-sdk + +## Usage guide + +**Basic usage:** + +```python +from amazon.paapi import AmazonApi +amazon = AmazonApi(KEY, SECRET, TAG, COUNTRY) +product = amazon.get_product('B01N5IB20Q') +print(product.title) +``` + +**Get multiple product information:** + +```python +product = amazon.get_products('B01N5IB20Q,B01F9G43WU') +print(product[0].images.large) +print(product[1].prices.price.value) +``` + +**Use URL insted of ASIN:** + +```python +product = amazon.get_product('https://www.amazon.com/dp/B01N5IB20Q') +``` + +**Get product variations:** + +```python +product = amazon.get_variations('B01N5IB20Q') +print(product[0].title) +``` + +**Search product:** + +```python +product = amazon.search_products(item_count=25, keywords='speaker') +print(product[14].url) +``` + +**Get browse node information:** + +```python +node = amazon.get_browsenodes(browse_nodes=browsenodes_list) +``` + +**Get the ASIN from a URL:** + +```python +from amazon.tools import get_asin +asin = get_asin('https://www.amazon.com/dp/B01N5IB20Q') +``` + +**Throttling:** + +Throttling value must be `greater than 0` or `False` to disable it. This value throttles requests to a maximum of one request every `1 / value` seconds. Note that this value is a per-worker throttling, so applications with multiple workers may make more requests per second. Throttling value is [set by default](https://github.com/sergioteula/python-amazon-paapi/blob/master/amazon/paapi.py#L36) to `0.8` or one request every 1.25 seconds. + +```python +amazon = AmazonApi(KEY, SECRET, TAG, COUNTRY, throttling=0.5) # Max one request every two seconds +amazon = AmazonApi(KEY, SECRET, TAG, COUNTRY, throttling=False) # Unlimited requests per second +``` + +**Serializer for Django:** + +We provide a serializer for Django REST framework, which speeds up your API +implementation. + +```python +from amazon.serializers import AmazonProductSerializer +from rest_framework import serializers + +serialized_product = AmazonProductSerializer(product) +serialized_product.data +``` + +If you want to serialize a list of products: + +```python +serialized_products = AmazonProductSerializer(products, many=True) +serialized_products.data +``` + +For more information on how to work with serializers, check the documentation for +[Django REST framework](https://www.django-rest-framework.org/api-guide/serializers/). + +## License + +Copyright © 2020 Sergio Abad. See [license](https://github.com/sergioteula/python-amazon-paapi/blob/master/LICENSE) for details. From eda722db09c4bbf6c17c4e0c6dbc2a20f6f41beb Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Tue, 13 Jul 2021 20:03:21 +0200 Subject: [PATCH 64/67] Updated readme --- README.md | 81 ++++++++++++++-------------------------- amazon_paapi/__init__.py | 1 + 2 files changed, 30 insertions(+), 52 deletions(-) diff --git a/README.md b/README.md index bf0acab..8f63ba3 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # Amazon Product Advertising API 5.0 wrapper for Python -A simple Python wrapper for the [last version of the Amazon Product Advertising API](https://webservices.amazon.com/paapi5/documentation/quick-start/using-sdk.html). This module allows to get product information from Amazon using the official API in an easier way. +A simple Python wrapper for the [last version of the Amazon Product Advertising API](https://webservices.amazon.com/paapi5/documentation/quick-start/using-sdk.html). This module allows interacting with Amazon using the official API in an easier way. [![PyPI](https://img.shields.io/pypi/v/python-amazon-paapi?color=%231182C2&label=PyPI)](https://pypi.org/project/python-amazon-paapi/) -[![Python](https://img.shields.io/badge/Python-2.x%20%7C%203.x-%23FFD140)](https://www.python.org/) +[![Python](https://img.shields.io/badge/Python->3.6-%23FFD140)](https://www.python.org/) [![License](https://img.shields.io/badge/License-MIT-%23e83633)](https://github.com/sergioteula/python-amazon-paapi/blob/master/LICENSE) [![Support](https://img.shields.io/badge/Support-Good-brightgreen)](https://github.com/sergioteula/python-amazon-paapi/issues) [![Amazon API](https://img.shields.io/badge/Amazon%20API-5.0-%23FD9B15)](https://webservices.amazon.com/paapi5/documentation/) @@ -16,9 +16,8 @@ A simple Python wrapper for the [last version of the Amazon Product Advertising - Get browse nodes information. - Get multiple results at once without the 10 items limitation from Amazon. - Configurable throttling to avoid requests exceptions. -- Built-in serializer for Django REST framework. +- Type hints to help you coding. - Support for [all available countries](https://github.com/sergioteula/python-amazon-paapi/blob/master/amazon/paapi.py#L31). -- Reorganized product information [structure](https://github.com/sergioteula/python-amazon-paapi/blob/master/PRODUCT.md) for simple use. - Ask for new features through the [issues](https://github.com/sergioteula/python-amazon-paapi/issues) section. - Join our [Telegram group](https://t.me/PythonAmazonPAAPI) for support or development. @@ -28,94 +27,72 @@ You can install or upgrade the module with: pip install python-amazon-paapi --upgrade -If you get `ModuleNotFoundError`, try installing this: - - pip install amightygirl.paapi5-python-sdk - ## Usage guide **Basic usage:** ```python -from amazon.paapi import AmazonApi +from amazon_paapi import AmazonApi amazon = AmazonApi(KEY, SECRET, TAG, COUNTRY) -product = amazon.get_product('B01N5IB20Q') -print(product.title) +item = amazon.get_items('B01N5IB20Q')[0] +print(item.item_info.title.display_value) # Item title ``` -**Get multiple product information:** +**Get multiple items information:** ```python -product = amazon.get_products('B01N5IB20Q,B01F9G43WU') -print(product[0].images.large) -print(product[1].prices.price.value) +items = amazon.get_items(['B01N5IB20Q', 'B01F9G43WU']) +for item in items: + print(item.images.primary.large.url) # Primary image url + print(item.offers.listings[0].price.amount) # Current price ``` **Use URL insted of ASIN:** ```python -product = amazon.get_product('https://www.amazon.com/dp/B01N5IB20Q') +item = amazon.get_items('https://www.amazon.com/dp/B01N5IB20Q') ``` -**Get product variations:** +**Get item variations:** ```python -product = amazon.get_variations('B01N5IB20Q') -print(product[0].title) +variations = amazon.get_variations('B01N5IB20Q') +for item in variations.items: + print(item.detail_page_url) # Affiliate url ``` -**Search product:** +**Search items:** ```python -product = amazon.search_products(item_count=25, keywords='speaker') -print(product[14].url) +search_result = amazon.search_items(keywords='nintendo') +for item in search_result.items: + print(item.item_info.product_info.color) # Item color ``` **Get browse node information:** ```python -node = amazon.get_browsenodes(browse_nodes=browsenodes_list) +browse_nodes = amazon.get_browse_nodes(['667049031', '599385031']) +for browse_node in browse_nodes: + print(browse_node.display_name) # The name of the node ``` -**Get the ASIN from a URL:** +**Get the ASIN from URL:** ```python -from amazon.tools import get_asin +from amazon_paapi import get_asin asin = get_asin('https://www.amazon.com/dp/B01N5IB20Q') ``` **Throttling:** -Throttling value must be `greater than 0` or `False` to disable it. This value throttles requests to a maximum of one request every `1 / value` seconds. Note that this value is a per-worker throttling, so applications with multiple workers may make more requests per second. Throttling value is [set by default](https://github.com/sergioteula/python-amazon-paapi/blob/master/amazon/paapi.py#L36) to `0.8` or one request every 1.25 seconds. +Throttling value represents the wait time in seconds between API calls, being the default value 1 second. Use it to avoid reaching Amazon request limits. ```python -amazon = AmazonApi(KEY, SECRET, TAG, COUNTRY, throttling=0.5) # Max one request every two seconds -amazon = AmazonApi(KEY, SECRET, TAG, COUNTRY, throttling=False) # Unlimited requests per second +amazon = AmazonApi(KEY, SECRET, TAG, COUNTRY, throttling=4) # Makes 1 request every 4 seconds +amazon = AmazonApi(KEY, SECRET, TAG, COUNTRY, throttling=0) # No wait time between requests ``` -**Serializer for Django:** - -We provide a serializer for Django REST framework, which speeds up your API -implementation. - -```python -from amazon.serializers import AmazonProductSerializer -from rest_framework import serializers - -serialized_product = AmazonProductSerializer(product) -serialized_product.data -``` - -If you want to serialize a list of products: - -```python -serialized_products = AmazonProductSerializer(products, many=True) -serialized_products.data -``` - -For more information on how to work with serializers, check the documentation for -[Django REST framework](https://www.django-rest-framework.org/api-guide/serializers/). - ## License -Copyright © 2020 Sergio Abad. See [license](https://github.com/sergioteula/python-amazon-paapi/blob/master/LICENSE) for details. +Copyright © 2021 Sergio Abad. See [license](https://github.com/sergioteula/python-amazon-paapi/blob/master/LICENSE) for details. diff --git a/amazon_paapi/__init__.py b/amazon_paapi/__init__.py index dc57f67..621b9a5 100644 --- a/amazon_paapi/__init__.py +++ b/amazon_paapi/__init__.py @@ -3,3 +3,4 @@ __author__ = 'Sergio Abad' from .api import AmazonApi +from .tools import get_asin From 4186a4233d1c1bb032802733c5cc185924eb91ad Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Tue, 13 Jul 2021 20:15:13 +0200 Subject: [PATCH 65/67] Added compatibility with Python 3.6.x --- amazon_paapi/api.py | 20 ++++++++++---------- amazon_paapi/helpers/arguments.py | 12 ++++++------ amazon_paapi/helpers/generators.py | 6 +++--- amazon_paapi/helpers/requests.py | 9 +++++---- amazon_paapi/models/browse_nodes_result.py | 3 ++- amazon_paapi/models/item_result.py | 15 ++++++++------- amazon_paapi/models/search_result.py | 3 ++- amazon_paapi/models/variations_result.py | 7 ++++--- 8 files changed, 40 insertions(+), 35 deletions(-) diff --git a/amazon_paapi/api.py b/amazon_paapi/api.py index da625f6..8a7f3ca 100644 --- a/amazon_paapi/api.py +++ b/amazon_paapi/api.py @@ -11,7 +11,7 @@ from .helpers import requests from .helpers.generators import get_list_chunks -from typing import Union +from typing import List, Union import time @@ -49,12 +49,12 @@ def __init__(self, key: str, secret: str, tag: str, country: models.Country, thr def get_items(self, - items: Union[str, list[str]], + items: Union[str, List[str]], condition: models.Condition = None, merchant: models.Merchant = None, currency_of_preference: str = None, - languages_of_preference: list[str] = None, - **kwargs) -> list[models.Item]: + languages_of_preference: List[str] = None, + **kwargs) -> List[models.Item]: """Get items information from Amazon. @@ -113,8 +113,8 @@ def search_items(self, browse_node_id: str = None, condition: models.Condition = None, currency_of_preference: str = None, - delivery_flags: list[str] = None, - languages_of_preference: list[str] = None, + delivery_flags: List[str] = None, + languages_of_preference: List[str] = None, merchant: models.Merchant = None, max_price: int = None, min_price: int = None, @@ -211,7 +211,7 @@ def get_variations(self, variation_page: int = None, condition: models.Condition = None, currency_of_preference: str = None, - languages_of_preference: list[str] = None, + languages_of_preference: List[str] = None, merchant: models.Merchant = None, **kwargs) -> models.VariationsResult: """Returns a set of items that are the same product, but differ according to a @@ -261,9 +261,9 @@ def get_variations(self, def get_browse_nodes(self, - browse_node_ids: list[str], - languages_of_preference: list[str] = None, - **kwargs) -> list[models.BrowseNode]: + browse_node_ids: List[str], + languages_of_preference: List[str] = None, + **kwargs) -> List[models.BrowseNode]: """Returns the specified browse node's information like name, children and ancestors. Args: diff --git a/amazon_paapi/helpers/arguments.py b/amazon_paapi/helpers/arguments.py index 5386de5..510b265 100644 --- a/amazon_paapi/helpers/arguments.py +++ b/amazon_paapi/helpers/arguments.py @@ -3,12 +3,12 @@ from ..tools import get_asin from ..errors import InvalidArgumentException, AsinNotFoundException -from typing import Union +from typing import List, Union -def get_items_ids(items: Union[str, list[str]]) -> list[str]: - if not isinstance(items, str) and not isinstance(items, list): - raise InvalidArgumentException('Invalid items argument, it should be a string or list of strings') +def get_items_ids(items: Union[str, List[str]]) -> List[str]: + if not isinstance(items, str) and not isinstance(items, List): + raise InvalidArgumentException('Invalid items argument, it should be a string or List of strings') if isinstance(items, str): items_ids = items.split(',') @@ -54,6 +54,6 @@ def check_variations_args(**kwargs): def check_browse_nodes_args(**kwargs): - if not isinstance(kwargs['browse_node_ids'], list): - error_message = 'Argument browse_node_ids should be a list of strings.' + if not isinstance(kwargs['browse_node_ids'], List): + error_message = 'Argument browse_node_ids should be a List of strings.' raise InvalidArgumentException(error_message) diff --git a/amazon_paapi/helpers/generators.py b/amazon_paapi/helpers/generators.py index ae30f2c..1aaa524 100644 --- a/amazon_paapi/helpers/generators.py +++ b/amazon_paapi/helpers/generators.py @@ -1,10 +1,10 @@ """Module with helper functions for making generators.""" -from typing import Generator +from typing import Generator, List -def get_list_chunks(full_list: list[str], chunk_size: int) -> Generator[list[str], None, None]: - """Yield successive chunks from list.""" +def get_list_chunks(full_list: List[str], chunk_size: int) -> Generator[List[str], None, None]: + """Yield successive chunks from List.""" for i in range(0, len(full_list), chunk_size): yield full_list[i:i + chunk_size] diff --git a/amazon_paapi/helpers/requests.py b/amazon_paapi/helpers/requests.py index 618930c..2e9fd9f 100644 --- a/amazon_paapi/helpers/requests.py +++ b/amazon_paapi/helpers/requests.py @@ -1,6 +1,7 @@ """Module with helper functions for creating requests.""" +from typing import List from ..models.item_result import Item from ..models.search_result import SearchResult from ..models.variations_result import VariationsResult @@ -19,7 +20,7 @@ import inspect -def get_items_request(amazon_api, asin_chunk: list[str], **kwargs) -> GetItemsRequest: +def get_items_request(amazon_api, asin_chunk: List[str], **kwargs) -> GetItemsRequest: try: return GetItemsRequest(resources=_get_request_resources(GetItemsResource), partner_type=PartnerType.ASSOCIATES, @@ -31,7 +32,7 @@ def get_items_request(amazon_api, asin_chunk: list[str], **kwargs) -> GetItemsRe raise MalformedRequestException('Parameters for get_items request are not correct: ' + str(e)) -def get_items_response(amazon_api, request: GetItemsRequest) -> list[Item]: +def get_items_response(amazon_api, request: GetItemsRequest) -> List[Item]: try: response = amazon_api._api.get_items(request) except ApiException as e: @@ -100,7 +101,7 @@ def get_browse_nodes_request(amazon_api, **kwargs) -> GetBrowseNodesRequest: raise MalformedRequestException('Parameters for get_browse_nodes request are not correct: ' + str(e)) -def get_browse_nodes_response(amazon_api, request: GetBrowseNodesRequest) -> list[BrowseNode]: +def get_browse_nodes_response(amazon_api, request: GetBrowseNodesRequest) -> List[BrowseNode]: try: response = amazon_api._api.get_browse_nodes(request) except ApiException as e: @@ -112,7 +113,7 @@ def get_browse_nodes_response(amazon_api, request: GetBrowseNodesRequest) -> lis return response.browse_nodes_result.browse_nodes -def _get_request_resources(resources) -> list[str]: +def _get_request_resources(resources) -> List[str]: resources = inspect.getmembers(resources, lambda a:not(inspect.isroutine(a))) resources = [x[-1] for x in resources if isinstance(x[-1], str) and x[0][0:2] != '__'] return resources diff --git a/amazon_paapi/models/browse_nodes_result.py b/amazon_paapi/models/browse_nodes_result.py index 01e55ed..4cf288f 100644 --- a/amazon_paapi/models/browse_nodes_result.py +++ b/amazon_paapi/models/browse_nodes_result.py @@ -1,3 +1,4 @@ +from typing import List from ..sdk import models @@ -16,5 +17,5 @@ class BrowseNode(models.BrowseNode): id: str is_root: bool context_free_name: str - children: list[BrowseNodeChild] + children: List[BrowseNodeChild] ancestor: BrowseNodeAncestor diff --git a/amazon_paapi/models/item_result.py b/amazon_paapi/models/item_result.py index 13f8100..61418ff 100644 --- a/amazon_paapi/models/item_result.py +++ b/amazon_paapi/models/item_result.py @@ -1,3 +1,4 @@ +from typing import List from ..sdk import models """Shared models""" @@ -6,14 +7,14 @@ class ApiLabelLocale: locale: str class ApiMultiValuedAttributeStr(ApiLabelLocale, models.MultiValuedAttribute): - display_values: list[str] + display_values: List[str] class ApiDisplayValuesType: display_value: str type: str class ApiMultiValuedAttributeType(ApiLabelLocale, models.MultiValuedAttribute): - display_values: list[ApiDisplayValuesType] + display_values: List[ApiDisplayValuesType] class ApiUnitBasedAttribute(ApiLabelLocale, models.UnitBasedAttribute): display_value: float @@ -47,7 +48,7 @@ class ApiImageType(models.ImageType): class ApiImages(models.Images): primary: ApiImageType - variants: list[ApiImageType] + variants: List[ApiImageType] """Item info models""" class ApiByLineInfo(models.ByLineInfo): @@ -182,12 +183,12 @@ class ApiListings(models.OfferListing): merchant_info: ApiOfferMerchantInfo price: ApiOfferPrice program_eligibility: ApiOfferProgramEligibility - promotions: list[ApiPromotion] + promotions: List[ApiPromotion] saving_basis: ApiPrice violates_map: bool class ApiOffers(models.Offers): - listings: list[ApiListings] + listings: List[ApiListings] """Browse node info model""" class ApiBrowseNode(models.BrowseNode): @@ -204,7 +205,7 @@ class ApiWebsiteSalesRank(models.WebsiteSalesRank): sales_rank: str class ApiBrowseNodeInfo(models.BrowseNodeInfo): - browse_nodes: list[ApiBrowseNode] + browse_nodes: List[ApiBrowseNode] website_sales_rank: ApiWebsiteSalesRank """Main model""" @@ -219,4 +220,4 @@ class Item(models.Item): parent_asin: str rental_offers: models.RentalOffers score: float - variation_attributes: list[models.VariationAttribute] + variation_attributes: List[models.VariationAttribute] diff --git a/amazon_paapi/models/search_result.py b/amazon_paapi/models/search_result.py index c922282..b16cff4 100644 --- a/amazon_paapi/models/search_result.py +++ b/amazon_paapi/models/search_result.py @@ -1,7 +1,8 @@ +from typing import List from .item_result import Item from ..sdk.models import SearchResult class SearchResult(SearchResult): - items: list[Item] + items: List[Item] total_result_count: int search_url: str diff --git a/amazon_paapi/models/variations_result.py b/amazon_paapi/models/variations_result.py index fb0c07c..f22cfcd 100644 --- a/amazon_paapi/models/variations_result.py +++ b/amazon_paapi/models/variations_result.py @@ -1,3 +1,4 @@ +from typing import List from .item_result import Item from ..sdk.models import VariationsResult, VariationSummary @@ -10,7 +11,7 @@ class ApiPrice: class ApiVariationDimension: display_name: str name: str - values: list[str] + values: List[str] class ApiVariationPrice: @@ -21,9 +22,9 @@ class ApiVariationSummary(VariationSummary): page_count: int price: ApiVariationPrice variation_count: int - variation_dimensions: list[ApiVariationDimension] + variation_dimensions: List[ApiVariationDimension] class VariationsResult(VariationsResult): - items: list[Item] + items: List[Item] variation_summary: ApiVariationSummary From 74fddca929dd916a38a23eabd0b5ae9279d275fe Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Tue, 13 Jul 2021 20:26:57 +0200 Subject: [PATCH 66/67] Added link to previous version --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 8f63ba3..e9f11bd 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,8 @@ A simple Python wrapper for the [last version of the Amazon Product Advertising [![Support](https://img.shields.io/badge/Support-Good-brightgreen)](https://github.com/sergioteula/python-amazon-paapi/issues) [![Amazon API](https://img.shields.io/badge/Amazon%20API-5.0-%23FD9B15)](https://webservices.amazon.com/paapi5/documentation/) +> If you are still using the old version, go [here](https://github.com/sergioteula/python-amazon-paapi/blob/master/amazon/README). + ## Features - Object oriented interface for simple usage. From ccde26744daf8014bb432f0d978ba417ec934cef Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Tue, 13 Jul 2021 20:32:57 +0200 Subject: [PATCH 67/67] Added example --- examples/example.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 examples/example.py diff --git a/examples/example.py b/examples/example.py new file mode 100644 index 0000000..7422280 --- /dev/null +++ b/examples/example.py @@ -0,0 +1,32 @@ +from amazon_paapi import AmazonApi +import secrets + + +amazon = AmazonApi(secrets.KEY, secrets.SECRET, secrets.TAG, secrets.COUNTRY, throttling=2) + + +print('\nGet items') +print('=========================================================') +product = amazon.get_items('B01N5IB20Q') +print(product[0].item_info.title.display_value) + + +print('Search items') +print('=========================================================') +items = amazon.search_items(keywords='nintendo', item_count=3) +for item in items.items: + print(item.item_info.title.display_value) + + +print('\nGet variations') +print('=========================================================') +items = amazon.get_variations('B08F63PPNV', variation_count=3) +for item in items.items: + print(item.item_info.title.display_value) + + +print('\nGet nodes') +print('=========================================================') +items = amazon.get_browse_nodes(['667049031']) # Only available in spanish marketplace +for item in items: + print(item.display_name)