From 5b283b9699958d8e62509b87980c5d0f6fdf8e3f Mon Sep 17 00:00:00 2001 From: Sergio Abad Date: Tue, 21 Jun 2022 19:42:54 +0200 Subject: [PATCH] Solved ItemsNotFoudException typo --- amazon_paapi/api.py | 8 +++---- amazon_paapi/errors/exceptions.py | 2 +- amazon_paapi/helpers/requests.py | 36 +++++++++++++++++++------------ 3 files changed, 27 insertions(+), 19 deletions(-) diff --git a/amazon_paapi/api.py b/amazon_paapi/api.py index fd6fe07..b57ec07 100644 --- a/amazon_paapi/api.py +++ b/amazon_paapi/api.py @@ -82,7 +82,7 @@ def get_items( ``InvalidArgumentException`` ``MalformedRequestException`` ``ApiRequestException`` - ``ItemsNotFoudException`` + ``ItemsNotFoundException`` """ kwargs.update({ @@ -178,7 +178,7 @@ def search_items( ``InvalidArgumentException`` ``MalformedRequestException`` ``ApiRequestException`` - ``ItemsNotFoudException`` + ``ItemsNotFoundException`` """ kwargs.update({ @@ -247,7 +247,7 @@ def get_variations( ``InvalidArgumentException`` ``MalformedRequestException`` ``ApiRequestException`` - ``ItemsNotFoudException`` + ``ItemsNotFoundException`` """ asin = arguments.get_items_ids(asin)[0] @@ -290,7 +290,7 @@ def get_browse_nodes( ``InvalidArgumentException`` ``MalformedRequestException`` ``ApiRequestException`` - ``ItemsNotFoudException`` + ``ItemsNotFoundException`` """ kwargs.update({ diff --git a/amazon_paapi/errors/exceptions.py b/amazon_paapi/errors/exceptions.py index 544d0bb..e04cbab 100644 --- a/amazon_paapi/errors/exceptions.py +++ b/amazon_paapi/errors/exceptions.py @@ -28,7 +28,7 @@ class MalformedRequestException(AmazonException): """Raised if the request for Amazon API is not correctly formed""" pass -class ItemsNotFoudException(AmazonException): +class ItemsNotFoundException(AmazonException): """Raised if no items are found""" pass diff --git a/amazon_paapi/helpers/requests.py b/amazon_paapi/helpers/requests.py index 05a894d..a32b867 100644 --- a/amazon_paapi/helpers/requests.py +++ b/amazon_paapi/helpers/requests.py @@ -1,23 +1,31 @@ """Module with helper functions for creating requests.""" +import inspect from typing import List + +from ..errors import ( + ApiRequestException, + AssociateValidationException, + InvalidArgumentException, + ItemsNotFoundException, + MalformedRequestException, + TooManyRequestsException, +) +from ..models.browse_nodes_result import BrowseNode from ..models.item_result import Item from ..models.search_result import SearchResult from ..models.variations_result import VariationsResult -from ..models.browse_nodes_result import BrowseNode -from ..errors import ApiRequestException, ItemsNotFoudException, MalformedRequestException, TooManyRequestsException, AssociateValidationException, InvalidArgumentException -from ..sdk.models.partner_type import PartnerType -from ..sdk.models.get_items_resource import GetItemsResource +from ..sdk.models.get_browse_nodes_request import GetBrowseNodesRequest +from ..sdk.models.get_browse_nodes_resource import GetBrowseNodesResource from ..sdk.models.get_items_request import GetItemsRequest -from ..sdk.models.search_items_resource import SearchItemsResource -from ..sdk.models.search_items_request import SearchItemsRequest -from ..sdk.models.get_variations_resource import GetVariationsResource +from ..sdk.models.get_items_resource import GetItemsResource from ..sdk.models.get_variations_request import GetVariationsRequest -from ..sdk.models.get_browse_nodes_resource import GetBrowseNodesResource -from ..sdk.models.get_browse_nodes_request import GetBrowseNodesRequest +from ..sdk.models.get_variations_resource import GetVariationsResource +from ..sdk.models.partner_type import PartnerType +from ..sdk.models.search_items_request import SearchItemsRequest +from ..sdk.models.search_items_resource import SearchItemsResource from ..sdk.rest import ApiException -import inspect def get_items_request(amazon_api, asin_chunk: List[str], **kwargs) -> GetItemsRequest: @@ -39,7 +47,7 @@ def get_items_response(amazon_api, request: GetItemsRequest) -> List[Item]: _manage_response_exceptions(e) if response.items_result == None: - raise ItemsNotFoudException('No items have been found') + raise ItemsNotFoundException('No items have been found') return response.items_result.items @@ -62,7 +70,7 @@ def get_search_items_response(amazon_api, request: SearchItemsRequest) -> Search _manage_response_exceptions(e) if response.search_result == None: - raise ItemsNotFoudException('No items have been found') + raise ItemsNotFoundException('No items have been found') return response.search_result @@ -85,7 +93,7 @@ def get_variations_response(amazon_api, request: GetVariationsRequest) -> Variat _manage_response_exceptions(e) if response.variations_result == None: - raise ItemsNotFoudException('No variation items have been found') + raise ItemsNotFoundException('No variation items have been found') return response.variations_result @@ -108,7 +116,7 @@ def get_browse_nodes_response(amazon_api, request: GetBrowseNodesRequest) -> Lis _manage_response_exceptions(e) if response.browse_nodes_result == None: - raise ItemsNotFoudException('No browse nodes have been found') + raise ItemsNotFoundException('No browse nodes have been found') return response.browse_nodes_result.browse_nodes