Skip to content

Commit

Permalink
adding list_policies_for_target_single_page for orgs
Browse files Browse the repository at this point in the history
  • Loading branch information
eamonnfaherty committed Oct 26, 2020
1 parent b27243e commit 03ebbcd
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
20 changes: 20 additions & 0 deletions betterboto/organizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,24 @@ def list_policies_single_page(self, **kwargs):
)


def list_policies_for_target_single_page(self, **kwargs):
"""
This will continue to call list_policies_for_target until there are no more pages left to retrieve. It will return
the aggregated response in the same structure as list_policies_for_target does.
:param self: organizations client
:param kwargs: these are passed onto the list_policies_for_target method call
:return: organizations_client.list_policies_for_target.response
"""
return slurp(
'list_policies_for_target',
self.list_policies_for_target,
'Policies',
'NextToken', 'NextToken',
**kwargs
)


def list_organizational_units_for_parent_single_page(self, **kwargs):
"""
This will continue to call list_organizational_units_for_parent until there are no more pages left to retrieve.
Expand Down Expand Up @@ -258,6 +276,8 @@ def make_better(client):
client.convert_path_to_ou = types.MethodType(convert_path_to_ou, 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_policies_single_page = types.MethodType(list_policies_single_page, client)
client.list_policies_for_target_single_page = types.MethodType(list_policies_for_target_single_page, client)
client.list_organizational_units_for_parent_single_page = types.MethodType(list_organizational_units_for_parent_single_page, client)
client.list_roots_single_page = types.MethodType(list_roots_single_page, client)
client.list_parents_single_page = types.MethodType(list_parents_single_page, client)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setuptools.setup(
name="better-boto",
version="0.33.0",
version="0.34.0",
author="Eamonn Faherty",
author_email="python-packages@designandsolve.co.uk",
description="Helpers to make using boto3 more enjoyable",
Expand Down

0 comments on commit 03ebbcd

Please sign in to comment.