Skip to content

Commit 9bf73e8

Browse files
authored
feat(types): add pagination stopOnSameToken option (#3524)
* feat(types): add pagination stopOnSameToken option * feat(types): pagination, update client codegen
1 parent e017377 commit 9bf73e8

File tree

1,947 files changed

+3900
-1946
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,947 files changed

+3900
-1946
lines changed

clients/client-accessanalyzer/src/pagination/ListAccessPreviewFindingsPaginator.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ export async function* paginateListAccessPreviewFindings(
5151
throw new Error("Invalid client, expected AccessAnalyzer | AccessAnalyzerClient");
5252
}
5353
yield page;
54+
const prevToken = token;
5455
token = page.nextToken;
55-
hasNext = !!token;
56+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
5657
}
5758
// @ts-ignore
5859
return undefined;

clients/client-accessanalyzer/src/pagination/ListAccessPreviewsPaginator.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ export async function* paginateListAccessPreviews(
5151
throw new Error("Invalid client, expected AccessAnalyzer | AccessAnalyzerClient");
5252
}
5353
yield page;
54+
const prevToken = token;
5455
token = page.nextToken;
55-
hasNext = !!token;
56+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
5657
}
5758
// @ts-ignore
5859
return undefined;

clients/client-accessanalyzer/src/pagination/ListAnalyzedResourcesPaginator.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ export async function* paginateListAnalyzedResources(
5151
throw new Error("Invalid client, expected AccessAnalyzer | AccessAnalyzerClient");
5252
}
5353
yield page;
54+
const prevToken = token;
5455
token = page.nextToken;
55-
hasNext = !!token;
56+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
5657
}
5758
// @ts-ignore
5859
return undefined;

clients/client-accessanalyzer/src/pagination/ListAnalyzersPaginator.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ export async function* paginateListAnalyzers(
5151
throw new Error("Invalid client, expected AccessAnalyzer | AccessAnalyzerClient");
5252
}
5353
yield page;
54+
const prevToken = token;
5455
token = page.nextToken;
55-
hasNext = !!token;
56+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
5657
}
5758
// @ts-ignore
5859
return undefined;

clients/client-accessanalyzer/src/pagination/ListArchiveRulesPaginator.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ export async function* paginateListArchiveRules(
5151
throw new Error("Invalid client, expected AccessAnalyzer | AccessAnalyzerClient");
5252
}
5353
yield page;
54+
const prevToken = token;
5455
token = page.nextToken;
55-
hasNext = !!token;
56+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
5657
}
5758
// @ts-ignore
5859
return undefined;

clients/client-accessanalyzer/src/pagination/ListFindingsPaginator.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ export async function* paginateListFindings(
5151
throw new Error("Invalid client, expected AccessAnalyzer | AccessAnalyzerClient");
5252
}
5353
yield page;
54+
const prevToken = token;
5455
token = page.nextToken;
55-
hasNext = !!token;
56+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
5657
}
5758
// @ts-ignore
5859
return undefined;

clients/client-accessanalyzer/src/pagination/ListPolicyGenerationsPaginator.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ export async function* paginateListPolicyGenerations(
5151
throw new Error("Invalid client, expected AccessAnalyzer | AccessAnalyzerClient");
5252
}
5353
yield page;
54+
const prevToken = token;
5455
token = page.nextToken;
55-
hasNext = !!token;
56+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
5657
}
5758
// @ts-ignore
5859
return undefined;

clients/client-accessanalyzer/src/pagination/ValidatePolicyPaginator.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ export async function* paginateValidatePolicy(
5151
throw new Error("Invalid client, expected AccessAnalyzer | AccessAnalyzerClient");
5252
}
5353
yield page;
54+
const prevToken = token;
5455
token = page.nextToken;
55-
hasNext = !!token;
56+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
5657
}
5758
// @ts-ignore
5859
return undefined;

clients/client-acm-pca/src/pagination/ListCertificateAuthoritiesPaginator.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ export async function* paginateListCertificateAuthorities(
5151
throw new Error("Invalid client, expected ACMPCA | ACMPCAClient");
5252
}
5353
yield page;
54+
const prevToken = token;
5455
token = page.NextToken;
55-
hasNext = !!token;
56+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
5657
}
5758
// @ts-ignore
5859
return undefined;

clients/client-acm-pca/src/pagination/ListPermissionsPaginator.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ export async function* paginateListPermissions(
5151
throw new Error("Invalid client, expected ACMPCA | ACMPCAClient");
5252
}
5353
yield page;
54+
const prevToken = token;
5455
token = page.NextToken;
55-
hasNext = !!token;
56+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
5657
}
5758
// @ts-ignore
5859
return undefined;

clients/client-acm-pca/src/pagination/ListTagsPaginator.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ export async function* paginateListTags(
4747
throw new Error("Invalid client, expected ACMPCA | ACMPCAClient");
4848
}
4949
yield page;
50+
const prevToken = token;
5051
token = page.NextToken;
51-
hasNext = !!token;
52+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
5253
}
5354
// @ts-ignore
5455
return undefined;

clients/client-acm/src/pagination/ListCertificatesPaginator.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ export async function* paginateListCertificates(
5151
throw new Error("Invalid client, expected ACM | ACMClient");
5252
}
5353
yield page;
54+
const prevToken = token;
5455
token = page.NextToken;
55-
hasNext = !!token;
56+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
5657
}
5758
// @ts-ignore
5859
return undefined;

clients/client-alexa-for-business/src/pagination/ListBusinessReportSchedulesPaginator.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ export async function* paginateListBusinessReportSchedules(
5151
throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient");
5252
}
5353
yield page;
54+
const prevToken = token;
5455
token = page.NextToken;
55-
hasNext = !!token;
56+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
5657
}
5758
// @ts-ignore
5859
return undefined;

clients/client-alexa-for-business/src/pagination/ListConferenceProvidersPaginator.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ export async function* paginateListConferenceProviders(
5151
throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient");
5252
}
5353
yield page;
54+
const prevToken = token;
5455
token = page.NextToken;
55-
hasNext = !!token;
56+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
5657
}
5758
// @ts-ignore
5859
return undefined;

clients/client-alexa-for-business/src/pagination/ListDeviceEventsPaginator.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ export async function* paginateListDeviceEvents(
5151
throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient");
5252
}
5353
yield page;
54+
const prevToken = token;
5455
token = page.NextToken;
55-
hasNext = !!token;
56+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
5657
}
5758
// @ts-ignore
5859
return undefined;

clients/client-alexa-for-business/src/pagination/ListGatewayGroupsPaginator.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ export async function* paginateListGatewayGroups(
5151
throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient");
5252
}
5353
yield page;
54+
const prevToken = token;
5455
token = page.NextToken;
55-
hasNext = !!token;
56+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
5657
}
5758
// @ts-ignore
5859
return undefined;

clients/client-alexa-for-business/src/pagination/ListGatewaysPaginator.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ export async function* paginateListGateways(
5151
throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient");
5252
}
5353
yield page;
54+
const prevToken = token;
5455
token = page.NextToken;
55-
hasNext = !!token;
56+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
5657
}
5758
// @ts-ignore
5859
return undefined;

clients/client-alexa-for-business/src/pagination/ListSkillsPaginator.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ export async function* paginateListSkills(
4747
throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient");
4848
}
4949
yield page;
50+
const prevToken = token;
5051
token = page.NextToken;
51-
hasNext = !!token;
52+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
5253
}
5354
// @ts-ignore
5455
return undefined;

clients/client-alexa-for-business/src/pagination/ListSkillsStoreCategoriesPaginator.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ export async function* paginateListSkillsStoreCategories(
5151
throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient");
5252
}
5353
yield page;
54+
const prevToken = token;
5455
token = page.NextToken;
55-
hasNext = !!token;
56+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
5657
}
5758
// @ts-ignore
5859
return undefined;

clients/client-alexa-for-business/src/pagination/ListSkillsStoreSkillsByCategoryPaginator.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ export async function* paginateListSkillsStoreSkillsByCategory(
5151
throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient");
5252
}
5353
yield page;
54+
const prevToken = token;
5455
token = page.NextToken;
55-
hasNext = !!token;
56+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
5657
}
5758
// @ts-ignore
5859
return undefined;

clients/client-alexa-for-business/src/pagination/ListSmartHomeAppliancesPaginator.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ export async function* paginateListSmartHomeAppliances(
5151
throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient");
5252
}
5353
yield page;
54+
const prevToken = token;
5455
token = page.NextToken;
55-
hasNext = !!token;
56+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
5657
}
5758
// @ts-ignore
5859
return undefined;

clients/client-alexa-for-business/src/pagination/ListTagsPaginator.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ export async function* paginateListTags(
4747
throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient");
4848
}
4949
yield page;
50+
const prevToken = token;
5051
token = page.NextToken;
51-
hasNext = !!token;
52+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
5253
}
5354
// @ts-ignore
5455
return undefined;

clients/client-alexa-for-business/src/pagination/SearchAddressBooksPaginator.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ export async function* paginateSearchAddressBooks(
5151
throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient");
5252
}
5353
yield page;
54+
const prevToken = token;
5455
token = page.NextToken;
55-
hasNext = !!token;
56+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
5657
}
5758
// @ts-ignore
5859
return undefined;

clients/client-alexa-for-business/src/pagination/SearchContactsPaginator.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ export async function* paginateSearchContacts(
5151
throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient");
5252
}
5353
yield page;
54+
const prevToken = token;
5455
token = page.NextToken;
55-
hasNext = !!token;
56+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
5657
}
5758
// @ts-ignore
5859
return undefined;

clients/client-alexa-for-business/src/pagination/SearchDevicesPaginator.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ export async function* paginateSearchDevices(
5151
throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient");
5252
}
5353
yield page;
54+
const prevToken = token;
5455
token = page.NextToken;
55-
hasNext = !!token;
56+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
5657
}
5758
// @ts-ignore
5859
return undefined;

clients/client-alexa-for-business/src/pagination/SearchNetworkProfilesPaginator.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ export async function* paginateSearchNetworkProfiles(
5151
throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient");
5252
}
5353
yield page;
54+
const prevToken = token;
5455
token = page.NextToken;
55-
hasNext = !!token;
56+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
5657
}
5758
// @ts-ignore
5859
return undefined;

clients/client-alexa-for-business/src/pagination/SearchProfilesPaginator.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ export async function* paginateSearchProfiles(
5151
throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient");
5252
}
5353
yield page;
54+
const prevToken = token;
5455
token = page.NextToken;
55-
hasNext = !!token;
56+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
5657
}
5758
// @ts-ignore
5859
return undefined;

clients/client-alexa-for-business/src/pagination/SearchRoomsPaginator.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ export async function* paginateSearchRooms(
4747
throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient");
4848
}
4949
yield page;
50+
const prevToken = token;
5051
token = page.NextToken;
51-
hasNext = !!token;
52+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
5253
}
5354
// @ts-ignore
5455
return undefined;

clients/client-alexa-for-business/src/pagination/SearchSkillGroupsPaginator.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ export async function* paginateSearchSkillGroups(
5151
throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient");
5252
}
5353
yield page;
54+
const prevToken = token;
5455
token = page.NextToken;
55-
hasNext = !!token;
56+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
5657
}
5758
// @ts-ignore
5859
return undefined;

clients/client-alexa-for-business/src/pagination/SearchUsersPaginator.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ export async function* paginateSearchUsers(
4747
throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient");
4848
}
4949
yield page;
50+
const prevToken = token;
5051
token = page.NextToken;
51-
hasNext = !!token;
52+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
5253
}
5354
// @ts-ignore
5455
return undefined;

clients/client-amp/src/pagination/ListRuleGroupsNamespacesPaginator.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ export async function* paginateListRuleGroupsNamespaces(
5151
throw new Error("Invalid client, expected Amp | AmpClient");
5252
}
5353
yield page;
54+
const prevToken = token;
5455
token = page.nextToken;
55-
hasNext = !!token;
56+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
5657
}
5758
// @ts-ignore
5859
return undefined;

clients/client-amp/src/pagination/ListWorkspacesPaginator.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ export async function* paginateListWorkspaces(
5151
throw new Error("Invalid client, expected Amp | AmpClient");
5252
}
5353
yield page;
54+
const prevToken = token;
5455
token = page.nextToken;
55-
hasNext = !!token;
56+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
5657
}
5758
// @ts-ignore
5859
return undefined;

clients/client-amplifyuibuilder/src/pagination/ExportComponentsPaginator.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ export async function* paginateExportComponents(
5050
throw new Error("Invalid client, expected AmplifyUIBuilder | AmplifyUIBuilderClient");
5151
}
5252
yield page;
53+
const prevToken = token;
5354
token = page.nextToken;
54-
hasNext = !!token;
55+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
5556
}
5657
// @ts-ignore
5758
return undefined;

clients/client-amplifyuibuilder/src/pagination/ExportThemesPaginator.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ export async function* paginateExportThemes(
5050
throw new Error("Invalid client, expected AmplifyUIBuilder | AmplifyUIBuilderClient");
5151
}
5252
yield page;
53+
const prevToken = token;
5354
token = page.nextToken;
54-
hasNext = !!token;
55+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
5556
}
5657
// @ts-ignore
5758
return undefined;

clients/client-amplifyuibuilder/src/pagination/ListComponentsPaginator.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ export async function* paginateListComponents(
5151
throw new Error("Invalid client, expected AmplifyUIBuilder | AmplifyUIBuilderClient");
5252
}
5353
yield page;
54+
const prevToken = token;
5455
token = page.nextToken;
55-
hasNext = !!token;
56+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
5657
}
5758
// @ts-ignore
5859
return undefined;

clients/client-amplifyuibuilder/src/pagination/ListThemesPaginator.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ export async function* paginateListThemes(
4747
throw new Error("Invalid client, expected AmplifyUIBuilder | AmplifyUIBuilderClient");
4848
}
4949
yield page;
50+
const prevToken = token;
5051
token = page.nextToken;
51-
hasNext = !!token;
52+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
5253
}
5354
// @ts-ignore
5455
return undefined;

0 commit comments

Comments
 (0)