diff --git a/.githooks/pre-push b/.githooks/pre-push new file mode 100755 index 0000000..6b0950e --- /dev/null +++ b/.githooks/pre-push @@ -0,0 +1,9 @@ +#! /bin/bash + +ROOT_DIR="$(git rev-parse --show-toplevel)" +source "${ROOT_DIR}/scripts/helpers" + +./scripts/check_isort +./scripts/check_black + +header "Proceeding with push" diff --git a/.github/workflows/lint-and-test.yml b/.github/workflows/lint-and-test.yml new file mode 100644 index 0000000..d1b489c --- /dev/null +++ b/.github/workflows/lint-and-test.yml @@ -0,0 +1,30 @@ +name: Lint and test + +on: + push: + +jobs: + + isort: + runs-on: ubuntu-latest + container: + image: sergioteula/pytools + volumes: + - ${{github.workspace}}:/code + steps: + - name: Check out code + uses: actions/checkout@v2 + - name: Check imports order + run: ./scripts/check_isort + + black: + runs-on: ubuntu-latest + container: + image: sergioteula/pytools + volumes: + - ${{github.workspace}}:/code + steps: + - name: Check out code + uses: actions/checkout@v2 + - name: Check code format + run: ./scripts/check_black diff --git a/.shellcheckrc b/.shellcheckrc new file mode 100644 index 0000000..1c2cbb5 --- /dev/null +++ b/.shellcheckrc @@ -0,0 +1,3 @@ +# ~/.shellcheckrc + +disable=SC1091 diff --git a/README.md b/README.md index bbe7d6a..d9def6f 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,14 @@ amazon = AmazonApi(KEY, SECRET, TAG, COUNTRY, throttling=4) # Makes 1 request e amazon = AmazonApi(KEY, SECRET, TAG, COUNTRY, throttling=0) # No wait time between requests ``` +## Contribution + +Activate githooks with: + +``` +git config core.hooksPath .githooks +``` + ## License Copyright © 2021 Sergio Abad. See [license](https://github.com/sergioteula/python-amazon-paapi/blob/master/LICENSE) for details. diff --git a/amazon/README.md b/amazon/README.md deleted file mode 100644 index 755db35..0000000 --- a/amazon/README.md +++ /dev/null @@ -1,123 +0,0 @@ -# Amazon Product Advertising API 5.0 wrapper for Python v3.3.4 - -> :warning: **This version is deprecated and it will be removed in the future. Please use [version 4.0.0 or higher](https://github.com/sergioteula/python-amazon-paapi).** - -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/) - -## 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 this module version with: - - pip install python-amazon-paapi==3.3.4 - -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. diff --git a/amazon/__init__.py b/amazon/__init__.py deleted file mode 100644 index 17c61a2..0000000 --- a/amazon/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -"""Amazon Product Advertising API wrapper for Python""" - -__version__ = '3.3.3' -__author__ = 'Sergio Abad' diff --git a/amazon/constant.py b/amazon/constant.py deleted file mode 100644 index c1fae32..0000000 --- a/amazon/constant.py +++ /dev/null @@ -1,241 +0,0 @@ -"""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 deleted file mode 100644 index c9af2df..0000000 --- a/amazon/exception.py +++ /dev/null @@ -1,11 +0,0 @@ -"""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 deleted file mode 100644 index d29a79c..0000000 --- a/amazon/paapi.py +++ /dev/null @@ -1,457 +0,0 @@ -"""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/paapi5_python_sdk/COPYING.txt b/amazon/paapi5_python_sdk/COPYING.txt deleted file mode 100644 index d645695..0000000 --- a/amazon/paapi5_python_sdk/COPYING.txt +++ /dev/null @@ -1,202 +0,0 @@ - - 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/amazon/paapi5_python_sdk/LICENSE.txt b/amazon/paapi5_python_sdk/LICENSE.txt deleted file mode 100644 index d645695..0000000 --- a/amazon/paapi5_python_sdk/LICENSE.txt +++ /dev/null @@ -1,202 +0,0 @@ - - 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/amazon/paapi5_python_sdk/NOTICE.txt b/amazon/paapi5_python_sdk/NOTICE.txt deleted file mode 100644 index 526e5d9..0000000 --- a/amazon/paapi5_python_sdk/NOTICE.txt +++ /dev/null @@ -1,2 +0,0 @@ -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/amazon/paapi5_python_sdk/__init__.py b/amazon/paapi5_python_sdk/__init__.py deleted file mode 100644 index 33fd32b..0000000 --- a/amazon/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 .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/amazon/paapi5_python_sdk/api/__init__.py b/amazon/paapi5_python_sdk/api/__init__.py deleted file mode 100644 index 8fa4a5c..0000000 --- a/amazon/paapi5_python_sdk/api/__init__.py +++ /dev/null @@ -1,29 +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 api package -from .default_api import DefaultApi diff --git a/amazon/paapi5_python_sdk/api/default_api.py b/amazon/paapi5_python_sdk/api/default_api.py deleted file mode 100644 index 268c452..0000000 --- a/amazon/paapi5_python_sdk/api/default_api.py +++ /dev/null @@ -1,428 +0,0 @@ -# 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 ..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/amazon/paapi5_python_sdk/api_client.py b/amazon/paapi5_python_sdk/api_client.py deleted file mode 100644 index 5f26b32..0000000 --- a/amazon/paapi5_python_sdk/api_client.py +++ /dev/null @@ -1,685 +0,0 @@ -# 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 .configuration import Configuration -from .. import paapi5_python_sdk -from . import rest - -from .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/amazon/paapi5_python_sdk/auth/__init__.py b/amazon/paapi5_python_sdk/auth/__init__.py deleted file mode 100644 index fe07328..0000000 --- a/amazon/paapi5_python_sdk/auth/__init__.py +++ /dev/null @@ -1,29 +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 auth into sdk package -from .sig_v4 import AWSV4Auth diff --git a/amazon/paapi5_python_sdk/auth/sig_v4.py b/amazon/paapi5_python_sdk/auth/sig_v4.py deleted file mode 100644 index 6fc4bdc..0000000 --- a/amazon/paapi5_python_sdk/auth/sig_v4.py +++ /dev/null @@ -1,149 +0,0 @@ -# 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/amazon/paapi5_python_sdk/availability.py b/amazon/paapi5_python_sdk/availability.py deleted file mode 100644 index ff22efa..0000000 --- a/amazon/paapi5_python_sdk/availability.py +++ /dev/null @@ -1,104 +0,0 @@ -# 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/amazon/paapi5_python_sdk/browse_node.py b/amazon/paapi5_python_sdk/browse_node.py deleted file mode 100644 index 09e8242..0000000 --- a/amazon/paapi5_python_sdk/browse_node.py +++ /dev/null @@ -1,285 +0,0 @@ -# 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 .browse_node_ancestor import BrowseNodeAncestor # noqa: F401,E501 -from .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/amazon/paapi5_python_sdk/browse_node_ancestor.py b/amazon/paapi5_python_sdk/browse_node_ancestor.py deleted file mode 100644 index 72c6514..0000000 --- a/amazon/paapi5_python_sdk/browse_node_ancestor.py +++ /dev/null @@ -1,204 +0,0 @@ -# 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/amazon/paapi5_python_sdk/browse_node_child.py b/amazon/paapi5_python_sdk/browse_node_child.py deleted file mode 100644 index 47c2d9d..0000000 --- a/amazon/paapi5_python_sdk/browse_node_child.py +++ /dev/null @@ -1,178 +0,0 @@ -# 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/amazon/paapi5_python_sdk/browse_node_children.py b/amazon/paapi5_python_sdk/browse_node_children.py deleted file mode 100644 index 9b9772a..0000000 --- a/amazon/paapi5_python_sdk/browse_node_children.py +++ /dev/null @@ -1,100 +0,0 @@ -# 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 .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/amazon/paapi5_python_sdk/browse_node_info.py b/amazon/paapi5_python_sdk/browse_node_info.py deleted file mode 100644 index 52d8de7..0000000 --- a/amazon/paapi5_python_sdk/browse_node_info.py +++ /dev/null @@ -1,155 +0,0 @@ -# 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 .browse_node import BrowseNode # noqa: F401,E501 -from .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/amazon/paapi5_python_sdk/browse_nodes_result.py b/amazon/paapi5_python_sdk/browse_nodes_result.py deleted file mode 100644 index 0bccd5d..0000000 --- a/amazon/paapi5_python_sdk/browse_nodes_result.py +++ /dev/null @@ -1,128 +0,0 @@ -# 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 .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/amazon/paapi5_python_sdk/by_line_info.py b/amazon/paapi5_python_sdk/by_line_info.py deleted file mode 100644 index 9b3052b..0000000 --- a/amazon/paapi5_python_sdk/by_line_info.py +++ /dev/null @@ -1,181 +0,0 @@ -# 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 .contributor import Contributor # noqa: F401,E501 -from .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/amazon/paapi5_python_sdk/classifications.py b/amazon/paapi5_python_sdk/classifications.py deleted file mode 100644 index 86e2e25..0000000 --- a/amazon/paapi5_python_sdk/classifications.py +++ /dev/null @@ -1,154 +0,0 @@ -# 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 .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/amazon/paapi5_python_sdk/condition.py b/amazon/paapi5_python_sdk/condition.py deleted file mode 100644 index 0f554dc..0000000 --- a/amazon/paapi5_python_sdk/condition.py +++ /dev/null @@ -1,107 +0,0 @@ -# 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/amazon/paapi5_python_sdk/configuration.py b/amazon/paapi5_python_sdk/configuration.py deleted file mode 100644 index 562a9c6..0000000 --- a/amazon/paapi5_python_sdk/configuration.py +++ /dev/null @@ -1,230 +0,0 @@ -# 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("") - 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/amazon/paapi5_python_sdk/content_info.py b/amazon/paapi5_python_sdk/content_info.py deleted file mode 100644 index b46e244..0000000 --- a/amazon/paapi5_python_sdk/content_info.py +++ /dev/null @@ -1,208 +0,0 @@ -# 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 .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): - """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/amazon/paapi5_python_sdk/content_rating.py b/amazon/paapi5_python_sdk/content_rating.py deleted file mode 100644 index 10ac8f0..0000000 --- a/amazon/paapi5_python_sdk/content_rating.py +++ /dev/null @@ -1,128 +0,0 @@ -# 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 .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/amazon/paapi5_python_sdk/contributor.py b/amazon/paapi5_python_sdk/contributor.py deleted file mode 100644 index 1b1f30e..0000000 --- a/amazon/paapi5_python_sdk/contributor.py +++ /dev/null @@ -1,178 +0,0 @@ -# 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/amazon/paapi5_python_sdk/delivery_flag.py b/amazon/paapi5_python_sdk/delivery_flag.py deleted file mode 100644 index 1f0c469..0000000 --- a/amazon/paapi5_python_sdk/delivery_flag.py +++ /dev/null @@ -1,106 +0,0 @@ -# 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/amazon/paapi5_python_sdk/dimension_based_attribute.py b/amazon/paapi5_python_sdk/dimension_based_attribute.py deleted file mode 100644 index 04cc4f7..0000000 --- a/amazon/paapi5_python_sdk/dimension_based_attribute.py +++ /dev/null @@ -1,206 +0,0 @@ -# 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 .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/amazon/paapi5_python_sdk/duration_price.py b/amazon/paapi5_python_sdk/duration_price.py deleted file mode 100644 index 724fe4b..0000000 --- a/amazon/paapi5_python_sdk/duration_price.py +++ /dev/null @@ -1,155 +0,0 @@ -# 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 .offer_price import OfferPrice # noqa: F401,E501 -from .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/amazon/paapi5_python_sdk/error_data.py b/amazon/paapi5_python_sdk/error_data.py deleted file mode 100644 index 3d6b106..0000000 --- a/amazon/paapi5_python_sdk/error_data.py +++ /dev/null @@ -1,152 +0,0 @@ -# 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/amazon/paapi5_python_sdk/external_ids.py b/amazon/paapi5_python_sdk/external_ids.py deleted file mode 100644 index ff545a7..0000000 --- a/amazon/paapi5_python_sdk/external_ids.py +++ /dev/null @@ -1,180 +0,0 @@ -# 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 .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/amazon/paapi5_python_sdk/get_browse_nodes_request.py b/amazon/paapi5_python_sdk/get_browse_nodes_request.py deleted file mode 100644 index 6d5d57b..0000000 --- a/amazon/paapi5_python_sdk/get_browse_nodes_request.py +++ /dev/null @@ -1,262 +0,0 @@ -# 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 .get_browse_nodes_resource import GetBrowseNodesResource # noqa: F401,E501 -from .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/amazon/paapi5_python_sdk/get_browse_nodes_resource.py b/amazon/paapi5_python_sdk/get_browse_nodes_resource.py deleted file mode 100644 index 4e7ff94..0000000 --- a/amazon/paapi5_python_sdk/get_browse_nodes_resource.py +++ /dev/null @@ -1,104 +0,0 @@ -# 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/amazon/paapi5_python_sdk/get_browse_nodes_response.py b/amazon/paapi5_python_sdk/get_browse_nodes_response.py deleted file mode 100644 index 10e0a21..0000000 --- a/amazon/paapi5_python_sdk/get_browse_nodes_response.py +++ /dev/null @@ -1,155 +0,0 @@ -# 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 .browse_nodes_result import BrowseNodesResult # noqa: F401,E501 -from .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/amazon/paapi5_python_sdk/get_items_request.py b/amazon/paapi5_python_sdk/get_items_request.py deleted file mode 100644 index 567ba65..0000000 --- a/amazon/paapi5_python_sdk/get_items_request.py +++ /dev/null @@ -1,423 +0,0 @@ -# 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 .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): - """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/amazon/paapi5_python_sdk/get_items_resource.py b/amazon/paapi5_python_sdk/get_items_resource.py deleted file mode 100644 index b0ddcc5..0000000 --- a/amazon/paapi5_python_sdk/get_items_resource.py +++ /dev/null @@ -1,157 +0,0 @@ -# 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/amazon/paapi5_python_sdk/get_items_response.py b/amazon/paapi5_python_sdk/get_items_response.py deleted file mode 100644 index fa22753..0000000 --- a/amazon/paapi5_python_sdk/get_items_response.py +++ /dev/null @@ -1,155 +0,0 @@ -# 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 .error_data import ErrorData # noqa: F401,E501 -from .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/amazon/paapi5_python_sdk/get_variations_request.py b/amazon/paapi5_python_sdk/get_variations_request.py deleted file mode 100644 index 0b1ea3a..0000000 --- a/amazon/paapi5_python_sdk/get_variations_request.py +++ /dev/null @@ -1,448 +0,0 @@ -# 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 .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): - """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/amazon/paapi5_python_sdk/get_variations_resource.py b/amazon/paapi5_python_sdk/get_variations_resource.py deleted file mode 100644 index bf5018e..0000000 --- a/amazon/paapi5_python_sdk/get_variations_resource.py +++ /dev/null @@ -1,160 +0,0 @@ -# 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/amazon/paapi5_python_sdk/get_variations_response.py b/amazon/paapi5_python_sdk/get_variations_response.py deleted file mode 100644 index 287ee5e..0000000 --- a/amazon/paapi5_python_sdk/get_variations_response.py +++ /dev/null @@ -1,155 +0,0 @@ -# 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 .error_data import ErrorData # noqa: F401,E501 -from .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/amazon/paapi5_python_sdk/image_size.py b/amazon/paapi5_python_sdk/image_size.py deleted file mode 100644 index cb56660..0000000 --- a/amazon/paapi5_python_sdk/image_size.py +++ /dev/null @@ -1,178 +0,0 @@ -# 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/amazon/paapi5_python_sdk/image_type.py b/amazon/paapi5_python_sdk/image_type.py deleted file mode 100644 index 1abf7eb..0000000 --- a/amazon/paapi5_python_sdk/image_type.py +++ /dev/null @@ -1,180 +0,0 @@ -# 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 .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/amazon/paapi5_python_sdk/images.py b/amazon/paapi5_python_sdk/images.py deleted file mode 100644 index cf46148..0000000 --- a/amazon/paapi5_python_sdk/images.py +++ /dev/null @@ -1,154 +0,0 @@ -# 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 .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/amazon/paapi5_python_sdk/item.py b/amazon/paapi5_python_sdk/item.py deleted file mode 100644 index 6583aed..0000000 --- a/amazon/paapi5_python_sdk/item.py +++ /dev/null @@ -1,367 +0,0 @@ -# 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 .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): - """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/amazon/paapi5_python_sdk/item_id_type.py b/amazon/paapi5_python_sdk/item_id_type.py deleted file mode 100644 index 0d3b36a..0000000 --- a/amazon/paapi5_python_sdk/item_id_type.py +++ /dev/null @@ -1,103 +0,0 @@ -# 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/amazon/paapi5_python_sdk/item_info.py b/amazon/paapi5_python_sdk/item_info.py deleted file mode 100644 index c03de48..0000000 --- a/amazon/paapi5_python_sdk/item_info.py +++ /dev/null @@ -1,398 +0,0 @@ -# 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 .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): - """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/amazon/paapi5_python_sdk/items_result.py b/amazon/paapi5_python_sdk/items_result.py deleted file mode 100644 index 4c4192a..0000000 --- a/amazon/paapi5_python_sdk/items_result.py +++ /dev/null @@ -1,128 +0,0 @@ -# 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 .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/amazon/paapi5_python_sdk/language_type.py b/amazon/paapi5_python_sdk/language_type.py deleted file mode 100644 index c5a038c..0000000 --- a/amazon/paapi5_python_sdk/language_type.py +++ /dev/null @@ -1,152 +0,0 @@ -# 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/amazon/paapi5_python_sdk/languages.py b/amazon/paapi5_python_sdk/languages.py deleted file mode 100644 index f1f8db0..0000000 --- a/amazon/paapi5_python_sdk/languages.py +++ /dev/null @@ -1,180 +0,0 @@ -# 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 .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/amazon/paapi5_python_sdk/manufacture_info.py b/amazon/paapi5_python_sdk/manufacture_info.py deleted file mode 100644 index ccc9fe7..0000000 --- a/amazon/paapi5_python_sdk/manufacture_info.py +++ /dev/null @@ -1,180 +0,0 @@ -# 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 .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/amazon/paapi5_python_sdk/max_price.py b/amazon/paapi5_python_sdk/max_price.py deleted file mode 100644 index 651f4da..0000000 --- a/amazon/paapi5_python_sdk/max_price.py +++ /dev/null @@ -1,98 +0,0 @@ -# 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/amazon/paapi5_python_sdk/merchant.py b/amazon/paapi5_python_sdk/merchant.py deleted file mode 100644 index f5a6ad9..0000000 --- a/amazon/paapi5_python_sdk/merchant.py +++ /dev/null @@ -1,104 +0,0 @@ -# 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/amazon/paapi5_python_sdk/min_price.py b/amazon/paapi5_python_sdk/min_price.py deleted file mode 100644 index b4b2aa4..0000000 --- a/amazon/paapi5_python_sdk/min_price.py +++ /dev/null @@ -1,98 +0,0 @@ -# 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/amazon/paapi5_python_sdk/min_reviews_rating.py b/amazon/paapi5_python_sdk/min_reviews_rating.py deleted file mode 100644 index a4d1bbb..0000000 --- a/amazon/paapi5_python_sdk/min_reviews_rating.py +++ /dev/null @@ -1,98 +0,0 @@ -# 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/amazon/paapi5_python_sdk/min_saving_percent.py b/amazon/paapi5_python_sdk/min_saving_percent.py deleted file mode 100644 index a3ec1ad..0000000 --- a/amazon/paapi5_python_sdk/min_saving_percent.py +++ /dev/null @@ -1,98 +0,0 @@ -# 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/amazon/paapi5_python_sdk/multi_valued_attribute.py b/amazon/paapi5_python_sdk/multi_valued_attribute.py deleted file mode 100644 index 0d1e6b5..0000000 --- a/amazon/paapi5_python_sdk/multi_valued_attribute.py +++ /dev/null @@ -1,178 +0,0 @@ -# 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/amazon/paapi5_python_sdk/offer_availability.py b/amazon/paapi5_python_sdk/offer_availability.py deleted file mode 100644 index 2da4ef6..0000000 --- a/amazon/paapi5_python_sdk/offer_availability.py +++ /dev/null @@ -1,203 +0,0 @@ -# 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/amazon/paapi5_python_sdk/offer_condition.py b/amazon/paapi5_python_sdk/offer_condition.py deleted file mode 100644 index 056091f..0000000 --- a/amazon/paapi5_python_sdk/offer_condition.py +++ /dev/null @@ -1,232 +0,0 @@ -# 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 .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/amazon/paapi5_python_sdk/offer_count.py b/amazon/paapi5_python_sdk/offer_count.py deleted file mode 100644 index 951020b..0000000 --- a/amazon/paapi5_python_sdk/offer_count.py +++ /dev/null @@ -1,98 +0,0 @@ -# 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/amazon/paapi5_python_sdk/offer_delivery_info.py b/amazon/paapi5_python_sdk/offer_delivery_info.py deleted file mode 100644 index 69ad748..0000000 --- a/amazon/paapi5_python_sdk/offer_delivery_info.py +++ /dev/null @@ -1,206 +0,0 @@ -# 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 .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/amazon/paapi5_python_sdk/offer_listing.py b/amazon/paapi5_python_sdk/offer_listing.py deleted file mode 100644 index 0cb3be6..0000000 --- a/amazon/paapi5_python_sdk/offer_listing.py +++ /dev/null @@ -1,421 +0,0 @@ -# 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 .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): - """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/amazon/paapi5_python_sdk/offer_loyalty_points.py b/amazon/paapi5_python_sdk/offer_loyalty_points.py deleted file mode 100644 index 08b86e9..0000000 --- a/amazon/paapi5_python_sdk/offer_loyalty_points.py +++ /dev/null @@ -1,126 +0,0 @@ -# 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/amazon/paapi5_python_sdk/offer_merchant_info.py b/amazon/paapi5_python_sdk/offer_merchant_info.py deleted file mode 100644 index b0ec576..0000000 --- a/amazon/paapi5_python_sdk/offer_merchant_info.py +++ /dev/null @@ -1,178 +0,0 @@ -# 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/amazon/paapi5_python_sdk/offer_price.py b/amazon/paapi5_python_sdk/offer_price.py deleted file mode 100644 index 343c9b5..0000000 --- a/amazon/paapi5_python_sdk/offer_price.py +++ /dev/null @@ -1,232 +0,0 @@ -# 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 .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/amazon/paapi5_python_sdk/offer_program_eligibility.py b/amazon/paapi5_python_sdk/offer_program_eligibility.py deleted file mode 100644 index ffeaa6c..0000000 --- a/amazon/paapi5_python_sdk/offer_program_eligibility.py +++ /dev/null @@ -1,152 +0,0 @@ -# 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/amazon/paapi5_python_sdk/offer_promotion.py b/amazon/paapi5_python_sdk/offer_promotion.py deleted file mode 100644 index d161a4b..0000000 --- a/amazon/paapi5_python_sdk/offer_promotion.py +++ /dev/null @@ -1,255 +0,0 @@ -# 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/amazon/paapi5_python_sdk/offer_savings.py b/amazon/paapi5_python_sdk/offer_savings.py deleted file mode 100644 index 42c5eb9..0000000 --- a/amazon/paapi5_python_sdk/offer_savings.py +++ /dev/null @@ -1,230 +0,0 @@ -# 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/amazon/paapi5_python_sdk/offer_shipping_charge.py b/amazon/paapi5_python_sdk/offer_shipping_charge.py deleted file mode 100644 index 5674f19..0000000 --- a/amazon/paapi5_python_sdk/offer_shipping_charge.py +++ /dev/null @@ -1,229 +0,0 @@ -# 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/amazon/paapi5_python_sdk/offer_sub_condition.py b/amazon/paapi5_python_sdk/offer_sub_condition.py deleted file mode 100644 index bb5be69..0000000 --- a/amazon/paapi5_python_sdk/offer_sub_condition.py +++ /dev/null @@ -1,204 +0,0 @@ -# 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/amazon/paapi5_python_sdk/offer_summary.py b/amazon/paapi5_python_sdk/offer_summary.py deleted file mode 100644 index f2363b2..0000000 --- a/amazon/paapi5_python_sdk/offer_summary.py +++ /dev/null @@ -1,207 +0,0 @@ -# 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 .offer_condition import OfferCondition # noqa: F401,E501 -from .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/amazon/paapi5_python_sdk/offers.py b/amazon/paapi5_python_sdk/offers.py deleted file mode 100644 index 4565b7b..0000000 --- a/amazon/paapi5_python_sdk/offers.py +++ /dev/null @@ -1,155 +0,0 @@ -# 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 .offer_listing import OfferListing # noqa: F401,E501 -from .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/amazon/paapi5_python_sdk/partner_type.py b/amazon/paapi5_python_sdk/partner_type.py deleted file mode 100644 index 37f9a39..0000000 --- a/amazon/paapi5_python_sdk/partner_type.py +++ /dev/null @@ -1,103 +0,0 @@ -# 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/amazon/paapi5_python_sdk/price.py b/amazon/paapi5_python_sdk/price.py deleted file mode 100644 index 9fa403c..0000000 --- a/amazon/paapi5_python_sdk/price.py +++ /dev/null @@ -1,154 +0,0 @@ -# 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 .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/amazon/paapi5_python_sdk/product_advertising_api_client_exception.py b/amazon/paapi5_python_sdk/product_advertising_api_client_exception.py deleted file mode 100644 index 2e5cd35..0000000 --- a/amazon/paapi5_python_sdk/product_advertising_api_client_exception.py +++ /dev/null @@ -1,128 +0,0 @@ -# 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 .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/amazon/paapi5_python_sdk/product_advertising_api_service_exception.py b/amazon/paapi5_python_sdk/product_advertising_api_service_exception.py deleted file mode 100644 index 957d9d4..0000000 --- a/amazon/paapi5_python_sdk/product_advertising_api_service_exception.py +++ /dev/null @@ -1,126 +0,0 @@ -# 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/amazon/paapi5_python_sdk/product_info.py b/amazon/paapi5_python_sdk/product_info.py deleted file mode 100644 index d0558d1..0000000 --- a/amazon/paapi5_python_sdk/product_info.py +++ /dev/null @@ -1,261 +0,0 @@ -# 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 .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): - """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/amazon/paapi5_python_sdk/properties.py b/amazon/paapi5_python_sdk/properties.py deleted file mode 100644 index ea72b0a..0000000 --- a/amazon/paapi5_python_sdk/properties.py +++ /dev/null @@ -1,83 +0,0 @@ -# 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/amazon/paapi5_python_sdk/refinement.py b/amazon/paapi5_python_sdk/refinement.py deleted file mode 100644 index cce4c59..0000000 --- a/amazon/paapi5_python_sdk/refinement.py +++ /dev/null @@ -1,180 +0,0 @@ -# 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 .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/amazon/paapi5_python_sdk/refinement_bin.py b/amazon/paapi5_python_sdk/refinement_bin.py deleted file mode 100644 index 9b44ba6..0000000 --- a/amazon/paapi5_python_sdk/refinement_bin.py +++ /dev/null @@ -1,152 +0,0 @@ -# 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/amazon/paapi5_python_sdk/rental_offer_listing.py b/amazon/paapi5_python_sdk/rental_offer_listing.py deleted file mode 100644 index 95936a6..0000000 --- a/amazon/paapi5_python_sdk/rental_offer_listing.py +++ /dev/null @@ -1,262 +0,0 @@ -# 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 .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): - """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/amazon/paapi5_python_sdk/rental_offers.py b/amazon/paapi5_python_sdk/rental_offers.py deleted file mode 100644 index 6fb4e09..0000000 --- a/amazon/paapi5_python_sdk/rental_offers.py +++ /dev/null @@ -1,128 +0,0 @@ -# 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 .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/amazon/paapi5_python_sdk/rest.py b/amazon/paapi5_python_sdk/rest.py deleted file mode 100644 index a4e74fa..0000000 --- a/amazon/paapi5_python_sdk/rest.py +++ /dev/null @@ -1,333 +0,0 @@ -# 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/amazon/paapi5_python_sdk/search_items_request.py b/amazon/paapi5_python_sdk/search_items_request.py deleted file mode 100644 index 4d1107a..0000000 --- a/amazon/paapi5_python_sdk/search_items_request.py +++ /dev/null @@ -1,818 +0,0 @@ -# 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 .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): - """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/amazon/paapi5_python_sdk/search_items_resource.py b/amazon/paapi5_python_sdk/search_items_resource.py deleted file mode 100644 index a55a559..0000000 --- a/amazon/paapi5_python_sdk/search_items_resource.py +++ /dev/null @@ -1,158 +0,0 @@ -# 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/amazon/paapi5_python_sdk/search_items_response.py b/amazon/paapi5_python_sdk/search_items_response.py deleted file mode 100644 index 8c66fc7..0000000 --- a/amazon/paapi5_python_sdk/search_items_response.py +++ /dev/null @@ -1,155 +0,0 @@ -# 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 .error_data import ErrorData # noqa: F401,E501 -from .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/amazon/paapi5_python_sdk/search_refinements.py b/amazon/paapi5_python_sdk/search_refinements.py deleted file mode 100644 index 2741661..0000000 --- a/amazon/paapi5_python_sdk/search_refinements.py +++ /dev/null @@ -1,180 +0,0 @@ -# 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 .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/amazon/paapi5_python_sdk/search_result.py b/amazon/paapi5_python_sdk/search_result.py deleted file mode 100644 index 6ba2d5e..0000000 --- a/amazon/paapi5_python_sdk/search_result.py +++ /dev/null @@ -1,207 +0,0 @@ -# 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 .item import Item # noqa: F401,E501 -from .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/amazon/paapi5_python_sdk/single_boolean_valued_attribute.py b/amazon/paapi5_python_sdk/single_boolean_valued_attribute.py deleted file mode 100644 index df043f6..0000000 --- a/amazon/paapi5_python_sdk/single_boolean_valued_attribute.py +++ /dev/null @@ -1,178 +0,0 @@ -# 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/amazon/paapi5_python_sdk/single_integer_valued_attribute.py b/amazon/paapi5_python_sdk/single_integer_valued_attribute.py deleted file mode 100644 index 63b93e3..0000000 --- a/amazon/paapi5_python_sdk/single_integer_valued_attribute.py +++ /dev/null @@ -1,178 +0,0 @@ -# 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/amazon/paapi5_python_sdk/single_string_valued_attribute.py b/amazon/paapi5_python_sdk/single_string_valued_attribute.py deleted file mode 100644 index e217d62..0000000 --- a/amazon/paapi5_python_sdk/single_string_valued_attribute.py +++ /dev/null @@ -1,178 +0,0 @@ -# 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/amazon/paapi5_python_sdk/sort_by.py b/amazon/paapi5_python_sdk/sort_by.py deleted file mode 100644 index 33f8312..0000000 --- a/amazon/paapi5_python_sdk/sort_by.py +++ /dev/null @@ -1,108 +0,0 @@ -# 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/amazon/paapi5_python_sdk/technical_info.py b/amazon/paapi5_python_sdk/technical_info.py deleted file mode 100644 index 508af10..0000000 --- a/amazon/paapi5_python_sdk/technical_info.py +++ /dev/null @@ -1,128 +0,0 @@ -# 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 .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/amazon/paapi5_python_sdk/trade_in_info.py b/amazon/paapi5_python_sdk/trade_in_info.py deleted file mode 100644 index 248b4e1..0000000 --- a/amazon/paapi5_python_sdk/trade_in_info.py +++ /dev/null @@ -1,154 +0,0 @@ -# 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 .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/amazon/paapi5_python_sdk/trade_in_price.py b/amazon/paapi5_python_sdk/trade_in_price.py deleted file mode 100644 index 3e968e5..0000000 --- a/amazon/paapi5_python_sdk/trade_in_price.py +++ /dev/null @@ -1,178 +0,0 @@ -# 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/amazon/paapi5_python_sdk/unit_based_attribute.py b/amazon/paapi5_python_sdk/unit_based_attribute.py deleted file mode 100644 index 19e5f31..0000000 --- a/amazon/paapi5_python_sdk/unit_based_attribute.py +++ /dev/null @@ -1,204 +0,0 @@ -# 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/amazon/paapi5_python_sdk/variation_attribute.py b/amazon/paapi5_python_sdk/variation_attribute.py deleted file mode 100644 index 1173e3d..0000000 --- a/amazon/paapi5_python_sdk/variation_attribute.py +++ /dev/null @@ -1,152 +0,0 @@ -# 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/amazon/paapi5_python_sdk/variation_dimension.py b/amazon/paapi5_python_sdk/variation_dimension.py deleted file mode 100644 index 8ff9e86..0000000 --- a/amazon/paapi5_python_sdk/variation_dimension.py +++ /dev/null @@ -1,204 +0,0 @@ -# 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/amazon/paapi5_python_sdk/variation_summary.py b/amazon/paapi5_python_sdk/variation_summary.py deleted file mode 100644 index e8aeea4..0000000 --- a/amazon/paapi5_python_sdk/variation_summary.py +++ /dev/null @@ -1,207 +0,0 @@ -# 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 .price import Price # noqa: F401,E501 -from .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/amazon/paapi5_python_sdk/variations_result.py b/amazon/paapi5_python_sdk/variations_result.py deleted file mode 100644 index 9ce3c66..0000000 --- a/amazon/paapi5_python_sdk/variations_result.py +++ /dev/null @@ -1,155 +0,0 @@ -# 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 .item import Item # noqa: F401,E501 -from .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/amazon/paapi5_python_sdk/website_sales_rank.py b/amazon/paapi5_python_sdk/website_sales_rank.py deleted file mode 100644 index da92d28..0000000 --- a/amazon/paapi5_python_sdk/website_sales_rank.py +++ /dev/null @@ -1,204 +0,0 @@ -# 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 diff --git a/amazon/parse.py b/amazon/parse.py deleted file mode 100644 index 1f65cf3..0000000 --- a/amazon/parse.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 diff --git a/amazon/serializer/dango_rest_framework.py b/amazon/serializer/dango_rest_framework.py deleted file mode 100644 index 8988c15..0000000 --- a/amazon/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/tools.py b/amazon/tools.py deleted file mode 100644 index c67e29f..0000000 --- a/amazon/tools.py +++ /dev/null @@ -1,26 +0,0 @@ -"""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/amazon_paapi/__init__.py b/amazon_paapi/__init__.py index 621b9a5..61887fa 100644 --- a/amazon_paapi/__init__.py +++ b/amazon_paapi/__init__.py @@ -1,6 +1,6 @@ """Amazon Product Advertising API wrapper for Python""" -__author__ = 'Sergio Abad' +__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 b57ec07..f66e25a 100644 --- a/amazon_paapi/api.py +++ b/amazon_paapi/api.py @@ -29,7 +29,15 @@ class AmazonApi: ``InvalidArgumentException`` """ - def __init__(self, key: str, secret: str, tag: str, country: models.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 @@ -38,15 +46,14 @@ 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.regions.DOMAINS[country] + self._host = "webservices.amazon." + models.regions.DOMAINS[country] self._region = models.regions.REGIONS[country] - self._marketplace = 'www.amazon.' + models.regions.DOMAINS[country] + self._marketplace = "www.amazon." + models.regions.DOMAINS[country] except KeyError as error: - raise InvalidArgumentException('Country code is not correct') from error + raise InvalidArgumentException("Country code is not correct") from error self._api = DefaultApi(key, secret, self._host, self._region) - def get_items( self, items: Union[str, List[str]], @@ -57,7 +64,6 @@ def get_items( include_unavailable: bool = False, **kwargs ) -> List[models.Item]: - """Get items information from Amazon. Args: @@ -85,12 +91,14 @@ def get_items( ``ItemsNotFoundException`` """ - kwargs.update({ - 'condition': condition, - 'merchant': merchant, - 'currency_of_preference': currency_of_preference, - 'languages_of_preference': languages_of_preference - }) + kwargs.update( + { + "condition": condition, + "merchant": merchant, + "currency_of_preference": currency_of_preference, + "languages_of_preference": languages_of_preference, + } + ) items_ids = arguments.get_items_ids(items) results = [] @@ -103,7 +111,6 @@ def get_items( return sort_items(results, items_ids, include_unavailable) - def search_items( self, item_count: int = None, @@ -181,36 +188,37 @@ def search_items( ``ItemsNotFoundException`` """ - 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, - }) + 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, + } + ) arguments.check_search_args(**kwargs) request = requests.get_search_items_request(self, **kwargs) self._throttle() return requests.get_search_items_response(self, request) - def get_variations( self, asin: str, @@ -252,22 +260,23 @@ def get_variations( asin = arguments.get_items_ids(asin)[0] - kwargs.update({ - 'asin': asin, - 'variation_count': variation_count, - 'variation_page': variation_page, - 'condition': condition, - 'currency_of_preference': currency_of_preference, - 'languages_of_preference': languages_of_preference, - 'merchant': merchant - }) + kwargs.update( + { + "asin": asin, + "variation_count": variation_count, + "variation_page": variation_page, + "condition": condition, + "currency_of_preference": currency_of_preference, + "languages_of_preference": languages_of_preference, + "merchant": merchant, + } + ) arguments.check_variations_args(**kwargs) request = requests.get_variations_request(self, **kwargs) self._throttle() return requests.get_variations_response(self, request) - def get_browse_nodes( self, browse_node_ids: List[str], @@ -293,17 +302,18 @@ def get_browse_nodes( ``ItemsNotFoundException`` """ - kwargs.update({ - 'browse_node_ids': browse_node_ids, - 'languages_of_preference': languages_of_preference - }) + kwargs.update( + { + "browse_node_ids": browse_node_ids, + "languages_of_preference": languages_of_preference, + } + ) arguments.check_browse_nodes_args(**kwargs) request = requests.get_browse_nodes_request(self, **kwargs) self._throttle() return requests.get_browse_nodes_response(self, request) - def _throttle(self): wait_time = self._throttling - (time.time() - self._last_query_time) if wait_time > 0: diff --git a/amazon_paapi/errors/exceptions.py b/amazon_paapi/errors/exceptions.py index e04cbab..56a5933 100644 --- a/amazon_paapi/errors/exceptions.py +++ b/amazon_paapi/errors/exceptions.py @@ -3,43 +3,58 @@ class AmazonException(Exception): """Common base class for all Amazon API exceptions.""" + def __init__(self, reason: str): super().__init__() self.reason = reason def __str__(self) -> str: - return '%s' % self.reason + return "%s" % self.reason class InvalidArgumentException(AmazonException): """Raised when arguments are not correct.""" + pass 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 ItemsNotFoundException(AmazonException): """Raised if no items are found""" + pass + class TooManyRequestsException(AmazonException): """Raised when requests limit is reached""" + pass + class InvalidPartnerTagException(AmazonException): """Raised if the partner tag is not present or invalid""" + pass + class AssociateValidationException(AmazonException): """Raised when credentials are not valid for the selected country""" + pass diff --git a/amazon_paapi/helpers/arguments.py b/amazon_paapi/helpers/arguments.py index d76d9af..53eacf6 100644 --- a/amazon_paapi/helpers/arguments.py +++ b/amazon_paapi/helpers/arguments.py @@ -9,10 +9,12 @@ 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') + raise InvalidArgumentException( + "Invalid items argument, it should be a string or List of strings" + ) if isinstance(items, str): - items_ids = items.split(',') + items_ids = items.split(",") items_ids = [get_asin(x.strip()) for x in items_ids] else: @@ -21,7 +23,7 @@ def get_items_ids(items: Union[str, List[str]]) -> List[str]: if items_ids: return items_ids - raise AsinNotFoundException('No ASIN codes have been found.') + raise AsinNotFoundException("No ASIN codes have been found.") def check_search_args(**kwargs): @@ -30,18 +32,27 @@ def check_search_args(**kwargs): def _check_search_mandatory_args(**kwargs): - mandatory_args = [kwargs['keywords'], kwargs['actor'], kwargs['artist'], - kwargs['author'], kwargs['brand'], kwargs['title'], - kwargs['browse_node_id'], kwargs['search_index']] + mandatory_args = [ + kwargs["keywords"], + kwargs["actor"], + kwargs["artist"], + kwargs["author"], + kwargs["brand"], + kwargs["title"], + kwargs["browse_node_id"], + kwargs["search_index"], + ] 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, title, browse_node_id or search_index.') + error_message = ( + "At least one of the following args should be provided: keywords, actor," + " artist, author, brand, title, browse_node_id or search_index." + ) raise InvalidArgumentException(error_message) def _check_search_pagination_args(**kwargs): - error_message = ('Args item_count and item_page should be integers between 1 and 10.') - pagination_args = [kwargs['item_count'], kwargs['item_page']] + error_message = "Args item_count and item_page should be integers between 1 and 10." + pagination_args = [kwargs["item_count"], kwargs["item_page"]] pagination_args = [arg for arg in pagination_args if arg] if not all(isinstance(arg, int) for arg in pagination_args): @@ -52,8 +63,10 @@ def _check_search_pagination_args(**kwargs): def check_variations_args(**kwargs): - error_message = ('Args variation_count and variation_page should be integers between 1 and 10.') - variation_args = [kwargs['variation_count'], kwargs['variation_page']] + error_message = ( + "Args variation_count and variation_page should be integers between 1 and 10." + ) + variation_args = [kwargs["variation_count"], kwargs["variation_page"]] variation_args = [arg for arg in variation_args if arg] if not all(isinstance(arg, int) for arg in variation_args): @@ -64,6 +77,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 1aaa524..f0d6537 100644 --- a/amazon_paapi/helpers/generators.py +++ b/amazon_paapi/helpers/generators.py @@ -4,7 +4,9 @@ from typing import Generator, List -def get_list_chunks(full_list: List[str], chunk_size: int) -> Generator[List[str], None, None]: +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] + yield full_list[i : i + chunk_size] diff --git a/amazon_paapi/helpers/items.py b/amazon_paapi/helpers/items.py index 499faaf..40b139f 100644 --- a/amazon_paapi/helpers/items.py +++ b/amazon_paapi/helpers/items.py @@ -1,10 +1,13 @@ """Module to manage items""" from typing import List + from .. import models -def sort_items(items: List[models.Item], items_ids: List[str], include_unavailable: bool) -> List[models.Item]: +def sort_items( + items: List[models.Item], items_ids: List[str], include_unavailable: bool +) -> List[models.Item]: sorted_items = [] for asin in items_ids: diff --git a/amazon_paapi/helpers/requests.py b/amazon_paapi/helpers/requests.py index a32b867..a9b9c9b 100644 --- a/amazon_paapi/helpers/requests.py +++ b/amazon_paapi/helpers/requests.py @@ -30,14 +30,18 @@ def get_items_request(amazon_api, asin_chunk: List[str], **kwargs) -> GetItemsRequest: try: - return GetItemsRequest(resources=_get_request_resources(GetItemsResource), - partner_type=PartnerType.ASSOCIATES, - marketplace=amazon_api._marketplace, - partner_tag=amazon_api._tag, - item_ids=asin_chunk, - **kwargs) + return GetItemsRequest( + resources=_get_request_resources(GetItemsResource), + 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)) + raise MalformedRequestException( + "Parameters for get_items request are not correct: " + str(e) + ) def get_items_response(amazon_api, request: GetItemsRequest) -> List[Item]: @@ -47,20 +51,24 @@ def get_items_response(amazon_api, request: GetItemsRequest) -> List[Item]: _manage_response_exceptions(e) if response.items_result == None: - raise ItemsNotFoundException('No items have been found') + raise ItemsNotFoundException("No items have been found") return response.items_result.items def get_search_items_request(amazon_api, **kwargs) -> SearchItemsRequest: try: - return SearchItemsRequest(resources=_get_request_resources(SearchItemsResource), - partner_type=PartnerType.ASSOCIATES, - marketplace=amazon_api._marketplace, - partner_tag=amazon_api._tag, - **kwargs) + return SearchItemsRequest( + resources=_get_request_resources(SearchItemsResource), + 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)) + raise MalformedRequestException( + "Parameters for search_items request are not correct: " + str(e) + ) def get_search_items_response(amazon_api, request: SearchItemsRequest) -> SearchResult: @@ -70,74 +78,97 @@ def get_search_items_response(amazon_api, request: SearchItemsRequest) -> Search _manage_response_exceptions(e) if response.search_result == None: - raise ItemsNotFoundException('No items have been found') + raise ItemsNotFoundException("No items have been found") return response.search_result 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) + 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)) + raise MalformedRequestException( + "Parameters for get_variations request are not correct: " + str(e) + ) -def get_variations_response(amazon_api, request: GetVariationsRequest) -> VariationsResult: +def get_variations_response( + amazon_api, request: GetVariationsRequest +) -> VariationsResult: try: response = amazon_api._api.get_variations(request) except ApiException as e: _manage_response_exceptions(e) if response.variations_result == None: - raise ItemsNotFoundException('No variation items have been found') + raise ItemsNotFoundException("No variation items have been found") return response.variations_result 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) + 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)) + 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: _manage_response_exceptions(e) if response.browse_nodes_result == None: - raise ItemsNotFoundException('No browse nodes have been found') + raise ItemsNotFoundException("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] != '__'] + 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 + def _manage_response_exceptions(error) -> None: if isinstance(error, ApiException): if error.status == 429: - raise TooManyRequestsException('Requests limit reached, try increasing throttling or wait before trying again') - - elif 'InvalidParameterValue' in error.body: - raise InvalidArgumentException('The value provided in the request for atleast one parameter is invalid.') - - elif 'InvalidPartnerTag' in error.body: - raise InvalidArgumentException('The partner tag is invalid or not present.') - - elif 'InvalidAssociate' in error.body: - raise AssociateValidationException('Used credentials are not valid for the selected country.') - - raise ApiRequestException('Request failed: ' + str(error.reason)) + raise TooManyRequestsException( + "Requests limit reached, try increasing throttling or wait before" + " trying again" + ) + + elif "InvalidParameterValue" in error.body: + raise InvalidArgumentException( + "The value provided in the request for atleast one parameter is" + " invalid." + ) + + elif "InvalidPartnerTag" in error.body: + raise InvalidArgumentException("The partner tag is invalid or not present.") + + elif "InvalidAssociate" in error.body: + raise AssociateValidationException( + "Used credentials are not valid for the selected country." + ) + + raise ApiRequestException("Request failed: " + str(error.reason)) diff --git a/amazon_paapi/models/__init__.py b/amazon_paapi/models/__init__.py index dd7ee13..50fcd07 100644 --- a/amazon_paapi/models/__init__.py +++ b/amazon_paapi/models/__init__.py @@ -1,6 +1,6 @@ -from .regions import Country +from ..sdk.models import Availability, Condition, Merchant, SortBy +from .browse_nodes_result import BrowseNode from .item_result import Item +from .regions import Country 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 index 4cf288f..79d0c80 100644 --- a/amazon_paapi/models/browse_nodes_result.py +++ b/amazon_paapi/models/browse_nodes_result.py @@ -1,4 +1,5 @@ from typing import List + from ..sdk import models diff --git a/amazon_paapi/models/item_result.py b/amazon_paapi/models/item_result.py index 8617201..0b09c09 100644 --- a/amazon_paapi/models/item_result.py +++ b/amazon_paapi/models/item_result.py @@ -28,15 +28,21 @@ class ApiUnitBasedAttribute(ApiLabelLocale, models.UnitBasedAttribute): unit: str -class ApiSingleStringValuedAttribute(ApiLabelLocale, models.SingleStringValuedAttribute): +class ApiSingleStringValuedAttribute( + ApiLabelLocale, models.SingleStringValuedAttribute +): display_value: str -class ApiSingleBooleanValuedAttribute(ApiLabelLocale, models.SingleBooleanValuedAttribute): +class ApiSingleBooleanValuedAttribute( + ApiLabelLocale, models.SingleBooleanValuedAttribute +): display_value: bool -class ApiSingleIntegerValuedAttribute(ApiLabelLocale, models.SingleIntegerValuedAttribute): +class ApiSingleIntegerValuedAttribute( + ApiLabelLocale, models.SingleIntegerValuedAttribute +): display_value: float @@ -99,7 +105,7 @@ class ApiExternalIds(models.ExternalIds): up_cs: ApiMultiValuedAttributeStr -class ApiFeatures(): +class ApiFeatures: features: ApiMultiValuedAttributeStr diff --git a/amazon_paapi/models/regions.py b/amazon_paapi/models/regions.py index 36bc387..2657524 100644 --- a/amazon_paapi/models/regions.py +++ b/amazon_paapi/models/regions.py @@ -1,67 +1,67 @@ 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' + 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' + "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', + "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", } diff --git a/amazon_paapi/models/search_result.py b/amazon_paapi/models/search_result.py index b16cff4..68e30c3 100644 --- a/amazon_paapi/models/search_result.py +++ b/amazon_paapi/models/search_result.py @@ -1,6 +1,8 @@ from typing import List -from .item_result import Item + from ..sdk.models import SearchResult +from .item_result import Item + class SearchResult(SearchResult): items: List[Item] diff --git a/amazon_paapi/models/variations_result.py b/amazon_paapi/models/variations_result.py index f22cfcd..6a2f8cd 100644 --- a/amazon_paapi/models/variations_result.py +++ b/amazon_paapi/models/variations_result.py @@ -1,6 +1,8 @@ from typing import List -from .item_result import Item + from ..sdk.models import VariationsResult, VariationSummary +from .item_result import Item + class ApiPrice: amount: float @@ -18,6 +20,7 @@ class ApiVariationPrice: highest_price: ApiPrice lowest_price: ApiPrice + class ApiVariationSummary(VariationSummary): page_count: int price: ApiVariationPrice diff --git a/amazon_paapi/tools/asin.py b/amazon_paapi/tools/asin.py index e531977..f142855 100644 --- a/amazon_paapi/tools/asin.py +++ b/amazon_paapi/tools/asin.py @@ -1,18 +1,19 @@ """Some useful tools.""" import re + from ..errors import AsinNotFoundException def get_asin(text: str) -> str: """Returns the ASIN from a given text. Raises AsinNotFoundException on fail.""" # Return if text is an ASIN - if re.search(r'^[a-zA-Z0-9]{10}$', text): + if re.search(r"^[a-zA-Z0-9]{10}$", text): return text.upper() # 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) + asin = re.search(r"(dp|gp/product|gp/aw/d|dp/product)/([a-zA-Z0-9]{10})", text) if asin: return asin.group(2).upper() - raise AsinNotFoundException('Asin not found: ' + text) + raise AsinNotFoundException("Asin not found: " + text) diff --git a/docs/conf.py b/docs/conf.py index 5a365a1..52591b6 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -12,17 +12,18 @@ # import os import sys -sys.path.insert(0, os.path.abspath('..')) + +sys.path.insert(0, os.path.abspath("..")) # -- Project information ----------------------------------------------------- -project = 'python-amazon-paapi' -copyright = '2021, Sergio Abad' -author = 'Sergio Abad' +project = "python-amazon-paapi" +copyright = "2021, Sergio Abad" +author = "Sergio Abad" # The full version, including alpha/beta/rc tags -release = '4.2.0' +release = "4.2.0" # -- General configuration --------------------------------------------------- @@ -30,26 +31,22 @@ # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = [ - 'sphinx.ext.autodoc', - 'sphinx.ext.napoleon', - 'myst_parser' -] +extensions = ["sphinx.ext.autodoc", "sphinx.ext.napoleon", "myst_parser"] # Don't show type hints in the signature - that just makes it hardly readable # and we document the types anyway -autodoc_typehints = 'none' +autodoc_typehints = "none" # Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] +templates_path = ["_templates"] # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] # The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' +pygments_style = "sphinx" # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = False @@ -60,33 +57,34 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = 'sphinx_rtd_theme' +html_theme = "sphinx_rtd_theme" html_theme_options = { - 'style_external_links': True, + "style_external_links": True, } # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +html_static_path = ["_static"] # The name of an image file (relative to this directory) to place at the top # of the sidebar. -html_logo = '_static/pa-paapi-logo.png' +html_logo = "_static/pa-paapi-logo.png" # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. -html_favicon = '_static/pa-paapi-icon.ico' +html_favicon = "_static/pa-paapi-icon.ico" # -- script stuff -------------------------------------------------------- + def autodoc_skip_member(app, what, name, obj, skip, options): pass def setup(app): app.add_css_file("dark.css") - app.connect('autodoc-skip-member', autodoc_skip_member) + app.connect("autodoc-skip-member", autodoc_skip_member) diff --git a/examples/example.py b/examples/example.py index 7422280..fd3262b 100644 --- a/examples/example.py +++ b/examples/example.py @@ -1,32 +1,34 @@ -from amazon_paapi import AmazonApi import secrets +from amazon_paapi import AmazonApi -amazon = AmazonApi(secrets.KEY, secrets.SECRET, secrets.TAG, secrets.COUNTRY, throttling=2) +amazon = AmazonApi( + secrets.KEY, secrets.SECRET, secrets.TAG, secrets.COUNTRY, throttling=2 +) -print('\nGet items') -print('=========================================================') -product = amazon.get_items('B01N5IB20Q') +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) +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) +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 +print("\nGet nodes") +print("=========================================================") +items = amazon.get_browse_nodes(["667049031"]) # Only available in spanish marketplace for item in items: print(item.display_name) diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..59d9a8e --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,7 @@ +[tool.black] +preview = true +exclude = ".*/sdk/.*" + +[tool.isort] +profile = "black" +skip_glob = "*/sdk/*" diff --git a/scripts/check_black b/scripts/check_black new file mode 100755 index 0000000..bdebf44 --- /dev/null +++ b/scripts/check_black @@ -0,0 +1,23 @@ +#! /bin/bash + +ROOT_DIR="$(git rev-parse --show-toplevel)" +source "${ROOT_DIR}/scripts/helpers" + +header "Checking code format with black" + +if [ -n "$(check_if_installed docker)" ]; then + docker run -v "${PWD}:/code" sergioteula/pytools black --check --diff --color . +elif [ -n "$(check_if_installed black)" ]; then + black --check --diff --color . +else + error "black is not installed" + exit 1 +fi + +EXIT_CODE="$?" +if [ "$EXIT_CODE" = "0" ]; then + success "Code is correctly formatted" +else + error "Code should be formatted using black" + exit 1 +fi diff --git a/scripts/check_isort b/scripts/check_isort new file mode 100755 index 0000000..046205e --- /dev/null +++ b/scripts/check_isort @@ -0,0 +1,23 @@ +#! /bin/bash + +ROOT_DIR="$(git rev-parse --show-toplevel)" +source "${ROOT_DIR}/scripts/helpers" + +header "Checking imports order with isort" + +if [ -n "$(check_if_installed docker)" ]; then + docker run -v "${PWD}:/code" sergioteula/pytools isort -c --color . +elif [ -n "$(check_if_installed isort)" ]; then + isort -c --color . +else + error "isort is not installed" + exit 1 +fi + +EXIT_CODE="$?" +if [ "$EXIT_CODE" = "0" ]; then + success "Imports are correctly ordered" +else + error "Imports order is not correct" + exit 1 +fi diff --git a/scripts/helpers b/scripts/helpers new file mode 100755 index 0000000..c3351f3 --- /dev/null +++ b/scripts/helpers @@ -0,0 +1,30 @@ +#! /bin/bash -e + +BLUE="\033[0;34m" +GREEN="\033[0;32m" +RED="\033[0;31m" +YELLOW="\033[0;33m" +NC="\033[0m" +LINE="--------------------------------------------------------------------" + +check_if_installed() { + if [ -x "$(command -v "${1}")" ]; then + echo "${1} is installed" + fi +} + +header(){ + echo -e "\n${BLUE}${*}\n${BLUE}${LINE}${NC}" +} + +warning(){ + echo -e "${YELLOW}WARNING: ${*}${NC}" +} + +error(){ + echo -e "${RED}ERROR: ${*}${NC}" +} + +success(){ + echo -e "${GREEN}${*}${NC}" +} diff --git a/setup.py b/setup.py index c4f0797..b843949 100644 --- a/setup.py +++ b/setup.py @@ -1,28 +1,24 @@ import setuptools -with open('README.md', 'r') as fh: +with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( - name='python-amazon-paapi', - version='4.3.2', - author='Sergio Abad', - author_email='sergio.abad@bytelix.com', - description='Amazon Product Advertising API 5.0 wrapper for Python', + name="python-amazon-paapi", + version="4.3.2", + author="Sergio Abad", + author_email="sergio.abad@bytelix.com", + description="Amazon Product Advertising API 5.0 wrapper for Python", long_description=long_description, - long_description_content_type='text/markdown', - license='MIT', - url='https://github.com/sergioteula/python-amazon-paapi', + long_description_content_type="text/markdown", + license="MIT", + url="https://github.com/sergioteula/python-amazon-paapi", packages=setuptools.find_packages(), - install_requires=['certifi', - 'six', - 'python_dateutil', - 'setuptools', - 'urllib3'], + install_requires=["certifi", "six", "python_dateutil", "setuptools", "urllib3"], classifiers=[ - 'Programming Language :: Python', - 'License :: OSI Approved :: MIT License', - 'Operating System :: OS Independent', + "Programming Language :: Python", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", ], - python_requires='>=3.6', + python_requires=">=3.6", ) diff --git a/tests/test_api_get_browse_nodes.py b/tests/test_api_get_browse_nodes.py index 4f9edfd..dcaeb5b 100644 --- a/tests/test_api_get_browse_nodes.py +++ b/tests/test_api_get_browse_nodes.py @@ -11,5 +11,5 @@ def test_search_items(self, mocked_get_browse_nodes_response): mocked_response = [] mocked_get_browse_nodes_response.return_value = mocked_response amazon = AmazonApi("key", "secret", "tag", "ES") - response = amazon.get_browse_nodes(['ABCDEFGHIJ']) + response = amazon.get_browse_nodes(["ABCDEFGHIJ"]) self.assertTrue(isinstance(response, list))