Skip to content

feat(types): add pagination stopOnSameToken option #3524

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 25, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ export async function* paginateListAccessPreviewFindings(
throw new Error("Invalid client, expected AccessAnalyzer | AccessAnalyzerClient");
}
yield page;
const prevToken = token;
token = page.nextToken;
hasNext = !!token;
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
}
// @ts-ignore
return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ export async function* paginateListAccessPreviews(
throw new Error("Invalid client, expected AccessAnalyzer | AccessAnalyzerClient");
}
yield page;
const prevToken = token;
token = page.nextToken;
hasNext = !!token;
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
}
// @ts-ignore
return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ export async function* paginateListAnalyzedResources(
throw new Error("Invalid client, expected AccessAnalyzer | AccessAnalyzerClient");
}
yield page;
const prevToken = token;
token = page.nextToken;
hasNext = !!token;
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
}
// @ts-ignore
return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ export async function* paginateListAnalyzers(
throw new Error("Invalid client, expected AccessAnalyzer | AccessAnalyzerClient");
}
yield page;
const prevToken = token;
token = page.nextToken;
hasNext = !!token;
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
}
// @ts-ignore
return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ export async function* paginateListArchiveRules(
throw new Error("Invalid client, expected AccessAnalyzer | AccessAnalyzerClient");
}
yield page;
const prevToken = token;
token = page.nextToken;
hasNext = !!token;
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
}
// @ts-ignore
return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ export async function* paginateListFindings(
throw new Error("Invalid client, expected AccessAnalyzer | AccessAnalyzerClient");
}
yield page;
const prevToken = token;
token = page.nextToken;
hasNext = !!token;
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
}
// @ts-ignore
return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ export async function* paginateListPolicyGenerations(
throw new Error("Invalid client, expected AccessAnalyzer | AccessAnalyzerClient");
}
yield page;
const prevToken = token;
token = page.nextToken;
hasNext = !!token;
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
}
// @ts-ignore
return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ export async function* paginateValidatePolicy(
throw new Error("Invalid client, expected AccessAnalyzer | AccessAnalyzerClient");
}
yield page;
const prevToken = token;
token = page.nextToken;
hasNext = !!token;
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
}
// @ts-ignore
return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ export async function* paginateListCertificateAuthorities(
throw new Error("Invalid client, expected ACMPCA | ACMPCAClient");
}
yield page;
const prevToken = token;
token = page.NextToken;
hasNext = !!token;
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
}
// @ts-ignore
return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ export async function* paginateListPermissions(
throw new Error("Invalid client, expected ACMPCA | ACMPCAClient");
}
yield page;
const prevToken = token;
token = page.NextToken;
hasNext = !!token;
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
}
// @ts-ignore
return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ export async function* paginateListTags(
throw new Error("Invalid client, expected ACMPCA | ACMPCAClient");
}
yield page;
const prevToken = token;
token = page.NextToken;
hasNext = !!token;
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
}
// @ts-ignore
return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ export async function* paginateListCertificates(
throw new Error("Invalid client, expected ACM | ACMClient");
}
yield page;
const prevToken = token;
token = page.NextToken;
hasNext = !!token;
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
}
// @ts-ignore
return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ export async function* paginateListBusinessReportSchedules(
throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient");
}
yield page;
const prevToken = token;
token = page.NextToken;
hasNext = !!token;
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
}
// @ts-ignore
return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ export async function* paginateListConferenceProviders(
throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient");
}
yield page;
const prevToken = token;
token = page.NextToken;
hasNext = !!token;
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
}
// @ts-ignore
return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ export async function* paginateListDeviceEvents(
throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient");
}
yield page;
const prevToken = token;
token = page.NextToken;
hasNext = !!token;
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
}
// @ts-ignore
return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ export async function* paginateListGatewayGroups(
throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient");
}
yield page;
const prevToken = token;
token = page.NextToken;
hasNext = !!token;
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
}
// @ts-ignore
return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ export async function* paginateListGateways(
throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient");
}
yield page;
const prevToken = token;
token = page.NextToken;
hasNext = !!token;
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
}
// @ts-ignore
return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ export async function* paginateListSkills(
throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient");
}
yield page;
const prevToken = token;
token = page.NextToken;
hasNext = !!token;
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
}
// @ts-ignore
return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ export async function* paginateListSkillsStoreCategories(
throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient");
}
yield page;
const prevToken = token;
token = page.NextToken;
hasNext = !!token;
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
}
// @ts-ignore
return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ export async function* paginateListSkillsStoreSkillsByCategory(
throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient");
}
yield page;
const prevToken = token;
token = page.NextToken;
hasNext = !!token;
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
}
// @ts-ignore
return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ export async function* paginateListSmartHomeAppliances(
throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient");
}
yield page;
const prevToken = token;
token = page.NextToken;
hasNext = !!token;
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
}
// @ts-ignore
return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ export async function* paginateListTags(
throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient");
}
yield page;
const prevToken = token;
token = page.NextToken;
hasNext = !!token;
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
}
// @ts-ignore
return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ export async function* paginateSearchAddressBooks(
throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient");
}
yield page;
const prevToken = token;
token = page.NextToken;
hasNext = !!token;
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
}
// @ts-ignore
return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ export async function* paginateSearchContacts(
throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient");
}
yield page;
const prevToken = token;
token = page.NextToken;
hasNext = !!token;
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
}
// @ts-ignore
return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ export async function* paginateSearchDevices(
throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient");
}
yield page;
const prevToken = token;
token = page.NextToken;
hasNext = !!token;
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
}
// @ts-ignore
return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ export async function* paginateSearchNetworkProfiles(
throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient");
}
yield page;
const prevToken = token;
token = page.NextToken;
hasNext = !!token;
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
}
// @ts-ignore
return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ export async function* paginateSearchProfiles(
throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient");
}
yield page;
const prevToken = token;
token = page.NextToken;
hasNext = !!token;
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
}
// @ts-ignore
return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ export async function* paginateSearchRooms(
throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient");
}
yield page;
const prevToken = token;
token = page.NextToken;
hasNext = !!token;
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
}
// @ts-ignore
return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ export async function* paginateSearchSkillGroups(
throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient");
}
yield page;
const prevToken = token;
token = page.NextToken;
hasNext = !!token;
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
}
// @ts-ignore
return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ export async function* paginateSearchUsers(
throw new Error("Invalid client, expected AlexaForBusiness | AlexaForBusinessClient");
}
yield page;
const prevToken = token;
token = page.NextToken;
hasNext = !!token;
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
}
// @ts-ignore
return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ export async function* paginateListRuleGroupsNamespaces(
throw new Error("Invalid client, expected Amp | AmpClient");
}
yield page;
const prevToken = token;
token = page.nextToken;
hasNext = !!token;
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
}
// @ts-ignore
return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ export async function* paginateListWorkspaces(
throw new Error("Invalid client, expected Amp | AmpClient");
}
yield page;
const prevToken = token;
token = page.nextToken;
hasNext = !!token;
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
}
// @ts-ignore
return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ export async function* paginateExportComponents(
throw new Error("Invalid client, expected AmplifyUIBuilder | AmplifyUIBuilderClient");
}
yield page;
const prevToken = token;
token = page.nextToken;
hasNext = !!token;
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
}
// @ts-ignore
return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ export async function* paginateExportThemes(
throw new Error("Invalid client, expected AmplifyUIBuilder | AmplifyUIBuilderClient");
}
yield page;
const prevToken = token;
token = page.nextToken;
hasNext = !!token;
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
}
// @ts-ignore
return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ export async function* paginateListComponents(
throw new Error("Invalid client, expected AmplifyUIBuilder | AmplifyUIBuilderClient");
}
yield page;
const prevToken = token;
token = page.nextToken;
hasNext = !!token;
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
}
// @ts-ignore
return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ export async function* paginateListThemes(
throw new Error("Invalid client, expected AmplifyUIBuilder | AmplifyUIBuilderClient");
}
yield page;
const prevToken = token;
token = page.nextToken;
hasNext = !!token;
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
}
// @ts-ignore
return undefined;
Expand Down
Loading