in src/pkg/qs_asset_gov.py [0:0]
def get_all_datasets(account_id):
"""
Paginate through all list_data_sets responses and build a list of every
dataset in the QuickSight account.
"""
all_datasets = []
response = QS_CLIENT.list_data_sets(AwsAccountId=account_id)
for dset in response['DataSetSummaries']:
all_datasets.append(dset)
while response.get("NextToken", None) is not None:
response = QS_CLIENT.list_data_sets(
AwsAccountId=account_id, NextToken=response.get("NextToken")
)
for dset in response['DataSetSummaries']:
all_datasets.append(dset)
return all_datasets