From 5b2656816cc3bab2eac9d979242063ed975fa367 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 3 Sep 2026 22:05:01 +0000 Subject: [PATCH 1/2] Remove the deprecated amazon_paapi module Drop the legacy Product Advertising API 5.0 wrapper and its bundled SDK, leaving amazon_creatorsapi as the only public API. Release as 7.0.0. - Delete the amazon_paapi package and its test suite - Delete the PAAPI documentation and the version 6 migration guide - Drop the API_KEY/API_SECRET credentials, only used by the removed module - Narrow the packaging, lint, type-check and coverage config to the remaining packages Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_017tt3keqqTMqgirkJezEVU8 --- .agent/rules/code-style-guide.md | 4 +- .env.template | 6 - .github/workflows/check.yml | 2 - .pre-commit-config.yaml | 4 +- CHANGELOG.md | 15 + Makefile | 2 +- README.md | 5 +- amazon_paapi/__init__.py | 20 - amazon_paapi/api.py | 349 -------- amazon_paapi/errors/__init__.py | 25 - amazon_paapi/errors/exceptions.py | 46 - amazon_paapi/helpers/__init__.py | 1 - amazon_paapi/helpers/arguments.py | 93 -- amazon_paapi/helpers/generators.py | 16 - amazon_paapi/helpers/items.py | 21 - amazon_paapi/helpers/requests.py | 204 ----- amazon_paapi/models/__init__.py | 22 - amazon_paapi/models/browse_nodes_result.py | 30 - amazon_paapi/models/item_result.py | 450 ---------- amazon_paapi/models/regions.py | 105 --- amazon_paapi/models/search_result.py | 18 - amazon_paapi/models/variations_result.py | 49 -- amazon_paapi/sdk/COPYING.txt | 202 ----- amazon_paapi/sdk/LICENSE.txt | 202 ----- amazon_paapi/sdk/NOTICE.txt | 2 - amazon_paapi/sdk/__init__.py | 145 ---- amazon_paapi/sdk/api/__init__.py | 29 - amazon_paapi/sdk/api/default_api.py | 430 --------- amazon_paapi/sdk/api_client.py | 684 --------------- amazon_paapi/sdk/auth/__init__.py | 33 - amazon_paapi/sdk/auth/sign_helper.py | 152 ---- amazon_paapi/sdk/configuration.py | 232 ----- amazon_paapi/sdk/models/__init__.py | 135 --- amazon_paapi/sdk/models/availability.py | 105 --- amazon_paapi/sdk/models/big_decimal.py | 99 --- amazon_paapi/sdk/models/browse_node.py | 286 ------ .../sdk/models/browse_node_ancestor.py | 204 ----- amazon_paapi/sdk/models/browse_node_child.py | 179 ---- amazon_paapi/sdk/models/browse_node_info.py | 156 ---- .../sdk/models/browse_nodes_result.py | 129 --- amazon_paapi/sdk/models/by_line_info.py | 182 ---- amazon_paapi/sdk/models/classifications.py | 155 ---- amazon_paapi/sdk/models/condition.py | 108 --- amazon_paapi/sdk/models/content_info.py | 209 ----- amazon_paapi/sdk/models/content_rating.py | 129 --- amazon_paapi/sdk/models/contributor.py | 205 ----- amazon_paapi/sdk/models/customer_reviews.py | 155 ---- amazon_paapi/sdk/models/deal_details.py | 257 ------ amazon_paapi/sdk/models/delivery_flag.py | 107 --- .../sdk/models/dimension_based_attribute.py | 207 ----- amazon_paapi/sdk/models/duration_price.py | 156 ---- amazon_paapi/sdk/models/error_data.py | 153 ---- amazon_paapi/sdk/models/external_ids.py | 181 ---- .../sdk/models/get_browse_nodes_request.py | 263 ------ .../sdk/models/get_browse_nodes_resource.py | 105 --- .../sdk/models/get_browse_nodes_response.py | 156 ---- amazon_paapi/sdk/models/get_items_request.py | 424 --------- amazon_paapi/sdk/models/get_items_resource.py | 170 ---- amazon_paapi/sdk/models/get_items_response.py | 156 ---- .../sdk/models/get_variations_request.py | 449 ---------- .../sdk/models/get_variations_resource.py | 173 ---- .../sdk/models/get_variations_response.py | 156 ---- amazon_paapi/sdk/models/image_size.py | 179 ---- amazon_paapi/sdk/models/image_type.py | 181 ---- amazon_paapi/sdk/models/images.py | 155 ---- amazon_paapi/sdk/models/item.py | 422 --------- amazon_paapi/sdk/models/item_id_type.py | 104 --- amazon_paapi/sdk/models/item_info.py | 399 --------- amazon_paapi/sdk/models/items_result.py | 129 --- amazon_paapi/sdk/models/language_type.py | 153 ---- amazon_paapi/sdk/models/languages.py | 181 ---- amazon_paapi/sdk/models/manufacture_info.py | 181 ---- amazon_paapi/sdk/models/max_price.py | 99 --- amazon_paapi/sdk/models/merchant.py | 105 --- amazon_paapi/sdk/models/min_price.py | 99 --- amazon_paapi/sdk/models/min_reviews_rating.py | 99 --- amazon_paapi/sdk/models/min_saving_percent.py | 99 --- amazon_paapi/sdk/models/money.py | 181 ---- .../sdk/models/multi_valued_attribute.py | 179 ---- amazon_paapi/sdk/models/offer_availability.py | 205 ----- .../sdk/models/offer_availability_v2.py | 205 ----- amazon_paapi/sdk/models/offer_condition.py | 260 ------ .../sdk/models/offer_condition_note.py | 153 ---- amazon_paapi/sdk/models/offer_condition_v2.py | 179 ---- amazon_paapi/sdk/models/offer_count.py | 99 --- .../sdk/models/offer_delivery_info.py | 207 ----- amazon_paapi/sdk/models/offer_listing.py | 422 --------- amazon_paapi/sdk/models/offer_listing_v2.py | 343 -------- amazon_paapi/sdk/models/offer_listings.py | 101 --- amazon_paapi/sdk/models/offer_listings_v2.py | 101 --- .../sdk/models/offer_loyalty_points.py | 127 --- .../sdk/models/offer_loyalty_points_v2.py | 127 --- .../sdk/models/offer_merchant_info.py | 231 ----- .../sdk/models/offer_merchant_info_v2.py | 153 ---- amazon_paapi/sdk/models/offer_price.py | 286 ------ amazon_paapi/sdk/models/offer_price_v2.py | 209 ----- .../sdk/models/offer_program_eligibility.py | 153 ---- amazon_paapi/sdk/models/offer_promotion.py | 257 ------ amazon_paapi/sdk/models/offer_saving_basis.py | 182 ---- amazon_paapi/sdk/models/offer_savings.py | 231 ----- amazon_paapi/sdk/models/offer_savings_v2.py | 155 ---- .../sdk/models/offer_shipping_charge.py | 231 ----- .../sdk/models/offer_sub_condition.py | 205 ----- amazon_paapi/sdk/models/offer_summary.py | 208 ----- amazon_paapi/sdk/models/offer_type.py | 105 --- amazon_paapi/sdk/models/offers.py | 156 ---- amazon_paapi/sdk/models/offers_v2.py | 129 --- amazon_paapi/sdk/models/partner_type.py | 104 --- amazon_paapi/sdk/models/price.py | 155 ---- amazon_paapi/sdk/models/price_type.py | 107 --- ...roduct_advertising_api_client_exception.py | 129 --- ...oduct_advertising_api_service_exception.py | 127 --- amazon_paapi/sdk/models/product_info.py | 262 ------ amazon_paapi/sdk/models/properties.py | 99 --- amazon_paapi/sdk/models/rating.py | 127 --- amazon_paapi/sdk/models/refinement.py | 181 ---- amazon_paapi/sdk/models/refinement_bin.py | 153 ---- .../sdk/models/rental_offer_listing.py | 263 ------ amazon_paapi/sdk/models/rental_offers.py | 129 --- amazon_paapi/sdk/models/saving_basis_type.py | 107 --- amazon_paapi/sdk/models/search_index.py | 99 --- .../sdk/models/search_items_request.py | 819 ------------------ .../sdk/models/search_items_resource.py | 171 ---- .../sdk/models/search_items_response.py | 156 ---- amazon_paapi/sdk/models/search_refinements.py | 181 ---- amazon_paapi/sdk/models/search_result.py | 208 ----- .../models/single_boolean_valued_attribute.py | 179 ---- .../models/single_integer_valued_attribute.py | 179 ---- .../models/single_string_valued_attribute.py | 179 ---- amazon_paapi/sdk/models/sort_by.py | 109 --- amazon_paapi/sdk/models/technical_info.py | 156 ---- amazon_paapi/sdk/models/trade_in_info.py | 155 ---- amazon_paapi/sdk/models/trade_in_price.py | 179 ---- .../sdk/models/unit_based_attribute.py | 205 ----- .../sdk/models/variation_attribute.py | 153 ---- .../sdk/models/variation_dimension.py | 205 ----- amazon_paapi/sdk/models/variation_summary.py | 208 ----- amazon_paapi/sdk/models/variations_result.py | 156 ---- amazon_paapi/sdk/models/website_sales_rank.py | 205 ----- amazon_paapi/sdk/rest.py | 335 ------- amazon_paapi/tools/__init__.py | 5 - amazon_paapi/tools/asin.py | 19 - docs/conf.py | 2 +- docs/index.rst | 15 - docs/pages/migration-guide-6.md | 166 ---- docs/pages/usage-guide.md | 2 - pyproject.toml | 33 +- tests/__init__.py | 2 +- tests/api_test.py | 67 -- tests/errors_test.py | 12 - tests/helpers_arguments_test.py | 94 -- tests/helpers_generators_test.py | 19 - tests/helpers_items_test.py | 52 -- tests/helpers_requests_test.py | 183 ---- tests/integration_test.py | 333 ------- tests/offersv2_test.py | 79 -- tests/tools_test.py | 37 - 157 files changed, 32 insertions(+), 24780 deletions(-) delete mode 100644 amazon_paapi/__init__.py delete mode 100644 amazon_paapi/api.py delete mode 100644 amazon_paapi/errors/__init__.py delete mode 100644 amazon_paapi/errors/exceptions.py delete mode 100644 amazon_paapi/helpers/__init__.py delete mode 100644 amazon_paapi/helpers/arguments.py delete mode 100644 amazon_paapi/helpers/generators.py delete mode 100644 amazon_paapi/helpers/items.py delete mode 100644 amazon_paapi/helpers/requests.py delete mode 100644 amazon_paapi/models/__init__.py delete mode 100644 amazon_paapi/models/browse_nodes_result.py delete mode 100644 amazon_paapi/models/item_result.py delete mode 100644 amazon_paapi/models/regions.py delete mode 100644 amazon_paapi/models/search_result.py delete mode 100644 amazon_paapi/models/variations_result.py delete mode 100644 amazon_paapi/sdk/COPYING.txt delete mode 100644 amazon_paapi/sdk/LICENSE.txt delete mode 100644 amazon_paapi/sdk/NOTICE.txt delete mode 100644 amazon_paapi/sdk/__init__.py delete mode 100644 amazon_paapi/sdk/api/__init__.py delete mode 100644 amazon_paapi/sdk/api/default_api.py delete mode 100644 amazon_paapi/sdk/api_client.py delete mode 100644 amazon_paapi/sdk/auth/__init__.py delete mode 100644 amazon_paapi/sdk/auth/sign_helper.py delete mode 100644 amazon_paapi/sdk/configuration.py delete mode 100644 amazon_paapi/sdk/models/__init__.py delete mode 100644 amazon_paapi/sdk/models/availability.py delete mode 100644 amazon_paapi/sdk/models/big_decimal.py delete mode 100644 amazon_paapi/sdk/models/browse_node.py delete mode 100644 amazon_paapi/sdk/models/browse_node_ancestor.py delete mode 100644 amazon_paapi/sdk/models/browse_node_child.py delete mode 100644 amazon_paapi/sdk/models/browse_node_info.py delete mode 100644 amazon_paapi/sdk/models/browse_nodes_result.py delete mode 100644 amazon_paapi/sdk/models/by_line_info.py delete mode 100644 amazon_paapi/sdk/models/classifications.py delete mode 100644 amazon_paapi/sdk/models/condition.py delete mode 100644 amazon_paapi/sdk/models/content_info.py delete mode 100644 amazon_paapi/sdk/models/content_rating.py delete mode 100644 amazon_paapi/sdk/models/contributor.py delete mode 100644 amazon_paapi/sdk/models/customer_reviews.py delete mode 100644 amazon_paapi/sdk/models/deal_details.py delete mode 100644 amazon_paapi/sdk/models/delivery_flag.py delete mode 100644 amazon_paapi/sdk/models/dimension_based_attribute.py delete mode 100644 amazon_paapi/sdk/models/duration_price.py delete mode 100644 amazon_paapi/sdk/models/error_data.py delete mode 100644 amazon_paapi/sdk/models/external_ids.py delete mode 100644 amazon_paapi/sdk/models/get_browse_nodes_request.py delete mode 100644 amazon_paapi/sdk/models/get_browse_nodes_resource.py delete mode 100644 amazon_paapi/sdk/models/get_browse_nodes_response.py delete mode 100644 amazon_paapi/sdk/models/get_items_request.py delete mode 100644 amazon_paapi/sdk/models/get_items_resource.py delete mode 100644 amazon_paapi/sdk/models/get_items_response.py delete mode 100644 amazon_paapi/sdk/models/get_variations_request.py delete mode 100644 amazon_paapi/sdk/models/get_variations_resource.py delete mode 100644 amazon_paapi/sdk/models/get_variations_response.py delete mode 100644 amazon_paapi/sdk/models/image_size.py delete mode 100644 amazon_paapi/sdk/models/image_type.py delete mode 100644 amazon_paapi/sdk/models/images.py delete mode 100644 amazon_paapi/sdk/models/item.py delete mode 100644 amazon_paapi/sdk/models/item_id_type.py delete mode 100644 amazon_paapi/sdk/models/item_info.py delete mode 100644 amazon_paapi/sdk/models/items_result.py delete mode 100644 amazon_paapi/sdk/models/language_type.py delete mode 100644 amazon_paapi/sdk/models/languages.py delete mode 100644 amazon_paapi/sdk/models/manufacture_info.py delete mode 100644 amazon_paapi/sdk/models/max_price.py delete mode 100644 amazon_paapi/sdk/models/merchant.py delete mode 100644 amazon_paapi/sdk/models/min_price.py delete mode 100644 amazon_paapi/sdk/models/min_reviews_rating.py delete mode 100644 amazon_paapi/sdk/models/min_saving_percent.py delete mode 100644 amazon_paapi/sdk/models/money.py delete mode 100644 amazon_paapi/sdk/models/multi_valued_attribute.py delete mode 100644 amazon_paapi/sdk/models/offer_availability.py delete mode 100644 amazon_paapi/sdk/models/offer_availability_v2.py delete mode 100644 amazon_paapi/sdk/models/offer_condition.py delete mode 100644 amazon_paapi/sdk/models/offer_condition_note.py delete mode 100644 amazon_paapi/sdk/models/offer_condition_v2.py delete mode 100644 amazon_paapi/sdk/models/offer_count.py delete mode 100644 amazon_paapi/sdk/models/offer_delivery_info.py delete mode 100644 amazon_paapi/sdk/models/offer_listing.py delete mode 100644 amazon_paapi/sdk/models/offer_listing_v2.py delete mode 100644 amazon_paapi/sdk/models/offer_listings.py delete mode 100644 amazon_paapi/sdk/models/offer_listings_v2.py delete mode 100644 amazon_paapi/sdk/models/offer_loyalty_points.py delete mode 100644 amazon_paapi/sdk/models/offer_loyalty_points_v2.py delete mode 100644 amazon_paapi/sdk/models/offer_merchant_info.py delete mode 100644 amazon_paapi/sdk/models/offer_merchant_info_v2.py delete mode 100644 amazon_paapi/sdk/models/offer_price.py delete mode 100644 amazon_paapi/sdk/models/offer_price_v2.py delete mode 100644 amazon_paapi/sdk/models/offer_program_eligibility.py delete mode 100644 amazon_paapi/sdk/models/offer_promotion.py delete mode 100644 amazon_paapi/sdk/models/offer_saving_basis.py delete mode 100644 amazon_paapi/sdk/models/offer_savings.py delete mode 100644 amazon_paapi/sdk/models/offer_savings_v2.py delete mode 100644 amazon_paapi/sdk/models/offer_shipping_charge.py delete mode 100644 amazon_paapi/sdk/models/offer_sub_condition.py delete mode 100644 amazon_paapi/sdk/models/offer_summary.py delete mode 100644 amazon_paapi/sdk/models/offer_type.py delete mode 100644 amazon_paapi/sdk/models/offers.py delete mode 100644 amazon_paapi/sdk/models/offers_v2.py delete mode 100644 amazon_paapi/sdk/models/partner_type.py delete mode 100644 amazon_paapi/sdk/models/price.py delete mode 100644 amazon_paapi/sdk/models/price_type.py delete mode 100644 amazon_paapi/sdk/models/product_advertising_api_client_exception.py delete mode 100644 amazon_paapi/sdk/models/product_advertising_api_service_exception.py delete mode 100644 amazon_paapi/sdk/models/product_info.py delete mode 100644 amazon_paapi/sdk/models/properties.py delete mode 100644 amazon_paapi/sdk/models/rating.py delete mode 100644 amazon_paapi/sdk/models/refinement.py delete mode 100644 amazon_paapi/sdk/models/refinement_bin.py delete mode 100644 amazon_paapi/sdk/models/rental_offer_listing.py delete mode 100644 amazon_paapi/sdk/models/rental_offers.py delete mode 100644 amazon_paapi/sdk/models/saving_basis_type.py delete mode 100644 amazon_paapi/sdk/models/search_index.py delete mode 100644 amazon_paapi/sdk/models/search_items_request.py delete mode 100644 amazon_paapi/sdk/models/search_items_resource.py delete mode 100644 amazon_paapi/sdk/models/search_items_response.py delete mode 100644 amazon_paapi/sdk/models/search_refinements.py delete mode 100644 amazon_paapi/sdk/models/search_result.py delete mode 100644 amazon_paapi/sdk/models/single_boolean_valued_attribute.py delete mode 100644 amazon_paapi/sdk/models/single_integer_valued_attribute.py delete mode 100644 amazon_paapi/sdk/models/single_string_valued_attribute.py delete mode 100644 amazon_paapi/sdk/models/sort_by.py delete mode 100644 amazon_paapi/sdk/models/technical_info.py delete mode 100644 amazon_paapi/sdk/models/trade_in_info.py delete mode 100644 amazon_paapi/sdk/models/trade_in_price.py delete mode 100644 amazon_paapi/sdk/models/unit_based_attribute.py delete mode 100644 amazon_paapi/sdk/models/variation_attribute.py delete mode 100644 amazon_paapi/sdk/models/variation_dimension.py delete mode 100644 amazon_paapi/sdk/models/variation_summary.py delete mode 100644 amazon_paapi/sdk/models/variations_result.py delete mode 100644 amazon_paapi/sdk/models/website_sales_rank.py delete mode 100644 amazon_paapi/sdk/rest.py delete mode 100644 amazon_paapi/tools/__init__.py delete mode 100644 amazon_paapi/tools/asin.py delete mode 100644 docs/pages/migration-guide-6.md delete mode 100644 tests/api_test.py delete mode 100644 tests/errors_test.py delete mode 100644 tests/helpers_arguments_test.py delete mode 100644 tests/helpers_generators_test.py delete mode 100644 tests/helpers_items_test.py delete mode 100644 tests/helpers_requests_test.py delete mode 100644 tests/integration_test.py delete mode 100644 tests/offersv2_test.py delete mode 100644 tests/tools_test.py diff --git a/.agent/rules/code-style-guide.md b/.agent/rules/code-style-guide.md index 76ddac1..3aba2a0 100644 --- a/.agent/rules/code-style-guide.md +++ b/.agent/rules/code-style-guide.md @@ -17,11 +17,11 @@ trigger: always_on # Test - Add tests following TDD practices -- Mirror the amazon_paapi structure in the tests directory +- Mirror the amazon_creatorsapi structure in the tests directory - Use unittest.TestCase with setUp() and tearDown() - Use unittest assertions, not native assert - Use @patch decorators for mocks (avoid context managers) # References -- Documentation for the Product Advertising API here: https://webservices.amazon.com/paapi5/documentation/operations.html +- Documentation for the Creators API here: https://webservices.amazon.com/creatorsapi/documentation/ diff --git a/.env.template b/.env.template index 43f6d49..25fd0d6 100644 --- a/.env.template +++ b/.env.template @@ -1,13 +1,7 @@ -# Product Advertising API -API_KEY= -API_SECRET= - # Creators API CREDENTIAL_ID= CREDENTIAL_SECRET= API_VERSION= MARKETPLACE= - -# Common AFFILIATE_TAG= COUNTRY_CODE= diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 3141c57..10711f8 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -31,8 +31,6 @@ jobs: check: runs-on: ubuntu-latest env: - API_KEY: ${{ secrets.API_KEY }} - API_SECRET: ${{ secrets.API_SECRET }} AFFILIATE_TAG: ${{ secrets.AFFILIATE_TAG }} COUNTRY_CODE: ${{ secrets.COUNTRY_CODE }} CREDENTIAL_ID: ${{ secrets.CREDENTIAL_ID }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 86bbee9..83d294e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,7 +33,7 @@ repos: rev: v0.1.6 hooks: - id: detect-missing-init - args: ["--create", "--python-folders", "amazon_paapi"] + args: ["--create", "--python-folders", "amazon_creatorsapi"] - repo: https://github.com/gitleaks/gitleaks rev: v8.30.0 @@ -52,7 +52,7 @@ repos: - id: test name: Running tests language: system - entry: "bash -c 'set -a && source .env 2>/dev/null; set +a && uv run pytest -rs --cov=amazon_paapi --cov=amazon_creatorsapi'" + entry: "bash -c 'set -a && source .env 2>/dev/null; set +a && uv run pytest -rs --cov=amazon_creatorsapi'" types_or: [python] pass_filenames: false diff --git a/CHANGELOG.md b/CHANGELOG.md index c241184..9b793eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,21 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [7.0.0] - 2026-09-03 + +### Removed + +- The deprecated `amazon_paapi` module and its bundled Product Advertising API 5.0 SDK +- `AmazonApi`, `amazon_paapi.errors`, `amazon_paapi.helpers`, `amazon_paapi.models` and `amazon_paapi.tools` +- Product Advertising API documentation, including the version 6 migration guide +- `API_KEY` and `API_SECRET` environment variables, only used by the removed module + +### Changed + +- Use `amazon_creatorsapi` instead. Replace `AmazonApi(access_key, secret_key, partner_tag, country)` + with `AmazonCreatorsApi(credential_id, credential_secret, version, tag, country)`, and import + `get_asin` from `amazon_creatorsapi` + ## [6.4.0] - 2026-09-03 ### Added diff --git a/Makefile b/Makefile index 9210f8d..8400552 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ test: @uv run --env-file .env pytest -rs coverage: - @uv run pytest -rs --cov=amazon_paapi --cov=amazon_creatorsapi --cov-report=html --cov-report=term --cov-report=xml + @uv run pytest -rs --cov=amazon_creatorsapi --cov-report=html --cov-report=term --cov-report=xml test-all-python-tags: @touch .env diff --git a/README.md b/README.md index 952bdbf..2b96f7c 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,12 @@ # Python Amazon Creators API -A Python wrapper for Amazon's product APIs. This package supports both the legacy [Product Advertising API 5.0](https://webservices.amazon.com/paapi5/documentation/) and the new [Amazon Creators API](https://webservices.amazon.com/creatorsapi/documentation/). +A Python wrapper for the [Amazon Creators API](https://webservices.amazon.com/creatorsapi/documentation/). [![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-≥3.9-%23FFD140)](https://www.python.org/) [![License](https://img.shields.io/badge/License-MIT-%23e83633)](https://github.com/sergioteula/python-amazon-paapi/blob/master/LICENSE) [![Downloads](https://img.shields.io/pypi/dm/python-amazon-paapi?label=Downloads)](https://pypi.org/project/python-amazon-paapi/) -> [!IMPORTANT] -> **Migration Advisory**: The `amazon_paapi` module is deprecated. Amazon is transitioning from the Product Advertising API (PAAPI) to the new **Creators API**. Please migrate to the `amazon_creatorsapi` module for new projects. See the [Migration Guide](https://python-amazon-paapi.readthedocs.io/en/latest/pages/migration-guide-6.html) for more information. - ## Features - 🎯 **Simple object-oriented interface** for easy integration diff --git a/amazon_paapi/__init__.py b/amazon_paapi/__init__.py deleted file mode 100644 index e17cee7..0000000 --- a/amazon_paapi/__init__.py +++ /dev/null @@ -1,20 +0,0 @@ -"""Amazon Product Advertising API wrapper for Python. - -DEPRECATED: This module is deprecated and will be removed in a future version. -Use `amazon_creatorsapi` instead. -""" - -import warnings - -warnings.warn( - "The 'amazon_paapi' module is deprecated and will be removed in a future version. " - "Please use 'amazon_creatorsapi' instead.", - DeprecationWarning, - stacklevel=2, -) - -__author__ = "Sergio Abad" -__all__ = ["AmazonApi", "get_asin"] - -from .api import AmazonApi # noqa: E402 -from .tools import get_asin # noqa: E402 diff --git a/amazon_paapi/api.py b/amazon_paapi/api.py deleted file mode 100644 index 9dee50a..0000000 --- a/amazon_paapi/api.py +++ /dev/null @@ -1,349 +0,0 @@ -"""Amazon Product Advertising API wrapper for Python. - -A simple Python wrapper for the last version of the Amazon Product Advertising API. -""" - -from __future__ import annotations - -import time -from typing import TYPE_CHECKING, Any - -from . import models -from .errors import InvalidArgument -from .helpers import arguments, requests -from .helpers.generators import get_list_chunks -from .helpers.items import sort_items -from .sdk.api.default_api import DefaultApi - -if TYPE_CHECKING: - from .models.regions import CountryCode - - -class AmazonApi: - """Provides methods to get information from Amazon using your API credentials. - - Args: - key (``str``): Your API key. - secret (``str``): Your API secret. - tag (``str``): Your affiliate tracking id, used to create the affiliate link. - country (``CountryCode``): Country code for your affiliate account. - Use values from ``models.Country``, e.g. ``Country.ES``. - throttling (``float``, optional): Wait time in seconds between API calls. Use it - to avoid reaching Amazon limits. Defaults to 1 second. - - Raises: - ``InvalidArgumentException`` - - """ - - def __init__( - self, - key: str, - secret: str, - tag: str, - country: CountryCode, - throttling: float = 1, - ) -> None: - """Initialize the Amazon API client with the provided credentials.""" - self._key = key - self._secret = secret - self._last_query_time = time.time() - throttling - self.tag = tag - self.country = country - self.throttling = float(throttling) - - try: - self._host = "webservices.amazon." + models.regions.DOMAINS[country] - self.region = models.regions.REGIONS[country] - self.marketplace = "www.amazon." + models.regions.DOMAINS[country] - except KeyError as error: - msg = "Country code is not correct" - raise InvalidArgument(msg) from error - - self.api = DefaultApi(key, secret, self._host, self.region) - - def get_items( - self, - items: str | list[str], - condition: models.Condition = None, - merchant: models.Merchant = None, - currency_of_preference: str | None = None, - languages_of_preference: list[str] | None = None, - include_unavailable: bool = False, - **kwargs: Any, - ) -> list[models.Item]: - """Get items information from Amazon. - - Args: - items (``str`` | ``list[str]``): One or more items, using ASIN or product - URL. Items in string format should be separated by commas. - condition (``models.Condition``, optional): Filters offers by condition - type. Defaults to Any. - merchant (``models.Merchant``, optional): Filters search results to return - items having at least an offer sold by target merchant. Defaults to All. - currency_of_preference (``str``, optional): Currency of preference in which - the prices information should be returned. Expected currency code format - is ISO 4217. - languages_of_preference (``list[str]``, optional): Languages in order of - preference in which the item information should be returned. - include_unavailable (``bool``, optional): The returned list includes not - available items. Not available items have the ASIN and item_info equals - None. Defaults to False. - kwargs (``dict``, optional): Other arguments to be passed to the Amazon API. - - Returns: - ``list[models.Item]``: A list of items with Amazon information. - - Raises: - ``InvalidArgumentException`` - ``MalformedRequestException`` - ``ApiRequestException`` - ``ItemsNotFoundException`` - - """ - 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 = [] - - for asin_chunk in get_list_chunks(list(set(items_ids)), chunk_size=10): - request = requests.get_items_request(self, asin_chunk, **kwargs) - self._throttle() - items_response = requests.get_items_response(self, request) - results.extend(items_response) - - return sort_items(results, items_ids, include_unavailable=include_unavailable) - - def search_items( - self, # NOSONAR - item_count: int | None = None, - item_page: int | None = None, - actor: str | None = None, - artist: str | None = None, - author: str | None = None, - brand: str | None = None, - keywords: str | None = None, - title: str | None = None, - availability: models.Availability = None, - browse_node_id: str | None = None, - condition: models.Condition = None, - currency_of_preference: str | None = None, - delivery_flags: list[str] | None = None, - languages_of_preference: list[str] | None = None, - merchant: models.Merchant = None, - max_price: int | None = None, - min_price: int | None = None, - min_saving_percent: int | None = None, - min_reviews_rating: int | None = None, - search_index: str | None = None, - sort_by: models.SortBy = None, - **kwargs: Any, - ) -> models.SearchResult: - """Search for items on Amazon based on a search query. - - At least one of the following parameters should be specified: ``keywords``, - ``actor``, ``artist``, ``author``, ``brand``, ``title``, ``browse_node_id`` - or ``search_index``. - - Args: - item_count (``int``, optional): Number of items returned. Should be between - 1 and 10. Defaults to 10. - item_page (``int``, optional): The specific page of items to be returned - from the available results. Should be between 1 and 10. Defaults to 1. - actor (``str``, optional): Actor name associated with the item. - artist (``str``, optional): Artist name associated with the item. - author (``str``, optional): Author name associated with the item. - brand (``str``, optional): Brand name associated with the item. - keywords (``str``, optional): A word or phrase that describes an item. - title (``str``, optional): Title associated with the item. - availability (``models.Availability``, optional): Filters available items on - Amazon. Defaults to Available. - browse_node_id (``str``, optional): A unique ID assigned by Amazon that - identifies a product category or subcategory. - condition (``models.Condition``, optional): Filters offers by condition - type. Defaults to Any. - currency_of_preference (``str``, optional): Currency of preference in which - the prices information should be returned. Expected currency code format - is ISO 4217. - delivery_flags (``list[str]``): Filters items which satisfy a certain - delivery program. - languages_of_preference (``list[str]``, optional): Languages in order of - preference in which the item information should be returned. - merchant (``models.Merchant``, optional): Filters search results to return - items having at least an offer sold by target merchant. Defaults to All. - max_price (``int``, optional): Filters search results to items with at least - one offer price below the specified value. Prices appear in lowest - currency denomination. For example, $31.41 should be passed as 3141 or - 28.00€ should be 2800. - min_price (``int``, optional): Filters search results to items with at least - one offer price above the specified value. Prices appear in lowest - currency denomination. For example, $31.41 should be passed as 3141 or - 28.00€ should be 2800. - min_saving_percent (``int``, optional): Filters search results to items with - at least one offer having saving percentage above the specified value. - Value should be positive integer less than 100. - min_reviews_rating (``int``, optional): Filters search results to items with - customer review ratings above specified value. Value should be positive - integer less than 5. - search_index (``str``, optional): Indicates the product category to search. - Defaults to All. - sort_by (``models.SortBy``, optional): The way in which items are sorted. - kwargs (``dict``, optional): Other arguments to be passed to the Amazon API. - - Returns: - ``models.SearchResult``: The search result containing the list of items. - - Raises: - ``InvalidArgumentException`` - ``MalformedRequestException`` - ``ApiRequestException`` - ``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, - } - ) - - 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, - variation_count: int | None = None, - variation_page: int | None = None, - condition: models.Condition = None, - currency_of_preference: str | None = None, - languages_of_preference: list[str] | None = None, - merchant: models.Merchant = None, - **kwargs: Any, - ) -> models.VariationsResult: - """Return a set of items that are the same product but differ by theme. - - Items can differ by size, color, or other variation attributes. - A variation is a child ASIN. - - Args: - asin (``str``): One item, using ASIN or product URL. - variation_count (``int``, optional): Number of items returned. Should be - between 1 and 10. Defaults to 10. - variation_page (``int``, optional): The specific page of items to be - returned from the available results. Should be between 1 and 10. - Defaults to 1. - condition (``models.Condition``, optional): Filters offers by condition - type. Defaults to Any. - currency_of_preference (``str``, optional): Currency of preference in which - the prices information should be returned. Expected currency code format - is ISO 4217. - languages_of_preference (``list[str]``, optional): Languages in order of - preference in which the item information should be returned. - merchant (``models.Merchant``, optional): Filters search results to return - items having at least an offer sold by target merchant. Defaults to All. - kwargs (``dict``, optional): Other arguments to be passed to the Amazon API. - - Returns: - ``models.VariationsResult``: Variations result containing the items list. - - Raises: - ``InvalidArgumentException`` - ``MalformedRequestException`` - ``ApiRequestException`` - ``ItemsNotFoundException`` - - """ - 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, - } - ) - - 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], - languages_of_preference: list[str] | None = None, - **kwargs: Any, - ) -> list[models.BrowseNode]: - """Return the specified browse node's information. - - Information includes name, children, and ancestors. - - Args: - browse_node_ids (``list[str]``): List of browse node ids. A browse node id - is a unique ID assigned by Amazon that identifies a product - category/sub-category. - languages_of_preference (``list[str]``, optional): Languages in order of - preference in which the item information should be returned. - kwargs (``dict``, optional): Other arguments to be passed to the Amazon API. - - Returns: - ``list[models.BrowseNode]``: A list of browse nodes. - - Raises: - ``InvalidArgumentException`` - ``MalformedRequestException`` - ``ApiRequestException`` - ``ItemsNotFoundException`` - - """ - 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) -> None: - """Wait for the throttling interval to elapse since the last API call.""" - wait_time = self.throttling - (time.time() - self._last_query_time) - if wait_time > 0: - time.sleep(wait_time) - self._last_query_time = time.time() diff --git a/amazon_paapi/errors/__init__.py b/amazon_paapi/errors/__init__.py deleted file mode 100644 index 46d33de..0000000 --- a/amazon_paapi/errors/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -"""Custom exceptions for the Amazon Product Advertising API.""" - -from .exceptions import ( - AmazonError, - AsinNotFound, - AssociateValidationError, - InvalidArgument, - InvalidPartnerTag, - ItemsNotFound, - MalformedRequest, - RequestError, - TooManyRequests, -) - -__all__ = [ - "AmazonError", - "AsinNotFound", - "AssociateValidationError", - "InvalidArgument", - "InvalidPartnerTag", - "ItemsNotFound", - "MalformedRequest", - "RequestError", - "TooManyRequests", -] diff --git a/amazon_paapi/errors/exceptions.py b/amazon_paapi/errors/exceptions.py deleted file mode 100644 index 35e2100..0000000 --- a/amazon_paapi/errors/exceptions.py +++ /dev/null @@ -1,46 +0,0 @@ -"""Custom exceptions module.""" - - -class AmazonError(Exception): - """Common base class for all Amazon API exceptions.""" - - def __init__(self, reason: str) -> None: - """Initialize the exception with a reason message.""" - super().__init__() - self.reason = reason - - def __str__(self) -> str: - """Return the string representation of the exception.""" - return self.reason - - -class AsinNotFound(AmazonError): - """Raised if the ASIN for an item is not found.""" - - -class AssociateValidationError(AmazonError): - """Raised when credentials are not valid for the selected country.""" - - -class InvalidArgument(AmazonError): - """Raised when arguments are not correct.""" - - -class InvalidPartnerTag(AmazonError): - """Raised if the partner tag is not present or invalid.""" - - -class ItemsNotFound(AmazonError): - """Raised if no items are found.""" - - -class MalformedRequest(AmazonError): - """Raised if the request for Amazon API is not correctly formed.""" - - -class RequestError(AmazonError): - """Raised if the request to Amazon API fails.""" - - -class TooManyRequests(AmazonError): - """Raised when requests limit is reached.""" diff --git a/amazon_paapi/helpers/__init__.py b/amazon_paapi/helpers/__init__.py deleted file mode 100644 index c5bc5b8..0000000 --- a/amazon_paapi/helpers/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Helper modules for Amazon PAAPI requests and responses.""" diff --git a/amazon_paapi/helpers/arguments.py b/amazon_paapi/helpers/arguments.py deleted file mode 100644 index ba8ae18..0000000 --- a/amazon_paapi/helpers/arguments.py +++ /dev/null @@ -1,93 +0,0 @@ -"""Module with helper functions for managing arguments.""" - -from __future__ import annotations - -from typing import Any - -from amazon_paapi.errors import InvalidArgument -from amazon_paapi.tools import get_asin - -MAX_PAGINATION_VALUE = 10 - - -def get_items_ids(items: str | list[str]) -> list[str]: - """Parse and extract ASINs from items input. - - Args: - items: Either a comma-separated string of ASINs/URLs or a list of ASINs/URLs. - - Returns: - A list of extracted ASINs. - - Raises: - InvalidArgument: If items is not a string or list. - - """ - if isinstance(items, str): - items_ids = items.split(",") - return [get_asin(x.strip()) for x in items_ids] - - if isinstance(items, list): - return [get_asin(x.strip()) for x in items] - - msg = "Invalid items argument, it should be a string or List of strings" # type: ignore[unreachable] - raise InvalidArgument(msg) - - -def check_search_args(**kwargs: Any) -> None: - """Validate all search arguments.""" - check_search_mandatory_args(**kwargs) - check_search_pagination_args(**kwargs) - - -def check_search_mandatory_args(**kwargs: Any) -> None: - """Validate that at least one mandatory search argument is provided.""" - mandatory_args = [ - kwargs.get("keywords"), - kwargs.get("actor"), - kwargs.get("artist"), - kwargs.get("author"), - kwargs.get("brand"), - kwargs.get("title"), - kwargs.get("browse_node_id"), - kwargs.get("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." - ) - raise InvalidArgument(error_message) - - -def check_search_pagination_args(**kwargs: Any) -> None: - """Validate pagination arguments for search requests.""" - error_message = "Args item_count and item_page should be integers between 1 and 10." - pagination_args = [kwargs.get("item_count"), kwargs.get("item_page")] - - for arg in pagination_args: - if arg is not None and ( - not isinstance(arg, int) or not 1 <= arg <= MAX_PAGINATION_VALUE - ): - raise InvalidArgument(error_message) - - -def check_variations_args(**kwargs: Any) -> None: - """Validate variation arguments for get_variations requests.""" - error_message = ( - "Args variation_count and variation_page should be integers between 1 and 10." - ) - variation_args = [kwargs.get("variation_count"), kwargs.get("variation_page")] - - for arg in variation_args: - if arg is not None and ( - not isinstance(arg, int) or not 1 <= arg <= MAX_PAGINATION_VALUE - ): - raise InvalidArgument(error_message) - - -def check_browse_nodes_args(**kwargs: Any) -> None: - """Validate browse node arguments.""" - if not isinstance(kwargs.get("browse_node_ids"), list): - error_message = "Argument browse_node_ids should be a List of strings." - raise InvalidArgument(error_message) diff --git a/amazon_paapi/helpers/generators.py b/amazon_paapi/helpers/generators.py deleted file mode 100644 index fd6a9e1..0000000 --- a/amazon_paapi/helpers/generators.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Module with helper functions for making generators.""" - -from __future__ import annotations - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from collections.abc import Generator - - -def get_list_chunks( - full_list: list[str], chunk_size: int -) -> Generator[list[str], None, None]: - """Yield successive chunks from List.""" - for i in range(0, len(full_list), chunk_size): - yield full_list[i : i + chunk_size] diff --git a/amazon_paapi/helpers/items.py b/amazon_paapi/helpers/items.py deleted file mode 100644 index e0b3831..0000000 --- a/amazon_paapi/helpers/items.py +++ /dev/null @@ -1,21 +0,0 @@ -"""Module to manage items.""" - -from __future__ import annotations - -from amazon_paapi import models - - -def sort_items( - items: list[models.Item], items_ids: list[str], *, include_unavailable: bool -) -> list[models.Item]: - """Sort items by the order of the provided items_ids list.""" - sorted_items: list[models.Item] = [] - - for asin in items_ids: - matches: list[models.Item] = [item for item in items if item.asin == asin] - if matches: - sorted_items.append(matches[0]) - elif include_unavailable: - sorted_items.append(models.Item(asin=asin)) - - return sorted_items diff --git a/amazon_paapi/helpers/requests.py b/amazon_paapi/helpers/requests.py deleted file mode 100644 index 7ce47cf..0000000 --- a/amazon_paapi/helpers/requests.py +++ /dev/null @@ -1,204 +0,0 @@ -"""Module with helper functions for creating requests.""" - -from __future__ import annotations - -import inspect -from typing import TYPE_CHECKING, Any, NoReturn, cast - -from amazon_paapi.errors import ( - AssociateValidationError, - InvalidArgument, - ItemsNotFound, - MalformedRequest, - RequestError, - TooManyRequests, -) -from amazon_paapi.sdk.models.get_browse_nodes_request import GetBrowseNodesRequest -from amazon_paapi.sdk.models.get_browse_nodes_resource import GetBrowseNodesResource -from amazon_paapi.sdk.models.get_items_request import GetItemsRequest -from amazon_paapi.sdk.models.get_items_resource import GetItemsResource -from amazon_paapi.sdk.models.get_variations_request import GetVariationsRequest -from amazon_paapi.sdk.models.get_variations_resource import GetVariationsResource -from amazon_paapi.sdk.models.partner_type import PartnerType -from amazon_paapi.sdk.models.search_items_request import SearchItemsRequest -from amazon_paapi.sdk.models.search_items_resource import SearchItemsResource -from amazon_paapi.sdk.rest import ApiException -from amazon_paapi.sdk.rest import ApiException as ApiExceptionType - -HTTP_TOO_MANY_REQUESTS = 429 - -if TYPE_CHECKING: - from amazon_paapi.api import AmazonApi - from amazon_paapi.models.browse_nodes_result import BrowseNode - from amazon_paapi.models.item_result import Item - from amazon_paapi.models.search_result import SearchResult - from amazon_paapi.models.variations_result import VariationsResult - - -def get_items_request( - amazon_api: AmazonApi, - asin_chunk: list[str], - **kwargs: Any, -) -> GetItemsRequest: - """Create a GetItemsRequest for the Amazon API.""" - 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, - ) - except TypeError as exc: - msg = f"Parameters for get_items request are not correct: {exc}" - raise MalformedRequest(msg) from exc - - -def get_items_response(amazon_api: AmazonApi, request: GetItemsRequest) -> list[Item]: - """Execute a GetItemsRequest and return the list of items.""" - try: - response = amazon_api.api.get_items(request) - except ApiException as exc: - _manage_response_exceptions(exc) - - if response.items_result is None: - msg = "No items have been found" - raise ItemsNotFound(msg) - - return cast("list[Item]", response.items_result.items) - - -def get_search_items_request( - amazon_api: AmazonApi, - **kwargs: Any, -) -> SearchItemsRequest: - """Create a SearchItemsRequest for the Amazon API.""" - try: - return SearchItemsRequest( - resources=_get_request_resources(SearchItemsResource), - partner_type=PartnerType.ASSOCIATES, - marketplace=amazon_api.marketplace, - partner_tag=amazon_api.tag, - **kwargs, - ) - except TypeError as exc: - msg = f"Parameters for search_items request are not correct: {exc}" - raise MalformedRequest(msg) from exc - - -def get_search_items_response( - amazon_api: AmazonApi, request: SearchItemsRequest -) -> SearchResult: - """Execute a SearchItemsRequest and return the search result.""" - try: - response = amazon_api.api.search_items(request) - except ApiException as exc: - _manage_response_exceptions(exc) - - if response.search_result is None: - msg = "No items have been found" - raise ItemsNotFound(msg) - - return cast("SearchResult", response.search_result) - - -def get_variations_request( - amazon_api: AmazonApi, - **kwargs: Any, -) -> GetVariationsRequest: - """Create a GetVariationsRequest for the Amazon API.""" - try: - return GetVariationsRequest( - resources=_get_request_resources(GetVariationsResource), - partner_type=PartnerType.ASSOCIATES, - marketplace=amazon_api.marketplace, - partner_tag=amazon_api.tag, - **kwargs, - ) - except TypeError as exc: - msg = f"Parameters for get_variations request are not correct: {exc}" - raise MalformedRequest(msg) from exc - - -def get_variations_response( - amazon_api: AmazonApi, request: GetVariationsRequest -) -> VariationsResult: - """Execute a GetVariationsRequest and return the variations result.""" - try: - response = amazon_api.api.get_variations(request) - except ApiException as exc: - _manage_response_exceptions(exc) - - if response.variations_result is None: - msg = "No variation items have been found" - raise ItemsNotFound(msg) - - return cast("VariationsResult", response.variations_result) - - -def get_browse_nodes_request( - amazon_api: AmazonApi, - **kwargs: Any, -) -> GetBrowseNodesRequest: - """Create a GetBrowseNodesRequest for the Amazon API.""" - try: - return GetBrowseNodesRequest( - resources=_get_request_resources(GetBrowseNodesResource), - partner_type=PartnerType.ASSOCIATES, - marketplace=amazon_api.marketplace, - partner_tag=amazon_api.tag, - **kwargs, - ) - except TypeError as exc: - msg = f"Parameters for get_browse_nodes request are not correct: {exc}" - raise MalformedRequest(msg) from exc - - -def get_browse_nodes_response( - amazon_api: AmazonApi, request: GetBrowseNodesRequest -) -> list[BrowseNode]: - """Execute a GetBrowseNodesRequest and return the list of browse nodes.""" - try: - response = amazon_api.api.get_browse_nodes(request) - except ApiException as exc: - _manage_response_exceptions(exc) - - if response.browse_nodes_result is None: - msg = "No browse nodes have been found" - raise ItemsNotFound(msg) - - return cast("list[BrowseNode]", response.browse_nodes_result.browse_nodes) - - -def _get_request_resources(resource_class: type[object]) -> list[str]: - """Extract all resource strings from a resource class.""" - members = inspect.getmembers(resource_class, lambda a: not inspect.isroutine(a)) - return [x[-1] for x in members if isinstance(x[-1], str) and x[0][0:2] != "__"] - - -def _manage_response_exceptions(error: ApiExceptionType) -> NoReturn: - """Handle API exceptions and raise appropriate custom exceptions.""" - error_status = getattr(error, "status", None) - error_body = getattr(error, "body", "") or "" - - if error_status == HTTP_TOO_MANY_REQUESTS: - msg = ( - "Requests limit reached, try increasing throttling or wait before" - " trying again" - ) - raise TooManyRequests(msg) - - if "InvalidParameterValue" in error_body: - msg = "The value provided in the request for atleast one parameter is invalid." - raise InvalidArgument(msg) - - if "InvalidPartnerTag" in error_body: - msg = "The partner tag is invalid or not present." - raise InvalidArgument(msg) - - if "InvalidAssociate" in error_body: - msg = "Used credentials are not valid for the selected country." - raise AssociateValidationError(msg) - - raise RequestError("Request failed: " + str(error.reason)) diff --git a/amazon_paapi/models/__init__.py b/amazon_paapi/models/__init__.py deleted file mode 100644 index 10d2b7f..0000000 --- a/amazon_paapi/models/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -"""Models for the Amazon Product Advertising API responses.""" - -from amazon_paapi.sdk.models import Availability, Condition, Merchant, SortBy - -from .browse_nodes_result import BrowseNode -from .item_result import Item -from .regions import Country, CountryCode -from .search_result import SearchResult -from .variations_result import VariationsResult - -__all__ = [ - "Availability", - "BrowseNode", - "Condition", - "Country", - "CountryCode", - "Item", - "Merchant", - "SearchResult", - "SortBy", - "VariationsResult", -] diff --git a/amazon_paapi/models/browse_nodes_result.py b/amazon_paapi/models/browse_nodes_result.py deleted file mode 100644 index ff353de..0000000 --- a/amazon_paapi/models/browse_nodes_result.py +++ /dev/null @@ -1,30 +0,0 @@ -"""Browse node result models for Amazon Product Advertising API.""" - -from __future__ import annotations - -from amazon_paapi.sdk import models as sdk_models - - -class BrowseNodeChild(sdk_models.BrowseNodeChild): - """Represent a child browse node.""" - - context_free_name: str - display_name: str - id: str - - -class BrowseNodeAncestor(BrowseNodeChild, sdk_models.BrowseNodeAncestor): - """Represent an ancestor browse node.""" - - ancestor: BrowseNodeChild - - -class BrowseNode(sdk_models.BrowseNode): - """Represent a browse node with its hierarchy information.""" - - display_name: str - id: str - is_root: bool - context_free_name: str - children: list[BrowseNodeChild] - ancestor: BrowseNodeAncestor diff --git a/amazon_paapi/models/item_result.py b/amazon_paapi/models/item_result.py deleted file mode 100644 index 4000461..0000000 --- a/amazon_paapi/models/item_result.py +++ /dev/null @@ -1,450 +0,0 @@ -"""Item result models for Amazon Product Advertising API.""" - -from __future__ import annotations - -from amazon_paapi.sdk import models as sdk_models - - -class ApiLabelLocale: - """Base class for API attributes with label and locale.""" - - label: str - locale: str - - -class ApiMultiValuedAttributeStr(ApiLabelLocale, sdk_models.MultiValuedAttribute): - """Multi-valued attribute with string display values.""" - - display_values: list[str] - - -class ApiDisplayValuesType: - """Display value with type information.""" - - display_value: str - type: str - - -class ApiMultiValuedAttributeType(ApiLabelLocale, sdk_models.MultiValuedAttribute): - """Multi-valued attribute with typed display values.""" - - display_values: list[ApiDisplayValuesType] - - -class ApiUnitBasedAttribute(ApiLabelLocale, sdk_models.UnitBasedAttribute): - """Unit-based attribute with numeric value and unit.""" - - display_value: float - unit: str - - -class ApiSingleStringValuedAttribute( - ApiLabelLocale, sdk_models.SingleStringValuedAttribute -): - """Single-valued attribute with string display value.""" - - display_value: str - - -class ApiSingleBooleanValuedAttribute( - ApiLabelLocale, sdk_models.SingleBooleanValuedAttribute -): - """Single-valued attribute with boolean display value.""" - - display_value: bool - - -class ApiSingleIntegerValuedAttribute( - ApiLabelLocale, sdk_models.SingleIntegerValuedAttribute -): - """Single-valued attribute with integer display value.""" - - display_value: float - - -class ApiPrice: - """Price information model.""" - - amount: float - currency: str - price_per_unit: float - display_amount: str - price_type: sdk_models.PriceType - price_type_label: str - - -class ApiImageSize(sdk_models.ImageSize): - """Image size with URL and dimensions.""" - - url: str - height: str - width: str - - -class ApiImageType(sdk_models.ImageType): - """Image type with multiple size variants.""" - - large: ApiImageSize - medium: ApiImageSize - small: ApiImageSize - - -class ApiImages(sdk_models.Images): - """Container for primary and variant images.""" - - primary: ApiImageType - variants: list[ApiImageType] - - -class ApiByLineInfo(sdk_models.ByLineInfo): - """Product by-line information including brand and manufacturer.""" - - brand: ApiSingleStringValuedAttribute - contributors: ApiSingleStringValuedAttribute - manufacturer: ApiSingleStringValuedAttribute - - -class ApiClassifications(sdk_models.Classifications): - """Product classification information.""" - - binding: ApiSingleStringValuedAttribute - product_group: ApiSingleStringValuedAttribute - - -class ApiContentInfo(sdk_models.ContentInfo): - """Product content information.""" - - edition: ApiSingleStringValuedAttribute - languages: ApiMultiValuedAttributeType - publication_date: ApiSingleStringValuedAttribute | None - - -class ApiContentRating(sdk_models.ContentRating): - """Content rating information.""" - - audience_rating: ApiSingleStringValuedAttribute - - -class ApiExternalIds(sdk_models.ExternalIds): - """External product identifiers.""" - - ea_ns: ApiMultiValuedAttributeStr - isb_ns: ApiMultiValuedAttributeStr - up_cs: ApiMultiValuedAttributeStr - - -class ApiFeatures: - """Product features container.""" - - features: ApiMultiValuedAttributeStr - - -class ApiManufactureInfo(sdk_models.ManufactureInfo): - """Manufacturing information.""" - - item_part_number: ApiSingleStringValuedAttribute - model: ApiSingleStringValuedAttribute - warranty: ApiSingleStringValuedAttribute - - -class ApiItemDimensions(sdk_models.DimensionBasedAttribute): - """Item physical dimensions.""" - - height: ApiUnitBasedAttribute - length: ApiUnitBasedAttribute - weight: ApiUnitBasedAttribute - width: ApiUnitBasedAttribute - - -class ApiProductInfo(sdk_models.ProductInfo): - """Product information container.""" - - color: ApiSingleStringValuedAttribute - is_adult_product: ApiSingleBooleanValuedAttribute - item_dimensions: ApiItemDimensions - release_date: ApiSingleStringValuedAttribute - size: ApiSingleStringValuedAttribute - unit_count: ApiSingleIntegerValuedAttribute - - -class ApiTechnicalInfo(sdk_models.TechnicalInfo): - """Technical specifications.""" - - formats: ApiMultiValuedAttributeStr - energy_efficiency_class: ApiSingleStringValuedAttribute - - -class ApiTradeInPrice(sdk_models.TradeInPrice): - """Trade-in price information.""" - - amount: float - currency: str - display_amount: str - - -class ApiTradeInInfo(sdk_models.TradeInInfo): - """Trade-in eligibility and pricing.""" - - is_eligible_for_trade_in: bool - price: ApiTradeInPrice - - -class ApiItemInfo(sdk_models.ItemInfo): - """Comprehensive item information container.""" - - by_line_info: ApiByLineInfo - classifications: ApiClassifications - content_info: ApiContentInfo | None - content_rating: ApiContentRating - external_ids: ApiExternalIds - features: ApiFeatures - manufacture_info: ApiManufactureInfo - product_info: ApiProductInfo | None - technical_info: ApiTechnicalInfo - title: ApiSingleStringValuedAttribute - trade_in_info: ApiTradeInInfo - - -class ApiOfferAvailability(sdk_models.OfferAvailability): - """Offer availability information.""" - - max_order_quantity: int - message: str - min_order_quantity: int - type: str - - -class ApiOfferConditionInfo: - """Base class for offer condition information.""" - - display_value: str - label: str - locale: str - value: str - - -class ApiOfferSubCondition(ApiOfferConditionInfo, sdk_models.OfferSubCondition): - """Offer sub-condition details.""" - - -class ApiOfferConditionNote(sdk_models.OfferConditionNote): - """Offer condition note.""" - - locale: str - value: str - - -class ApiOfferCondition(ApiOfferConditionInfo, sdk_models.OfferCondition): - """Offer condition with sub-condition.""" - - sub_condition: ApiOfferSubCondition - condition_note: ApiOfferConditionNote - - -class ApiOfferDeliveryInfo(sdk_models.OfferDeliveryInfo): - """Offer delivery information.""" - - is_amazon_fulfilled: bool - is_free_shipping_eligible: bool - is_prime_eligible: bool - - -class ApiOfferLoyaltyPoints(sdk_models.OfferLoyaltyPoints): - """Loyalty points for offer.""" - - points: int - - -class ApiOfferMerchantInfo(sdk_models.OfferMerchantInfo): - """Merchant information for offer.""" - - default_shipping_country: str - feedback_count: int - feedback_rating: float - id: str - name: str - - -class ApiOfferSavings(ApiPrice, sdk_models.OfferSavings): - """Offer savings information.""" - - percentage: float - - -class ApiOfferPrice(ApiPrice, sdk_models.OfferPrice): - """Offer price with savings.""" - - savings: sdk_models.OfferSavings - - -class ApiOfferProgramEligibility(sdk_models.OfferProgramEligibility): - """Program eligibility for offer.""" - - is_prime_exclusive: bool - is_prime_pantry: bool - - -class ApiPromotion(ApiPrice, sdk_models.OfferPromotion): - """Promotion information.""" - - type: str - discount_percent: float - - -class ApiListings(sdk_models.OfferListing): - """Offer listing with all details.""" - - availability: ApiOfferAvailability - condition: ApiOfferCondition - delivery_info: ApiOfferDeliveryInfo - id: str - is_buy_box_winner: bool - loyalty_points: ApiOfferLoyaltyPoints - merchant_info: ApiOfferMerchantInfo - price: ApiOfferPrice - program_eligibility: ApiOfferProgramEligibility - promotions: list[ApiPromotion] - saving_basis: ApiPrice - violates_map: bool - - -class ApiOffers(sdk_models.Offers): - """Container for offer listings.""" - - listings: list[ApiListings] - - -class ApiBrowseNode(sdk_models.BrowseNode): - """Browse node information.""" - - ancestor: str - context_free_name: str - display_name: str - id: str - is_root: str - sales_rank: str - - -class ApiWebsiteSalesRank(sdk_models.WebsiteSalesRank): - """Website sales rank information.""" - - context_free_name: str - display_name: str - sales_rank: str - - -class ApiBrowseNodeInfo(sdk_models.BrowseNodeInfo): - """Browse node information container.""" - - browse_nodes: list[ApiBrowseNode] - website_sales_rank: ApiWebsiteSalesRank - - -class ApiMoney(sdk_models.Money): - """Money representation for OffersV2 price fields.""" - - amount: float - currency: str - display_amount: str - - -class ApiOfferAvailabilityV2(sdk_models.OfferAvailabilityV2): - """OffersV2 availability information.""" - - max_order_quantity: int - message: str - min_order_quantity: int - type: str - - -class ApiOfferConditionV2(sdk_models.OfferConditionV2): - """OffersV2 condition information.""" - - condition_note: str - sub_condition: str - value: str - - -class ApiDealDetails(sdk_models.DealDetails): - """Deal details for OffersV2 listings.""" - - access_type: str - badge: str - early_access_duration_in_milliseconds: int - end_time: str - percent_claimed: int - start_time: str - - -class ApiOfferLoyaltyPointsV2(sdk_models.OfferLoyaltyPointsV2): - """OffersV2 loyalty points information.""" - - points: int - - -class ApiOfferMerchantInfoV2(sdk_models.OfferMerchantInfoV2): - """OffersV2 merchant information.""" - - id: str - name: str - - -class ApiOfferSavingBasis(sdk_models.OfferSavingBasis): - """Saving basis information for OffersV2.""" - - money: ApiMoney - saving_basis_type: str - saving_basis_type_label: str - - -class ApiOfferSavingsV2(sdk_models.OfferSavingsV2): - """OffersV2 savings information.""" - - money: ApiMoney - percentage: int - - -class ApiOfferPriceV2(sdk_models.OfferPriceV2): - """OffersV2 price information.""" - - money: ApiMoney - price_per_unit: ApiMoney - saving_basis: ApiOfferSavingBasis - savings: ApiOfferSavingsV2 - - -class ApiListingsV2(sdk_models.OfferListingV2): - """OffersV2 listing with all details.""" - - availability: ApiOfferAvailabilityV2 - condition: ApiOfferConditionV2 - deal_details: ApiDealDetails - is_buy_box_winner: bool - loyalty_points: ApiOfferLoyaltyPointsV2 - merchant_info: ApiOfferMerchantInfoV2 - price: ApiOfferPriceV2 - type: sdk_models.OfferType - violates_map: bool - - -class ApiOffersV2(sdk_models.OffersV2): - """Container for OffersV2 listings.""" - - listings: list[ApiListingsV2] - - -class Item(sdk_models.Item): - """Amazon product item with all details.""" - - asin: str - browse_node_info: ApiBrowseNodeInfo - customer_reviews: sdk_models.CustomerReviews - detail_page_url: str - images: ApiImages - item_info: ApiItemInfo - offers: ApiOffers - offers_v2: ApiOffersV2 - parent_asin: str - rental_offers: sdk_models.RentalOffers - score: float - variation_attributes: list[sdk_models.VariationAttribute] diff --git a/amazon_paapi/models/regions.py b/amazon_paapi/models/regions.py deleted file mode 100644 index 1e6e201..0000000 --- a/amazon_paapi/models/regions.py +++ /dev/null @@ -1,105 +0,0 @@ -"""Region and country code definitions for Amazon marketplaces.""" - -from __future__ import annotations - -from typing import Literal - -CountryCode = Literal[ - "AU", - "BE", - "BR", - "CA", - "FR", - "DE", - "IN", - "IT", - "JP", - "MX", - "NL", - "PL", - "SG", - "SA", - "ES", - "SE", - "TR", - "AE", - "UK", - "US", -] - - -class Country: - """Constants for supported Amazon countries. - - Use these constants when specifying the country parameter. - Example: AmazonApi(key, secret, tag, Country.ES) - """ - - AU: CountryCode = "AU" - BE: CountryCode = "BE" - BR: CountryCode = "BR" - CA: CountryCode = "CA" - FR: CountryCode = "FR" - DE: CountryCode = "DE" - IN: CountryCode = "IN" - IT: CountryCode = "IT" - JP: CountryCode = "JP" - MX: CountryCode = "MX" - NL: CountryCode = "NL" - PL: CountryCode = "PL" - SG: CountryCode = "SG" - SA: CountryCode = "SA" - ES: CountryCode = "ES" - SE: CountryCode = "SE" - TR: CountryCode = "TR" - AE: CountryCode = "AE" - UK: CountryCode = "UK" - US: CountryCode = "US" - - -REGIONS: dict[str, str] = { - "AU": "us-west-2", - "BE": "eu-west-1", - "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: dict[str, str] = { - "AU": "com.au", - "BE": "com.be", - "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 deleted file mode 100644 index f089db5..0000000 --- a/amazon_paapi/models/search_result.py +++ /dev/null @@ -1,18 +0,0 @@ -"""Search result model for Amazon Product Advertising API.""" - -from __future__ import annotations - -from typing import TYPE_CHECKING - -from amazon_paapi.sdk import models as sdk_models - -if TYPE_CHECKING: - from .item_result import Item - - -class SearchResult(sdk_models.SearchResult): - """Represent the result of a search operation.""" - - items: list[Item] - total_result_count: int - search_url: str diff --git a/amazon_paapi/models/variations_result.py b/amazon_paapi/models/variations_result.py deleted file mode 100644 index 70ea447..0000000 --- a/amazon_paapi/models/variations_result.py +++ /dev/null @@ -1,49 +0,0 @@ -"""Variations result models for Amazon Product Advertising API.""" - -from __future__ import annotations - -from typing import TYPE_CHECKING - -from amazon_paapi.sdk import models as sdk_models - -if TYPE_CHECKING: - from .item_result import Item - - -class ApiPrice: - """Represent a price with amount and currency.""" - - amount: float - currency: str - display_amount: str - - -class ApiVariationDimension: - """Represent a variation dimension like size or color.""" - - display_name: str - name: str - values: list[str] - - -class ApiVariationPrice: - """Represent the price range for variations.""" - - highest_price: ApiPrice - lowest_price: ApiPrice - - -class ApiVariationSummary(sdk_models.VariationSummary): - """Represent a summary of variations for a product.""" - - page_count: int - price: ApiVariationPrice - variation_count: int - variation_dimensions: list[ApiVariationDimension] - - -class VariationsResult(sdk_models.VariationsResult): - """Represent the result of a get variations operation.""" - - items: list[Item] - variation_summary: ApiVariationSummary diff --git a/amazon_paapi/sdk/COPYING.txt b/amazon_paapi/sdk/COPYING.txt deleted file mode 100644 index d645695..0000000 --- a/amazon_paapi/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_paapi/sdk/LICENSE.txt b/amazon_paapi/sdk/LICENSE.txt deleted file mode 100644 index d645695..0000000 --- a/amazon_paapi/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_paapi/sdk/NOTICE.txt b/amazon_paapi/sdk/NOTICE.txt deleted file mode 100644 index 93040d3..0000000 --- a/amazon_paapi/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. diff --git a/amazon_paapi/sdk/__init__.py b/amazon_paapi/sdk/__init__.py deleted file mode 100644 index 08d151f..0000000 --- a/amazon_paapi/sdk/__init__.py +++ /dev/null @@ -1,145 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -from __future__ import absolute_import - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -# import auth into sdk package -from .auth.sign_helper import AWSV4Auth - - -# import apis into sdk package -from .api.default_api import DefaultApi - -# import ApiClient -from .api_client import ApiClient -from .configuration import Configuration -# import models into sdk package -from .models.availability import Availability -from .models.big_decimal import BigDecimal -from .models.browse_node import BrowseNode -from .models.browse_node_ancestor import BrowseNodeAncestor -from .models.browse_node_child import BrowseNodeChild -from .models.browse_node_info import BrowseNodeInfo -from .models.browse_nodes_result import BrowseNodesResult -from .models.by_line_info import ByLineInfo -from .models.classifications import Classifications -from .models.condition import Condition -from .models.content_info import ContentInfo -from .models.content_rating import ContentRating -from .models.contributor import Contributor -from .models.customer_reviews import CustomerReviews -from .models.deal_details import DealDetails -from .models.delivery_flag import DeliveryFlag -from .models.dimension_based_attribute import DimensionBasedAttribute -from .models.duration_price import DurationPrice -from .models.error_data import ErrorData -from .models.external_ids import ExternalIds -from .models.get_browse_nodes_request import GetBrowseNodesRequest -from .models.get_browse_nodes_resource import GetBrowseNodesResource -from .models.get_browse_nodes_response import GetBrowseNodesResponse -from .models.get_items_request import GetItemsRequest -from .models.get_items_resource import GetItemsResource -from .models.get_items_response import GetItemsResponse -from .models.get_variations_request import GetVariationsRequest -from .models.get_variations_resource import GetVariationsResource -from .models.get_variations_response import GetVariationsResponse -from .models.image_size import ImageSize -from .models.image_type import ImageType -from .models.images import Images -from .models.item import Item -from .models.item_id_type import ItemIdType -from .models.item_info import ItemInfo -from .models.items_result import ItemsResult -from .models.language_type import LanguageType -from .models.languages import Languages -from .models.manufacture_info import ManufactureInfo -from .models.max_price import MaxPrice -from .models.merchant import Merchant -from .models.min_price import MinPrice -from .models.min_reviews_rating import MinReviewsRating -from .models.min_saving_percent import MinSavingPercent -from .models.money import Money -from .models.multi_valued_attribute import MultiValuedAttribute -from .models.offer_availability import OfferAvailability -from .models.offer_availability_v2 import OfferAvailabilityV2 -from .models.offer_condition import OfferCondition -from .models.offer_condition_note import OfferConditionNote -from .models.offer_condition_v2 import OfferConditionV2 -from .models.offer_count import OfferCount -from .models.offer_delivery_info import OfferDeliveryInfo -from .models.offer_listing import OfferListing -from .models.offer_listing_v2 import OfferListingV2 -from .models.offer_listings import OfferListings -from .models.offer_listings_v2 import OfferListingsV2 -from .models.offer_loyalty_points import OfferLoyaltyPoints -from .models.offer_loyalty_points_v2 import OfferLoyaltyPointsV2 -from .models.offer_merchant_info import OfferMerchantInfo -from .models.offer_merchant_info_v2 import OfferMerchantInfoV2 -from .models.offer_price import OfferPrice -from .models.offer_price_v2 import OfferPriceV2 -from .models.offer_program_eligibility import OfferProgramEligibility -from .models.offer_promotion import OfferPromotion -from .models.offer_saving_basis import OfferSavingBasis -from .models.offer_savings import OfferSavings -from .models.offer_savings_v2 import OfferSavingsV2 -from .models.offer_shipping_charge import OfferShippingCharge -from .models.offer_sub_condition import OfferSubCondition -from .models.offer_summary import OfferSummary -from .models.offer_type import OfferType -from .models.offers import Offers -from .models.offers_v2 import OffersV2 -from .models.partner_type import PartnerType -from .models.price import Price -from .models.price_type import PriceType -from .models.product_advertising_api_client_exception import ProductAdvertisingAPIClientException -from .models.product_advertising_api_service_exception import ProductAdvertisingAPIServiceException -from .models.product_info import ProductInfo -from .models.properties import Properties -from .models.rating import Rating -from .models.refinement import Refinement -from .models.refinement_bin import RefinementBin -from .models.rental_offer_listing import RentalOfferListing -from .models.rental_offers import RentalOffers -from .models.saving_basis_type import SavingBasisType -from .models.search_index import SearchIndex -from .models.search_items_request import SearchItemsRequest -from .models.search_items_resource import SearchItemsResource -from .models.search_items_response import SearchItemsResponse -from .models.search_refinements import SearchRefinements -from .models.search_result import SearchResult -from .models.single_boolean_valued_attribute import SingleBooleanValuedAttribute -from .models.single_integer_valued_attribute import SingleIntegerValuedAttribute -from .models.single_string_valued_attribute import SingleStringValuedAttribute -from .models.sort_by import SortBy -from .models.technical_info import TechnicalInfo -from .models.trade_in_info import TradeInInfo -from .models.trade_in_price import TradeInPrice -from .models.unit_based_attribute import UnitBasedAttribute -from .models.variation_attribute import VariationAttribute -from .models.variation_dimension import VariationDimension -from .models.variation_summary import VariationSummary -from .models.variations_result import VariationsResult -from .models.website_sales_rank import WebsiteSalesRank diff --git a/amazon_paapi/sdk/api/__init__.py b/amazon_paapi/sdk/api/__init__.py deleted file mode 100644 index ccf380c..0000000 --- a/amazon_paapi/sdk/api/__init__.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -from __future__ import absolute_import - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - -# import apis into api package -from ..api.default_api import DefaultApi diff --git a/amazon_paapi/sdk/api/default_api.py b/amazon_paapi/sdk/api/default_api.py deleted file mode 100644 index 4b4e0c2..0000000 --- a/amazon_paapi/sdk/api/default_api.py +++ /dev/null @@ -1,430 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -from __future__ import absolute_import - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - -import 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_paapi/sdk/api_client.py b/amazon_paapi/sdk/api_client.py deleted file mode 100644 index d3a4e41..0000000 --- a/amazon_paapi/sdk/api_client.py +++ /dev/null @@ -1,684 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -from __future__ import absolute_import - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - -import 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 models -from . import rest - -from .auth.sign_helper 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 = ThreadPool() - 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.2.4' - - self.access_key = access_key - self.secret_key = secret_key - self.host = host - self.region = region - - def __del__(self): - 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(models, 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: - 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.now(datetime.timezone.utc) - headers['x-amz-target'] = 'com.amazon.paapi5.v1.ProductAdvertisingAPIv1.' + api_name - headers['content-encoding'] = 'amz-1.0' - headers['Content-Type'] = 'application/json; charset=utf-8' - headers['host'] = self.host - headers['x-amz-date'] = self.get_amz_date(utc_timestamp) - aws_v4_auth = 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) - auth_headers = aws_v4_auth.get_headers() - - 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_paapi/sdk/auth/__init__.py b/amazon_paapi/sdk/auth/__init__.py deleted file mode 100644 index b4e620f..0000000 --- a/amazon_paapi/sdk/auth/__init__.py +++ /dev/null @@ -1,33 +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 - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 - - OpenAPI spec version: 1.0.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -# import auth into sdk package -from ..auth.sign_helper import AWSV4Auth diff --git a/amazon_paapi/sdk/auth/sign_helper.py b/amazon_paapi/sdk/auth/sign_helper.py deleted file mode 100644 index 1f2ff53..0000000 --- a/amazon_paapi/sdk/auth/sign_helper.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 - -""" - -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 - - # Date and time stamp - self.xAmzDateTime = self.timestamp.strftime("%Y%m%dT%H%M%SZ") - self.xAmzDate = self.timestamp.strftime("%Y%m%d") - - def get_headers(self): - canonical_request = self.prepare_canonical_url() - string_to_sign = self.prepare_string_to_sign( - canonical_request=canonical_request - ) - signing_key = self.get_signature_key( - self.secret_key, self.xAmzDate, self.region, self.service - ) - signature = self.get_signature( - 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 prepare_canonical_url(self): - canonical_uri = self.method_name + "\n" + self.path - canonical_querystring = "" - canonical_header = "" - self.signed_header = "" - sorted_keys = sorted(self.headers, key=str.lower) - for key in sorted_keys: - 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 prepare_string_to_sign(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 get_signature_key(self, key, date_stamp, region_name, service_name): - k_date = self.sign(("AWS4" + key).encode("utf-8"), date_stamp) - k_region = self.sign(k_date, region_name) - k_service = self.sign(k_region, service_name) - k_signing = self.sign(k_service, "aws4_request") - return k_signing - - def get_signature(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_paapi/sdk/configuration.py b/amazon_paapi/sdk/configuration.py deleted file mode 100644 index f2473db..0000000 --- a/amazon_paapi/sdk/configuration.py +++ /dev/null @@ -1,232 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -from __future__ import absolute_import - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - -import 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("amazon_paapi.sdk") - self.logger["urllib3_logger"] = logging.getLogger("urllib3") - # Log format - self.logger_format = '%(asctime)s %(levelname)s %(message)s' - # Log stream handler - self.logger_stream_handler = None - # Log file handler - self.logger_file_handler = None - # Debug file location - self.logger_file = None - # Debug switch - self.debug = False - - # SSL/TLS verification - # Set this to false to skip verifying SSL certificate when calling API - # from https server. - self.verify_ssl = True - # Set this to customize the certificate file to verify the peer. - self.ssl_ca_cert = None - # client certificate file - self.cert_file = None - # client key file - self.key_file = None - # Set this to True/False to enable/disable SSL hostname verification. - self.assert_hostname = None - - # urllib3 connection pool's maximum number of connections saved - # per pool. urllib3 uses 1 connection as default value, but this is - # not the best value when you are making a lot of possibly parallel - # requests to the same host, which is often the case here. - # cpu_count * 5 is used as default value to increase performance. - if connection_pool_maxsize is None: - connection_pool_maxsize = multiprocessing.cpu_count() * 5 - self.connection_pool_maxsize = connection_pool_maxsize - # Proxy URL - self.proxy = None - # Safe chars for path_param - self.safe_chars_for_path_param = '' - - @property - def logger_file(self): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - return self.__logger_file - - @logger_file.setter - def logger_file(self, value): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - self.__logger_file = value - if self.__logger_file: - # If set logging file, - # then add file handler and remove stream handler. - self.logger_file_handler = logging.FileHandler(self.__logger_file) - self.logger_file_handler.setFormatter(self.logger_formatter) - for _, logger in six.iteritems(self.logger): - logger.addHandler(self.logger_file_handler) - if self.logger_stream_handler: - logger.removeHandler(self.logger_stream_handler) - else: - # If not set logging file, - # then add stream handler and remove file handler. - self.logger_stream_handler = logging.StreamHandler() - self.logger_stream_handler.setFormatter(self.logger_formatter) - for _, logger in six.iteritems(self.logger): - logger.addHandler(self.logger_stream_handler) - if self.logger_file_handler: - logger.removeHandler(self.logger_file_handler) - - @property - def debug(self): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - return self.__debug - - @debug.setter - def debug(self, value): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - self.__debug = value - if self.__debug: - # if debug status is True, turn on debug logging - for _, logger in six.iteritems(self.logger): - logger.setLevel(logging.DEBUG) - # turn on httplib debug - httplib.HTTPConnection.debuglevel = 1 - else: - # if debug status is False, turn off debug logging, - # setting log level to default `logging.WARNING` - for _, logger in six.iteritems(self.logger): - logger.setLevel(logging.WARNING) - # turn off httplib debug - httplib.HTTPConnection.debuglevel = 0 - - @property - def logger_format(self): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - return self.__logger_format - - @logger_format.setter - def logger_format(self, value): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - self.__logger_format = value - self.logger_formatter = logging.Formatter(self.__logger_format) - - def get_api_key_with_prefix(self, identifier): - """Gets API key (with prefix if set). - - :param identifier: The identifier of apiKey. - :return: The token for api key authentication. - """ - if (self.api_key.get(identifier) and - self.api_key_prefix.get(identifier)): - return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] # noqa: E501 - elif self.api_key.get(identifier): - return self.api_key[identifier] - - def auth_settings(self): - """Gets Auth Settings dict for api client. - - :return: The Auth Settings information dict. - """ - return { - - } - - def to_debug_report(self): - """Gets the essential information for debugging. - - :return: The report for debugging. - """ - return "Python SDK Debug Report:\n"\ - "OS: {env}\n"\ - "Python Version: {pyversion}\n"\ - "Version of the API: 5.0.0\n"\ - "SDK Package Version: 1.2.4".\ - format(env=sys.platform, pyversion=sys.version) diff --git a/amazon_paapi/sdk/models/__init__.py b/amazon_paapi/sdk/models/__init__.py deleted file mode 100644 index 5acd701..0000000 --- a/amazon_paapi/sdk/models/__init__.py +++ /dev/null @@ -1,135 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -from __future__ import absolute_import - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -# import models into model package -from ..models.availability import Availability -from ..models.big_decimal import BigDecimal -from ..models.browse_node import BrowseNode -from ..models.browse_node_ancestor import BrowseNodeAncestor -from ..models.browse_node_child import BrowseNodeChild -from ..models.browse_node_info import BrowseNodeInfo -from ..models.browse_nodes_result import BrowseNodesResult -from ..models.by_line_info import ByLineInfo -from ..models.classifications import Classifications -from ..models.condition import Condition -from ..models.content_info import ContentInfo -from ..models.content_rating import ContentRating -from ..models.contributor import Contributor -from ..models.customer_reviews import CustomerReviews -from ..models.deal_details import DealDetails -from ..models.delivery_flag import DeliveryFlag -from ..models.dimension_based_attribute import DimensionBasedAttribute -from ..models.duration_price import DurationPrice -from ..models.error_data import ErrorData -from ..models.external_ids import ExternalIds -from ..models.get_browse_nodes_request import GetBrowseNodesRequest -from ..models.get_browse_nodes_resource import GetBrowseNodesResource -from ..models.get_browse_nodes_response import GetBrowseNodesResponse -from ..models.get_items_request import GetItemsRequest -from ..models.get_items_resource import GetItemsResource -from ..models.get_items_response import GetItemsResponse -from ..models.get_variations_request import GetVariationsRequest -from ..models.get_variations_resource import GetVariationsResource -from ..models.get_variations_response import GetVariationsResponse -from ..models.image_size import ImageSize -from ..models.image_type import ImageType -from ..models.images import Images -from ..models.item import Item -from ..models.item_id_type import ItemIdType -from ..models.item_info import ItemInfo -from ..models.items_result import ItemsResult -from ..models.language_type import LanguageType -from ..models.languages import Languages -from ..models.manufacture_info import ManufactureInfo -from ..models.max_price import MaxPrice -from ..models.merchant import Merchant -from ..models.min_price import MinPrice -from ..models.min_reviews_rating import MinReviewsRating -from ..models.min_saving_percent import MinSavingPercent -from ..models.money import Money -from ..models.multi_valued_attribute import MultiValuedAttribute -from ..models.offer_availability import OfferAvailability -from ..models.offer_availability_v2 import OfferAvailabilityV2 -from ..models.offer_condition import OfferCondition -from ..models.offer_condition_note import OfferConditionNote -from ..models.offer_condition_v2 import OfferConditionV2 -from ..models.offer_count import OfferCount -from ..models.offer_delivery_info import OfferDeliveryInfo -from ..models.offer_listing import OfferListing -from ..models.offer_listing_v2 import OfferListingV2 -from ..models.offer_listings import OfferListings -from ..models.offer_listings_v2 import OfferListingsV2 -from ..models.offer_loyalty_points import OfferLoyaltyPoints -from ..models.offer_loyalty_points_v2 import OfferLoyaltyPointsV2 -from ..models.offer_merchant_info import OfferMerchantInfo -from ..models.offer_merchant_info_v2 import OfferMerchantInfoV2 -from ..models.offer_price import OfferPrice -from ..models.offer_price_v2 import OfferPriceV2 -from ..models.offer_program_eligibility import OfferProgramEligibility -from ..models.offer_promotion import OfferPromotion -from ..models.offer_saving_basis import OfferSavingBasis -from ..models.offer_savings import OfferSavings -from ..models.offer_savings_v2 import OfferSavingsV2 -from ..models.offer_shipping_charge import OfferShippingCharge -from ..models.offer_sub_condition import OfferSubCondition -from ..models.offer_summary import OfferSummary -from ..models.offer_type import OfferType -from ..models.offers import Offers -from ..models.offers_v2 import OffersV2 -from ..models.partner_type import PartnerType -from ..models.price import Price -from ..models.price_type import PriceType -from ..models.product_advertising_api_client_exception import ProductAdvertisingAPIClientException -from ..models.product_advertising_api_service_exception import ProductAdvertisingAPIServiceException -from ..models.product_info import ProductInfo -from ..models.properties import Properties -from ..models.rating import Rating -from ..models.refinement import Refinement -from ..models.refinement_bin import RefinementBin -from ..models.rental_offer_listing import RentalOfferListing -from ..models.rental_offers import RentalOffers -from ..models.saving_basis_type import SavingBasisType -from ..models.search_index import SearchIndex -from ..models.search_items_request import SearchItemsRequest -from ..models.search_items_resource import SearchItemsResource -from ..models.search_items_response import SearchItemsResponse -from ..models.search_refinements import SearchRefinements -from ..models.search_result import SearchResult -from ..models.single_boolean_valued_attribute import SingleBooleanValuedAttribute -from ..models.single_integer_valued_attribute import SingleIntegerValuedAttribute -from ..models.single_string_valued_attribute import SingleStringValuedAttribute -from ..models.sort_by import SortBy -from ..models.technical_info import TechnicalInfo -from ..models.trade_in_info import TradeInInfo -from ..models.trade_in_price import TradeInPrice -from ..models.unit_based_attribute import UnitBasedAttribute -from ..models.variation_attribute import VariationAttribute -from ..models.variation_dimension import VariationDimension -from ..models.variation_summary import VariationSummary -from ..models.variations_result import VariationsResult -from ..models.website_sales_rank import WebsiteSalesRank diff --git a/amazon_paapi/sdk/models/availability.py b/amazon_paapi/sdk/models/availability.py deleted file mode 100644 index 97666e9..0000000 --- a/amazon_paapi/sdk/models/availability.py +++ /dev/null @@ -1,105 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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_paapi/sdk/models/big_decimal.py b/amazon_paapi/sdk/models/big_decimal.py deleted file mode 100644 index 0cabb05..0000000 --- a/amazon_paapi/sdk/models/big_decimal.py +++ /dev/null @@ -1,99 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class BigDecimal(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501 - """BigDecimal - a model defined in Swagger""" # noqa: E501 - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(BigDecimal, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, BigDecimal): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/amazon_paapi/sdk/models/browse_node.py b/amazon_paapi/sdk/models/browse_node.py deleted file mode 100644 index 26e0fc0..0000000 --- a/amazon_paapi/sdk/models/browse_node.py +++ /dev/null @@ -1,286 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.browse_node_ancestor import BrowseNodeAncestor # noqa: F401,E501 -from ..models.browse_node_child import BrowseNodeChild # 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': 'list[BrowseNodeChild]', - '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: list[BrowseNodeChild] - """ - 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: list[BrowseNodeChild] - """ - - 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_paapi/sdk/models/browse_node_ancestor.py b/amazon_paapi/sdk/models/browse_node_ancestor.py deleted file mode 100644 index f574c88..0000000 --- a/amazon_paapi/sdk/models/browse_node_ancestor.py +++ /dev/null @@ -1,204 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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_paapi/sdk/models/browse_node_child.py b/amazon_paapi/sdk/models/browse_node_child.py deleted file mode 100644 index 7fdb470..0000000 --- a/amazon_paapi/sdk/models/browse_node_child.py +++ /dev/null @@ -1,179 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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_paapi/sdk/models/browse_node_info.py b/amazon_paapi/sdk/models/browse_node_info.py deleted file mode 100644 index 11b5d26..0000000 --- a/amazon_paapi/sdk/models/browse_node_info.py +++ /dev/null @@ -1,156 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.browse_node import BrowseNode # noqa: F401,E501 -from ..models.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_paapi/sdk/models/browse_nodes_result.py b/amazon_paapi/sdk/models/browse_nodes_result.py deleted file mode 100644 index db3ee7f..0000000 --- a/amazon_paapi/sdk/models/browse_nodes_result.py +++ /dev/null @@ -1,129 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.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_paapi/sdk/models/by_line_info.py b/amazon_paapi/sdk/models/by_line_info.py deleted file mode 100644 index 25fa735..0000000 --- a/amazon_paapi/sdk/models/by_line_info.py +++ /dev/null @@ -1,182 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.contributor import Contributor # noqa: F401,E501 -from ..models.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_paapi/sdk/models/classifications.py b/amazon_paapi/sdk/models/classifications.py deleted file mode 100644 index f343a2f..0000000 --- a/amazon_paapi/sdk/models/classifications.py +++ /dev/null @@ -1,155 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.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_paapi/sdk/models/condition.py b/amazon_paapi/sdk/models/condition.py deleted file mode 100644 index cd1576d..0000000 --- a/amazon_paapi/sdk/models/condition.py +++ /dev/null @@ -1,108 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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_paapi/sdk/models/content_info.py b/amazon_paapi/sdk/models/content_info.py deleted file mode 100644 index 478e367..0000000 --- a/amazon_paapi/sdk/models/content_info.py +++ /dev/null @@ -1,209 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.languages import Languages # noqa: F401,E501 -from ..models.single_integer_valued_attribute import SingleIntegerValuedAttribute # noqa: F401,E501 -from ..models.single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 - - -class ContentInfo(object): - """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_paapi/sdk/models/content_rating.py b/amazon_paapi/sdk/models/content_rating.py deleted file mode 100644 index a5c8f1d..0000000 --- a/amazon_paapi/sdk/models/content_rating.py +++ /dev/null @@ -1,129 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.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_paapi/sdk/models/contributor.py b/amazon_paapi/sdk/models/contributor.py deleted file mode 100644 index c2d5bfa..0000000 --- a/amazon_paapi/sdk/models/contributor.py +++ /dev/null @@ -1,205 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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', - 'role_type': 'str' - } - - attribute_map = { - 'locale': 'Locale', - 'name': 'Name', - 'role': 'Role', - 'role_type': 'RoleType' - } - - def __init__(self, locale=None, name=None, role=None, role_type=None): # noqa: E501 - """Contributor - a model defined in Swagger""" # noqa: E501 - - self._locale = None - self._name = None - self._role = None - self._role_type = 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 - if role_type is not None: - self.role_type = role_type - - @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 - - @property - def role_type(self): - """Gets the role_type of this Contributor. # noqa: E501 - - - :return: The role_type of this Contributor. # noqa: E501 - :rtype: str - """ - return self._role_type - - @role_type.setter - def role_type(self, role_type): - """Sets the role_type of this Contributor. - - - :param role_type: The role_type of this Contributor. # noqa: E501 - :type: str - """ - - self._role_type = role_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(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_paapi/sdk/models/customer_reviews.py b/amazon_paapi/sdk/models/customer_reviews.py deleted file mode 100644 index 02f674e..0000000 --- a/amazon_paapi/sdk/models/customer_reviews.py +++ /dev/null @@ -1,155 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.rating import Rating # noqa: F401,E501 - - -class CustomerReviews(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 = { - 'count': 'int', - 'star_rating': 'Rating' - } - - attribute_map = { - 'count': 'Count', - 'star_rating': 'StarRating' - } - - def __init__(self, count=None, star_rating=None): # noqa: E501 - """CustomerReviews - a model defined in Swagger""" # noqa: E501 - - self._count = None - self._star_rating = None - self.discriminator = None - - if count is not None: - self.count = count - if star_rating is not None: - self.star_rating = star_rating - - @property - def count(self): - """Gets the count of this CustomerReviews. # noqa: E501 - - - :return: The count of this CustomerReviews. # noqa: E501 - :rtype: int - """ - return self._count - - @count.setter - def count(self, count): - """Sets the count of this CustomerReviews. - - - :param count: The count of this CustomerReviews. # noqa: E501 - :type: int - """ - - self._count = count - - @property - def star_rating(self): - """Gets the star_rating of this CustomerReviews. # noqa: E501 - - - :return: The star_rating of this CustomerReviews. # noqa: E501 - :rtype: Rating - """ - return self._star_rating - - @star_rating.setter - def star_rating(self, star_rating): - """Sets the star_rating of this CustomerReviews. - - - :param star_rating: The star_rating of this CustomerReviews. # noqa: E501 - :type: Rating - """ - - self._star_rating = star_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(CustomerReviews, 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, CustomerReviews): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/amazon_paapi/sdk/models/deal_details.py b/amazon_paapi/sdk/models/deal_details.py deleted file mode 100644 index f906814..0000000 --- a/amazon_paapi/sdk/models/deal_details.py +++ /dev/null @@ -1,257 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class DealDetails(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'access_type': 'str', - 'badge': 'str', - 'early_access_duration_in_milliseconds': 'int', - 'end_time': 'str', - 'percent_claimed': 'int', - 'start_time': 'str' - } - - attribute_map = { - 'access_type': 'AccessType', - 'badge': 'Badge', - 'early_access_duration_in_milliseconds': 'EarlyAccessDurationInMilliseconds', - 'end_time': 'EndTime', - 'percent_claimed': 'PercentClaimed', - 'start_time': 'StartTime' - } - - def __init__(self, access_type=None, badge=None, early_access_duration_in_milliseconds=None, end_time=None, percent_claimed=None, start_time=None): # noqa: E501 - """DealDetails - a model defined in Swagger""" # noqa: E501 - - self._access_type = None - self._badge = None - self._early_access_duration_in_milliseconds = None - self._end_time = None - self._percent_claimed = None - self._start_time = None - self.discriminator = None - - if access_type is not None: - self.access_type = access_type - if badge is not None: - self.badge = badge - if early_access_duration_in_milliseconds is not None: - self.early_access_duration_in_milliseconds = early_access_duration_in_milliseconds - if end_time is not None: - self.end_time = end_time - if percent_claimed is not None: - self.percent_claimed = percent_claimed - if start_time is not None: - self.start_time = start_time - - @property - def access_type(self): - """Gets the access_type of this DealDetails. # noqa: E501 - - - :return: The access_type of this DealDetails. # noqa: E501 - :rtype: str - """ - return self._access_type - - @access_type.setter - def access_type(self, access_type): - """Sets the access_type of this DealDetails. - - - :param access_type: The access_type of this DealDetails. # noqa: E501 - :type: str - """ - - self._access_type = access_type - - @property - def badge(self): - """Gets the badge of this DealDetails. # noqa: E501 - - - :return: The badge of this DealDetails. # noqa: E501 - :rtype: str - """ - return self._badge - - @badge.setter - def badge(self, badge): - """Sets the badge of this DealDetails. - - - :param badge: The badge of this DealDetails. # noqa: E501 - :type: str - """ - - self._badge = badge - - @property - def early_access_duration_in_milliseconds(self): - """Gets the early_access_duration_in_milliseconds of this DealDetails. # noqa: E501 - - - :return: The early_access_duration_in_milliseconds of this DealDetails. # noqa: E501 - :rtype: int - """ - return self._early_access_duration_in_milliseconds - - @early_access_duration_in_milliseconds.setter - def early_access_duration_in_milliseconds(self, early_access_duration_in_milliseconds): - """Sets the early_access_duration_in_milliseconds of this DealDetails. - - - :param early_access_duration_in_milliseconds: The early_access_duration_in_milliseconds of this DealDetails. # noqa: E501 - :type: int - """ - - self._early_access_duration_in_milliseconds = early_access_duration_in_milliseconds - - @property - def end_time(self): - """Gets the end_time of this DealDetails. # noqa: E501 - - - :return: The end_time of this DealDetails. # noqa: E501 - :rtype: str - """ - return self._end_time - - @end_time.setter - def end_time(self, end_time): - """Sets the end_time of this DealDetails. - - - :param end_time: The end_time of this DealDetails. # noqa: E501 - :type: str - """ - - self._end_time = end_time - - @property - def percent_claimed(self): - """Gets the percent_claimed of this DealDetails. # noqa: E501 - - - :return: The percent_claimed of this DealDetails. # noqa: E501 - :rtype: int - """ - return self._percent_claimed - - @percent_claimed.setter - def percent_claimed(self, percent_claimed): - """Sets the percent_claimed of this DealDetails. - - - :param percent_claimed: The percent_claimed of this DealDetails. # noqa: E501 - :type: int - """ - - self._percent_claimed = percent_claimed - - @property - def start_time(self): - """Gets the start_time of this DealDetails. # noqa: E501 - - - :return: The start_time of this DealDetails. # noqa: E501 - :rtype: str - """ - return self._start_time - - @start_time.setter - def start_time(self, start_time): - """Sets the start_time of this DealDetails. - - - :param start_time: The start_time of this DealDetails. # noqa: E501 - :type: str - """ - - self._start_time = start_time - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(DealDetails, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, DealDetails): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/amazon_paapi/sdk/models/delivery_flag.py b/amazon_paapi/sdk/models/delivery_flag.py deleted file mode 100644 index 035e354..0000000 --- a/amazon_paapi/sdk/models/delivery_flag.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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_paapi/sdk/models/dimension_based_attribute.py b/amazon_paapi/sdk/models/dimension_based_attribute.py deleted file mode 100644 index 4503900..0000000 --- a/amazon_paapi/sdk/models/dimension_based_attribute.py +++ /dev/null @@ -1,207 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.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_paapi/sdk/models/duration_price.py b/amazon_paapi/sdk/models/duration_price.py deleted file mode 100644 index 79346d1..0000000 --- a/amazon_paapi/sdk/models/duration_price.py +++ /dev/null @@ -1,156 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.offer_price import OfferPrice # noqa: F401,E501 -from ..models.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_paapi/sdk/models/error_data.py b/amazon_paapi/sdk/models/error_data.py deleted file mode 100644 index 48b027d..0000000 --- a/amazon_paapi/sdk/models/error_data.py +++ /dev/null @@ -1,153 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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_paapi/sdk/models/external_ids.py b/amazon_paapi/sdk/models/external_ids.py deleted file mode 100644 index bea77ff..0000000 --- a/amazon_paapi/sdk/models/external_ids.py +++ /dev/null @@ -1,181 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.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_paapi/sdk/models/get_browse_nodes_request.py b/amazon_paapi/sdk/models/get_browse_nodes_request.py deleted file mode 100644 index 4031d84..0000000 --- a/amazon_paapi/sdk/models/get_browse_nodes_request.py +++ /dev/null @@ -1,263 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.get_browse_nodes_resource import GetBrowseNodesResource # noqa: F401,E501 -from ..models.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_paapi/sdk/models/get_browse_nodes_resource.py b/amazon_paapi/sdk/models/get_browse_nodes_resource.py deleted file mode 100644 index abb8fbb..0000000 --- a/amazon_paapi/sdk/models/get_browse_nodes_resource.py +++ /dev/null @@ -1,105 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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_paapi/sdk/models/get_browse_nodes_response.py b/amazon_paapi/sdk/models/get_browse_nodes_response.py deleted file mode 100644 index f8c786e..0000000 --- a/amazon_paapi/sdk/models/get_browse_nodes_response.py +++ /dev/null @@ -1,156 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.browse_nodes_result import BrowseNodesResult # noqa: F401,E501 -from ..models.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_paapi/sdk/models/get_items_request.py b/amazon_paapi/sdk/models/get_items_request.py deleted file mode 100644 index 80738df..0000000 --- a/amazon_paapi/sdk/models/get_items_request.py +++ /dev/null @@ -1,424 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.condition import Condition # noqa: F401,E501 -from ..models.get_items_resource import GetItemsResource # noqa: F401,E501 -from ..models.item_id_type import ItemIdType # noqa: F401,E501 -from ..models.merchant import Merchant # noqa: F401,E501 -from ..models.offer_count import OfferCount # noqa: F401,E501 -from ..models.partner_type import PartnerType # noqa: F401,E501 -from ..models.properties import Properties # noqa: F401,E501 - - -class GetItemsRequest(object): - """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_paapi/sdk/models/get_items_resource.py b/amazon_paapi/sdk/models/get_items_resource.py deleted file mode 100644 index 2cfc750..0000000 --- a/amazon_paapi/sdk/models/get_items_resource.py +++ /dev/null @@ -1,170 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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" - CUSTOMERREVIEWS_COUNT = "CustomerReviews.Count" - CUSTOMERREVIEWS_STARRATING = "CustomerReviews.StarRating" - 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_CONDITIONNOTE = "Offers.Listings.Condition.ConditionNote" - 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_CONDITIONNOTE = "RentalOffers.Listings.Condition.ConditionNote" - 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" - OFFERSV2_LISTINGS_AVAILABILITY = "OffersV2.Listings.Availability" - OFFERSV2_LISTINGS_CONDITION = "OffersV2.Listings.Condition" - OFFERSV2_LISTINGS_DEALDETAILS = "OffersV2.Listings.DealDetails" - OFFERSV2_LISTINGS_ISBUYBOXWINNER = "OffersV2.Listings.IsBuyBoxWinner" - OFFERSV2_LISTINGS_LOYALTYPOINTS = "OffersV2.Listings.LoyaltyPoints" - OFFERSV2_LISTINGS_MERCHANTINFO = "OffersV2.Listings.MerchantInfo" - OFFERSV2_LISTINGS_PRICE = "OffersV2.Listings.Price" - OFFERSV2_LISTINGS_TYPE = "OffersV2.Listings.Type" - - """ - Attributes: - 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_paapi/sdk/models/get_items_response.py b/amazon_paapi/sdk/models/get_items_response.py deleted file mode 100644 index f344a07..0000000 --- a/amazon_paapi/sdk/models/get_items_response.py +++ /dev/null @@ -1,156 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.error_data import ErrorData # noqa: F401,E501 -from ..models.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_paapi/sdk/models/get_variations_request.py b/amazon_paapi/sdk/models/get_variations_request.py deleted file mode 100644 index ecc339d..0000000 --- a/amazon_paapi/sdk/models/get_variations_request.py +++ /dev/null @@ -1,449 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.condition import Condition # noqa: F401,E501 -from ..models.get_variations_resource import GetVariationsResource # noqa: F401,E501 -from ..models.merchant import Merchant # noqa: F401,E501 -from ..models.offer_count import OfferCount # noqa: F401,E501 -from ..models.partner_type import PartnerType # noqa: F401,E501 -from ..models.properties import Properties # noqa: F401,E501 - - -class GetVariationsRequest(object): - """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_paapi/sdk/models/get_variations_resource.py b/amazon_paapi/sdk/models/get_variations_resource.py deleted file mode 100644 index 4d7efae..0000000 --- a/amazon_paapi/sdk/models/get_variations_resource.py +++ /dev/null @@ -1,173 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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" - CUSTOMERREVIEWS_COUNT = "CustomerReviews.Count" - CUSTOMERREVIEWS_STARRATING = "CustomerReviews.StarRating" - 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_CONDITIONNOTE = "Offers.Listings.Condition.ConditionNote" - 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_CONDITIONNOTE = "RentalOffers.Listings.Condition.ConditionNote" - 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" - OFFERSV2_LISTINGS_AVAILABILITY = "OffersV2.Listings.Availability" - OFFERSV2_LISTINGS_CONDITION = "OffersV2.Listings.Condition" - OFFERSV2_LISTINGS_DEALDETAILS = "OffersV2.Listings.DealDetails" - OFFERSV2_LISTINGS_ISBUYBOXWINNER = "OffersV2.Listings.IsBuyBoxWinner" - OFFERSV2_LISTINGS_LOYALTYPOINTS = "OffersV2.Listings.LoyaltyPoints" - OFFERSV2_LISTINGS_MERCHANTINFO = "OffersV2.Listings.MerchantInfo" - OFFERSV2_LISTINGS_PRICE = "OffersV2.Listings.Price" - OFFERSV2_LISTINGS_TYPE = "OffersV2.Listings.Type" - - """ - Attributes: - 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_paapi/sdk/models/get_variations_response.py b/amazon_paapi/sdk/models/get_variations_response.py deleted file mode 100644 index b21b021..0000000 --- a/amazon_paapi/sdk/models/get_variations_response.py +++ /dev/null @@ -1,156 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.error_data import ErrorData # noqa: F401,E501 -from ..models.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_paapi/sdk/models/image_size.py b/amazon_paapi/sdk/models/image_size.py deleted file mode 100644 index 2e18b39..0000000 --- a/amazon_paapi/sdk/models/image_size.py +++ /dev/null @@ -1,179 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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_paapi/sdk/models/image_type.py b/amazon_paapi/sdk/models/image_type.py deleted file mode 100644 index d1300a1..0000000 --- a/amazon_paapi/sdk/models/image_type.py +++ /dev/null @@ -1,181 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.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_paapi/sdk/models/images.py b/amazon_paapi/sdk/models/images.py deleted file mode 100644 index cec86b4..0000000 --- a/amazon_paapi/sdk/models/images.py +++ /dev/null @@ -1,155 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.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_paapi/sdk/models/item.py b/amazon_paapi/sdk/models/item.py deleted file mode 100644 index 89274c7..0000000 --- a/amazon_paapi/sdk/models/item.py +++ /dev/null @@ -1,422 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.browse_node_info import BrowseNodeInfo # noqa: F401,E501 -from ..models.customer_reviews import CustomerReviews # noqa: F401,E501 -from ..models.images import Images # noqa: F401,E501 -from ..models.item_info import ItemInfo # noqa: F401,E501 -from ..models.offers import Offers # noqa: F401,E501 -from ..models.offers_v2 import OffersV2 # noqa: F401,E501 -from ..models.rental_offers import RentalOffers # noqa: F401,E501 -from ..models.variation_attribute import VariationAttribute # noqa: F401,E501 - - -class Item(object): - """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', - 'customer_reviews': 'CustomerReviews', - 'detail_page_url': 'str', - 'images': 'Images', - 'item_info': 'ItemInfo', - 'offers': 'Offers', - 'offers_v2': 'OffersV2', - 'parent_asin': 'str', - 'rental_offers': 'RentalOffers', - 'score': 'float', - 'variation_attributes': 'list[VariationAttribute]' - } - - attribute_map = { - 'asin': 'ASIN', - 'browse_node_info': 'BrowseNodeInfo', - 'customer_reviews': 'CustomerReviews', - 'detail_page_url': 'DetailPageURL', - 'images': 'Images', - 'item_info': 'ItemInfo', - 'offers': 'Offers', - 'offers_v2': 'OffersV2', - 'parent_asin': 'ParentASIN', - 'rental_offers': 'RentalOffers', - 'score': 'Score', - 'variation_attributes': 'VariationAttributes' - } - - def __init__(self, asin=None, browse_node_info=None, customer_reviews=None, detail_page_url=None, images=None, item_info=None, offers=None, offers_v2=None, parent_asin=None, rental_offers=None, score=None, variation_attributes=None): # noqa: E501 - """Item - a model defined in Swagger""" # noqa: E501 - - self._asin = None - self._browse_node_info = None - self._customer_reviews = None - self._detail_page_url = None - self._images = None - self._item_info = None - self._offers = None - self._offers_v2 = None - self._parent_asin = None - self._rental_offers = None - self._score = None - 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 customer_reviews is not None: - self.customer_reviews = customer_reviews - 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 offers_v2 is not None: - self.offers_v2 = offers_v2 - if parent_asin is not None: - self.parent_asin = parent_asin - if rental_offers is not None: - 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 customer_reviews(self): - """Gets the customer_reviews of this Item. # noqa: E501 - - - :return: The customer_reviews of this Item. # noqa: E501 - :rtype: CustomerReviews - """ - return self._customer_reviews - - @customer_reviews.setter - def customer_reviews(self, customer_reviews): - """Sets the customer_reviews of this Item. - - - :param customer_reviews: The customer_reviews of this Item. # noqa: E501 - :type: CustomerReviews - """ - - self._customer_reviews = customer_reviews - - @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 offers_v2(self): - """Gets the offers_v2 of this Item. # noqa: E501 - - - :return: The offers_v2 of this Item. # noqa: E501 - :rtype: OffersV2 - """ - return self._offers_v2 - - @offers_v2.setter - def offers_v2(self, offers_v2): - """Sets the offers_v2 of this Item. - - - :param offers_v2: The offers_v2 of this Item. # noqa: E501 - :type: OffersV2 - """ - - self._offers_v2 = offers_v2 - - @property - def parent_asin(self): - """Gets the parent_asin of this Item. # noqa: E501 - - - :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_paapi/sdk/models/item_id_type.py b/amazon_paapi/sdk/models/item_id_type.py deleted file mode 100644 index 8661d91..0000000 --- a/amazon_paapi/sdk/models/item_id_type.py +++ /dev/null @@ -1,104 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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_paapi/sdk/models/item_info.py b/amazon_paapi/sdk/models/item_info.py deleted file mode 100644 index 3900f10..0000000 --- a/amazon_paapi/sdk/models/item_info.py +++ /dev/null @@ -1,399 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.by_line_info import ByLineInfo # noqa: F401,E501 -from ..models.classifications import Classifications # noqa: F401,E501 -from ..models.content_info import ContentInfo # noqa: F401,E501 -from ..models.content_rating import ContentRating # noqa: F401,E501 -from ..models.external_ids import ExternalIds # noqa: F401,E501 -from ..models.manufacture_info import ManufactureInfo # noqa: F401,E501 -from ..models.multi_valued_attribute import MultiValuedAttribute # noqa: F401,E501 -from ..models.product_info import ProductInfo # noqa: F401,E501 -from ..models.single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 -from ..models.technical_info import TechnicalInfo # noqa: F401,E501 -from ..models.trade_in_info import TradeInInfo # noqa: F401,E501 - - -class ItemInfo(object): - """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_paapi/sdk/models/items_result.py b/amazon_paapi/sdk/models/items_result.py deleted file mode 100644 index 6c75f86..0000000 --- a/amazon_paapi/sdk/models/items_result.py +++ /dev/null @@ -1,129 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.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_paapi/sdk/models/language_type.py b/amazon_paapi/sdk/models/language_type.py deleted file mode 100644 index 55e80de..0000000 --- a/amazon_paapi/sdk/models/language_type.py +++ /dev/null @@ -1,153 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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_paapi/sdk/models/languages.py b/amazon_paapi/sdk/models/languages.py deleted file mode 100644 index c0f7cf2..0000000 --- a/amazon_paapi/sdk/models/languages.py +++ /dev/null @@ -1,181 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.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_paapi/sdk/models/manufacture_info.py b/amazon_paapi/sdk/models/manufacture_info.py deleted file mode 100644 index 3ca6a8a..0000000 --- a/amazon_paapi/sdk/models/manufacture_info.py +++ /dev/null @@ -1,181 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.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_paapi/sdk/models/max_price.py b/amazon_paapi/sdk/models/max_price.py deleted file mode 100644 index 87cb869..0000000 --- a/amazon_paapi/sdk/models/max_price.py +++ /dev/null @@ -1,99 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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_paapi/sdk/models/merchant.py b/amazon_paapi/sdk/models/merchant.py deleted file mode 100644 index c20a723..0000000 --- a/amazon_paapi/sdk/models/merchant.py +++ /dev/null @@ -1,105 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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_paapi/sdk/models/min_price.py b/amazon_paapi/sdk/models/min_price.py deleted file mode 100644 index 2d6f6b9..0000000 --- a/amazon_paapi/sdk/models/min_price.py +++ /dev/null @@ -1,99 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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_paapi/sdk/models/min_reviews_rating.py b/amazon_paapi/sdk/models/min_reviews_rating.py deleted file mode 100644 index 26b8ae3..0000000 --- a/amazon_paapi/sdk/models/min_reviews_rating.py +++ /dev/null @@ -1,99 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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_paapi/sdk/models/min_saving_percent.py b/amazon_paapi/sdk/models/min_saving_percent.py deleted file mode 100644 index f006e8c..0000000 --- a/amazon_paapi/sdk/models/min_saving_percent.py +++ /dev/null @@ -1,99 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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_paapi/sdk/models/money.py b/amazon_paapi/sdk/models/money.py deleted file mode 100644 index 07d1284..0000000 --- a/amazon_paapi/sdk/models/money.py +++ /dev/null @@ -1,181 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.big_decimal import BigDecimal # noqa: F401,E501 - - -class Money(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'amount': 'BigDecimal', - 'currency': 'str', - 'display_amount': 'str' - } - - attribute_map = { - 'amount': 'Amount', - 'currency': 'Currency', - 'display_amount': 'DisplayAmount' - } - - def __init__(self, amount=None, currency=None, display_amount=None): # noqa: E501 - """Money - a model defined in Swagger""" # noqa: E501 - - self._amount = None - self._currency = None - self._display_amount = None - self.discriminator = None - - if amount is not None: - self.amount = amount - if currency is not None: - self.currency = currency - if display_amount is not None: - self.display_amount = display_amount - - @property - def amount(self): - """Gets the amount of this Money. # noqa: E501 - - - :return: The amount of this Money. # noqa: E501 - :rtype: BigDecimal - """ - return self._amount - - @amount.setter - def amount(self, amount): - """Sets the amount of this Money. - - - :param amount: The amount of this Money. # noqa: E501 - :type: BigDecimal - """ - - self._amount = amount - - @property - def currency(self): - """Gets the currency of this Money. # noqa: E501 - - - :return: The currency of this Money. # noqa: E501 - :rtype: str - """ - return self._currency - - @currency.setter - def currency(self, currency): - """Sets the currency of this Money. - - - :param currency: The currency of this Money. # noqa: E501 - :type: str - """ - - self._currency = currency - - @property - def display_amount(self): - """Gets the display_amount of this Money. # noqa: E501 - - - :return: The display_amount of this Money. # noqa: E501 - :rtype: str - """ - return self._display_amount - - @display_amount.setter - def display_amount(self, display_amount): - """Sets the display_amount of this Money. - - - :param display_amount: The display_amount of this Money. # noqa: E501 - :type: str - """ - - self._display_amount = display_amount - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Money, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Money): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/amazon_paapi/sdk/models/multi_valued_attribute.py b/amazon_paapi/sdk/models/multi_valued_attribute.py deleted file mode 100644 index 3ebfcf7..0000000 --- a/amazon_paapi/sdk/models/multi_valued_attribute.py +++ /dev/null @@ -1,179 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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_paapi/sdk/models/offer_availability.py b/amazon_paapi/sdk/models/offer_availability.py deleted file mode 100644 index 6a0ee57..0000000 --- a/amazon_paapi/sdk/models/offer_availability.py +++ /dev/null @@ -1,205 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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_paapi/sdk/models/offer_availability_v2.py b/amazon_paapi/sdk/models/offer_availability_v2.py deleted file mode 100644 index 13c8f35..0000000 --- a/amazon_paapi/sdk/models/offer_availability_v2.py +++ /dev/null @@ -1,205 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class OfferAvailabilityV2(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'message': 'str', - 'max_order_quantity': 'int', - 'min_order_quantity': 'int', - 'type': 'str' - } - - attribute_map = { - 'message': 'Message', - 'max_order_quantity': 'MaxOrderQuantity', - 'min_order_quantity': 'MinOrderQuantity', - 'type': 'Type' - } - - def __init__(self, message=None, max_order_quantity=None, min_order_quantity=None, type=None): # noqa: E501 - """OfferAvailabilityV2 - a model defined in Swagger""" # noqa: E501 - - self._message = None - self._max_order_quantity = None - self._min_order_quantity = None - self._type = None - self.discriminator = None - - if message is not None: - self.message = message - if max_order_quantity is not None: - self.max_order_quantity = max_order_quantity - if min_order_quantity is not None: - self.min_order_quantity = min_order_quantity - if type is not None: - self.type = type - - @property - def message(self): - """Gets the message of this OfferAvailabilityV2. # noqa: E501 - - - :return: The message of this OfferAvailabilityV2. # noqa: E501 - :rtype: str - """ - return self._message - - @message.setter - def message(self, message): - """Sets the message of this OfferAvailabilityV2. - - - :param message: The message of this OfferAvailabilityV2. # noqa: E501 - :type: str - """ - - self._message = message - - @property - def max_order_quantity(self): - """Gets the max_order_quantity of this OfferAvailabilityV2. # noqa: E501 - - - :return: The max_order_quantity of this OfferAvailabilityV2. # noqa: E501 - :rtype: int - """ - return self._max_order_quantity - - @max_order_quantity.setter - def max_order_quantity(self, max_order_quantity): - """Sets the max_order_quantity of this OfferAvailabilityV2. - - - :param max_order_quantity: The max_order_quantity of this OfferAvailabilityV2. # noqa: E501 - :type: int - """ - - self._max_order_quantity = max_order_quantity - - @property - def min_order_quantity(self): - """Gets the min_order_quantity of this OfferAvailabilityV2. # noqa: E501 - - - :return: The min_order_quantity of this OfferAvailabilityV2. # noqa: E501 - :rtype: int - """ - return self._min_order_quantity - - @min_order_quantity.setter - def min_order_quantity(self, min_order_quantity): - """Sets the min_order_quantity of this OfferAvailabilityV2. - - - :param min_order_quantity: The min_order_quantity of this OfferAvailabilityV2. # noqa: E501 - :type: int - """ - - self._min_order_quantity = min_order_quantity - - @property - def type(self): - """Gets the type of this OfferAvailabilityV2. # noqa: E501 - - - :return: The type of this OfferAvailabilityV2. # noqa: E501 - :rtype: str - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this OfferAvailabilityV2. - - - :param type: The type of this OfferAvailabilityV2. # noqa: E501 - :type: str - """ - - self._type = type - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(OfferAvailabilityV2, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, OfferAvailabilityV2): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/amazon_paapi/sdk/models/offer_condition.py b/amazon_paapi/sdk/models/offer_condition.py deleted file mode 100644 index 442dc01..0000000 --- a/amazon_paapi/sdk/models/offer_condition.py +++ /dev/null @@ -1,260 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.offer_condition_note import OfferConditionNote # noqa: F401,E501 -from ..models.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', - 'condition_note': 'OfferConditionNote' - } - - attribute_map = { - 'display_value': 'DisplayValue', - 'label': 'Label', - 'locale': 'Locale', - 'value': 'Value', - 'sub_condition': 'SubCondition', - 'condition_note': 'ConditionNote' - } - - def __init__(self, display_value=None, label=None, locale=None, value=None, sub_condition=None, condition_note=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._condition_note = 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 - if condition_note is not None: - self.condition_note = condition_note - - @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 - - @property - def condition_note(self): - """Gets the condition_note of this OfferCondition. # noqa: E501 - - - :return: The condition_note of this OfferCondition. # noqa: E501 - :rtype: OfferConditionNote - """ - return self._condition_note - - @condition_note.setter - def condition_note(self, condition_note): - """Sets the condition_note of this OfferCondition. - - - :param condition_note: The condition_note of this OfferCondition. # noqa: E501 - :type: OfferConditionNote - """ - - self._condition_note = condition_note - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(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_paapi/sdk/models/offer_condition_note.py b/amazon_paapi/sdk/models/offer_condition_note.py deleted file mode 100644 index b312791..0000000 --- a/amazon_paapi/sdk/models/offer_condition_note.py +++ /dev/null @@ -1,153 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class OfferConditionNote(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', - 'value': 'str' - } - - attribute_map = { - 'locale': 'Locale', - 'value': 'Value' - } - - def __init__(self, locale=None, value=None): # noqa: E501 - """OfferConditionNote - a model defined in Swagger""" # noqa: E501 - - self._locale = None - self._value = None - self.discriminator = None - - if locale is not None: - self.locale = locale - if value is not None: - self.value = value - - @property - def locale(self): - """Gets the locale of this OfferConditionNote. # noqa: E501 - - - :return: The locale of this OfferConditionNote. # noqa: E501 - :rtype: str - """ - return self._locale - - @locale.setter - def locale(self, locale): - """Sets the locale of this OfferConditionNote. - - - :param locale: The locale of this OfferConditionNote. # noqa: E501 - :type: str - """ - - self._locale = locale - - @property - def value(self): - """Gets the value of this OfferConditionNote. # noqa: E501 - - - :return: The value of this OfferConditionNote. # noqa: E501 - :rtype: str - """ - return self._value - - @value.setter - def value(self, value): - """Sets the value of this OfferConditionNote. - - - :param value: The value of this OfferConditionNote. # 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(OfferConditionNote, 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, OfferConditionNote): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/amazon_paapi/sdk/models/offer_condition_v2.py b/amazon_paapi/sdk/models/offer_condition_v2.py deleted file mode 100644 index a69a309..0000000 --- a/amazon_paapi/sdk/models/offer_condition_v2.py +++ /dev/null @@ -1,179 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class OfferConditionV2(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'value': 'str', - 'sub_condition': 'str', - 'condition_note': 'str' - } - - attribute_map = { - 'value': 'Value', - 'sub_condition': 'SubCondition', - 'condition_note': 'ConditionNote' - } - - def __init__(self, value=None, sub_condition=None, condition_note=None): # noqa: E501 - """OfferConditionV2 - a model defined in Swagger""" # noqa: E501 - - self._value = None - self._sub_condition = None - self._condition_note = None - self.discriminator = None - - if value is not None: - self.value = value - if sub_condition is not None: - self.sub_condition = sub_condition - if condition_note is not None: - self.condition_note = condition_note - - @property - def value(self): - """Gets the value of this OfferConditionV2. # noqa: E501 - - - :return: The value of this OfferConditionV2. # noqa: E501 - :rtype: str - """ - return self._value - - @value.setter - def value(self, value): - """Sets the value of this OfferConditionV2. - - - :param value: The value of this OfferConditionV2. # noqa: E501 - :type: str - """ - - self._value = value - - @property - def sub_condition(self): - """Gets the sub_condition of this OfferConditionV2. # noqa: E501 - - - :return: The sub_condition of this OfferConditionV2. # noqa: E501 - :rtype: str - """ - return self._sub_condition - - @sub_condition.setter - def sub_condition(self, sub_condition): - """Sets the sub_condition of this OfferConditionV2. - - - :param sub_condition: The sub_condition of this OfferConditionV2. # noqa: E501 - :type: str - """ - - self._sub_condition = sub_condition - - @property - def condition_note(self): - """Gets the condition_note of this OfferConditionV2. # noqa: E501 - - - :return: The condition_note of this OfferConditionV2. # noqa: E501 - :rtype: str - """ - return self._condition_note - - @condition_note.setter - def condition_note(self, condition_note): - """Sets the condition_note of this OfferConditionV2. - - - :param condition_note: The condition_note of this OfferConditionV2. # noqa: E501 - :type: str - """ - - self._condition_note = condition_note - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(OfferConditionV2, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, OfferConditionV2): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/amazon_paapi/sdk/models/offer_count.py b/amazon_paapi/sdk/models/offer_count.py deleted file mode 100644 index 31a570b..0000000 --- a/amazon_paapi/sdk/models/offer_count.py +++ /dev/null @@ -1,99 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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_paapi/sdk/models/offer_delivery_info.py b/amazon_paapi/sdk/models/offer_delivery_info.py deleted file mode 100644 index 0a40c21..0000000 --- a/amazon_paapi/sdk/models/offer_delivery_info.py +++ /dev/null @@ -1,207 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.offer_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_paapi/sdk/models/offer_listing.py b/amazon_paapi/sdk/models/offer_listing.py deleted file mode 100644 index 3e1d701..0000000 --- a/amazon_paapi/sdk/models/offer_listing.py +++ /dev/null @@ -1,422 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.offer_availability import OfferAvailability # noqa: F401,E501 -from ..models.offer_condition import OfferCondition # noqa: F401,E501 -from ..models.offer_delivery_info import OfferDeliveryInfo # noqa: F401,E501 -from ..models.offer_loyalty_points import OfferLoyaltyPoints # noqa: F401,E501 -from ..models.offer_merchant_info import OfferMerchantInfo # noqa: F401,E501 -from ..models.offer_price import OfferPrice # noqa: F401,E501 -from ..models.offer_program_eligibility import OfferProgramEligibility # noqa: F401,E501 -from ..models.offer_promotion import OfferPromotion # noqa: F401,E501 - - -class OfferListing(object): - """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_paapi/sdk/models/offer_listing_v2.py b/amazon_paapi/sdk/models/offer_listing_v2.py deleted file mode 100644 index a8bc904..0000000 --- a/amazon_paapi/sdk/models/offer_listing_v2.py +++ /dev/null @@ -1,343 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.deal_details import DealDetails # noqa: F401,E501 -from ..models.offer_availability_v2 import OfferAvailabilityV2 # noqa: F401,E501 -from ..models.offer_condition_v2 import OfferConditionV2 # noqa: F401,E501 -from ..models.offer_loyalty_points_v2 import OfferLoyaltyPointsV2 # noqa: F401,E501 -from ..models.offer_merchant_info_v2 import OfferMerchantInfoV2 # noqa: F401,E501 -from ..models.offer_price_v2 import OfferPriceV2 # noqa: F401,E501 -from ..models.offer_type import OfferType # noqa: F401,E501 - - -class OfferListingV2(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'availability': 'OfferAvailabilityV2', - 'condition': 'OfferConditionV2', - 'deal_details': 'DealDetails', - 'is_buy_box_winner': 'bool', - 'loyalty_points': 'OfferLoyaltyPointsV2', - 'merchant_info': 'OfferMerchantInfoV2', - 'price': 'OfferPriceV2', - 'type': 'OfferType', - 'violates_map': 'bool' - } - - attribute_map = { - 'availability': 'Availability', - 'condition': 'Condition', - 'deal_details': 'DealDetails', - 'is_buy_box_winner': 'IsBuyBoxWinner', - 'loyalty_points': 'LoyaltyPoints', - 'merchant_info': 'MerchantInfo', - 'price': 'Price', - 'type': 'Type', - 'violates_map': 'ViolatesMAP' - } - - def __init__(self, availability=None, condition=None, deal_details=None, is_buy_box_winner=None, loyalty_points=None, merchant_info=None, price=None, type=None, violates_map=None): # noqa: E501 - """OfferListingV2 - a model defined in Swagger""" # noqa: E501 - - self._availability = None - self._condition = None - self._deal_details = None - self._is_buy_box_winner = None - self._loyalty_points = None - self._merchant_info = None - self._price = None - self._type = None - self._violates_map = None - self.discriminator = None - - if availability is not None: - self.availability = availability - if condition is not None: - self.condition = condition - if deal_details is not None: - self.deal_details = deal_details - if is_buy_box_winner is not None: - self.is_buy_box_winner = is_buy_box_winner - if loyalty_points is not None: - self.loyalty_points = loyalty_points - if merchant_info is not None: - self.merchant_info = merchant_info - if price is not None: - self.price = price - if type is not None: - self.type = type - if violates_map is not None: - self.violates_map = violates_map - - @property - def availability(self): - """Gets the availability of this OfferListingV2. # noqa: E501 - - - :return: The availability of this OfferListingV2. # noqa: E501 - :rtype: OfferAvailabilityV2 - """ - return self._availability - - @availability.setter - def availability(self, availability): - """Sets the availability of this OfferListingV2. - - - :param availability: The availability of this OfferListingV2. # noqa: E501 - :type: OfferAvailabilityV2 - """ - - self._availability = availability - - @property - def condition(self): - """Gets the condition of this OfferListingV2. # noqa: E501 - - - :return: The condition of this OfferListingV2. # noqa: E501 - :rtype: OfferConditionV2 - """ - return self._condition - - @condition.setter - def condition(self, condition): - """Sets the condition of this OfferListingV2. - - - :param condition: The condition of this OfferListingV2. # noqa: E501 - :type: OfferConditionV2 - """ - - self._condition = condition - - @property - def deal_details(self): - """Gets the deal_details of this OfferListingV2. # noqa: E501 - - - :return: The deal_details of this OfferListingV2. # noqa: E501 - :rtype: DealDetails - """ - return self._deal_details - - @deal_details.setter - def deal_details(self, deal_details): - """Sets the deal_details of this OfferListingV2. - - - :param deal_details: The deal_details of this OfferListingV2. # noqa: E501 - :type: DealDetails - """ - - self._deal_details = deal_details - - @property - def is_buy_box_winner(self): - """Gets the is_buy_box_winner of this OfferListingV2. # noqa: E501 - - - :return: The is_buy_box_winner of this OfferListingV2. # noqa: E501 - :rtype: bool - """ - return self._is_buy_box_winner - - @is_buy_box_winner.setter - def is_buy_box_winner(self, is_buy_box_winner): - """Sets the is_buy_box_winner of this OfferListingV2. - - - :param is_buy_box_winner: The is_buy_box_winner of this OfferListingV2. # noqa: E501 - :type: bool - """ - - self._is_buy_box_winner = is_buy_box_winner - - @property - def loyalty_points(self): - """Gets the loyalty_points of this OfferListingV2. # noqa: E501 - - - :return: The loyalty_points of this OfferListingV2. # noqa: E501 - :rtype: OfferLoyaltyPointsV2 - """ - return self._loyalty_points - - @loyalty_points.setter - def loyalty_points(self, loyalty_points): - """Sets the loyalty_points of this OfferListingV2. - - - :param loyalty_points: The loyalty_points of this OfferListingV2. # noqa: E501 - :type: OfferLoyaltyPointsV2 - """ - - self._loyalty_points = loyalty_points - - @property - def merchant_info(self): - """Gets the merchant_info of this OfferListingV2. # noqa: E501 - - - :return: The merchant_info of this OfferListingV2. # noqa: E501 - :rtype: OfferMerchantInfoV2 - """ - return self._merchant_info - - @merchant_info.setter - def merchant_info(self, merchant_info): - """Sets the merchant_info of this OfferListingV2. - - - :param merchant_info: The merchant_info of this OfferListingV2. # noqa: E501 - :type: OfferMerchantInfoV2 - """ - - self._merchant_info = merchant_info - - @property - def price(self): - """Gets the price of this OfferListingV2. # noqa: E501 - - - :return: The price of this OfferListingV2. # noqa: E501 - :rtype: OfferPriceV2 - """ - return self._price - - @price.setter - def price(self, price): - """Sets the price of this OfferListingV2. - - - :param price: The price of this OfferListingV2. # noqa: E501 - :type: OfferPriceV2 - """ - - self._price = price - - @property - def type(self): - """Gets the type of this OfferListingV2. # noqa: E501 - - - :return: The type of this OfferListingV2. # noqa: E501 - :rtype: OfferType - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this OfferListingV2. - - - :param type: The type of this OfferListingV2. # noqa: E501 - :type: OfferType - """ - - self._type = type - - @property - def violates_map(self): - """Gets the violates_map of this OfferListingV2. # noqa: E501 - - - :return: The violates_map of this OfferListingV2. # noqa: E501 - :rtype: bool - """ - return self._violates_map - - @violates_map.setter - def violates_map(self, violates_map): - """Sets the violates_map of this OfferListingV2. - - - :param violates_map: The violates_map of this OfferListingV2. # noqa: E501 - :type: bool - """ - - self._violates_map = violates_map - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(OfferListingV2, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, OfferListingV2): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/amazon_paapi/sdk/models/offer_listings.py b/amazon_paapi/sdk/models/offer_listings.py deleted file mode 100644 index 434c386..0000000 --- a/amazon_paapi/sdk/models/offer_listings.py +++ /dev/null @@ -1,101 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.offer_listing import OfferListing # noqa: F401,E501 - - -class OfferListings(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501 - """OfferListings - a model defined in Swagger""" # noqa: E501 - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(OfferListings, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, OfferListings): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/amazon_paapi/sdk/models/offer_listings_v2.py b/amazon_paapi/sdk/models/offer_listings_v2.py deleted file mode 100644 index c873ef5..0000000 --- a/amazon_paapi/sdk/models/offer_listings_v2.py +++ /dev/null @@ -1,101 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.offer_listing_v2 import OfferListingV2 # noqa: F401,E501 - - -class OfferListingsV2(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501 - """OfferListingsV2 - a model defined in Swagger""" # noqa: E501 - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(OfferListingsV2, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, OfferListingsV2): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/amazon_paapi/sdk/models/offer_loyalty_points.py b/amazon_paapi/sdk/models/offer_loyalty_points.py deleted file mode 100644 index 64725b9..0000000 --- a/amazon_paapi/sdk/models/offer_loyalty_points.py +++ /dev/null @@ -1,127 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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_paapi/sdk/models/offer_loyalty_points_v2.py b/amazon_paapi/sdk/models/offer_loyalty_points_v2.py deleted file mode 100644 index f1897f6..0000000 --- a/amazon_paapi/sdk/models/offer_loyalty_points_v2.py +++ /dev/null @@ -1,127 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class OfferLoyaltyPointsV2(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'points': 'int' - } - - attribute_map = { - 'points': 'Points' - } - - def __init__(self, points=None): # noqa: E501 - """OfferLoyaltyPointsV2 - a model defined in Swagger""" # noqa: E501 - - self._points = None - self.discriminator = None - - if points is not None: - self.points = points - - @property - def points(self): - """Gets the points of this OfferLoyaltyPointsV2. # noqa: E501 - - - :return: The points of this OfferLoyaltyPointsV2. # noqa: E501 - :rtype: int - """ - return self._points - - @points.setter - def points(self, points): - """Sets the points of this OfferLoyaltyPointsV2. - - - :param points: The points of this OfferLoyaltyPointsV2. # noqa: E501 - :type: int - """ - - self._points = points - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(OfferLoyaltyPointsV2, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, OfferLoyaltyPointsV2): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/amazon_paapi/sdk/models/offer_merchant_info.py b/amazon_paapi/sdk/models/offer_merchant_info.py deleted file mode 100644 index 4bbd8cb..0000000 --- a/amazon_paapi/sdk/models/offer_merchant_info.py +++ /dev/null @@ -1,231 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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', - 'feedback_count': 'int', - 'feedback_rating': 'float', - 'id': 'str', - 'name': 'str' - } - - attribute_map = { - 'default_shipping_country': 'DefaultShippingCountry', - 'feedback_count': 'FeedbackCount', - 'feedback_rating': 'FeedbackRating', - 'id': 'Id', - 'name': 'Name' - } - - def __init__(self, default_shipping_country=None, feedback_count=None, feedback_rating=None, id=None, name=None): # noqa: E501 - """OfferMerchantInfo - a model defined in Swagger""" # noqa: E501 - - self._default_shipping_country = None - self._feedback_count = None - self._feedback_rating = 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 feedback_count is not None: - self.feedback_count = feedback_count - if feedback_rating is not None: - self.feedback_rating = feedback_rating - 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 feedback_count(self): - """Gets the feedback_count of this OfferMerchantInfo. # noqa: E501 - - - :return: The feedback_count of this OfferMerchantInfo. # noqa: E501 - :rtype: int - """ - return self._feedback_count - - @feedback_count.setter - def feedback_count(self, feedback_count): - """Sets the feedback_count of this OfferMerchantInfo. - - - :param feedback_count: The feedback_count of this OfferMerchantInfo. # noqa: E501 - :type: int - """ - - self._feedback_count = feedback_count - - @property - def feedback_rating(self): - """Gets the feedback_rating of this OfferMerchantInfo. # noqa: E501 - - - :return: The feedback_rating of this OfferMerchantInfo. # noqa: E501 - :rtype: float - """ - return self._feedback_rating - - @feedback_rating.setter - def feedback_rating(self, feedback_rating): - """Sets the feedback_rating of this OfferMerchantInfo. - - - :param feedback_rating: The feedback_rating of this OfferMerchantInfo. # noqa: E501 - :type: float - """ - - self._feedback_rating = feedback_rating - - @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_paapi/sdk/models/offer_merchant_info_v2.py b/amazon_paapi/sdk/models/offer_merchant_info_v2.py deleted file mode 100644 index ded5dd2..0000000 --- a/amazon_paapi/sdk/models/offer_merchant_info_v2.py +++ /dev/null @@ -1,153 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class OfferMerchantInfoV2(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'name': 'str', - 'id': 'str' - } - - attribute_map = { - 'name': 'Name', - 'id': 'Id' - } - - def __init__(self, name=None, id=None): # noqa: E501 - """OfferMerchantInfoV2 - a model defined in Swagger""" # noqa: E501 - - self._name = None - self._id = None - self.discriminator = None - - if name is not None: - self.name = name - if id is not None: - self.id = id - - @property - def name(self): - """Gets the name of this OfferMerchantInfoV2. # noqa: E501 - - - :return: The name of this OfferMerchantInfoV2. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this OfferMerchantInfoV2. - - - :param name: The name of this OfferMerchantInfoV2. # noqa: E501 - :type: str - """ - - self._name = name - - @property - def id(self): - """Gets the id of this OfferMerchantInfoV2. # noqa: E501 - - - :return: The id of this OfferMerchantInfoV2. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this OfferMerchantInfoV2. - - - :param id: The id of this OfferMerchantInfoV2. # noqa: E501 - :type: str - """ - - self._id = id - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(OfferMerchantInfoV2, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, OfferMerchantInfoV2): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/amazon_paapi/sdk/models/offer_price.py b/amazon_paapi/sdk/models/offer_price.py deleted file mode 100644 index 3ea6232..0000000 --- a/amazon_paapi/sdk/models/offer_price.py +++ /dev/null @@ -1,286 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.offer_savings import OfferSavings # noqa: F401,E501 -from ..models.price_type import PriceType # 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', - 'price_type': 'PriceType', - 'price_type_label': 'str', - 'savings': 'OfferSavings' - } - - attribute_map = { - 'amount': 'Amount', - 'currency': 'Currency', - 'display_amount': 'DisplayAmount', - 'price_per_unit': 'PricePerUnit', - 'price_type': 'PriceType', - 'price_type_label': 'PriceTypeLabel', - 'savings': 'Savings' - } - - def __init__(self, amount=None, currency=None, display_amount=None, price_per_unit=None, price_type=None, price_type_label=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._price_type = None - self._price_type_label = 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 price_type is not None: - self.price_type = price_type - if price_type_label is not None: - self.price_type_label = price_type_label - 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 price_type(self): - """Gets the price_type of this OfferPrice. # noqa: E501 - - - :return: The price_type of this OfferPrice. # noqa: E501 - :rtype: PriceType - """ - return self._price_type - - @price_type.setter - def price_type(self, price_type): - """Sets the price_type of this OfferPrice. - - - :param price_type: The price_type of this OfferPrice. # noqa: E501 - :type: PriceType - """ - - self._price_type = price_type - - @property - def price_type_label(self): - """Gets the price_type_label of this OfferPrice. # noqa: E501 - - - :return: The price_type_label of this OfferPrice. # noqa: E501 - :rtype: str - """ - return self._price_type_label - - @price_type_label.setter - def price_type_label(self, price_type_label): - """Sets the price_type_label of this OfferPrice. - - - :param price_type_label: The price_type_label of this OfferPrice. # noqa: E501 - :type: str - """ - - self._price_type_label = price_type_label - - @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_paapi/sdk/models/offer_price_v2.py b/amazon_paapi/sdk/models/offer_price_v2.py deleted file mode 100644 index 383c838..0000000 --- a/amazon_paapi/sdk/models/offer_price_v2.py +++ /dev/null @@ -1,209 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.money import Money # noqa: F401,E501 -from ..models.offer_saving_basis import OfferSavingBasis # noqa: F401,E501 -from ..models.offer_savings_v2 import OfferSavingsV2 # noqa: F401,E501 - - -class OfferPriceV2(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'money': 'Money', - 'price_per_unit': 'Money', - 'savings': 'OfferSavingsV2', - 'saving_basis': 'OfferSavingBasis' - } - - attribute_map = { - 'money': 'Money', - 'price_per_unit': 'PricePerUnit', - 'savings': 'Savings', - 'saving_basis': 'SavingBasis' - } - - def __init__(self, money=None, price_per_unit=None, savings=None, saving_basis=None): # noqa: E501 - """OfferPriceV2 - a model defined in Swagger""" # noqa: E501 - - self._money = None - self._price_per_unit = None - self._savings = None - self._saving_basis = None - self.discriminator = None - - if money is not None: - self.money = money - if price_per_unit is not None: - self.price_per_unit = price_per_unit - if savings is not None: - self.savings = savings - if saving_basis is not None: - self.saving_basis = saving_basis - - @property - def money(self): - """Gets the money of this OfferPriceV2. # noqa: E501 - - - :return: The money of this OfferPriceV2. # noqa: E501 - :rtype: Money - """ - return self._money - - @money.setter - def money(self, money): - """Sets the money of this OfferPriceV2. - - - :param money: The money of this OfferPriceV2. # noqa: E501 - :type: Money - """ - - self._money = money - - @property - def price_per_unit(self): - """Gets the price_per_unit of this OfferPriceV2. # noqa: E501 - - - :return: The price_per_unit of this OfferPriceV2. # noqa: E501 - :rtype: Money - """ - return self._price_per_unit - - @price_per_unit.setter - def price_per_unit(self, price_per_unit): - """Sets the price_per_unit of this OfferPriceV2. - - - :param price_per_unit: The price_per_unit of this OfferPriceV2. # noqa: E501 - :type: Money - """ - - self._price_per_unit = price_per_unit - - @property - def savings(self): - """Gets the savings of this OfferPriceV2. # noqa: E501 - - - :return: The savings of this OfferPriceV2. # noqa: E501 - :rtype: OfferSavingsV2 - """ - return self._savings - - @savings.setter - def savings(self, savings): - """Sets the savings of this OfferPriceV2. - - - :param savings: The savings of this OfferPriceV2. # noqa: E501 - :type: OfferSavingsV2 - """ - - self._savings = savings - - @property - def saving_basis(self): - """Gets the saving_basis of this OfferPriceV2. # noqa: E501 - - - :return: The saving_basis of this OfferPriceV2. # noqa: E501 - :rtype: OfferSavingBasis - """ - return self._saving_basis - - @saving_basis.setter - def saving_basis(self, saving_basis): - """Sets the saving_basis of this OfferPriceV2. - - - :param saving_basis: The saving_basis of this OfferPriceV2. # noqa: E501 - :type: OfferSavingBasis - """ - - self._saving_basis = saving_basis - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(OfferPriceV2, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, OfferPriceV2): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/amazon_paapi/sdk/models/offer_program_eligibility.py b/amazon_paapi/sdk/models/offer_program_eligibility.py deleted file mode 100644 index 4b890ca..0000000 --- a/amazon_paapi/sdk/models/offer_program_eligibility.py +++ /dev/null @@ -1,153 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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_paapi/sdk/models/offer_promotion.py b/amazon_paapi/sdk/models/offer_promotion.py deleted file mode 100644 index 6987972..0000000 --- a/amazon_paapi/sdk/models/offer_promotion.py +++ /dev/null @@ -1,257 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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_paapi/sdk/models/offer_saving_basis.py b/amazon_paapi/sdk/models/offer_saving_basis.py deleted file mode 100644 index 9b70591..0000000 --- a/amazon_paapi/sdk/models/offer_saving_basis.py +++ /dev/null @@ -1,182 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.money import Money # noqa: F401,E501 -from ..models.saving_basis_type import SavingBasisType # noqa: F401,E501 - - -class OfferSavingBasis(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'money': 'Money', - 'saving_basis_type': 'SavingBasisType', - 'saving_basis_type_label': 'str' - } - - attribute_map = { - 'money': 'Money', - 'saving_basis_type': 'SavingBasisType', - 'saving_basis_type_label': 'SavingBasisTypeLabel' - } - - def __init__(self, money=None, saving_basis_type=None, saving_basis_type_label=None): # noqa: E501 - """OfferSavingBasis - a model defined in Swagger""" # noqa: E501 - - self._money = None - self._saving_basis_type = None - self._saving_basis_type_label = None - self.discriminator = None - - if money is not None: - self.money = money - if saving_basis_type is not None: - self.saving_basis_type = saving_basis_type - if saving_basis_type_label is not None: - self.saving_basis_type_label = saving_basis_type_label - - @property - def money(self): - """Gets the money of this OfferSavingBasis. # noqa: E501 - - - :return: The money of this OfferSavingBasis. # noqa: E501 - :rtype: Money - """ - return self._money - - @money.setter - def money(self, money): - """Sets the money of this OfferSavingBasis. - - - :param money: The money of this OfferSavingBasis. # noqa: E501 - :type: Money - """ - - self._money = money - - @property - def saving_basis_type(self): - """Gets the saving_basis_type of this OfferSavingBasis. # noqa: E501 - - - :return: The saving_basis_type of this OfferSavingBasis. # noqa: E501 - :rtype: SavingBasisType - """ - return self._saving_basis_type - - @saving_basis_type.setter - def saving_basis_type(self, saving_basis_type): - """Sets the saving_basis_type of this OfferSavingBasis. - - - :param saving_basis_type: The saving_basis_type of this OfferSavingBasis. # noqa: E501 - :type: SavingBasisType - """ - - self._saving_basis_type = saving_basis_type - - @property - def saving_basis_type_label(self): - """Gets the saving_basis_type_label of this OfferSavingBasis. # noqa: E501 - - - :return: The saving_basis_type_label of this OfferSavingBasis. # noqa: E501 - :rtype: str - """ - return self._saving_basis_type_label - - @saving_basis_type_label.setter - def saving_basis_type_label(self, saving_basis_type_label): - """Sets the saving_basis_type_label of this OfferSavingBasis. - - - :param saving_basis_type_label: The saving_basis_type_label of this OfferSavingBasis. # noqa: E501 - :type: str - """ - - self._saving_basis_type_label = saving_basis_type_label - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(OfferSavingBasis, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, OfferSavingBasis): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/amazon_paapi/sdk/models/offer_savings.py b/amazon_paapi/sdk/models/offer_savings.py deleted file mode 100644 index e706ef7..0000000 --- a/amazon_paapi/sdk/models/offer_savings.py +++ /dev/null @@ -1,231 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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_paapi/sdk/models/offer_savings_v2.py b/amazon_paapi/sdk/models/offer_savings_v2.py deleted file mode 100644 index e857046..0000000 --- a/amazon_paapi/sdk/models/offer_savings_v2.py +++ /dev/null @@ -1,155 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.money import Money # noqa: F401,E501 - - -class OfferSavingsV2(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'money': 'Money', - 'percentage': 'int' - } - - attribute_map = { - 'money': 'Money', - 'percentage': 'Percentage' - } - - def __init__(self, money=None, percentage=None): # noqa: E501 - """OfferSavingsV2 - a model defined in Swagger""" # noqa: E501 - - self._money = None - self._percentage = None - self.discriminator = None - - if money is not None: - self.money = money - if percentage is not None: - self.percentage = percentage - - @property - def money(self): - """Gets the money of this OfferSavingsV2. # noqa: E501 - - - :return: The money of this OfferSavingsV2. # noqa: E501 - :rtype: Money - """ - return self._money - - @money.setter - def money(self, money): - """Sets the money of this OfferSavingsV2. - - - :param money: The money of this OfferSavingsV2. # noqa: E501 - :type: Money - """ - - self._money = money - - @property - def percentage(self): - """Gets the percentage of this OfferSavingsV2. # noqa: E501 - - - :return: The percentage of this OfferSavingsV2. # noqa: E501 - :rtype: int - """ - return self._percentage - - @percentage.setter - def percentage(self, percentage): - """Sets the percentage of this OfferSavingsV2. - - - :param percentage: The percentage of this OfferSavingsV2. # noqa: E501 - :type: int - """ - - self._percentage = percentage - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(OfferSavingsV2, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, OfferSavingsV2): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/amazon_paapi/sdk/models/offer_shipping_charge.py b/amazon_paapi/sdk/models/offer_shipping_charge.py deleted file mode 100644 index 57d3f51..0000000 --- a/amazon_paapi/sdk/models/offer_shipping_charge.py +++ /dev/null @@ -1,231 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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_paapi/sdk/models/offer_sub_condition.py b/amazon_paapi/sdk/models/offer_sub_condition.py deleted file mode 100644 index a4b0f7f..0000000 --- a/amazon_paapi/sdk/models/offer_sub_condition.py +++ /dev/null @@ -1,205 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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_paapi/sdk/models/offer_summary.py b/amazon_paapi/sdk/models/offer_summary.py deleted file mode 100644 index 443e693..0000000 --- a/amazon_paapi/sdk/models/offer_summary.py +++ /dev/null @@ -1,208 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.offer_condition import OfferCondition # noqa: F401,E501 -from ..models.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_paapi/sdk/models/offer_type.py b/amazon_paapi/sdk/models/offer_type.py deleted file mode 100644 index ad77e89..0000000 --- a/amazon_paapi/sdk/models/offer_type.py +++ /dev/null @@ -1,105 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class OfferType(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - allowed enum values - """ - SUBSCRIBE_AND_SAVE = "SUBSCRIBE_AND_SAVE" - LIGHTNING_DEAL = "LIGHTNING_DEAL" - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501 - """OfferType - a model defined in Swagger""" # noqa: E501 - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(OfferType, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, OfferType): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/amazon_paapi/sdk/models/offers.py b/amazon_paapi/sdk/models/offers.py deleted file mode 100644 index 5b66169..0000000 --- a/amazon_paapi/sdk/models/offers.py +++ /dev/null @@ -1,156 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.offer_listing import OfferListing # noqa: F401,E501 -from ..models.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_paapi/sdk/models/offers_v2.py b/amazon_paapi/sdk/models/offers_v2.py deleted file mode 100644 index 4ffc861..0000000 --- a/amazon_paapi/sdk/models/offers_v2.py +++ /dev/null @@ -1,129 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.offer_listing_v2 import OfferListingV2 # noqa: F401,E501 - - -class OffersV2(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'listings': 'list[OfferListingV2]' - } - - attribute_map = { - 'listings': 'Listings' - } - - def __init__(self, listings=None): # noqa: E501 - """OffersV2 - a model defined in Swagger""" # noqa: E501 - - self._listings = None - self.discriminator = None - - if listings is not None: - self.listings = listings - - @property - def listings(self): - """Gets the listings of this OffersV2. # noqa: E501 - - - :return: The listings of this OffersV2. # noqa: E501 - :rtype: OfferListingsV2 - """ - return self._listings - - @listings.setter - def listings(self, listings): - """Sets the listings of this OffersV2. - - - :param listings: The listings of this OffersV2. # noqa: E501 - :type: OfferListingsV2 - """ - - self._listings = listings - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(OffersV2, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, OffersV2): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/amazon_paapi/sdk/models/partner_type.py b/amazon_paapi/sdk/models/partner_type.py deleted file mode 100644 index 11c7fb1..0000000 --- a/amazon_paapi/sdk/models/partner_type.py +++ /dev/null @@ -1,104 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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_paapi/sdk/models/price.py b/amazon_paapi/sdk/models/price.py deleted file mode 100644 index 7735e6a..0000000 --- a/amazon_paapi/sdk/models/price.py +++ /dev/null @@ -1,155 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.offer_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_paapi/sdk/models/price_type.py b/amazon_paapi/sdk/models/price_type.py deleted file mode 100644 index 563aad3..0000000 --- a/amazon_paapi/sdk/models/price_type.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class PriceType(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - allowed enum values - """ - LIST_PRICE = "LIST_PRICE" - LOWEST_PRICE = "LOWEST_PRICE" - LOWEST_PRICE_STRIKETHROUGH = "LOWEST_PRICE_STRIKETHROUGH" - WAS_PRICE = "WAS_PRICE" - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501 - """PriceType - 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(PriceType, 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, PriceType): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/amazon_paapi/sdk/models/product_advertising_api_client_exception.py b/amazon_paapi/sdk/models/product_advertising_api_client_exception.py deleted file mode 100644 index f81c7eb..0000000 --- a/amazon_paapi/sdk/models/product_advertising_api_client_exception.py +++ /dev/null @@ -1,129 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.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_paapi/sdk/models/product_advertising_api_service_exception.py b/amazon_paapi/sdk/models/product_advertising_api_service_exception.py deleted file mode 100644 index efde7f4..0000000 --- a/amazon_paapi/sdk/models/product_advertising_api_service_exception.py +++ /dev/null @@ -1,127 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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_paapi/sdk/models/product_info.py b/amazon_paapi/sdk/models/product_info.py deleted file mode 100644 index cc30195..0000000 --- a/amazon_paapi/sdk/models/product_info.py +++ /dev/null @@ -1,262 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.dimension_based_attribute import DimensionBasedAttribute # noqa: F401,E501 -from ..models.single_boolean_valued_attribute import SingleBooleanValuedAttribute # noqa: F401,E501 -from ..models.single_integer_valued_attribute import SingleIntegerValuedAttribute # noqa: F401,E501 -from ..models.single_string_valued_attribute import SingleStringValuedAttribute # noqa: F401,E501 - - -class ProductInfo(object): - """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_paapi/sdk/models/properties.py b/amazon_paapi/sdk/models/properties.py deleted file mode 100644 index c380967..0000000 --- a/amazon_paapi/sdk/models/properties.py +++ /dev/null @@ -1,99 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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_paapi/sdk/models/rating.py b/amazon_paapi/sdk/models/rating.py deleted file mode 100644 index c585c60..0000000 --- a/amazon_paapi/sdk/models/rating.py +++ /dev/null @@ -1,127 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class Rating(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'value': 'float' - } - - attribute_map = { - 'value': 'Value' - } - - def __init__(self, value=None): # noqa: E501 - """Rating - a model defined in Swagger""" # noqa: E501 - - self._value = None - self.discriminator = None - - if value is not None: - self.value = value - - @property - def value(self): - """Gets the value of this Rating. # noqa: E501 - - - :return: The value of this Rating. # noqa: E501 - :rtype: float - """ - return self._value - - @value.setter - def value(self, value): - """Sets the value of this Rating. - - - :param value: The value of this Rating. # noqa: E501 - :type: float - """ - - 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(Rating, 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, Rating): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/amazon_paapi/sdk/models/refinement.py b/amazon_paapi/sdk/models/refinement.py deleted file mode 100644 index 292a0c9..0000000 --- a/amazon_paapi/sdk/models/refinement.py +++ /dev/null @@ -1,181 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.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_paapi/sdk/models/refinement_bin.py b/amazon_paapi/sdk/models/refinement_bin.py deleted file mode 100644 index 7ba9c8f..0000000 --- a/amazon_paapi/sdk/models/refinement_bin.py +++ /dev/null @@ -1,153 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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_paapi/sdk/models/rental_offer_listing.py b/amazon_paapi/sdk/models/rental_offer_listing.py deleted file mode 100644 index 1b0f9fb..0000000 --- a/amazon_paapi/sdk/models/rental_offer_listing.py +++ /dev/null @@ -1,263 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.duration_price import DurationPrice # noqa: F401,E501 -from ..models.offer_availability import OfferAvailability # noqa: F401,E501 -from ..models.offer_condition import OfferCondition # noqa: F401,E501 -from ..models.offer_delivery_info import OfferDeliveryInfo # noqa: F401,E501 -from ..models.offer_merchant_info import OfferMerchantInfo # noqa: F401,E501 - - -class RentalOfferListing(object): - """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_paapi/sdk/models/rental_offers.py b/amazon_paapi/sdk/models/rental_offers.py deleted file mode 100644 index 0ebaf74..0000000 --- a/amazon_paapi/sdk/models/rental_offers.py +++ /dev/null @@ -1,129 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.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_paapi/sdk/models/saving_basis_type.py b/amazon_paapi/sdk/models/saving_basis_type.py deleted file mode 100644 index eedfd4f..0000000 --- a/amazon_paapi/sdk/models/saving_basis_type.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class SavingBasisType(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - allowed enum values - """ - LIST_PRICE = "LIST_PRICE" - LOWEST_PRICE = "LOWEST_PRICE" - LOWEST_PRICE_STRIKETHROUGH = "LOWEST_PRICE_STRIKETHROUGH" - WAS_PRICE = "WAS_PRICE" - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501 - """SavingBasisType - a model defined in Swagger""" # noqa: E501 - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(SavingBasisType, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SavingBasisType): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/amazon_paapi/sdk/models/search_index.py b/amazon_paapi/sdk/models/search_index.py deleted file mode 100644 index 1e6637b..0000000 --- a/amazon_paapi/sdk/models/search_index.py +++ /dev/null @@ -1,99 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class SearchIndex(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501 - """SearchIndex - a model defined in Swagger""" # noqa: E501 - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(SearchIndex, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SearchIndex): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/amazon_paapi/sdk/models/search_items_request.py b/amazon_paapi/sdk/models/search_items_request.py deleted file mode 100644 index ae5383a..0000000 --- a/amazon_paapi/sdk/models/search_items_request.py +++ /dev/null @@ -1,819 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.availability import Availability # noqa: F401,E501 -from ..models.condition import Condition # noqa: F401,E501 -from ..models.delivery_flag import DeliveryFlag # noqa: F401,E501 -from ..models.max_price import MaxPrice # noqa: F401,E501 -from ..models.merchant import Merchant # noqa: F401,E501 -from ..models.min_price import MinPrice # noqa: F401,E501 -from ..models.min_reviews_rating import MinReviewsRating # noqa: F401,E501 -from ..models.min_saving_percent import MinSavingPercent # noqa: F401,E501 -from ..models.offer_count import OfferCount # noqa: F401,E501 -from ..models.partner_type import PartnerType # noqa: F401,E501 -from ..models.properties import Properties # noqa: F401,E501 -from ..models.search_items_resource import SearchItemsResource # noqa: F401,E501 -from ..models.sort_by import SortBy # noqa: F401,E501 - - -class SearchItemsRequest(object): - """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_paapi/sdk/models/search_items_resource.py b/amazon_paapi/sdk/models/search_items_resource.py deleted file mode 100644 index 36852c0..0000000 --- a/amazon_paapi/sdk/models/search_items_resource.py +++ /dev/null @@ -1,171 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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" - CUSTOMERREVIEWS_COUNT = "CustomerReviews.Count" - CUSTOMERREVIEWS_STARRATING = "CustomerReviews.StarRating" - 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_CONDITIONNOTE = "Offers.Listings.Condition.ConditionNote" - 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" - OFFERSV2_LISTINGS_AVAILABILITY = "OffersV2.Listings.Availability" - OFFERSV2_LISTINGS_CONDITION = "OffersV2.Listings.Condition" - OFFERSV2_LISTINGS_DEALDETAILS = "OffersV2.Listings.DealDetails" - OFFERSV2_LISTINGS_ISBUYBOXWINNER = "OffersV2.Listings.IsBuyBoxWinner" - OFFERSV2_LISTINGS_LOYALTYPOINTS = "OffersV2.Listings.LoyaltyPoints" - OFFERSV2_LISTINGS_MERCHANTINFO = "OffersV2.Listings.MerchantInfo" - OFFERSV2_LISTINGS_PRICE = "OffersV2.Listings.Price" - OFFERSV2_LISTINGS_TYPE = "OffersV2.Listings.Type" - PARENTASIN = "ParentASIN" - RENTALOFFERS_LISTINGS_AVAILABILITY_MAXORDERQUANTITY = "RentalOffers.Listings.Availability.MaxOrderQuantity" - RENTALOFFERS_LISTINGS_AVAILABILITY_MESSAGE = "RentalOffers.Listings.Availability.Message" - 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_CONDITIONNOTE = "RentalOffers.Listings.Condition.ConditionNote" - 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_paapi/sdk/models/search_items_response.py b/amazon_paapi/sdk/models/search_items_response.py deleted file mode 100644 index 0d23313..0000000 --- a/amazon_paapi/sdk/models/search_items_response.py +++ /dev/null @@ -1,156 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.error_data import ErrorData # noqa: F401,E501 -from ..models.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_paapi/sdk/models/search_refinements.py b/amazon_paapi/sdk/models/search_refinements.py deleted file mode 100644 index fe18818..0000000 --- a/amazon_paapi/sdk/models/search_refinements.py +++ /dev/null @@ -1,181 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.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_paapi/sdk/models/search_result.py b/amazon_paapi/sdk/models/search_result.py deleted file mode 100644 index 5a27751..0000000 --- a/amazon_paapi/sdk/models/search_result.py +++ /dev/null @@ -1,208 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.item import Item # noqa: F401,E501 -from ..models.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_paapi/sdk/models/single_boolean_valued_attribute.py b/amazon_paapi/sdk/models/single_boolean_valued_attribute.py deleted file mode 100644 index 2c8c9c6..0000000 --- a/amazon_paapi/sdk/models/single_boolean_valued_attribute.py +++ /dev/null @@ -1,179 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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_paapi/sdk/models/single_integer_valued_attribute.py b/amazon_paapi/sdk/models/single_integer_valued_attribute.py deleted file mode 100644 index 6fa1e4a..0000000 --- a/amazon_paapi/sdk/models/single_integer_valued_attribute.py +++ /dev/null @@ -1,179 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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_paapi/sdk/models/single_string_valued_attribute.py b/amazon_paapi/sdk/models/single_string_valued_attribute.py deleted file mode 100644 index 3cdd8bd..0000000 --- a/amazon_paapi/sdk/models/single_string_valued_attribute.py +++ /dev/null @@ -1,179 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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_paapi/sdk/models/sort_by.py b/amazon_paapi/sdk/models/sort_by.py deleted file mode 100644 index 8c925d3..0000000 --- a/amazon_paapi/sdk/models/sort_by.py +++ /dev/null @@ -1,109 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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_paapi/sdk/models/technical_info.py b/amazon_paapi/sdk/models/technical_info.py deleted file mode 100644 index c54f483..0000000 --- a/amazon_paapi/sdk/models/technical_info.py +++ /dev/null @@ -1,156 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.multi_valued_attribute import MultiValuedAttribute # noqa: F401,E501 -from ..models.single_string_valued_attribute import SingleStringValuedAttribute # 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 = { - 'energy_efficiency_class': 'SingleStringValuedAttribute', - 'formats': 'MultiValuedAttribute' - } - - attribute_map = { - 'energy_efficiency_class': 'EnergyEfficiencyClass', - 'formats': 'Formats' - } - - def __init__(self, energy_efficiency_class=None, formats=None): # noqa: E501 - """TechnicalInfo - a model defined in Swagger""" # noqa: E501 - - self._energy_efficiency_class = None - self._formats = None - self.discriminator = None - - if energy_efficiency_class is not None: - self.energy_efficiency_class = energy_efficiency_class - if formats is not None: - self.formats = formats - - @property - def energy_efficiency_class(self): - """Gets the energy_efficiency_class of this TechnicalInfo. # noqa: E501 - - - :return: The energy_efficiency_class of this TechnicalInfo. # noqa: E501 - :rtype: SingleStringValuedAttribute - """ - return self._energy_efficiency_class - - @energy_efficiency_class.setter - def energy_efficiency_class(self, energy_efficiency_class): - """Sets the energy_efficiency_class of this TechnicalInfo. - - - :param energy_efficiency_class: The energy_efficiency_class of this TechnicalInfo. # noqa: E501 - :type: SingleStringValuedAttribute - """ - - self._energy_efficiency_class = energy_efficiency_class - - @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_paapi/sdk/models/trade_in_info.py b/amazon_paapi/sdk/models/trade_in_info.py deleted file mode 100644 index 54bd2bd..0000000 --- a/amazon_paapi/sdk/models/trade_in_info.py +++ /dev/null @@ -1,155 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.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_paapi/sdk/models/trade_in_price.py b/amazon_paapi/sdk/models/trade_in_price.py deleted file mode 100644 index 3c84b4d..0000000 --- a/amazon_paapi/sdk/models/trade_in_price.py +++ /dev/null @@ -1,179 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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_paapi/sdk/models/unit_based_attribute.py b/amazon_paapi/sdk/models/unit_based_attribute.py deleted file mode 100644 index 825fb39..0000000 --- a/amazon_paapi/sdk/models/unit_based_attribute.py +++ /dev/null @@ -1,205 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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_paapi/sdk/models/variation_attribute.py b/amazon_paapi/sdk/models/variation_attribute.py deleted file mode 100644 index 404abaf..0000000 --- a/amazon_paapi/sdk/models/variation_attribute.py +++ /dev/null @@ -1,153 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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_paapi/sdk/models/variation_dimension.py b/amazon_paapi/sdk/models/variation_dimension.py deleted file mode 100644 index 52aa1d5..0000000 --- a/amazon_paapi/sdk/models/variation_dimension.py +++ /dev/null @@ -1,205 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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_paapi/sdk/models/variation_summary.py b/amazon_paapi/sdk/models/variation_summary.py deleted file mode 100644 index 0fb6c9c..0000000 --- a/amazon_paapi/sdk/models/variation_summary.py +++ /dev/null @@ -1,208 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.price import Price # noqa: F401,E501 -from ..models.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_paapi/sdk/models/variations_result.py b/amazon_paapi/sdk/models/variations_result.py deleted file mode 100644 index fa1169e..0000000 --- a/amazon_paapi/sdk/models/variations_result.py +++ /dev/null @@ -1,156 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - -from ..models.item import Item # noqa: F401,E501 -from ..models.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_paapi/sdk/models/website_sales_rank.py b/amazon_paapi/sdk/models/website_sales_rank.py deleted file mode 100644 index c2b0dd7..0000000 --- a/amazon_paapi/sdk/models/website_sales_rank.py +++ /dev/null @@ -1,205 +0,0 @@ -# coding: utf-8 - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - - -import pprint -import re # noqa: F401 - -import six - - -class 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_paapi/sdk/rest.py b/amazon_paapi/sdk/rest.py deleted file mode 100644 index 99f57bb..0000000 --- a/amazon_paapi/sdk/rest.py +++ /dev/null @@ -1,335 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -from __future__ import absolute_import - -""" - Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"). - You may not use this file except in compliance with the License. - A copy of the License is located at - - http://www.apache.org/licenses/LICENSE-2.0 - - or in the "license" file accompanying this file. This file is distributed - on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - express or implied. See the License for the specific language governing - permissions and limitations under the License. -""" - -""" - ProductAdvertisingAPI - - https://webservices.amazon.com/paapi5/documentation/index.html # noqa: E501 -""" - -import 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_paapi/tools/__init__.py b/amazon_paapi/tools/__init__.py deleted file mode 100644 index c77eaba..0000000 --- a/amazon_paapi/tools/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -"""Tools for extracting information from Amazon URLs and ASINs.""" - -__all__ = ["get_asin"] - -from .asin import get_asin diff --git a/amazon_paapi/tools/asin.py b/amazon_paapi/tools/asin.py deleted file mode 100644 index 919e8ef..0000000 --- a/amazon_paapi/tools/asin.py +++ /dev/null @@ -1,19 +0,0 @@ -"""Some useful tools.""" - -import re - -from amazon_paapi.errors import AsinNotFound - - -def get_asin(text: str) -> str: - """Extract the ASIN from a given text or URL.""" - # Return if text is an ASIN - 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) - if asin: - return asin.group(2).upper() - - raise AsinNotFound("Asin not found: " + text) diff --git a/docs/conf.py b/docs/conf.py index db06254..bdd9b83 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -23,7 +23,7 @@ author = "Sergio Abad" # The full version, including alpha/beta/rc tags -release = "6.4.0" +release = "7.0.0" # -- General configuration --------------------------------------------------- diff --git a/docs/index.rst b/docs/index.rst index dafb92f..829a098 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -9,11 +9,6 @@ Welcome to Python Amazon Creators API's documentation! A simple Python wrapper for the Amazon Creators API. This module allows interacting with Amazon using the official APIs in an easier way. -.. note:: - - The ``amazon_paapi`` module is deprecated. New projects should use the ``amazon_creatorsapi`` - module instead. See the :doc:`./pages/migration-guide-6` for migration instructions. - Introduction --------------- @@ -41,16 +36,6 @@ API Reference amazon_creatorsapi.models -Migration guide ---------------- - -If you are still using version 5.x or lower, it is recommended upgrading to the latest version. - -.. toctree:: - :maxdepth: 1 - - ./pages/migration-guide-6.md - Changelog --------- diff --git a/docs/pages/migration-guide-6.md b/docs/pages/migration-guide-6.md deleted file mode 100644 index c0c6753..0000000 --- a/docs/pages/migration-guide-6.md +++ /dev/null @@ -1,166 +0,0 @@ -# Creators API migration guide - -This guide explains how to migrate from the deprecated `amazon_paapi` module to the new -`amazon_creatorsapi` module, which uses Amazon's Creators API. - -## Why migrate? - -Version 6.0.0 introduces support for Amazon's new **Creators API**, which replaces the -Product Advertising API (PAAPI). The old `amazon_paapi` module is now deprecated and will -not receive new features. - -Key benefits of the Creators API: - -- OAuth2-based authentication (more secure) -- Simplified credential management -- New features and improvements from Amazon - -## Changelog summary - -- New `amazon_creatorsapi` module for the Creators API -- The `amazon_paapi` module is deprecated (shows a warning when imported) -- Different authentication credentials required - -## How to upgrade? - -Upgrading to the last version of this module is as easy as running this pip command: - - pip install python-amazon-paapi --upgrade - -## Credential changes - -The Creators API uses different credentials than PAAPI: - -| PAAPI | Creators API | -| ----------- | ----------------- | -| Access Key | Credential ID | -| Secret Key | Credential Secret | -| - | Version | -| Partner Tag | Partner Tag | -| Country | Country | - -You will need to obtain new credentials from the Amazon Associates Creators API portal. - -## What should I change in my current code? - -### Import changes - -```diff -- from amazon_paapi import AmazonApi -+ from amazon_creatorsapi import AmazonCreatorsApi -``` - -### Initialization changes - -```diff -- amazon = AmazonApi( -- access_key="YOUR_ACCESS_KEY", -- secret_key="YOUR_SECRET_KEY", -- partner_tag="YOUR_TAG", -- country="ES" -- ) - -+ amazon = AmazonCreatorsApi( -+ credential_id="YOUR_CREDENTIAL_ID", -+ credential_secret="YOUR_CREDENTIAL_SECRET", -+ version="2.2", -+ tag="YOUR_TAG", -+ country="ES" -+ ) -``` - -### Method signature changes - -While the main methods have the same names, there are important parameter differences: - -#### `get_items` - -| Removed in Creators API | New in Creators API | -| ----------------------- | ----------------------------------- | -| `merchant` | `resources: list[GetItemsResource]` | -| `include_unavailable` | | -| `**kwargs` | | - -#### `search_items` - -| Removed in Creators API | New in Creators API | -| ----------------------- | -------------------------------------- | -| `availability` | `resources: list[SearchItemsResource]` | -| `delivery_flags` | | -| `merchant` | | -| `**kwargs` | | - -#### `get_variations` - -| Removed in Creators API | New in Creators API | -| ----------------------- | ---------------------------------------- | -| `merchant` | `resources: list[GetVariationsResource]` | -| `**kwargs` | | - -#### `get_browse_nodes` - -| Removed in Creators API | New in Creators API | -| ----------------------- | ----------------------------------------- | -| `**kwargs` | `resources: list[GetBrowseNodesResource]` | - -#### Basic usage examples - -```python -# Get items -items = amazon.get_items(['B01N5IB20Q']) - -# Search items -results = amazon.search_items(keywords='nintendo') - -# Get variations -variations = amazon.get_variations('B01N5IB20Q') - -# Get browse nodes -nodes = amazon.get_browse_nodes(['667049031']) -``` - -### Helper functions - -```diff -- from amazon_paapi import get_asin -+ from amazon_creatorsapi.core import get_asin -``` - -### Models module - -Version 6.0 introduces a new `models` module that re-exports all SDK models for convenient access: - -```python -from amazon_creatorsapi.models import ( - Item, - Condition, - SortBy, - GetItemsResource, - SearchItemsResource, - GetVariationsResource, - GetBrowseNodesResource, -) -``` - -This allows you to import models directly without navigating the SDK structure. - -### Exceptions - -Exception names have changed to use the `Error` suffix: - -```python -from amazon_creatorsapi.errors import ( - AmazonCreatorsApiError, # Base exception - InvalidArgumentError, - ItemsNotFoundError, - TooManyRequestsError, - AssociateValidationError, - RequestError, -) -``` - -## I need more help - -You can always ask for help in our [Telegram group](https://t.me/PythonAmazonPAAPI) or raise an issue on -[Github](https://github.com/sergioteula/python-amazon-paapi/issues) for help. If you find that this -guide could be improved somehow, feel free to send a pull request with your changes. diff --git a/docs/pages/usage-guide.md b/docs/pages/usage-guide.md index fc95a09..6a56e98 100644 --- a/docs/pages/usage-guide.md +++ b/docs/pages/usage-guide.md @@ -10,8 +10,6 @@ pip install python-amazon-paapi --upgrade The `amazon_creatorsapi` module provides access to Amazon's Creators API. -> **Note:** The `amazon_paapi` module is deprecated. New projects should use the Creators API. - ## Basic Usage ```python diff --git a/pyproject.toml b/pyproject.toml index 7ecaf0a..1ff897c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,12 @@ [project] name = "python-amazon-paapi" -version = "6.4.0" -description = "Amazon Product Advertising API 5.0 wrapper for Python" +version = "7.0.0" +description = "Amazon Creators API wrapper for Python" readme = "README.md" requires-python = ">=3.9" license = "MIT" authors = [{ name = "Sergio Abad", email = "sergio.abad@bytelix.com" }] -keywords = ["amazon", "paapi", "product-advertising-api", "affiliate", "api"] +keywords = ["amazon", "creators-api", "affiliate", "api"] classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3", @@ -43,7 +43,7 @@ requires = ["hatchling"] build-backend = "hatchling.build" [tool.hatch.build.targets.wheel] -packages = ["amazon_paapi", "amazon_creatorsapi", "creatorsapi_python_sdk"] +packages = ["amazon_creatorsapi", "creatorsapi_python_sdk"] [dependency-groups] dev = [ @@ -59,7 +59,7 @@ dev = [ [tool.ruff] target-version = "py39" cache-dir = ".cache/ruff" -exclude = ["amazon_paapi/sdk/*", "creatorsapi_python_sdk/*", "docs/*"] +exclude = ["creatorsapi_python_sdk/*", "docs/*"] [tool.ruff.lint] select = ["ALL"] @@ -72,7 +72,7 @@ ignore = [ "ISC001", # Implicitly concatenated string literals (conflicts with Ruff formatter) "PT019", # Fixture without value is injected as parameter ] -exclude = ["amazon_paapi/sdk/*", "creatorsapi_python_sdk/*", "docs/*"] +exclude = ["creatorsapi_python_sdk/*", "docs/*"] [tool.ruff.lint.per-file-ignores] "tests/*" = [ @@ -92,19 +92,9 @@ exclude = ["amazon_paapi/sdk/*", "creatorsapi_python_sdk/*", "docs/*"] "T201", # print found (CLI scripts use print) ] "**/api.py" = ["PLR0913"] # Too many arguments to function call -"amazon_paapi/*" = [ - "FBT001", # Boolean positional arg in function definition - "FBT002", # Boolean default value in function definition - "N818", # Exception name should be named with an Error suffix -] [tool.ruff.format] -exclude = [ - "amazon_paapi/sdk/*", - "creatorsapi_python_sdk/*", - "docs/*", - ".github", -] +exclude = ["creatorsapi_python_sdk/*", "docs/*", ".github"] [tool.mypy] python_version = "3.9" @@ -117,17 +107,12 @@ warn_unreachable = true warn_unused_configs = true warn_unused_ignores = true cache_dir = '.cache/mypy' -exclude = ["amazon_paapi/sdk/*", "creatorsapi_python_sdk/*"] - -[[tool.mypy.overrides]] -module = ["amazon_paapi/sdk/*"] -follow_imports = "skip" +exclude = ["creatorsapi_python_sdk/*"] [tool.coverage.run] branch = true relative_files = true -source = ["amazon_paapi", "amazon_creatorsapi"] -omit = ["amazon_paapi/sdk/*"] +source = ["amazon_creatorsapi"] [tool.coverage.report] precision = 2 diff --git a/tests/__init__.py b/tests/__init__.py index ed694da..8db52d5 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1 +1 @@ -"""Test suite for python-amazon-paapi.""" +"""Test suite for the Amazon Creators API wrapper.""" diff --git a/tests/api_test.py b/tests/api_test.py deleted file mode 100644 index b92e39b..0000000 --- a/tests/api_test.py +++ /dev/null @@ -1,67 +0,0 @@ -"""Tests for AmazonApi class.""" - -import time -import unittest -from unittest import mock -from unittest.mock import MagicMock - -from amazon_paapi import AmazonApi, models -from amazon_paapi.errors.exceptions import InvalidArgument -from amazon_paapi.helpers import requests - - -class TestApi(unittest.TestCase): - def test_api_init_invalid_argument(self): - with self.assertRaises(InvalidArgument): - AmazonApi("key", "secret", "tag", "invalid_country") - - def test_api_throttling_disabled(self): - throttling = 0 - amazon = AmazonApi("key", "secret", "tag", "ES", throttling) - start = int(time.time() * 10) - amazon._throttle() - amazon._throttle() - - self.assertEqual(start, int(time.time() * 10)) - - def test_api_throttling_sleeps(self): - throttling = 0.1 - amazon = AmazonApi("key", "secret", "tag", "ES", throttling) - start = int(time.time() * 10) - amazon._throttle() - amazon._throttle() - - self.assertTrue(start < int(time.time() * 10)) - - @mock.patch.object(requests, "get_items_response") - def test_get_items(self, mocked_get_items_response: MagicMock): - mocked_get_items_response.return_value = [] - amazon = AmazonApi("key", "secret", "tag", "ES") - response = amazon.get_items("ABCDEFGHIJ") - self.assertTrue(isinstance(response, list)) - - @mock.patch.object(requests, "get_search_items_response") - def test_search_items(self, mocked_get_search_items_response: MagicMock): - mocked_response = models.SearchResult() - mocked_response.items = [] - mocked_get_search_items_response.return_value = mocked_response - amazon = AmazonApi("key", "secret", "tag", "ES") - response = amazon.search_items(keywords="test") - self.assertTrue(isinstance(response.items, list)) - - @mock.patch.object(requests, "get_variations_response") - def test_get_variations(self, mocked_get_variations_response: MagicMock): - mocked_response = models.VariationsResult() - mocked_response.items = [] - mocked_get_variations_response.return_value = mocked_response - amazon = AmazonApi("key", "secret", "tag", "ES") - response = amazon.get_variations("ABCDEFGHIJ") - self.assertTrue(isinstance(response.items, list)) - - @mock.patch.object(requests, "get_browse_nodes_response") - def test_get_browse_nodes(self, mocked_get_browse_nodes_response: MagicMock): - mocked_response: list[models.BrowseNode] = [] - mocked_get_browse_nodes_response.return_value = mocked_response - amazon = AmazonApi("key", "secret", "tag", "ES") - response = amazon.get_browse_nodes(["ABCDEFGHIJ"]) - self.assertIsInstance(response, list) diff --git a/tests/errors_test.py b/tests/errors_test.py deleted file mode 100644 index 700567c..0000000 --- a/tests/errors_test.py +++ /dev/null @@ -1,12 +0,0 @@ -"""Tests for error classes.""" - -import unittest - -from amazon_paapi.errors import AmazonError - - -class TestAmazonError(unittest.TestCase): - def test_amazon_error_str(self): - error = AmazonError("Test reason") - - self.assertEqual("Test reason", str(error)) diff --git a/tests/helpers_arguments_test.py b/tests/helpers_arguments_test.py deleted file mode 100644 index f0fb7b8..0000000 --- a/tests/helpers_arguments_test.py +++ /dev/null @@ -1,94 +0,0 @@ -"""Tests for arguments helper functions.""" - -import unittest - -from amazon_paapi.errors import AsinNotFound, InvalidArgument -from amazon_paapi.helpers.arguments import ( - check_browse_nodes_args, - check_search_mandatory_args, - check_search_pagination_args, - check_variations_args, - get_items_ids, -) - - -class TestHelpersArguments(unittest.TestCase): - def setUp(self): - self.amazon_urls = [ - "https://www.amazon.es/gp/product/B07PHPXHQS", - "https://www.amazon.es/test-name/dp/B08TJRVWV1/?test", - ] - self.invalid_url = "https://www.amazon.es/earlyaccess" - - def tearDown(self): - del self.amazon_urls - del self.invalid_url - - def test_get_item_id_from_url(self): - result = get_items_ids(self.amazon_urls[0]) - self.assertEqual(["B07PHPXHQS"], result) - - def test_get_item_id_from_several_urls(self): - result = get_items_ids(self.amazon_urls) - self.assertEqual(["B07PHPXHQS", "B08TJRVWV1"], result) - - def test_get_item_id_for_invalid_url(self): - with self.assertRaises(AsinNotFound): - get_items_ids(self.invalid_url) - - def test_get_item_id_from_several_urls_with_invalid_url(self): - self.amazon_urls.insert(1, self.invalid_url) - with self.assertRaises(AsinNotFound): - get_items_ids(self.amazon_urls) - - def test_get_item_id_from_asin(self): - result = get_items_ids("B01N5IB20Q") - self.assertEqual(["B01N5IB20Q"], result) - - def test_get_items_ids_from_string_of_asins(self): - result = get_items_ids("B01N5IB20Q,B01N5IB20Q,B01N5IB20Q") - self.assertEqual(["B01N5IB20Q", "B01N5IB20Q", "B01N5IB20Q"], result) - - def test_get_items_ids_from_list_of_asins(self): - result = get_items_ids(["B01N5IB20Q", "B01N5IB20Q", "B01N5IB20Q"]) - self.assertEqual(["B01N5IB20Q", "B01N5IB20Q", "B01N5IB20Q"], result) - - def test_get_items_ids_invalid_argument(self): - with self.assertRaises(InvalidArgument): - get_items_ids(34) - - def test_check_search_mandatory_args_correct(self): - check_search_mandatory_args(actor="John Doe") - - def test_check_search_mandatory_args_raises_exception(self): - with self.assertRaises(InvalidArgument): - check_search_mandatory_args() - - def test_check_search_pagination_args_correct(self): - check_search_pagination_args(item_count=1, item_page=10) - - def test_check_search_pagination_args_if_not_integers(self): - with self.assertRaises(InvalidArgument): - check_search_pagination_args(item_count=True, item_page="test") - - def test_check_search_pagination_args_if_not_between_1_10(self): - with self.assertRaises(InvalidArgument): - check_search_pagination_args(item_count=0, item_page=11) - - def test_check_check_variations_args_correct(self): - check_variations_args(variation_count=1, variation_page=10) - - def test_check_check_variations_args_if_not_integers(self): - with self.assertRaises(InvalidArgument): - check_variations_args(variation_count=True, variation_page="test") - - def test_check_check_variations_args_if_not_between_1_10(self): - with self.assertRaises(InvalidArgument): - check_variations_args(variation_count=0, variation_page=11) - - def test_check_browse_nodes_args_correct(self): - check_browse_nodes_args(browse_node_ids=["1"]) - - def test_check_browse_nodes_args_if_not_list(self): - with self.assertRaises(InvalidArgument): - check_browse_nodes_args(browse_node_ids=1) diff --git a/tests/helpers_generators_test.py b/tests/helpers_generators_test.py deleted file mode 100644 index 175390f..0000000 --- a/tests/helpers_generators_test.py +++ /dev/null @@ -1,19 +0,0 @@ -"""Tests for generators helper functions.""" - -import unittest - -from amazon_paapi.helpers.generators import get_list_chunks - - -class TestHelpersGenerators(unittest.TestCase): - def test_get_list_chunks_for_big_list(self): - mocked_iterable = get_list_chunks(list(range(15)), 10) - chunk = next(mocked_iterable) - self.assertEqual(len(chunk), 10) - chunk = next(mocked_iterable) - self.assertEqual(len(chunk), 5) - - def test_get_list_chunks_for_small_list(self): - mocked_iterable = get_list_chunks(list(range(5)), 10) - chunk = next(mocked_iterable) - self.assertEqual(len(chunk), 5) diff --git a/tests/helpers_items_test.py b/tests/helpers_items_test.py deleted file mode 100644 index 49a7ade..0000000 --- a/tests/helpers_items_test.py +++ /dev/null @@ -1,52 +0,0 @@ -"""Tests for items helper functions.""" - -import unittest -from unittest import mock - -from amazon_paapi.helpers.items import sort_items - - -class MockedItem(mock.MagicMock): - def __init__(self, asin: str) -> None: - super().__init__() - self.asin = asin - - -class TestHelpersItems(unittest.TestCase): - def setUp(self): - self.mocked_items = [ - MockedItem("B"), - MockedItem("C"), - MockedItem("A"), - MockedItem("D"), - ] - self.mocked_items_ids = ["B", "A", "D", "C", "E", "A"] - - def test_sort_items(self): - sorted_items = sort_items( - self.mocked_items, self.mocked_items_ids, include_unavailable=False - ) - self.assertEqual(sorted_items[0].asin, "B") - self.assertEqual(sorted_items[1].asin, "A") - self.assertEqual(sorted_items[2].asin, "D") - self.assertEqual(sorted_items[3].asin, "C") - - def test_sort_items_include_unavailable(self): - sorted_items = sort_items( - self.mocked_items, self.mocked_items_ids, include_unavailable=True - ) - self.assertEqual(sorted_items[4].asin, "E") - self.assertEqual(len(sorted_items), 6) - - def test_sort_items_not_include_unavailable(self): - sorted_items = sort_items( - self.mocked_items, self.mocked_items_ids, include_unavailable=False - ) - self.assertEqual(sorted_items[4].asin, "A") - self.assertEqual(len(sorted_items), 5) - - def test_sort_items_include_repeated(self): - sorted_items = sort_items( - self.mocked_items, self.mocked_items_ids, include_unavailable=True - ) - self.assertEqual(sorted_items[1].asin, sorted_items[5].asin) diff --git a/tests/helpers_requests_test.py b/tests/helpers_requests_test.py deleted file mode 100644 index 36ef000..0000000 --- a/tests/helpers_requests_test.py +++ /dev/null @@ -1,183 +0,0 @@ -"""Tests for requests helper functions.""" - -import unittest -from unittest.mock import MagicMock, Mock, patch - -from amazon_paapi.errors import ( - AssociateValidationError, - InvalidArgument, - ItemsNotFound, - MalformedRequest, - RequestError, - TooManyRequests, -) -from amazon_paapi.helpers import requests -from amazon_paapi.sdk.rest import ApiException - - -class TestRequests(unittest.TestCase): - @patch.object(requests, "GetItemsRequest") - def test_get_items_request(self, mock_get_items_request: MagicMock): - mock_get_items_request.return_value = "foo" - result = requests.get_items_request(Mock(), ["test"]) - - self.assertEqual("foo", result) - - @patch.object(requests, "GetItemsRequest") - def test_get_items_request_error(self, mock_get_items_request: MagicMock): - mock_get_items_request.side_effect = TypeError() - - with self.assertRaises(MalformedRequest): - requests.get_items_request(Mock(), ["test"]) - - @patch.object(requests, "SearchItemsRequest") - def test_search_items_request(self, mock_search_items_request: MagicMock): - mock_search_items_request.return_value = "foo" - result = requests.get_search_items_request(Mock()) - - self.assertEqual("foo", result) - - @patch.object(requests, "SearchItemsRequest") - def test_search_items_request_error(self, mock_search_items_request: MagicMock): - mock_search_items_request.side_effect = TypeError() - - with self.assertRaises(MalformedRequest): - requests.get_search_items_request(Mock()) - - @patch.object(requests, "GetVariationsRequest") - def test_variations_request(self, mock_variations_request: MagicMock): - mock_variations_request.return_value = "foo" - result = requests.get_variations_request(Mock()) - - self.assertEqual("foo", result) - - @patch.object(requests, "GetVariationsRequest") - def test_variations_request_error(self, mock_variations_request: MagicMock): - mock_variations_request.side_effect = TypeError() - - with self.assertRaises(MalformedRequest): - requests.get_variations_request(Mock()) - - @patch.object(requests, "GetBrowseNodesRequest") - def test_browse_nodes_request(self, mock_browse_nodes_request: MagicMock): - mock_browse_nodes_request.return_value = "foo" - result = requests.get_browse_nodes_request(Mock()) - - self.assertEqual("foo", result) - - @patch.object(requests, "GetBrowseNodesRequest") - def test_browse_nodes_request_error(self, mock_browse_nodes_request: MagicMock): - mock_browse_nodes_request.side_effect = TypeError() - - with self.assertRaises(MalformedRequest): - requests.get_browse_nodes_request(Mock()) - - def test_get_items_response(self): - amazon_api = Mock() - api_result = Mock() - api_result.items_result.items = "foo" - amazon_api.api.get_items.return_value = api_result - response = requests.get_items_response(amazon_api, Mock()) - - self.assertEqual("foo", response) - - def test_get_items_response_api_exception(self): - amazon_api = Mock() - amazon_api.api.get_items.side_effect = ApiException() - - with self.assertRaises(RequestError): - requests.get_items_response(amazon_api, Mock()) - - def test_get_items_response_items_not_found_exception(self): - amazon_api = Mock() - amazon_api.api.get_items.return_value = Mock(items_result=None) - - with self.assertRaises(ItemsNotFound): - requests.get_items_response(amazon_api, Mock()) - - def test_search_items_response(self): - amazon_api = Mock() - api_result = Mock(search_result="foo") - amazon_api.api.search_items.return_value = api_result - response = requests.get_search_items_response(amazon_api, Mock()) - - self.assertEqual("foo", response) - - def test_get_search_items_response_api_exception(self): - amazon_api = Mock() - amazon_api.api.search_items.side_effect = ApiException() - - with self.assertRaises(RequestError): - requests.get_search_items_response(amazon_api, Mock()) - - def test_get_search_items_response_items_not_found_exception(self): - amazon_api = Mock() - amazon_api.api.search_items.return_value = Mock(search_result=None) - - with self.assertRaises(ItemsNotFound): - requests.get_search_items_response(amazon_api, Mock()) - - def test_get_variations_response(self): - amazon_api = Mock() - api_result = Mock(variations_result="foo") - amazon_api.api.get_variations.return_value = api_result - response = requests.get_variations_response(amazon_api, Mock()) - - self.assertEqual("foo", response) - - def test_get_variations_response_api_exception(self): - amazon_api = Mock() - amazon_api.api.get_variations.side_effect = ApiException() - - with self.assertRaises(RequestError): - requests.get_variations_response(amazon_api, Mock()) - - def test_get_variations_response_items_not_found_exception(self): - amazon_api = Mock() - amazon_api.api.get_variations.return_value = Mock(variations_result=None) - - with self.assertRaises(ItemsNotFound): - requests.get_variations_response(amazon_api, Mock()) - - def test_get_browse_nodes_response(self): - amazon_api = Mock() - api_result = Mock() - api_result.browse_nodes_result.browse_nodes = "foo" - amazon_api.api.get_browse_nodes.return_value = api_result - response = requests.get_browse_nodes_response(amazon_api, Mock()) - - self.assertEqual("foo", response) - - def test_get_browse_nodes_response_api_exception(self): - amazon_api = Mock() - amazon_api.api.get_browse_nodes.side_effect = ApiException() - - with self.assertRaises(RequestError): - requests.get_browse_nodes_response(amazon_api, Mock()) - - def test_get_browse_nodes_response_items_not_found_exception(self): - amazon_api = Mock() - amazon_api.api.get_browse_nodes.return_value = Mock(browse_nodes_result=None) - - with self.assertRaises(ItemsNotFound): - requests.get_browse_nodes_response(amazon_api, Mock()) - - def test_manage_response_exceptions_too_many_requests(self): - error = Mock(spec=ApiException, status=429) - with self.assertRaises(TooManyRequests): - requests._manage_response_exceptions(error) - - def test_manage_response_exceptions_invalid_parameter_value(self): - error = Mock(spec=ApiException, body="InvalidParameterValue", status=200) - with self.assertRaises(InvalidArgument): - requests._manage_response_exceptions(error) - - def test_manage_response_exceptions_invalid_partner_tag(self): - error = Mock(spec=ApiException, body="InvalidPartnerTag", status=200) - with self.assertRaises(InvalidArgument): - requests._manage_response_exceptions(error) - - def test_manage_response_exceptions_invalid_associate(self): - error = Mock(spec=ApiException, body="InvalidAssociate", status=200) - with self.assertRaises(AssociateValidationError): - requests._manage_response_exceptions(error) diff --git a/tests/integration_test.py b/tests/integration_test.py deleted file mode 100644 index a5a05e1..0000000 --- a/tests/integration_test.py +++ /dev/null @@ -1,333 +0,0 @@ -"""Integration tests for Amazon Product Advertising API.""" - -from __future__ import annotations - -import os -from pathlib import Path -from typing import TYPE_CHECKING, ClassVar, cast -from unittest import TestCase, skipUnless - -from dotenv import load_dotenv - -from amazon_paapi.api import AmazonApi - -# Load environment variables from .env file -load_dotenv(Path(__file__).parents[2] / ".env") - -if TYPE_CHECKING: - from amazon_paapi.models import BrowseNode, CountryCode - from amazon_paapi.models.item_result import Item - from amazon_paapi.models.search_result import SearchResult - from amazon_paapi.models.variations_result import VariationsResult - - -def get_api_credentials() -> tuple[str, str, str, CountryCode]: - """Get API credentials from environment variables. - - Raises: - ValueError: If any required credential is missing. - """ - credentials = { - "API_KEY": os.environ.get("API_KEY"), - "API_SECRET": os.environ.get("API_SECRET"), - "AFFILIATE_TAG": os.environ.get("AFFILIATE_TAG"), - "COUNTRY_CODE": os.environ.get("COUNTRY_CODE"), - } - - missing = [key for key, value in credentials.items() if value is None] - if missing: - msg = f"Missing environment variables: {', '.join(missing)}" - raise ValueError(msg) - - return ( - cast("str", credentials["API_KEY"]), - cast("str", credentials["API_SECRET"]), - cast("str", credentials["AFFILIATE_TAG"]), - cast("CountryCode", credentials["COUNTRY_CODE"]), - ) - - -def has_api_credentials() -> bool: - """Check if all API credentials are available.""" - try: - get_api_credentials() - except ValueError: - return False - return True - - -@skipUnless(has_api_credentials(), "Needs Amazon API credentials") -class IntegrationTest(TestCase): - """Integration tests that make real API calls to Amazon. - - All API results are cached at class level to minimize the number of - requests. This reduces costs and avoids rate limiting. - """ - - api: ClassVar[AmazonApi] - affiliate_tag: ClassVar[str] - search_result: ClassVar[SearchResult] - item_with_offers: ClassVar[Item] - get_items_result: ClassVar[list[Item]] - variations_result: ClassVar[VariationsResult] - browse_nodes_result: ClassVar[list[BrowseNode]] - - @classmethod - def _has_valid_offer(cls, item: Item) -> bool: - """Check if an item has a valid offer with price and availability. - - Args: - item: The item to check. - - Returns: - True if the item has a valid offer with price and is in stock. - """ - if item.offers_v2 is None or not item.offers_v2.listings: - return False - - listing = item.offers_v2.listings[0] - - # Check that the listing has a valid price - has_price = ( - listing.price is not None - and listing.price.money is not None - and listing.price.money.amount is not None - ) - - # Check that the product is not out of stock - is_available = ( - listing.availability is None - or listing.availability.type is None - or listing.availability.type != "OutOfStock" - ) - - return has_price and is_available - - @classmethod - def setUpClass(cls) -> None: - """Set up API client and make shared API calls once for all tests.""" - api_key, api_secret, affiliate_tag, country_code = get_api_credentials() - - cls.api = AmazonApi(api_key, api_secret, affiliate_tag, country_code) - cls.affiliate_tag = affiliate_tag - - cls.search_result = cls.api.search_items(keywords="laptop") - - cls.item_with_offers = next( - (item for item in cls.search_result.items if cls._has_valid_offer(item)), - cls.search_result.items[0], - ) - cls.get_items_result = cls.api.get_items(cls.item_with_offers.asin) - - item_with_variations = next( - (item for item in cls.search_result.items if item.parent_asin), - cls.search_result.items[0], - ) - cls.variations_result = cls.api.get_variations( - item_with_variations.parent_asin or item_with_variations.asin - ) - - item_with_browse_nodes = next( - ( - item - for item in cls.search_result.items - if item.browse_node_info and item.browse_node_info.browse_nodes - ), - None, - ) - if item_with_browse_nodes: - browse_node_id = item_with_browse_nodes.browse_node_info.browse_nodes[0].id - cls.browse_nodes_result = cls.api.get_browse_nodes([browse_node_id]) - else: - cls.browse_nodes_result = [] - - def test_search_items_returns_expected_count(self) -> None: - """Test that search returns the default number of items.""" - self.assertEqual(10, len(self.search_result.items)) - - def test_search_items_includes_affiliate_tag(self) -> None: - """Test that search results include the affiliate tag in URLs.""" - searched_item = self.search_result.items[0] - self.assertIn(self.affiliate_tag, searched_item.detail_page_url) - - def test_search_items_returns_offers_v2(self) -> None: - """Test that search results include OffersV2 data.""" - self.assertGreater(len(self.search_result.items), 0) - - item = self.item_with_offers - self.assertIsNotNone(item.offers_v2) - - if item.offers_v2.listings: - listing = item.offers_v2.listings[0] - self.assertIsNotNone(listing) - - def test_offers_v2_listing_has_price_info(self) -> None: - """Test that OffersV2 listings include price information.""" - item = self.item_with_offers - self.assertIsNotNone(item.offers_v2) - - if item.offers_v2.listings: - listing = item.offers_v2.listings[0] - self.assertIsNotNone(listing.price) - - if listing.price and listing.price.money: - self.assertIsNotNone(listing.price.money.amount) - self.assertIsNotNone(listing.price.money.currency) - self.assertIsNotNone(listing.price.money.display_amount) - - def test_offers_v2_listing_has_merchant_info(self) -> None: - """Test that OffersV2 listings include merchant information.""" - item = self.item_with_offers - self.assertIsNotNone(item.offers_v2) - - if item.offers_v2.listings: - listing = item.offers_v2.listings[0] - - if listing.merchant_info: - self.assertIsNotNone(listing.merchant_info.name) - - def test_offers_v2_listing_has_condition(self) -> None: - """Test that OffersV2 listings include condition information.""" - item = self.item_with_offers - self.assertIsNotNone(item.offers_v2) - - if item.offers_v2.listings: - listing = item.offers_v2.listings[0] - - if listing.condition: - self.assertIsNotNone(listing.condition.value) - - def test_offers_v2_listing_has_availability(self) -> None: - """Test that OffersV2 listings include availability information.""" - item = self.item_with_offers - self.assertIsNotNone(item.offers_v2) - - if item.offers_v2.listings: - listing = item.offers_v2.listings[0] - - if listing.availability: - self.assertIsNotNone(listing.availability.type) - - def test_get_items_returns_single_result(self) -> None: - """Test that get_items returns exactly one item when given one ASIN.""" - self.assertEqual(1, len(self.get_items_result)) - - def test_get_items_includes_affiliate_tag(self) -> None: - """Test that get_items results include the affiliate tag in URLs.""" - self.assertIn(self.affiliate_tag, self.get_items_result[0].detail_page_url) - - def test_get_items_returns_offers_v2(self) -> None: - """Test that get_items returns OffersV2 data with price details.""" - item = self.get_items_result[0] - self.assertIsNotNone(item.offers_v2) - - if item.offers_v2.listings: - listing = item.offers_v2.listings[0] - self.assertIsNotNone(listing) - - if listing.price and listing.price.money: - self.assertIsNotNone(listing.price.money.amount) - self.assertIsNotNone(listing.price.money.display_amount) - - def test_get_variations_returns_items(self) -> None: - """Test that get_variations returns a list of variation items.""" - self.assertIsNotNone(self.variations_result) - self.assertGreater(len(self.variations_result.items), 0) - - def test_get_variations_returns_variation_summary(self) -> None: - """Test that get_variations returns variation summary.""" - self.assertIsNotNone(self.variations_result.variation_summary) - self.assertGreater(self.variations_result.variation_summary.variation_count, 0) - - def test_get_variations_items_include_affiliate_tag(self) -> None: - """Test that variation items include the affiliate tag in URLs.""" - item = self.variations_result.items[0] - self.assertIn(self.affiliate_tag, item.detail_page_url) - - def test_get_browse_nodes_returns_results(self) -> None: - """Test that get_browse_nodes returns browse node information.""" - self.assertGreater(len(self.browse_nodes_result), 0) - - def test_get_browse_nodes_returns_node_info(self) -> None: - """Test that browse nodes contain expected information.""" - node = self.browse_nodes_result[0] - self.assertIsNotNone(node.id) - self.assertIsNotNone(node.display_name) - - def test_offers_v2_listing_has_is_buy_box_winner(self) -> None: - """Test that OffersV2 listings include is_buy_box_winner attribute.""" - item = self.item_with_offers - self.assertIsNotNone(item.offers_v2) - - if item.offers_v2.listings: - listing = item.offers_v2.listings[0] - self.assertIsInstance(listing.is_buy_box_winner, bool) - - def test_offers_v2_listing_has_type(self) -> None: - """Test that OffersV2 listings include offer type.""" - item = self.item_with_offers - self.assertIsNotNone(item.offers_v2) - - if item.offers_v2.listings: - listing = item.offers_v2.listings[0] - if listing.type: - self.assertIsNotNone(listing.type) - - def test_offers_v2_price_has_savings_when_available(self) -> None: - """Test that OffersV2 price includes savings info when available.""" - item = self.item_with_offers - self.assertIsNotNone(item.offers_v2) - - if item.offers_v2.listings: - listing = item.offers_v2.listings[0] - if listing.price and listing.price.savings: - savings = listing.price.savings - if savings.money: - self.assertIsNotNone(savings.money.amount) - if savings.percentage is not None: - self.assertIsInstance(savings.percentage, (int, float)) - - def test_search_items_returns_item_info(self) -> None: - """Test that search results include item info with title.""" - item = self.search_result.items[0] - self.assertIsNotNone(item.item_info) - self.assertIsNotNone(item.item_info.title) - self.assertIsNotNone(item.item_info.title.display_value) - self.assertIsInstance(item.item_info.title.display_value, str) - self.assertGreater(len(item.item_info.title.display_value), 0) - - def test_search_items_returns_valid_asin(self) -> None: - """Test that search results return valid ASIN format.""" - item = self.search_result.items[0] - self.assertIsNotNone(item.asin) - self.assertEqual(len(item.asin), 10) - self.assertTrue(item.asin.isalnum()) - - def test_search_items_returns_images(self) -> None: - """Test that search results include product images.""" - item = self.search_result.items[0] - self.assertIsNotNone(item.images) - if item.images.primary: - self.assertIsNotNone(item.images.primary.large) - if item.images.primary.large: - self.assertIsNotNone(item.images.primary.large.url) - self.assertTrue(item.images.primary.large.url.startswith("http")) - - def test_get_items_returns_item_info(self) -> None: - """Test that get_items returns item info with title.""" - item = self.get_items_result[0] - self.assertIsNotNone(item.item_info) - self.assertIsNotNone(item.item_info.title) - self.assertIsNotNone(item.item_info.title.display_value) - - def test_get_variations_returns_offers_v2(self) -> None: - """Test that get_variations returns OffersV2 data for variation items.""" - item_with_offers = next( - (item for item in self.variations_result.items if item.offers_v2), - None, - ) - if item_with_offers and item_with_offers.offers_v2: - self.assertIsNotNone(item_with_offers.offers_v2) - if item_with_offers.offers_v2.listings: - listing = item_with_offers.offers_v2.listings[0] - self.assertIsNotNone(listing) diff --git a/tests/offersv2_test.py b/tests/offersv2_test.py deleted file mode 100644 index eba94c0..0000000 --- a/tests/offersv2_test.py +++ /dev/null @@ -1,79 +0,0 @@ -"""Tests for OffersV2 functionality.""" - -import unittest - -from amazon_paapi.helpers import requests -from amazon_paapi.models.item_result import ( - ApiDealDetails, - ApiListingsV2, - ApiOfferPriceV2, - ApiOfferSavingBasis, - Item, -) -from amazon_paapi.sdk.models.get_items_resource import GetItemsResource -from amazon_paapi.sdk.models.get_variations_resource import GetVariationsResource -from amazon_paapi.sdk.models.search_items_resource import SearchItemsResource - -EXPECTED_OFFERSV2_RESOURCES = [ - "OffersV2.Listings.Availability", - "OffersV2.Listings.Condition", - "OffersV2.Listings.DealDetails", - "OffersV2.Listings.IsBuyBoxWinner", - "OffersV2.Listings.LoyaltyPoints", - "OffersV2.Listings.MerchantInfo", - "OffersV2.Listings.Price", - "OffersV2.Listings.Type", -] - - -class TestOffersV2Resources(unittest.TestCase): - """Test cases for OffersV2 resource constants.""" - - def test_get_items_resources_include_all_offersv2(self) -> None: - """Verify _get_request_resources includes all OffersV2 resources.""" - resources = requests._get_request_resources(GetItemsResource) - for resource in EXPECTED_OFFERSV2_RESOURCES: - self.assertIn(resource, resources) - - def test_search_items_resources_include_all_offersv2(self) -> None: - """Verify _get_request_resources includes all OffersV2 resources for search.""" - resources = requests._get_request_resources(SearchItemsResource) - for resource in EXPECTED_OFFERSV2_RESOURCES: - self.assertIn(resource, resources) - - def test_get_variations_resources_include_all_offersv2(self) -> None: - """Verify _get_request_resources includes OffersV2 resources.""" - resources = requests._get_request_resources(GetVariationsResource) - for resource in EXPECTED_OFFERSV2_RESOURCES: - self.assertIn(resource, resources) - - -class TestOffersV2Models(unittest.TestCase): - """Test cases for OffersV2 model structure.""" - - def test_item_has_offers_v2_attribute(self) -> None: - """Verify Item class has offers_v2 typed as ApiOffersV2.""" - self.assertIn("offers_v2", Item.__annotations__) - self.assertEqual(Item.__annotations__["offers_v2"], "ApiOffersV2") - - def test_api_listings_v2_has_required_attributes(self) -> None: - """Verify ApiListingsV2 has violates_map and deal_details.""" - annotations = ApiListingsV2.__annotations__ - self.assertIn("violates_map", annotations) - self.assertIn("deal_details", annotations) - - def test_api_deal_details_has_required_attributes(self) -> None: - """Verify ApiDealDetails has badge and access_type.""" - annotations = ApiDealDetails.__annotations__ - self.assertIn("badge", annotations) - self.assertIn("access_type", annotations) - - def test_api_offer_price_v2_has_required_attributes(self) -> None: - """Verify ApiOfferPriceV2 has money and savings.""" - annotations = ApiOfferPriceV2.__annotations__ - self.assertIn("money", annotations) - self.assertIn("savings", annotations) - - def test_api_offer_saving_basis_has_saving_basis_type(self) -> None: - """Verify ApiOfferSavingBasis has saving_basis_type.""" - self.assertIn("saving_basis_type", ApiOfferSavingBasis.__annotations__) diff --git a/tests/tools_test.py b/tests/tools_test.py deleted file mode 100644 index cf750da..0000000 --- a/tests/tools_test.py +++ /dev/null @@ -1,37 +0,0 @@ -"""Tests for tools module.""" - -import unittest - -from amazon_paapi.errors import AsinNotFound -from amazon_paapi.tools import get_asin - - -class TestTools(unittest.TestCase): - def test_get_asin(self): - self.assertEqual(get_asin("B01N5IB20Q"), "B01N5IB20Q") - self.assertEqual( - get_asin("https://www.amazon.es/gp/product/B07PHPXHQS"), "B07PHPXHQS" - ) - self.assertEqual( - get_asin( - "https://www.amazon.es/gp/product/B07PHPXHQS?pf_rd_r3FXDZDV1W6KY83KEE2Z" - "4&pf_rd_p=c6fa5af0-ec7c-40de-8332-fd1421de4244&pd_rd_r=58786171-de0f-4" - "fe1-a2df-ee335d6715ee&pd_rd_w=KND7A&pd_rd_wg=kIr5z&ref_=pd_gw_unk" - ), - "B07PHPXHQS", - ) - self.assertEqual(get_asin("https://www.amazon.es/dp/B07PKW4CKF"), "B07PKW4CKF") - self.assertEqual( - get_asin( - "https://www.amazon.es/dp/B07PKW4CKF?_encoding=UTF8&ref_=pocs_dp_m_sp_m" - "ulti_c_more_nooffers_B08D1G2XVX" - ), - "B07PKW4CKF", - ) - - def test_asin_not_found(self): - with self.assertRaises(AsinNotFound): - get_asin("https://www.amazon.es/gp/") - - with self.assertRaises(AsinNotFound): - get_asin("this is not even a URL") From 0918b474e4bc227d4bd85ab6eb651c03c84de880 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 3 Sep 2026 22:13:58 +0000 Subject: [PATCH 2/2] Keep the Creators API migration guide Restore docs/pages/migration-guide-6.md and its entry in the docs index. It is the upgrade path for users of the removed amazon_paapi module, so reword it to describe that module as removed in 7.0.0 rather than merely deprecated. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_017tt3keqqTMqgirkJezEVU8 --- CHANGELOG.md | 8 +- docs/index.rst | 11 +++ docs/pages/migration-guide-6.md | 166 ++++++++++++++++++++++++++++++++ 3 files changed, 181 insertions(+), 4 deletions(-) create mode 100644 docs/pages/migration-guide-6.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b793eb..6c98382 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,14 +11,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - The deprecated `amazon_paapi` module and its bundled Product Advertising API 5.0 SDK - `AmazonApi`, `amazon_paapi.errors`, `amazon_paapi.helpers`, `amazon_paapi.models` and `amazon_paapi.tools` -- Product Advertising API documentation, including the version 6 migration guide +- Product Advertising API documentation and deprecation notices in the README and docs - `API_KEY` and `API_SECRET` environment variables, only used by the removed module ### Changed -- Use `amazon_creatorsapi` instead. Replace `AmazonApi(access_key, secret_key, partner_tag, country)` - with `AmazonCreatorsApi(credential_id, credential_secret, version, tag, country)`, and import - `get_asin` from `amazon_creatorsapi` +- Use `amazon_creatorsapi` instead. See the + [migration guide](https://python-amazon-paapi.readthedocs.io/en/latest/pages/migration-guide-6.html) + for the credential, method and exception mapping ## [6.4.0] - 2026-09-03 diff --git a/docs/index.rst b/docs/index.rst index 829a098..12501bf 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -36,6 +36,17 @@ API Reference amazon_creatorsapi.models +Migration guide +--------------- + +If you are still using the removed ``amazon_paapi`` module, follow this guide to move to +``amazon_creatorsapi``. + +.. toctree:: + :maxdepth: 1 + + ./pages/migration-guide-6.md + Changelog --------- diff --git a/docs/pages/migration-guide-6.md b/docs/pages/migration-guide-6.md new file mode 100644 index 0000000..61a3e74 --- /dev/null +++ b/docs/pages/migration-guide-6.md @@ -0,0 +1,166 @@ +# Creators API migration guide + +This guide explains how to migrate from the `amazon_paapi` module to the +`amazon_creatorsapi` module, which uses Amazon's Creators API. + +## Why migrate? + +Version 6.0.0 introduced support for Amazon's new **Creators API**, which replaces the +Product Advertising API (PAAPI). The old `amazon_paapi` module was deprecated in that +release and removed in 7.0.0, so importing it now raises `ModuleNotFoundError`. + +Key benefits of the Creators API: + +- OAuth2-based authentication (more secure) +- Simplified credential management +- New features and improvements from Amazon + +## Changelog summary + +- New `amazon_creatorsapi` module for the Creators API +- The `amazon_paapi` module is deprecated in 6.0.0 and removed in 7.0.0 +- Different authentication credentials required + +## How to upgrade? + +Upgrading to the last version of this module is as easy as running this pip command: + + pip install python-amazon-paapi --upgrade + +## Credential changes + +The Creators API uses different credentials than PAAPI: + +| PAAPI | Creators API | +| ----------- | ----------------- | +| Access Key | Credential ID | +| Secret Key | Credential Secret | +| - | Version | +| Partner Tag | Partner Tag | +| Country | Country | + +You will need to obtain new credentials from the Amazon Associates Creators API portal. + +## What should I change in my current code? + +### Import changes + +```diff +- from amazon_paapi import AmazonApi ++ from amazon_creatorsapi import AmazonCreatorsApi +``` + +### Initialization changes + +```diff +- amazon = AmazonApi( +- access_key="YOUR_ACCESS_KEY", +- secret_key="YOUR_SECRET_KEY", +- partner_tag="YOUR_TAG", +- country="ES" +- ) + ++ amazon = AmazonCreatorsApi( ++ credential_id="YOUR_CREDENTIAL_ID", ++ credential_secret="YOUR_CREDENTIAL_SECRET", ++ version="2.2", ++ tag="YOUR_TAG", ++ country="ES" ++ ) +``` + +### Method signature changes + +While the main methods have the same names, there are important parameter differences: + +#### `get_items` + +| Removed in Creators API | New in Creators API | +| ----------------------- | ----------------------------------- | +| `merchant` | `resources: list[GetItemsResource]` | +| `include_unavailable` | | +| `**kwargs` | | + +#### `search_items` + +| Removed in Creators API | New in Creators API | +| ----------------------- | -------------------------------------- | +| `availability` | `resources: list[SearchItemsResource]` | +| `delivery_flags` | | +| `merchant` | | +| `**kwargs` | | + +#### `get_variations` + +| Removed in Creators API | New in Creators API | +| ----------------------- | ---------------------------------------- | +| `merchant` | `resources: list[GetVariationsResource]` | +| `**kwargs` | | + +#### `get_browse_nodes` + +| Removed in Creators API | New in Creators API | +| ----------------------- | ----------------------------------------- | +| `**kwargs` | `resources: list[GetBrowseNodesResource]` | + +#### Basic usage examples + +```python +# Get items +items = amazon.get_items(['B01N5IB20Q']) + +# Search items +results = amazon.search_items(keywords='nintendo') + +# Get variations +variations = amazon.get_variations('B01N5IB20Q') + +# Get browse nodes +nodes = amazon.get_browse_nodes(['667049031']) +``` + +### Helper functions + +```diff +- from amazon_paapi import get_asin ++ from amazon_creatorsapi.core import get_asin +``` + +### Models module + +Version 6.0 introduces a new `models` module that re-exports all SDK models for convenient access: + +```python +from amazon_creatorsapi.models import ( + Item, + Condition, + SortBy, + GetItemsResource, + SearchItemsResource, + GetVariationsResource, + GetBrowseNodesResource, +) +``` + +This allows you to import models directly without navigating the SDK structure. + +### Exceptions + +Exception names have changed to use the `Error` suffix: + +```python +from amazon_creatorsapi.errors import ( + AmazonCreatorsApiError, # Base exception + InvalidArgumentError, + ItemsNotFoundError, + TooManyRequestsError, + AssociateValidationError, + RequestError, +) +``` + +## I need more help + +You can always ask for help in our [Telegram group](https://t.me/PythonAmazonPAAPI) or raise an issue on +[Github](https://github.com/sergioteula/python-amazon-paapi/issues) for help. If you find that this +guide could be improved somehow, feel free to send a pull request with your changes.