From 57e6254e1a71c0e4e2aaaebe7131999e6dffa60a Mon Sep 17 00:00:00 2001 From: Eamonn Faherty Date: Fri, 14 Jun 2019 15:57:19 +0100 Subject: [PATCH] adding search_products_as_admin_single_page --- betterboto/organizations.py | 18 ++++++++++++++++++ setup.py | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/betterboto/organizations.py b/betterboto/organizations.py index 948ed37..5428554 100644 --- a/betterboto/organizations.py +++ b/betterboto/organizations.py @@ -7,6 +7,23 @@ logger = logging.getLogger(__file__) +def search_products_as_admin_single_page(self, **kwargs): + """ + This will continue to call search_products_as_admin until there are no more pages left to retrieve. It will return + the aggregated response in the same structure as search_products_as_admin does. + + :param self: organizations client + :param kwargs: these are passed onto the search_products_as_admin method call + :return: organizations_client.search_products_as_admin.response + """ + return slurp( + 'search_products_as_admin', + self.search_products_as_admin, + 'ProductViewDetails', + **kwargs + ) + + def list_accounts_single_page(self, **kwargs): """ This will continue to call list_accounts until there are no more pages left to retrieve. It will return @@ -169,4 +186,5 @@ def make_better(client): client.list_children_single_page = types.MethodType(list_children_single_page, client) client.list_children_nested = types.MethodType(list_children_nested, client) client.list_organizational_units_for_parent_single_page = types.MethodType(list_organizational_units_for_parent_single_page, client) + client.search_products_as_admin_single_page = types.MethodType(search_products_as_admin_single_page, client) return client diff --git a/setup.py b/setup.py index 8aba7a9..18d0be3 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setuptools.setup( name="better-boto", - version="0.7.0", + version="0.8.0", author="Eamonn Faherty", author_email="python-packages@designandsolve.co.uk", description="Helpers to make using boto3 more enjoyable",